v4.0.0-alpha.3
Pre-release
Pre-release
·
658 commits
to master
since this release
4.0.0-alpha.2 was skipped because of an error in the release process
Breaking Changes
New ink
crate
The ink_lang
crate has been replaced in #1223 by a new top level ink
crate. All existing sub-crates are reexported and should be used via the new ink
crate, so e.g. ink::env
instead of
ink_env
. Contract authors should now import the top level ink
crate instead of the individual crates.
Migration
- In
Cargo.toml
Replace all individualink_*
crate dependencies with theink
crate. - In the contract source:
- Remove the commonly used
use ink_lang as ink
idiom. - Replace all usages of individual crates with reexports, e.g.
ink_env
➜ink::env
.
- Remove the commonly used
Storage Rework
#1331 changes the way ink!
works with contract storage. Storage keys
are generated at compile-time, and user facing abstractions which determine how contract data is laid out in storage
have changed.
Migration
- Initialize
Mapping
fields withMapping::default()
instead ofink_lang::utils::initialize_contract
in
constructors. Seeerc20
and other examples which use aMapping
. - Remove
SpreadAllocate
,SpreadLayout
andPackedLayout
implementations.
Removal of wee-alloc
support
ink! uses a bump allocator by default, additionally we supported another allocator (wee-alloc
)
through a feature flag. wee-alloc
is no longer maintained and we removed support for it.
Changed
- Introduce
ink
entrance crate ‒ #1223 - Use
XXH32
instead ofsha256
for calculating storage keys ‒ #1393
Fixed
- Trim single whitespace prefix in the metadata
docs
field ‒ #1385 - Allow pay_with_call to take multiple arguments ‒ #1401
Added
- Add
ink_env::pay_with_call!
helper macro for off-chain emulation of sending payments with contract message calls ‒ #1379
Removed
- Remove
wee-alloc
‒ #1403