Multicall3
Sonic0xca11bde05977b3631167028862be2a173976ca11
Solidity v0.8.12+commit.f00d7308
概览
读取函数
Can revert if the BASEFEE opcode is not implemented by the given chain
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| basefee | uint256 |
Returns the block hash for the given block number
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| blockNumber | uint256 | The block number |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| blockHash | bytes32 |
Returns the block number
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| blockNumber | uint256 |
Returns the chain id
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| chainid | uint256 |
Returns the block coinbase
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| coinbase | address |
Returns the block difficulty
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| difficulty | uint256 |
Returns the block gas limit
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| gaslimit | uint256 |
Returns the block timestamp
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| timestamp | uint256 |
Returns the (ETH) balance of a given address
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| addr | address |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| balance | uint256 |
Returns the block hash of the last block
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| blockHash | bytes32 |
写入函数
Backwards-compatible call aggregation with Multicall
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| calls | tuple[] | An array of Call structs |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| 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
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| calls | tuple[] | An array of Call3 structs |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| returnData | tuple[] | returnData An array of Result structs |
Reverts if msg.value is less than the sum of the call values
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| calls | tuple[] | An array of Call3Value structs |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| returnData | tuple[] | returnData An array of Result structs |
Aggregate calls and allow failures using tryAggregate
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| calls | tuple[] | An array of Call structs |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| 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
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| requireSuccess | bool | If true, require all calls to succeed |
| calls | tuple[] | An array of Call structs |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| returnData | tuple[] | returnData An array of Result structs |
Aggregate calls and allow failures using tryAggregate
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| requireSuccess | bool | |
| calls | tuple[] | An array of Call structs |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| 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 |