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: adjust tests and scripts for permission migration #201

Merged
merged 2 commits into from
Feb 5, 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 @@ -7,6 +7,7 @@ import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol';

import 'forge-std/Test.sol';
import {GovHelpers} from 'aave-helpers/GovHelpers.sol';
import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol';
import {AaveGovernanceV2} from 'aave-address-book/AaveGovernanceV2.sol';
import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol';
import {ProtocolV2TestBase, ReserveConfig} from 'aave-helpers/ProtocolV2TestBase.sol';
Expand All @@ -24,12 +25,12 @@ contract AaveV2Ethereum_MigrationOfRemainingGovV2Permissions_20240130_Test is Pr
AaveV2Ethereum_MigrationOfRemainingGovV2Permissions_Part2_20240130 internal proposalPart2;

function setUp() public {
vm.createSelectFork(vm.rpcUrl('mainnet'), 19119958);
vm.createSelectFork(vm.rpcUrl('mainnet'), 19162360);
proposal = AaveV2Ethereum_MigrationOfRemainingGovV2Permissions_20240130(
PayloadsToDeploy.part1(address(new MainnetPayload()), address(0))
0xd15280055CfE8A8AD69EBC5108582fE5CF9e72ae // PayloadsToDeploy.part1(address(new MainnetPayload()), address(0))
);
proposalPart2 = AaveV2Ethereum_MigrationOfRemainingGovV2Permissions_Part2_20240130(
PayloadsToDeploy.part2(address(proposal))
0xb26EF5Fcef56262A5a21565b7665ffe2068DaE7C // PayloadsToDeploy.part2(address(proposal))
);
}

Expand All @@ -40,11 +41,11 @@ contract AaveV2Ethereum_MigrationOfRemainingGovV2Permissions_20240130_Test is Pr
uint256 wETHBalance = IERC20(AaveV2EthereumAssets.WETH_UNDERLYING).balanceOf(
address(AaveV2Ethereum.COLLECTOR)
);
assert(proposal.EXECUTION_TIME() == block.timestamp + 7 days);
assert(proposal.EXECUTION_TIME() >= block.timestamp + 5 days);
vm.warp(proposal.EXECUTION_TIME() - 2 days);
executePayload(vm, address(proposal));
GovV3Helpers.executePayload(vm, 57);
vm.warp(proposal.EXECUTION_TIME());
executePayload(vm, address(proposalPart2));
GovV3Helpers.executePayload(vm, 58);
uint256 wETHBalanceAfter = IERC20(AaveV2EthereumAssets.WETH_UNDERLYING).balanceOf(
address(AaveV2Ethereum.COLLECTOR)
);
Expand Down Expand Up @@ -79,8 +80,8 @@ contract AaveV2Ethereum_MigrationOfRemainingGovV2Permissions_20240130_Polygon_Te
PolygonPayload proposal;

function setUp() public {
vm.createSelectFork(vm.rpcUrl('polygon'), 52961125);
proposal = new PolygonPayload();
vm.createSelectFork(vm.rpcUrl('polygon'), 53153947);
proposal = PolygonPayload(0x40F9a4FB0E9E2a982c0A7547A6a48965BD480235);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ contract DeployPolygon is PolygonScript {
* verify-command: npx catapulta-verify -b broadcast/MigrationOfRemainingGovV2Permissions_20240130.s.sol/1/run-latest.json
*/
contract DeployEthereum is EthereumScript {
address internal constant POLYGON_PAYLOAD = address(0);
address internal constant POLYGON_PAYLOAD = address(0x40F9a4FB0E9E2a982c0A7547A6a48965BD480235);

function run() external broadcast {
require(POLYGON_PAYLOAD != address(0));
MainnetPayload payload = new MainnetPayload();
// deploy payloads
address payload0 = PayloadsToDeploy.part1(address(0), POLYGON_PAYLOAD);
address payload0 = PayloadsToDeploy.part1(address(payload), POLYGON_PAYLOAD);

address payload1 = PayloadsToDeploy.part2(address(new MainnetPayload()));
address payload1 = PayloadsToDeploy.part2(address(payload0));

// compose action
IPayloadsControllerCore.ExecutionAction[]
Expand Down Expand Up @@ -86,12 +87,16 @@ contract CreateProposal is EthereumScript {
// compose actions for validation
IPayloadsControllerCore.ExecutionAction[]
memory actionsEthereum0 = new IPayloadsControllerCore.ExecutionAction[](1);
actionsEthereum0[0] = GovV3Helpers.buildAction(address(0)); // TODO: replace with part1
actionsEthereum0[0] = GovV3Helpers.buildAction(
address(0xd15280055CfE8A8AD69EBC5108582fE5CF9e72ae)
);
payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum0);

IPayloadsControllerCore.ExecutionAction[]
memory actionsEthereum1 = new IPayloadsControllerCore.ExecutionAction[](1);
actionsEthereum1[0] = GovV3Helpers.buildAction(address(0)); // TODO: replace with part2
actionsEthereum1[0] = GovV3Helpers.buildAction(
address(0xb26EF5Fcef56262A5a21565b7665ffe2068DaE7C)
);
payloads[1] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum1);
// create proposal
vm.startBroadcast();
Expand Down
Loading