Base
هل أنت مستعد لاستدعاء هذا في الإنتاج؟
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Base
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
eth_getCode returns the EVM bytecode deployed at an address on Base, the Coinbase-built OP Stack optimistic rollup that settles to Ethereum L1 and uses ETH for gas. Because Base runs a standard EVM, the bytecode you read back here is byte-identical to what the same contract would carry on Ethereum mainnet. Point the call at https://base.therpc.io/YOUR_API_KEY (chain ID 8453, hex 0x2105) and pass an address plus a block tag. The result is the hex-encoded bytecode at the specified block, or "0x" when the address is an EOA, was self-destructed, or held no code at that height.
"0x" result means a plain wallet, anything longer means a deployed contract on Base.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 1 | address | string (hex) | نعم | The address to read code from. |
| 2 | blockTag | string | لا | Block at which to read the code.الافتراضي: latest |
| النوع | الوصف |
|---|---|
| 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 Base playground.
| الكود | الرسالة | السبب |
|---|---|---|
-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 is ambiguous: it covers both EOAs and self-destructed contracts, so absence of code alone does not tell you which case you hit — cross-check with eth_getTransactionCount or history if it matters.eth_getStorageAt to find the logic contract.Missing trie node error.المعاملات
0x-prefixed 20-byte address
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"