Skip to content

feat(api-contract): add support for ink! v6 and pallet-revive compatibility #6158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 9, 2025

Conversation

AlexD10S
Copy link
Contributor

@AlexD10S AlexD10S commented May 29, 2025

ink! has released the alpha version of ink! v6, which introduces major changes to how smart contracts are deployed and executed.

The biggest shift is the migration from pallet-contracts + WebAssembly (executed in wasmi) to pallet-revive + RISC-V (executed in PolkaVM).

I previously opened an issue asking for guidance on the best approach. The recommendation was to preserve backwards compatibility while supporting v6 — this PR follows that approach.

How to test it locally

Note: ink! v6 introduces breaking changes. See the migration guide for full details.

Toolchain Setup

For ink! v6
Creating and deploying ink! v6 contracts requires a different version of the CLI tool (whether you use pop-cli or cargo-contracts) than ink! v5.

For ink! v6, install pop-cli with the polkavm-contracts feature enabled:

cargo install pop-cli --no-default-features --locked -F polkavm-contracts,parachain,telemetry

Steps to deploy and interact:

pop new contract
pop build
pop up      # deploy
pop call contract   # interact

See Getting Started with ink! v6 for more.

For ink! v5
Install the CLI without the polkavm-contracts feature:

cargo install --force --locked pop-cli

Then follow the same flow as above.

Node to deploy your contracts

For ink! v5, you can use the substrate-contracts-node, which includes the traditional pallet-contracts runtime. For ink! v6, the recommended node is ink-node, which runs pallet-revive and is RISC-V + PolkaVM based.

If you want to test both versions in the same chain, you can use a local instance of pop-node, or the public testnet RPC endpoint at:

https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc2.paseo.popnetwork.xyz#/explorer

To interact on Pop Network Testnet, you’ll need tokens. You can follow this guide to get some:
Bridge tokens to Pop Network

Project that integrates these changes

I've been working on adapting the Contracts UI to support both ink! v6 and ink! v5 (and earlier) smart contracts. This integration relies on the changes introduced in the api-contract library in this PR.

If you'd like to experiment with it, you can try it out by checking out the related PR use-ink/contracts-ui#571

Copy link
Contributor

@valentinfernandez1 valentinfernandez1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just needs a yarn lint

@valentinfernandez1 valentinfernandez1 merged commit 3ffc196 into polkadot-js:master Jun 9, 2025
4 checks passed
@polkadot-js-bot
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Jun 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants