eth_getCode

Returns code at a given address.

Parameters

  1. Address.

  2. Quantity or tag - choose 1 of the following options:

    • A hexadecimal block number.

    • "earliest" - the earliest/genesis block.

    • "latest" - the latest mined block.

    • "pending" - the pending state/transactions.

Sample Request

curl https://lb.nodies.app/v1/<INSERT URL> \
   -H "x-api-key: <API-KEY>" \
   -X POST \
   -H "Content-Type: application/json" \
   -d '{ 
  "jsonrpc": "2.0",
  "method": "eth_getCode",
  "params": [
    "0x5B19bd330A84c049b62D5B0FC2bA120217a18C1C",
    "latest"
  ],
  "id": 1
}'

Sample Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x6080604052600436106100435760003560e01c80633659cfe61461005a5780634f1ef2861461009a5780635c60da1b14610127578063f851a4401461016557610052565b366100525761005061017a565b005b61005061017a565b34801561006657600080fd5b506100506004803603602081101561007d57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610194565b610050600480360360408110156100b057600080fd5b73ffffffffffffffffffffffffffffffffffffffff82351691908101906040810160208201356401000000008111156100e857600080fd5b8201836020820111156100fa57600080fd5b8035906020019184600183028401116401000000008311171561011c57600080fd5b5090925090506101e8565b34801561013357600080fd5b5061013c6102bc565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561017157600080fd5b5061013c610313565b610182610394565b61019261018d610428565b61044d565b565b61019c610471565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156101dd576101d881610495565b6101e5565b6101e561017a565b50565b6101f0610471565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102af5761022c83610495565b60008373ffffffffffffffffffffffffffffffffffffffff1683836040518083838082843760405192019450600093509091505080830381855af49150503d8060008114610296576040519150601f19603f3d011682016040523d82523d6000602084013e61029b565b606091505b50509050806102a957600080fd5b506102b7565b6102b761017a565b505050565b60006102c6610471565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561030857610301610428565b9050610310565b61031061017a565b90565b600061031d610471565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561030857610301610471565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061038c57508115155b949350505050565b61039c610471565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604281526020018061059b6042913960600191505060405180910390fd5b610192610192565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561046c573d6000f35b3d6000fd5b7f000000000000000000000000980205d352f198748b626f6f7c38a8a5663ec98190565b61049e816104e2565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6104eb81610358565b610540576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806105656036913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe5570677261646561626c6550726f78793a206e657720696d706c656d656e746174696f6e206973206e6f74206120636f6e74726163745472616e73706172656e745570677261646561626c6550726f78793a2061646d696e2063616e6e6f742066616c6c6261636b20746f2070726f787920746172676574a26469706673582212200f42fc9d1f991236ae26e240c8505def958528031655d7dd335d3988cc0c88f564736f6c63430007060033"
}

Last updated