Run PUSH1 1 PUSH1 2 ADD on Amsterdam and show me the gas and the final stack.
Look forabout 9 call-frame gas and stack 0x3
Agent will likely call run_bytecodeWhat you can ask →
Status: Live on the public MCP. Tool:
run_bytecode.
Run PUSH1 1 PUSH1 2 ADD on Amsterdam and show me the gas and the final stack.
Look forabout 9 call-frame gas and stack 0x3
Agent will likely call run_bytecodeWhat you can ask →
Run caller-supplied raw EVM bytecode under a chosen fork / EIP configuration and receive a structured result — call-frame gas used, return data, final stack, optional opcode trace, and provenance.
Bytecode runs as a VM message-call (real execution account, call-frame gas — no 21,000 intrinsic). SSTORE persists for the duration of that call. Optional accounts seeds code, balance, and storage in the same request.
Tell the user call gas, stack, and return data in plain language. Read gasUsed from the JSON internally; do not lead with that field name unless they asked for raw output.
SSTORE / SLOAD (EIP-8038) — existing-slot write is about 5,006 vs 12,106accounts[].code and observe EXTCODESIZE in one callWallet gas limits, first-touch ETH transfers, receipt logs, and paid txStateGas belong on Run Transaction.
run_bytecode
| Field | Required | Description |
|---|---|---|
bytecode | Yes | Hex-encoded bytecode (0x prefix optional). Max 24 576 bytes. |
accounts | No | BYOS prestate on this call (see below). |
fork | No | { baseHardfork, eips[] } — default glamsterdam. Use fusaka when the user asks for current-mainnet EL behavior |
gasLimit | No | Decimal string. Default 1000000. Max 30000000. |
trace | No | When true, include stack-only execution steps (max 10 000) |
accounts[]) Each run starts an empty world. To model “five accounts, two with 3 ETH, one unfunded, deploy this runtime bytecode at 0x…”, build accounts[] on the same run_bytecode call — the server does not invent demo state.
| Field | Meaning |
|---|---|
address | Hex address (required) |
balance | Wei as decimal string. Omit → default 1 ETH prefund; "0" → unfunded |
nonce | Decimal string. Default 0 |
code | Runtime bytecode already at this address (not CREATE) |
storage | { slot, value } hex words for existing-slot SLOAD/SSTORE |
bytecode (top-level) is the program executed at the lab address 0x00000000000000000000000000000000000000b1.accounts[]. Precompiles (0x05, 0x100, …) need no seeding.Example — 3 ETH sender and a contract already deployed:
{
"bytecode": "0x…",
"accounts": [
{ "address": "0x0000000000000000000000000000000000000001", "balance": "3000000000000000000" },
{ "address": "0x00000000000000000000000000000000000000aa", "code": "0x600100", "storage": [{ "slot": "0x00", "value": "0x01" }] }
]
}glamsterdam — preview fork ({ "baseHardfork": "glamsterdam", "eips": [] }; alias amsterdam). Default. EIP-8024 and other Glamsterdam EIPs are bundled in the hardfork — you do not need eips: [8024] for DUPN/SWAPN/EXCHANGE to work.fusaka — current mainnet EL ({ "baseHardfork": "fusaka", "eips": [] }; aliases osaka, mainnet-el). First-class for Fusaka twins (ModExp, P-256).When the user wants a before/after view, run the same bytecode twice on the pair from eipIntroductions / eips[].comparison (often predecessor vs introducedAt) and diff gasUsed, success, and optional steps. For a single-fork question, run once on the fork they named.
{
"bytecode": "0x600160026003600460056006600760086009600a600b600c600d600e600f60106011e68000",
"fork": { "baseHardfork": "fusaka", "eips": [] }
}Expected on baseline: success: false (invalid opcode 0xe6). Re-run with glamsterdam to see DUPN succeed.
| Field | Description |
|---|---|
success | Whether execution completed without revert |
gasUsed | Call-frame gas consumed (string). Does not include the 21,000 transaction intrinsic. |
gasUsedScope | Always call-frame |
stateGasSpilled | Present when non-zero (Glamsterdam new-slot SSTORE). Program write cost ≈ gasUsed − stateGasSpilled. |
returnValue | Hex return data |
finalStack | Stack after execution (hex strings). With trace: true, full stack from last step. |
error | Error message if execution failed (e.g. stack underflow) |
steps | Optional trace steps when trace is true |
logs | Raw logs emitted during execution (when any) |
decodedLogs | Indexed logs with optional decorations |
provenance | Always present — engineVersion, forkConfig, perEip spec snapshot; named eips[] also add a compact Spec: clause on caveat |
{
"bytecode": "0x600100",
"fork": { "baseHardfork": "glamsterdam", "eips": [] }
}Expected: success: true, gasUsed: "3".
{
"bytecode": "0x6001600260036004e88e00",
"fork": { "baseHardfork": "glamsterdam", "eips": [] },
"trace": true
}Pushes 1, 2, 3, 4, runs EXCHANGE, then STOP. Trace includes opcode EXCHANGE.
{
"bytecode": "0x600160026003600460056006600760086009600a600b600c600d600e600f60106011e68000",
"fork": { "baseHardfork": "glamsterdam", "eips": [] },
"trace": true
}Deep stack + DUPN — invalid on fusaka baseline; valid on Glamsterdam preview.
See Guarantees for ceilings (max gas, bytecode size, trace steps).