overlay namespace
overlay_callConstructor
Re-runs the transaction that deployed the contract at address with code as its creation code and returns the runtime code that the constructor gives. Pass the result as a code state override to overlay_getLogs or eth_call. Needs the state of the parent of the creation block and of the blocks after it. If a contract deployed it, the code runs as a call from that contract on the state before the deploying transaction: ORIGIN is that contract, state that the deploying transaction writes before the deployment (for example, constructor parameters that a factory keeps in its storage) is not there, and the transactions before it in the block also see the code at address and, for a constructor that gets ETH, the value added to the balance of that contract. An address whose code was removed and deployed again can give an earlier deployment.
- Parameters
- Request
- Response
-
address: string (address) -
code: string (hex data)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "overlay_callConstructor",
"params": [address, code]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result: object
code: string (hex data)
result may be null in a successful response.
overlay_getLogs
Re-executes the blocks in the filter range with the state overrides applied to the state before each block and returns the logs that match the filter, as eth_getLogs does. A block hash can select a block that is not canonical only when the range is that one block. Needs the state of each block in the range.
- Parameters
- Request
- Response
-
filter: objectaddress: string (address), array of string (address), ornullblockHash: string (hash, not allowed withfromBlockortoBlock)fromBlock: string (block number or hash or either ofearliest,finalized,latest,pending, orsafe) or integer (block number)toBlock: string (block number or hash or either ofearliest,finalized,latest,pending, orsafe) or integer (block number)topics: array of (string (hash), array of string (hash), ornull)useIndex: boolean
-
stateOverride: map of object
balance: string (hex integer)code: string (hex data)movePrecompileToAddress: string (address)nonce: string (hex integer)state: map of string (hash)stateDiff: map of string (hash)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "overlay_getLogs",
"params": [filter, stateOverride]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result: array of object
address: string (address)blockHash: string (hash)blockNumber: string (hex integer)blockTimestamp: string (hex integer)data: string (hex data)logIndex: string (hex integer)removed: booleantopics: array of string (hash)transactionHash: string (hash)transactionIndex: string (hex integer)