You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A multicall contract enables a single eth_call to be used to
aggregate multiple constant contract method calls to a variety
of addresses.
The ethers Multicall contract is located at multicall.eth
and is verified on Etherscan.
JavaScript API
constmulticaller=Multicaller(provider);// The maximum amount of gas to allow each sub-call to consumemulticaller.gasLimtPerCall=50000;// The maximum result length to allow each call to returnmulticaller.resultLimitPerCall=1024;multicaller.queue(address,fragment[,values])=>Promise<any>multicaller.queueResult(address,fragment[,values])=>Promise<Result>multicall.flush()=>Promise<number>
There is a single method, execute which will throttle the
amount of gas per external call and limit the resulting output
from each call to prevent malicious contracts from breaking the
aggregate call.
Each result includes a status (0 for failure, 1 for successs) along
with any result. A status of 0 may still return data, which will be
the result of the revert.
License
MIT License.
About
A simple multicall contract and library wrapper to aggregate Ethereum calls.