Multicall3
Sonic0xca11bde05977b3631167028862be2a173976ca11
Solidity v0.8.12+commit.f00d7308
Overview
Read Functions
Can revert if the BASEFEE opcode is not implemented by the given chain
Returns
| Name | Type | Description |
|---|---|---|
| basefee | uint256 |
Returns the block hash for the given block number
Parameters
| Name | Type | Description |
|---|---|---|
| blockNumber | uint256 | The block number |
Returns
| Name | Type | Description |
|---|---|---|
| blockHash | bytes32 |
Returns the block number
Returns
| Name | Type | Description |
|---|---|---|
| blockNumber | uint256 |
Returns the chain id
Returns
| Name | Type | Description |
|---|---|---|
| chainid | uint256 |
Returns the block coinbase
Returns
| Name | Type | Description |
|---|---|---|
| coinbase | address |
Returns the block difficulty
Returns
| Name | Type | Description |
|---|---|---|
| difficulty | uint256 |
Returns the block gas limit
Returns
| Name | Type | Description |
|---|---|---|
| gaslimit | uint256 |
Returns the block timestamp
Returns
| Name | Type | Description |
|---|---|---|
| timestamp | uint256 |
Returns the (ETH) balance of a given address
Parameters
| Name | Type | Description |
|---|---|---|
| addr | address |
Returns
| Name | Type | Description |
|---|---|---|
| balance | uint256 |
Returns the block hash of the last block
Returns
| Name | Type | Description |
|---|---|---|
| blockHash | bytes32 |
Write Functions
Backwards-compatible call aggregation with Multicall
Parameters
| Name | Type | Description |
|---|---|---|
| calls | tuple[] | An array of Call structs |
Returns
| Name | Type | Description |
|---|---|---|
| blockNumber | uint256 | blockNumber The block number where the calls were executed |
| returnData | bytes[] | returnData An array of bytes containing the responses |
Aggregate calls, ensuring each returns success if required
Parameters
| Name | Type | Description |
|---|---|---|
| calls | tuple[] | An array of Call3 structs |
Returns
| Name | Type | Description |
|---|---|---|
| returnData | tuple[] | returnData An array of Result structs |
Reverts if msg.value is less than the sum of the call values
Parameters
| Name | Type | Description |
|---|---|---|
| calls | tuple[] | An array of Call3Value structs |
Returns
| Name | Type | Description |
|---|---|---|
| returnData | tuple[] | returnData An array of Result structs |
Aggregate calls and allow failures using tryAggregate
Parameters
| Name | Type | Description |
|---|---|---|
| calls | tuple[] | An array of Call structs |
Returns
| Name | Type | Description |
|---|---|---|
| blockNumber | uint256 | blockNumber The block number where the calls were executed |
| blockHash | bytes32 | blockHash The hash of the block where the calls were executed |
| returnData | tuple[] | returnData An array of Result structs |
Aggregate calls without requiring success
Parameters
| Name | Type | Description |
|---|---|---|
| requireSuccess | bool | If true, require all calls to succeed |
| calls | tuple[] | An array of Call structs |
Returns
| Name | Type | Description |
|---|---|---|
| returnData | tuple[] | returnData An array of Result structs |
Aggregate calls and allow failures using tryAggregate
Parameters
| Name | Type | Description |
|---|---|---|
| requireSuccess | bool | |
| calls | tuple[] | An array of Call structs |
Returns
| Name | Type | Description |
|---|---|---|
| blockNumber | uint256 | blockNumber The block number where the calls were executed |
| blockHash | bytes32 | blockHash The hash of the block where the calls were executed |
| returnData | tuple[] | returnData An array of Result structs |