Skip to content

Releases: use-ink/ink

v5.0.0-rc

05 Dec 12:43
d969617
Compare
Choose a tag to compare
v5.0.0-rc Pre-release
Pre-release

This is a release candidate for ink! 5.0. Notable changes include:

  • Support for multiple chain extensions - #1958. This is a breaking change. Developers need to update their code utilising new API.
  • Lazy StorageVec structure that allows access vector data efficiently - #1995
  • E2E framework introduced a new builder API to simplify the call building - #1917

Added

  • Allow mutable parameters in messages - #2004
  • [E2E] Allow testing with live-chain state - #1949
  • [E2E] Call builders and extra gas margin option - #1917
  • Linter: storage_never_freed lint - #1932
  • Linter: strict_balance_equality lint - #1914
  • Linter: no_main lint - #2001
  • Clean E2E configuration parsing - #1922
  • Make set_code_hash generic - #1906
  • Provide a StorageVec datastructure built on top of Lazy - #1995

Changed

  • Messages return TypeSpec directly - #1999
  • Fail when decoding from storage and not all bytes consumed - #1897
  • [E2E] resolve DispatchError error details for dry-runs - #1944
  • [E2E] update to new drink API - #2005
  • Support multiple chain extensions - #1958
    • New example of how to use multiple chain extensions in one contract.
    • Affects the usage of the #[ink::chain_extension] macro and the definition of the chain extension.

v5.0.0-alpha

09 Sep 21:43
09f5fba
Compare
Choose a tag to compare
v5.0.0-alpha Pre-release
Pre-release

The preview release of the ink! 5.0.0 release.
This release addresses the majority of issues raised in the OpenZeppelin audit
in particular, we addressed the proxy selector clashing attack.
As of this release, ink! only allows exactly one other message with a well-known reserved selector to be defined.
You can read more about the change in the PR

There are also other notable changes:

  • Rework of event definitions - #1827.
  • Updated upgradeable contract example illustrating delegate_call
  • Removal of unchecked arithmetic. cargo-contract will fail compiling the contract with raw arithmetic operations.
  • Introduction of an alternative off-chain E2E testing backend, drink!
    Big thanks to @pmikolajczyk41 for this massive contribution!

You can see a more detailed log of changes below:

Added

  • [Drink backend]: allow for arbitrary runtime - #1892
  • [Drink backend]: support runtime call - #1891
  • Reexport scale dependencies, introduce #[ink::scale_derive] - #1890
  • Upgradeable contracts example - #1889
  • Persist static buffer size in metadata - #1880
  • Modify static buffer size via environmental variables - #1869
  • [Drink backend]: Make tests generic E2EBackend trait - #1867
  • [Drink backend]: Backend choice β€’ #1864
  • [Drink backend]: Backend traits - #1857
  • [Drink backend]: Abstract error and result structs - #1844
  • Added sr25519_verify function to ink_env #1840
  • Warn when primitive number is annotated as event topic - #1837
  • Events 2.0 - #1827
  • Add set_block_number to off-chain test api Engine - #1806
  • Stabilize call_runtime β€’ #1749
  • Schema generation - #1765
  • Restrict wildcard selectors to have exactly one other message - #1708

