eth
eth_getCode
Returns the compiled bytecode of a smart contract at the given address. Returns "0x" for externally owned accounts (EOAs) that have no contract code.
Returns the compiled bytecode of a smart contract at the given address. Returns "0x" for externally owned accounts (EOAs) that have no contract code.
Parameters
| # | Type | Description |
|---|---|---|
| 1 | string | The address of the contract (20 bytes). |
| 2 | string | Block number as a hex string, or a block tag ("latest", "earliest", "pending"). |
Returns
string -- The bytecode at the given address as a hexadecimal string, or "0x" if no code is present.
Example
curl -s -X POST https://rpc.pulsechain.box \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": ["0xA1077a294dDE1B09bB078844df40758a5D0f9a27", "latest"],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x6060604052600436106100af576000357c..."
}
TRY IT
Notes
- The example address
0xA1077a294dDE1B09bB078844df40758a5D0f9a27is the Wrapped PLS (WPLS) contract on PulseChain. - A result of
"0x"means the address is an EOA (externally owned account) with no deployed contract code. - As a full archive node, you can query the bytecode at any historical block to inspect contracts before and after upgrades or self-destructs.
- The returned bytecode is the runtime bytecode (deployed code), not the creation bytecode used during deployment.
- The response is truncated in the example above; the actual WPLS contract bytecode is significantly longer.
eth_getTransactionCount
Returns the number of transactions sent from an address (the account nonce). This value is used to determine the next valid nonce when constructing a new transaction.
eth_getStorageAt
Returns the value stored at a specific storage position of a contract. This allows direct inspection of a contract's internal state without calling a view function.
