diff --git a/.env.wsteth.opt_sepolia b/.env.wsteth.opt_sepolia new file mode 100644 index 00000000..76efa537 --- /dev/null +++ b/.env.wsteth.opt_sepolia @@ -0,0 +1,71 @@ +# Detailed info: https://github.com/lidofinance/lido-l2#Project-Configuration + +# ############################ +# RPCs +# ############################ + +RPC_ETH_SEPOLIA= +RPC_OPT_SEPOLIA=https://sepolia.optimism.io + +# ############################ +# Etherscan +# ############################ + +ETHERSCAN_API_KEY_ETH= +ETHERSCAN_API_KEY_OPT= + +# ############################ +# Bridge/Gateway Deployment +# ############################ + +# Address of the token to deploy the bridge/gateway for +TOKEN=0xB82381A3fBD3FaFA77B3a7bE693342618240067b + +# Name of the network environments used by deployment scripts. +# Might be one of: "mainnet", "sepolia". +NETWORK=sepolia + +# Private key of the deployer account used for deployment process +ETH_DEPLOYER_PRIVATE_KEY= +OPT_DEPLOYER_PRIVATE_KEY= + +L1_PROXY_ADMIN=0x32A0E5828B62AAb932362a4816ae03b860b65e83 +L1_BRIDGE_ADMIN=0x32A0E5828B62AAb932362a4816ae03b860b65e83 +L1_DEPOSITS_ENABLED=true +L1_WITHDRAWALS_ENABLED=true +L1_DEPOSITS_ENABLERS=["0x32A0E5828B62AAb932362a4816ae03b860b65e83"] +L1_DEPOSITS_DISABLERS="["0x32A0E5828B62AAb932362a4816ae03b860b65e83", "0xa5F1d7D49F581136Cf6e58B32cBE9a2039C48bA1"]" +L1_WITHDRAWALS_ENABLERS=["0x32A0E5828B62AAb932362a4816ae03b860b65e83"] +L1_WITHDRAWALS_DISABLERS="["0x32A0E5828B62AAb932362a4816ae03b860b65e83", "0xa5F1d7D49F581136Cf6e58B32cBE9a2039C48bA1"]" + +L2_PROXY_ADMIN=0xf695357C66bA514150Da95b189acb37b46DDe602 +L2_BRIDGE_ADMIN=0xf695357C66bA514150Da95b189acb37b46DDe602 +L2_DEPOSITS_ENABLED=true +L2_WITHDRAWALS_ENABLED=true +L2_DEPOSITS_ENABLERS=["0xf695357C66bA514150Da95b189acb37b46DDe602"] +L2_DEPOSITS_DISABLERS="["0xf695357C66bA514150Da95b189acb37b46DDe602", "0xa5F1d7D49F581136Cf6e58B32cBE9a2039C48bA1"]" +L2_WITHDRAWALS_ENABLERS=["0xf695357C66bA514150Da95b189acb37b46DDe602"] +L2_WITHDRAWALS_DISABLERS="["0xf695357C66bA514150Da95b189acb37b46DDe602", "0xa5F1d7D49F581136Cf6e58B32cBE9a2039C48bA1"]" + +# ############################ +# Integration & E2E Testing +# ############################ + +TESTING_OPT_NETWORK=sepolia +TESTING_OPT_L1_TOKEN=0xB82381A3fBD3FaFA77B3a7bE693342618240067b +TESTING_OPT_L2_TOKEN=0x24B47cd3A74f1799b32B2de11073764Cb1bb318B +TESTING_OPT_L1_ERC20_TOKEN_BRIDGE=0x4Abf633d9c0F4aEebB4C2E3213c7aa1b8505D332 +TESTING_OPT_L2_ERC20_TOKEN_BRIDGE=0xdBA2760246f315203F8B716b3a7590F0FFdc704a + +# ############################ +# Integration Testing +# ############################ + +TESTING_USE_DEPLOYED_CONTRACTS=true +TESTING_L1_TOKENS_HOLDER= + +# ############################ +# E2E Testing +# ############################ + +TESTING_PRIVATE_KEY= diff --git a/hardhat.config.ts b/hardhat.config.ts index e09d0e91..ed47221c 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -40,15 +40,15 @@ const config: HardhatUserConfig = { eth_mainnet: { url: env.string("RPC_ETH_MAINNET", ""), }, - eth_goerli: { - url: env.string("RPC_ETH_GOERLI", ""), + eth_sepolia: { + url: env.string("RPC_ETH_SEPOLIA", ""), }, // Ethereum Fork Chains eth_mainnet_fork: { url: "http://localhost:8545", }, - eth_goerli_fork: { + eth_sepolia_fork: { url: "http://localhost:8545", }, @@ -56,15 +56,15 @@ const config: HardhatUserConfig = { arb_mainnet: { url: env.string("RPC_ARB_MAINNET", ""), }, - arb_goerli: { - url: env.string("RPC_ARB_GOERLI", ""), + arb_sepolia: { + url: env.string("RPC_ARB_SEPOLIA", ""), }, // Arbitrum Fork Chains arb_mainnet_fork: { url: "http://localhost:8546", }, - arb_goerli_fork: { + arb_sepolia_fork: { url: "http://localhost:8546", }, @@ -72,15 +72,15 @@ const config: HardhatUserConfig = { opt_mainnet: { url: env.string("RPC_OPT_MAINNET", ""), }, - opt_goerli: { - url: env.string("RPC_OPT_GOERLI", ""), + opt_sepolia: { + url: env.string("RPC_OPT_SEPOLIA", ""), }, // Optimism Fork Chains opt_mainnet_fork: { url: "http://localhost:9545", }, - opt_goerli_fork: { + opt_sepolia_fork: { url: "http://localhost:9545", }, }, @@ -91,12 +91,30 @@ const config: HardhatUserConfig = { etherscan: { apiKey: { mainnet: env.string("ETHERSCAN_API_KEY_ETH", ""), - goerli: env.string("ETHERSCAN_API_KEY_ETH", ""), - arbitrumGoerli: env.string("ETHERSCAN_API_KEY_ARB", ""), + sepolia: env.string("ETHERSCAN_API_KEY_ETH", ""), arbitrumOne: env.string("ETHERSCAN_API_KEY_ARB", ""), optimisticEthereum: env.string("ETHERSCAN_API_KEY_OPT", ""), - optimisticGoerli: env.string("ETHERSCAN_API_KEY_OPT", ""), + "opt_sepolia": env.string("ETHERSCAN_API_KEY_OPT", ""), }, + + customChains: [ + { + network: 'sepolia', + chainId: 11155111, + urls: { + apiURL: 'https://api-sepolia.etherscan.io/api', + browserURL: 'https://sepolia.etherscan.io', + }, + }, + { + network: 'opt_sepolia', + chainId: 11155420, + urls: { + apiURL: 'https://api-sepolia-optimism.etherscan.io/api', + browserURL: 'https://sepolia-optimism.etherscan.io', + }, + }, + ], }, typechain: { externalArtifacts: [ diff --git a/package-lock.json b/package-lock.json index 320e2ca6..cfddd6b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "ISC", "dependencies": { "@arbitrum/sdk": "3.1.6", - "@eth-optimism/sdk": "3.0.0", + "@eth-optimism/sdk": "3.2.0", "@ethersproject/providers": "^5.6.8", "@lidofinance/evm-script-decoder": "^0.2.2", "@openzeppelin/contracts": "4.6.0", @@ -18,7 +18,7 @@ }, "devDependencies": { "@nomiclabs/hardhat-ethers": "^2.0.6", - "@nomiclabs/hardhat-etherscan": "^3.1.7", + "@nomiclabs/hardhat-etherscan": "^3.1.8", "@nomiclabs/hardhat-waffle": "^2.0.3", "@typechain/ethers-v5": "^7.2.0", "@typechain/hardhat": "^2.3.1", @@ -480,20 +480,10 @@ } }, "node_modules/@eth-optimism/contracts-bedrock": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/@eth-optimism/contracts-bedrock/-/contracts-bedrock-0.15.0.tgz", - "integrity": "sha512-p6whbEsxENrsJ7OkxtPa39BdgmQVeRRquEjt7Qj4oNCooBSeXcWPbx+AtKO/UkODXekuT3inpeWk7QZqmaH0IQ==", - "dependencies": { - "@eth-optimism/core-utils": "^0.12.1", - "@openzeppelin/contracts": "4.7.3", - "@openzeppelin/contracts-upgradeable": "4.7.3", - "ethers": "^5.7.0" - } - }, - "node_modules/@eth-optimism/contracts-bedrock/node_modules/@openzeppelin/contracts": { - "version": "4.7.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.7.3.tgz", - "integrity": "sha512-dGRS0agJzu8ybo44pCIf3xBaPQN/65AIXNgK8+4gzKd5kbvlqyxryUYVLJv7fK98Seyd2hDZzVEHSWAh0Bt1Yw==" + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/@eth-optimism/contracts-bedrock/-/contracts-bedrock-0.17.1.tgz", + "integrity": "sha512-Hc5peN5PM8kzl9dzqSD5jv6ED3QliO1DF0dXLRJxfrXR7/rmEeyuAYESUwUM0gdJZjkwRYiS5m230BI6bQmnlw==", + "hasInstallScript": true }, "node_modules/@eth-optimism/contracts/node_modules/@eth-optimism/core-utils": { "version": "0.12.0", @@ -519,9 +509,10 @@ } }, "node_modules/@eth-optimism/core-utils": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/@eth-optimism/core-utils/-/core-utils-0.12.1.tgz", - "integrity": "sha512-H2NnH9HTVDJmr9Yzb5R7GrAaYimcyIY4bF5Oud0xM1/DP4pSoNMtWm1kG3ZBpdqHFFYWH9GiSZZC5/cjFdKBEA==", + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/@eth-optimism/core-utils/-/core-utils-0.13.1.tgz", + "integrity": "sha512-1FvzbUmCEy9zSKPG1QWg2VfA2Cy90xBA9Wkp11lXXrz91zUPCNCNSRTujXWYIC86ketNsZp7p4njSf6lTycHCw==", + "hasInstallScript": true, "dependencies": { "@ethersproject/abi": "^5.7.0", "@ethersproject/abstract-provider": "^5.7.0", @@ -533,26 +524,60 @@ "@ethersproject/keccak256": "^5.7.0", "@ethersproject/properties": "^5.7.0", "@ethersproject/rlp": "^5.7.0", - "@ethersproject/web": "^5.7.0", - "chai": "^4.3.4" + "@ethersproject/web": "^5.7.1", + "chai": "^4.3.9", + "ethers": "^5.7.2", + "node-fetch": "^2.6.7" } }, "node_modules/@eth-optimism/sdk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@eth-optimism/sdk/-/sdk-3.0.0.tgz", - "integrity": "sha512-tl5Rh1rRBuohSc0/EZgQFVoICFF9Hv+gHWuf5EcI9+xZXEC0F3gFUbTk7VtkyKW0gHNIRL/H+I7Cu0us9eEu+g==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eth-optimism/sdk/-/sdk-3.2.0.tgz", + "integrity": "sha512-+ZEO/mDWz3WLzaPVHvgOAK4iN723HmI6sLLr2tmO1/RUoCHVfWMUDwuiikrA49cAsdsjMxCV9+0XNZ8btD2JUg==", + "hasInstallScript": true, "dependencies": { "@eth-optimism/contracts": "0.6.0", - "@eth-optimism/contracts-bedrock": "0.15.0", - "@eth-optimism/core-utils": "0.12.1", + "@eth-optimism/contracts-bedrock": "0.17.1", + "@eth-optimism/core-utils": "0.13.1", "lodash": "^4.17.21", - "merkletreejs": "^0.2.27", - "rlp": "^2.2.7" + "merkletreejs": "^0.3.11", + "rlp": "^2.2.7", + "semver": "^7.5.4" }, "peerDependencies": { "ethers": "^5" } }, + "node_modules/@eth-optimism/sdk/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@eth-optimism/sdk/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@eth-optimism/sdk/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "node_modules/@ethereum-waffle/chai": { "version": "3.4.4", "resolved": "https://registry.npmjs.org/@ethereum-waffle/chai/-/chai-3.4.4.tgz", @@ -2181,9 +2206,10 @@ } }, "node_modules/@nomiclabs/hardhat-etherscan": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.1.7.tgz", - "integrity": "sha512-tZ3TvSgpvsQ6B6OGmo1/Au6u8BrAkvs1mIC/eURA3xgIfznUZBhmpne8hv7BXUzw9xNL3fXdpOYgOQlVMTcoHQ==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.1.8.tgz", + "integrity": "sha512-v5F6IzQhrsjHh6kQz4uNrym49brK9K5bYCq2zQZ729RYRaifI9hHbtmK+KkIVevfhut7huQFEQ77JLRMAzWYjQ==", + "deprecated": "The @nomiclabs/hardhat-etherscan package is deprecated, please use @nomicfoundation/hardhat-verify instead", "dev": true, "dependencies": { "@ethersproject/abi": "^5.1.2", @@ -2290,11 +2316,6 @@ "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.6.0.tgz", "integrity": "sha512-8vi4d50NNya/bQqCmaVzvHNmwHvS0OBKb7HNtuNwEE3scXWrP31fKQoGxNMT+KbzmrNZzatE3QK5p2gFONI/hg==" }, - "node_modules/@openzeppelin/contracts-upgradeable": { - "version": "4.7.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.7.3.tgz", - "integrity": "sha512-+wuegAMaLcZnLCJIvrVUDzA9z/Wp93f0Dla/4jJvIhijRrPabjQbZe6fWiECLaJyfn5ci9fqf9vTw3xpQOad2A==" - }, "node_modules/@resolver-engine/core": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@resolver-engine/core/-/core-0.3.3.tgz", @@ -4828,17 +4849,17 @@ } }, "node_modules/chai": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", - "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", "dependencies": { "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^4.1.2", - "get-func-name": "^2.0.0", - "loupe": "^2.3.1", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", "pathval": "^1.1.1", - "type-detect": "^4.0.5" + "type-detect": "^4.0.8" }, "engines": { "node": ">=4" @@ -4869,9 +4890,12 @@ } }, "node_modules/check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dependencies": { + "get-func-name": "^2.0.2" + }, "engines": { "node": "*" } @@ -5436,9 +5460,9 @@ } }, "node_modules/crypto-js": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz", - "integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==" + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", + "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==" }, "node_modules/d": { "version": "1.0.1", @@ -19044,13 +19068,13 @@ } }, "node_modules/merkletreejs": { - "version": "0.2.32", - "resolved": "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.2.32.tgz", - "integrity": "sha512-TostQBiwYRIwSE5++jGmacu3ODcKAgqb0Y/pnIohXS7sWxh1gCkSptbmF1a43faehRDpcHf7J/kv0Ml2D/zblQ==", + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.3.11.tgz", + "integrity": "sha512-LJKTl4iVNTndhL+3Uz/tfkjD0klIWsHlUzgtuNnNrsf7bAlXR30m+xYB7lHr5Z/l6e/yAIsr26Dabx6Buo4VGQ==", "dependencies": { "bignumber.js": "^9.0.1", "buffer-reverse": "^1.0.1", - "crypto-js": "^3.1.9-1", + "crypto-js": "^4.2.0", "treeify": "^1.1.0", "web3-utils": "^1.3.4" }, @@ -19619,7 +19643,6 @@ "version": "2.6.12", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", - "dev": true, "dependencies": { "whatwg-url": "^5.0.0" }, @@ -22661,8 +22684,7 @@ "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, "node_modules/treeify": { "version": "1.1.0", @@ -24404,8 +24426,7 @@ "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" }, "node_modules/websocket": { "version": "1.0.34", @@ -24443,7 +24464,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dev": true, "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -25183,27 +25203,14 @@ } }, "@eth-optimism/contracts-bedrock": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/@eth-optimism/contracts-bedrock/-/contracts-bedrock-0.15.0.tgz", - "integrity": "sha512-p6whbEsxENrsJ7OkxtPa39BdgmQVeRRquEjt7Qj4oNCooBSeXcWPbx+AtKO/UkODXekuT3inpeWk7QZqmaH0IQ==", - "requires": { - "@eth-optimism/core-utils": "^0.12.1", - "@openzeppelin/contracts": "4.7.3", - "@openzeppelin/contracts-upgradeable": "4.7.3", - "ethers": "^5.7.0" - }, - "dependencies": { - "@openzeppelin/contracts": { - "version": "4.7.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.7.3.tgz", - "integrity": "sha512-dGRS0agJzu8ybo44pCIf3xBaPQN/65AIXNgK8+4gzKd5kbvlqyxryUYVLJv7fK98Seyd2hDZzVEHSWAh0Bt1Yw==" - } - } + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/@eth-optimism/contracts-bedrock/-/contracts-bedrock-0.17.1.tgz", + "integrity": "sha512-Hc5peN5PM8kzl9dzqSD5jv6ED3QliO1DF0dXLRJxfrXR7/rmEeyuAYESUwUM0gdJZjkwRYiS5m230BI6bQmnlw==" }, "@eth-optimism/core-utils": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/@eth-optimism/core-utils/-/core-utils-0.12.1.tgz", - "integrity": "sha512-H2NnH9HTVDJmr9Yzb5R7GrAaYimcyIY4bF5Oud0xM1/DP4pSoNMtWm1kG3ZBpdqHFFYWH9GiSZZC5/cjFdKBEA==", + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/@eth-optimism/core-utils/-/core-utils-0.13.1.tgz", + "integrity": "sha512-1FvzbUmCEy9zSKPG1QWg2VfA2Cy90xBA9Wkp11lXXrz91zUPCNCNSRTujXWYIC86ketNsZp7p4njSf6lTycHCw==", "requires": { "@ethersproject/abi": "^5.7.0", "@ethersproject/abstract-provider": "^5.7.0", @@ -25215,21 +25222,47 @@ "@ethersproject/keccak256": "^5.7.0", "@ethersproject/properties": "^5.7.0", "@ethersproject/rlp": "^5.7.0", - "@ethersproject/web": "^5.7.0", - "chai": "^4.3.4" + "@ethersproject/web": "^5.7.1", + "chai": "^4.3.9", + "ethers": "^5.7.2", + "node-fetch": "^2.6.7" } }, "@eth-optimism/sdk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@eth-optimism/sdk/-/sdk-3.0.0.tgz", - "integrity": "sha512-tl5Rh1rRBuohSc0/EZgQFVoICFF9Hv+gHWuf5EcI9+xZXEC0F3gFUbTk7VtkyKW0gHNIRL/H+I7Cu0us9eEu+g==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eth-optimism/sdk/-/sdk-3.2.0.tgz", + "integrity": "sha512-+ZEO/mDWz3WLzaPVHvgOAK4iN723HmI6sLLr2tmO1/RUoCHVfWMUDwuiikrA49cAsdsjMxCV9+0XNZ8btD2JUg==", "requires": { "@eth-optimism/contracts": "0.6.0", - "@eth-optimism/contracts-bedrock": "0.15.0", - "@eth-optimism/core-utils": "0.12.1", + "@eth-optimism/contracts-bedrock": "0.17.1", + "@eth-optimism/core-utils": "0.13.1", "lodash": "^4.17.21", - "merkletreejs": "^0.2.27", - "rlp": "^2.2.7" + "merkletreejs": "^0.3.11", + "rlp": "^2.2.7", + "semver": "^7.5.4" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "requires": { + "lru-cache": "^6.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } } }, "@ethereum-waffle/chai": { @@ -26395,9 +26428,9 @@ "requires": {} }, "@nomiclabs/hardhat-etherscan": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.1.7.tgz", - "integrity": "sha512-tZ3TvSgpvsQ6B6OGmo1/Au6u8BrAkvs1mIC/eURA3xgIfznUZBhmpne8hv7BXUzw9xNL3fXdpOYgOQlVMTcoHQ==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.1.8.tgz", + "integrity": "sha512-v5F6IzQhrsjHh6kQz4uNrym49brK9K5bYCq2zQZ729RYRaifI9hHbtmK+KkIVevfhut7huQFEQ77JLRMAzWYjQ==", "dev": true, "requires": { "@ethersproject/abi": "^5.1.2", @@ -26482,11 +26515,6 @@ "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.6.0.tgz", "integrity": "sha512-8vi4d50NNya/bQqCmaVzvHNmwHvS0OBKb7HNtuNwEE3scXWrP31fKQoGxNMT+KbzmrNZzatE3QK5p2gFONI/hg==" }, - "@openzeppelin/contracts-upgradeable": { - "version": "4.7.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.7.3.tgz", - "integrity": "sha512-+wuegAMaLcZnLCJIvrVUDzA9z/Wp93f0Dla/4jJvIhijRrPabjQbZe6fWiECLaJyfn5ci9fqf9vTw3xpQOad2A==" - }, "@resolver-engine/core": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@resolver-engine/core/-/core-0.3.3.tgz", @@ -28518,17 +28546,17 @@ } }, "chai": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", - "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", "requires": { "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^4.1.2", - "get-func-name": "^2.0.0", - "loupe": "^2.3.1", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", "pathval": "^1.1.1", - "type-detect": "^4.0.5" + "type-detect": "^4.0.8" } }, "chalk": { @@ -28547,9 +28575,12 @@ "dev": true }, "check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "requires": { + "get-func-name": "^2.0.2" + } }, "chokidar": { "version": "3.5.3", @@ -29003,9 +29034,9 @@ } }, "crypto-js": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz", - "integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==" + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", + "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==" }, "d": { "version": "1.0.1", @@ -39502,13 +39533,13 @@ "dev": true }, "merkletreejs": { - "version": "0.2.32", - "resolved": "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.2.32.tgz", - "integrity": "sha512-TostQBiwYRIwSE5++jGmacu3ODcKAgqb0Y/pnIohXS7sWxh1gCkSptbmF1a43faehRDpcHf7J/kv0Ml2D/zblQ==", + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/merkletreejs/-/merkletreejs-0.3.11.tgz", + "integrity": "sha512-LJKTl4iVNTndhL+3Uz/tfkjD0klIWsHlUzgtuNnNrsf7bAlXR30m+xYB7lHr5Z/l6e/yAIsr26Dabx6Buo4VGQ==", "requires": { "bignumber.js": "^9.0.1", "buffer-reverse": "^1.0.1", - "crypto-js": "^3.1.9-1", + "crypto-js": "^4.2.0", "treeify": "^1.1.0", "web3-utils": "^1.3.4" } @@ -39948,7 +39979,6 @@ "version": "2.6.12", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", - "dev": true, "requires": { "whatwg-url": "^5.0.0" } @@ -42255,8 +42285,7 @@ "tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, "treeify": { "version": "1.1.0", @@ -43731,8 +43760,7 @@ "webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" }, "websocket": { "version": "1.0.34", @@ -43769,7 +43797,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dev": true, "requires": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" diff --git a/package.json b/package.json index 8acec291..820a38ee 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,10 @@ "test:unit": "hardhat test ./test/**/*.unit.test.ts", "test:integration": "hardhat test ./test/**/*.integration.test.ts", "fork:eth:mainnet": "hardhat node:fork eth_mainnet 8545", - "fork:eth:goerli": "hardhat node:fork eth_goerli 8545", - "fork:arb:goerli": "hardhat node:fork arb_goerli 8546", + "fork:eth:sepolia": "hardhat node:fork eth_sepolia 8545", + "fork:arb:sepolia": "hardhat node:fork arb_sepolia 8546", "fork:arb:mainnet": "hardhat node:fork arb_mainnet 8546", - "fork:opt:goerli": "hardhat node:fork opt_goerli 9545", + "fork:opt:sepolia": "hardhat node:fork opt_sepolia 9545", "fork:opt:mainnet": "hardhat node:fork opt_mainnet 9545", "arbitrum:deploy": "ts-node --files ./scripts/arbitrum/deploy-gateway.ts", "arbitrum:finalize-message": "ts-node --files ./scripts/arbitrum/finalize-message.ts", @@ -38,7 +38,7 @@ "license": "ISC", "devDependencies": { "@nomiclabs/hardhat-ethers": "^2.0.6", - "@nomiclabs/hardhat-etherscan": "^3.1.7", + "@nomiclabs/hardhat-etherscan": "^3.1.8", "@nomiclabs/hardhat-waffle": "^2.0.3", "@typechain/ethers-v5": "^7.2.0", "@typechain/hardhat": "^2.3.1", @@ -70,7 +70,7 @@ }, "dependencies": { "@arbitrum/sdk": "3.1.6", - "@eth-optimism/sdk": "3.0.0", + "@eth-optimism/sdk": "3.2.0", "@ethersproject/providers": "^5.6.8", "@lidofinance/evm-script-decoder": "^0.2.2", "@openzeppelin/contracts": "4.6.0", diff --git a/test/arbitrum/bridging-native.e2e.test.ts b/test/arbitrum/bridging-native.e2e.test.ts index 3290b034..6e56499b 100644 --- a/test/arbitrum/bridging-native.e2e.test.ts +++ b/test/arbitrum/bridging-native.e2e.test.ts @@ -12,7 +12,7 @@ import arbitrum from "../../utils/arbitrum"; import { ethers } from "hardhat"; async function ctxFactory() { - const networkName = env.network("TESTING_ARB_NETWORK", "goerli"); + const networkName = env.network("TESTING_ARB_NETWORK", "sepolia"); const testingSetup = await arbitrum.testing(networkName).getE2ETestSetup(); const l2Network = await getL2Network(testingSetup.l2Provider); diff --git a/test/arbitrum/bridging-router.e2e.test.ts b/test/arbitrum/bridging-router.e2e.test.ts index 19020abe..fc7fcc76 100644 --- a/test/arbitrum/bridging-router.e2e.test.ts +++ b/test/arbitrum/bridging-router.e2e.test.ts @@ -7,7 +7,7 @@ import { scenario } from "../../utils/testing"; import arbitrum from "../../utils/arbitrum"; async function ctxFactory() { - const networkName = env.network("TESTING_ARB_NETWORK", "goerli"); + const networkName = env.network("TESTING_ARB_NETWORK", "sepolia"); const testingSetup = await arbitrum.testing(networkName).getE2ETestSetup(); const l2Network = await getL2Network(testingSetup.l2Provider); diff --git a/test/arbitrum/managing-deposits.e2e.test.ts b/test/arbitrum/managing-deposits.e2e.test.ts index ecfd003b..1154cbca 100644 --- a/test/arbitrum/managing-deposits.e2e.test.ts +++ b/test/arbitrum/managing-deposits.e2e.test.ts @@ -77,7 +77,7 @@ const scenarioTest = scenario( [false, false], ]); - const arbAddresses = arbitrum.addresses("goerli"); + const arbAddresses = arbitrum.addresses("sepolia"); const { calldata, callvalue } = await ctx.messaging.prepareRetryableTicketTx({ @@ -160,7 +160,7 @@ scenarioTest.run(); scenarioTest.run(); async function ctxFactory() { - const ethArbNetwork = network.multichain(["eth", "arb"], "goerli"); + const ethArbNetwork = network.multichain(["eth", "arb"], "sepolia"); const [l1Provider] = ethArbNetwork.getProviders({ forking: false, @@ -176,8 +176,8 @@ async function ctxFactory() { ); return { - lidoAragonDAO: lido("goerli", l1Provider), - messaging: arbitrum.messaging("goerli", { forking: false }), + lidoAragonDAO: lido("sepolia", l1Provider), + messaging: arbitrum.messaging("sepolia", { forking: false }), gasAmount: wei`0.1 ether`, l2Tester, l1Provider, diff --git a/test/arbitrum/managing-executor.e2e.test.ts b/test/arbitrum/managing-executor.e2e.test.ts index 29142ebb..0dc6a15b 100644 --- a/test/arbitrum/managing-executor.e2e.test.ts +++ b/test/arbitrum/managing-executor.e2e.test.ts @@ -59,7 +59,7 @@ scenario("Arbitrum :: Update guardian", ctxFactory) [false], ]); - const arbAddresses = arbitrum.addresses("goerli"); + const arbAddresses = arbitrum.addresses("sepolia"); const { calldata, callvalue } = await ctx.messaging.prepareRetryableTicketTx({ @@ -134,7 +134,7 @@ scenario("Arbitrum :: Update guardian", ctxFactory) .run(); async function ctxFactory() { - const ethArbNetwork = network.multichain(["eth", "arb"], "goerli"); + const ethArbNetwork = network.multichain(["eth", "arb"], "sepolia"); const [l1Provider] = ethArbNetwork.getProviders({ forking: false, @@ -150,8 +150,8 @@ async function ctxFactory() { ); return { - lidoAragonDAO: lido("goerli", l1Provider), - messaging: arbitrum.messaging("goerli", { forking: false }), + lidoAragonDAO: lido("sepolia", l1Provider), + messaging: arbitrum.messaging("sepolia", { forking: false }), gasAmount: wei`0.1 ether`, l2Tester, l1Provider, diff --git a/test/arbitrum/managing-proxy.e2e.test.ts b/test/arbitrum/managing-proxy.e2e.test.ts index d37da310..e8342cfa 100644 --- a/test/arbitrum/managing-proxy.e2e.test.ts +++ b/test/arbitrum/managing-proxy.e2e.test.ts @@ -66,7 +66,7 @@ scenario("Arbitrum :: AAVE governance crosschain bridge", ctxFactory) [false], ]); - const arbAddresses = arbitrum.addresses("goerli"); + const arbAddresses = arbitrum.addresses("sepolia"); const { calldata, callvalue } = await ctx.messaging.prepareRetryableTicketTx({ @@ -173,7 +173,7 @@ scenario("Arbitrum :: AAVE governance crosschain bridge", ctxFactory) [false], ]); - const arbAddresses = arbitrum.addresses("goerli"); + const arbAddresses = arbitrum.addresses("sepolia"); const { calldata, callvalue } = await ctx.messaging.prepareRetryableTicketTx({ @@ -240,7 +240,7 @@ scenario("Arbitrum :: AAVE governance crosschain bridge", ctxFactory) .run(); async function ctxFactory() { - const ethArbNetwork = network.multichain(["eth", "arb"], "goerli"); + const ethArbNetwork = network.multichain(["eth", "arb"], "sepolia"); const [l1Provider] = ethArbNetwork.getProviders({ forking: false, @@ -256,8 +256,8 @@ async function ctxFactory() { ); return { - lidoAragonDAO: lido("goerli", l1Provider), - messaging: arbitrum.messaging("goerli", { forking: false }), + lidoAragonDAO: lido("sepolia", l1Provider), + messaging: arbitrum.messaging("sepolia", { forking: false }), gasAmount: wei`0.1 ether`, l2Tester, l1LDOHolder, diff --git a/test/optimism/bridging-to.e2e.test.ts b/test/optimism/bridging-to.e2e.test.ts index 9b7087da..a7a0dbc6 100644 --- a/test/optimism/bridging-to.e2e.test.ts +++ b/test/optimism/bridging-to.e2e.test.ts @@ -12,6 +12,7 @@ import network from "../../utils/network"; import optimism from "../../utils/optimism"; import { ERC20Mintable } from "../../typechain"; import { scenario } from "../../utils/testing"; +import { sleep } from "../../utils/testing/e2e"; let depositTokensTxResponse: TransactionResponse; let withdrawTokensTxResponse: TransactionResponse; @@ -119,6 +120,8 @@ scenario("Optimism :: Bridging via depositTo/withdrawTo E2E test", ctxFactory) }) .step("Finalizing L2 -> L1 message", async (ctx) => { + const finalizationPeriod = await ctx.crossChainMessenger.contracts.l1.L2OutputOracle.FINALIZATION_PERIOD_SECONDS(); + await sleep(finalizationPeriod * 1000); await ctx.crossChainMessenger.finalizeMessage(withdrawTokensTxResponse); }) @@ -132,7 +135,7 @@ scenario("Optimism :: Bridging via depositTo/withdrawTo E2E test", ctxFactory) .run(); async function ctxFactory() { - const networkName = env.network("TESTING_OPT_NETWORK", "goerli"); + const networkName = env.network("TESTING_OPT_NETWORK", "sepolia"); const testingSetup = await optimism.testing(networkName).getE2ETestSetup(); return { diff --git a/test/optimism/bridging.e2e.test.ts b/test/optimism/bridging.e2e.test.ts index 669d816a..d578e860 100644 --- a/test/optimism/bridging.e2e.test.ts +++ b/test/optimism/bridging.e2e.test.ts @@ -12,6 +12,7 @@ import network from "../../utils/network"; import optimism from "../../utils/optimism"; import { ERC20Mintable } from "../../typechain"; import { scenario } from "../../utils/testing"; +import { sleep } from "../../utils/testing/e2e"; let depositTokensTxResponse: TransactionResponse; let withdrawTokensTxResponse: TransactionResponse; @@ -109,6 +110,8 @@ scenario("Optimism :: Bridging via deposit/withdraw E2E test", ctxFactory) }) .step("Finalizing L2 -> L1 message", async (ctx) => { + const finalizationPeriod = await ctx.crossChainMessenger.contracts.l1.L2OutputOracle.FINALIZATION_PERIOD_SECONDS(); + await sleep(finalizationPeriod * 1000); await ctx.crossChainMessenger.finalizeMessage(withdrawTokensTxResponse); }) @@ -122,7 +125,7 @@ scenario("Optimism :: Bridging via deposit/withdraw E2E test", ctxFactory) .run(); async function ctxFactory() { - const networkName = env.network("TESTING_OPT_NETWORK", "goerli"); + const networkName = env.network("TESTING_OPT_NETWORK", "sepolia"); const testingSetup = await optimism.testing(networkName).getE2ETestSetup(); return { diff --git a/test/optimism/managing-deposits.e2e.test.ts b/test/optimism/managing-deposits.e2e.test.ts index b89a34e9..1566d551 100644 --- a/test/optimism/managing-deposits.e2e.test.ts +++ b/test/optimism/managing-deposits.e2e.test.ts @@ -63,7 +63,7 @@ const scenarioTest = scenario( [false, false], ]); - const optAddresses = optimism.addresses("goerli"); + const optAddresses = optimism.addresses("sepolia"); const { calldata, callvalue } = await ctx.messaging.prepareL2Message({ sender: ctx.lidoAragonDAO.agent.address, @@ -138,7 +138,7 @@ scenarioTest.run(); scenarioTest.run(); async function ctxFactory() { - const ethOptNetwork = network.multichain(["eth", "opt"], "goerli"); + const ethOptNetwork = network.multichain(["eth", "opt"], "sepolia"); const [l1Provider] = ethOptNetwork.getProviders({ forking: false }); const [l1Tester, l2Tester] = ethOptNetwork.getSigners( @@ -152,8 +152,8 @@ async function ctxFactory() { ); return { - lidoAragonDAO: lido("goerli", l1Provider), - messaging: optimism.messaging("goerli", { forking: false }), + lidoAragonDAO: lido("sepolia", l1Provider), + messaging: optimism.messaging("sepolia", { forking: false }), gasAmount: wei`0.1 ether`, l1Tester, l2Tester, diff --git a/test/optimism/managing-executor.e2e.test.ts b/test/optimism/managing-executor.e2e.test.ts index 679a7f04..340a050e 100644 --- a/test/optimism/managing-executor.e2e.test.ts +++ b/test/optimism/managing-executor.e2e.test.ts @@ -47,7 +47,7 @@ scenario("Optimism :: AAVE governance crosschain bridge management", ctxFactory) [false], ]); - const optAddresses = optimism.addresses("goerli"); + const optAddresses = optimism.addresses("sepolia"); const { calldata, callvalue } = await ctx.messaging.prepareL2Message({ sender: ctx.lidoAragonDAO.agent.address, @@ -115,7 +115,7 @@ scenario("Optimism :: AAVE governance crosschain bridge management", ctxFactory) .run(); async function ctxFactory() { - const ethOptNetwork = network.multichain(["eth", "opt"], "goerli"); + const ethOptNetwork = network.multichain(["eth", "opt"], "sepolia"); const [l1Provider] = ethOptNetwork.getProviders({ forking: false }); const [, l2Tester] = ethOptNetwork.getSigners( @@ -129,8 +129,8 @@ async function ctxFactory() { ); return { - lidoAragonDAO: lido("goerli", l1Provider), - messaging: optimism.messaging("goerli", { forking: false }), + lidoAragonDAO: lido("sepolia", l1Provider), + messaging: optimism.messaging("sepolia", { forking: false }), gasAmount: wei`0.1 ether`, l2Tester, l1LDOHolder, diff --git a/test/optimism/managing-proxy.e2e.test.ts b/test/optimism/managing-proxy.e2e.test.ts index 5491b92a..632de88c 100644 --- a/test/optimism/managing-proxy.e2e.test.ts +++ b/test/optimism/managing-proxy.e2e.test.ts @@ -47,7 +47,7 @@ scenario( [false], ]); - const optAddresses = optimism.addresses("goerli"); + const optAddresses = optimism.addresses("sepolia"); const { calldata, callvalue } = await ctx.messaging.prepareL2Message({ sender: ctx.lidoAragonDAO.agent.address, @@ -118,7 +118,7 @@ scenario( [false], ]); - const optAddresses = optimism.addresses("goerli"); + const optAddresses = optimism.addresses("sepolia"); const { calldata, callvalue } = await ctx.messaging.prepareL2Message({ sender: ctx.lidoAragonDAO.agent.address, @@ -180,7 +180,7 @@ scenario( .run(); async function ctxFactory() { - const ethOptNetwork = network.multichain(["eth", "opt"], "goerli"); + const ethOptNetwork = network.multichain(["eth", "opt"], "sepolia"); const [l1Provider] = ethOptNetwork.getProviders({ forking: false }); const [l1Tester, l2Tester] = ethOptNetwork.getSigners( @@ -194,8 +194,8 @@ async function ctxFactory() { ); return { - lidoAragonDAO: lido("goerli", l1Provider), - messaging: optimism.messaging("goerli", { forking: false }), + lidoAragonDAO: lido("sepolia", l1Provider), + messaging: optimism.messaging("sepolia", { forking: false }), gasAmount: wei`0.1 ether`, l1Tester, l2Tester, diff --git a/utils/arbitrum/addresses.ts b/utils/arbitrum/addresses.ts index 54ed0ab5..d06b22ed 100644 --- a/utils/arbitrum/addresses.ts +++ b/utils/arbitrum/addresses.ts @@ -26,7 +26,7 @@ export default function addresses( switch (networkName) { case "mainnet": return { ...ArbitrumMainnetAddresses, ...options.customAddresses }; - case "goerli": + case "sepolia": return { ...ArbitrumGoerliAddresses, ...options.customAddresses }; default: throw new Error(`Network "${networkName}" is not supported`); diff --git a/utils/deployment/DeployScript.ts b/utils/deployment/DeployScript.ts index d2617b4c..a6adb1d9 100644 --- a/utils/deployment/DeployScript.ts +++ b/utils/deployment/DeployScript.ts @@ -166,12 +166,12 @@ export class DeployScript { const chainId = await this.deployer.getChainId(); const networkNameByChainId: Record = { 1: "eth_mainnet", - 5: "eth_goerli", + 11155111: "eth_sepolia", 10: "opt_mainnet", - 420: "opt_goerli", + 11155420: "opt_sepolia", 31337: "hardhat", 42161: "arb_mainnet", - 421613: "arb_goerli", + 421613: "arb_sepolia", }; const networkName = networkNameByChainId[chainId] || ""; const arsString = stepInfo.args.map((a) => `"${a.value}"`).join(" "); diff --git a/utils/env.ts b/utils/env.ts index 4516f739..543af0b6 100644 --- a/utils/env.ts +++ b/utils/env.ts @@ -48,7 +48,7 @@ function getAddressList(variableName: string, defaultValue?: string[]) { } function getNetwork(name: string = "NETWORK", defaultNetwork?: NetworkName) { - return getEnum(name, ["mainnet", "goerli"], defaultNetwork); + return getEnum(name, ["mainnet", "sepolia"], defaultNetwork); } function getPrivateKey() { diff --git a/utils/lido.ts b/utils/lido.ts index 949f8f4a..ac3de401 100644 --- a/utils/lido.ts +++ b/utils/lido.ts @@ -1,7 +1,7 @@ import aragon from "./aragon"; import { SignerOrProvider } from "./network"; -type AragonEnvSetupName = "mainnet" | "mainnet_test" | "goerli"; +type AragonEnvSetupName = "mainnet" | "mainnet_test" | "sepolia"; const ARAGON_MAINNET_TESTING = { agent: "0x184d39300f2fA4419d04998e9C58Cb5De586d879", @@ -15,7 +15,7 @@ const ARAGON_MAINNET = { tokenManager: "0xf73a1260d222f447210581DDf212D915c09a3249", }; -const ARAGON_GOERLI = { +const ARAGON_SEPOLIA = { agent: "0x4333218072D5d7008546737786663c38B4D561A4", voting: "0xbc0B67b4553f4CF52a913DE9A6eD0057E2E758Db", tokenManager: "0xDfe76d11b365f5e0023343A367f0b311701B3bc1", @@ -24,7 +24,7 @@ const ARAGON_GOERLI = { const ARAGON_CONTRACTS_BY_NAME = { mainnet: ARAGON_MAINNET, mainnet_test: ARAGON_MAINNET_TESTING, - goerli: ARAGON_GOERLI, + sepolia: ARAGON_SEPOLIA, }; export default function lido( diff --git a/utils/network.ts b/utils/network.ts index 5fd29d0d..1564aa27 100644 --- a/utils/network.ts +++ b/utils/network.ts @@ -7,35 +7,35 @@ import { HardhatRuntimeEnvironment, HttpNetworkConfig } from "hardhat/types"; import env from "./env"; type ChainNameShort = "arb" | "opt" | "eth"; -export type NetworkName = "goerli" | "mainnet"; +export type NetworkName = "sepolia" | "mainnet"; export type SignerOrProvider = Signer | Provider; const HARDHAT_NETWORK_NAMES = { eth: { - goerli: "eth_goerli", + sepolia: "eth_sepolia", mainnet: "eth_mainnet", }, arb: { - goerli: "arb_goerli", + sepolia: "arb_sepolia", mainnet: "arb_mainnet", }, opt: { - goerli: "opt_goerli", + sepolia: "opt_sepolia", mainnet: "opt_mainnet", }, }; const HARDHAT_NETWORK_NAMES_FORK = { eth: { - goerli: "eth_goerli_fork", + sepolia: "eth_sepolia_fork", mainnet: "eth_mainnet_fork", }, arb: { - goerli: "arb_goerli_fork", + sepolia: "arb_sepolia_fork", mainnet: "arb_mainnet_fork", }, opt: { - goerli: "opt_goerli_fork", + sepolia: "opt_sepolia_fork", mainnet: "opt_mainnet_fork", }, }; @@ -119,15 +119,15 @@ function getChainId(protocol: ChainNameShort, networkName: NetworkName) { const chainIds = { eth: { mainnet: 1, - goerli: 5, + sepolia: 11155111, }, opt: { mainnet: 10, - goerli: 420, + sepolia: 11155420, }, arb: { mainnet: 42161, - goerli: 421613, + sepolia: 421613, }, }; const chainId = chainIds[protocol][networkName]; @@ -141,13 +141,13 @@ function getBlockExplorerBaseUrlByChainId(chainId: number) { const baseUrlByChainId: Record = { // ethereum 1: "https://etherscan.io", - 5: "https://goerli.etherscan.io", + 11155111: "https://sepolia.etherscan.io", // arbitrum 42161: "https://arbiscan.io", - 421613: "https://goerli-rollup-explorer.arbitrum.io", + 421613: "https://sepolia-rollup-explorer.arbitrum.io", // optimism 10: "https://optimistic.etherscan.io", - 420: "https://blockscout.com/optimism/goerli", + 11155420: "https://blockscout.com/optimism/sepolia", // forked node 31337: "https://etherscan.io", }; diff --git a/utils/optimism/addresses.ts b/utils/optimism/addresses.ts index 3dfa46ab..762cdb82 100644 --- a/utils/optimism/addresses.ts +++ b/utils/optimism/addresses.ts @@ -3,25 +3,23 @@ import { OptContractAddresses, CommonOptions } from "./types"; const OptimismMainnetAddresses: OptContractAddresses = { L1CrossDomainMessenger: "0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1", - L2CrossDomainMessenger: "0x4200000000000000000000000000000000000007", - CanonicalTransactionChain: "0x5E4e65926BA27467555EB562121fac00D24E9dD2", + L2CrossDomainMessenger: "0x4200000000000000000000000000000000000007" }; -const OptimismGoerliAddresses: OptContractAddresses = { - L1CrossDomainMessenger: "0x5086d1eEF304eb5284A0f6720f79403b4e9bE294", +const OptimismSepoliaAddresses: OptContractAddresses = { + L1CrossDomainMessenger: "0x58Cc85b8D04EA49cC6DBd3CbFFd00B4B8D6cb3ef", L2CrossDomainMessenger: "0x4200000000000000000000000000000000000007", - CanonicalTransactionChain: "0x607F755149cFEB3a14E1Dc3A4E2450Cde7dfb04D", }; -export default function addresses( +export default function addresses( networkName: NetworkName, options: CommonOptions = {} ) { switch (networkName) { case "mainnet": return { ...OptimismMainnetAddresses, ...options.customAddresses }; - case "goerli": - return { ...OptimismGoerliAddresses, ...options.customAddresses }; + case "sepolia": + return { ...OptimismSepoliaAddresses, ...options.customAddresses }; default: throw new Error(`Network "${networkName}" is not supported`); } diff --git a/utils/optimism/contracts.ts b/utils/optimism/contracts.ts index 3cc10823..4a7014db 100644 --- a/utils/optimism/contracts.ts +++ b/utils/optimism/contracts.ts @@ -1,5 +1,4 @@ import { - CanonicalTransactionChain__factory, CrossDomainMessengerStub__factory, L1CrossDomainMessenger__factory, L2CrossDomainMessenger__factory, @@ -35,9 +34,5 @@ export default function contracts( optAddresses.L2CrossDomainMessenger, l2Provider ), - CanonicalTransactionChain: CanonicalTransactionChain__factory.connect( - optAddresses.CanonicalTransactionChain, - l1Provider - ), }; } diff --git a/utils/optimism/testing.ts b/utils/optimism/testing.ts index febb4de7..635d2e6a 100644 --- a/utils/optimism/testing.ts +++ b/utils/optimism/testing.ts @@ -105,8 +105,7 @@ export default function testing(networkName: NetworkName) { l2ERC20TokenBridgeAdmin: await testingUtils.impersonate( l2ERC20TokenBridgeAdminAddress, optProvider - ), - canonicalTransactionChain: optContracts.CanonicalTransactionChain, + ) }; }, async getE2ETestSetup() { diff --git a/utils/optimism/types.ts b/utils/optimism/types.ts index 63d7f39d..38cea940 100644 --- a/utils/optimism/types.ts +++ b/utils/optimism/types.ts @@ -1,7 +1,6 @@ export type OptContractNames = | "L1CrossDomainMessenger" - | "L2CrossDomainMessenger" - | "CanonicalTransactionChain"; + | "L2CrossDomainMessenger"; export type OptContractAddresses = Record; export type CustomOptContractAddresses = Partial; diff --git a/utils/testing/scenario.ts b/utils/testing/scenario.ts index a11ba74f..66998a17 100644 --- a/utils/testing/scenario.ts +++ b/utils/testing/scenario.ts @@ -1,6 +1,6 @@ import { CtxFactory, StepTest, CtxFn } from "./types"; -class ScenarioTest { +class ScenarioTest { private afterFn?: CtxFn; private beforeFn?: CtxFn; @@ -68,6 +68,6 @@ class ScenarioTest { } } -export function scenario(title: string, ctxFactory: CtxFactory) { +export function scenario(title: string, ctxFactory: CtxFactory) { return new ScenarioTest(title, ctxFactory); } diff --git a/utils/testing/unit.ts b/utils/testing/unit.ts index 246a847e..a282e77e 100644 --- a/utils/testing/unit.ts +++ b/utils/testing/unit.ts @@ -1,11 +1,11 @@ import hre from "hardhat"; import { CtxFactory, StepTest, CtxFn } from "./types"; -export function unit(title: string, ctxFactory: CtxFactory) { +export function unit(title: string, ctxFactory: CtxFactory) { return new UnitTest(title, ctxFactory); } -class UnitTest { +class UnitTest { public readonly title: string; private readonly ctxFactory: CtxFactory;