simulate_transaction
Simulate Ethereum transactions to verify contract calls before execution, checking for reverts and return data without broadcasting.
Instructions
Run an eth_call against the chain's RPC to simulate a transaction without signing or broadcasting it. Returns { ok, returnData?, revertReason? }. Use this BEFORE prepare_*/send_transaction to verify a contract call does what you expect — e.g. does wrapping ETH by sending to WETH9's fallback succeed, does a custom calldata revert, what selector gets hit. For state-dependent calls (WETH deposit credits msg.sender, ERC-20 transfer debits msg.sender), pass the user's wallet as from. Prepared transactions are also re-simulated automatically at send_transaction time — this tool lets the agent check ahead. NEVER call this on a tx that depends on an approval you just submitted but haven't yet waited on: the approval must be included on-chain (poll get_transaction_status until confirmed) before the dependent tx will simulate correctly — otherwise you get a misleading 'insufficient allowance' revert.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | No | ethereum | |
| from | No | msg.sender to simulate from. Omit for a state-independent call; include the user's wallet when the target contract's behavior depends on the caller (e.g. WETH9.deposit credits msg.sender, ERC-20 transfer debits msg.sender). | |
| to | Yes | ||
| data | No | Hex-encoded calldata. Omit for a plain value transfer. | |
| value | No | Value to send with the call, in wei as a decimal string. Omit for 0. Example: "500000000000000000" for 0.5 ETH. |