post https://zksync-era-mainnet.unifra.io/v1/
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://zksync-era-mainnet.unifra.io/v1/your-api-key' \
--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"
}