> For the complete documentation index, see [llms.txt](https://docs.papaya.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.papaya.finance/protocol/advanced-features/multicall.md).

# 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
