Skip to main content
11 votes
Accepted

ERROR: Loading of original wasm failed

Solved! This was caused by the nightly toolchain. Switching to the stable toolchain solved this issue. Edit: As pointed out by Shunsuke, this is specific to the 1.70.0 nightly build. 1.68.0 version ...
statisticalanomaly's user avatar
9 votes
Accepted

Is the WASM blob created from ink! contract always deterministic

Currently we don't persist the information necessary to have a deterministic build. There is this GitHub issue for it: https://github.com/paritytech/cargo-contract/issues/525. The underlying issue is ...
cmichi's user avatar
  • 2,800
5 votes
Accepted

cargo-contract throws on a valid WS URl

This is caused by a peculiar behavior of Rust url library, which insists to store port as None in case that is the default port for a particular protocol. This is your case (443 for wss) cargo-...
hansu's user avatar
  • 108
4 votes
Accepted

How to interact between a smart contract written in Solidity from a smart contract written in ink!?

But how would it be possible to build smart contracts written in ink! that call public functions in smart contracts written in Solidity and vice versa? We need to distinguish between Solidity ...
xermicus's user avatar
4 votes

using String in ink version 4

EDIT: this is not completely correct answer anymore. Openbrush is using String type from ink! prelude since version 3.0.0 pub type String = ink::prelude::string::String; When you look at the ...
Maario's user avatar
  • 659
4 votes

ERROR: Loading of original wasm failed

For cases where updated nightly is still preferred for whatever reason: rustup update rustup install nightly-2023-02-07-aarch64-apple-darwin rustup component add rust-src --toolchain nightly-2023-02-...
blairmunroakusa's user avatar
3 votes

What is the purpose of installing cargo-contract and using it to create Ink! Rust smart contracts?

To develop Ink! smart contracts using Rust, you need to install the cargo-contract tool. cargo-contract is a Cargo subcommand specifically designed for developing smart contracts on the Substrate ...
Arunjot Singh's user avatar
3 votes

I get a "The executed contract exhausted its gas limit." when attempting to instantiate a contract

Every contract execution whether it is an instantiation or a call needs to set a parameter named gas_limit to cap how much execution it is allowed to perform. This is necessary because whoever sends a ...
Alexander Theißen's user avatar
3 votes

How to build multiple ink contracts from a root folder?

This is currently a limitation of cargo contract and generally speaking currently there is no solution for what is asked. If cargo contract needs to be called in a folder other than where Cargo.toml ...
Alex Sed's user avatar
  • 590
3 votes

cargo contract throws error about supplied arguments in ` #[ink(constructor)]` for version 3.0.1

I've reproduced your issue and I believe it was an error on our end which caused this. It looks like we introduced a breaking change in the codegen as part of ink! 3.2, sorry! This change was related ...
HCastano's user avatar
  • 1,071
3 votes
Accepted

cargo contract throws error about supplied arguments in ` #[ink(constructor)]` for version 3.0.1

I had the same situation above. After specify indirect dependencies' version declaratively, I succeded to compile and deploy contracts to the local node with pallet-contracts polkadot-v0.9.19 support. ...
Shunsuke's user avatar
  • 432
2 votes

Unable to deploy INK 4.0 beta smart contract

The network I'm trying to deploy the contract to is not supporting INK! 4.0 beta yet.
yonatan hornstein's user avatar
2 votes
Accepted

While installing cargo-contract --version 2.0.0-alpha.3, I got error

Because some dependencies got updated (breaking changes). You should use this to lock the dependencies version: cargo install --force --locked cargo-contract --version 2.0.0-alpha.3
AurevoirXavier's user avatar
  • 10.6k
2 votes

How do i pass a `Vec<u8>` as argument to a contracts function, using the command line(cargo contract)

Here is how i solved it: I converted all the array elements to an hexadecimal string. You can check out the hex crate e.g [20, 103, 114, 101, 97, 116] = 0x + 146772656174(hex string) Make sure to add ...
Woodfish's user avatar
  • 121
2 votes

What is the purpose of installing cargo-contract and using it to create Ink! Rust smart contracts?

To understand the role of cargo-contract in developing Ink! smart contracts, let's break it down: Cargo: Cargo is the build system and package manager for Rust. It simplifies the process of managing ...
the dev's user avatar
  • 477
1 vote

Issue with cargo test and ink! Flipper contract

It turns out the issue was that the build scripts that were running during compilation were by default targeting -mmacosx-version-min=10.7 which meant that some features were not available. The fix ...
WhisperingZebra's user avatar
1 vote

Failing to run ink! e2e tests

It should work on rust v1.72 and substrate-contracts-node v0.31 with cargo-contract-contract 3.2
Sergei Surovsev's user avatar
1 vote

e2e-tests "We should find a port before the reader ends"

Looks like cargo-contract 3.1.0 has been yanked. cargo-contract compatibility with different rust toolchains: Rust <= 1.69 + pallet-contracts < polkadot-1.0.0 = cargo-contract 3.0.1 Rust > = ...
Evil Kyle's user avatar
  • 149
1 vote
Accepted

How to "graceful terminate" a smart contract from the "rococo-contracts-rpc.polkadot.io" chain?

One of possible solutions would be to have per default as "best practices" in every smart-contract created a function called "destructor" together with a "beneficiary account&...
Evil Kyle's user avatar
  • 149
1 vote
Accepted

What is the purpose of the `contracts_runtime.scale` file in the `cargo-contracts` repository?

The metadata was downloaded from a running substrate-contracts-node and is used to generate the APIs and types required for constructing contract extrinsics and querying storage from a compatible node....
Andrew Jones's user avatar
1 vote

ERROR: Loading of original wasm failed

ran into the same issue using v3.0 cargo contract , updating cargo contract to v4 solved it. Use cargo install --git https://github.com/paritytech/cargo-contract cargo-contract --force to update
Honour's user avatar
  • 11
1 vote

ERROR: Loading of original wasm failed

Adding a rust toolchain override file can also work. Such as this: [toolchain] channel = "nightly-2023-01-01" components = [ "rustfmt" ] targets = [ "wasm32-unknown-unknown&...
Bruno's user avatar
  • 8,315
1 vote

Unable to deploy INK 4.0 beta smart contract

I was having the same issue deploying on a local 0.21.0 node. I got it to work by running node version 0.23.0 instead.
Keegan's user avatar
  • 33
1 vote

cargo contract throws error about supplied arguments in ` #[ink(constructor)]` for version 3.0.1

Thanks for the issue reporting! Its origin is described in detail in @HCastano's answer, and is now fixed in the upcoming ink! 3.3.0 release along with other backwards compatibility breaking issues. ...
Alexander Gryaznov's user avatar
1 vote

error[E0152]: found duplicate lang item `panic_impl`

As stated by @Ganesh11 in the comments, you are likely missing pdao-beacon-chain-common/std in your std features. I'm commenting the answer so that the question doesn't show up unanswered anymore.
cmichi's user avatar
  • 2,800
1 vote

How to get Rust contract methods to output/print when running on substrate-contracts-node?

I have the following ink! message: #[ink(message)] pub fn say_hello(&self) { ink_env::debug_println!("Hello"); } I run my node like this: ./target/release/substrate-contracts-node --...
Bruno's user avatar
  • 8,315

Only top scored, non community-wiki answers of a minimum length are eligible