Skip to main content

Documentation Index

Fetch the complete documentation index at: https://developers.circle.com/llms.txt

Use this file to discover all available pages before exploring further.

Execute write functions on any smart contract from your agent wallet. Common uses include approving token allowances, interacting with DeFi protocols, or calling custom contract logic.

Prerequisites

Before you begin, ensure you have:

Steps

Follow these steps to execute a smart contract function.
1

Find the contract address

For Circle contracts (USDC, CCTP, Gateway), look up the address for your blockchain:
circle contract address usdc --chain BASE
2

Execute the contract function

Run circle wallet execute with the ABI function signature, parameters, and contract address:
circle wallet execute "approve(address,uint256)" 0xSpender 1000000 \
  --contract 0xUSDC \
  --address 0xYourWalletAddress \
  --chain BASE
The CLI waits for the transaction to reach a terminal state and returns the result:
{
  "data": {
    "id": "abc-123-...",
    "state": "CONFIRMED",
    "blockchain": "BASE",
    "txHash": "0xabc...",
    "operation": "CONTRACT_EXECUTION",
    "contractAddress": "0xUSDC",
    "abiFunctionSignature": "approve(address,uint256)"
  }
}
If the transaction fails, the CLI prints the reason. Verify the contract address, function signature, and parameters, then retry.
See the CLI Command Reference for full syntax and options, including --amount to send native token value with the call.