Skip to content

v3.1.0

Compare
Choose a tag to compare
@cmichi cmichi released this 18 May 06:17
· 651 commits to master since this release
07be64c

Version 3.1.0

Compatibility

We recommend using a version of the pallet-contracts later than 7d233c2 (May 13, 2022) in your node.

This is the case in the latest release of the substrate-contracts-nodev0.15.1 and the latest Polkadot release v0.9.22.

Breaking Changes

There are two breaking changes in this release:

  • As part of #1235 the message selectors of your contract may change. A change of selectors would affect your client, frontend, Dapp, etc..
  • As part of #1233 we removed the eth_compatibility crate.
    Its recovery functionality has been moved to ink_env now: ink_env::ecdsa_to_eth_address. The reason for this change is that we moved the gas-expensive crypto operations into pallet-contracts.
    The crates to_default_account_id function has been removed; the reason for this change is that ink! doesn't have knowledge about the specific Substrate types on the underlying chain. If you want to retain the function in your contract and are just using standard Substrate types you should add the prior functionality to your contract ‒ it was a simple <Blake2x256 as CryptoHash>::hash(&ecdsa_pubkey[u8; 33]).

New API functions

We added two new Mapping API functions: Mapping::contains and Mapping::insert_return_size#1224. These are more gas-efficient than whatever you were using previously.

Additionaly there are a couple new ink_env functions now:

New Upgradeable Contract Example

We've added a new example: upgradeable-contracts/set-code-hash.

It illustrates how the newly added ink_env::set_code_hash can be used to implement an upgradeable contract that replaces its own code.

Added

Fixed

  • Fix ordering of message ids if the trait is implemented before the inherent section ‒ #1235

Removed

  • Removed eth_compatibility crate and moved its functionality partly into ink_env#1233