hello world challenge for contracts in ink!
https://github.com/nuke-web3/ch-contract.git
substrate-node-template folder for the edits made to have the contracts pallet added
erc20 folder for the /target/* files with the compiled wasm and metadata needed.
substrate-front-end-template folder for edits made to interact with the deployed ERC20 contract.
/erc20/target/erc20.wasm file and /erc20/target/erc20metadata.json ABI file.1000000000 tokens from the Alice account.ERC20.js with this hash:
The Deployed Contract Address should be: 5G7aVUF6RhN1QWtLY7VHa32fSFWaA1oLGuMrjvTLoqcpGqR7
Using the Execute tab from the UI, use the Message to Send = transfer(to: AccountId, value: u128): Result<(), Error>) and send Bob 500 units.
Starting with a fresh chain (use ./target/release/node-template/purge-chain --dev -y ), redelpoy the contract, but this time with 1000000000 tokens. We want to send Bob 5000000 this time.
Be sure that you re-upload the contract via Canvas AND the hash is updated in ERC20.js!
See instructions in substrate-front-end-template to bring up the template. Then use the UI for the ERC20 to transfer funds!
Note that the ballances is non functional for the ERC20 at this time. It will not display.
You should see a valid event to ContractExecution! If you get a DispatchError (specifically index 9, error 12), check if the address of the deployed contact is correct!
Check the balances via the Canvas UI: