Skip to content

Commit

Permalink
Update test/groups/upgradeableProxy/adminOperationsUpgradeableRenounc…
Browse files Browse the repository at this point in the history
…eableProxy.t.sol

Co-authored-by: Yevgeniy <35062472+roleengineer@users.noreply.github.com>
  • Loading branch information
benjaminbollen and roleengineer authored Nov 18, 2024
1 parent d32aa9c commit e63bc6c
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,18 @@ contract adminOperationsUpgradeableRenounceableProxy is Test, GroupSetup {
}

function testRenounceAdmin() public {
// todo: it's not trivial (or impossible?) to read the ADMIN_SLOT from the proxy from a test contract
// this can only be read over the RPC?
// So for now, just test that after renouncing the admin, the group is no longer able to upgrade
// To properly test this, we need to mock the proxy to have an admin() func
// But we can also see this in the test trace, so maybe not necessary

// current admin
address admin = address(uint160(uint256(vm.load(address(proxy), ADMIN_SLOT))));
assertEq(admin, group);

// renounce admin
vm.prank(group);
proxy.renounceUpgradeability();

// renounced admin
admin = address(uint160(uint256(vm.load(address(proxy), ADMIN_SLOT))));
assertEq(admin, address(0x1));

// expect revert when trying to upgrade to implementation 0xdead
vm.startPrank(group);
vm.expectRevert();
Expand Down

0 comments on commit e63bc6c

Please sign in to comment.