# 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. The `type` parameter can be one of "NATIVE", "CW20", "CW721", "ERC20", or "ERC721", and `pointee` 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 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 in `path_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 at `address` to the target receiver.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.eniac.network/build/smart-contracts/evm-cli.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
