Releases: use-ink/cargo-contract
v6.0.0-beta.1
Here's how you can use this release:
cargo install --force --locked --version 6.0.0-beta.1 cargo-contract Compatibility:
- Rust >= 1.88
- ink!
6.0.0-beta.1 ink-nodev0.47.0polkadot-sdkfrompolkadot-sdk/cbab8ed4be1941420dd25dc81102fb79d8e2a7f0(Oct 15, 2025)- Paseo Passet Hub (was upgraded here)
Full Changelog
Fixed
v6.0.0-beta
Version 6.0.0-beta
Here's how you can use this release:
cargo install --force --locked --version 6.0.0-beta cargo-contract Compatibility:
- Rust >= 1.88
- ink!
6.0.0-beta ink-nodev0.46.0polkadot-sdkfrompolkadot-sdk/cbab8ed4be1941420dd25dc81102fb79d8e2a7f0(Oct 15, 2025)- Paseo Passet Hub (was upgraded here)
Full Changelog
Added
- Heuristic to distinguish ink! vs. Solidity contracts on-chain ‒ 2147
- Added more output to
cargo contract info‒ 2148
Changed
- Re-enable
clippy::cast_possible_truncationlint ‒ #2138 - Synchronize with
polkadot-sdk/1b1cef306d9ceebf963fd15a04b5c79ee2618bce‒ 2675 - Synchronize with
polkadot-sdk/cbab8ed4be1941420dd25dc81102fb79d8e2a7f0‒ 2153
Fixed
v6.0.0-alpha.4
Version 6.0.0-alpha.4
Compatibility of this release:
- Rust >= 1.88
- ink!
v6.0.0-alpha.4 ink-nodev0.45.1polkadot-sdkfromuse-ink/polkadot-sdk/a71ec19a94702ea71767ba5ac97603ea6c6305c1
We have to use a slight fork of polkadot-sdk for the moment. It's just polkadot-sdk/master plus two
commits on top with pre-compiles. Those two commits are PRs to polkadot-sdk. but haven't been merged yet.
To install:
cargo install --force --git https://github.com/use-ink/cargo-contract --tag v6.0.0-alpha.4
Changed
v6.0.0-alpha.3
Version 6.0.0-alpha.3
Compatibility of this release:
- Rust >= 1.88
- ink!
v6.0.0-alpha.3 ink-nodev0.45.1polkadot-sdkfromuse-ink/polkadot-sdk/a71ec19a94702ea71767ba5ac97603ea6c6305c1
We have to use a slight fork of polkadot-sdk for the moment. It's just polkadot-sdk/master plus two
commits on top with pre-compiles. Those two commits are PRs to polkadot-sdk. but haven't been merged yet.
To install:
cargo install --force --git https://github.com/use-ink/cargo-contract --tag v6.0.0-alpha.3
Changed
- Upgrade to
subxt0.44‒ 2127 - Synchronized with
polkadot-sdk/c40b36c3a7c208f9a6837b80812473af3d9ba7f7‒ 2102 - Re-enable
rustcoverflow checks - #2116 - chore: Upgrade to Rust edition 2024 - #2125
Removed
v6.0.0-alpha.1
Intermediate alpha release for cargo-contract.
This release is compatible with:
polkadot-sdkcommitcb629d46ebf00aa65624013a61f9c69ebf02b0b4- ink! v6.0.0-alpha.1
ink-nodev0.44.0 (notice there are binary releases linked)- Passet Hub if no newer pull request has been merged than this one
To install this version of cargo-contract:
cargo install --force --git https://github.com/use-ink/cargo-contract --tag v6.0.0-alpha.1
To depend on it:
contract-build = { git = "https://github.com/use-ink/cargo-contract", tag = "v6.0.0-alpha.1" }
v6.0.0-alpha
This is our first alpha release for cargo-contract v6. We release it together
with ink! v6.0.0-alpha.
The biggest change is that we are in the process of migrating from pallet-contracts +
WebAssembly (executed in wasmi) to pallet-revive +
RISC-V (executed in PolkaVM).
This is a major breaking change, cargo-contract will only be compatible with ink! >= v6
and chains that include pallet-revive.
We did a detailed write-up of the background to this development and the reasoning
here.
Compatibility of this release:
- ink!
v6.0.0-alpha substrate-contracts-node/9c020a2polkadot-sdk/f8c90b2a01ec77579bccd21ae17bd6ff2eeffd6a
In the following we'll describe some breaking changes on a high-level. The
context to understand them is that the pallet-revive team has Ethereum/Solidity
support as the number one priority. All their design decisions derive from that,
they don't want to maintain code that is unnecessary for that objective.
Updated structs + function arguments
We had to change a number of structs and function arguments. Some notable ones:
SourceWasm -> SourceContractBytecode
dest_wasm -> dest_polkavm
optimization_result -> linker_size_result
And v5 ExecuteArgs →
v6.0.0-alpha ExecuteArgs.
We won't describe the other ones here. The best course is to see if you encounter
compilation errors upon upgrading to 6.0.0-alpha. If so, please check our Rust
docs or the cargo-contract source code for how the new format looks and what
the comments say.
The commit that applied the majority of naming changes was
this one.
Types
Contract Balance: U256
For the type of a contract's balance, pallet-revive uses depending on the context
- either the configured
pallet_revive::Config::Currencytype (which corresponds
to theink::Environment::Balancetype. - or a hardcoded
U256(which corresponds to what Ethereum uses).
In this alpha release we just adhere to requiring the types thatpallet-reviveuses.
In an upcoming beta release this could be simplified to reduce UX friction by just
using one type everywhere and converting to thepallet-reviveone.
Contract Address: H160
For a contract's account, pallet-revive is using either the configured AccountId type
of the polkadot-sdk runtime, or H160.
Finding the H160 for an AccountId is done via an address derivation scheme derived in
#7662.
After instantiating a contract, the address is no longer returned by pallet-revive.
Instead one has to derive it from given parameters (see the linked PR). cargo-contract
does that automatically.
For contract instantiations and contract calls the pallet requires that a 1-to-1 mapping
of an AccountId to a H160 has been created. This can be done via the map_account/
unmap_account API.
The PR #6096 contains more
information.
Besides the publicly exposed crate functions, we've introduced a new subcommand
cargo contract account that allows resolving the H160 contract address to the
Substrate AccountId which it is mapped to.
Contract Hash: H256
For a contract's hash value, pallet-revive uses a fixed H256, Previously,
the ink::Environment::Hash type referenced the hash type being used for the
contract's hash. Now it's just a fixed H160.
Events
In #7164, Parity removed
most smart-contract-specific events: Called, ContractCodeUpdated, CodeStored,
CodeRemoved, Terminated, Instantiated, DelegateCalled,
StorageDepositTransferredAndHeld, StorageDepositTransferredAndReleased.
The ContractEmitted event (for events a contract emits) is still available.
Debugging
Previously, pallet-contracts returned a debug_message field with contract
instantiations and dry-runs.
Whenever ink::env::debug_println was invoked in a contract, ink! wrote debugging
info to this field. This functionality has been removed. Instead pallet-revive now
supports other means of debugging.
The most relevant for this release is the tracing API. There are a number of PRs
that implemented it, so we won't link a specific one here. A good starting point
to look deeper into it is the tracing.rs.
We have implemented barebones support for this tracing API in the 6.0.0-alpha
versions of ink! + cargo-contract. But it's really barebones and should
certainly be improved before a production release.
Detection of contract language disabled
The heuristic detection of a contract's language in cargo contract info
has been temporarily disabled; it's not yet implemented.
Contract sizes
Contracts compiled with v6.0.0-alpha will have a large file size. This is due to a number
of bugs in PolkaVM that prohibit us from using e.g. LTO. The contract sizes will eventually
get much smaller again, once those bugs are fixed.
Linting
Linting of a contract can be executed by running the lint command:
➜ cargo contract lint --help
Lint a contract
Usage: cargo contract lint [OPTIONS]
Options:
--manifest-path <MANIFEST_PATH>
Path to the `Cargo.toml` of the contract to build
--quiet
No output printed to stdout
--verbose
Use verbose output
--extra-lints
Performs extra linting checks during the build process. Basic clippy lints are deemed important and run anyway.
-h, --help
Print help (see a summary with '-h')Or can be executed programmatically:
let crate_metadata = CrateMetadata::collect(manifest_path)?;
let verbosity = TryFrom::<&VerbosityFlags>::try_from(&self.verbosity)?;
contract_build::lint(extra_lint, &crate_metadata, &verbosity);Please see #2013 for more information.
Ability to generate Solidity metadata for a contract
ink! v6 will have the ability to speak Solidity, you'll be able to integrate
with tools like Metamask and call ink! contracts from Solidity as if they were
a pre-compile.
We added a new subcommand for this:
cargo contract build ---metadata <ink|solidity>Please see #1930 for more information.
Changed
- Target
pallet-reviveinstead ofpallet-contracts- #1851 - Retrieve PolkaVM target spec from linker - #1939
Added
- Add option to generate Solidity compatible metadata (via
cargo contract build ---metadata <ink|solidity>) - #1930 - Deny overflowing (and lossy) integer type cast operations - #1895
- Remove linting by default,
--skip-lintingand--lintflag incargo contract buildand add a new commandlint- #2013
Fixed
- Resolved verifiable-build image failures within
release-verifiable-imageworkflow - #2018
v5.0.3
v5.0.2
v5.0.1
v5.0.0
This release concludes the migration of ink! from Parity to the outside world. It doesn't come with any new features, we just:
- …changed the Parity URLs to ones for our new GitHub organization
@use-ink. - …upgraded many dependencies to newer versions, which results in two particular
breaking changes regarding compatibility:- We had to remove support for Substrate metadata that is below
V14in #1722. Metadata formats belowV14are quite old and we hope this doesn't affect anyone. cargo-contractv5 works only with Rust >= 1.81.
- We had to remove support for Substrate metadata that is below
For the linter in cargo-contract the Rust toolchain version changed. To upgrade:
export TOOLCHAIN_VERSION=nightly-2024-09-05
rustup install $TOOLCHAIN_VERSION
rustup component add rust-src --toolchain $TOOLCHAIN_VERSION
rustup run $TOOLCHAIN_VERSION cargo install cargo-dylint dylint-link
Changed
- Updated the toolchain version used by
ink_linting- #1616 - Update repository URLs & references from
paritytechGitHub organization to newuse-inkone ‒ #1663 - Bump the version of
subxtandsubxt-signer- #1722
Removed
- Remove support for
V11metadata #1722