Skip to content

Latest commit

 

History

History
1020 lines (759 loc) · 56.7 KB

File metadata and controls

1020 lines (759 loc) · 56.7 KB

Changelog

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]

Version 6.0.0-beta.2

Added

  • Allow contract_build::execute to specify how cli arguments are passed to verifiable builds ‒ 2177
  • Allow specifying directory name for contract ‒ 2176

Fixed

  • Make cargo-contract compatible with Rust 1.92 ‒ 2178
  • Allow verifiable builds from CLIs that are not cargo-contract2172

Version 6.0.0-beta.1

Fixed

  • Event decoding when interacting with a contract - 2162
  • Accept plain string call arguments by inferring types from metadata - 2161.
  • Only use --all-features in cargo contract test when no feature specified - 2164

Version 6.0.0-beta

Added

  • Heuristic to distinguish ink! vs. Solidity contracts on-chain ‒ 2147
  • Added more output to cargo contract info2148

Changed

  • Re-enable clippy::cast_possible_truncation lint ‒ #2138
  • Synchronize with polkadot-sdk/1b1cef306d9ceebf963fd15a04b5c79ee2618bce2675
  • Synchronize with polkadot-sdk/cbab8ed4be1941420dd25dc81102fb79d8e2a7f02153

Fixed

  • Support instantiate --code-hash2136
  • Properly decode Address values inside Vectors ‒ 2137

Version 6.0.0-alpha.4

Changed

  • Handle Rust >= 1.91 change of target-pointer-width JSON type ‒ 2131
  • Retrieve the contract address from the Instantiated event ‒ 2134

[6.0.0-alpha.3]

Compatibility of this release:

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.

Changed

  • Upgrade to subxt 0.442127
  • Synchronized with polkadot-sdk/c40b36c3a7c208f9a6837b80812473af3d9ba7f72102
  • Re-enable rustc overflow checks - #2116
  • chore: Upgrade to Rust edition 2024 - #2125

Removed

  • Removed chain extension functionality ‒ 2120
  • Remove MAX_EVENT_TOPICS from Environment implementations - #2122

[6.0.0-alpha.1]

Added

  • Support setting ABI in Cargo.toml and propagate ABI into build environment via cfg flag - #2033
  • Add cargo contract test subcommand - #2034
  • Show cost of mapping an address in cargo-contract prompt - #1990

Fixed

  • Fixed erroneous "[lib] name" warnings - #2035
  • Fix Solidity metadata generation for overloaded functions and events - #2082

Changed

  • Bump the version of subxt and subxt-signer - #2036
  • Add --nocapture flag to cargo contract test subcommand - #2037
  • Mark rustc wrapper crate as a non-member of any workspace - #2038
  • Reusable rustc wrapper - #2039
  • Validate metadata spec arg against specified ABI for contract build - #2043
  • Make metadata spec arg optional for contract build - #2047
  • Update Solidity metadata generation to support SolEncode and SolDecode implementing arbitrary types - #2048
  • Declare ink_abi as an expected cfg in new project Cargo.toml template - #2058
  • Allow setting target directory for contract builds - #2063
  • Include ABI declaration in new project template - #2066
  • Synchronized with polkadot-sdk/cb629d46ebf00aa65624013a61f9c69ebf02b0b4 - #2077
  • ABI specific target directories for intermediate build artifacts - #2089
  • Add errors to Solidity metadata - #2098

