Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(multicall): add for alephzero and zksync #1266

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/_constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ export const ENABLED_POOLS_UNDERLYING_TOKENS = [
export const SECONDS_PER_YEAR = 365 * 24 * 60 * 60;

export const MULTICALL3_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11";
export const MULTICALL3_ADDRESS_OVERRIDES = {
[CHAIN_IDs.ALEPH_ZERO]: "0x3CA11702f7c0F28e0b4e03C31F7492969862C569",
[CHAIN_IDs.ZK_SYNC]: "0xF9cda624FBC7e059355ce98a31693d299FACd963",
};

export const DEFI_LLAMA_POOL_LOOKUP: Record<string, string> = {
"0x36Be1E97eA98AB43b4dEBf92742517266F5731a3":
Expand Down
4 changes: 3 additions & 1 deletion api/_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
DOMAIN_CALLDATA_DELIMITER,
EXTERNAL_POOL_TOKEN_EXCHANGE_RATE,
MULTICALL3_ADDRESS,
MULTICALL3_ADDRESS_OVERRIDES,
SECONDS_PER_YEAR,
TOKEN_SYMBOLS_MAP,
defaultRelayerAddressOverride,
Expand Down Expand Up @@ -1621,8 +1622,9 @@ export async function callViaMulticall3(
}[],
overrides: ethers.CallOverrides = {}
): Promise<ethers.utils.Result[]> {
const chainId = provider.network.chainId;
const multicall3 = new ethers.Contract(
MULTICALL3_ADDRESS,
MULTICALL3_ADDRESS_OVERRIDES[chainId] ?? MULTICALL3_ADDRESS,
MINIMAL_MULTICALL3_ABI,
provider
);
Expand Down
Loading