# 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

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

#### Parameters

| Name  | Type               | Description |
| ----- | ------------------ | ----------- |
| calls | Multicall2.Call\[] | undefined   |

#### Returns

| Name        | Type     | Description |
| ----------- | -------- | ----------- |
| blockNumber | uint256  | undefined   |
| returnData  | bytes\[] | undefined   |

### blockAndAggregate

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

#### Parameters

| Name  | Type               | Description |
| ----- | ------------------ | ----------- |
| calls | Multicall2.Call\[] | undefined   |

#### Returns

| Name        | Type                 | Description |
| ----------- | -------------------- | ----------- |
| blockNumber | uint256              | undefined   |
| blockHash   | bytes32              | undefined   |
| returnData  | Multicall2.Result\[] | undefined   |

### getBlockHash

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

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| blockNumber | uint256 | undefined   |

#### Returns

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| blockHash | bytes32 | undefined   |

### getBlockNumber

```solidity
function getBlockNumber() external view returns (uint256 blockNumber)
```

#### Returns

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| blockNumber | uint256 | undefined   |

### getCurrentBlockCoinbase

```solidity
function getCurrentBlockCoinbase() external view returns (address coinbase)
```

#### Returns

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| coinbase | address | undefined   |

### getCurrentBlockDifficulty

```solidity
function getCurrentBlockDifficulty() external view returns (uint256 difficulty)
```

#### Returns

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| difficulty | uint256 | undefined   |

### getCurrentBlockGasLimit

```solidity
function getCurrentBlockGasLimit() external view returns (uint256 gaslimit)
```

#### Returns

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| gaslimit | uint256 | undefined   |

### getCurrentBlockTimestamp

```solidity
function getCurrentBlockTimestamp() external view returns (uint256 timestamp)
```

#### Returns

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| timestamp | uint256 | undefined   |

### getEthBalance

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

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| addr | address | undefined   |

#### Returns

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| balance | uint256 | undefined   |

### getLastBlockHash

```solidity
function getLastBlockHash() external view returns (bytes32 blockHash)
```

#### Returns

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| blockHash | bytes32 | undefined   |

### tryAggregate

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

#### Parameters

| Name           | Type               | Description |
| -------------- | ------------------ | ----------- |
| requireSuccess | bool               | undefined   |
| calls          | Multicall2.Call\[] | undefined   |

#### Returns

| Name       | Type                 | Description |
| ---------- | -------------------- | ----------- |
| returnData | Multicall2.Result\[] | undefined   |

### tryBlockAndAggregate

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

#### Parameters

| Name           | Type               | Description |
| -------------- | ------------------ | ----------- |
| requireSuccess | bool               | undefined   |
| calls          | Multicall2.Call\[] | undefined   |

#### Returns

| Name        | Type                 | Description |
| ----------- | -------------------- | ----------- |
| blockNumber | uint256              | undefined   |
| blockHash   | bytes32              | undefined   |
| returnData  | Multicall2.Result\[] | undefined   |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://contracts.synapseprotocol.com/amm/helper/multicall2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
