Skip to content

v4.0.0-alpha.3

Pre-release
Pre-release
Compare
Choose a tag to compare
@ascjones ascjones released this 21 Sep 12:11
· 658 commits to master since this release
c2c0a9f

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 individual ink_* crate dependencies with the ink 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_envink::env.

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 with Mapping::default() instead of ink_lang::utils::initialize_contract in
    constructors. See erc20 and other examples which use a Mapping.
  • Remove SpreadAllocate, SpreadLayout and PackedLayout 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 of sha256 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