v3.1.0
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-node
v0.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 toink_env
now:ink_env::ecdsa_to_eth_address
. The reason for this change is that we moved the gas-expensive crypto operations intopallet-contracts
.
The cratesto_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
- Implement
seal_code_hash
andseal_own_code_hash
‒ #1205 - Add
set_code_hash
function and example ‒ #1203 - Implement
ink_env::ecdsa_to_eth_address
‒ #1233 - Add
Mapping::contains(key)
andMapping::insert_return_size(key, val)
‒ #1224
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 intoink_env
‒ #1233