Avalanche
هل أنت مستعد لاستدعاء هذا في الإنتاج؟
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Avalanche
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
eth_getCode returns the deployed EVM bytecode stored at an address on the Avalanche C-Chain at a chosen block. The C-Chain is the contract-running chain of the Avalanche primary network, so this is how you read the on-chain code behind protocols like Aave, Trader Joe, or GMX, all of which pay gas in AVAX. An externally owned account (EOA) has no code and returns "0x". Point the request at https://avalanche.therpc.io/YOUR_API_KEY (chain ID 43114, 0xa86a) and the node replies with the hex-encoded bytecode at the given address and block.
"0x" result means no code lives at that C-Chain address.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 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 Avalanche 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 returned for both EOAs and self-destructed contracts; the absence of code alone does not tell you which case you are looking at.eth_getStorageAt to read the logic contract.المعاملات
0x-prefixed 20-byte address
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"