> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sei.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Transactions with seid

> Complete guide to executing EVM transactions using the Sei CLI (seid). Learn how to send tokens, deploy contracts, and interact with smart contracts.

## Overview

EVM transactions on Sei allow you to interact with smart contracts, transfer tokens, deploy contracts, and manage various blockchain operations through the command line interface. This guide covers all available transaction types using the `seid` CLI, from basic token transfers to complex contract interactions and precompile calls.

## Prerequisites

Sending transactions via CLI requires you to have keys configured in your local keyring. You can then specify the key you want to use by appending `--from=[key name]` to your command.

If you don't already have keys configured, you'll need to either generate a new key or import an existing one into your local keyring. Refer to this guide on [how to create a key](/evm/installing-seid-cli) for more details.

## Network Configuration

If the machine you run these commands from are not a node of the network, you'd need to append the following to your commands:

```bash theme={"dark"}
--evm-rpc http://<sei-evm-rpc-url>
```

Refer to the [RPC endpoints](/evm/networks) page for the list of available RPC endpoints.

<Info>Most commands support `--evm-rpc` flag to specify custom RPC endpoints. The default is `http://localhost:8545`.</Info>

## Common Transaction Flags

All transaction commands support these common flags:

* `--from=<sender>` - Specifies the key name to use for signing
* `--gas-fee-cap=<cap>` - Gas fee cap 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 Address

Associates the Sei address and EVM address on-chain for the sending key. This is required for cross-layer interactions.

```bash theme={"dark"}
seid tx evm associate-address [optional priv key hex] --from=<sender> --evm-rpc=<url>
```

**Parameters:**

* `[optional priv key hex]` - Optional private key in hex format. If not provided, uses the key from keyring.

**Example:**

```bash theme={"dark"}
seid tx evm associate-address --from=mykey --evm-rpc=http://localhost:8545
```

**Output :**

```
Response: {"jsonrpc":"2.0","result":null,"id":"associate_addr"}
```

## Token Transfer Commands

### Send Native Tokens

Sends native tokens (usei) to the target EVM address.

```bash theme={"dark"}
seid tx evm send [to EVM address] [amount in wei] --from=<sender> --gas-fee-cap=<cap> --gas-limit=<limit> --evm-rpc=<url>
```

**Parameters:**

* `[to EVM address]` - Destination EVM address (0x format)
* `[amount in wei]` - Amount to send in wei (smallest unit)

**Default Flags:**

* `--gas-fee-cap=1000000000000` (1000 Gwei)
* `--gas-limit=21000`

**Example:**

```bash theme={"dark"}
seid tx evm send 0x1234567890abcdef1234567890abcdef12345678 1000000000000000000 --from=mykey
```

**Output :**

```
Transaction hash: 0x...
```

### Send ERC20 Tokens

Sends ERC20 tokens from a specific contract to a recipient.

```bash theme={"dark"}
seid tx evm erc20-send [contract addr] [recipient] [amount] --from=<sender> --gas-fee-cap=<cap> --gas-limit=<limit> --evm-rpc=<url>
```

**Parameters:**

* `[contract addr]` - ERC20 contract address
* `[recipient]` - Recipient EVM address
* `[amount]` - Amount in smallest unit of the token

**Default Flags:**

* `--gas-fee-cap=1000000000000` (1000 Gwei)
* `--gas-limit=7000000`

**Example:**

```bash theme={"dark"}
seid tx evm erc20-send 0xTokenContract123... 0xRecipient456... 1000000 --from=mykey
```

**Output :**

```
Transaction hash: 0x...
```

## Contract Deployment Commands

### Deploy Contract

Deploys an EVM contract from a binary file.

```bash theme={"dark"}
seid tx evm deploy [path to binary] --from=<sender> --gas-fee-cap=<cap> --gas-limit=<limit> --evm-rpc=<url>
```

**Parameters:**

* `[path to binary]` - Path to the contract binary file

**Default Flags:**

* `--gas-fee-cap=1000000000000` (1000 Gwei)
* `--gas-limit=5000000`

