Multicall

This contract is designed to aggregate multiple calls into a single call, which can be useful for reducing the number of separate Ethereum calls a client needs to make. It also provides several helper

Aggregate

This function takes an array of Call structs, each containing a target address and call data, and executes each call. It returns the block number at the time of execution and an array of bytes arrays containing the return data from each call.

Example Input:

Multicall.aggregate(
    Multicall.Call[] memory calls
);

Example Output:

// Returns the block number at the time of execution and an array of bytes arrays containing the return data from each call.

Get Eth Balance

This function returns the Ether balance of a given address.

Example Input:

Multicall.getEthBalance(
    address addr
);

Example Output:

// Returns the Ether balance of the given address.

Get Block Hash

This function returns the block hash of a given block number.

Example Input:

Multicall.getBlockHash(
    uint256 blockNumber
);

Example Output:

// Returns the block hash of the given block number.

Get Last Block Hash

This function returns the block hash of the last block.

Example Input:

Multicall.getLastBlockHash();

Example Output:

// Returns the block hash of the last block.

Get Current Block Timestamp

This function returns the timestamp of the current block.

Example Input:

Multicall.getCurrentBlockTimestamp();

Example Output:

// Returns the difficulty of the current block.

Get Current Block Gas Limit

This function returns the gas limit of the current block.

Example Input:

Multicall.getCurrentBlockGasLimit();

Example Output:

// Returns the gas limit of the current block.

Get Current Block Coinbase

This function returns the coinbase (miner's address) of the current block.

Example Input:

Multicall.getCurrentBlockCoinbase();

Example Output:

// Returns the coinbase (miner's address) of the current block.

Last updated