From f72a8bead9130ae8c4c21d88de73ccc6fb852c0e Mon Sep 17 00:00:00 2001 From: Nicolas Alencar <55406040+nicoalencar@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:33:07 -0300 Subject: [PATCH] Add Mode and Mantle chains --- env.tmpl | 2 ++ src/config.ts | 24 +++++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/env.tmpl b/env.tmpl index 90ceb7a..f2866c7 100644 --- a/env.tmpl +++ b/env.tmpl @@ -16,3 +16,5 @@ RPC_URL_SCROLL= RPC_URL_BASE= RPC_URL_BLAST= RPC_URL_LINEA= +RPC_URL_MODE= +RPC_URL_MANTLE= diff --git a/src/config.ts b/src/config.ts index 2c521ba..ef99676 100644 --- a/src/config.ts +++ b/src/config.ts @@ -75,6 +75,8 @@ const supportedChains: Map = { 59144: { name: 'Linea' }, 81457: { name: 'Blast' }, 534352: { name: 'Scroll' }, + 34443: { name: 'Mode' }, + 5000: { name: 'Mantle' }, }; interface BridgeContract { @@ -142,10 +144,10 @@ export const SCRAPER_MODE: ScraperMode = process.env.SCRAPER_MODE === undefined ? DEFAULT_SCRAPER_MODE : process.env.SCRAPER_MODE === 'BLOCKS' - ? 'BLOCKS' - : process.env.SCRAPER_MODE === 'EVENTS' - ? 'EVENTS' - : throwError('Wrong SCRAPER_MODE'); + ? 'BLOCKS' + : process.env.SCRAPER_MODE === 'EVENTS' + ? 'EVENTS' + : throwError('Wrong SCRAPER_MODE'); export const METRICS_PATH = process.env.METRICS_PATH || DEFAULT_METRICS_PATH; export const PROMETHEUS_PORT = getIntConfig('PROMETHEUS_PORT', DEFAULT_PROMETHEUS_PORT); @@ -386,13 +388,13 @@ export const FEAT_UNISWAP_V2_PAIR_CREATED_EVENT = getBoolConfig( export const UNISWAP_V2_PAIR_CREATED_PROTOCOL_CONTRACT_ADDRESSES_AND_START_BLOCKS = process.env .UNISWAP_V2_PAIR_CREATED_PROTOCOL_CONTRACT_ADDRESSES_AND_START_BLOCKS ? process.env.UNISWAP_V2_PAIR_CREATED_PROTOCOL_CONTRACT_ADDRESSES_AND_START_BLOCKS.split(',').map((contract) => { - const [name, factoryAddress, startBlock] = contract.split(':'); - return { - name, - factoryAddress, - startBlock: parseInt(startBlock), - }; - }) + const [name, factoryAddress, startBlock] = contract.split(':'); + return { + name, + factoryAddress, + startBlock: parseInt(startBlock), + }; + }) : []; if (