This repository contains examples contracts using XVM to call EVM from ink! needed to use XVM from WASM contracts. It contains an implementation of XVM chain-extension to use in your contracts. As well as ink! contracts SDK that implements XVM chain-extension to be used as is.
This repo code is copied initially from the repos below https://github.com/realtakahashi/ink-xvm-sdk https://github.com/AstarNetwork/ink-xvm-sdk
e.g. Astar https://github.com/AstarNetwork/Astar/releases
Then run it: ./astar-collator --dev --tmp
https://docs.astar.network/docs/build/environment/local-network/ Configure Metamask to use: Name: Astar, URL: http://127.0.0.1:9944 , ChainID: 4369 Astar , Currency Symbol: ASTL
The Storage contract is located at ./solidity/Storage.sol
cargo install --force --locked cargo-contract
cargo contract --version
... cargo contract version is 4.1.1 works for my Wasm Ink! 4.3.0 version
cargo contract build --manifest-path PATH_TO_XVM_FOLDER/Cargo.toml
... this should succeed with the following:
- store_xvm.contract (code + metadata)
- store_xvm.wasm (the contract's code)
- store_xvm.json (the contract's metadata)
Use https://ui.use.ink/ to deploy the compiled wasm with the already deployed Solidity contract address from above
Although it says Contract Reverted. Decoding Failed, that is OKAY!
Go to https://polkadot.js.org/apps/#/contracts and follow the tutorial link posted above
https://theastarbulletin.news/how-to-implement-a-contract-using-xvm-1c94d2072c30
https://docs.astar.network/docs/learn/interoperability/xvm/#interfaces
Code are copied from https://github.com/realtakahashi/ink-xvm-sdk and https://github.com/AstarNetwork/ink-xvm-sdk