Tuesday, February 7, 2023
API
Protocol
WASM
Tooling

Release: sc - 0.39, vm - 0.1.5

Important

Because of the many changes, upgrading to this new version takes a lot of work to do by hand. Fortunately, this will not be necessary, for we have created an automated contract upgrade tool. The tool will do all the renames and will move some files around.

To perform the update, call the following (where you keep the contracts). It can handle multiple contracts at once and will discover them automatically.

	
cargo install multiversx-sc-meta
sc-meta upgrade
	

It should be able to the migration entirely without assistance, but do let us know if you encounter problems. It did manage to upgrade all the DEX contracts by itself.

A note on notation

From here on, releases will be notated using the short names of crates, since they have become quite many. To quote from the changelog:

	
The `mx-sdk-rs` repo contains many crates, grouped into several families. Crates in these families always have the same version with one another.

For brevity, the changelog will only mention a short version of their name.

They are:
- `multiversx-sc`, in short `sc`, the smart contract framework, 6 crates + 3 for contracts/modules:
    - `multiversx-sc`
    - `multiversx-sc-derive`
    - `multiversx-sc-meta`
    - `multiversx-sc-scenario`
    - `multiversx-sc-snippets`
    - `multiversx-sc-wasm-adapter`
    - `multiversx-sc-modules` - *standard contract modules*
    - `multiversx-price-aggregator-sc` - *core contract*
    - `multiversx-wegld-swap-sc` - *core contract*
- `multiversx-sc-codec`, in short `codec`, the serializer/deserializer, 2 crates:
    - `multiversx-sc-codec`
    - `multiversx-sc-codec-derive`
- `multiversx-chain-vm`, in short `vm`, a Rust VM implementation, 1 crate.
- `multiversx-chain-scenario-format`, in short `scenario-format`, scenario JSON serializer/deserializer, 1 crate.
- `multiversx-sdk`, in short `sdk`, allows communication with the chain(s), 1 crate.

	

For instance in this release, the first 9 crates all get version 0.39, the 2 codec crates 0.17, etc.

All crates renamed and reorganized

Crates were renamed as follows:

  • elrond-codecmultiversx-sc-codec
  • elrond-codec-derivemultiversx-sc-codec-derive
  • elrond-wasmmultiversx-sc
  • elrond-wasm-derivemultiversx-sc-derive
  • elrond-wasm-nodemultiversx-sc-wasm-adapter
  • elrond-wasm-interactor-snippetsmultiversx-sc-snippets
  • mandosmultiversx-chain-scenario-format
  • elrond-wasm-modulesmultiversx-sc-modules

Crate elron-wasm-output was completely removed. Its logic is now injected directly into the individual contract wasm crates, via several macros.

Crate elrond-wasm-debug was split into several crates:

  • multiversx-sc-meta handles ABIs, contract builds, snippet generation, and is also a standalone tool that can be installed via cargo install .
  • multiversx-sc-scenario is the base of all contract tests. The ScenarioWorld object is the facade for running both programatic and JSON scenario tests.
  • multiversx-chain-vm is aiming to become replica of the VM written in Go. It currently still contains some leftover mandos code, but this will all be refactored in the next release. The contracts should not be aware of the existence of this crate.

There is a completely new crate: multiversx-sdk. This is a tool for interacting with the blockchain. It is used by multiversx-sc-snippets to interact with the blockchain. It is still only a prototype, but more development is coming to it soon.

Also made some re-exports more concise:

  • elrond-wasm::elrond_codec is now simply multiversx_sc::codec
  • elrond_codec::elrond_codec_derive is now simply multiversx_sc_codec::derive

The meta crate

There is a full documentation of the current features available at https://docs.multiversx.com/developers/developer-reference/sc-meta

In short, it is two tools in one:

  • the old contract ABI & build tool
  • a standalone tool that can upgrade contracts, etc.

The scenario testing facade

The ScenarioWorld object is supposed to become the unique facade required to write scenarios and either test them locally (the former “Mandos” scenario tests), or use them to interact with a blockchain.

The Rust SDK crate

As mentioned above, the multiversx-sdk is able to interact with the blockchain: query contracts, sign transactions, get network statistics, etc.

It was originally started by the community, now it is an official tool. There are examples of everything that it can currently do: https://github.com/multiversx/mx-sdk-rs/tree/master/sdk/core/examples.

Twiggy post-processing

Twiggy is a very handy tool for analyzing smart contract size and hunting down bloat. We have been using it for years. Read more about it here:

It is now extremely easy to generate twiggy reports for contracts.

ManagedVec supports sorting and deduplication

A long awaited feature, there are sort and deduplicate methods available now for ManagedVec.

migrateUserName builtin function mock

A new builtin function being now under development is now available in the framework.



Github Release Link:

Feel free to send us feedback or open a topic in our Github Discussions tab and share your thoughts so that the entire MultiversX community can hear you. If you have a great idea, share it with us and let's make it happen by implementing and integrating it in our ecosystem.

Stay Hungry! Stay Foolish!

Do you need more information?

Explore projects, tokens, and integrations built on MultiversX