api icon indicating copy to clipboard operation
api copied to clipboard

api-contracts: Support ink! v6 and pallet-revive

Open AlexD10S opened this issue 7 months ago • 1 comments

The upcoming release of ink! v6 (currently available as an alpha for early developers) introduces significant changes, including a migration from pallet-contracts (Wasm-based) to pallet-revive (RISC-V based).

Currently, the api-contracts package only supports interaction with pallet-contracts. To support ink! v6, it will need to be updated to interact with pallet-revive, which also introduces a change in the contract address format (AccountId20).

We’ve started experimenting with the changes internally to get a feel for how things might look.: https://github.com/use-ink/polkadot-js-api/pull/1/files

The main differences involve switching the pallet interaction from pallet-contracts to pallet-revive, and adjusting to the new contract address format (AccountId20).

These changes would make the updated code compatible only with ink! v6, and not with ink! v5 (which depends on pallet-contracts).

Happy to collaborate and help with the implementation but I’d love to hear your thoughts on the best approach moving forward:

  • Should we update the existing api-contracts to support only ink! v6 (pallet-revive), dropping support for pallet-contracts?

  • Should we introduce a new package (e.g., api-revive) that mirrors api-contracts but is tailored specifically for ink! v6?

  • Alternatively, should we add new components for pallet-revive within the same library. For example creating a CodePromiseRevive (similar to CodePromise)?

AlexD10S avatar May 19 '25 14:05 AlexD10S

Hi @AlexD10S thank you for the initiative, I'd say that ideally we want to keep this backwards compatible so I'd go for alternative 3. Add new code to the contracts package.

Additionally we don't want to mess too much with the interface that is exposed to the developer, that should be abstracted as much as possible, meaning that for example instead of creating a CodePromiseRevive the current CodePromise should be able to handle both cases depending on the version of ink!.

valentinfernandez1 avatar May 27 '25 15:05 valentinfernandez1

Completed with https://github.com/polkadot-js/api/pull/6158

AlexD10S avatar Jul 08 '25 19:07 AlexD10S

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

polkadot-js-bot avatar Jul 15 '25 22:07 polkadot-js-bot