# Ink! 5.1 release

**URL:** <https://forum.polkadot.network/t/ink-5-1-release/11056>\
**Category:** Ecosystem\
**Tags:** ink\
**Created:** [December 3, 2024, 4:43pm UTC](https://forum.polkadot.network/t/ink-5-1-release/11056 "2024-12-03T16:43:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alejandro](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.polkadot.network/alejandro/32/55_2.png) [@alejandro](https://forum.polkadot.network/u/alejandro)\
**Post date:** [December 3, 2024, 4:43pm UTC](https://forum.polkadot.network/t/ink-5-1-release/11056/1 "2024-12-03T16:43:21Z")

</div>

![ink! 5.1-with-Polkadot-Logo-2400x1200](https://europe1.discourse-cdn.com/flex005/uploads/polkadot2/original/2X/7/7cb9becba3a39a82f3baaa03ddd8bfb3c7e704b9.jpeg)

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](https://github.com/use-ink/ink/releases/tag/v5.1.0)

* * *

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`](https://github.com/use-ink/ink-examples/tree/main/contract-xcm)

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

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

- [`xcm_send`](https://docs.rs/ink_env/5.1.0/ink_env/fn.xcm_send.html)
- [`xcm_execute`](https://docs.rs/ink_env/5.1.0/ink_env/fn.xcm_execute.html)

#### 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](https://github.com/use-ink/ink-examples/tree/main/runtime-call-contract) 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!](https://use.ink/basics/contract-testing/drink):

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

```diff
- #[ink_e2e::test(backend(runtime_only(sandbox = ink_e2e::MinimalSandbox)))]
+ #[ink_e2e::test(backend(runtime_only(sandbox = ink_e2e::DefaultSandbox)))]

```

```diff
- 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](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.12.0)  
(this release stabilized the `pallet-contracts` XCM functions that ink! uses)
- `substrate-contracts-node`: `>= 0.42.0`
- [DRink!](https://github.com/inkdevhub/drink): `>= 0.18.0`

* * *

❣ _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](https://polkadot.polkassembly.io/referenda/1123)._

---

<div class="post-metadata">

**Author:** ![carloskiron](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.polkadot.network/carloskiron/32/1991_2.png) [@carloskiron](https://forum.polkadot.network/u/carloskiron)\
**Post date:** [December 4, 2024, 12:29am UTC](https://forum.polkadot.network/t/ink-5-1-release/11056/2 "2024-12-04T00:29:24Z")

</div>

This new capabilities are great! Congrats
