Skip to Content
API ReferenceContracts

Contracts

Simulate Call

Execute a read-only contract call (eth_call) without submitting a transaction. Use this to read contract state, test function calls, or preview transaction results.

The data parameter should be the ABI-encoded function selector and arguments. For example, to call balanceOf(address) on an ERC-20:

  • Function selector: 0x70a08231
  • Address padded to 32 bytes: 000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045

simulateCall

Executes a contract call locally without sending a transaction (eth_call). Returns the raw return data. Useful for reading contract state, testing function calls, or simulating transactions before submission.

curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
  -H "Content-Type: application/json" \
{
  "jsonrpc": "2.0",
  "method": "simulateCall",
  "params": {
    "chain": "ethereum",
    "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "data": "0x70a08231000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045"
  },
  "id": 1
}

Parameters

NameRequiredDescription
chainyesNetwork slug
toyesContract address
e.g. 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
datayesABI-encoded function call data
e.g. 0x70a08231000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045
fromnoCaller address
valuenoETH value in hex wei
blocknoBlock number (hex) or "latest"

Response Fields

FieldType
dataobject
chainstring
resultstring

Supported Networks

EthereumPolygonBNB ChainOptimismBaseAvalancheArbitrumGnosisMoonbeamLineaHyperliquid
Try It
{
  "jsonrpc": "2.0",
  "method": "simulateCall",
  "params": {
    "chain": "ethereum",
    "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "data": "0x70a08231000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045"
  },
  "id": 1
}

Get Contract Code

Check whether an address is a contract or an EOA. Returns the deployed bytecode and its size in bytes.

getCode

Returns the bytecode deployed at an address. If the result is "0x", the address is an EOA (externally owned account), not a contract. Also returns the bytecode size in bytes.

curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
  -H "Content-Type: application/json" \
{
  "jsonrpc": "2.0",
  "method": "getCode",
  "params": {
    "chain": "ethereum",
    "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "blockHeight": 19834521
  },
  "id": 1
}

Parameters

NameRequiredDescription
chainyesNetwork slug
addressyesAddress to check
e.g. 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
blockHeightnoHistorical EVM block number (archive nodes only)
e.g. 19834521

Response Fields

FieldType
dataobject
chainstring
addressstring
blockHeightinteger
isContractboolean
bytecodeSizeinteger
bytecodestring

Supported Networks

EthereumPolygonBNB ChainOptimismBaseAvalancheArbitrumGnosisMoonbeamLineaHyperliquid
Try It
{
  "jsonrpc": "2.0",
  "method": "getCode",
  "params": {
    "chain": "ethereum",
    "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "blockHeight": 19834521
  },
  "id": 1
}