Changed

  • Reexport scale dependencies, introduce #[ink::scale_derive] β€’ #1890
  • [ink_e2e] build contracts at runtime instead of during codegen - #1881
  • Use of workspace dependencies and properties - #1835
  • Remove of unchecked arithmetic - #1831
  • E2E crate refactoring - #1830
  • Use `decode_all`` for decoding cross contract call result - #1810
  • E2E: improve call API, remove build_message + callback - #1782

v4.3.0

24 Aug 08:28
71c817c
Compare
Choose a tag to compare

Version 4.3.0

This release is to fix compatibility of ink_e2e with newer (> 1.69) versions of Rust,
which produce signext instructions, and older versions of pallet_contracts which do
not yet support these instructions.

  • Backport use of contract-build to 3.2.0 to include signext lowering, and update
    subxt to remove incompatible wasmi-instrument transient dependency β€’ #1884

v4.2.1

14 Jun 19:50
v4.2.1
1b2e7cf
Compare
Choose a tag to compare

Version 4.2.1

This release contains a low-severity security related fix. Users of the 4.x series of releases are advised to update.

Note that this release contains a breaking change since the API of ink_env::invoke_contract_delegate and CallBuilder::try_invoke now return an extra ink_primitives::MessageResult which must be handled.

We decided to release this breaking change as a PATCH release to ensure that affected users are upgrading to the fixed API.

See the published advisory for more info.

Fixed

  • Handle LangError from DelegateCall

v4.2.0

20 Apr 08:23
v4.2.0
55088cc
Compare
Choose a tag to compare

ink!-4 2 0

Added

  • Persist Environment in metadata β€’ #1741
  • Added possibility for runtime_call in E2E tests β€’ #1736
  • Added default attribute to constructors and messages β€’ #1724
  • Added clarification about Mapping::size unit β€’ #1735

Changed

  • Upgraded syn to version 2 β€’ #1731
  • Update scale-info requirement to 2.5 β€’ #1733
  • Bump subxt to 0.28.0 β€’ #1750

v4.1.0

23 Mar 17:59
d068d18
Compare
Choose a tag to compare

Added

  • Basic support for dyn Trait to allow cross-contract calls only with trait - #1673
  • E2E: auto detect contracts to be built - #1691
  • Add set_code_hash to EnvAccess - #1698
  • Add set_block_timestamp to off-chain test api Engine - #1721

Changed

  • Support conditional compilation - #1707

v4.0.1

27 Feb 16:17
0af00f7
Compare
Choose a tag to compare

Version 4.0.1

Fixed

  • Fixing ManualKey<0> to act properly - #1670
  • Indicated latest release of cargo-contract in e2e crate

v4.0.0

15 Feb 16:42
ad4f5e5
Compare
Choose a tag to compare

Version 4.0.0

The latest stable release of ink! is here πŸ₯³

This version brings a lot of usability improvements, making the language better suited for the needs of production parachains.

A couple of highlights include:

  • Changes to how contract storage works, which significantly reduced the sizes of
    contract binaries
  • A new end-to-end testing framework, letting you easily write integration tests
  • Changes to the metadata format, which (in part) makes error handling more expressive

There's a lot more to dig through, so take some time to poke around the CHANGELOG (including the 4.0.0-alpha and 4.0.0-beta releases).

You may notice there have been a few breaking changes. No need to be scared though, we wrote up a migration guide covering all of the breaking changes and how to update your ink! 3.x contract accordingly.

Thanks to everyone that helped make this release possible ❀️

Compatibility

In order to build contracts which use ink! v4.0.0 you need to use cargo-contract v2.0.0. You can install it as follows:

cargo install cargo-contract --forced --locked

You will also need to use a version of pallet-contracts later than polkadot-v0.9.37 in your node.

The v0.24.0 release of the substrate-contracts-node is compatible with the ink! 4.0.0 release.

For full compatibility requirements see the migration guide.

Added

  • Add Mapping::contains(key) and Mapping::insert_return_size(key, val) β€’ #1224
  • Add payment-channel example β€’ #1248 (thanks @kanishkatn!)
  • Add version field to ink! metadata β€’ #1313
  • The rand-extension example has been adapted to an updated version of the ChainExtension API β€’ #1356
  • Add ink_env::pay_with_call! helper macro for off-chain emulation of sending payments with contract message calls β€’ #1379
  • Allow using Result<Self, Error> as a return type in constructors β€’ #1446
  • Add Mapping::take() function allowing to get a value removing it from storage β€’ #1461
  • Add E2E testing framework MVP β€’ #1395
  • Add E2E tests for Mapping functions - #1492
  • E2E: expose call dry-run method β€’ #1624
  • Make cross-contract callee non-optional β€’ #1636
  • Support custom environment in E2E tests - #1645 (thanks @pmikolajczyk41!)

Changed

  • Contract size optimization in case contract doesn't accept payment β€’ #1267 (thanks @xgreenx!)
  • Move ink! linter into ink repository β€’ #1361
  • Introduce ink entrance crate β€’ #1223
  • Use XXH32 instead of sha256 for calculating storage keys β€’ #1393
  • Storage Refactoring β€’ #1331
  • Add support for language level errors (LangError) β€’ #1450
  • Return LangErrors from constructors β€’ #1504
  • Update scale-info requirement to 2.3 β€’ #1467
  • Merge Mapping::insert(key, val) and Mapping::insert_return_size(key, val) into one method - #1463
  • FFI: no more __unstable__ wasm import module β€’ #1522
  • Clean up CallBuilder return() type β€’ #1525
  • Fix trait message return type metadata β€’ #1531
  • Bump Dylint dependencies β€’ #1551
  • Stabilize take_storage β€’ #1568
  • Chain Extension: Evaluation of method return type at compile time β€’ #1569
  • Make more functions be const β€’ #1574 (thanks @yjhmelody!)
  • Unify fallible and non fallible instantiate methods β€’ #1591
  • Make CallBuilder and CreateBuilder error handling optional β€’ #1602
  • Rename CallBuilder::fire() method to invoke() β€’ #1604
  • chore: add minimum rust version to the ink crate β€’ #1609 (thanks @Kurtsley!)
  • Rename _checked codegen call methods with try_ β€’ #1621
  • Bump Substrate and subxt dependencies β€’ #1549
  • E2E: spawn a separate contracts node instance per test β€’ #1642

Fixed

  • Trim single whitespace prefix in the metadata docs field β€’ #1385
  • Allow pay_with_call to take multiple arguments β€’ #1401
  • Add Determinism enum from pallet-contracts β€’ #1547
  • Added missed WhereClosure for the generics into storage_item β€’ #1536 (thanks @xgreenx!)

Removed

  • Implement ecdsa_to_eth_address() and remove eth_compatibility crate β€’ #1233
  • Remove wee-alloc β€’ #1403
  • Remove ink_env::random function β€’ #1442
  • Remove Default implementation for AccountId β€’ #1255

v4.0.0-rc

01 Feb 20:15
50b32f4
Compare
Choose a tag to compare
v4.0.0-rc Pre-release
Pre-release

The first release candidate is here! This is the first release which could become the final
v4.0.0. Any subsequent release candidates should only contain bug fixes: no API changes,
breaking or otherwise.

Breaking Changes

  1. We've renamed some of the generated message methods on the ContractRef struct. They
    have been changed from _checked to try_ (#1621)
  2. We have removed the Default implementation for AccountIds. This is because of
    security concerns around the use of the zero address which has a known private key in
    the sr25519 and ed25519 curves (#1255).
  3. We have replaced the CallBuilder::callee() method with a call() method and also
    added a delegate() method. This streamlines the Call and DelegateCall workflows
    (#1636)

Added

  • E2E: expose call dry-run method β€’ #1624
  • Make cross-contract callee non-optional β€’ #1636

Changed

  • Rename _checked codegen call methods with try_ β€’ #1621
  • Bump Substrate and subxt dependencies β€’ #1549

Removed

  • Remove Default implementation for AccountId β€’ #1255

v4.0.0-beta.1

25 Jan 11:23
c8aa3ee
Compare
Choose a tag to compare
v4.0.0-beta.1 Pre-release
Pre-release

This supersedes #1590, but RC coming soonβ„’

Version 4.0.0-beta.1

The coolest feature included in this release is the first first published version of
ink!'s native "end-to-end" (E2E) testing framework.

This enables testing of a contract by deploying and calling it on a Substrate node with
pallet-contracts. See the erc20 example for usage.

Breaking Changes

This release includes a couple of breaking changes.

  1. The CallBuilder::returns() method does not require an extra MessageResult anymore
    as the type is now added under the hood (#1525)
  2. The CallBuilder::invoke() and CreateBuilder::instantiate() methods now unwrap the
    Result from pallet-contracts under the hood (#1602)
    If you wish to handle the error use the new try_ variants of those methods instead.
  3. The CallBuilder::fire() method has been renamed to invoke()
    (#1604)
  4. The returns_result flag has been removed from the #[ink(extension = …)] attribute
    (#1569)
    We now infer this information at compile time. If handle_status is set to true,
    the return type will still be wrapped into Result as before.
  5. The Minimum Supported Rust Version (MSRV) has been set to 1.63.0. This was already
    the case, but previously it was enforced by cargo-contract instead of ink!
    (#1609)

Added

  • Add E2E testing framework MVP β€’ #1395
  • Add E2E tests for Mapping functions - #1492

Fixed

  • Add Determinism enum from pallet-contracts β€’ #1547
  • Added missed WhereClosure for the generics into storage_item β€’ #1536 (thanks @xgreenx)

Changed

  • Handle LangError from instantiate β€’ #1512
  • FFI: no more __unstable__ wasm import module β€’ #1522
  • Clean up CallBuilder return() type β€’ #1525
  • Fix trait message return type metadata β€’ #1531
  • Bump Dylint dependencies β€’ #1551
  • Stabilize take_storage β€’ #1568
  • Chain Extension: Evaluation of method return type at compile time β€’ #1569
  • Make more functions be const β€’ #1574 (thanks @yjhmelody)
  • Unify fallible and non fallible instantiate methods β€’ #1591
  • Make CallBuilder and CreateBuilder error handling optional β€’ #1602
  • Rename CallBuilder::fire() method to invoke() β€’ #1604
  • chore: add minimum rust version to the ink crate β€’ #1609 (thanks @Kurtsley)