# Multicall

### multicall

Executes multiple calls in a single transaction.

```solidity
function multicall(bytes[] data) external returns (bytes[] memory results)
```

#### Parameters

* `data` (bytes\[]): Array of encoded function calls

#### Description

Executes multiple function calls in a single transaction. This is useful for batching operations to save gas and ensure atomicity.

#### Example

```javascript
// Execute multiple calls in one transaction
const calls = [
  papayaContract.interface.encodeFunctionData("deposit", [ethers.utils.parseEther("100"), false]),
  papayaContract.interface.encodeFunctionData("subscribe", ["0xauthor...", ethers.utils.parseEther("0.001"), 1])
];

const results = await papayaContract.multicall(calls);
```

### Related Errors

* [FailedCall](https://app.gitbook.com/o/qmYNDgxzLtvTeLBHbPpz/s/crhGDzgi59PyfFaJtlVP/~/changes/67/protocol/error-codes#failedcall): When any of the multicall operations fail


---

# 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://docs.papaya.finance/protocol/advanced-features/multicall.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.
