| type | Skill |
| mode | read-only |
| name | Tx Explain |
| category | basics |
| description | Decode any Base transaction into a plain-English story - method, token movements, swaps/approvals, counterparties, and suspicious-approval flags. Keyless via Base RPC + Etherscan v2. |
| var | |
| tags | ["crypto","base"] |
| requires | ["ETHERSCAN_API_KEY?"] |
| capabilities | ["external_api","sends_notifications"] |
${var} — Transaction hash (0x..., 66 chars) on Base. Required. If empty, log TX_EXPLAIN_NO_TARGET and exit cleanly (no notify).
Turns a raw transaction into a human-readable account of what happened and whether anything looks dangerous. Runs keyless on public endpoints.
Config
- Target =
${var}. Chain = Base (chainid=8453, explorer basescan.org).
ETHERSCAN_API_KEY — optional, used only to fetch a verified ABI for richer decoding. Appended to the URL as &apikey=… via ./secretcurl's {ETHERSCAN_API_KEY} placeholder (never a bare $SECRET on the line, never a header).
Steps
1. Fetch tx + receipt
TX="${var}"
curl -m 10 -s -X POST "https://mainnet.base.org" -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["'"$TX"'"],"id":1}' | jq '.result'
curl -m 10 -s -X POST "https://mainnet.base.org" -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["'"$TX"'"],"id":1}' | jq '.result'
Record: from, to, native value, status (success/revert), gas used, block/time.
2. Decode the method
Take the first 4 bytes of input (the selector). Recognize common selectors directly; otherwise fetch the to contract's verified ABI via Etherscan v2 (module=contract&action=getabi) — keyless works, and the optional key is appended via ./secretcurl (never a bare $SECRET):
TO="<the tx's `to` contract address from step 1>"
KEYQ=; [ -n ] && KEYQ=
./secretcurl -m 10 -s | jq -r