From c7fb8f49aa8cb94d9dd15c46bf46c942c0f7fb05 Mon Sep 17 00:00:00 2001 From: JosepBove Date: Tue, 17 Oct 2023 02:12:22 +0200 Subject: [PATCH 1/5] :sparkles:feat: start emissions aip --- ...ndSafetyModuleAAVEEmissions_20231016.s.sol | 34 ++++++ ...mendSafetyModuleAAVEEmissions_20231016.sol | 113 +++++++++++++++++ ...ndSafetyModuleAAVEEmissions_20231016.t.sol | 115 ++++++++++++++++++ .../AmendSafetyModuleAAVEEmissions.md | 36 ++++++ 4 files changed, 298 insertions(+) create mode 100644 src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_AmendSafetyModuleAAVEEmissions_20231016.s.sol create mode 100644 src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.sol create mode 100644 src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol create mode 100644 src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AmendSafetyModuleAAVEEmissions.md diff --git a/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_AmendSafetyModuleAAVEEmissions_20231016.s.sol b/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_AmendSafetyModuleAAVEEmissions_20231016.s.sol new file mode 100644 index 00000000..715f1130 --- /dev/null +++ b/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_AmendSafetyModuleAAVEEmissions_20231016.s.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; +import {EthereumScript} from 'aave-helpers/ScriptUtils.sol'; +import {AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016} from './AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.sol'; + +/** + * @dev Deploy AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016 + * command: make deploy-ledger contract=src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_AmendSafetyModuleAAVEEmissions_20231016.s.sol:DeployEthereum chain=mainnet + */ +contract DeployEthereum is EthereumScript { + function run() external broadcast { + new AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016(); + } +} + +/** + * @dev Create Proposal + * command: make deploy-ledger contract=src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_AmendSafetyModuleAAVEEmissions_20231016.s.sol:CreateProposal chain=mainnet + */ +contract CreateProposal is EthereumScript { + function run() external broadcast { + GovHelpers.Payload[] memory payloads = new GovHelpers.Payload[](1); + payloads[0] = GovHelpers.buildMainnet(address(0)); + GovHelpers.createProposal( + payloads, + GovHelpers.ipfsHashFile( + vm, + 'src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AmendSafetyModuleAAVEEmissions.md' + ) + ); + } +} diff --git a/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.sol b/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.sol new file mode 100644 index 00000000..5b1f2ce9 --- /dev/null +++ b/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.sol @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {AaveSafetyModule} from 'aave-address-book/AaveSafetyModule.sol'; +import {AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; +import {IAaveEcosystemReserveController, AaveMisc} from "aave-address-book/AaveMisc.sol"; + +library DistributionTypes { + struct AssetConfigInput { + uint128 emissionPerSecond; + uint256 totalStaked; + address underlyingAsset; + } + + struct UserStakeInput { + address underlyingAsset; + uint256 stakedByUser; + uint256 totalStaked; + } +} + + +interface IAaveDistributionManager { + function configureAssets(DistributionTypes.AssetConfigInput[] calldata assetsConfigInput) external; + function STAKED_TOKEN() external returns(address); + function totalSupply() external returns(uint256); +} + +/** + * @title Amend Safety Module AAVE Emissions + * @author Aave-Chan Initiative + * - Snapshot: https://snapshot.org/#/aave.eth/proposal/0xb0124fb0206676ee743e8d6221b7b3c317cb26a657551f11cb5fa23544772a73 + * - Discussion: https://governance.aave.com/t/arfc-treasury-management-amend-safety-module-aave-emissions/14936 + */ +contract AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016 is IProposalGenericExecutor { + + address public constant STKAAVE = AaveSafetyModule.STK_AAVE; + address public constant STKABPT = AaveSafetyModule.STK_ABPT; + + address public constant ECOSYSTEM_RESERVE = AaveMisc.ECOSYSTEM_RESERVE; + + // New daily emission + uint256 public constant DAILY_EMISSIONS = 385 ether; + + // Total cycle emission (90 days) + uint256 public constant CYCLE_EMISSIONS = DAILY_EMISSIONS * 90; + + // Daily emission to seconds; 1 day * 24h * 3600 s = 86400 + uint128 public constant EMISSIONS_PER_SECOND = uint128(DAILY_EMISSIONS / 86400); + + IAaveEcosystemReserveController public constant ECOSYSTEM_RESERVE_CONTROLLER + = AaveMisc.AAVE_ECOSYSTEM_RESERVE_CONTROLLER; + + function execute() external { + // stkAave from daily 550 to 285 converted to seconds as required + _changeEmissions(STKAAVE, EMISSIONS_PER_SECOND); + + // stkABPT from daily 550 to 285 converted to seconds as required + _changeEmissions(STKABPT, EMISSIONS_PER_SECOND); + + // Remove the approval as needed by the ecosystem reserve and change it to the emissions of a 90 day cycle + _set90DayCycle(); + } + + function _changeEmissions(address asset, uint128 newEmissions) internal { + IAaveDistributionManager distributionManager = IAaveDistributionManager(asset); + + DistributionTypes.AssetConfigInput[] memory config = new DistributionTypes.AssetConfigInput[](1); + + config[0] = DistributionTypes.AssetConfigInput( + newEmissions, // emissions per second + distributionManager.totalSupply(), // total staked + asset // underlying asset + ); + + distributionManager.configureAssets(config); + } + + function _set90DayCycle() internal { + + // For requirement of the controller, first we reset allowance + ECOSYSTEM_RESERVE_CONTROLLER.approve( + ECOSYSTEM_RESERVE, + AaveV3EthereumAssets.AAVE_UNDERLYING, + STKAAVE, + 0 + ); + + ECOSYSTEM_RESERVE_CONTROLLER.approve( + ECOSYSTEM_RESERVE, + AaveV3EthereumAssets.AAVE_UNDERLYING, + STKABPT, + 0 + ); + + // Then we set the amount 90 days * 385 daily emission (both on stkAave and stkABPT) => 90 * 550 = 34_650 + ECOSYSTEM_RESERVE_CONTROLLER.approve( + ECOSYSTEM_RESERVE, + AaveV3EthereumAssets.AAVE_UNDERLYING, + STKAAVE, + CYCLE_EMISSIONS + ); + + ECOSYSTEM_RESERVE_CONTROLLER.approve( + ECOSYSTEM_RESERVE, + AaveV3EthereumAssets.AAVE_UNDERLYING, + STKABPT, + CYCLE_EMISSIONS + ); + + } +} diff --git a/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol b/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol new file mode 100644 index 00000000..775dc7b9 --- /dev/null +++ b/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol @@ -0,0 +1,115 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import 'forge-std/Test.sol'; +import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; +import {AaveSafetyModule} from 'aave-address-book/AaveSafetyModule.sol'; +import {AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; +import {AaveGovernanceV2} from 'aave-address-book/AaveGovernanceV2.sol'; +import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016} from './AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.sol'; +import {IAaveEcosystemReserveController, AaveMisc} from "aave-address-book/AaveMisc.sol"; +import {IERC20} from "solidity-utils/contracts/oz-common/interfaces/IERC20.sol"; + +library DistributionTypes { + struct AssetConfigInput { + uint128 emissionPerSecond; + uint256 totalStaked; + address underlyingAsset; + } + + struct UserStakeInput { + address underlyingAsset; + uint256 stakedByUser; + uint256 totalStaked; + } + + struct AssetResponse { + uint128 emissionPerSecond; + uint128 lastUpdateTimestamp; + uint256 index; + } +} + + +interface IAaveDistributionManager { + function configureAssets(DistributionTypes.AssetConfigInput[] calldata assetsConfigInput) external; + function STAKED_TOKEN() external returns(address); + function totalSupply() external returns(uint256); + function assets(address asset) external returns(DistributionTypes.AssetResponse memory); +} + +/** + * @dev Test for AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016 + * command: make test-contract filter=AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016 + */ +contract AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016_Test is ProtocolV3TestBase { + + AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016 internal proposal; + + address public constant STKAAVE = AaveSafetyModule.STK_AAVE; + address public constant STKABPT = AaveSafetyModule.STK_ABPT; + + address public constant ECOSYSTEM_RESERVE = AaveMisc.ECOSYSTEM_RESERVE; + + IAaveEcosystemReserveController public constant ECOSYSTEM_RESERVE_CONTROLLER + = AaveMisc.AAVE_ECOSYSTEM_RESERVE_CONTROLLER; + + uint256 public constant DAILY_EMISSIONS = 385 ether; + + // Total cycle emission (90 days) + uint256 public constant CYCLE_EMISSIONS = DAILY_EMISSIONS * 90; + + // Daily emission to seconds; 1 day * 24h * 3600 s = 86400 + uint128 public constant EMISSIONS_PER_SECOND = uint128(DAILY_EMISSIONS / 86400); + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('mainnet'), 18364871); + proposal = new AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016(); + } + + function testProposalExecutionPep() public { + + ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( + 'preAaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016', + AaveV3Ethereum.POOL + ); + + + GovHelpers.executePayload(vm, address(proposal), AaveGovernanceV2.SHORT_EXECUTOR); + + + ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( + 'postAaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016', + AaveV3Ethereum.POOL + ); + + + /* + Check emission changes, the value should be 385 ether * 86400 seconds on a day + */ + IAaveDistributionManager aaveManager = IAaveDistributionManager(STKAAVE); + DistributionTypes.AssetResponse memory aaveRes = aaveManager.assets(STKAAVE); + assertEq(aaveRes.emissionPerSecond, EMISSIONS_PER_SECOND); + + IAaveDistributionManager bptManager = IAaveDistributionManager(STKABPT); + DistributionTypes.AssetResponse memory bptRes = bptManager.assets(STKABPT); + assertEq(bptRes.emissionPerSecond, EMISSIONS_PER_SECOND); + + /* + Check cycles changes, the allowance should be 385 ether * 90 as described on the proposal + */ + assertEq(IERC20(AaveV3EthereumAssets.AAVE_UNDERLYING).allowance(ECOSYSTEM_RESERVE, STKAAVE), CYCLE_EMISSIONS); + assertEq(IERC20(AaveV3EthereumAssets.AAVE_UNDERLYING).allowance(ECOSYSTEM_RESERVE, STKABPT), CYCLE_EMISSIONS); + + + diffReports( + 'preAaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016', + 'postAaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016' + ); + + e2eTest(AaveV3Ethereum.POOL); + } + +} diff --git a/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AmendSafetyModuleAAVEEmissions.md b/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AmendSafetyModuleAAVEEmissions.md new file mode 100644 index 00000000..c31395eb --- /dev/null +++ b/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AmendSafetyModuleAAVEEmissions.md @@ -0,0 +1,36 @@ +--- +title: "Amend Safety Module AAVE Emissions" +author: "Aave-Chan Initiative" +discussions: "https://governance.aave.com/t/arfc-treasury-management-amend-safety-module-aave-emissions/14936" +--- + +## Simple Summary + +This publication proposes reducing AAVE (Safety Incentives) distributions to the Safety Module (SM) by 30% and introducing a 90-day SM emission cycle. + +## Motivation + +The SM serves as the Aave Protocol’s self-protection smart contract. The Aave Protocol distributes 1,100 AAVE daily, split evenly across AAVE and B-80AAVE-20wETH deposits. + +Future proposals shall discuss the composition and aim to improve the overall capital efficiency of the SM. However, this publication intends to reduce AAVE emissions in the immediate future, saving the DAO valuable AAVE emissions while the broader SM upgrade is being advanced. It is widely accepted within the community that Aave DAO is overpaying for AAVE and B-80BAL-20wETH deposits. + +This publication proposes reducing AAVE emissions by ~30%. The revised AAVE emission is to be reduced from 1,100 AAVE/day to 770 AAVE/day. This represents a 330 AAVE/day reduction. The APR for stkAAVE holders is expected to reduce from 6.87% to 4.81%. Similarly, for the B-80BAL-20wETH deposits, yield is expected to fall from 14.35% to 10.05%. + +Please note that the 80AAVE/20wETH Balancer v1 pool is to be migrated to Balancer v2 in the future. This will present the community with an opportunity to further revise the AAVE emissions. It may also occur at a time when the DAO has vlAURA and/or veBAL at its disposal. + +For context, the Llama Part IV SM Upgrade suggests reducing the AAVE emission to stkAAVE holders by 75%. This is because slashing for stkAAVE is to be reduced, additional assets are to be added to the SM, and the emissions are to be redirected to those newly added assets. Since this proposal was published, stkAAVE has also gained the utility of discounted GHO borrowing rates. + +Similarly, Xenophon Labs recommended doubling the slashing percentage from 30% to 60% on the stkAAVE pool and lowering emissions by 80 AAVE/day, from 550 to 470. While this publication does not propose amending the slashing rate, the reduction in AAVE emissions is about double. + +## Specification + +## References + +- Implementation: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.sol) +- Tests: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol) +- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0xb0124fb0206676ee743e8d6221b7b3c317cb26a657551f11cb5fa23544772a73) +- [Discussion](https://governance.aave.com/t/arfc-treasury-management-amend-safety-module-aave-emissions/14936) + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). From 766805b44743ff55fcde47ee991ed92a6263e3d1 Mon Sep 17 00:00:00 2001 From: JosepBove Date: Tue, 17 Oct 2023 13:27:58 +0200 Subject: [PATCH 2/5] :sparkles:feat: SM emissions specification --- .../AmendSafetyModuleAAVEEmissions.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AmendSafetyModuleAAVEEmissions.md b/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AmendSafetyModuleAAVEEmissions.md index c31395eb..34c0847a 100644 --- a/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AmendSafetyModuleAAVEEmissions.md +++ b/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AmendSafetyModuleAAVEEmissions.md @@ -24,6 +24,15 @@ Similarly, Xenophon Labs recommended doubling the slashing percentage from 30% t ## Specification +The implementation for this proposal will be prepared by ACI. The table below shows the current and proposed daily AAVE Emissions. + +| **Collateral** | **Current Emissions** | **Proposed Emissions** | +|----------------- |----------------------- |------------------------ | +| AAVE | 550 | 385 | +| B-80AAVE-20wETH | 550 | 385 | + +Transition to a 90-day period SM Emission schedule. + ## References - Implementation: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.sol) From cb378dd161f8ff17867f2b7a03a5e6089b65ce20 Mon Sep 17 00:00:00 2001 From: JosepBove Date: Tue, 17 Oct 2023 13:35:59 +0200 Subject: [PATCH 3/5] :recycle:chore: remove pool tests --- ...ndSafetyModuleAAVEEmissions_20231016.t.sol | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol b/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol index 775dc7b9..fa2ced33 100644 --- a/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol +++ b/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol @@ -71,21 +71,8 @@ contract AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016_Test is Protoco function testProposalExecutionPep() public { - ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( - 'preAaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016', - AaveV3Ethereum.POOL - ); - - GovHelpers.executePayload(vm, address(proposal), AaveGovernanceV2.SHORT_EXECUTOR); - - ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( - 'postAaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016', - AaveV3Ethereum.POOL - ); - - /* Check emission changes, the value should be 385 ether * 86400 seconds on a day */ @@ -102,14 +89,6 @@ contract AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016_Test is Protoco */ assertEq(IERC20(AaveV3EthereumAssets.AAVE_UNDERLYING).allowance(ECOSYSTEM_RESERVE, STKAAVE), CYCLE_EMISSIONS); assertEq(IERC20(AaveV3EthereumAssets.AAVE_UNDERLYING).allowance(ECOSYSTEM_RESERVE, STKABPT), CYCLE_EMISSIONS); - - - diffReports( - 'preAaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016', - 'postAaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016' - ); - - e2eTest(AaveV3Ethereum.POOL); } } From 075eb511c2c6378a2a69dc5298fe234ac8d27006 Mon Sep 17 00:00:00 2001 From: JosepBove Date: Tue, 17 Oct 2023 13:36:47 +0200 Subject: [PATCH 4/5] :pencil2:fix: test name --- ...aveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol b/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol index fa2ced33..5a087971 100644 --- a/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol +++ b/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol @@ -69,7 +69,7 @@ contract AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016_Test is Protoco proposal = new AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016(); } - function testProposalExecutionPep() public { + function testProposalExecution() public { GovHelpers.executePayload(vm, address(proposal), AaveGovernanceV2.SHORT_EXECUTOR); From 5da20e15440cbdd42ee32bd1851ea3f99523b11f Mon Sep 17 00:00:00 2001 From: JosepBove Date: Tue, 17 Oct 2023 13:41:18 +0200 Subject: [PATCH 5/5] :pencil2:chore: change library name --- ...thereum_AmendSafetyModuleAAVEEmissions_20231016.sol | 8 ++++---- ...ereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.sol b/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.sol index 5b1f2ce9..0acd0cfe 100644 --- a/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.sol +++ b/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.sol @@ -6,7 +6,7 @@ import {AaveSafetyModule} from 'aave-address-book/AaveSafetyModule.sol'; import {AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; import {IAaveEcosystemReserveController, AaveMisc} from "aave-address-book/AaveMisc.sol"; -library DistributionTypes { +library HelperStructs { struct AssetConfigInput { uint128 emissionPerSecond; uint256 totalStaked; @@ -22,7 +22,7 @@ library DistributionTypes { interface IAaveDistributionManager { - function configureAssets(DistributionTypes.AssetConfigInput[] calldata assetsConfigInput) external; + function configureAssets(HelperStructs.AssetConfigInput[] calldata assetsConfigInput) external; function STAKED_TOKEN() external returns(address); function totalSupply() external returns(uint256); } @@ -66,9 +66,9 @@ contract AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016 is IProposalGen function _changeEmissions(address asset, uint128 newEmissions) internal { IAaveDistributionManager distributionManager = IAaveDistributionManager(asset); - DistributionTypes.AssetConfigInput[] memory config = new DistributionTypes.AssetConfigInput[](1); + HelperStructs.AssetConfigInput[] memory config = new HelperStructs.AssetConfigInput[](1); - config[0] = DistributionTypes.AssetConfigInput( + config[0] = HelperStructs.AssetConfigInput( newEmissions, // emissions per second distributionManager.totalSupply(), // total staked asset // underlying asset diff --git a/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol b/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol index 5a087971..2ee80a85 100644 --- a/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol +++ b/src/20231016_AaveV3_Eth_AmendSafetyModuleAAVEEmissions/AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016.t.sol @@ -12,7 +12,7 @@ import {AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016} from './AaveV3_ import {IAaveEcosystemReserveController, AaveMisc} from "aave-address-book/AaveMisc.sol"; import {IERC20} from "solidity-utils/contracts/oz-common/interfaces/IERC20.sol"; -library DistributionTypes { +library HelperStructs { struct AssetConfigInput { uint128 emissionPerSecond; uint256 totalStaked; @@ -34,10 +34,10 @@ library DistributionTypes { interface IAaveDistributionManager { - function configureAssets(DistributionTypes.AssetConfigInput[] calldata assetsConfigInput) external; + function configureAssets(HelperStructs.AssetConfigInput[] calldata assetsConfigInput) external; function STAKED_TOKEN() external returns(address); function totalSupply() external returns(uint256); - function assets(address asset) external returns(DistributionTypes.AssetResponse memory); + function assets(address asset) external returns(HelperStructs.AssetResponse memory); } /** @@ -77,11 +77,11 @@ contract AaveV3_Ethereum_AmendSafetyModuleAAVEEmissions_20231016_Test is Protoco Check emission changes, the value should be 385 ether * 86400 seconds on a day */ IAaveDistributionManager aaveManager = IAaveDistributionManager(STKAAVE); - DistributionTypes.AssetResponse memory aaveRes = aaveManager.assets(STKAAVE); + HelperStructs.AssetResponse memory aaveRes = aaveManager.assets(STKAAVE); assertEq(aaveRes.emissionPerSecond, EMISSIONS_PER_SECOND); IAaveDistributionManager bptManager = IAaveDistributionManager(STKABPT); - DistributionTypes.AssetResponse memory bptRes = bptManager.assets(STKABPT); + HelperStructs.AssetResponse memory bptRes = bptManager.assets(STKABPT); assertEq(bptRes.emissionPerSecond, EMISSIONS_PER_SECOND); /*