Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use onchain addresses #6

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
pragma solidity ^0.8.0;

import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol';
import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol';
import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol';
import {AaveV3EthereumLido} from 'aave-address-book/AaveV3EthereumLido.sol';
import {IEmissionManager} from 'aave-v3-periphery/contracts/rewards/interfaces/IEmissionManager.sol';
import {DataTypes} from 'aave-v3-origin/core/contracts/protocol/libraries/types/DataTypes.sol';

/**
* @title Set ACI as Emission Manager for USDS and aUSDS
* @author ACI
Expand All @@ -15,12 +18,18 @@ contract AaveV3Ethereum_SetACIAsEmissionManagerForUSDSAndAUSDS_20240929 is
{
address public constant ACI_MULTISIG = 0xac140648435d03f784879cd789130F22Ef588Fcd;
address public constant USDS = 0xdC035D45d973E3EC169d2276DDab16f1e407384F; // Hardcoded as lib is not updated yet.
address public constant aEthUSDS = 0x32a6268f9Ba3642Dda7892aDd74f1D34469A4259; // Hardcoded as it doesn't exist yet.
address public constant aEthLidoUSDS = 0x09AA30b182488f769a9824F15E6Ce58591Da4781; // Hardcoded as it doesn't exist yet.

function execute() external {
IEmissionManager(AaveV3Ethereum.EMISSION_MANAGER).setEmissionAdmin(USDS, ACI_MULTISIG);
IEmissionManager(AaveV3Ethereum.EMISSION_MANAGER).setEmissionAdmin(aEthUSDS, ACI_MULTISIG);
IEmissionManager(AaveV3Ethereum.EMISSION_MANAGER).setEmissionAdmin(aEthLidoUSDS, ACI_MULTISIG);
DataTypes.ReserveDataLegacy memory protoUSDS = AaveV3Ethereum.POOL.getReserveData(USDS);
IEmissionManager(AaveV3Ethereum.EMISSION_MANAGER).setEmissionAdmin(
protoUSDS.aTokenAddress,
ACI_MULTISIG
);
DataTypes.ReserveDataLegacy memory lidoUSDS = AaveV3EthereumLido.POOL.getReserveData(USDS);
IEmissionManager(AaveV3Ethereum.EMISSION_MANAGER).setEmissionAdmin(
lidoUSDS.aTokenAddress,
ACI_MULTISIG
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
pragma solidity ^0.8.0;

import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol';
import {AaveV3EthereumLido} from 'aave-address-book/AaveV3EthereumLido.sol';
import {GovV3Helpers} from 'aave-helpers/src/GovV3Helpers.sol';

import {DataTypes} from 'aave-v3-origin/core/contracts/protocol/libraries/types/DataTypes.sol';
import {IEmissionManager} from 'aave-v3-periphery/contracts/rewards/interfaces/IEmissionManager.sol';

import 'forge-std/Test.sol';
Expand All @@ -26,6 +27,7 @@ contract AaveV3Ethereum_SetACIAsEmissionManagerForUSDSAndAUSDS_20240929_Test is
* @dev executes the generic test suite including e2e and config snapshots
*/
function test_defaultProposalExecution() public {
GovV3Helpers.executePayload(vm, 183);
defaultTest(
'AaveV3Ethereum_SetACIAsEmissionManagerForUSDSAndAUSDS_20240929',
AaveV3Ethereum.POOL,
Expand All @@ -34,17 +36,24 @@ contract AaveV3Ethereum_SetACIAsEmissionManagerForUSDSAndAUSDS_20240929_Test is
}

function test_emissions_admin() public {
GovV3Helpers.executePayload(vm, 183);
GovV3Helpers.executePayload(vm, address(proposal));
assertEq(
IEmissionManager(AaveV3Ethereum.EMISSION_MANAGER).getEmissionAdmin(proposal.USDS()),
proposal.ACI_MULTISIG()
);
DataTypes.ReserveDataLegacy memory protoUSDS = AaveV3Ethereum.POOL.getReserveData(
proposal.USDS()
);
assertEq(
IEmissionManager(AaveV3Ethereum.EMISSION_MANAGER).getEmissionAdmin(proposal.aEthUSDS()),
IEmissionManager(AaveV3Ethereum.EMISSION_MANAGER).getEmissionAdmin(protoUSDS.aTokenAddress),
proposal.ACI_MULTISIG()
);
DataTypes.ReserveDataLegacy memory lidoUSDS = AaveV3EthereumLido.POOL.getReserveData(
proposal.USDS()
);
assertEq(
IEmissionManager(AaveV3Ethereum.EMISSION_MANAGER).getEmissionAdmin(proposal.aEthLidoUSDS()),
IEmissionManager(AaveV3Ethereum.EMISSION_MANAGER).getEmissionAdmin(lidoUSDS.aTokenAddress),
proposal.ACI_MULTISIG()
);
}
Expand Down
Loading