From 17ad805c38ca4199efafa3c00c2e5b1b79565987 Mon Sep 17 00:00:00 2001 From: sakulstra Date: Tue, 16 Jan 2024 14:16:02 +0100 Subject: [PATCH] fix: update reports --- .../generatePayloadReport.spec.ts.snap | 80 +++++++++---------- src/govv3/checks/selfDestruct.ts | 18 +++-- src/govv3/checks/state.ts | 2 +- src/govv3/simulate.ts | 38 ++++----- 4 files changed, 66 insertions(+), 72 deletions(-) diff --git a/src/govv3/__snapshots__/generatePayloadReport.spec.ts.snap b/src/govv3/__snapshots__/generatePayloadReport.spec.ts.snap index 7d8dd8e..dc1b79a 100644 --- a/src/govv3/__snapshots__/generatePayloadReport.spec.ts.snap +++ b/src/govv3/__snapshots__/generatePayloadReport.spec.ts.snap @@ -15,7 +15,7 @@ exports[`generatePayloadReport > should match snapshot 1`] = ` #### Info -### InitializableImmutableAdminUpgradeabilityProxy (Aave USDT) at \`0x3Ed3B47Dd13EC9a98b44e6204A523E766B225811\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.USDT.A_TOKEN") +InitializableImmutableAdminUpgradeabilityProxy (Aave USDT) at \`0x3Ed3B47Dd13EC9a98b44e6204A523E766B225811\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.USDT.A_TOKEN") \`\`\`diff @@ Slot \`0x0000000000000000000000000000000000000000000000000000000000000036\` @@ - "0x00000000000000000000000000000000000000000000000000009767a805c73e" @@ -25,7 +25,7 @@ exports[`generatePayloadReport > should match snapshot 1`] = ` + "0x000000000000000000000000000000000000000000000000000001b8fad61505" \`\`\` -### Dai (Dai) at \`0x6B175474E89094C44Da98b954EedeAC495271d0F\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.DAI.UNDERLYING, AaveV2EthereumAMM.ASSETS.DAI.UNDERLYING, AaveV3Ethereum.ASSETS.DAI.UNDERLYING") +Dai (Dai) at \`0x6B175474E89094C44Da98b954EedeAC495271d0F\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.DAI.UNDERLYING, AaveV2EthereumAMM.ASSETS.DAI.UNDERLYING, AaveV3Ethereum.ASSETS.DAI.UNDERLYING") \`\`\`diff @@ \`balanceOf\` key \`0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c\` @@ - 502889065017878577338563 @@ -41,7 +41,7 @@ exports[`generatePayloadReport > should match snapshot 1`] = ` \`\`\` -### InitializableImmutableAdminUpgradeabilityProxy at \`0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.POOL") with implementation LendingPool at \`0x085E34722e04567Df9E6d2c32e82fd74f3342e79\` +InitializableImmutableAdminUpgradeabilityProxy at \`0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.POOL") with implementation LendingPool at \`0x085E34722e04567Df9E6d2c32e82fd74f3342e79\` \`\`\`diff @@ \`_reserves\` key \`0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\`.liquidityIndex @@ - 1125972900043692179606694722 @@ -83,7 +83,7 @@ exports[`generatePayloadReport > should match snapshot 1`] = ` \`\`\` -### InitializableImmutableAdminUpgradeabilityProxy at \`0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV3Ethereum.POOL") with implementation Pool at \`0x5FAab9E1adbddaD0a08734BE8a52185Fd6558E14\` +InitializableImmutableAdminUpgradeabilityProxy at \`0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV3Ethereum.POOL") with implementation Pool at \`0x5FAab9E1adbddaD0a08734BE8a52185Fd6558E14\` \`\`\`diff @@ Slot \`0xed960c71bd5fa1333658850f076b35ec5565086b606556c3dd36a916b43ddf21\` @@ - "0x000000000027c683ca3377fb1f1693f7000000000359f41baa6a46f058e50aee" @@ -99,7 +99,7 @@ exports[`generatePayloadReport > should match snapshot 1`] = ` + "0x000000000000000000000000000000000000000000000000000000099459516a" \`\`\` -### InitializableImmutableAdminUpgradeabilityProxy (Aave v3 USDC) at \`0x98C23E9d8f34FEFb1B7BD6a91B7FF122F4e16F5c\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV3Ethereum.ASSETS.USDC.A_TOKEN") with implementation AToken at \`0x7EfFD7b47Bfd17e52fB7559d3f924201b9DbfF3d\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV3Ethereum.DEFAULT_A_TOKEN_IMPL_REV_1") +InitializableImmutableAdminUpgradeabilityProxy (Aave v3 USDC) at \`0x98C23E9d8f34FEFb1B7BD6a91B7FF122F4e16F5c\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV3Ethereum.ASSETS.USDC.A_TOKEN") with implementation AToken at \`0x7EfFD7b47Bfd17e52fB7559d3f924201b9DbfF3d\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV3Ethereum.DEFAULT_A_TOKEN_IMPL_REV_1") \`\`\`diff @@ Slot \`0x0000000000000000000000000000000000000000000000000000000000000036\` @@ - "0x0000000000000000000000000000000000000000000000000002046ddd0d5441" @@ -109,21 +109,21 @@ exports[`generatePayloadReport > should match snapshot 1`] = ` + "0x000000000359f41db929cf9775960caa0000000000000000000002e2db896a2a" \`\`\` -### unknown contract name at \`0x9CE312c09AB6cA0cc4cb7d7CECA975729F1ffB6a\` +unknown contract name at \`0x9CE312c09AB6cA0cc4cb7d7CECA975729F1ffB6a\` \`\`\`diff @@ Slot \`0x0000000000000000000000000000000000000000000000000000000000000000\` @@ - "0x0000000000000000000000000000000000000000000000000000000000000000" + "0xd995ff6cf3e2498dd70cd06dd7b3f4c06840ba62f7b1ff3c20b766f1f572a8d2" \`\`\` -### unknown contract name at \`0x9d53CeFcd5fbeb850B053a23Ec6F59eb3Dc76E33\` +unknown contract name at \`0x9d53CeFcd5fbeb850B053a23Ec6F59eb3Dc76E33\` \`\`\`diff @@ Slot \`0x0000000000000000000000000000000000000000000000000000000000000000\` @@ - "0x0000000000000000000000000000000000000000000000000000000000000000" + "0x5277a0a374a2530b7c07818355e3f7fb438196e1c8b1353925e712542064af9e" \`\`\` -### FiatTokenProxy (USDC) at \`0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.USDC.UNDERLYING, AaveV2EthereumAMM.ASSETS.USDC.UNDERLYING, AaveV3Ethereum.ASSETS.USDC.UNDERLYING") with implementation FiatTokenV2_2 at \`0x43506849D7C04F9138D1A2050bbF3A0c054402dd\` +FiatTokenProxy (USDC) at \`0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.USDC.UNDERLYING, AaveV2EthereumAMM.ASSETS.USDC.UNDERLYING, AaveV3Ethereum.ASSETS.USDC.UNDERLYING") with implementation FiatTokenV2_2 at \`0x43506849D7C04F9138D1A2050bbF3A0c054402dd\` \`\`\`diff @@ Slot \`0x368c3f5f03e5634b3e4381c9c3caac98f4d254c7027fd14b53436c90d060fef4\` @@ - "0x000000000000000000000000000000000000000000000000000038207ce5ee96" @@ -142,7 +142,7 @@ exports[`generatePayloadReport > should match snapshot 1`] = ` + "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" \`\`\` -### InitializableImmutableAdminUpgradeabilityProxy (Aave v2 USDC) at \`0xBcca60bB61934080951369a648Fb03DF4F96263C\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.USDC.A_TOKEN") +InitializableImmutableAdminUpgradeabilityProxy (Aave v2 USDC) at \`0xBcca60bB61934080951369a648Fb03DF4F96263C\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.USDC.A_TOKEN") \`\`\`diff @@ Slot \`0x0000000000000000000000000000000000000000000000000000000000000036\` @@ - "0x0000000000000000000000000000000000000000000000000000f84a2f718226" @@ -152,7 +152,7 @@ exports[`generatePayloadReport > should match snapshot 1`] = ` + "0x0000000000000000000000000000000000000000000000000000000057637bec" \`\`\` -### InitializableImmutableAdminUpgradeabilityProxy at \`0xd784927Ff2f95ba542BfC824c8a8a98F3495f6b5\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.DEFAULT_INCENTIVES_CONTROLLER") +InitializableImmutableAdminUpgradeabilityProxy at \`0xd784927Ff2f95ba542BfC824c8a8a98F3495f6b5\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.DEFAULT_INCENTIVES_CONTROLLER") \`\`\`diff @@ \`assets\` key \`0x3ed3b47dd13ec9a98b44e6204a523e766b225811\`.lastUpdateTimestamp @@ - 1705398863 @@ -164,7 +164,7 @@ exports[`generatePayloadReport > should match snapshot 1`] = ` \`\`\` -### TransparentUpgradeableProxy at \`0xdAbad81aF85554E9ae636395611C58F7eC1aAEc5\`[:ghost:](https://github.com/bgd-labs/aave-address-book "GovernanceV3Ethereum.PAYLOADS_CONTROLLER") with implementation PayloadsController at \`0x7222182cB9c5320587b5148BF03eeE107AD64578\` +TransparentUpgradeableProxy at \`0xdAbad81aF85554E9ae636395611C58F7eC1aAEc5\`[:ghost:](https://github.com/bgd-labs/aave-address-book "GovernanceV3Ethereum.PAYLOADS_CONTROLLER") with implementation PayloadsController at \`0x7222182cB9c5320587b5148BF03eeE107AD64578\` \`\`\`diff @@ Slot \`0xa7d0f7195d52522be008ca0e9c182cb8d5cdec7c4327b16f8f80417732546566\` @@ - "0x0065a5097a0065a02ba302013765a685a401622c060e5d700d9ad89413363a91" @@ -174,7 +174,7 @@ exports[`generatePayloadReport > should match snapshot 1`] = ` + "0x000000000000000000093a8000000151800065ce502300000000000065a65bdf" \`\`\` -### TetherToken (Tether) at \`0xdAC17F958D2ee523a2206206994597C13D831ec7\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.USDT.UNDERLYING, AaveV2EthereumAMM.ASSETS.USDT.UNDERLYING, AaveV3Ethereum.ASSETS.USDT.UNDERLYING") +TetherToken (Tether) at \`0xdAC17F958D2ee523a2206206994597C13D831ec7\`[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.USDT.UNDERLYING, AaveV2EthereumAMM.ASSETS.USDT.UNDERLYING, AaveV3Ethereum.ASSETS.USDT.UNDERLYING") \`\`\`diff @@ \`balances\` key \`0x3ed3b47dd13ec9a98b44e6204a523e766b225811\` @@ - 37673056276055 @@ -319,29 +319,29 @@ exports[`generatePayloadReport > should match snapshot 1`] = ` #### Warnings - [0xd73a92be73efbfcf3854433a5fcbabf9c1316073](https://etherscan.io/address/0xd73a92be73efbfcf3854433a5fcbabf9c1316073): EOA (may have code later) -- [0xdabad81af85554e9ae636395611c58f7ec1aaec5](https://etherscan.io/address/0xdabad81af85554e9ae636395611c58f7ec1aaec5): Contract (with DELEGATECALL) -- [0x5300a1a15135ea4dc7ad5a167152c01efc9b192a](https://etherscan.io/address/0x5300a1a15135ea4dc7ad5a167152c01efc9b192a): Contract (with DELEGATECALL) -- [0xbcca60bb61934080951369a648fb03df4f96263c](https://etherscan.io/address/0xbcca60bb61934080951369a648fb03df4f96263c): Contract (with DELEGATECALL) -- [0x7d2768de32b0b80b7a3454c06bdac94a69ddc7a9](https://etherscan.io/address/0x7d2768de32b0b80b7a3454c06bdac94a69ddc7a9): Contract (with DELEGATECALL) +- [0xdabad81af85554e9ae636395611c58f7ec1aaec5](https://etherscan.io/address/0xdabad81af85554e9ae636395611c58f7ec1aaec5): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "GovernanceV3Ethereum.PAYLOADS_CONTROLLER") +- [0x5300a1a15135ea4dc7ad5a167152c01efc9b192a](https://etherscan.io/address/0x5300a1a15135ea4dc7ad5a167152c01efc9b192a): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.POOL_ADMIN, AaveV2EthereumAMM.POOL_ADMIN, AaveV3Ethereum.ACL_ADMIN, GovernanceV3Ethereum.EXECUTOR_LVL_1") +- [0xbcca60bb61934080951369a648fb03df4f96263c](https://etherscan.io/address/0xbcca60bb61934080951369a648fb03df4f96263c): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.USDC.A_TOKEN") +- [0x7d2768de32b0b80b7a3454c06bdac94a69ddc7a9](https://etherscan.io/address/0x7d2768de32b0b80b7a3454c06bdac94a69ddc7a9): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.POOL") - [0x085e34722e04567df9e6d2c32e82fd74f3342e79](https://etherscan.io/address/0x085e34722e04567df9e6d2c32e82fd74f3342e79): Contract (with DELEGATECALL) -- [0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c](https://etherscan.io/address/0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c): Contract (with DELEGATECALL) -- [0xd784927ff2f95ba542bfc824c8a8a98f3495f6b5](https://etherscan.io/address/0xd784927ff2f95ba542bfc824c8a8a98f3495f6b5): Contract (with DELEGATECALL) -- [0xb53c1a33016b2dc2ff3653530bff1848a515c8c5](https://etherscan.io/address/0xb53c1a33016b2dc2ff3653530bff1848a515c8c5): Contract (with DELEGATECALL) +- [0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c](https://etherscan.io/address/0x464c71f6c2f760dda6093dcb91c24c39e5d6e18c): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.COLLECTOR, AaveV2EthereumAMM.COLLECTOR, AaveV2EthereumArc.COLLECTOR, AaveV3Ethereum.COLLECTOR") +- [0xd784927ff2f95ba542bfc824c8a8a98f3495f6b5](https://etherscan.io/address/0xd784927ff2f95ba542bfc824c8a8a98f3495f6b5): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.DEFAULT_INCENTIVES_CONTROLLER") +- [0xb53c1a33016b2dc2ff3653530bff1848a515c8c5](https://etherscan.io/address/0xb53c1a33016b2dc2ff3653530bff1848a515c8c5): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.POOL_ADDRESSES_PROVIDER") - [0xf5543cdd5f551635e13ebe07e47d01d0fc9cbbd5](https://etherscan.io/address/0xf5543cdd5f551635e13ebe07e47d01d0fc9cbbd5): Contract (with DELEGATECALL) -- [0x619beb58998ed2278e08620f97007e1116d5d25b](https://etherscan.io/address/0x619beb58998ed2278e08620f97007e1116d5d25b): Contract (with DELEGATECALL) -- [0xe4922afab0bbadd8ab2a88e0c79d884ad337fca6](https://etherscan.io/address/0xe4922afab0bbadd8ab2a88e0c79d884ad337fca6): Contract (with DELEGATECALL) -- [0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48](https://etherscan.io/address/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48): Contract (with DELEGATECALL) +- [0x619beb58998ed2278e08620f97007e1116d5d25b](https://etherscan.io/address/0x619beb58998ed2278e08620f97007e1116d5d25b): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.USDC.V_TOKEN") +- [0xe4922afab0bbadd8ab2a88e0c79d884ad337fca6](https://etherscan.io/address/0xe4922afab0bbadd8ab2a88e0c79d884ad337fca6): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.USDC.S_TOKEN") +- [0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48](https://etherscan.io/address/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.USDC.UNDERLYING, AaveV2EthereumAMM.ASSETS.USDC.UNDERLYING, AaveV3Ethereum.ASSETS.USDC.UNDERLYING") - [0x43506849d7c04f9138d1a2050bbf3a0c054402dd](https://etherscan.io/address/0x43506849d7c04f9138d1a2050bbf3a0c054402dd): Contract (with DELEGATECALL) -- [0x87870bca3f3fd6335c3f4ce8392d69350b4fa4e2](https://etherscan.io/address/0x87870bca3f3fd6335c3f4ce8392d69350b4fa4e2): Contract (with DELEGATECALL) +- [0x87870bca3f3fd6335c3f4ce8392d69350b4fa4e2](https://etherscan.io/address/0x87870bca3f3fd6335c3f4ce8392d69350b4fa4e2): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV3Ethereum.POOL") - [0x5faab9e1adbddad0a08734be8a52185fd6558e14](https://etherscan.io/address/0x5faab9e1adbddad0a08734be8a52185fd6558e14): Contract (with DELEGATECALL) -- [0x72e95b8931767c79ba4eee721354d6e99a61d004](https://etherscan.io/address/0x72e95b8931767c79ba4eee721354d6e99a61d004): Contract (with DELEGATECALL) -- [0xb0fe3d292f4bd50de902ba5bdf120ad66e9d7a39](https://etherscan.io/address/0xb0fe3d292f4bd50de902ba5bdf120ad66e9d7a39): Contract (with DELEGATECALL) -- [0x98c23e9d8f34fefb1b7bd6a91b7ff122f4e16f5c](https://etherscan.io/address/0x98c23e9d8f34fefb1b7bd6a91b7ff122f4e16f5c): Contract (with DELEGATECALL) -- [0x8164cc65827dcfe994ab23944cbc90e0aa80bfcb](https://etherscan.io/address/0x8164cc65827dcfe994ab23944cbc90e0aa80bfcb): Contract (with DELEGATECALL) -- [0x531842cebbdd378f8ee36d171d6cc9c4fcf475ec](https://etherscan.io/address/0x531842cebbdd378f8ee36d171d6cc9c4fcf475ec): Contract (with DELEGATECALL) -- [0xe91d55ab2240594855abd11b3faae801fd4c4687](https://etherscan.io/address/0xe91d55ab2240594855abd11b3faae801fd4c4687): Contract (with DELEGATECALL) -- [0x3ed3b47dd13ec9a98b44e6204a523e766b225811](https://etherscan.io/address/0x3ed3b47dd13ec9a98b44e6204a523e766b225811): Contract (with DELEGATECALL) -- [0x3ea64b1c0194524b48f9118462c8e9cd61a243c7](https://etherscan.io/address/0x3ea64b1c0194524b48f9118462c8e9cd61a243c7): Contract (with DELEGATECALL) +- [0x72e95b8931767c79ba4eee721354d6e99a61d004](https://etherscan.io/address/0x72e95b8931767c79ba4eee721354d6e99a61d004): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV3Ethereum.ASSETS.USDC.V_TOKEN") +- [0xb0fe3d292f4bd50de902ba5bdf120ad66e9d7a39](https://etherscan.io/address/0xb0fe3d292f4bd50de902ba5bdf120ad66e9d7a39): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV3Ethereum.ASSETS.USDC.S_TOKEN") +- [0x98c23e9d8f34fefb1b7bd6a91b7ff122f4e16f5c](https://etherscan.io/address/0x98c23e9d8f34fefb1b7bd6a91b7ff122f4e16f5c): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV3Ethereum.ASSETS.USDC.A_TOKEN") +- [0x8164cc65827dcfe994ab23944cbc90e0aa80bfcb](https://etherscan.io/address/0x8164cc65827dcfe994ab23944cbc90e0aa80bfcb): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV3Ethereum.DEFAULT_INCENTIVES_CONTROLLER") +- [0x531842cebbdd378f8ee36d171d6cc9c4fcf475ec](https://etherscan.io/address/0x531842cebbdd378f8ee36d171d6cc9c4fcf475ec): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.USDT.V_TOKEN") +- [0xe91d55ab2240594855abd11b3faae801fd4c4687](https://etherscan.io/address/0xe91d55ab2240594855abd11b3faae801fd4c4687): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.USDT.S_TOKEN") +- [0x3ed3b47dd13ec9a98b44e6204a523e766b225811](https://etherscan.io/address/0x3ed3b47dd13ec9a98b44e6204a523e766b225811): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.USDT.A_TOKEN") +- [0x3ea64b1c0194524b48f9118462c8e9cd61a243c7](https://etherscan.io/address/0x3ea64b1c0194524b48f9118462c8e9cd61a243c7): Contract (with DELEGATECALL)[:ghost:](https://github.com/bgd-labs/aave-address-book "MiscEthereum.AAVE_SWAPPER") - [0x9ce312c09ab6ca0cc4cb7d7ceca975729f1ffb6a](https://etherscan.io/address/0x9ce312c09ab6ca0cc4cb7d7ceca975729f1ffb6a): EOA (may have code later) - [0x9d53cefcd5fbeb850b053a23ec6f59eb3dc76e33](https://etherscan.io/address/0x9d53cefcd5fbeb850b053a23ec6f59eb3dc76e33): EOA (may have code later) @@ -355,20 +355,20 @@ exports[`generatePayloadReport > should match snapshot 1`] = ` - [0xeae736e5d6560169f9285c62492f8a89fb4ab790](https://etherscan.io/address/0xeae736e5d6560169f9285c62492f8a89fb4ab790): Contract (looks safe) - [0x1f57cc62113c3a6346882dcf3ed49120411ac2d2](https://etherscan.io/address/0x1f57cc62113c3a6346882dcf3ed49120411ac2d2): Contract (looks safe) - [0x8dff7fda82976452b6fb957f549944e7af7a3e6f](https://etherscan.io/address/0x8dff7fda82976452b6fb957f549944e7af7a3e6f): Contract (looks safe) -- [0xb72f23ade9b9980c2e731ca504105fc860643619](https://etherscan.io/address/0xb72f23ade9b9980c2e731ca504105fc860643619): Contract (looks safe) -- [0x8a32f49ffba88aba6eff96f45d8bd1d4b3f35c7d](https://etherscan.io/address/0x8a32f49ffba88aba6eff96f45d8bd1d4b3f35c7d): Contract (looks safe) -- [0x6b175474e89094c44da98b954eedeac495271d0f](https://etherscan.io/address/0x6b175474e89094c44da98b954eedeac495271d0f): Contract (looks safe) -- [0xdac17f958d2ee523a2206206994597c13d831ec7](https://etherscan.io/address/0xdac17f958d2ee523a2206206994597c13d831ec7): Contract (looks safe) +- [0xb72f23ade9b9980c2e731ca504105fc860643619](https://etherscan.io/address/0xb72f23ade9b9980c2e731ca504105fc860643619): Contract (looks safe)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.USDC.INTEREST_RATE_STRATEGY") +- [0x8a32f49ffba88aba6eff96f45d8bd1d4b3f35c7d](https://etherscan.io/address/0x8a32f49ffba88aba6eff96f45d8bd1d4b3f35c7d): Contract (looks safe)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.LENDING_RATE_ORACLE, AaveV2EthereumAMM.LENDING_RATE_ORACLE") +- [0x6b175474e89094c44da98b954eedeac495271d0f](https://etherscan.io/address/0x6b175474e89094c44da98b954eedeac495271d0f): Contract (looks safe)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.DAI.UNDERLYING, AaveV2EthereumAMM.ASSETS.DAI.UNDERLYING, AaveV3Ethereum.ASSETS.DAI.UNDERLYING") +- [0xdac17f958d2ee523a2206206994597c13d831ec7](https://etherscan.io/address/0xdac17f958d2ee523a2206206994597c13d831ec7): Contract (looks safe)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.USDT.UNDERLYING, AaveV2EthereumAMM.ASSETS.USDT.UNDERLYING, AaveV3Ethereum.ASSETS.USDT.UNDERLYING") - [0x589f82ff8162fa96545b435435713e9d6ca79fbb](https://etherscan.io/address/0x589f82ff8162fa96545b435435713e9d6ca79fbb): Contract (looks safe) -- [0xac725cb59d16c81061bdea61041a8a5e73da9ec6](https://etherscan.io/address/0xac725cb59d16c81061bdea61041a8a5e73da9ec6): Contract (looks safe) -- [0x15c5620dffac7c7366eed66c20ad222ddbb1ed57](https://etherscan.io/address/0x15c5620dffac7c7366eed66c20ad222ddbb1ed57): Contract (looks safe) -- [0x7effd7b47bfd17e52fb7559d3f924201b9dbff3d](https://etherscan.io/address/0x7effd7b47bfd17e52fb7559d3f924201b9dbff3d): Contract (looks safe) -- [0x642a8dacc59b73491dcaa3bcef046d660901fcc1](https://etherscan.io/address/0x642a8dacc59b73491dcaa3bcef046d660901fcc1): Contract (looks safe) +- [0xac725cb59d16c81061bdea61041a8a5e73da9ec6](https://etherscan.io/address/0xac725cb59d16c81061bdea61041a8a5e73da9ec6): Contract (looks safe)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV3Ethereum.DEFAULT_VARIABLE_DEBT_TOKEN_IMPL_REV_1") +- [0x15c5620dffac7c7366eed66c20ad222ddbb1ed57](https://etherscan.io/address/0x15c5620dffac7c7366eed66c20ad222ddbb1ed57): Contract (looks safe)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV3Ethereum.DEFAULT_STABLE_DEBT_TOKEN_IMPL_REV_1") +- [0x7effd7b47bfd17e52fb7559d3f924201b9dbff3d](https://etherscan.io/address/0x7effd7b47bfd17e52fb7559d3f924201b9dbff3d): Contract (looks safe)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV3Ethereum.DEFAULT_A_TOKEN_IMPL_REV_1") +- [0x642a8dacc59b73491dcaa3bcef046d660901fcc1](https://etherscan.io/address/0x642a8dacc59b73491dcaa3bcef046d660901fcc1): Contract (looks safe)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV3Ethereum.ASSETS.USDC.INTEREST_RATE_STRATEGY") - [0xe7b67f44ea304dd7f6d215b13686637ff64cd2b2](https://etherscan.io/address/0xe7b67f44ea304dd7f6d215b13686637ff64cd2b2): Contract (looks safe) - [0x99e81edbcab512d393638c087fd29c3dc6c9b00e](https://etherscan.io/address/0x99e81edbcab512d393638c087fd29c3dc6c9b00e): Contract (looks safe) - [0xc61262d6ad449ac09b4087f46391dd9a26b5888b](https://etherscan.io/address/0xc61262d6ad449ac09b4087f46391dd9a26b5888b): Contract (looks safe) - [0x9651f64bd77550691eb2aeeb58188cb67f005902](https://etherscan.io/address/0x9651f64bd77550691eb2aeeb58188cb67f005902): Contract (looks safe) -- [0xf02ec9ca513ca505f0f5347e7d784fa6165f8a99](https://etherscan.io/address/0xf02ec9ca513ca505f0f5347e7d784fa6165f8a99): Contract (looks safe) +- [0xf02ec9ca513ca505f0f5347e7d784fa6165f8a99](https://etherscan.io/address/0xf02ec9ca513ca505f0f5347e7d784fa6165f8a99): Contract (looks safe)[:ghost:](https://github.com/bgd-labs/aave-address-book "AaveV2Ethereum.ASSETS.USDT.INTEREST_RATE_STRATEGY") - [0x0bbdb9a4657912d7a4b198310397ef178dba0893](https://etherscan.io/address/0x0bbdb9a4657912d7a4b198310397ef178dba0893): Contract (looks safe) - [0x11c76ad590abdffcd980afec9ad951b160f02797](https://etherscan.io/address/0x11c76ad590abdffcd980afec9ad951b160f02797): Contract (looks safe) diff --git a/src/govv3/checks/selfDestruct.ts b/src/govv3/checks/selfDestruct.ts index 896d26b..d72c3f7 100644 --- a/src/govv3/checks/selfDestruct.ts +++ b/src/govv3/checks/selfDestruct.ts @@ -2,8 +2,9 @@ // adjusted for viem & aave governance v3 import { Hex, PublicClient } from 'viem'; import { ProposalCheck } from './types'; -import { toAddressLink } from '../utils/markdownUtils'; +import { flagKnownAddress, toAddressLink } from '../utils/markdownUtils'; import { PayloadsController } from '../payloadsController'; +import { isKnownAddress } from '../utils/checkAddress'; /** * Check all targets with code if they contain selfdestruct. @@ -42,13 +43,16 @@ async function checkNoSelfdestructs( const error: string[] = []; for (const addr of addresses) { const status = await checkNoSelfdestruct(trustedAddrs, addr, provider); + const isAddrKnown = isKnownAddress(addr, provider.chain!.id); const address = toAddressLink(addr, true, provider); - if (status === 'eoa') info.push(`- ${address}: EOA`); - else if (status === 'empty') warn.push(`- ${address}: EOA (may have code later)`); - else if (status === 'safe') info.push(`- ${address}: Contract (looks safe)`); - else if (status === 'delegatecall') warn.push(`- ${address}: Contract (with DELEGATECALL)`); - else if (status === 'trusted') info.push(`- ${address}: Trusted contract (not checked)`); - else error.push(`- ${address}: Contract (with SELFDESTRUCT)`); + if (status === 'eoa') info.push(`- ${address}: EOA${flagKnownAddress(isAddrKnown)}`); + else if (status === 'empty') warn.push(`- ${address}: EOA (may have code later)${flagKnownAddress(isAddrKnown)}`); + else if (status === 'safe') info.push(`- ${address}: Contract (looks safe)${flagKnownAddress(isAddrKnown)}`); + else if (status === 'delegatecall') + warn.push(`- ${address}: Contract (with DELEGATECALL)${flagKnownAddress(isAddrKnown)}`); + else if (status === 'trusted') + info.push(`- ${address}: Trusted contract (not checked)${flagKnownAddress(isAddrKnown)}`); + else error.push(`- ${address}: Contract (with SELFDESTRUCT)${flagKnownAddress(isAddrKnown)}`); } return { info, warn, error }; } diff --git a/src/govv3/checks/state.ts b/src/govv3/checks/state.ts index 341b93b..c54fe4b 100644 --- a/src/govv3/checks/state.ts +++ b/src/govv3/checks/state.ts @@ -36,7 +36,7 @@ export const checkStateChanges: ProposalCheck = { // Parse state changes at each address for (const [address, diffs] of Object.entries(stateDiffs)) { // Use contracts array to get contract name of address - stateChanges += `\n### ${getContractName( + stateChanges += `\n${getContractName( simulation.contracts, address as Address, publicClient.chain!.id diff --git a/src/govv3/simulate.ts b/src/govv3/simulate.ts index e3b3e59..874b5fc 100644 --- a/src/govv3/simulate.ts +++ b/src/govv3/simulate.ts @@ -20,14 +20,14 @@ export async function simulateProposal(governanceAddress: Hex, publicClient: Pub const logs = await governance.cacheLogs(); const proposal = await governance.getProposalAndLogs(proposalId, logs); const result = await governance.simulateProposalExecutionOnTenderly(proposalId, proposal); - // console.log( - // await generateProposalReport({ - // simulation: result, - // proposalId: proposalId, - // proposalInfo: proposal, - // publicClient: publicClient, - // }) - // ); + console.log( + await generateProposalReport({ + simulation: result, + proposalId: proposalId, + proposalInfo: proposal, + publicClient: publicClient, + }) + ); const payloads: { payload: Awaited>; simulation: TenderlySimulationResponse; @@ -42,23 +42,13 @@ export async function simulateProposal(governanceAddress: Hex, publicClient: Pub try { const result = await controllerContract.simulatePayloadExecutionOnTenderly(payload.payloadId, config); console.log( - JSON.stringify( - { - simulation: result, - payloadId: payload.payloadId, - payloadInfo: config, - }, - (key, value) => (typeof value === 'bigint' ? value.toString() : value) - ) + await generateReport({ + simulation: result, + payloadId: payload.payloadId, + payloadInfo: config, + publicClient: CHAIN_ID_CLIENT_MAP[Number(payload.chain) as keyof typeof CHAIN_ID_CLIENT_MAP], + }) ); - // console.log( - // await generateReport({ - // simulation: result, - // payloadId: payload.payloadId, - // payloadInfo: config, - // publicClient: CHAIN_ID_CLIENT_MAP[Number(payload.chain) as keyof typeof CHAIN_ID_CLIENT_MAP], - // }) - // ); payloads.push({ payload: config, simulation: result }); } catch (e) { console.log('error simulating payload');