Skip to content

Commit

Permalink
fix: ensure test sender is not proxy admin in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Thegaram committed Apr 10, 2024
1 parent 111a0c0 commit 8ff695c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test/ScrollBadgeResolver.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ contract ScrollBadgeTest is ScrollBadgeTestBase {

function testResolverToggleBadgeOnlyOwner(address notOwner, address anyBadge, bool enable) external {
vm.assume(notOwner != address(this));
vm.assume(notOwner != PROXY_ADMIN_ADDRESS);
vm.prank(notOwner);
vm.expectRevert("Ownable: caller is not the owner");
resolver.toggleBadge(anyBadge, enable);
}

function testResolverToggleWhitelistOnlyOwner(address notOwner, bool enable) external {
vm.assume(notOwner != address(this));
vm.assume(notOwner != PROXY_ADMIN_ADDRESS);
vm.prank(notOwner);
vm.expectRevert("Ownable: caller is not the owner");
resolver.toggleWhitelist(enable);
Expand Down
2 changes: 1 addition & 1 deletion test/ScrollBadgeTestBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ contract ScrollBadgeTestBase is Test {
address internal constant alice = address(1);
address internal constant bob = address(2);

address private constant PROXY_ADMIN_ADDRESS = 0x2000000000000000000000000000000000000000;
address internal constant PROXY_ADMIN_ADDRESS = 0x2000000000000000000000000000000000000000;

function setUp() public virtual {
// EAS infra
Expand Down

0 comments on commit 8ff695c

Please sign in to comment.