New Major Release for SmartPy, February 2021
Happy New Year — Year of the Ox!
SmartPy is an intuitive and powerful smart contract development platform for Tezos.
We are delighted to announce a new release containing many improvements including one breaking change in the compilation interface for the CLI.
Please test and send feedback!
New compilation interface and targets
Breaking change in the CLI
Instead of building explicitly SmartPy contracts in the command line with
SmartPy.sh compile <script.py> <class-call> <output-directory>
We are switching to a simplified command
SmartPy.sh compile <script.py> <output-directory>
and the class-call
is registered inside the file script.py
with
sp.add_compilation_target(name, contract, storage=None)
One example
In practice, this is done like that:
Inside a file called script.py
import smartpy as spclass MyContract(sp.contract):
...# A contract with an empty (unit) storage
sp.add_compilation_target("min_comp", MyContract())# A contract with a simple int storage
sp.add_compilation_target("min_comp_int", MyContract(x = 1))
And we can typically compile this contract by doing:
~/smartpy-cli/SmartPy.sh compile script.py output_dir
Immediate benefits of the change
- Simpler interface in the command line (no
class-call
anymore). - Several contracts can be compiled at a given time with nice hierarchical outputs and great performance.
- Setting an optional initial storage is possible.
- This change uses our architecture of scenarios which were previously only used for tests which means that we profit from them for compilation as well. It also brings consistency between testing and compilation targets.
We will talk again about this in the future with new uses of scenarios.
New outputs in scenarios: tests and compilation targets
New files
We now output more files in more formats: contracts, storage, types, sizes.
Experimental html output
Because of popular demand in our telegram group https://t.me/SmartPy_io, we added an experimental --html
argument in the CLI. When ON, it computes the output panel and creates a log.html file.
New Origination Page in SmartPy.io
SmartPy.io provides an IDE along with a set of tools to originate, explore and study smart contracts on Tezos. One of this tool is the Origination Page that is accessible from the Output Panel in the IDE by clicking on Deploy Smart Contrac
t.
This origination page has been redesigned from scratch. Important elements are:
- A brand new beautiful react interface.
- A better Wallet integration with support for Ledger, Faucet, private test keys, Beacon and Thanos.
- Computation of gas, storage size and proposed fees.
- Storage and code Edition.
- Links with the SmartPy Michelson Editor.
- Sharing.
New elements for EDO
As already announced, we support most elements of the Edo update in the SmartPy language. We will talk again about it.