Skip to main content

eth_simulateV1

Executes a sequence of message calls building on each other's state without creating transactions on the block chain, optionally overriding block and state data

Params

(2)

1. Payload (required)

blockStateCalls
Block State Calls
required

Definition of blocks that can contain calls and overrides

traceTransfers
boolean

Adds ETH transfers as ERC20 transfer events to the logs. These transfers have emitter contract parameter set as address(0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee). Default: false.

validation
boolean

When true, the eth_simulateV1 does all validations that a normal EVM would do, except contract sender and signature checks. When false, eth_simulateV1 behaves like eth_call. Default: false.

returnFullTransactions
boolean

When true, the method returns full transaction objects, otherwise, just hashes are returned.

2. Block tag

default: 'latest'

(any of)
string
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$

Result

(Result of calls)
error
required

Params

Payload

Unsupported field schema for field root_blockStateCalls: Missing items definition.

{
  "title": "Block State Calls",
  "type": "array",
  "properties": {
    "blockOverrides": {
      "title": "Block overrides",
      "type": "object",
      "properties": {
        "number": {
          "title": "Number",
          "type": "string",
          "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,15})$"
        },
        "prevRandao": {
          "title": "The Previous value of randomness beacon",
          "type": "string",
          "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,63})$"
        },
        "time": {
          "title": "Time",
          "type": "string",
          "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,15})$"
        },
        "gasLimit": {
          "title": "Gas limit",
          "type": "string",
          "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,15})$"
        },
        "feeRecipient": {
          "title": "Fee Recipient (also known as coinbase)",
          "type": "string",
          "pattern": "^0x[0-9a-fA-F]{40}$"
        },
        "baseFeePerGas": {
          "title": "Base fee per unit of gas",
          "type": "string",
          "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,63})$"
        },
        "withdrawals": {
          "title": "Withdrawals made by validators",
          "type": "array",
          "items": [
            {
              "type": "object",
              "title": "Validator withdrawal",
              "required": [
                "index",
                "validatorIndex",
                "address",
                "amount"
              ],
              "additionalProperties": false,
              "properties": {
                "index": {
                  "title": "index of withdrawal",
                  "type": "string",
                  "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,15})$"
                },
                "validatorIndex": {
                  "title": "index of validator that generated withdrawal",
                  "type": "string",
                  "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,15})$"
                },
                "address": {
                  "title": "recipient address for withdrawal value",
                  "type": "string",
                  "pattern": "^0x[0-9a-fA-F]{40}$"
                },
                "amount": {
                  "title": "value contained in withdrawal",
                  "type": "string",
                  "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,63})$"
                }
              }
            }
          ]
        },
        "blobBaseFee": {
          "title": "Base fee per unit of blob gas",
          "type": "string",
          "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,15})$"
        }
      }
    },
    "stateOverrides": {
      "title": "State overrides",
      "type": "object",
      "patternProperties": {
        "^0x[a-fA-F0-9]{40}$": {
          "title": "Details of an account to be overridden",
          "type": "object",
          "oneOf": [
            {
              "title": "Account override with whole storage replacement",
              "required": [
                "state"
              ],
              "properties": {
                "nonce": {
                  "title": "Nonce",
                  "type": "string",
                  "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,15})$"
                },
                "balance": {
                  "title": "Balance",
                  "type": "string",
                  "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,63})$"
                },
                "code": {
                  "title": "Code",
                  "type": "string",
                  "pattern": "^0x[0-9a-f]*$"
                },
                "movePrecompileToAddress": {
                  "title": "MovePrecompileToAddress",
                  "type": "string",
                  "pattern": "^0x[0-9a-fA-F]{40}$"
                },
                "state": {
                  "title": "Storage",
                  "type": "object",
                  "patternProperties": {
                    "^0x[a-fA-F0-9]{64}$": {
                      "title": "32 byte hex value",
                      "type": "string",
                      "pattern": "^0x[0-9a-f]{64}$"
                    }
                  },
                  "additionalProperties": false
                }
              }
            },
            {
              "title": "Account override with partial storage modification",
              "required": [
                "stateDiff"
              ],
              "properties": {
                "nonce": {
                  "title": "Nonce",
                  "type": "string",
                  "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,15})$"
                },
                "balance": {
                  "title": "Balance",
                  "type": "string",
                  "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,63})$"
                },
                "code": {
                  "title": "Code",
                  "type": "string",
                  "pattern": "^0x[0-9a-f]*$"
                },
                "movePrecompileToAddress": {
                  "title": "MovePrecompileToAddress",
                  "type": "string",
                  "pattern": "^0x[0-9a-fA-F]{40}$"
                },
                "stateDiff": {
                  "title": "Storage difference",
                  "type": "object",
                  "patternProperties": {
                    "^0x[a-fA-F0-9]{64}$": {
                      "title": "32 byte hex value",
                      "type": "string",
                      "pattern": "^0x[0-9a-f]{64}$"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "calls": {
      "type": "array",
      "title": "calls",
      "items": {
        "type": "object",
        "title": "Transaction object type for call",
        "properties": {
          "type": {
            "title": "type",
            "type": "string",
            "pattern": "^0x([0-9a-fA-F]?){1,2}$"
          },
          "nonce": {
            "title": "nonce",
            "type": "string",
            "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,15})$"
          },
          "to": {
            "title": "to address",
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$"
          },
          "from": {
            "title": "from address",
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$"
          },
          "gas": {
            "title": "gas limit",
            "type": "string",
            "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,15})$"
          },
          "value": {
            "title": "value",
            "type": "string",
            "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,63})$"
          },
          "input": {
            "title": "input data",
            "type": "string",
            "pattern": "^0x[0-9a-f]*$"
          },
          "gasPrice": {
            "title": "gas price",
            "type": "string",
            "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,63})$"
          },
          "maxPriorityFeePerGas": {
            "title": "max priority fee per gas",
            "type": "string",
            "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,63})$"
          },
          "maxFeePerGas": {
            "title": "max fee per gas",
            "type": "string",
            "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,63})$"
          },
          "maxFeePerBlobGas": {
            "title": "max fee per blob gas",
            "type": "string",
            "pattern": "^0x(0|[1-9a-f][0-9a-f]{0,63})$"
          },
          "accessList": {
            "title": "accessList",
            "type": "array",
            "items": {
              "title": "Access list entry",
              "type": "object",
              "additionalProperties": false,
              "required": [
                "address",
                "storageKeys"
              ],
              "properties": {
                "address": {
                  "title": "hex encoded address",
                  "type": "string",
                  "pattern": "^0x[0-9a-fA-F]{40}$"
                },
                "storageKeys": {
                  "type": "array",
                  "items": {
                    "title": "32 byte hex value",
                    "type": "string",
                    "pattern": "^0x[0-9a-f]{64}$"
                  }
                }
              }
            }
          },
          "blobVersionedHashes": {
            "title": "Blob versioned hashes",
            "type": "string",
            "pattern": "^0x[0-9a-f]{64}$"
          }
        }
      }
    }
  }
}

Block tag


Request

await window.ethereum.request({
"method": "eth_simulateV1",
"params": [
null,
null
]
});