Query and run commands
Query and execute commands on your new contract
Now you can check that the contract has assigned the right amount to the self-delegate address:
From the example above, it will return:
Using the commands supported by execute
work the same way. The incantation for executing commands on a contract via the CLI is:
You can omit --amount
if not needed for execute
calls.
You will likely need to add additional flags depending on your local node's gas settings. If in doubt, --gas-prices 0.1usource --gas auto --gas-adjustment 1.3
will work. If you also add -b block
, then the tx will block until complete or failed, rather than executing asynchronously.
In this case, your command will look something like:
Passing arguments
As before, you can encode whatever JSON arguments you need via the node CLI (or another tool of your choice). But how do you know what arguments to use?
Every contract specifies the arguments that can be used for each action exposed to execute
. Their types are also specified.
This specification, or spec, for short, can be found in the schema for the contract.
In the folder contracts/erc20
within cosmwasm-examples
, for example, you can see the schemas:
Each of the JSON files above is a JSON schema, specifying the correct shape of JSON that it accepts.
Even though it is your job as a developer to provide documentation to your users, at a bare minimum, the schema will enforce argument correctness and provide basic documentation to others.
Last updated