> ## Documentation Index
> Fetch the complete documentation index at: https://seilabs-docs-evm-cookbook.mintlify.site/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 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 the `seid` 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](/evm/installing-seid-cli).

## Network configuration

If you run these commands from a machine that is not a network node, append this flag to each command:

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

For a list of available RPC endpoints, see [RPC endpoints](/evm/networks).

<Info>Most commands support the `--evm-rpc` flag, which sets a custom RPC endpoint. 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>`: 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.

```bash theme={null}
seid tx evm native-associate [custom-message] --from=<sender>
```

The custom message identifies the association request. This command submits a native transaction, so use standard `seid` transaction flags such as `--node` and `--chain-id` instead of `--evm-rpc`.

**Example:**

```bash theme={null}
seid tx evm native-associate "associate" \
  --from=mykey \
  --chain-id pacific-1 \
  --node https://rpc.sei-apis.com
```

<Note>The legacy `seid tx evm associate-address` command and its `sei_associate` JSON-RPC method were removed.</Note>

## Token transfer commands

### Send native tokens

This command sends native tokens (usei) to the target EVM address.

```bash theme={null}
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={null}
seid tx evm send 0x1234567890abcdef1234567890abcdef12345678 1000000000000000000 --from=mykey
```

**Output:**

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

### Send ERC20 tokens

This command sends ERC20 tokens from a specific contract to a recipient.

```bash theme={null}
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 the smallest unit of the token

**Default flags:**

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

**Example:**

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

**Output:**

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

## Contract deployment commands

### Deploy contract

This command deploys an EVM contract from a binary file.

```bash theme={null}
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={null}
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

This command calls an EVM contract with a specific payload. To generate the payload, see [Payload generation](/evm/querying-the-evm#payload-generation).

```bash theme={null}
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={null}
seid tx evm call-contract 0xContract123... 0xa9059cbb000000... --value=1000000000000000000 --from=mykey
```

**Output:**

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

### Call precompile

This command calls a method on a precompiled contract. Precompiles give EVM access to Cosmos SDK functionality.

```bash theme={null}
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 a validator (payable, so it uses `--value`):*

```bash theme={null}
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 each precompile's methods, parameters, and usage patterns, see 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={null}
seid tx evm send 0x... 1000000000000000000 \
  --gas-fee-cap=2000000000000 \
  --gas-limit=100000 \
  --from=mykey
```

### Nonce management

Override the automatic nonce calculation:

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

## Error handling

<Warning>
  **Common issues:**

  * Insufficient balance for the transaction amount and gas
  * Incorrect address formats (use the 0x prefix for EVM addresses)
  * Gas limit too low for complex operations
  * Nonce conflicts when you send transactions in rapid succession
</Warning>

## Best practices

1. Start with the default gas limits, and adjust them for transaction complexity.
2. Always verify addresses before you send transactions.
3. Use secure key storage, and never expose private keys.
4. Confirm that you are connected to the correct network.
5. 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.

For details about a specific command, use the help flag:

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.