Skip to content

Commit

Permalink
fix: chaos renew correct asset (#492)
Browse files Browse the repository at this point in the history
* fix: correct asset

* fix: commit hash
  • Loading branch information
ianflexa authored Oct 17, 2024
1 parent 303ac43 commit 17f32f0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ contract AaveV3Ethereum_ChaosLabsAaveRiskManagementServiceRenewal_20241012 is
CollectorUtils.stream(
AaveV3Ethereum.COLLECTOR,
CollectorUtils.CreateStreamInput({
underlying: AaveV3EthereumAssets.USDC_A_TOKEN,
underlying: AaveV3EthereumAssets.USDT_A_TOKEN,
receiver: CHAOS_LABS_RECEIVER,
amount: 1_000_000 * 10 ** IERC20Metadata(AaveV3EthereumAssets.USDC_A_TOKEN).decimals(),
amount: 1_000_000 * 10 ** IERC20Metadata(AaveV3EthereumAssets.USDT_A_TOKEN).decimals(),
start: 1731405180,
duration: 365 days
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@ contract AaveV3Ethereum_ChaosLabsAaveRiskManagementServiceRenewal_20241012_Test
proposal = new AaveV3Ethereum_ChaosLabsAaveRiskManagementServiceRenewal_20241012();
}

/**
* @dev executes the generic test suite including e2e and config snapshots
*/
function test_defaultProposalExecution() public {
address receiverAddress = proposal.CHAOS_LABS_RECEIVER();
uint256 ghoBalanceBefore = IERC20(AaveV3EthereumAssets.GHO_UNDERLYING).balanceOf(
receiverAddress
);
uint256 aUsdcBalanceBefore = IERC20(AaveV3EthereumAssets.USDC_A_TOKEN).balanceOf(
uint256 aUsdtBalanceBefore = IERC20(AaveV3EthereumAssets.USDT_A_TOKEN).balanceOf(
receiverAddress
);

Expand All @@ -52,8 +49,8 @@ contract AaveV3Ethereum_ChaosLabsAaveRiskManagementServiceRenewal_20241012_Test

AaveV3Ethereum.COLLECTOR.withdrawFromStream(nextStreamId + 1, 1);
assertEq(
IERC20(AaveV3EthereumAssets.USDC_A_TOKEN).balanceOf(receiverAddress),
aUsdcBalanceBefore + 1
IERC20(AaveV3EthereumAssets.USDT_A_TOKEN).balanceOf(receiverAddress),
aUsdtBalanceBefore + 1
);

vm.warp(block.timestamp + 400 days); // November 13 2025 is in a long time
Expand All @@ -75,11 +72,11 @@ contract AaveV3Ethereum_ChaosLabsAaveRiskManagementServiceRenewal_20241012_Test
AaveV3Ethereum.COLLECTOR.balanceOf(nextStreamId + 1, receiverAddress)
);
assertApproxEqAbs(
IERC20(AaveV3EthereumAssets.USDC_A_TOKEN).balanceOf(receiverAddress),
aUsdcBalanceBefore +
IERC20(AaveV3EthereumAssets.USDT_A_TOKEN).balanceOf(receiverAddress),
aUsdtBalanceBefore +
1_000_000 *
10 ** IERC20Metadata(AaveV3EthereumAssets.USDC_A_TOKEN).decimals(),
25 * 10 ** IERC20Metadata(AaveV3EthereumAssets.USDC_A_TOKEN).decimals() //due to rounding and low decimals error is of ~25 $
10 ** IERC20Metadata(AaveV3EthereumAssets.USDT_A_TOKEN).decimals(),
25 * 10 ** IERC20Metadata(AaveV3EthereumAssets.USDT_A_TOKEN).decimals() //due to rounding and low decimals error is of ~25 $
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ Regarding technical implementation, the AIP will call the `createStream()` metho

## References

- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/1a4ae0ce293c667c62786d69813688813e9801fc/src/20241012_AaveV3Ethereum_ChaosLabsAaveRiskManagementServiceRenewal/AaveV3Ethereum_ChaosLabsAaveRiskManagementServiceRenewal_20241012.sol)
- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/1a4ae0ce293c667c62786d69813688813e9801fc/src/20241012_AaveV3Ethereum_ChaosLabsAaveRiskManagementServiceRenewal/AaveV3Ethereum_ChaosLabsAaveRiskManagementServiceRenewal_20241012.t.sol)
- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241012_AaveV3Ethereum_ChaosLabsAaveRiskManagementServiceRenewal/AaveV3Ethereum_ChaosLabsAaveRiskManagementServiceRenewal_20241012.sol)
- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241012_AaveV3Ethereum_ChaosLabsAaveRiskManagementServiceRenewal/AaveV3Ethereum_ChaosLabsAaveRiskManagementServiceRenewal_20241012.t.sol)
- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0xa8ec5cf2568691144861b38af1b2cef4f95d33d0912fea28438132cabf4b6c28)
- [Discussion](https://governance.aave.com/t/arfc-chaos-labs-aave-risk-management-service-renewal/19306)

Expand Down

1 comment on commit 17f32f0

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Foundry report

forge 0.2.0 (adb6aba 2024-10-17T00:21:47.342666875Z)
Build log
Compiling 229 files with Solc 0.8.20
Solc 0.8.20 finished in 79.02s
Compiler run successful with warnings:
Warning (5667): Unused function parameter. Remove or comment out the variable name to silence this warning.
   --> lib/aave-helpers/src/swaps/AaveSwapper.sol:146:5:
    |
146 |     address erc20Token
    |     ^^^^^^^^^^^^^^^^^^

Warning (2018): Function state mutability can be restricted to pure
   --> lib/aave-helpers/src/swaps/AaveSwapper.sol:145:3:
    |
145 |   function maxRescue(
    |   ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to pure
   --> lib/aave-helpers/src/ProtocolV2TestBase.sol:663:3:
    |
663 |   function _logReserveConfig(ReserveConfig memory config) internal view {
    |   ^ (Relevant source part starts here and spans across multiple lines).

| Contract                                                            | Size (B) | Margin (B) |
|---------------------------------------------------------------------|----------|------------|
| AaveGovernanceV2                                                    |       44 |     24,532 |
| AaveSwapper                                                         |    5,555 |     19,021 |
| AaveV2Avalanche                                                     |       44 |     24,532 |
| AaveV2AvalancheAssets                                               |       44 |     24,532 |
| AaveV2Avalanche_ReserveFactorUpdatesMidOctober_20241004             |      988 |     23,588 |
| AaveV2Avalanche_UpdateLegacyGuardian_20241016                       |      348 |     24,228 |
| AaveV2Ethereum                                                      |       44 |     24,532 |
| AaveV2EthereumAMM                                                   |       44 |     24,532 |
| AaveV2EthereumAMMAssets                                             |       44 |     24,532 |
| AaveV2EthereumAMM_UpdateLegacyGuardian_20241016                     |      348 |     24,228 |
| AaveV2EthereumAssets                                                |       44 |     24,532 |
| AaveV2Ethereum_ReserveFactorUpdatesMidOctober_20241004              |      988 |     23,588 |
| AaveV2Ethereum_UpdateLegacyGuardian_20241016                        |      348 |     24,228 |
| AaveV2Polygon                                                       |       44 |     24,532 |
| AaveV2PolygonAssets                                                 |       44 |     24,532 |
| AaveV2Polygon_ReserveFactorUpdatesMidOctober_20241004               |    2,384 |     22,192 |
| AaveV2Polygon_UpdateLegacyGuardian_20241016                         |      348 |     24,228 |
| AaveV3Arbitrum                                                      |       44 |     24,532 |
| AaveV3ArbitrumAssets                                                |       44 |     24,532 |
| AaveV3ArbitrumEModes                                                |       44 |     24,532 |
| AaveV3ArbitrumExternalLibraries                                     |       44 |     24,532 |
| AaveV3Arbitrum_ReserveFactorUpdatesMidOctober_20241004              |    3,227 |     21,349 |
| AaveV3Arbitrum_UpdateLegacyGuardian_20241016                        |    1,062 |     23,514 |
| AaveV3Avalanche                                                     |       44 |     24,532 |
| AaveV3AvalancheAssets                                               |       44 |     24,532 |
| AaveV3AvalancheEModes                                               |       44 |     24,532 |
| AaveV3AvalancheExternalLibraries                                    |       44 |     24,532 |
| AaveV3Avalanche_UpdateLegacyGuardian_20241016                       |    1,062 |     23,514 |
| AaveV3BNB                                                           |       44 |     24,532 |
| AaveV3BNBAssets                                                     |       44 |     24,532 |
| AaveV3BNBEModes                                                     |       44 |     24,532 |
| AaveV3BNBExternalLibraries                                          |       44 |     24,532 |
| AaveV3BNB_UpdateLegacyGuardian_20241016                             |    1,062 |     23,514 |
| AaveV3Base                                                          |       44 |     24,532 |
| AaveV3BaseAssets                                                    |       44 |     24,532 |
| AaveV3BaseEModes                                                    |       44 |     24,532 |
| AaveV3BaseExternalLibraries                                         |       44 |     24,532 |
| AaveV3Base_IncreaseCbBTCSupplyCaps_20241004                         |    3,146 |     21,430 |
| AaveV3Base_ReserveFactorUpdatesMidOctober_20241004                  |    3,223 |     21,353 |
| AaveV3Base_UpdateLegacyGuardian_20241016                            |    1,062 |     23,514 |
| AaveV3Ethereum                                                      |       44 |     24,532 |
| AaveV3EthereumAssets                                                |       44 |     24,532 |
| AaveV3EthereumEModes                                                |       44 |     24,532 |
| AaveV3EthereumExternalLibraries                                     |       44 |     24,532 |
| AaveV3EthereumLido                                                  |       44 |     24,532 |
| AaveV3EthereumLidoAssets                                            |       44 |     24,532 |
| AaveV3EthereumLidoEModes                                            |       44 |     24,532 |
| AaveV3EthereumLidoExternalLibraries                                 |       44 |     24,532 |
| AaveV3EthereumLido_WstETHSlope1UoptimalUpdate_20241001              |    3,250 |     21,326 |
| AaveV3Ethereum_ChaosLabsAaveRiskManagementServiceRenewal_20241012   |    1,255 |     23,321 |
| AaveV3Ethereum_IncreaseCbBTCSupplyCaps_20241004                     |    3,150 |     21,426 |
| AaveV3Ethereum_IncreaseUSDSBorrowRateToMatchSkySavingsRate_20241016 |    3,239 |     21,337 |
| AaveV3Ethereum_RenewLlamaRiskAsRiskServiceProvider_20241013         |    1,068 |     23,508 |
| AaveV3Ethereum_UpdateLegacyGuardian_20241016                        |    1,062 |     23,514 |
| AaveV3Gnosis                                                        |       44 |     24,532 |
| AaveV3GnosisAssets                                                  |       44 |     24,532 |
| AaveV3GnosisEModes                                                  |       44 |     24,532 |
| AaveV3GnosisExternalLibraries                                       |       44 |     24,532 |
| AaveV3Gnosis_ReserveFactorUpdatesMidOctober_20241004                |    3,225 |     21,351 |
| AaveV3Gnosis_UpdateLegacyGuardian_20241016                          |    1,062 |     23,514 |
| AaveV3Metis                                                         |       44 |     24,532 |
| AaveV3MetisAssets                                                   |       44 |     24,532 |
| AaveV3MetisEModes                                                   |       44 |     24,532 |
| AaveV3MetisExternalLibraries                                        |       44 |     24,532 |
| AaveV3Metis_UpdateLegacyGuardian_20241016                           |    1,062 |     23,514 |
| AaveV3Optimism                                                      |       44 |     24,532 |
| AaveV3OptimismAssets                                                |       44 |     24,532 |
| AaveV3OptimismEModes                                                |       44 |     24,532 |
| AaveV3OptimismExternalLibraries                                     |       44 |     24,532 |
| AaveV3Optimism_ReserveFactorUpdatesMidOctober_20241004              |    3,227 |     21,349 |
| AaveV3Optimism_UpdateLegacyGuardian_20241016                        |    1,062 |     23,514 |
| AaveV3Polygon                                                       |       44 |     24,532 |
| AaveV3PolygonAssets                                                 |       44 |     24,532 |
| AaveV3PolygonEModes                                                 |       44 |     24,532 |
| AaveV3PolygonExternalLibraries                                      |       44 |     24,532 |
| AaveV3Polygon_ReserveFactorUpdatesMidOctober_20241004               |    3,226 |     21,350 |
| AaveV3Polygon_UpdateLegacyGuardian_20241016                         |    1,062 |     23,514 |
| AaveV3Scroll                                                        |       44 |     24,532 |
| AaveV3ScrollAssets                                                  |       44 |     24,532 |
| AaveV3ScrollEModes                                                  |       44 |     24,532 |
| AaveV3ScrollExternalLibraries                                       |       44 |     24,532 |
| AaveV3Scroll_UpdateLegacyGuardian_20241016                          |    1,062 |     23,514 |
| Address                                                             |       44 |     24,532 |
| ChainHelpers                                                        |       44 |     24,532 |
| ChainIds                                                            |       44 |     24,532 |
| CollectorUtils                                                      |       44 |     24,532 |
| ConfiguratorInputTypes                                              |       44 |     24,532 |
| Create2Utils                                                        |      121 |     24,455 |
| Create2UtilsZkSync                                                  |      104 |     24,472 |
| DataTypes                                                           |       44 |     24,532 |
| EngineFlags                                                         |       44 |     24,532 |
| Errors                                                              |    4,652 |     19,924 |
| GovV3Helpers                                                        |    2,517 |     22,059 |
| GovV3StorageHelpers                                                 |       44 |     24,532 |
| GovernanceGuardians                                                 |      292 |     24,284 |
| GovernanceV3Arbitrum                                                |       44 |     24,532 |
| GovernanceV3Avalanche                                               |       44 |     24,532 |
| GovernanceV3BNB                                                     |       44 |     24,532 |
| GovernanceV3Base                                                    |       44 |     24,532 |
| GovernanceV3Ethereum                                                |       44 |     24,532 |
| GovernanceV3Gnosis                                                  |       44 |     24,532 |
| GovernanceV3Metis                                                   |       44 |     24,532 |
| GovernanceV3Optimism                                                |       44 |     24,532 |
| GovernanceV3Polygon                                                 |       44 |     24,532 |
| GovernanceV3PolygonZkEvm                                            |       44 |     24,532 |
| GovernanceV3Scroll                                                  |       44 |     24,532 |
| GovernanceV3ZkSync                                                  |       44 |     24,532 |
| IpfsUtils                                                           |       44 |     24,532 |
| MiscArbitrum                                                        |       44 |     24,532 |
| MiscAvalanche                                                       |       44 |     24,532 |
| MiscBNB                                                             |       44 |     24,532 |
| MiscBase                                                            |       44 |     24,532 |
| MiscEthereum                                                        |       44 |     24,532 |
| MiscGnosis                                                          |       44 |     24,532 |
| MiscMetis                                                           |       44 |     24,532 |
| MiscOptimism                                                        |       44 |     24,532 |
| MiscPolygon                                                         |       44 |     24,532 |
| MiscScroll                                                          |       44 |     24,532 |
| Payloads                                                            |       44 |     24,532 |
| PayloadsControllerUtils                                             |       44 |     24,532 |
| ProtocolGuardians                                                   |      292 |     24,284 |
| ProxyHelpers                                                        |       44 |     24,532 |
| RenewalV2BasePayload                                                |      348 |     24,228 |
| RenewalV3BasePayload                                                |    1,062 |     23,514 |
| ReserveConfiguration                                                |      128 |     24,448 |
| SafeERC20                                                           |       44 |     24,532 |
| StorageHelpers                                                      |       44 |     24,532 |
| TestNetChainIds                                                     |       44 |     24,532 |
| WadRayMath                                                          |       44 |     24,532 |
Test success 🌈
No files changed, compilation skipped

Ran 1 test for src/20241012_AaveV3Ethereum_ChaosLabsAaveRiskManagementServiceRenewal/AaveV3Ethereum_ChaosLabsAaveRiskManagementServiceRenewal_20241012.t.sol:AaveV3Ethereum_ChaosLabsAaveRiskManagementServiceRenewal_20241012_Test
[PASS] test_defaultProposalExecution() (gas: 585371)
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 1.06s (893.80ms CPU time)

Ran 1 test suite in 1.07s (1.06s CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests)

Please sign in to comment.