curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": [
"0x5555555555555555555555555555555555555555",
"latest"
],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063a9059cbb1461003b578063dd62ed3e14610057575b600080fd5b610055600480360381019061005091906101a7565b610087565b005b610071600480360381019061006c91906101e7565b6100a5565b60405161007e9190610236565b60405180910390f35b8173ffffffffffffffffffffffffffffffffffffffff16ff5b60008173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156100e0576000905061012c565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610120576001905061012c565b60009050610131565b809150505b92915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061016782610138565b9050919050565b6101778161015c565b811461018257600080fd5b50565b6000813590506101948161016e565b92915050565b6000819050919050565b6101ad8161019a565b81146101b857600080fd5b50565b6000813590506101ca816101a4565b92915050565b600080604083850312156101e7576101e6610133565b5b60006101f585828601610185565b9250506020610206858286016101bb565b9150509250929050565b600080604083850312156102275761022661013357600080fd5b5b600061023585828601610185565b925050602061024685828601610185565b9150509250929050565b6102598161019a565b82525050565b60006020820190506102746000830184610250565b9291505056fea2646970667358221220..."
}
Returns the bytecode of a smart contract at a given address and block.
curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": [
"0x5555555555555555555555555555555555555555",
"latest"
],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063a9059cbb1461003b578063dd62ed3e14610057575b600080fd5b610055600480360381019061005091906101a7565b610087565b005b610071600480360381019061006c91906101e7565b6100a5565b60405161007e9190610236565b60405180910390f35b8173ffffffffffffffffffffffffffffffffffffffff16ff5b60008173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156100e0576000905061012c565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610120576001905061012c565b60009050610131565b809150505b92915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061016782610138565b9050919050565b6101778161015c565b811461018257600080fd5b50565b6000813590506101948161016e565b92915050565b6000819050919050565b6101ad8161019a565b81146101b857600080fd5b50565b6000813590506101ca816101a4565b92915050565b600080604083850312156101e7576101e6610133565b5b60006101f585828601610185565b9250506020610206858286016101bb565b9150509250929050565b600080604083850312156102275761022661013357600080fd5b5b600061023585828601610185565b925050602061024685828601610185565b9150509250929050565b6102598161019a565b82525050565b60006020820190506102746000830184610250565b9291505056fea2646970667358221220..."
}
eth_getCode
JSON-RPC method returns the bytecode of a smart contract at a given address and block. This method is essential for contract verification, analysis, and determining whether an address contains a smart contract or is an externally owned account (EOA).
address
(string, required) — The 20-byte address to retrieve code fromblock
(string, required) — Block identifier: "latest"
(only the latest block is supported on Hyperliquid)"0x"
if no code exists at the address.
"latest"
block parameter is supported"0x"
indicates an externally owned account (EOA)curl -X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getCode","params":["0x5555555555555555555555555555555555555555","latest"],"id":1}' \
https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm
eth_getCode
method is essential for applications that need to:
eth_getCode
only supports the latest block. The returned bytecode is the runtime code deployed on the blockchain, not the constructor code. For EOAs (externally owned accounts), this method returns "0x"
.Successful response with the contract bytecode
The response is of type object
.