All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]
- Target
pallet-revive
instead ofpallet-contracts
- #1851
- Bumped the ink! dependencies to ink! 5.1.0 - #1837
- Synchronized the
sp-*
dependencies with the ones used in ink! 5.1.0 - #1837
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
V14
in #1722. Metadata formats belowV14
are quite old and we hope this doesn't affect anyone. cargo-contract
v5 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
- Updated the toolchain version used by
ink_linting
- #1616 - Update repository URLs & references from
paritytech
GitHub organization to newuse-ink
one ‒ #1663 - Bump the version of
subxt
andsubxt-signer
- #1722
- Remove support for
V11
metadata #1722
- Remove mention of non-existent argument, improve clarity of warning message - #1590
- Fix the
instantiate
command for Substrate0.9.42
based chains - #1564
- Add
cargo contract storage --version
command - #1564 - Add
cargo contract verify --wasm
argument - #1551 - Add
cargo contract instantiate --chain
with production chain endpoints - #1290 - Warn when uploading unverifiable contract builds to production - #1290
- Fix installation instructions for
ink_linting
- #1546
- Fix e2e tests in the contract template - #1537
This cargo-contract
release is compatible with Rust versions >=1.70
and ink! versions >=5.0.0
ℹ️ We've created a migration guide from ink! 4 to ink! 5. It also contains an
overview over newly added features in this release of cargo-contract
and explains
e.g. the newly added contract verification in more detail.
👉 You can view it here.
Notable changes:
- Verifiable builds inside a docker container - #1148
- Extrinsics extracted to separate crate - #1181
- Fix building contracts with Rust >= 1.70: enable
sign_ext
Wasm opcode - #1189 - Support for multiple versions of
pallet-contracts
- #1399
- Export
ink_metadata
types intranscode
crate - #1522 - Improved error message for Strings as CLI arguments - #1492
- Add a user-friendly view of contract storage data in the form of a table - #1414
- Add
rpc
command - #1458 - Add schema generation and verification - #1404
- Compare
Environment
types against the node - #1377 - Detect
INK_STATIC_BUFFER_SIZE
env var - #1310 - Add
verify
command - #1306 - Add
--binary
flag forinfo
command - #1311 - Add
--all
flag forinfo
command - #1319 - Add contract language detection feature for
info
command - #1329 - Add warning message when using incompatible contract's ink! version - #1334
- Add workspace support -#1358
- Add
Storage Total Deposit
toinfo
command output - #1347 - Add dynamic types support - #1399
- Basic storage inspection command - #1395
- Standardised verifiable builds - #1148
- Enable Wasm sign_ext #1189
- Expose extrinsics operations as a library - #1181
- Suggest valid message or constructor name, when misspelled - #1162
- Add flag -y as a shortcut for --skip-confirm - #1127
- Add command line argument --max-memory-pages - #1128
- Show Gas consumption by default for dry-runs - #1121
- Print type comparison warning only on
--verbose
- #1483 - Mandatory dylint-based lints - #1412
- Add a new tabular layout for the contract storage data - #1485
- Run wasm-opt first, remove sign_ext feature - #1416
- Bump
subxt
to0.32.0
- #1352 - Remove check for compatible
scale
andscale-info
versions - #1370 - Dry-run result output improvements - 1123
- Display build progress with --output-json, print to stderr - 1211
- Upgrade wasm-opt to 0.113 - #1188
- Update substrate dependencies - #1149
- Make output format of cargo contract info consistent with other subcommands - #1120
- set minimum supported
rust-version
to1.70
- #1241
- Fix parsing of docker STDOUT - #1526
- Remove docker container on build failure - #1531
- Fix build
--verifiable
command #1511 - Do not allow to execute calls on immutable contract messages - #1397
- Improve JSON Output for Upload and Remove Commands - #1389
- Fix for a Url to String conversion in
info
command - #1330 - Configure tty output correctly - #1209
- Set
lto = "thin"
for metadata build to fixlinkme
on macOS - #1200 - fix(build): An error when running with
--lint
- #1174 - Dry-run result output improvements - #1123
- feat: use
CARGO_ENCODED_RUSTFLAGS
instead ofRUSTFLAGS
- #1124
- Export
ink_metadata
types intranscode
crate - #1522
- Fix build
--verifiable
command #1511
- Improved error message for Strings as CLI arguments - #1492
- Add a user-friendly view of contract storage data in the form of a table - #1414
- Add
rpc
command - #1458
- Print type comparison warning only on
--verbose
- #1483 - Mandatory dylint-based lints - #1412
- Add a new tabular layout for the contract storage data - #1485
- Run wasm-opt first, remove sign_ext feature - #1416
- Add schema generation and verification - #1404
- Compare
Environment
types against the node - #1377 - Detect
INK_STATIC_BUFFER_SIZE
env var - #1310 - Add
verify
command - #1306 - Add
--binary
flag forinfo
command - #1311 - Add
--all
flag forinfo
command - #1319 - Add contract language detection feature for
info
command - #1329 - Add warning message when using incompatible contract's ink! version - #1334
- Add workspace support -#1358
- Add
Storage Total Deposit
toinfo
command output - #1347 - Add dynamic types support - #1399
- Basic storage inspection command - #1395
- Bump
subxt
to0.32.0
- #1352 - Remove check for compatible
scale
andscale-info
versions - #1370 - Bump
ink
to5.0.0-rc
- #1415
- Do not allow to execute calls on immutable contract messages - #1397
- Improve JSON Output for Upload and Remove Commands - #1389
- Fix for a Url to String conversion in
info
command - #1330
Replaces the yanked 3.1.0
due to issues with supporting both Rust versions < 1.70
and >= 1.70
.
If you intend to use cargo-contract
with Rust >= 1.70
, and deploy to a node with a
version of pallet-contracts
at least polkadot-1.0.0
, then this is the release to use.
If you still want to compile with 1.69
and target an older version of pallet-contracts
then use the previous 3.0.1
release.
Notable changes:
- Verifiable builds inside a docker container - #1148
- Extrinsics extracted to separate crate - #1181
- Fix building contracts with Rust >= 1.70: enable
sign_ext
Wasm opcode - #1189
- Standardised verifiable builds - #1148
- Enable Wasm sign_ext #1189
- Expose extrinsics operations as a library - #1181
- Suggest valid message or constructor name, when misspelled - #1162
- Add flag -y as a shortcut for --skip-confirm - #1127
- Add command line argument --max-memory-pages - #1128
- Show Gas consumption by default for dry-runs - #1121
- Dry-run result output improvements - 1123
- Display build progress with --output-json, print to stderr - 1211
- Update
subxt
to0.30.1
with newsubxt-signer
crate - #1236 - Upgrade wasm-opt to 0.113 - #1188
- Update substrate dependencies - #1149
- Make output format of cargo contract info consistent with other subcommands - #1120
- set minimum supported
rust-version
to1.70
- #1241 [extrinsics]
update metadata tosubstrate-contracts-node 0.29
- #1242
- Configure tty output correctly - #1209
- Set
lto = "thin"
for metadata build to fixlinkme
on macOS - #1200 - fix(build): An error when running with
--lint
- #1174 - Dry-run result output improvements - #1123
- feat: use
CARGO_ENCODED_RUSTFLAGS
instead ofRUSTFLAGS
- #1124
[contract-build]
flush the remaining buffered bytes - 1118
- Experimental support for RISC-V contracts - #1076
- Contracts are build as
bin
crate now (we usedcdylib
before) - #1076- BREAKING CHANGE: Make sure that your contract is
no_main
by having this on top of your contract:#![cfg_attr(not(feature = "std"), no_std, no_main)]
- This will be detected and suggested for
error[E0601]
- #1113
- BREAKING CHANGE: Make sure that your contract is
- Update contracts node metadata (#1105)
- Compatible with
substrate-contracts-node 0.25.0-a2b09462c7c
- Compatible with
- Fix original Wasm artifact path #1116
- Revert "Bump tracing from 0.1.37 to 0.1.38" - #1096
- Minimum requirements of
ink!
dependencies all updated to4.2.0
- #1084 - Upgrade
subxt
to0.28
#1039 - Upgrade
scale-info
to2.5
#1057
- Dry-run
instantiate
,call
andupload
commands by default - #999
- Add
cargo contract encode
command - #998
- Limit input length for
decode
command - #982 - Pass contract features to metadata gen package - #1005
- Custom AccountId32 impl, remove substrate deps - #1010
- Fixes issue with with incompatible
wasmtime
versions when dependant project has old substrate dependencies.
- Fixes issue with with incompatible
- Explicitly enable
std
feature for metadata generation #977 - Return artifact paths when contracts unchanged #992
- Minimum requirements of
ink!
dependencies all updated to4.0.1
- Return correct contract id for
instantiate
command with subcontracts ‒ #777 - Bump template to ink! 4.0 ‒ #971
Major release compatible with ink! 4.0.0
. All the changes in aggregate since 1.5
:
- Add support for ink!'s
version
metadata field - #641 - Add Rust specific build info to metadata - #680
- Log code hash if contract is already uploaded - #805
- Add remove command - #837
- Build contracts and dylint driver with stable - #698
- Compile dylints when compiling the contract - #703
- Move transcode example to doc test, add helper method - #705
- Note that alongside this PR we released
[email protected]
- Note that alongside this PR we released
- Replace custom RPCs by
state_call
- #701 - Removed requirement to install binaryen. The
wasm-opt
tool is now compiled intocargo-contract
- #766. - Make linting opt in with
--lint
- #799 - Update to weights v2 - #809
- Update validation for renamed FFI functions - #816
- Denominated units for balances in events - #750
- Upgrade wasm-opt to 0.110.2 - #802
- Pass
--features
through tocargo
- #853 - Bump minimum requirement of
scale-info
in template to2.3
- #847 - Remove
unstable
module check, add--skip-wasm-validation
- #846 - Extract lib for invoking contract build - #787
- Upgrade wasm-opt to 0.111.0 #888
- Enable
wasm-opt
MVP features only #891 - Require env_type transcoders to be Send + Sync #879
- Extrinsics: allow specifying contract artifact directly #893
- Upgrade
subxt
to0.26
#924 - Display detailed cause of an error #931
- Use package name instead of lib name, default to "rlib" #929
- Rename
metadata.json
to{contract_name}.json
- #952 - Do not postprocess or generate metadata if contract unchanged #964
- Update
subxt
and substrate dependencies #968
- Fix
tracing_subscriber
filtering - #702 - Sync version of transcode crate to fix metadata parsing - #723
- Fix numbering of steps during
build
- #715 - Skip linting if running building in --offline mode - #737
- Fix storage deposit limit encoding - #751
- Rewrite relative path for
dev-dependency
- #760 - Log failure instead of failing when decoding an event - #769
- Fixed having non-JSON output after calling
instantiate
with--output-json
- #839 - add
-C target-cpu=mvp
rust flag to build command - #838 - Miscellaneous extrinsics display improvements #916
- Fix decoding of
LangError
#919 - Respect the lockfile #948
- Error if mismatching # of args for instantiate/call #966
- Pretty-print call dry-run return data #967
Second release candidate compatible with ink! 4.0.0-rc
.
- Upgrade
subxt
to0.26
#924 - Display detailed cause of an error #931
- Use package name instead of lib name, default to "rlib" #929
First release candidate for compatibility with ink! 4.0-rc
.
- Extrinsics: allow specifying contract artifact directly #893
- Add
cargo contract remove
command #837
- Upgrade wasm-opt to 0.111.0 #888
- Enable
wasm-opt
MVP features only #891 - Require env_type transcoders to be Send + Sync #879
- Add determinism arg to upload TX #870
- Pass
--features
through tocargo
- #853 - Remove rust toolchain channel check - #848
- Bump minimum requirement of
scale-info
in template to2.3
- #847 - Remove
unstable
module check, add--skip-wasm-validation
- #846 - Extract lib for invoking contract build - #787
- Fixed having non-JSON output after calling
instantiate
with--output-json
- #839 - add
-C target-cpu=mvp
rust flag to build command - #838
This release supports the ink! v4.0.0-beta
release.
- Update to weights v2 - #809
- Update validation for renamed FFI functions - #816
- Denominated units for balances in events - #750
- Upgrade wasm-opt to 0.110.2 - #802
- Log code hash if contract is already uploaded - #805
- Add Rust specific build info to metadata - #680
- Removed requirement to install binaryen. The
wasm-opt
tool is now compiled intocargo-contract
- #766. - Make linting opt in with
--lint
- #799
- Log failure instead of failing when decoding an event - #769
This release supports compatibility with the v4.0.0-alpha.3
release of ink!
. It is not backwards compatible with older versions of ink!
.
--output-json
support forcall
,instantiate
andupload
commands - #722- Denominated units for Balances - #750
- Use new ink entrance crate - #728
- Skip linting if running building in --offline mode - #737
- Sync version of transcode crate to fix metadata parsing - #723
- Fix numbering of steps during
build
- #715
This release brings two exciting updates! First, contracts can now be built using the
stable
Rust toolchain! Don't ask us how we managed to do this 👻.
Secondly, it allows you to build ink! v4.0.0-alpha.1
, which introduced a small - but
breaking - change to the ink! ABI as part of use-ink/ink#1313.
- Add support for ink!'s
version
metadata field - #641
- Build contracts and dylint driver with stable - #698
- Compile dylints when compiling the contract - #703
- Move transcode example to doc test, add helper method - #705
- Note that alongside this PR we released
[email protected]
- Note that alongside this PR we released
- Replace custom RPCs by
state_call
- #701
- Fix
tracing_subscriber
filtering - #702
- Dry run gas limit estimation - #484
- Bump
ink_*
crates tov3.3.1
- #686 - Refactor out transcode as a separate library - #597
- Sync
metadata
version withcargo-contract
- #611 - Adapt to new subxt API - #678
- Replace log/env_logger with tracing/tracing_subscriber - #689
- Contract upload: emitting a warning instead of an error when the contract already existed is more user friendly - #644
- Updated
cargo contract new
template dependencies to ink!version = "3"
- #569 - Improved documentation on how to invoke
cargo contract decode
- #572
- Make constructor selector look for exact function name - #562 (thanks @forgetso!)
- Fix dirty directory issue when crate installation had been interrupted - #571
- Allow hex literals for unsigned integers - #547
- Display
H256
instances in events as hex encoded string - #550 - Fix extrinsic params for contract chains - #523
- Fix
Vec<AccountId>
args - #519 - Fix
--dry-run
error deserialization and report error details - #534
decode
command for event, message and constructor data decoding - #481
- Fix usage of
check-only
and remove need forFromStr
impl - #499
- Fix linting support for Apple Silicon (and some other architectures) - #489
- Allow multiple args values for call and instantiate commands - #480
- Fix event decoding -
c721b1
--skip-linting
flag that allows to skip the linting step during build process - #468
- Improved error reporting during installation - #469
- Updated
cargo contract new
template dependencies to ink!3.0
- #466
We added commands to upload, instantiate and call contracts!
This allows interacting with contracts on live chains with a compatible
pallet-contracts
.
For command-line examples on how to use these commands see #79.
We are introducing a linter for ink! smart contracts in this release!
From now on cargo-contract
checks if the ink! smart contract that is
build
or check
-ed follows certain rules.
As a starting point we've only added one linting rule so far; it asserts correct
initialization of the ink_storage::Mapping
data structure.
In order for the linting to work with your smart contract, the contract has to be written in at least ink! 3.0.0-rc9. If it's older the linting will just always succeed.
- Interact with contracts: upload, instantiate and call commands - #79
- Add linting to assert correct initialization of
ink_storage::Mapping
- #431
- Upgrade
subxt
, SCALE crates, and substrate primitivesp-*
crates #451. - Updated
cargo contract new
template dependencies to ink!3.0.0-rc9
- #443
- Updated
cargo contract new
template dependencies to ink!3.0.0-rc8
- #402 - Reverted the disabled overflow checks in the
cargo contract new
template - #376 - Migrated to 2021 edition, enforcing MSRV of
1.56.1
- #360
- For contract size optimization added
workspace
section to override parentworkspace
- #378
- Updated
cargo contract new
template dependencies to ink!3.0.0-rc7
- #374 - Disabled overflow checks in the
cargo contract new
template - #372 - Use
-Clinker-plugin-lto
iflto
is enabled (reduces the size of a contract) - #358 - Deserialize metadata - #368
- Added a
--offline
flag to build contracts without network access - #356
- Update to
scale-info
1.0 and support new metadata versioning - #342 - Update
cargo contract new
template dependencies to ink!rc6
- #342
- Add option for JSON formatted output - #324
- Use new dependency resolver for template contract - #325
- Do not strip out panic messages in debug builds - #326
- Fixed a Windows issue with contract files in sub-folders - #313
- Convenient off-chain testing through
cargo contract test
- #283 - Build contracts in debug mode by default, add
--release
flag - #298 - Add
--keep-symbols
flag for better Wasm analysis capabilities - #302
- Change default optimizations pass to focus on code size - #305
- Suggest
binaryen
installation from GitHub release on outdated version - #274
- Always use library targets name for contract artifacts - #277
- Fixed
ERROR: The workspace root package should be a workspace member
when building a contract under Windows - #261
- Remove support for
--binaryen-as-dependency
- #251 - Remove support for the deprecated
cargo contract generate-metadata
command - #265 - Remove pinned
funty
dependency from "new project" template - #260
- Fix
wasm-opt --version
parsing - #248
- Improve error output for
wasm-opt
interaction - #244 - Check optimized Wasm output file exists - #243
- Detect
wasm-opt
version compatibility and improve error messages - #242 - Detect version mismatches of
parity-scale-codec
in contract and ink! dependency - #237 - Support specifying
optimization-passes
in the release profile - #231 - Support specifying
optimization-passes
on the CLI - #216 - Use
ink::test
attribute in "new project" template - #190
- Only allow new contract names beginning with an alphabetic character - #219
- Upgrade
cargo-metadata
and fix usages - #210
- no periods in new contract names - #192
- Update
cargo contract new
template dependencies forink!
rc3
- #204
- Fix linker error when building complex contracts - #199
- Implement Wasm validation for known issues/markers - #171
- Use either
binaryen-rs
dep orwasm-opt
binary - #168 - Update to scale-info 0.5 and codec 2.0 - #164
- Put build artifacts under
target/ink/
- #122
- Fix
wasm-opt
regression - #187 - Generate metadata explicitly for the contract which is build - #174
- Fix bug with empty Wasm file when using system binaryen for optimization - #179
- Suppress output on
--quiet
- #165 - Do not generate build artifacts under
target
forcheck
- #124 - update wasm-path usage name - #135
- Exit with 1 on Err #109
- Use package name instead of lib name for metadata dependency #107
- Do not prettify JSON for bundle #105
- Make
source.hash
non-optional, remove metadata-only #104 - Implement new commands
build
andcheck
+ introduce bundles (.contract files) #97 - Replace xbuild with cargo build-std #99
- Use binaryen-rs as dep instead of requiring manual wasm-opt installation #95
- Specify optional --manifest-path for build and generate-metadata #93
- Update new command template to ink! 3.0-rc2 #85
- Fix deprecation warnings #82
- Use ink 3.0.0-rc1 #82
- [template] now uses ink_env and ink_storage #81
- Update new command template to ink! 3.0 syntax #80
- Extract contract metadata to its own crate #69
- Fix ManifestPath compiler errors #73
- Upgrade cargo-xbuild and other dependencies #71
- Update subxt and async-std dependencies #66
- Generate extended contract metadata #62
- Autogenerate abi/metadata package #58
- Extract workspace to module directory #59
- Add preferred default release profile settings #55
- Add option to build with unmodified original manifest #51
- Update cargo-xbuild #54
- Fix LTO regressions in nightly toolchain #52
- First release to crates.io
- Use
subxt
release from crates.io
- Fix: fail the whole build process if the contract build fails.
- Minimize contract wasm binary size:
- Run
wasm-opt
on the contract Wasm binary. - Uses
cargo-xbuild
to build custom sysroot crates without panic string bloat. - Automatically removes the
rlib
crate type fromCargo.toml
, removing redundant metadata.
- Run
- Removes requirement for linker args specified in
.cargo/config
. - Added
--verbose
and--quiet
flags forbuild
andgenerate-metadata
commands.