Back to Eliza

EVM Plugin

packages/docs/plugin-registry/defi/evm.md

2.0.13.9 KB
Original Source

The EVM plugin enables Eliza agents to interact with Ethereum and EVM-compatible chains — reading balances, sending tokens, interacting with smart contracts, executing swaps, and participating in DeFi protocols.

Package: @elizaos/plugin-wallet

Overview

The EVM plugin provides the agent with an embedded wallet and a set of on-chain actions covering the most common DeFi operations across all major EVM chains.

Installation

bash
eliza plugins install @elizaos/plugin-wallet

Auto-Enable

The plugin auto-enables when ALCHEMY_API_KEY is set (this is the envKey in plugins.json).

Configuration

Environment VariableRequiredDescription
EVM_PRIVATE_KEYYesPrivate key for the agent's wallet (hex, starting with 0x)
EVM_RPC_PROVIDERNoDefault RPC endpoint (mainnet)
ALCHEMY_API_KEYNoAlchemy API key for multi-chain RPC (also the primary auto-enable trigger)
INFURA_API_KEYNoInfura API key for RPC
ANKR_API_KEYNoAnkr API key for RPC
ETHEREUM_PROVIDER_ETHEREUMNoCustom RPC URL for Ethereum mainnet
ETHEREUM_PROVIDER_BASENoCustom RPC URL for Base
ETHEREUM_PROVIDER_ARBITRUMNoCustom RPC URL for Arbitrum
ETHEREUM_PROVIDER_OPTIMISMNoCustom RPC URL for Optimism
TEE_MODENoTrusted Execution Environment mode
WALLET_SECRET_SALTNoSalt for wallet key derivation
SEPOLIA_RPC_URLNoRPC URL for Sepolia testnet
BASE_SEPOLIA_RPC_URLNoRPC URL for Base Sepolia testnet
json
{
  "settings": {
    "secrets": {
      "EVM_PRIVATE_KEY": "0x..."
    }
  }
}

Supported Chains

ChainChain IDNative Token
Ethereum Mainnet1ETH
Base8453ETH
Arbitrum One42161ETH
Optimism10ETH
Polygon137MATIC
BSC56BNB
Avalanche C-Chain43114AVAX
Zora7777777ETH
Mode34443ETH
Blast81457ETH

Actions

ActionDescription
TRANSFER_TOKENSend ETH or ERC-20 tokens to an address
SWAP_TOKENSSwap tokens via DEX aggregators (1inch, Uniswap)
GET_BALANCECheck ETH and token balances
DEPLOY_CONTRACTDeploy a smart contract
CALL_CONTRACTRead from a smart contract
SEND_TRANSACTIONSend a raw transaction
SIGN_MESSAGESign an arbitrary message
GET_TRANSACTIONLook up a transaction by hash
BRIDGE_TOKENSBridge tokens cross-chain

Providers

ProviderDescription
walletBalanceCurrent ETH and token balances
walletAddressThe agent's wallet address
chainInfoCurrent chain ID and network

Usage Examples

After the plugin is loaded, the agent can execute on-chain operations through natural language:

"Send 0.01 ETH to vitalik.eth"

"Swap 100 USDC for ETH on Base"

"What's my wallet balance on Arbitrum?"

"Deploy the ERC-20 contract to Base Sepolia"

Security Considerations

  • The private key grants full control of the agent's wallet. Store it securely using the built-in @elizaos/core secrets runtime.
  • Consider using a dedicated agent wallet with limited funds rather than a primary wallet.
  • The plugin does not impose spending limits — any action the LLM selects will execute. Configure the character carefully.
  • Use testnets (Base Sepolia, Arbitrum Sepolia) for development.

Testnet Configuration

json
{
  "settings": {
    "secrets": {
      "EVM_PRIVATE_KEY": "0x...",
      "EVM_RPC_PROVIDER": "https://sepolia.base.org"
    }
  }
}