Ink! 5.1 release

We’re thrilled to announce the first ink! release outside of Parity. ink! has grown into a community-driven project, maintained by the ink! Alliance, ensuring a bright future for our beloved language.

Find the full release notes here


This version of ink! comes with three highlights plus some minor fixes.

XCM Support

ink! 5.1 supports the usage of XCM in contracts, developers are no longer limited to cross-contract calls, but can now execute cross-parachain calls.

We added a contract example that demonstrates the usage: contract-xcm

We also added a new page on our documentation website: https://use.ink/basics/xcm.

You can view the Rust docs of the two functions here:

Call ink! contracts from polkadot-sdk runtimes

ink! 5.1 comes with basic support for calling contracts from a Polkadot runtime. We’ve added this example that demonstrates how to call flipper from a polkadot-sdk runtime pallet.

Calling a contract from the runtime is an interesting application for parachains, as they can put logic into a contract instead of their runtime. Contracts have a number of advantages, as they are easier to upgrade and allow for faster development iteration cycles.

The limitations currently are:

  • Contract calls can only be made to trait messages. This makes sense in the pallet-contracts context, as it is better to depend on a trait rather than a contract impl, since you are working against an interface.
  • Only contract messages can be called currently, no constructors.
  • The API could be nicer.

E2E Testing

We replaced our drink sandbox dependency with an internal ink! crate. In case you use DRink!:

First, you should upgrade your drink dependency to version = "0.18.0". Second, these are the two changes you have to make:

- #[ink_e2e::test(backend(runtime_only(sandbox = ink_e2e::MinimalSandbox)))]
+ #[ink_e2e::test(backend(runtime_only(sandbox = ink_e2e::DefaultSandbox)))]
- ink_e2e = { version = "5", features = ["drink"] }
+ ink_e2e = { version = "5", features = ["sandbox"] }

Compatibility

The compatibility changes a bit to ink! 5.0:

  • Rust: >= 1.81
  • cargo-contract: >= 5.0.0
  • polkadot-sdk: >= v1.12.0
    (this release stabilized the pallet-contracts XCM functions that ink! uses)
  • substrate-contracts-node: >= 0.42.0
  • DRink!: >= 0.18.0

:heavy_heart_exclamation: We want to say a big thank you to our Polkadot community, which recently decided on funding the continued maintenance and development of ink! with a Polkadot Treasury grant.

9 Likes

This new capabilities are great! Congrats

1 Like