mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
updated config
This commit is contained in:
parent
6a2648176f
commit
04b7ab4173
|
@ -35,12 +35,13 @@ if (!alchemyApiKey) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const PRIVATE_KEY = process.env.PRIVATE_KEY;
|
const PRIVATE_KEY = process.env.PRIVATE_KEY;
|
||||||
const test = "test test test test test test test test test test test junk";
|
|
||||||
const ETHERSCAN_API = process.env.ETHERSCAN_API_KEY;
|
const ETHERSCAN_API = process.env.ETHERSCAN_API_KEY;
|
||||||
const POLYGONSCAN_API = process.env.POLYGON_API_KEY;
|
const POLYGONSCAN_API = process.env.POLYGON_API_KEY;
|
||||||
const ARBISCAN_API = process.env.ARBISCAN_API_KEY;
|
const ARBISCAN_API = process.env.ARBISCAN_API_KEY;
|
||||||
const SNOWTRACE_API = process.env.SNOWTRACE_API_KEY;
|
const SNOWTRACE_API = process.env.SNOWTRACE_API_KEY;
|
||||||
const mnemonic = process.env.MNEMONIC ?? test;
|
const mnemonic =
|
||||||
|
process.env.MNEMONIC ??
|
||||||
|
"test test test test test test test test test test test junk";
|
||||||
|
|
||||||
function createTestnetConfig(
|
function createTestnetConfig(
|
||||||
network: keyof typeof chainIds
|
network: keyof typeof chainIds
|
||||||
|
@ -59,6 +60,13 @@ function createTestnetConfig(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createCofig(network: string) {
|
||||||
|
return {
|
||||||
|
url: getNetworkUrl(network),
|
||||||
|
accounts: !!PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : { mnemonic },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
function getNetworkUrl(networkType: string) {
|
function getNetworkUrl(networkType: string) {
|
||||||
//console.log(process.env);
|
//console.log(process.env);
|
||||||
if (networkType === "avalanche")
|
if (networkType === "avalanche")
|
||||||
|
@ -113,26 +121,14 @@ const config: HardhatUserConfig = {
|
||||||
url: String(getNetworkUrl(String(process.env.networkType))),
|
url: String(getNetworkUrl(String(process.env.networkType))),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
mainnet: createCofig("mainnet"),
|
||||||
|
polygon: createCofig("polygon"),
|
||||||
|
avalanche: createCofig("avalanche"),
|
||||||
|
arbitrum: createCofig("arbitrum"),
|
||||||
goerli: createTestnetConfig("goerli"),
|
goerli: createTestnetConfig("goerli"),
|
||||||
kovan: createTestnetConfig("kovan"),
|
kovan: createTestnetConfig("kovan"),
|
||||||
rinkeby: createTestnetConfig("rinkeby"),
|
rinkeby: createTestnetConfig("rinkeby"),
|
||||||
ropsten: createTestnetConfig("ropsten"),
|
ropsten: createTestnetConfig("ropsten"),
|
||||||
mainnet: {
|
|
||||||
url: getNetworkUrl("mainnet"),
|
|
||||||
accounts: !!PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : { mnemonic },
|
|
||||||
},
|
|
||||||
polygon: {
|
|
||||||
url: getNetworkUrl("polygon"),
|
|
||||||
accounts: !!PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : { mnemonic },
|
|
||||||
},
|
|
||||||
avalanche: {
|
|
||||||
url: getNetworkUrl("avalanche"),
|
|
||||||
accounts: !!PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : { mnemonic },
|
|
||||||
},
|
|
||||||
arbitrum: {
|
|
||||||
url: getNetworkUrl("arbiturm"),
|
|
||||||
accounts: !!PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : { mnemonic },
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
paths: {
|
paths: {
|
||||||
artifacts: "./artifacts",
|
artifacts: "./artifacts",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user