Skip to main content

eth_getCode

POST

Returns the runtime bytecode deployed at a contract address.Querying a regular account returns 0x.
param[0]
addressstringrequired
A TRON account address. It is not a Base58 address but the 20-byte form obtained by removingthe 41 prefix from the TRON hexadecimal address. (e.g.) TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t41a614f803b6fd780986a42c78ec9c7f77e6ded13c0xa614f803b6fd780986a42c78ec9c7f77e6ded13c
param[1]
blockTagstringrequired
The block to query. TRON currently supports only latest.
Responses
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "ERROR_CODE",
"message": "Unauthorized"
}
cURL
curl -X POST 'https://tron-mainnet.nodit.io' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getCode",
"params": [
"0xa614f803b6fd780986a42c78ec9c7f77e6ded13c",
"latest"
]
}'