[6.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:

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 ExecuteArgsv6.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::Currency type (which corresponds to the ink::Environment::Balance type.
  • or a hardcoded U256 (which corresponds to what Ethereum uses). In this alpha release we just adhere to requiring the types that pallet-revive uses. In an upcoming beta release this could be simplified to reduce UX friction by just using one type everywhere and converting to the pallet-revive one.

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-revive instead of pallet-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-linting and --lint flag in cargo contract build and add a new command lint - #2013

Fixed

  • Resolved verifiable-build image failures within release-verifiable-image workflow - #2018

[5.0.1]

Changed

  • Bumped the ink! dependencies to ink! 5.1.0 - #1837
  • Synchronized the sp-* dependencies with the ones used in ink! 5.1.0 - #1837

[5.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 V14 in #1722. Metadata formats below V14 are quite old and we hope this doesn't affect anyone.
    • cargo-contract v5 works only with Rust >= 1.81.

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 paritytech GitHub organization to new use-ink one ‒ #1663
  • Bump the version of subxt and subxt-signer - #1722

Removed

  • Remove support for V11 metadata #1722

[4.1.1]

Fixed

  • Remove mention of non-existent argument, improve clarity of warning message - #1590

[4.1.0]

Fixed

  • Fix the instantiate command for Substrate 0.9.42 based chains - #1564

Added

  • 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

[4.0.2]

Fixed

  • Fix installation instructions for ink_linting - #1546

[4.0.1]

Fixed

  • Fix e2e tests in the contract template - #1537

[4.0.0]

This cargo-contract release is compatible with Rust versions >=1.70and 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

Added

  • Export ink_metadata types in transcode 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 for info command - #1311
  • Add --all flag for info 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 to info 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

Changed

  • 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 to 0.32.0 - #1352
  • Remove check for compatible scale and scale-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 to 1.70 - #1241

Fixed

  • 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 fix linkme on macOS - #1200
  • fix(build): An error when running with --lint - #1174
  • Dry-run result output improvements - #1123
  • feat: use CARGO_ENCODED_RUSTFLAGS instead of RUSTFLAGS - #1124

[4.0.0-rc.4]

Added

  • Export ink_metadata types in transcode crate - #1522

Fixed

  • Fix parsing of docker STDOUT - #1526
  • Remove docker container on build failure - #1531

[4.0.0-rc.3]

Fixed

  • Fix build --verifiable command #1511

[4.0.0-rc.2]

Added

  • 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

Changed

  • Print type comparison warning only on --verbose - #1483
  • Mandatory dylint-based lints - #1412
  • Add a new tabular layout for the contract storage data - #1485

[4.0.0-rc.1]

Changed

  • Run wasm-opt first, remove sign_ext feature - #1416

[4.0.0-rc]

Added

  • 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 for info command - #1311
  • Add --all flag for info 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 to info command output - #1347
  • Add dynamic types support - #1399
  • Basic storage inspection command - #1395

Changed

  • Bump subxt to 0.32.0 - #1352
  • Remove check for compatible scale and scale-info versions - #1370
  • Bump ink to 5.0.0-rc - #1415

Fixed

  • 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

[4.0.0-alpha]

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

Added

  • 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

Changed

  • Dry-run result output improvements - 1123
  • Display build progress with --output-json, print to stderr - 1211
  • Update subxt to 0.30.1 with new subxt-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 to 1.70 - #1241
  • [extrinsics] update metadata to substrate-contracts-node 0.29 - #1242

Fixed

  • Configure tty output correctly - #1209
  • Set lto = "thin" for metadata build to fix linkme on macOS - #1200
  • fix(build): An error when running with --lint - #1174
  • Dry-run result output improvements - #1123
  • feat: use CARGO_ENCODED_RUSTFLAGS instead of RUSTFLAGS - #1124

[3.1.0] YANKED

[3.0.1]

Fixed

  • [contract-build] flush the remaining buffered bytes - 1118

[3.0.0]

Added

  • Experimental support for RISC-V contracts - #1076

Changed

  • Contracts are build as bin crate now (we used cdylib 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
  • Update contracts node metadata (#1105)
    • Compatible with substrate-contracts-node 0.25.0-a2b09462c7c

Fixed

  • Fix original Wasm artifact path #1116

[2.2.1]

Fixed

  • Revert "Bump tracing from 0.1.37 to 0.1.38" - #1096

[2.2.0]

Added

  • Add info command - #993
  • Add --output-json flag for info command - #1007

Changed

  • Minimum requirements of ink! dependencies all updated to 4.2.0 - #1084
  • Upgrade subxt to 0.28 #1039
  • Upgrade scale-info to 2.5 #1057

Fixed

  • Rewrites build file path in manifest #1077
  • Only copy and rewrite target contract manifest #1079

[2.1.0]

Changed

  • Dry-run instantiate, call and upload commands by default - #999

Added

  • Add cargo contract encode command - #998

Fixed

  • 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.

[2.0.2]

Fixed

  • Explicitly enable std feature for metadata generation #977
  • Return artifact paths when contracts unchanged #992
  • Minimum requirements of ink! dependencies all updated to 4.0.1

[2.0.1]

Fixed

  • Return correct contract id for instantiate command with subcontracts ‒ #777
  • Bump template to ink! 4.0 ‒ #971

[2.0.0]

Major release compatible with ink! 4.0.0. All the changes in aggregate since 1.5:

Added

  • 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

Changed

  • 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
  • Replace custom RPCs by state_call - #701
  • Removed requirement to install binaryen. The wasm-opt tool is now compiled into cargo-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 to cargo - #853
  • Bump minimum requirement of scale-info in template to 2.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 to 0.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

Fixed

  • 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

Removed

  • Remove the test command #958
  • Remove rust toolchain channel check - #848

[2.0.0-rc.1] - 2023-02-01

Second release candidate compatible with ink! 4.0.0-rc.

Changed

  • Upgrade subxt to 0.26 #924
  • Display detailed cause of an error #931
  • Use package name instead of lib name, default to "rlib" #929

Fixed

  • Miscellaneous extrinsics display improvements #916
  • Fix decoding of LangError #919

[2.0.0-rc] - 2023-01-12

First release candidate for compatibility with ink! 4.0-rc.

Changed

  • Extrinsics: allow specifying contract artifact directly #893

Added

  • Add cargo contract remove command #837

[2.0.0-beta.2] - 2023-01-09

Changed

  • Upgrade wasm-opt to 0.111.0 #888
  • Enable wasm-opt MVP features only #891
  • Require env_type transcoders to be Send + Sync #879

Fixed

  • Add determinism arg to upload TX #870

[2.0.0-beta.1] - 2022-12-07

Changed

  • Pass --features through to cargo - #853
  • Remove rust toolchain channel check - #848
  • Bump minimum requirement of scale-info in template to 2.3 - #847
  • Remove unstable module check, add --skip-wasm-validation - #846
  • Extract lib for invoking contract build - #787

Fixed

  • Fixed having non-JSON output after calling instantiate with --output-json - #839
  • add -C target-cpu=mvp rust flag to build command - #838

[2.0.0-beta] - 2022-11-22

This release supports the ink! v4.0.0-beta release.

Changed

  • 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

Added

  • Log code hash if contract is already uploaded - #805

[2.0.0-alpha.5] - 2022-10-27

Added

  • Add Rust specific build info to metadata - #680

Changed

  • Removed requirement to install binaryen. The wasm-opt tool is now compiled into cargo-contract - #766.
  • Make linting opt in with --lint - #799

Fixed

  • Log failure instead of failing when decoding an event - #769

[2.0.0-alpha.4] - 2022-10-03

Fixed

  • Fix storage deposit limit encoding - #751
  • Rewrite relative path for dev-dependency - #760

[2.0.0-alpha.3] - 2022-09-21

This release supports compatibility with the v4.0.0-alpha.3 release of ink!. It is not backwards compatible with older versions of ink!.

Added

  • --output-json support for call, instantiate and upload commands - #722
  • Denominated units for Balances - #750
  • Use new ink entrance crate - #728

Fixed

  • Skip linting if running building in --offline mode - #737

[2.0.0-alpha.2] - 2022-09-02

Fixed

  • Sync version of transcode crate to fix metadata parsing - #723
  • Fix numbering of steps during build - #715

[2.0.0-alpha.1] - 2022-08-24

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.

Added

  • Add support for ink!'s version metadata field - #641

Changed

  • 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
  • Replace custom RPCs by state_call - #701

Fixed

  • Fix tracing_subscriber filtering - #702

[1.5.0] - 2022-08-15

Added

  • Dry run gas limit estimation - #484

Changed

  • Bump ink_* crates to v3.3.1 - #686
  • Refactor out transcode as a separate library - #597
  • Sync metadata version with cargo-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

Fixed

  • Fix windows dylint build #690
  • Fix instantiate_with_code with already uploaded code #594

[1.4.0] - 2022-05-18

Changed

  • Updated cargo contract new template dependencies to ink! version = "3" - #569
  • Improved documentation on how to invoke cargo contract decode - #572

Fixed

  • Make constructor selector look for exact function name - #562 (thanks @forgetso!)
  • Fix dirty directory issue when crate installation had been interrupted - #571

[1.3.0] - 2022-05-09

Added

  • Allow hex literals for unsigned integers - #547

Fixed

  • 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

[1.2.0] - 2022-04-13

Added

  • decode command for event, message and constructor data decoding - #481

Fixed

  • Fix usage of check-only and remove need for FromStr impl - #499

[1.1.1] - 2022-04-05

Fixed

  • 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

[1.1.0] - 2022-03-18

Added

  • --skip-linting flag that allows to skip the linting step during build process - #468

[1.0.1] - 2022-03-18

  • Improved error reporting during installation - #469

[1.0.0] - 2022-03-17

Changed

  • Updated cargo contract new template dependencies to ink! 3.0 - #466

[0.18.0] - 2022-03-14

Interact with contracts: upload, instantiate and call commands

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.

Linting rules for smart contracts

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.

Added

  • Interact with contracts: upload, instantiate and call commands - #79
  • Add linting to assert correct initialization of ink_storage::Mapping - #431

Changed

  • Upgrade subxt, SCALE crates, and substrate primitive sp-* crates #451.
  • Updated cargo contract new template dependencies to ink! 3.0.0-rc9 - #443

[0.17.0] - 2022-01-19

Changed

  • 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

Added

  • For contract size optimization added workspace section to override parent workspace - #378

[0.16.0] - 2021-11-25

Changed

  • 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 if lto is enabled (reduces the size of a contract) - #358
  • Deserialize metadata - #368

Added

  • Added a --offline flag to build contracts without network access - #356

[0.15.0] - 2021-10-18

Changed

  • Update to scale-info 1.0 and support new metadata versioning - #342
  • Update cargo contract new template dependencies to ink! rc6 - #342

[0.14.0] - 2021-08-12

Added

  • Add option for JSON formatted output - #324

Changed

  • Use new dependency resolver for template contract - #325
  • Do not strip out panic messages in debug builds - #326

[0.13.1] - 2021-08-03

Fixed

  • Fixed a Windows issue with contract files in sub-folders - #313

[0.13.0] - 2021-07-22

Added

  • 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

Changed

  • Change default optimizations pass to focus on code size - #305

[0.12.1] - 2021-05-25

Added

  • Suggest binaryen installation from GitHub release on outdated version - #274

Fixed

  • Always use library targets name for contract artifacts - #277

[0.12.0] - 2021-04-21

Fixed

  • Fixed ERROR: The workspace root package should be a workspace member when building a contract under Windows - #261

Removed

  • 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

[0.11.1] - 2021-04-06

Fixed

  • Fix wasm-opt --version parsing - #248

[0.11.0] - 2021-03-31

Added

  • 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

Fixed

  • Only allow new contract names beginning with an alphabetic character - #219
  • Upgrade cargo-metadata and fix usages - #210

[0.10.0] - 2021-03-02

Fixed

  • no periods in new contract names - #192

Changed

  • Update cargo contract new template dependencies for ink! rc3 - #204

[0.9.1] - 2021-02-24

Fixed

  • Fix linker error when building complex contracts - #199

[0.9.0] - 2021-02-22

Added

  • Implement Wasm validation for known issues/markers - #171

Changed

  • Use either binaryen-rs dep or wasm-opt binary - #168
  • Update to scale-info 0.5 and codec 2.0 - #164
  • Put build artifacts under target/ink/ - #122

Fixed

  • 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 for check - #124
  • update wasm-path usage name - #135

[0.8.0] - 2020-11-27

  • 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 and check + 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

[0.7.1] - 2020-10-26

  • Update new command template to ink! 3.0-rc2 #85

[0.7.0] - 2020-10-13

  • 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

[0.6.1] - 2020-05-12

  • Fix LTO regressions in nightly toolchain #52

[0.6.0] - 2020-03-25

  • First release to crates.io
  • Use subxt release from crates.io

[0.5.0] - 2020-03-18

  • Upgrades dependencies #45
  • Update template to ink! 2.0 dependencies #47

[0.4.1] - 2020-02-26

  • Fix: fail the whole build process if the contract build fails.

[0.4.0] - 2020-02-26

  • 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 from Cargo.toml, removing redundant metadata.
  • Removes requirement for linker args specified in .cargo/config.
  • Added --verbose and --quiet flags for build and generate-metadata commands.