LogoLogo
  • Welcome
    • About ENI
  • Getting Started
    • Quickstart
      • Account Structure
      • Token Standards
      • Gas
    • Divergence from Ethereum
    • Transactions
      • Creating Transaction
    • Governance
      • Proposals
    • Oracles
  • Build
    • Setup and Installation
    • Smart Contracts
      • EVM (General)
      • EVM (CLI)
      • Querying State
    • Frontend Development
      • Overview
      • How to Deploy Your First dApp
    • Ecosystem
      • Tools and Resources
      • Resources
  • Node
    • Getting Started
    • Node Operators Guide
    • Validator Operations Guide
    • Advanced Configuration & Monitoring
    • Technical Reference
  • Reference
    • Overview
    • enid
    • CLI
      • enid add-genesis-account
      • enid blocktest
      • enid collect-gentxs
      • enid compact
      • enid config
      • enid debug
      • enid export
      • enid gentx
      • enid help
      • enid init
      • enid keys
        • enid keys delete
        • enid keys add
        • enid keys export
        • enid keys import
        • enid keys list
        • enid keys mnemonic
        • enid keys parse
        • enid keys show
      • enid latest_version
      • enid migrate
      • enid prune
      • enid query
        • enid query accesscontrol
        • enid query upgrade
        • enid query account
        • enid query auth
        • enid query bank
        • enid query block
        • enid query authz
        • enid query distribution
        • enid query epoch
        • enid query evidence
        • enid query evm
        • enid query feegrant
        • enid query ibc-transfer
        • enid query gov
        • enid query ibc
        • enid query mint
        • enid query oracle
        • enid query params
        • enid query slashing
        • enid query staking
        • enid query tendermint-validator-set
        • enid query tokenfactory
        • enid query tx
        • enid query txs
      • enid rollback
      • enid start
      • enid status
      • enid tendermint
      • enid tools
      • enid tx
      • enid validate-genesis
      • enid version
Powered by GitBook
On this page
  • Interacting with the EVM on ENI via CLI
  • Querying
  • Transactions
  1. Build
  2. Smart Contracts

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 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 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.

  • 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.

PreviousEVM (General)NextQuerying State

Last updated 2 months ago