Arbitrum One
Arbitrum One
Arbitrum One
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
eth_getCode returns the EVM bytecode deployed at an address on Arbitrum One, the Optimistic Rollup (chain ID 42161) where gas is paid in ETH and the Nitro/ArbOS stack runs the same EVM bytecode you would deploy on Ethereum L1. Point your call at https://arbitrum.therpc.io/YOUR_API_KEY, pass an address and a block tag, and the method returns the deployed bytecode at that address as of the specified block — or 0x if the account holds no code there.
0x — useful before routing a transfer or a contract call on Arbitrum One.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | address | string (hex) | Sí | The address to read code from. |
| 2 | blockTag | string | No | Block at which to read the code.Predeterminado: latest |
| Tipo | Descripción |
|---|---|
| string (hex) | Hex-encoded EVM bytecode, or "0x" if the address is an EOA, the contract was self-destructed, or no code existed at that block. |
Try it live in the Arbitrum One playground.
| Código | Mensaje | Causa |
|---|---|---|
-32602 | Invalid params | Address is malformed or block tag is unrecognised. |
-32000 | Missing trie node | Historical block has been pruned on a non-archive node. |
0x result means "no code here" — it cannot, on its own, distinguish a plain EOA from a contract that was self-destructed; cross-check with eth_getTransactionCount or history if you need to know which.eth_getStorageAt, then call eth_getCode on that address.Parámetros
0x-prefixed 20-byte address
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"