eth_getCode(Pre-Alpha) - Scroll

Returns code at a given address.

This method can be used to distinguish between contract addresses and wallet addresses.

Parameters

  • DATA, 20 Bytes - address
  • QUANTITY|TAG - Integer block number, or the string "latest", "earliest" or "pending", see the default block parameter.
params: ["0xb59f67a8bff5d8cd03f6ac17265c550ed8f33907", "latest"];

Returns

DATA - The code from the given address.

Example

Request

curl --location --request POST 'https://scroll-prealpha.unifra.io/v1/0363ea17bd324c91bb4c6d6f3f1c5f45' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc":"2.0",
    "method":"eth_getCode",
    "params":["0x3bA3B56f992bB8FDB946B8f5E33310f86560359B", "latest"],
    "id":0
}'

Result

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": "0x"
}
Language
Click Try It! to start a request and see the response here!