Multicall2

Michael Elliot <mike@makerdao.com>Joshua Levine <joshua@makerdao.com>Nick Johnson <arachnid@notdot.net>

Multicall2 - Aggregate results from multiple read-only function calls

Methods

aggregate

function aggregate(Multicall2.Call[] calls) external nonpayable returns (uint256 blockNumber, bytes[] returnData)

Parameters

NameTypeDescription

calls

Multicall2.Call[]

undefined

Returns

NameTypeDescription

blockNumber

uint256

undefined

returnData

bytes[]

undefined

blockAndAggregate

function blockAndAggregate(Multicall2.Call[] calls) external nonpayable returns (uint256 blockNumber, bytes32 blockHash, struct Multicall2.Result[] returnData)

Parameters

NameTypeDescription

calls

Multicall2.Call[]

undefined

Returns

NameTypeDescription

blockNumber

uint256

undefined

blockHash

bytes32

undefined

returnData

Multicall2.Result[]

undefined

getBlockHash

function getBlockHash(uint256 blockNumber) external view returns (bytes32 blockHash)

Parameters

NameTypeDescription

blockNumber

uint256

undefined

Returns

NameTypeDescription

blockHash

bytes32

undefined

getBlockNumber

function getBlockNumber() external view returns (uint256 blockNumber)

Returns

NameTypeDescription

blockNumber

uint256

undefined

getCurrentBlockCoinbase

function getCurrentBlockCoinbase() external view returns (address coinbase)

Returns

NameTypeDescription

coinbase

address

undefined

getCurrentBlockDifficulty

function getCurrentBlockDifficulty() external view returns (uint256 difficulty)

Returns

NameTypeDescription

difficulty

uint256

undefined

getCurrentBlockGasLimit

function getCurrentBlockGasLimit() external view returns (uint256 gaslimit)

Returns

NameTypeDescription

gaslimit

uint256

undefined

getCurrentBlockTimestamp

function getCurrentBlockTimestamp() external view returns (uint256 timestamp)

Returns

NameTypeDescription

timestamp

uint256

undefined

getEthBalance

function getEthBalance(address addr) external view returns (uint256 balance)

Parameters

NameTypeDescription

addr

address

undefined

Returns

NameTypeDescription

balance

uint256

undefined

getLastBlockHash

function getLastBlockHash() external view returns (bytes32 blockHash)

Returns

NameTypeDescription

blockHash

bytes32

undefined

tryAggregate

function tryAggregate(bool requireSuccess, Multicall2.Call[] calls) external nonpayable returns (struct Multicall2.Result[] returnData)

Parameters

NameTypeDescription

requireSuccess

bool

undefined

calls

Multicall2.Call[]

undefined

Returns

NameTypeDescription

returnData

Multicall2.Result[]

undefined

tryBlockAndAggregate

function tryBlockAndAggregate(bool requireSuccess, Multicall2.Call[] calls) external nonpayable returns (uint256 blockNumber, bytes32 blockHash, struct Multicall2.Result[] returnData)

Parameters

NameTypeDescription

requireSuccess

bool

undefined

calls

Multicall2.Call[]

undefined

Returns

NameTypeDescription

blockNumber

uint256

undefined

blockHash

bytes32

undefined

returnData

Multicall2.Result[]

undefined

Last updated