Skip to content

Commit

Permalink
Merge pull request #115 from beefyfinance/add-disable-chain-env
Browse files Browse the repository at this point in the history
Add env var to disable chains
  • Loading branch information
prevostc committed Sep 6, 2023
2 parents 5a3f7ce + 254821b commit 308d3e0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions data/chains.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const {
base,
} = addressBook;

const chains = {
const allChains = {
56: {
id: 'bsc',
chainId: 56,
Expand Down Expand Up @@ -511,7 +511,6 @@ const chains = {
priceCap: Number(process.env.ZKEVM_GAS_PRICE_CAP),
},
},
/*
8453: {
id: 'base',
chainId: 8453,
Expand Down Expand Up @@ -539,7 +538,13 @@ const chains = {
priceCap: Number(process.env.BASE_GAS_PRICE_CAP),
},
},
*/
};

const disabledChainIds = process.env.DISABLE_CHAIN_IDS ? process.env.DISABLE_CHAIN_IDS.split(',') : ["base"];
const filteredChains = Object.values(allChains).filter((c) => !disabledChainIds.includes(c.id));
const chains = {};
for (const chain of filteredChains) {
chains[chain.chainId] = chain;
}

module.exports = chains;

0 comments on commit 308d3e0

Please sign in to comment.