> For the complete documentation index, see [llms.txt](https://docs.vela.exchange/vela-knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vela.exchange/vela-knowledge-base/developers/contract-functions/multicall.md).

# Multicall

### 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:

```solidity
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:**

```solidity
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:**

```solidity
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:**

```solidity
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:**

```solidity
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:**

```solidity
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:**

```solidity
Multicall.getCurrentBlockCoinbase();
```

**Example Output:**

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.vela.exchange/vela-knowledge-base/developers/contract-functions/multicall.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
