From 3b0fa6b4f1575886dffec67b208101c0c8b21391 Mon Sep 17 00:00:00 2001 From: ollie <67156692+0xEillo@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:43:44 +0100 Subject: [PATCH] feat: add scroll testnet config --- contracts/.env.example | 1 + contracts/hardhat.config.ts | 19 ++++++++++++++++--- contracts/package.json | 11 ++++++++++- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/contracts/.env.example b/contracts/.env.example index 00a955e2..73423189 100644 --- a/contracts/.env.example +++ b/contracts/.env.example @@ -2,6 +2,7 @@ INFURA_KEY= PRIVATE_KEY=0000000000000000000000000000000000000000000000000000000000000001 ETHERSCAN_API_KEY= +SCROLL_API_KEY= # Verax Testnet Config ROUTER_ADDRESS=0x736c78b2f2cBf4F921E8551b2acB6A5Edc9177D5 diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index 8cccc30c..23c1bedf 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -22,15 +22,19 @@ const config: HardhatUserConfig = { hardhat: {}, "linea-goerli": { url: `https://linea-goerli.infura.io/v3/${process.env.INFURA_KEY ?? ""}`, - accounts: [process.env.PRIVATE_KEY ?? "0000000000000000000000000000000000000000000000000000000000000000"], + accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], }, linea: { url: `https://linea-mainnet.infura.io/v3/${process.env.INFURA_KEY ?? ""}`, - accounts: [process.env.PRIVATE_KEY ?? "0000000000000000000000000000000000000000000000000000000000000000"], + accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], }, sepolia: { url: `https://sepolia.infura.io/v3/${process.env.INFURA_KEY ?? ""}`, - accounts: [process.env.PRIVATE_KEY ?? "0000000000000000000000000000000000000000000000000000000000000000"], + accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], + }, + "scroll-sepolia": { + url: "https://sepolia-rpc.scroll.io/" || "", + accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], }, }, paths: { @@ -41,6 +45,7 @@ const config: HardhatUserConfig = { "linea-goerli": process.env.ETHERSCAN_API_KEY ?? "", linea: process.env.ETHERSCAN_API_KEY ?? "", sepolia: process.env.ETHERSCAN_API_KEY ?? "", + "scroll-sepolia": process.env.SCROLL_API_KEY ?? "", }, customChains: [ { @@ -59,6 +64,14 @@ const config: HardhatUserConfig = { browserURL: "https://lineascan.build", }, }, + { + network: "scroll-sepolia", + chainId: 534351, + urls: { + apiURL: "https://sepolia-blockscout.scroll.io/api", + browserURL: "https://sepolia-blockscout.scroll.io/", + }, + }, ], }, }; diff --git a/contracts/package.json b/contracts/package.json index 92104b4b..424c193e 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -23,27 +23,36 @@ "check:upgradeability:ci": "cp .env.example .env && pnpm run check:upgradeability", "check:upgradeable": "npx hardhat run --network linea script/upgrade/checkUpgradeable.ts", "check:upgradeable:goerli": "npx hardhat run --network linea-goerli script/upgrade/checkUpgradeable.ts", + "check:upgradeable:scroll-sepolia": "npx hardhat run --network scroll-sepolia script/upgrade/checkUpgradeable.ts", "clean": "rm -rf lcov.info coverage artifacts cache_hardhat cache out typechain-types", "decode": "npx hardhat run script/decode.ts", "deploy:CorrectModule": "npx hardhat run --network linea script/deploy/deployCorrectModule.ts", "deploy:CorrectModule:goerli": "npx hardhat run --network linea-goerli script/deploy/deployCorrectModule.ts", + "deploy:CorrectModule:scroll-sepolia": "npx hardhat run --network scroll-sepolia script/deploy/deployCorrectModule.ts", "deploy:IncorrectModule": "npx hardhat run --network linea script/deploy/deployIncorrectModule.ts", "deploy:IncorrectModule:goerli": "npx hardhat run --network linea-goerli script/deploy/deployIncorrectModule.ts", + "deploy:IncorrectModule:scroll-sepolia": "npx hardhat run --network scroll-sepolia script/deploy/deployIncorrectModule.ts", "deploy:MsgSenderModule": "npx hardhat run --network linea script/deploy/deployMsgSenderModule.ts", "deploy:MsgSenderModule:goerli": "npx hardhat run --network linea-goerli script/deploy/deployMsgSenderModule.ts", + "deploy:MsgSenderModule:scroll-sepolia": "npx hardhat run --network scroll-sepolia script/deploy/deployMsgSenderModule.ts", "deploy:all": "npx hardhat run --network linea script/deploy/deployEverything.ts", "deploy:all:goerli": "npx hardhat run --network linea-goerli script/deploy/deployEverything.ts", + "deploy:all:scroll-sepolia": "npx hardhat run --network scroll-sepolia script/deploy/deployEverything.ts", "deploy:post": "npx hardhat run --network linea script/deploy/postDeployment.ts", "deploy:post:goerli": "npx hardhat run --network linea-goerli script/deploy/postDeployment.ts", + "deploy:post:scroll-sepolia": "npx hardhat run --network scroll-sepolia script/deploy/postDeployment.ts", "encode": "npx hardhat run script/encode.ts", "lint": "pnpm solhint \"{script,src,test}/**/*.sol\"", "reimport": "npx hardhat run --network linea script/recreateNetworkFile.ts", "reimport:goerli": "npx hardhat run --network linea-goerli script/recreateNetworkFile.ts", + "reimport:scroll-sepolia": "npx hardhat run --network scroll-sepolia script/recreateNetworkFile.ts", "test": "forge test", "upgrade:all": "npx hardhat run --network linea script/upgrade/upgradeEverything.ts", "upgrade:all:force": "npx hardhat run --network linea script/upgrade/forceUpgradeEverything.ts", "upgrade:all:goerli": "npx hardhat run --network linea-goerli script/upgrade/upgradeEverything.ts", - "upgrade:all:goerli:force": "npx hardhat run --network linea-goerli script/upgrade/forceUpgradeEverything.ts" + "upgrade:all:goerli:force": "npx hardhat run --network linea-goerli script/upgrade/forceUpgradeEverything.ts", + "upgrade:all:scroll-sepolia": "npx hardhat run --network scroll-sepolia script/upgrade/upgradeEverything.ts", + "upgrade:all:goerli:scroll-sepolia": "npx hardhat run --network scroll-sepolia script/upgrade/forceUpgradeEverything.ts" }, "devDependencies": { "@nomicfoundation/hardhat-ethers": "^3.0.4",