ggxchain / ggxnode

Apache License 2.0
6 stars 5 forks source link

Error when calling EVM contract from WASM contract #143

Closed maksym-nyrka closed 3 months ago

maksym-nyrka commented 1 year ago

Steps to Reproduce

  1. Using guide create a wrapper for EVM contact
  2. Click the Execute button, and then Sign and Submit.
  3. See error

Environment

https://testnet.brooklyn.ggxchain.io/#/contracts

Logs, Errors or Screenshots

Screenshot

AuroraLantean commented 5 months ago

The contract's code was found to be invalid during validation.The most likely cause of this is that an API was used which is not supported by the node. This happens if an older node is used with a new version of ink!. Try updating your node to the newest available version.

AuroraLantean commented 5 months ago

also from 3 days ago: GGXnode repo cannot use the latest cargo contract cli tool

I can compile the newer wasm contracts now with the latest cargo contract CLI tool. I did that by commenting out channel = "nightly-2023-08-19" and "llvm-tools-preview",in rust-toolchain.toml, but when I run the ggxnode I copy those code back. I know that is a hack. Now when I was trying to upload the compiled wasm contract, the UI refused me saying "Unbalbe to handle version 5", which is the wasm Ink version. If we do not update the Rust compiler version soon, then we can only use older versions of cargo contract cli and ink

AuroraLantean commented 5 months ago

Submitted posts at Astar Discord, Astar XVM Github PR, and Stackoverflow

AuroraLantean commented 5 months ago

Regarding calls from Ink! XVM to Evm Solidity smart contracts, I have found another solution: Solang, a Solidity compiler for Solana and Polkadot https://github.com/hyperledger/solang#build-for-substrate Solang Solidity Compiler can compile smart contracts written in Solidity for Solana and Polkadot. It uses the llvm compiler framework to produce WebAssembly (WASM) or Solana SBF contract code. As result, the output is highly optimized, which saves you in gas costs or compute units.

AuroraLantean commented 5 months ago

Fixed the code and pushed for review https://github.com/ggxchain/ggxnode/pull/256

AuroraLantean commented 5 months ago

I have written an updated Readme with all steps, while leaving the old Readme unchanged https://github.com/ggxchain/ggxnode/blob/main/examples/cross-vm-communication/README.md

AuroraLantean commented 5 months ago

Merged to main