Skip to content

Commit

Permalink
test: ownership transfer after migration
Browse files Browse the repository at this point in the history
  • Loading branch information
DhairyaSethi committed Oct 31, 2024
1 parent be370f6 commit 8f151e2
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,28 @@ contract AaveV3Arbitrum_GHOCCIP150Upgrade_20241021_Test is ProtocolV3TestBase {
);
}

function test_ownershipTransferOfGhoProxyPool() public {
executePayload(vm, address(proposal));
_mockCCIPMigration();

assertEq(ghoTokenPool.owner(), AaveV3Arbitrum.ACL_ADMIN);

// CLL team transfers ownership of proxyPool and GHO token in TokenAdminRegistry
vm.prank(proxyPool.owner());
proxyPool.transferOwnership(AaveV3Arbitrum.ACL_ADMIN);
vm.prank(TOKEN_ADMIN_REGISTRY.owner());
TOKEN_ADMIN_REGISTRY.transferAdminRole(ARB_GHO_TOKEN, AaveV3Arbitrum.ACL_ADMIN);

// new AIP to accept ownership
vm.startPrank(AaveV3Arbitrum.ACL_ADMIN);
proxyPool.acceptOwnership();
TOKEN_ADMIN_REGISTRY.acceptAdminRole(ARB_GHO_TOKEN);
vm.stopPrank();

assertEq(proxyPool.owner(), AaveV3Arbitrum.ACL_ADMIN);
assertTrue(TOKEN_ADMIN_REGISTRY.isAdministrator(ARB_GHO_TOKEN, AaveV3Arbitrum.ACL_ADMIN));
}

function _mockCCIPMigration() private {
IRouter router = IRouter(ghoTokenPool.getRouter());
// token registry not set for 1.5 migration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ contract AaveV3Ethereum_GHOCCIP150Upgrade_20241021_Test is ProtocolV3TestBase {
ghoTokenPool.releaseOrMint(abi.encode(alice), alice, amount, ARB_CHAIN_SELECTOR, new bytes(0));
}

function test_stewardDisableRateLimit() public {
function test_stewardCanDisableRateLimit() public {
executePayload(vm, address(proposal));

vm.prank(ghoTokenPool.owner());
Expand All @@ -329,6 +329,30 @@ contract AaveV3Ethereum_GHOCCIP150Upgrade_20241021_Test is ProtocolV3TestBase {
);
}

function test_ownershipTransferOfGhoProxyPool() public {
executePayload(vm, address(proposal));
_mockCCIPMigration();

assertEq(ghoTokenPool.owner(), AaveV3Ethereum.ACL_ADMIN);

// CLL team transfers ownership of proxyPool and GHO token in TokenAdminRegistry
vm.prank(proxyPool.owner());
proxyPool.transferOwnership(AaveV3Ethereum.ACL_ADMIN);
vm.prank(TOKEN_ADMIN_REGISTRY.owner());
TOKEN_ADMIN_REGISTRY.transferAdminRole(MiscEthereum.GHO_TOKEN, AaveV3Ethereum.ACL_ADMIN);

// new AIP to accept ownership
vm.startPrank(AaveV3Ethereum.ACL_ADMIN);
proxyPool.acceptOwnership();
TOKEN_ADMIN_REGISTRY.acceptAdminRole(MiscEthereum.GHO_TOKEN);
vm.stopPrank();

assertEq(proxyPool.owner(), AaveV3Ethereum.ACL_ADMIN);
assertTrue(
TOKEN_ADMIN_REGISTRY.isAdministrator(MiscEthereum.GHO_TOKEN, AaveV3Ethereum.ACL_ADMIN)
);
}

function _mockCCIPMigration() private {
IRouter router = IRouter(ghoTokenPool.getRouter());
// token registry not set for 1.5 migration
Expand Down
2 changes: 2 additions & 0 deletions src/interfaces/ccip/IProxyPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ interface IProxyPool is ITypeAndVersion {
}

function owner() external view returns (address);
function transferOwnership(address newOwner) external;
function acceptOwnership() external;
function getRouter() external view returns (address);
function setRouter(address router) external;
function getRemotePool(uint64 chainSelector) external view returns (bytes memory);
Expand Down
2 changes: 2 additions & 0 deletions src/interfaces/ccip/ITokenAdminRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ interface ITokenAdminRegistry is ITypeAndVersion {
function owner() external view returns (address);
function acceptAdminRole(address from) external;
function proposeAdministrator(address localToken, address administrator) external;
function transferAdminRole(address localToken, address newAdministrator) external;
function isAdministrator(address localToken, address administrator) external view returns (bool);
function getPool(address token) external view returns (address);
function setPool(address source, address pool) external;
}

0 comments on commit 8f151e2

Please sign in to comment.