diff --git a/hardhat.config.ts b/hardhat.config.ts index 647dda5..df9598e 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -49,7 +49,7 @@ function createConfig(network: string) { function getNetworkUrl(networkType: string) { if (networkType === "avalanche") - return "https://api.avax.network/ext/bc/C/rpc"; + return "https://avalanche.drpc.org"; else if (networkType === "polygon") return `https://polygon-mainnet.g.alchemy.com/v2/${ALCHEMY_ID}`; else if (networkType === "arbitrum") @@ -85,9 +85,33 @@ const config = { }, kovan: createConfig("kovan"), mainnet: createConfig("mainnet"), - matic: createConfig("polygon"), - avax: createConfig("avalanche"), + polygon: createConfig("polygon"), + avalanche: { + url: "https://avalanche.drpc.org", + accounts: !!PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : { mnemonic }, + timeout: 150000, + }, arbitrum: createConfig("arbitrum"), + optimism: { + url: "https://rpc.ankr.com/optimism", + accounts: !!PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : { mnemonic }, + timeout: 150000, + }, + base: { + url: "https://rpc.ankr.com/base", + accounts: !!PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : { mnemonic }, + timeout: 150000, + }, + scroll: { + url: "https://rpc.ankr.com/scroll", + accounts: !!PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : { mnemonic }, + timeout: 150000, + }, + gnosis: { + url: "https://rpc.ankr.com/gnosis", + accounts: !!PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : { mnemonic }, + timeout: 150000, + } }, solidity: { compilers: [ @@ -118,7 +142,35 @@ const config = { tests: "./test", }, etherscan: { - apiKey: process.env.ETHERSCAN, + apiKey: { + mainnet: process.env.ETHERSCAN_API_KEY || "", + polygon: process.env.POLYGONSCAN_API_KEY || "", + arbitrumOne: process.env.ARBITRUM_API_KEY || "", + optimisticEthereum: process.env.OPTIMISIM_API_KEY || "", + base: process.env.BASE_API_KEY || "", + avalanche: process.env.SNOWTRACE_API_KEY || "", + scroll: process.env.SCROLL_API_KEY || "", + xdai: process.env.GNOSIS_API_KEY || "", + gnosis: process.env.GNOSIS_API_KEY || "", + }, + customChains: [ + { + network: "base", + chainId: 8453, + urls: { + apiURL: "https://api.basescan.org/api", + browserURL: "https://basescan.org/", + }, + }, + { + network: "scroll", + chainId: 534352, + urls: { + apiURL: "https://api.scrollscan.com/api", + browserURL: "https://scrollscan.com/", + }, + }, + ], }, typechain: { outDir: "typechain", diff --git a/scripts/constant/addresses.ts b/scripts/constant/addresses.ts index b59b2ee..34690c8 100644 --- a/scripts/constant/addresses.ts +++ b/scripts/constant/addresses.ts @@ -18,5 +18,7 @@ export default { polygon: "0xA9B99766E6C676Cf1975c0D3166F96C0848fF5ad", arbitrum: "0x1eE00C305C51Ff3bE60162456A9B533C07cD9288", avalanche: "0x6CE3e607C808b4f4C26B7F6aDAeB619e49CAbb25", + base: "0x6CE3e607C808b4f4C26B7F6aDAeB619e49CAbb25", + optimism: "0x6CE3e607C808b4f4C26B7F6aDAeB619e49CAbb25" }, }; diff --git a/scripts/deployDefaultImplmplementation.ts b/scripts/deployDefaultImplmplementation.ts new file mode 100644 index 0000000..57afda0 --- /dev/null +++ b/scripts/deployDefaultImplmplementation.ts @@ -0,0 +1,27 @@ +import hre from "hardhat"; +import addresses from "./constant/addresses"; +import instaDeployContract from "./deployContract"; + +async function main() { +const INSTA_INDEX = addresses.InstaIndex[hre.network.name]; + const instaAccountV2DefaultImpl = await instaDeployContract( + "InstaDefaultImplementation", + [INSTA_INDEX] + ); + + if (hre.network.name !== "hardhat") { + await hre.run("verify:verify", { + address: instaAccountV2DefaultImpl.address, + constructorArguments: [INSTA_INDEX], + }); + } else { + console.log(`Contracts deployed to ${hre.network.name}`); + } +} + +main() + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + });