curl --request POST \
--url https://base-mainnet.core.chainstack.com/2fc1de7f08c0465f6a28e3c355e0cb14 \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getCode",
"id": 1,
"params": [
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"latest"
]
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}
Base API method eth_getCode
retrieves the code stored at a specific address. This method is typically used to inspect the bytecode of smart contracts on the Base blockchain.
This example retrieves the bytecode of the USDC token on the Base Mainnet.
Get you own node endpoint today
Start for free and get your app to production levels immediately. No credit card required.
You can sign up with your GitHub, X, Google, or Microsoft account.
address
— the address to get the code from.block
— the block number (in hexadecimal) or one of the strings "earliest"
, "latest"
, or "pending"
, indicating the state to consider. The default is "latest"
.result
— the code from the specified address, returned as a hexadecimal string.The eth_getCode
method is essential for:
The code from the specified address
The response is of type object
.
Was this page helpful?
curl --request POST \
--url https://base-mainnet.core.chainstack.com/2fc1de7f08c0465f6a28e3c355e0cb14 \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getCode",
"id": 1,
"params": [
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"latest"
]
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}
curl --request POST \
--url https://base-mainnet.core.chainstack.com/2fc1de7f08c0465f6a28e3c355e0cb14 \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getCode",
"id": 1,
"params": [
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"latest"
]
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}
Base API method eth_getCode
retrieves the code stored at a specific address. This method is typically used to inspect the bytecode of smart contracts on the Base blockchain.
This example retrieves the bytecode of the USDC token on the Base Mainnet.
Get you own node endpoint today
Start for free and get your app to production levels immediately. No credit card required.
You can sign up with your GitHub, X, Google, or Microsoft account.
address
— the address to get the code from.block
— the block number (in hexadecimal) or one of the strings "earliest"
, "latest"
, or "pending"
, indicating the state to consider. The default is "latest"
.result
— the code from the specified address, returned as a hexadecimal string.The eth_getCode
method is essential for:
The code from the specified address
The response is of type object
.
Was this page helpful?
curl --request POST \
--url https://base-mainnet.core.chainstack.com/2fc1de7f08c0465f6a28e3c355e0cb14 \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getCode",
"id": 1,
"params": [
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"latest"
]
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}