diff --git a/.github/workflows/check-verification.yml b/.github/workflows/check-verification.yml new file mode 100644 index 00000000..6dd49ff0 --- /dev/null +++ b/.github/workflows/check-verification.yml @@ -0,0 +1,89 @@ +# Checks if all addresses are verified and generates a diff if not +name: Address verification diff + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + +on: + pull_request: + push: + branches: + - main + +jobs: + check: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "22" + registry-url: "https://registry.npmjs.org" + cache: "yarn" + + - name: install + run: yarn install --frozen-lockfile + + - name: Cache Restore + id: cache + uses: actions/cache/restore@v4 + with: + path: cache + key: ${{ runner.os }}-verification-${{ hashFiles('safe.csv') }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-verification-${{ hashFiles('safe.csv') }}- + ${{ runner.os }}-verification- + ${{ runner.os }}- + + - name: Create backup + if: steps.cache.outputs.cache-matched-key != '' + run: | + cd cache + ls -l + cd .. + cp cache/errors.json cache/errors.backup.json || : + cp cache/verification.json cache/verification.backup.json || : + + - name: verify + run: yarn check:verification + # the verification step will exit with error code whenever there is a non verified contract + # we don't want the ci to fail yet though as there are already unverified contracts + # we might consider removing this in the future + continue-on-error: true + env: + ETHERSCAN_API_KEY_MAINNET: ${{ secrets.ETHERSCAN_API_KEY_MAINNET }} + ETHERSCAN_API_KEY_POLYGON: ${{ secrets.ETHERSCAN_API_KEY_POLYGON }} + ETHERSCAN_API_KEY_ARBITRUM: ${{ secrets.ETHERSCAN_API_KEY_ARBITRUM }} + ETHERSCAN_API_KEY_OPTIMISM: ${{ secrets.ETHERSCAN_API_KEY_OPTIMISM }} + ETHERSCAN_API_KEY_SCROLL: ${{ secrets.ETHERSCAN_API_KEY_SCROLL }} + ETHERSCAN_API_KEY_BNB: ${{ secrets.ETHERSCAN_API_KEY_BNB }} + ETHERSCAN_API_KEY_BASE: ${{ secrets.ETHERSCAN_API_KEY_BASE }} + ETHERSCAN_API_KEY_ZKSYNC: ${{ secrets.ETHERSCAN_API_KEY_ZKSYNC }} + ETHERSCAN_API_KEY_GNOSIS: ${{ secrets.ETHERSCAN_API_KEY_GNOSIS }} + ETHERSCAN_API_KEY_ZKEVM: ${{ secrets.ETHERSCAN_API_KEY_ZKEVM }} + ETHERSCAN_API_KEY_AVALANCHE: ${{ secrets.ETHERSCAN_API_KEY_AVALANCHE }} + + - name: diff + if: steps.cache.outputs.cache-matched-key != '' + run: | + git diff --no-index --diff-algorithm=patience --ignore-space-at-eol cache/errors.backup.json cache/errors.json || : + git diff --no-index --diff-algorithm=patience --ignore-space-at-eol cache/verification.backup.json cache/verification.json || : + + - name: Remove backup + if: steps.cache.outputs.cache-matched-key != '' + run: | + rm cache/errors.backup.json || : + rm cache/verification.backup.json || : + + - name: Cache Save + # if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) + uses: actions/cache/save@v4 + with: + path: cache + key: ${{ runner.os }}-verification-${{ hashFiles('safe.csv') }}-${{ github.sha }} diff --git a/.github/workflows/test-release-alpha.yml b/.github/workflows/test-release-alpha.yml index 0c47dbcd..d5a6617e 100644 --- a/.github/workflows/test-release-alpha.yml +++ b/.github/workflows/test-release-alpha.yml @@ -1,7 +1,7 @@ name: Test & alpha release concurrency: - group: ${{ github.head_ref || github.ref_name }} + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} cancel-in-progress: true on: diff --git a/errors.json b/errors.json new file mode 100644 index 00000000..15366f68 --- /dev/null +++ b/errors.json @@ -0,0 +1,799 @@ +[ + { + "item": { + "path": [ + "AaveV2Avalanche", + "UI_INCENTIVE_DATA_PROVIDER" + ], + "value": "0x11979886A6dBAE27D7a72c49fCF3F23240D647bF", + "chainId": 43114 + }, + "error": "Contract source code not verified" + }, + { + "item": { + "path": [ + "AaveV2Avalanche", + "UI_POOL_DATA_PROVIDER" + ], + "value": "0x00e50FAB64eBB37b87df06Aa46b8B35d5f1A4e1A", + "chainId": 43114 + }, + "error": null + }, + { + "item": { + "path": [ + "AaveV2Ethereum", + "UI_INCENTIVE_DATA_PROVIDER" + ], + "value": "0xD01ab9a6577E1D84F142e44D49380e23A340387d", + "chainId": 1 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "0", + "Implementation": "", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV2EthereumAMM", + "UI_INCENTIVE_DATA_PROVIDER" + ], + "value": "0xD01ab9a6577E1D84F142e44D49380e23A340387d", + "chainId": 1 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "0", + "Implementation": "", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV2Polygon", + "UI_INCENTIVE_DATA_PROVIDER" + ], + "value": "0x645654D59A5226CBab969b1f5431aA47CBf64ab8", + "chainId": 137 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "0", + "Implementation": "", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "WETH", + "A_TOKEN" + ], + "value": "0xa818F1B57c201E092C4A2017A91815034326Efd1", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0x589750ba8af186ce5b55391b0b7148cad43a1619", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "WETH", + "S_TOKEN" + ], + "value": "0x436D82d905b014926a2375C576500B6fea0D2496", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0x06c35cfd3fc61ec2ac437f0d08840d5776b945af", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "WETH", + "V_TOKEN" + ], + "value": "0x0c0fce05F2314540EcB095bF4D069e5E0ED90fF8", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0xbec519531f0e78bcddb295242fa4ec5251b38574", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "wstETH", + "A_TOKEN" + ], + "value": "0x23e4E76D01B2002BE436CE8d6044b0aA2f68B68a", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0x589750ba8af186ce5b55391b0b7148cad43a1619", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "wstETH", + "S_TOKEN" + ], + "value": "0x5CBc43c339F5202D2dcB59583D33cA8498b75031", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0x06c35cfd3fc61ec2ac437f0d08840d5776b945af", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "wstETH", + "V_TOKEN" + ], + "value": "0x9D881f67F20B49243c98f53d2B9E91E39d02Ae09", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0xbec519531f0e78bcddb295242fa4ec5251b38574", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "GNO", + "A_TOKEN" + ], + "value": "0xA1Fa064A85266E2Ca82DEe5C5CcEC84DF445760e", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0x589750ba8af186ce5b55391b0b7148cad43a1619", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "GNO", + "S_TOKEN" + ], + "value": "0x1A126F613D7705E59ADb39909b25E1223aDF05dd", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0x06c35cfd3fc61ec2ac437f0d08840d5776b945af", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "GNO", + "V_TOKEN" + ], + "value": "0xBc59E99198DbA71985A66E1713cC89FFEC53f7FC", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0xbec519531f0e78bcddb295242fa4ec5251b38574", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "USDC", + "A_TOKEN" + ], + "value": "0xc6B7AcA6DE8a6044E0e32d0c841a89244A10D284", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0x589750ba8af186ce5b55391b0b7148cad43a1619", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "USDC", + "S_TOKEN" + ], + "value": "0x8220133C3a631de3C7A5B679A2417BD61431FEcf", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0x06c35cfd3fc61ec2ac437f0d08840d5776b945af", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "USDC", + "V_TOKEN" + ], + "value": "0x5F6f7B0a87CA3CF3d0b431Ae03EF3305180BFf4d", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0xbec519531f0e78bcddb295242fa4ec5251b38574", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "WXDAI", + "S_TOKEN" + ], + "value": "0xaC8b1cE0548C69318920C3e0b21Db296d5770D57", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0x06c35cfd3fc61ec2ac437f0d08840d5776b945af", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "WXDAI", + "V_TOKEN" + ], + "value": "0x281963D7471eCdC3A2Bd4503e24e89691cfe420D", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0xbec519531f0e78bcddb295242fa4ec5251b38574", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "EURe", + "A_TOKEN" + ], + "value": "0xEdBC7449a9b594CA4E053D9737EC5Dc4CbCcBfb2", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0x589750ba8af186ce5b55391b0b7148cad43a1619", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "EURe", + "S_TOKEN" + ], + "value": "0x916E13857FeeD0d982Df148DBe8d8542519aB96e", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0x06c35cfd3fc61ec2ac437f0d08840d5776b945af", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "EURe", + "V_TOKEN" + ], + "value": "0xb96404e475f337A7E98e4a541C9b71309BB66c5A", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0xbec519531f0e78bcddb295242fa4ec5251b38574", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "sDAI", + "A_TOKEN" + ], + "value": "0x7a5c3860a77a8DC1b225BD46d0fb2ac1C6D191BC", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0x589750ba8af186ce5b55391b0b7148cad43a1619", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "sDAI", + "S_TOKEN" + ], + "value": "0xa2E0335175Da40b081717FfD394C0E1de738cb9B", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0x06c35cfd3fc61ec2ac437f0d08840d5776b945af", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "sDAI", + "V_TOKEN" + ], + "value": "0x8Fe06E1D8Aff42Bf6812CacF7854A2249a00bED7", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0xbec519531f0e78bcddb295242fa4ec5251b38574", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "USDCe", + "A_TOKEN" + ], + "value": "0xC0333cb85B59a788d8C7CAe5e1Fd6E229A3E5a65", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0x589750ba8af186ce5b55391b0b7148cad43a1619", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "USDCe", + "S_TOKEN" + ], + "value": "0x135A7bA96fBe20949cf2D8E46c7F5ca3bB1EE222", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0x06c35cfd3fc61ec2ac437f0d08840d5776b945af", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "AaveV3Gnosis", + "ASSETS", + "USDCe", + "V_TOKEN" + ], + "value": "0x37B9Ad6b5DC8Ad977AD716e92F49e9D200e58431", + "chainId": 100 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "1", + "Implementation": "0xbec519531f0e78bcddb295242fa4ec5251b38574", + "SwarmSource": "" + } + ] + }, + { + "item": { + "path": [ + "GovernanceV3PolygonZkEvm", + "PC_DATA_HELPER" + ], + "value": "0xF1c11BE0b4466728DDb7991A0Ac5265646ec9672", + "chainId": 1101 + }, + "error": [ + { + "SourceCode": "", + "ABI": "Contract source code not verified", + "ContractName": "", + "CompilerVersion": "", + "OptimizationUsed": "", + "Runs": "", + "ConstructorArguments": "", + "EVMVersion": "Default", + "Library": "", + "LicenseType": "Unknown", + "Proxy": "0", + "Implementation": "", + "SwarmSource": "" + } + ] + } +] \ No newline at end of file diff --git a/package.json b/package.json index 4de1f7ec..94f2f54d 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "sideEffects": false, "scripts": { "prettier": "prettier --write 'src/**/*.{sol,ts}'", + "check:verification": "tsx scripts/verifyVerified.ts", "generate:abis": "tsx scripts/generateABIs.ts && npm run prettier", "generate:safe": "tsx scripts/generateSafeCSV.ts", "generate:addresses": "tsx scripts/generateAddresses.ts && npm run generate:safe && npm run prettier", diff --git a/safe.csv b/safe.csv index 3968f74e..26b79928 100644 --- a/safe.csv +++ b/safe.csv @@ -1,16 +1,11 @@ address,name,chainId -0x7d9103572bE58FfE99dc390E8246f02dcAe6f611,AaveGovernanceV2 ARBITRUM_BRIDGE_EXECUTOR,1 0xAce1d11d836cb3F51Ef658FD4D353fFb3c301218,AaveGovernanceV2 ARC_TIMELOCK,1 -0xA9F30e6ED4098e9439B2ac8aEA2d3fc26BcEbb45,AaveGovernanceV2 BASE_BRIDGE_EXECUTOR,1 0xd1B3E25fD7C8AE7CADDC6F71b461b79CD4ddcFa3,AaveGovernanceV2 CROSSCHAIN_FORWARDER_ARBITRUM,1 0x3215225538da1546FE0DA88ee13019f402078942,AaveGovernanceV2 CROSSCHAIN_FORWARDER_BASE,1 0x2fE52eF191F0BE1D98459BdaD2F1d3160336C08f,AaveGovernanceV2 CROSSCHAIN_FORWARDER_METIS,1 0x5f5C02875a8e9B5A26fbd09040ABCfDeb2AA6711,AaveGovernanceV2 CROSSCHAIN_FORWARDER_OPTIMISM,1 0x158a6bC04F0828318821baE797f50B0A1299d45b,AaveGovernanceV2 CROSSCHAIN_FORWARDER_POLYGON,1 0x79426A1c24B2978D90d7A5070a46C65B07bC4299,AaveGovernanceV2 LONG_EXECUTOR,1 -0x8EC77963068474a45016938Deb95E603Ca82a029,AaveGovernanceV2 METIS_BRIDGE_EXECUTOR,1 -0x7d9103572bE58FfE99dc390E8246f02dcAe6f611,AaveGovernanceV2 OPTIMISM_BRIDGE_EXECUTOR,1 -0xdc9A35B16DB4e126cFeDC41322b3a36454B1F772,AaveGovernanceV2 POLYGON_BRIDGE_EXECUTOR,1 0xEE56e2B3D491590B5b31738cC34d5232F378a8D5,AaveGovernanceV2 SHORT_EXECUTOR,1 0x4da27a545c0c5B758a6BA100e3a049001de870f5,AaveSafetyModule STK_AAVE,1 0x9eDA81C21C273a82BE9Bbc19B6A6182212068101,AaveSafetyModule STK_AAVE_WSTETH_BPTV2,1 @@ -974,6 +969,7 @@ address,name,chainId 0x55Cf9583D7D30DC4936bAee1f747591dBECe5df7,MiscOptimism AAVE_CL_ROBOT_OPERATOR,10 0x1685D81212580DD4cDA287616C2f6F4794927e18,MiscOptimism AAVE_MERKLE_DISTRIBUTOR,10 0x3b56998Ec06477704622ca8e2eA1b4db134cec32,MiscOptimism CREATE_3_FACTORY,10 +0x7d9103572bE58FfE99dc390E8246f02dcAe6f611,MiscOptimism LEGACY_BRIDGE_EXECUTOR,10 0x9abf798f5314BFd793A9E57A654BEd35af4A1D60,MiscOptimism PARASWAP_FEE_CLAIMER,10 0xE50c8C619d05ff98b22Adf991F17602C774F785c,MiscOptimism PROTOCOL_GUARDIAN,10 0xD3cF979e676265e4f6379749DECe4708B9A22476,MiscOptimism PROXY_ADMIN,10 @@ -1476,6 +1472,7 @@ address,name,chainId 0x7A9ff54A6eE4a21223036890bB8c4ea2D62c686b,MiscPolygon AAVE_MERKLE_DISTRIBUTOR,137 0x1C2BA5b8ab8e795fF44387ba6d251fa65AD20b36,MiscPolygon AAVE_POL_ETH_BRIDGE,137 0x3b56998Ec06477704622ca8e2eA1b4db134cec32,MiscPolygon CREATE_3_FACTORY,137 +0xdc9A35B16DB4e126cFeDC41322b3a36454B1F772,MiscPolygon LEGACY_BRIDGE_EXECUTOR,137 0xeE652bbF72689AA59F0B8F981c9c90e2A8Af8d8f,MiscPolygon MaticX_RATE_PROVIDER,137 0x9abf798f5314BFd793A9E57A654BEd35af4A1D60,MiscPolygon PARASWAP_FEE_CLAIMER,137 0x1450F2898D6bA2710C98BE9CAF3041330eD5ae58,MiscPolygon PROTOCOL_GUARDIAN,137 @@ -1649,6 +1646,7 @@ address,name,chainId 0x2233F8A66A728FBa6E1dC95570B25360D07D5524,GovernanceV3Metis PAYLOADS_CONTROLLER,1088 0x81d32B36380e6266e1BDd490eAC56cdB300afBe0,GovernanceV3Metis PC_DATA_HELPER,1088 0x2e649f6b54B07E210b31c9cC2eB8a0d5997c3D4A,MiscMetis CREATE_3_FACTORY,1088 +0x8EC77963068474a45016938Deb95E603Ca82a029,MiscMetis LEGACY_BRIDGE_EXECUTOR,1088 0xF6Db48C5968A9eBCB935786435530f28e32Cc501,MiscMetis PROTOCOL_GUARDIAN,1088 0x1CabD986cBAbDf12E00128DFf03C80ee62C4fd97,MiscMetis PROXY_ADMIN,1088 0x1dad86dC5990BCE5bFe3A150A4E0ece990d6EBcB,MiscMetis TRANSPARENT_PROXY_FACTORY,1088 @@ -1778,6 +1776,7 @@ address,name,chainId 0xE3B770Dc4ae3f8bECaB3Ed12dE692c741603e16A,GovernanceV3Base PC_DATA_HELPER,8453 0x88db99eeBb390a2a4DcAC2E1DDb09c07E911C5C3,MiscBase AAVE_CL_ROBOT_OPERATOR,8453 0x3b56998Ec06477704622ca8e2eA1b4db134cec32,MiscBase CREATE_3_FACTORY,8453 +0xA9F30e6ED4098e9439B2ac8aEA2d3fc26BcEbb45,MiscBase LEGACY_BRIDGE_EXECUTOR,8453 0xAe940e61E9863178b71500c9B5faE2a04Da361a1,MiscBase PARASWAP_FEE_CLAIMER,8453 0x9e10C0A1Eb8FF6a0AaA53a62C7a338f35D7D9a2A,MiscBase PROTOCOL_GUARDIAN,8453 0xc85b1E333aecc99340b2320493Fe2d22b8734795,MiscBase PROXY_ADMIN,8453 @@ -1950,6 +1949,7 @@ address,name,chainId 0xaa944aD95e51CB83C1f35FAEEDfC7d2c31B0BB4d,MiscArbitrum AAVE_CL_ROBOT_OPERATOR,42161 0x3b56998Ec06477704622ca8e2eA1b4db134cec32,MiscArbitrum CREATE_3_FACTORY,42161 0xF168B83598516A532a85995b52504a2Fa058C068,MiscArbitrum GHO_CCIP_TOKEN_POOL,42161 +0x7d9103572bE58FfE99dc390E8246f02dcAe6f611,MiscArbitrum LEGACY_BRIDGE_EXECUTOR,42161 0x9abf798f5314BFd793A9E57A654BEd35af4A1D60,MiscArbitrum PARASWAP_FEE_CLAIMER,42161 0xbbd9f90699c1FA0D7A65870D241DD1f1217c96Eb,MiscArbitrum PROTOCOL_GUARDIAN,42161 0xD3cF979e676265e4f6379749DECe4708B9A22476,MiscArbitrum PROXY_ADMIN,42161 diff --git a/scripts/configs/networks/arbitrum.ts b/scripts/configs/networks/arbitrum.ts index 82ff8249..04d0e14f 100644 --- a/scripts/configs/networks/arbitrum.ts +++ b/scripts/configs/networks/arbitrum.ts @@ -5,6 +5,7 @@ import {NetworkAddresses} from '../types'; export const arbitrumAddresses: NetworkAddresses<{ wstETH_stETH_AGGREGATOR: Hex; rETH_ETH_AGGREGATOR: Hex; + LEGACY_BRIDGE_EXECUTOR: Hex; }> = { name: 'Arbitrum', chainId: ChainId.arbitrum_one, @@ -18,6 +19,7 @@ export const arbitrumAddresses: NetworkAddresses<{ wstETH_stETH_AGGREGATOR: '0xB1552C5e96B312d0Bf8b554186F846C40614a540', rETH_ETH_AGGREGATOR: '0xF3272CAfe65b190e76caAF483db13424a3e23dD2', GHO_CCIP_TOKEN_POOL: '0xF168B83598516A532a85995b52504a2Fa058C068', + LEGACY_BRIDGE_EXECUTOR: '0x7d9103572bE58FfE99dc390E8246f02dcAe6f611', }, }; diff --git a/scripts/configs/networks/base.ts b/scripts/configs/networks/base.ts index ad572469..b2a4d9df 100644 --- a/scripts/configs/networks/base.ts +++ b/scripts/configs/networks/base.ts @@ -5,6 +5,7 @@ import {NetworkAddresses} from '../types'; export const baseAddresses: NetworkAddresses<{ wstETH_stETH_AGGREGATOR: Hex; cbETH_ETH_AGGREGATOR: Hex; + LEGACY_BRIDGE_EXECUTOR: Hex; }> = { name: 'Base', chainId: ChainId.base, @@ -17,6 +18,7 @@ export const baseAddresses: NetworkAddresses<{ PROTOCOL_GUARDIAN: '0x9e10C0A1Eb8FF6a0AaA53a62C7a338f35D7D9a2A', wstETH_stETH_AGGREGATOR: '0xB88BAc61a4Ca37C43a3725912B1f472c9A5bc061', cbETH_ETH_AGGREGATOR: '0x868a501e68F3D1E89CfC0D22F6b22E8dabce5F04', + LEGACY_BRIDGE_EXECUTOR: '0xA9F30e6ED4098e9439B2ac8aEA2d3fc26BcEbb45', }, }; @@ -26,6 +28,6 @@ export const baseSepoliaAddresses: NetworkAddresses = { addresses: { TRANSPARENT_PROXY_FACTORY: '0xd90f09ea5ee893b8c0564719e855f1cf0455d894', PROXY_ADMIN: '0xF9e48edc704BDF494309cA457BCea4c0696f591d', - GHO_TOKEN:'0x7CFa3f3d1cded0Da930881c609D4Dbf0012c14Bb' + GHO_TOKEN: '0x7CFa3f3d1cded0Da930881c609D4Dbf0012c14Bb', }, }; diff --git a/scripts/configs/networks/metis.ts b/scripts/configs/networks/metis.ts index 8635227c..8011351b 100644 --- a/scripts/configs/networks/metis.ts +++ b/scripts/configs/networks/metis.ts @@ -1,7 +1,10 @@ import {ChainId} from '@bgd-labs/js-utils'; import {NetworkAddresses} from '../types'; +import {Hex} from 'viem'; -export const metisAddresses: NetworkAddresses = { +export const metisAddresses: NetworkAddresses<{ + LEGACY_BRIDGE_EXECUTOR: Hex; +}> = { name: 'Metis', chainId: ChainId.metis, addresses: { @@ -9,5 +12,6 @@ export const metisAddresses: NetworkAddresses = { PROXY_ADMIN: '0x1CabD986cBAbDf12E00128DFf03C80ee62C4fd97', CREATE_3_FACTORY: '0x2e649f6b54B07E210b31c9cC2eB8a0d5997c3D4A', PROTOCOL_GUARDIAN: '0xF6Db48C5968A9eBCB935786435530f28e32Cc501', + LEGACY_BRIDGE_EXECUTOR: '0x8EC77963068474a45016938Deb95E603Ca82a029', }, }; diff --git a/scripts/configs/networks/optimism.ts b/scripts/configs/networks/optimism.ts index b6fb893d..6ed5f77a 100644 --- a/scripts/configs/networks/optimism.ts +++ b/scripts/configs/networks/optimism.ts @@ -5,6 +5,7 @@ import {NetworkAddresses} from '../types'; export const optimismAddresses: NetworkAddresses<{ wstETH_stETH_AGGREGATOR: Hex; rETH_ETH_AGGREGATOR: Hex; + LEGACY_BRIDGE_EXECUTOR: Hex; }> = { name: 'Optimism', chainId: ChainId.optimism, @@ -18,6 +19,7 @@ export const optimismAddresses: NetworkAddresses<{ AAVE_MERKLE_DISTRIBUTOR: '0x1685D81212580DD4cDA287616C2f6F4794927e18', wstETH_stETH_AGGREGATOR: '0xe59EBa0D492cA53C6f46015EEa00517F2707dc77', rETH_ETH_AGGREGATOR: '0x22F3727be377781d1579B7C9222382b21c9d1a8f', + LEGACY_BRIDGE_EXECUTOR: '0x7d9103572bE58FfE99dc390E8246f02dcAe6f611', }, }; @@ -27,6 +29,6 @@ export const optimismSepoliaAddresses: NetworkAddresses = { addresses: { GHO_TOKEN: '0xb13Cfa6f8B2Eed2C37fB00fF0c1A59807C585810', TRANSPARENT_PROXY_FACTORY: '0xb172a90A7C238969CE9B27cc19D13b60A91e7F00', - PROXY_ADMIN: '0xe892E40C92c2E4D281Be59b2E6300F271d824E75' + PROXY_ADMIN: '0xe892E40C92c2E4D281Be59b2E6300F271d824E75', }, }; diff --git a/scripts/configs/networks/polygon.ts b/scripts/configs/networks/polygon.ts index 702e0f48..876e6d0b 100644 --- a/scripts/configs/networks/polygon.ts +++ b/scripts/configs/networks/polygon.ts @@ -7,6 +7,7 @@ export const polygonAddresses: NetworkAddresses<{ wstETH_stETH_AGGREGATOR: Hex; MaticX_RATE_PROVIDER: Hex; stMATIC_RATE_PROVIDER: Hex; + LEGACY_BRIDGE_EXECUTOR: Hex; }> = { name: 'Polygon', chainId: ChainId.polygon, @@ -22,5 +23,6 @@ export const polygonAddresses: NetworkAddresses<{ wstETH_stETH_AGGREGATOR: '0x3Ea1eC855fBda8bA0396975eC260AD2e9B2Bc01c', MaticX_RATE_PROVIDER: '0xeE652bbF72689AA59F0B8F981c9c90e2A8Af8d8f', stMATIC_RATE_PROVIDER: '0xdEd6C522d803E35f65318a9a4d7333a22d582199', + LEGACY_BRIDGE_EXECUTOR: '0xdc9A35B16DB4e126cFeDC41322b3a36454B1F772', }, }; diff --git a/scripts/generateSafeCSV.ts b/scripts/generateSafeCSV.ts index 813119db..1ad064fa 100644 --- a/scripts/generateSafeCSV.ts +++ b/scripts/generateSafeCSV.ts @@ -1,44 +1,10 @@ -import * as addressBook from '../src/ts/AaveAddressBook'; -import {Address, isAddress} from 'viem'; import {CHAIN_ID_CLIENT_MAP} from '@bgd-labs/js-utils'; import {writeFileSync} from 'fs'; +import {flattenedAddresses} from './generator/getAddresses'; -export type ListItem = { - path: string[]; - value: string; - chainId: number | null; -}; - -function flattenObject(obj: any, path: string[] = [], chainId: number | null = null): ListItem[] { - const result: ListItem[] = []; - const entries = Object.entries(obj).sort(([keyA], [keyB]) => { - if (keyA === 'CHAIN_ID') return -1; - if (keyB === 'CHAIN_ID') return 1; - return 0; - }); - - for (let [key, value] of entries) { - if (key === 'tokenlist') continue; - if (chainId && CHAIN_ID_CLIENT_MAP[chainId!].chain?.testnet) continue; - - const newPath = [...path, key]; - if (key === 'CHAIN_ID') { - chainId = value as number; - } - if (typeof value === 'object' && value !== null) { - result.push(...flattenObject(value, newPath, chainId)); - } else if (isAddress(value as string)) { - result.push({ - path: newPath, - value: value as Address, - chainId, - }); - } - } - return result; -} - -const addresses = flattenObject(addressBook); +const addresses = flattenedAddresses.filter( + (item) => !CHAIN_ID_CLIENT_MAP[item.chainId].chain?.testnet, +); const safe = `address,name,chainId\n${addresses .sort((a, b) => a.chainId! - b.chainId!) diff --git a/scripts/generator/getAddresses.ts b/scripts/generator/getAddresses.ts new file mode 100644 index 00000000..530ea081 --- /dev/null +++ b/scripts/generator/getAddresses.ts @@ -0,0 +1,44 @@ +import * as addressBook from '../../src/ts/AaveAddressBook'; +import {Address, isAddress} from 'viem'; +import {CHAIN_ID_CLIENT_MAP} from '@bgd-labs/js-utils'; + +export type ListItem = { + path: string[]; + value: string; + chainId: number; +}; + +export function flattenObject( + obj: any, + path: string[] = [], + chainId: number | null = null, +): ListItem[] { + const result: ListItem[] = []; + const entries = Object.entries(obj).sort(([keyA], [keyB]) => { + if (keyA === 'CHAIN_ID') return -1; + if (keyB === 'CHAIN_ID') return 1; + return 0; + }); + + for (let [key, value] of entries) { + if (key === 'tokenlist') continue; + if (chainId && CHAIN_ID_CLIENT_MAP[chainId!].chain?.testnet) continue; + + const newPath = [...path, key]; + if (key === 'CHAIN_ID') { + chainId = value as number; + } + if (typeof value === 'object' && value !== null) { + result.push(...flattenObject(value, newPath, chainId)); + } else if (isAddress(value as string)) { + result.push({ + path: newPath, + value: value as Address, + chainId: chainId!, + }); + } + } + return result; +} + +export const flattenedAddresses = flattenObject(addressBook); diff --git a/scripts/generator/governanceV2Generator.ts b/scripts/generator/governanceV2Generator.ts index a2c907ad..0d728251 100644 --- a/scripts/generator/governanceV2Generator.ts +++ b/scripts/generator/governanceV2Generator.ts @@ -13,31 +13,6 @@ const govV2Addresses: Addresses = { SHORT_EXECUTOR: '0xEE56e2B3D491590B5b31738cC34d5232F378a8D5', LONG_EXECUTOR: '0x79426A1c24B2978D90d7A5070a46C65B07bC4299', ARC_TIMELOCK: '0xAce1d11d836cb3F51Ef658FD4D353fFb3c301218', - POLYGON_BRIDGE_EXECUTOR: { - value: '0xdc9A35B16DB4e126cFeDC41322b3a36454B1F772', - type: 'address', - chainId: ChainId.polygon, - }, - OPTIMISM_BRIDGE_EXECUTOR: { - value: '0x7d9103572bE58FfE99dc390E8246f02dcAe6f611', - type: 'address', - chainId: ChainId.optimism, - }, - ARBITRUM_BRIDGE_EXECUTOR: { - value: '0x7d9103572bE58FfE99dc390E8246f02dcAe6f611', - type: 'address', - chainId: ChainId.arbitrum_one, - }, - METIS_BRIDGE_EXECUTOR: { - value: '0x8EC77963068474a45016938Deb95E603Ca82a029', - type: 'address', - chainId: ChainId.metis, - }, - BASE_BRIDGE_EXECUTOR: { - value: '0xA9F30e6ED4098e9439B2ac8aEA2d3fc26BcEbb45', - type: 'address', - chainId: ChainId.base, - }, CROSSCHAIN_FORWARDER_POLYGON: '0x158a6bC04F0828318821baE797f50B0A1299d45b', CROSSCHAIN_FORWARDER_OPTIMISM: '0x5f5C02875a8e9B5A26fbd09040ABCfDeb2AA6711', CROSSCHAIN_FORWARDER_ARBITRUM: '0xd1B3E25fD7C8AE7CADDC6F71b461b79CD4ddcFa3', diff --git a/scripts/verifyVerified.ts b/scripts/verifyVerified.ts new file mode 100644 index 00000000..9bfe42aa --- /dev/null +++ b/scripts/verifyVerified.ts @@ -0,0 +1,142 @@ +import {CHAIN_ID_CLIENT_MAP, ChainId} from '@bgd-labs/js-utils'; +import {ListItem, flattenedAddresses} from './generator/getAddresses'; +import {writeFileSync, readFileSync, existsSync, mkdirSync} from 'fs'; +import {Address, zeroAddress} from 'viem'; + +const CHAIN_ID_API_KEY_MAP = { + [ChainId.mainnet]: process.env.ETHERSCAN_API_KEY_MAINNET, + [ChainId.polygon]: process.env.ETHERSCAN_API_KEY_POLYGON, + [ChainId.zkEVM]: process.env.ETHERSCAN_API_KEY_ZKEVM, + [ChainId.arbitrum_one]: process.env.ETHERSCAN_API_KEY_ARBITRUM, + [ChainId.optimism]: process.env.ETHERSCAN_API_KEY_OPTIMISM, + [ChainId.scroll]: process.env.ETHERSCAN_API_KEY_SCROLL, + [ChainId.bnb]: process.env.ETHERSCAN_API_KEY_BNB, + [ChainId.base]: process.env.ETHERSCAN_API_KEY_BASE, + [ChainId.zkSync]: process.env.ETHERSCAN_API_KEY_ZKSYNC, + [ChainId.gnosis]: process.env.ETHERSCAN_API_KEY_GNOSIS, +}; + +function getApiUrl(chainId: number) { + if (chainId === ChainId.metis) + return `https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan/api`; + return CHAIN_ID_CLIENT_MAP[chainId]?.chain?.blockExplorers?.default.apiUrl; +} + +function sleep(ms) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +async function checkProxyVerfication(item: ListItem, guid: string) { + const params = { + apikey: CHAIN_ID_API_KEY_MAP[item.chainId] || '', + module: 'contract', + action: 'checkproxyverification', + guid, + }; + const formattedParams = new URLSearchParams(params).toString(); + const url = `${getApiUrl(item.chainId)}?${formattedParams}`; + try { + const request = await fetch(url); + const {status} = await request.json(); + if (status === '1') + console.log( + 'successfully verified proxy. Please rerun the script in a few minutes as you need to wait till etherscan prunes its cache.', + ); + } catch (e) {} +} + +async function verifyProxy(item: ListItem) { + const params = { + apikey: CHAIN_ID_API_KEY_MAP[item.chainId] || '', + module: 'contract', + action: 'verifyproxycontract', + }; + const formattedParams = new URLSearchParams(params).toString(); + const url = `${getApiUrl(item.chainId)}?${formattedParams}`; + try { + const request = await fetch(url, { + method: 'POST', + body: new URLSearchParams({ + address: item.value, + }), + }); + + const {status, result} = await request.json(); + await sleep(1000); + if (status === '1') checkProxyVerfication(item, result); + } catch (e) { + console.error(e); + process.exit(1); + } +} + +async function checkVerified(item: ListItem) { + const params = { + apikey: CHAIN_ID_API_KEY_MAP[item.chainId] || '', + address: item.value, + module: 'contract', + action: 'getsourcecode', + }; + + const formattedParams = new URLSearchParams(params).toString(); + const url = `${getApiUrl(item.chainId)}?${formattedParams}`; + try { + const request = await fetch(url); + const {status, result} = await request.json(); + if (status !== '1' || !result[0].ContractName) { + // etherscan returns proxy contracts as non verified if the proxy is not manually assigned + // therefore we try to manually assign it + if (['S_TOKEN', 'V_TOKEN', 'A_TOKEN'].includes(item.path[item.path.length - 1])) { + await verifyProxy(item); + } + } + return {status, result}; + } catch (e) { + console.error(e); + return {status: '0', result: e}; + } +} + +const cachePath = './cache/verification.json'; + +async function main() { + if (!existsSync('cache')) mkdirSync('cache'); + const cache: Record> = existsSync(cachePath) + ? JSON.parse(readFileSync(cachePath, 'utf-8')) + : {}; + + const errors: {item: ListItem; error: any}[] = []; + for (const item of flattenedAddresses.filter( + (item) => ![ChainId.harmony, ChainId.fantom].includes(item.chainId as any), + )) { + // skip contracts for which we have checked verification before + if (cache[item.chainId]?.[item.value]) continue; + // skip zero addresses + if (item.value === zeroAddress) continue; + const {status, result} = (await checkVerified(item)) as { + status: string; + result: {ContractName: string}[]; + }; + + if (status !== '1' || !result[0].ContractName) { + errors.push({item, error: result}); + writeFileSync('./cache/errors.json', JSON.stringify(errors, null, 2), {encoding: 'utf-8'}); + console.log('errors', errors.length); + } else { + if (!cache[item.chainId]) cache[item.chainId] = {}; + cache[item.chainId][item.value] = { + name: result[0].ContractName, + }; + writeFileSync(cachePath, JSON.stringify(cache, null, 2), {encoding: 'utf-8'}); + } + await sleep(200); // rate limit on etherscan api of 5 req/s + } + if (errors.length != 0) { + console.log(errors); + process.exit(1); + } else { + writeFileSync('./cache/errors.json', JSON.stringify({}, null, 2), {encoding: 'utf-8'}); + } +} + +main(); diff --git a/src/AaveGovernanceV2.sol b/src/AaveGovernanceV2.sol index b5993e23..5b9d50c6 100644 --- a/src/AaveGovernanceV2.sol +++ b/src/AaveGovernanceV2.sol @@ -12,21 +12,6 @@ library AaveGovernanceV2 { // https://etherscan.io/address/0xAce1d11d836cb3F51Ef658FD4D353fFb3c301218 address internal constant ARC_TIMELOCK = 0xAce1d11d836cb3F51Ef658FD4D353fFb3c301218; - // https://polygonscan.com/address/0xdc9A35B16DB4e126cFeDC41322b3a36454B1F772 - address internal constant POLYGON_BRIDGE_EXECUTOR = 0xdc9A35B16DB4e126cFeDC41322b3a36454B1F772; - - // https://optimistic.etherscan.io/address/0x7d9103572bE58FfE99dc390E8246f02dcAe6f611 - address internal constant OPTIMISM_BRIDGE_EXECUTOR = 0x7d9103572bE58FfE99dc390E8246f02dcAe6f611; - - // https://arbiscan.io/address/0x7d9103572bE58FfE99dc390E8246f02dcAe6f611 - address internal constant ARBITRUM_BRIDGE_EXECUTOR = 0x7d9103572bE58FfE99dc390E8246f02dcAe6f611; - - // https://explorer.metis.io/address/0x8EC77963068474a45016938Deb95E603Ca82a029 - address internal constant METIS_BRIDGE_EXECUTOR = 0x8EC77963068474a45016938Deb95E603Ca82a029; - - // https://basescan.org/address/0xA9F30e6ED4098e9439B2ac8aEA2d3fc26BcEbb45 - address internal constant BASE_BRIDGE_EXECUTOR = 0xA9F30e6ED4098e9439B2ac8aEA2d3fc26BcEbb45; - // https://etherscan.io/address/0x158a6bC04F0828318821baE797f50B0A1299d45b address internal constant CROSSCHAIN_FORWARDER_POLYGON = 0x158a6bC04F0828318821baE797f50B0A1299d45b; diff --git a/src/MiscArbitrum.sol b/src/MiscArbitrum.sol index 60eb7357..02b3c6ac 100644 --- a/src/MiscArbitrum.sol +++ b/src/MiscArbitrum.sol @@ -29,4 +29,7 @@ library MiscArbitrum { // https://arbiscan.io/address/0xF168B83598516A532a85995b52504a2Fa058C068 address internal constant GHO_CCIP_TOKEN_POOL = 0xF168B83598516A532a85995b52504a2Fa058C068; + + // https://arbiscan.io/address/0x7d9103572bE58FfE99dc390E8246f02dcAe6f611 + address internal constant LEGACY_BRIDGE_EXECUTOR = 0x7d9103572bE58FfE99dc390E8246f02dcAe6f611; } diff --git a/src/MiscBase.sol b/src/MiscBase.sol index e4cb0cbb..7c6e091d 100644 --- a/src/MiscBase.sol +++ b/src/MiscBase.sol @@ -26,4 +26,7 @@ library MiscBase { // https://basescan.org/address/0x868a501e68F3D1E89CfC0D22F6b22E8dabce5F04 address internal constant cbETH_ETH_AGGREGATOR = 0x868a501e68F3D1E89CfC0D22F6b22E8dabce5F04; + + // https://basescan.org/address/0xA9F30e6ED4098e9439B2ac8aEA2d3fc26BcEbb45 + address internal constant LEGACY_BRIDGE_EXECUTOR = 0xA9F30e6ED4098e9439B2ac8aEA2d3fc26BcEbb45; } diff --git a/src/MiscMetis.sol b/src/MiscMetis.sol index abc2b79f..c0174064 100644 --- a/src/MiscMetis.sol +++ b/src/MiscMetis.sol @@ -14,4 +14,7 @@ library MiscMetis { // https://explorer.metis.io/address/0xF6Db48C5968A9eBCB935786435530f28e32Cc501 address internal constant PROTOCOL_GUARDIAN = 0xF6Db48C5968A9eBCB935786435530f28e32Cc501; + + // https://explorer.metis.io/address/0x8EC77963068474a45016938Deb95E603Ca82a029 + address internal constant LEGACY_BRIDGE_EXECUTOR = 0x8EC77963068474a45016938Deb95E603Ca82a029; } diff --git a/src/MiscOptimism.sol b/src/MiscOptimism.sol index 816fde53..e8b68216 100644 --- a/src/MiscOptimism.sol +++ b/src/MiscOptimism.sol @@ -29,4 +29,7 @@ library MiscOptimism { // https://optimistic.etherscan.io/address/0x22F3727be377781d1579B7C9222382b21c9d1a8f address internal constant rETH_ETH_AGGREGATOR = 0x22F3727be377781d1579B7C9222382b21c9d1a8f; + + // https://optimistic.etherscan.io/address/0x7d9103572bE58FfE99dc390E8246f02dcAe6f611 + address internal constant LEGACY_BRIDGE_EXECUTOR = 0x7d9103572bE58FfE99dc390E8246f02dcAe6f611; } diff --git a/src/MiscPolygon.sol b/src/MiscPolygon.sol index d86f0173..00a12d98 100644 --- a/src/MiscPolygon.sol +++ b/src/MiscPolygon.sol @@ -35,4 +35,7 @@ library MiscPolygon { // https://polygonscan.com/address/0xdEd6C522d803E35f65318a9a4d7333a22d582199 address internal constant stMATIC_RATE_PROVIDER = 0xdEd6C522d803E35f65318a9a4d7333a22d582199; + + // https://polygonscan.com/address/0xdc9A35B16DB4e126cFeDC41322b3a36454B1F772 + address internal constant LEGACY_BRIDGE_EXECUTOR = 0xdc9A35B16DB4e126cFeDC41322b3a36454B1F772; } diff --git a/src/ts/AaveGovernanceV2.ts b/src/ts/AaveGovernanceV2.ts index 6738fdbb..08bca0bc 100644 --- a/src/ts/AaveGovernanceV2.ts +++ b/src/ts/AaveGovernanceV2.ts @@ -8,21 +8,6 @@ export const LONG_EXECUTOR = '0x79426A1c24B2978D90d7A5070a46C65B07bC4299'; // https://etherscan.io/address/0xAce1d11d836cb3F51Ef658FD4D353fFb3c301218 export const ARC_TIMELOCK = '0xAce1d11d836cb3F51Ef658FD4D353fFb3c301218'; -// address https://polygonscan.com/address/0xdc9A35B16DB4e126cFeDC41322b3a36454B1F772 -export const POLYGON_BRIDGE_EXECUTOR = '0xdc9A35B16DB4e126cFeDC41322b3a36454B1F772'; - -// address https://optimistic.etherscan.io/address/0x7d9103572bE58FfE99dc390E8246f02dcAe6f611 -export const OPTIMISM_BRIDGE_EXECUTOR = '0x7d9103572bE58FfE99dc390E8246f02dcAe6f611'; - -// address https://arbiscan.io/address/0x7d9103572bE58FfE99dc390E8246f02dcAe6f611 -export const ARBITRUM_BRIDGE_EXECUTOR = '0x7d9103572bE58FfE99dc390E8246f02dcAe6f611'; - -// address https://explorer.metis.io/address/0x8EC77963068474a45016938Deb95E603Ca82a029 -export const METIS_BRIDGE_EXECUTOR = '0x8EC77963068474a45016938Deb95E603Ca82a029'; - -// address https://basescan.org/address/0xA9F30e6ED4098e9439B2ac8aEA2d3fc26BcEbb45 -export const BASE_BRIDGE_EXECUTOR = '0xA9F30e6ED4098e9439B2ac8aEA2d3fc26BcEbb45'; - // https://etherscan.io/address/0x158a6bC04F0828318821baE797f50B0A1299d45b export const CROSSCHAIN_FORWARDER_POLYGON = '0x158a6bC04F0828318821baE797f50B0A1299d45b'; diff --git a/src/ts/MiscArbitrum.ts b/src/ts/MiscArbitrum.ts index 70c0fa7a..bde52003 100644 --- a/src/ts/MiscArbitrum.ts +++ b/src/ts/MiscArbitrum.ts @@ -26,4 +26,7 @@ export const rETH_ETH_AGGREGATOR = '0xF3272CAfe65b190e76caAF483db13424a3e23dD2'; // https://arbiscan.io/address/0xF168B83598516A532a85995b52504a2Fa058C068 export const GHO_CCIP_TOKEN_POOL = '0xF168B83598516A532a85995b52504a2Fa058C068'; +// https://arbiscan.io/address/0x7d9103572bE58FfE99dc390E8246f02dcAe6f611 +export const LEGACY_BRIDGE_EXECUTOR = '0x7d9103572bE58FfE99dc390E8246f02dcAe6f611'; + export const CHAIN_ID = 42161; diff --git a/src/ts/MiscBase.ts b/src/ts/MiscBase.ts index 40935baa..2a64acf0 100644 --- a/src/ts/MiscBase.ts +++ b/src/ts/MiscBase.ts @@ -23,4 +23,7 @@ export const wstETH_stETH_AGGREGATOR = '0xB88BAc61a4Ca37C43a3725912B1f472c9A5bc0 // https://basescan.org/address/0x868a501e68F3D1E89CfC0D22F6b22E8dabce5F04 export const cbETH_ETH_AGGREGATOR = '0x868a501e68F3D1E89CfC0D22F6b22E8dabce5F04'; +// https://basescan.org/address/0xA9F30e6ED4098e9439B2ac8aEA2d3fc26BcEbb45 +export const LEGACY_BRIDGE_EXECUTOR = '0xA9F30e6ED4098e9439B2ac8aEA2d3fc26BcEbb45'; + export const CHAIN_ID = 8453; diff --git a/src/ts/MiscMetis.ts b/src/ts/MiscMetis.ts index 8b4da1c6..d8db107b 100644 --- a/src/ts/MiscMetis.ts +++ b/src/ts/MiscMetis.ts @@ -11,4 +11,7 @@ export const CREATE_3_FACTORY = '0x2e649f6b54B07E210b31c9cC2eB8a0d5997c3D4A'; // https://explorer.metis.io/address/0xF6Db48C5968A9eBCB935786435530f28e32Cc501 export const PROTOCOL_GUARDIAN = '0xF6Db48C5968A9eBCB935786435530f28e32Cc501'; +// https://explorer.metis.io/address/0x8EC77963068474a45016938Deb95E603Ca82a029 +export const LEGACY_BRIDGE_EXECUTOR = '0x8EC77963068474a45016938Deb95E603Ca82a029'; + export const CHAIN_ID = 1088; diff --git a/src/ts/MiscOptimism.ts b/src/ts/MiscOptimism.ts index a71f74cd..283c1bd1 100644 --- a/src/ts/MiscOptimism.ts +++ b/src/ts/MiscOptimism.ts @@ -26,4 +26,7 @@ export const wstETH_stETH_AGGREGATOR = '0xe59EBa0D492cA53C6f46015EEa00517F2707dc // https://optimistic.etherscan.io/address/0x22F3727be377781d1579B7C9222382b21c9d1a8f export const rETH_ETH_AGGREGATOR = '0x22F3727be377781d1579B7C9222382b21c9d1a8f'; +// https://optimistic.etherscan.io/address/0x7d9103572bE58FfE99dc390E8246f02dcAe6f611 +export const LEGACY_BRIDGE_EXECUTOR = '0x7d9103572bE58FfE99dc390E8246f02dcAe6f611'; + export const CHAIN_ID = 10; diff --git a/src/ts/MiscPolygon.ts b/src/ts/MiscPolygon.ts index 9e8456ff..6fbd43d7 100644 --- a/src/ts/MiscPolygon.ts +++ b/src/ts/MiscPolygon.ts @@ -32,4 +32,7 @@ export const MaticX_RATE_PROVIDER = '0xeE652bbF72689AA59F0B8F981c9c90e2A8Af8d8f' // https://polygonscan.com/address/0xdEd6C522d803E35f65318a9a4d7333a22d582199 export const stMATIC_RATE_PROVIDER = '0xdEd6C522d803E35f65318a9a4d7333a22d582199'; +// https://polygonscan.com/address/0xdc9A35B16DB4e126cFeDC41322b3a36454B1F772 +export const LEGACY_BRIDGE_EXECUTOR = '0xdc9A35B16DB4e126cFeDC41322b3a36454B1F772'; + export const CHAIN_ID = 137; diff --git a/ui/src/app/page.tsx b/ui/src/app/page.tsx index 523b012b..2ec5b84d 100644 --- a/ui/src/app/page.tsx +++ b/ui/src/app/page.tsx @@ -1,18 +1,13 @@ import { Suspense } from 'react'; -import * as addressBook from '../../../src/ts/AaveAddressBook'; +import { flattenedAddresses } from '../../../scripts/generator/getAddresses'; import { CHAIN_ID_CLIENT_MAP } from '@bgd-labs/js-utils'; import Image from 'next/image'; import { Search } from '@/components/Search'; import { SearchSkeleton } from '@/components/SearchSkeleton'; import { Footer } from '@/components/Footer'; -import { type SearchItem } from '@/types'; import logo from '@/assets/logo.svg'; -import { Address, isAddress } from 'viem'; import { SafeDownload } from '@/components/SafeDownload'; -const PRODUCTION_CHAIN_IDS = [ - 1, 8453, 42161, 43114, 250, 1666600000, 10, 137, 1088, 100, 56, 534352, -]; const VERSION_PRIORITY: { [key: string]: number } = { AaveV3: 1, AaveV2: 2, @@ -31,50 +26,22 @@ function getVersionPriority(name: string): number { const TAG_MAP: Record = { S_TOKEN: ['stable', 'debt'], V_TOKEN: ['variable', 'debt'], + STATA_TOKEN: ['stata', 'static'], }; -function flattenObject( - obj: any, - path: string[] = [], - chainId: number | null = null, -): SearchItem[] { - const result: SearchItem[] = []; - const entries = Object.entries(obj).sort(([keyA], [keyB]) => { - if (keyA === 'CHAIN_ID') return -1; - if (keyB === 'CHAIN_ID') return 1; - return 0; - }); +const addresses = flattenedAddresses.map((item) => ({ + ...item, + link: `${CHAIN_ID_CLIENT_MAP[item.chainId]?.chain?.blockExplorers?.default.url.replace(/\/$/, '')}/address/${item.value}`, + searchPath: [ + ...item.path, + item.value, + ...(TAG_MAP[item.path[item.path.length - 1]] ?? []), + ].join(' '), +})); - for (let [key, value] of entries) { - if (key === 'tokenlist') continue; - - const newPath = [...path, key]; - if (key === 'CHAIN_ID') { - chainId = value as number; - } - if (typeof value === 'object' && value !== null) { - result.push(...flattenObject(value, newPath, chainId)); - } else if (isAddress(value as string)) { - const link = `${CHAIN_ID_CLIENT_MAP[chainId!]?.chain?.blockExplorers?.default.url.replace(/\/$/, '')}/address/${value}`; - const key = newPath[newPath.length - 1]; - const searchPath = [...newPath, value]; - if (TAG_MAP[key]) searchPath.push(...TAG_MAP[key]); - result.push({ - path: newPath, - value: value as Address, - chainId, - link, - searchPath: searchPath.join(' '), - }); - } - } - return result; -} - -const addresses = flattenObject(addressBook); const sortedAddresses = addresses.sort((a, b) => { - const aInProduction = PRODUCTION_CHAIN_IDS.includes(a.chainId ?? 0); - const bInProduction = PRODUCTION_CHAIN_IDS.includes(b.chainId ?? 0); + const aInProduction = !CHAIN_ID_CLIENT_MAP[a.chainId].chain?.testnet; + const bInProduction = !CHAIN_ID_CLIENT_MAP[b.chainId].chain?.testnet; if (aInProduction && !bInProduction) { return -1;