Skip to main content
Returns the compiled bytecode at a given address. Returns "0x" for externally owned accounts (EOAs).
Since Denim, Base produces a canonical block every 200ms and Flashblocks are retired. The "pending" tag is still accepted, but it no longer returns Flashblocks preconfirmation state. Use "latest" for the newest canonical state. See Migrate From Flashblocks.

Parameters

string
required
The 20-byte address to query.
string
required
Block number in hex, or "latest", "pending", "safe", "finalized", "earliest".

Returns

string
The bytecode at the address as a hex string. "0x" if there is no code.

Example