**Example:**

```bash theme={"dark"}
seid tx evm deploy ./MyContract.bin --from=mykey --gas-limit=8000000
```

**Output :**

```
Deployer: 0x...
Deployed to: 0x...
Transaction hash: 0x...
```

## Contract Interaction Commands

### Call Contract

Calls an EVM contract with a specific payload. You can generate payload by taking a look at docs [here](/evm/querying-the-evm#payload-generation).

```bash theme={"dark"}
seid tx evm call-contract [addr] [payload hex] --value=<payment> --from=<sender> --gas-fee-cap=<cap> --gas-limit=<limit> --evm-rpc=<url>
```

**Parameters:**

* `[addr]` - Contract address
* `[payload hex]` - Function call data in hex format

**Default Flags:**

* `--gas-fee-cap=1000000000000` (1000 Gwei)
* `--gas-limit=7000000`
* `--value=0` - SEI value to send with the call

**Example:**

```bash theme={"dark"}
seid tx evm call-contract 0xContract123... 0xa9059cbb000000... --value=1000000000000000000 --from=mykey
```

**Output :**

```
Transaction hash: 0x...
```

### Call Precompile

Calls a method on a precompiled contract. Precompiles provide EVM access to Cosmos-SDK functionality.

```bash theme={"dark"}
seid tx evm call-precompile [precompile name] [method] [args...] --value=<payment> --from=<sender> --gas-fee-cap=<cap> --gas-limit=<limit> --evm-rpc=<url>
```

**Parameters:**

* `[precompile name]` - Name of the precompiled contract
* `[method]` - Method name to call
* `[args...]` - Method arguments

**Default Flags:**

* `--gas-fee-cap=1000000000000` (1000 Gwei)
* `--gas-limit=7000000`
* `--value=""` - SEI value to send (required for payable methods)

**Examples:**

*Delegate to validator (payable - uses --value):*

```bash theme={"dark"}
seid tx evm call-precompile staking delegate seivaloper1... --value=1000000000000000000 --from=mykey
```

**Available Precompiles:**

* `distribution` - Staking rewards management
* `json` - JSON parsing utilities
* `p256` - P256 cryptographic operations
* `staking` - Validator delegation and staking

<Info>For detailed information about each precompile's methods, parameters, and usage patterns, refer to the [EVM Precompiles documentation](/evm/precompiles/example-usage).</Info>

**Output :**

```
Transaction hash: 0x...
```

## Advanced Usage

### Custom Gas Settings

You can customize gas settings for any transaction:

```bash theme={"dark"}
seid tx evm send 0x... 1000000000000000000 \
  --gas-fee-cap=2000000000000 \
  --gas-limit=100000 \
  --from=mykey
```

### Nonce Management

Override automatic nonce calculation:

```bash theme={"dark"}
seid tx evm send 0x... 1000000000000000000 \
  --nonce=42 \
  --from=mykey
```

## Error Handling

<Warning>
  **Common Issues:**

  * Insufficient balance for transaction + gas
  * Incorrect address formats (use 0x prefix for EVM addresses)
  * Gas limit too low for complex operations
  * Nonce conflicts in rapid successive transactions
</Warning>

## Best Practices

1. **Gas Estimation**: Start with default gas limits and adjust based on transaction complexity
2. **Address Validation**: Always verify addresses before sending transactions
3. **Key Management**: Use secure key storage and never expose private keys
4. **Network Verification**: Confirm you're connected to the correct network
5. **Transaction Monitoring**: Save transaction hashes for tracking purposes

## Transaction Requirements

* **Key Configuration**: Local keyring must contain the signing key
* **Sufficient Balance**: Account must have enough tokens for transaction amount + gas
* **Address Formats**: Use proper formats (0x... for EVM, seivaloper... for validators)
* **Network Access**: Ensure connectivity to the specified RPC endpoint
* **Gas Limits**: Set appropriate gas limits for transaction complexity

For more detailed information about specific commands, use the help flag:

```bash theme={"dark"}
seid tx evm [command] --help
```
