---
title: 'Transactions with paxd'
description: 'Complete guide to executing EVM transactions using the Paxeer CLI (paxd). Learn how to send tokens, deploy contracts, and interact with smart contracts.'
keywords: ['paxd transactions', 'evm transactions', 'contract deployment', 'token transfer', 'smart contracts']
---

> **For AI agents:** the complete documentation index is at [llms.txt](/llms.txt). Append `.md` to any page URL for its markdown version.

## Overview

EVM transactions on Paxeer 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 `paxd` CLI, from basic token transfers to complex contract interactions.

## 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-paxd-cli) for more details.

## Network Configuration

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

```bash
--evm-rpc https://public-rpc.paxeer.app/evm/reference
```

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 Paxeer address and EVM address on-chain for the sending key. This is required for cross-layer interactions.

```bash
paxd 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
paxd 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 (uhpx) to the target EVM address.

```bash
paxd 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
paxd 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
paxd 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
paxd 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
paxd 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
paxd 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
paxd 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` - HPX value to send with the call

**Example:**

```bash
paxd 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 chain-specific functionality.

```bash
paxd 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=""` - HPX value to send (required for payable methods)

**Examples:**

_Delegate to validator (payable - uses --value):_

```bash
paxd tx evm call-precompile staking delegate paxvaloper1... --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
paxd tx evm send 0x... 1000000000000000000 \
  --gas-fee-cap=2000000000000 \
  --gas-limit=100000 \
  --from=mykey
```

### Nonce Management

Override automatic nonce calculation:

```bash
paxd 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, paxvaloper... 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
paxd tx evm [command] --help
```
