EVM (CLI)
Interacting with the EVM on ENI via CLI
Once the enid
command is installed (see Installing enid), you can easily query or send transactions to ENI through the CLI.
Querying
If the machine running these commands is not running a node on the network, you need to append --node http://url-to-eni-cosmos-rpc
to the commands. Refer to the Tools and Resources page for a list of RPC endpoints.
enid q evm eni-addr [some EVM address]
: Retrieves the associated ENI address for the queried EVM address (if it exists on-chain).enid q evm evm-addr [some ENI address]
: Retrieves the associated EVM address for the queried ENI address (if it exists on-chain).enid q evm erc20 [erc20 address] [method] [args...]
: Queries the ERC20 contract at the specified address using the given method and arguments.enid q evm payload [abi file path] [method] [args...]
: Generates a hexadecimal payload for a method call based on the provided ABI.enid q evm pointer [type] [pointee]
: Retrieves the pointer contract for the requested pointee. Thetype
parameter can be one of "NATIVE", "CW20", "CW721", "ERC20", or "ERC721", andpointee
is the target contract address. For the "NATIVE" type,pointee
will be the native token denomination.
Transactions
Sending transactions via the CLI requires you to add a key using enid keys add
. You can then specify the key to use by appending --from=[key name]
to the commands.
If the machine running these commands is not a node on the network, you need to append --evm-rpc http://url-to-eni-evm-rpc
to the commands. Refer to the Tools and Resources page for a list of RPC endpoints.
enid tx evm associate-address
: Associates the ENI address and EVM address of the sending key on-chain.enid tx evm send [target EVM address] [amount in wei]
: Sends native tokens to the target EVM address.enid tx evm deploy [binary file path]
: Deploys the EVM contract specified inpath_to_binary
.enid tx evm call-contract [address] [payload hex]
: Sends a transaction to call the contract at the target address with the provided payload.enid tx evm erc20-send [address] [receiver] [amount]
: Sends ERC20 tokens from the contract ataddress
to the target receiver.enid tx evm delegate [validator address] [amount]
: Delegates the specified amount to the target validator address. The validator address must be in the ENI/Cosmos validator address format.
Last updated