Questions tagged [cargo-contract]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

is it necessary to download all the dependencies and the full target file to compile and build any contract?

due to I have limited internet in my country , I can not download the full building files after I wrote the contract and need to only see if there are any errors and need to run the tests . so if I ...
castle_chain's user avatar
1 vote
1 answer
27 views

Issue with cargo test and ink! Flipper contract

cargo contract build works just fine and produces the correct outputs in the /target folder. Running cargo test however throws the following error: error: failed to run custom build command for `wasm-...
WhisperingZebra's user avatar
1 vote
0 answers
19 views

What is the principle of Code Hash generation in ink?

I come from ChainIDE, and I have some confusion regarding the generation mechanism of code hash. I tried to compile Flipper and PSP22 in different folders, but I obtained different code hashes. cargo ...
user4790's user avatar
1 vote
1 answer
68 views

Failing to run ink! e2e tests

I am trying to run e2e tests but getting the following error. Example of running the e2e tests of the flipper contract: running 4 tests test flipper::tests::it_works ... ok test flipper::tests::...
Szegoo's user avatar
  • 627
1 vote
1 answer
40 views

What happens to legacy contracts given breaking changes to cargo-contract v3?

In the cargo contract v3 release, breaking changes were made for how contracts are built (cdylib -> bin) and specifying no_main. I've found that cargo contract v2 produces contracts compatible with ...
goastler's user avatar
  • 559
0 votes
1 answer
129 views

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

I am doing a basic E2E test using the flipper example. This is my contract version I have install the substrate-contracts-node I am running with the "nightly-2023-02-09" (cargo +nightly-...
Evil Kyle's user avatar
  • 149
3 votes
1 answer
69 views

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

In theory we could use this command: cargo contract remove --execute --code-hash '******' --url 'wss://rococo-contracts-rpc.polkadot.io' --suri 'seeds' But in order to do that we have first to ...
Evil Kyle's user avatar
  • 149
2 votes
2 answers
811 views

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

What's the deal with installing cargo-contract to make Ink! Rust smart contracts? Is it the contract compiler, or is it ructc? Why do we even need it?
UPENDRA SINGH's user avatar
1 vote
2 answers
14 views

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

Cargo Contract is a popular tool for developing ink! contracts. This tool is known to work well with the substrate contracts node, and I thought it should work with other chains that support pallet ...
JoshOrndorff's user avatar
  • 1,159
4 votes
1 answer
188 views

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

In the repository of the cargo-contract CLI tool, which currently "helps you develop smart contracts in Parity's ink!, which is a Rust eDSL allowing you to write smart contracts for blockchains ...
Luke Schoen's user avatar
  • 2,312
2 votes
0 answers
43 views

How to upload the same ink! smart contract to a different code hash?

I've written this ink! quickstart script that I can repeatedly call to run these steps to flood my local testnet with instances of Flipper contracts: Kills an existing substrate-contracts-node ...
Luke Schoen's user avatar
  • 2,312
3 votes
0 answers
68 views

Cargo-contract forcibly calls nightly-2022-06-30 regardless of specified toolchain

I am experiencing an issue when using cargo-contract (version 1.5.1) to build a project (command: cargo +nightly contract build). The specified toolchain is not being recognized, and the process is ...
Yasu Yasu's user avatar
5 votes
1 answer
56 views

using String in ink version 4

so I am migrating my contract from version 3 to 4 my goal is to use the open brush as well but we can not use the open brush in ink version 4 because it still needs the nightly features and Ink v4 ...
Rahul navgire's user avatar
10 votes
4 answers
2k views

ERROR: Loading of original wasm failed

I having some trouble running the Flipper example from the Ink! webpage. The cargo contract build outputs the following error log: ERROR: Loading of original wasm failed Caused by: 0: Loading of ...
statisticalanomaly's user avatar
4 votes
2 answers
112 views

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

When using cargo contract to call contracts, in all the examples i've seen, its either been AccountId or boolean or integers(u & i). I need to pass a Vec<u8> to my contract function. I've ...
Woodfish's user avatar
  • 121
3 votes
1 answer
113 views

How to build multiple ink contracts from a root folder?

I have a simple parent folder and multiple contracts inside it in a simple structure as follows: contracts |__contract1 |__contract2 I add a root Cargo.toml file under contracts and ...
Alex Sed's user avatar
  • 580
2 votes
2 answers
125 views

Unable to deploy INK 4.0 beta smart contract

I'm trying to deploy INK 4.0 smart contract with cargo-contract 2.0 beta to a network but I'm getting the following error contracts.CodeRejected. Whenever i try to upload the contract to my local ...
yonatan hornstein's user avatar
0 votes
1 answer
193 views

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

I am using cargo install cargo-contract --version 2.0.0-alpha.3 to install 2.0.0-alpha.3, I got error: failed to compile cargo-contract v2.0.0-alpha.3, intermediate artifacts can be found at /var/...
Ganesh11's user avatar
  • 1,207
1 vote
1 answer
441 views

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

Error message fn panic(info: &core::panic::PanicInfo) -> ! { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the lang item is first defined in crate `std` (which `...
pinetree's user avatar
1 vote
1 answer
47 views

Using conditional compilation in ink!

My question is quite simple - can I use conditional compilation via cfg attribute macros in ink! contracts? Example: Cargo.toml cross_contract_emit = [] lib.rs #[cfg(not(feature = "...
fbielejec's user avatar
  • 331
2 votes
1 answer
84 views

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

I have tried following instructions from: https://rustrepo.com/repo/paritytech-substrate-contracts-node and https://ink.substrate.io/faq/#how-do-i-print-something-to-the-console-from-the-runtime My ...
ecorrales's user avatar
  • 103
4 votes
1 answer
483 views

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

I am new to substrate. Am trying to deploy and instantiate a simple contract on a local node. Everything is via the command line (cargo), or node.js, no UI, no browser. Am using paritytech's ...
ecorrales's user avatar
  • 103
3 votes
3 answers
338 views

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

In my smart contract, all the ink dependencies are set to =3.0.1 because of this issue: Cargo contract 3.0.1 When I tried to execute the cargo contract build or even cargo +nightly contract build to ...
Jitterbug's user avatar
  • 219
7 votes
1 answer
133 views

Is the WASM blob created from ink! contract always deterministic

The contract's source code is provided during the contract verification on a block explorer (or some other source verifier). The block explorer needs to compile that source and verify if the generated ...
Maario's user avatar
  • 659
4 votes
1 answer
126 views

cargo-contract throws on a valid WS URl

Most recent version (v1.3.0) of cargo-contract does not parse a valid WS url: cargo +nightly contract upload --suri '//Alice' --url 'wss://ws-smartnet.test.azero.dev:443' ERROR: Rpc error: Networking ...
fbielejec's user avatar
  • 331