EVM
Archive
eth_getCode
Summary: Get smart contract code
This request returns the compiled byte code of a smart contract, if any, at a given address and block.
Parameters
address string
requiredHex-encoded address.
Pattern: ^0x[0-9a-fA-F]{40}$
block anyOf
requiredBlock number, block hash, or string tag.
Returns
The compiled byte code of the smart contract at the given address. Linea stores compiled smart contract code as a hexadecimal value.
eth_getCodeResponse string
The compiled byte code of the smart contract at the given address. Linea stores compiled smart contract code as a hexadecimal value.
Pattern: ^0x[0-9a-f]*$
Customize request
Parameter
Value
Request
CURL
curl https://linea-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": ["0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f","0x927cf4"],
"id": 1
}'
Example response
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x6060604052600436106100af576000357c01000000000...."
}