BaseCallParams
BaseCallParams<
TThrowOnFail
>:BaseParams
<TThrowOnFail
> &object
Properties shared across call-like params. This type is used as the base for various call-like parameter types:
Type declaration
blobVersionedHashes?
readonly
optional
blobVersionedHashes:Hex
[]
Versioned hashes for each blob in a blob transaction for EIP-4844 transactions.
blockOverrideSet?
readonly
optional
blockOverrideSet:BlockOverrideSet
The fields of this optional object customize the block as part of which the call is simulated.
The object contains fields such as block number, hash, parent hash, nonce, etc.
This option cannot be used when createTransaction
is set to true
.
Setting the block number to a past block will not run in the context of that block’s state. To do that, fork that block number first.
Example
blockTag?
readonly
optional
blockTag:BlockParam
The block number or block tag to execute the call at. Defaults to latest
.
bigint
: The block number to execute the call at.Hex
: The block hash to execute the call at.BlockTag
: The named block tag to execute the call at.
Notable block tags:
- ‘latest’: The canonical head.
- ‘pending’: A block that is optimistically built with transactions in the txpool that have not yet been mined.
- ‘forked’: If forking, the ‘forked’ block will be the block the chain was forked at.
caller?
readonly
optional
caller:Address
The address that ran this code (msg.sender
). Defaults to the zero address.
If the from
address is set, it defaults to the from
address; otherwise, it defaults to the zero address.
createAccessList?
readonly
optional
createAccessList:boolean
Whether to return an access list mapping of addresses to storage keys.
Defaults to false
.
Example
createTrace?
readonly
optional
createTrace:boolean
Whether to return a complete trace with the call.
Defaults to false
.
Example
createTransaction?
readonly
optional
createTransaction:"on-success"
|"always"
|"never"
|boolean
Whether or not to update the state or run the call in a dry-run. Defaults to never
.
on-success
: Only update the state if the call is successful.always
: Always include the transaction even if it reverts.never
: Never include the transaction.true
: Alias foron-success
.false
: Alias fornever
.
Example
depth?
readonly
optional
depth:number
The depth of the EVM call. Useful for simulating an internal call. Defaults to 0
.
from?
readonly
optional
from:Address
The from address for the call. Defaults to the zero address for reads and the first account for writes.
It is also possible to set the origin
and caller
addresses separately using those options. Otherwise, both are set to the from
address.
gas?
readonly
optional
gas:bigint
The gas limit for the call. Defaults to the block gas limit as specified by the common configuration or the fork URL.
gasPrice?
readonly
optional
gasPrice:bigint
The gas price for the call. Note: This option is currently ignored when creating transactions because only EIP-1559 transactions are supported. This will be fixed in a future release.
gasRefund?
readonly
optional
gasRefund:bigint
The refund counter. Defaults to 0
.
maxFeePerGas?
readonly
optional
maxFeePerGas:bigint
The maximum fee per gas for EIP-1559 transactions.
maxPriorityFeePerGas?
readonly
optional
maxPriorityFeePerGas:bigint
The maximum priority fee per gas for EIP-1559 transactions.
origin?
readonly
optional
origin:Address
The address where the call originated from. Defaults to the zero address.
If the from
address is set, it defaults to the from
address; otherwise, it defaults to the zero address.
selfdestruct?
readonly
optional
selfdestruct:Set
<Address
>
Addresses to selfdestruct. Defaults to an empty set.
skipBalance?
readonly
optional
skipBalance:boolean
Whether to skip the balance check. Defaults to false
, except for scripts where it is set to true
.
stateOverrideSet?
readonly
optional
stateOverrideSet:StateOverrideSet
The state override set is an optional address-to-state mapping where each entry specifies some state to be ephemerally overridden prior to executing the call. Each address maps to an object containing:
This option cannot be used when createTransaction
is set to true
.
Example
to?
readonly
optional
to:Address
The address of the account executing this code (address(this)
). Defaults to the zero address.
This is not set for create transactions but is required for most transactions.
value?
readonly
optional
value:bigint
The value in ether that is being sent to the to
address. Defaults to 0
.
Type Parameters
• TThrowOnFail extends boolean
= boolean