Multicall
import "@thirdweb-dev/contracts/extension/Multicall.sol";
The Multicall
smart contract is an extension usable with any base smart contract. It provides a function multicall
to batch together multiple calls in a single external call.
It is recommended to use this extension alongside the ERC721Mintable
, ERC1155Mintable
or ERC20Mintable
extension to unlock the ERC721BatchMintable
, ERC1155BatchMintable
or ERC20BatchMintable
dashboard extension detection.
Usage
This is an example smart contract demonstrating how to inherit from this extension and override the functions to add (optional) custom functionality.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@thirdweb-dev/contracts/extension/Multicall.sol";
contract MyContract is Multicall { ... }
SDK Usage
This extension alone does not unlock anything extra in the SDKs. Checkout ERC721BatchMintable
, ERC1155BatchMintable
or ERC20BatchMintable
extensions
to see what this extension unlocks in the SDK when combined with ERC721Mintable
, ERC1155Mintable
or ERC20Mintable
.
Base Contracts Implementing This Extension
- ERC721Base
- ERC721SignatureMint
- ERC1155Base
- ERC1155SignatureMint
- ERC20Base
- ERC20SignatureMint
- ERC20SignatureMintVote
- ERC20Vote
Full API reference
multicall
function multicall(bytes[] calldata data) external virtual override returns (bytes[] memory results);
- Receives and executes a batch of function calls on the contract.
- Parameter
data
: The bytes data that makes up the batch of function calls to execute. - Return value
results
: The bytes data that makes up the result of the batch of function calls executed.