use-ink / ink

Polkadot's ink! to write smart contracts.
https://use.ink
Apache License 2.0
1.34k stars 426 forks source link

ERC721 smart contract deployment issue #1028

Closed aaku1234 closed 2 years ago

aaku1234 commented 2 years ago

system.extrinsic failed others deploying smart contract .Following this github code for ERC721 https://github.com/allanperlee/Nftoken

nuke-web3 commented 2 years ago

Please report issues and seek support with ink on their repos and element channels

And specifically for this one, why not open an issue on that repo :wink:

HCastano commented 2 years ago

Hey @aaku1234, can you tell us a little bit more about the versions of the tools you're using? E.g, rustc, cargo-contract, substrate-contracts-node.

17akash commented 2 years ago

Hey @aaku1234, can you tell us a little bit more about the versions of the tools you're using? E.g, rustc, cargo-contract, substrate-contracts-node.

Hello @HCastano,these are the version of my rustc - rustc 1.36.0-nightly cargo-contract - cargo-contract 0.15.0-unknown-x86_64-linux-gnu substrate-contracts-node - substrate-contracts-node 0.1.0-acbf103-x86_64-linux-gnu

HCastano commented 2 years ago

Your rustc version is quite old. For context, our CI is using cargo 1.58.0-nightly (ad50d0d26 2021-11-17). You can update using rustup update nightly.

Your smart-contracts-node is also a bit outdated. The latest commit is 9dd43c31. You can update with cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --force --locked.

Can you perform these updates and try deploying your contract again?

17akash commented 2 years ago

After updating rustc ,this is the version - rustc 1.56.0 (09c42c458 2021-10-18) and my smart-contract-node version - substrate-contracts-node 0.1.0-9dd43c3-x86_64-linux-gnu When I build the contract by command "cargo +nightly contract build" I got this error I also tried adding overflow-checks = falseinCargo.toml` but getting the same error

ERROR: Validation of the Wasm failed. ERROR: An unexpected panic function import was found in the contract Wasm. This typically goes back to a known bug in the Rust compiler: https://github.com/rust-lang/rust/issues/78744

As a workaround try to insert overflow-checks = false into your Cargo.toml. This will disable safe math operations, but unfortunately we are currently not aware of a better workaround until the bug in the compiler is fixed.

ERROR: An unexpected import function was found in the contract Wasm: _ZN4core9panicking5panic17hb051bf2d675326efE. The only allowed import functions are those starting with one of the following prefixes: seal, memory

HCastano commented 2 years ago

This is related to https://github.com/paritytech/ink/issues/364. We're working around it by disabling overflow-checks (see this PR for example). Can you do the same and see if you can successfully deploy your contract?

HCastano commented 2 years ago

@aaku1234 I'm gonna go ahead and close this issue. Feel free to ping us/re-open this if you feel like it hasn't been resolved.