Last updated
Last updated
We're going to grab the cosmwasm-examples
repo and compile our chosen contract.
We can compile our contract like so:
However, we want to create an optimised version to limit gas usage, so we're going to run:
This will result in an artifact called cw_erc20.wasm
being created in the artifacts
directory.
You can now upload, or 'store' this to the chain via your local node.
You will need to look in the output for this command for the code ID of the contract. In the JSON, it will look like {"key":"code_id","value":"6"}
in the output.
Alternatively, you can capture the output of the command run above, by doing these steps instead, and use the jq
tool installed earlier to get the code_id
value:
You can now see this value with:
Now we will download a contract, compile it, and upload it to the Source chain.