Overview
EVM transactions on Sei let you interact with smart contracts, transfer tokens, deploy contracts, and manage other blockchain operations from the command line. This guide covers all available transaction types in theseid CLI, from basic token transfers to complex contract interactions and precompile calls.
Prerequisites
To send transactions with the CLI, you must have keys configured in your local keyring. To select the key for a command, append--from=[key name] to it.
If you do not have keys configured yet, generate a new key or import an existing one into your local keyring. For details, see how to create a key.
Network configuration
If you run these commands from a machine that is not a network node, append this flag to each command:Most commands support the
--evm-rpc flag, which sets a custom RPC endpoint. The default is http://localhost:8545.Common transaction flags
All transaction commands support these common flags:--from=<sender>: Specifies the key name to use for signing--gas-fee-cap=<cap>: Maximum fee per unit of gas for the transaction (default varies by command)--gas-limit=<limit>: Gas limit for the transaction (default varies by command)--evm-rpc=<url>: EVM RPC endpoint URL (default:http://localhost:8545)--nonce=<nonce>: Nonce override for the transaction (-1 means auto-calculate)
Address management commands
Associate an address
This command associates the Sei address and the EVM address of the sending key on-chain. Cross-layer interactions require this association.seid transaction flags such as --node and --chain-id instead of --evm-rpc.
Example:
The legacy
seid tx evm associate-address command and its sei_associate JSON-RPC method were removed.Token transfer commands
Send native tokens
This command sends native tokens (usei) to the target EVM address.[to EVM address]: Destination EVM address (0x format)[amount in wei]: Amount to send in wei (smallest unit)
--gas-fee-cap=1000000000000(1000 Gwei)--gas-limit=21000
Send ERC20 tokens
This command sends ERC20 tokens from a specific contract to a recipient.[contract addr]: ERC20 contract address[recipient]: Recipient EVM address[amount]: Amount in the smallest unit of the token
--gas-fee-cap=1000000000000(1000 Gwei)--gas-limit=7000000
Contract deployment commands
Deploy contract
This command deploys an EVM contract from a binary file.[path to binary]: Path to the contract binary file
--gas-fee-cap=1000000000000(1000 Gwei)--gas-limit=5000000
Contract interaction commands
Call contract
This command calls an EVM contract with a specific payload. To generate the payload, see Payload generation.[addr]: Contract address[payload hex]: Function call data in hex format
--gas-fee-cap=1000000000000(1000 Gwei)--gas-limit=7000000--value=0: SEI value to send with the call
Call precompile
This command calls a method on a precompiled contract. Precompiles give EVM access to Cosmos SDK functionality.[precompile name]: Name of the precompiled contract[method]: Method name to call[args...]: Method arguments
--gas-fee-cap=1000000000000(1000 Gwei)--gas-limit=7000000--value="": SEI value to send (required for payable methods)
--value):
distribution: Staking rewards managementjson: JSON parsing utilitiesp256: P256 cryptographic operationsstaking: Validator delegation and staking
For each precompile’s methods, parameters, and usage patterns, see the EVM precompiles documentation.
Advanced usage
Custom gas settings
You can customize gas settings for any transaction:Nonce management
Override the automatic nonce calculation:Error handling
Best practices
- Start with the default gas limits, and adjust them for transaction complexity.
- Always verify addresses before you send transactions.
- Use secure key storage, and never expose private keys.
- Confirm that you are connected to the correct network.
- Save transaction hashes so that you can track the transactions.
Transaction requirements
- The local keyring must contain the signing key.
- The account must have enough tokens for the transaction amount and gas.
- Use the correct address formats: 0x… for EVM addresses and seivaloper… for validators.
- Make sure that you can connect to the specified RPC endpoint.
- Set gas limits that suit the transaction complexity.