Skip to content

Instantly share code, notes, and snippets.

@daochild
daochild / Multicall3ContractClient.ts
Created June 19, 2025 09:10 — forked from AlcibiadesCleinias/Multicall3ContractClient.ts
Multicall3 Contract Client Class on Typescript
// Resolve 2 TODOs and use multicall batch client.
import type { Interface, Result, ethers } from "ethers";
import { type IMulticall3 } from "../../index.js"; // TODO: use your import (in this example I used typechain types with multicall3 contract)
export type Multicall3ContractCall = { target: string, allowFailure: boolean, callData: string };
export type Aggregate3Response = { success: boolean; returnData: string };
export type TxResultsConverter<T> = (result: Result, ...opt: any[]) => T;
/*
* @description Client to be inherited from to work with Multicall3 contract to perform batch calls.