Skip to content

Commit

Permalink
chore: reorg inits, add multicall auth test
Browse files Browse the repository at this point in the history
  • Loading branch information
jparklev committed Apr 18, 2024
1 parent 33e2740 commit 38ca388
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/PointTokenVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ contract PointTokenVault is UUPSUpgradeable, AccessControlUpgradeable, Multicall
}

function initialize() public initializer {
__Multicall_init();
__UUPSUpgradeable_init();
__AccessControl_init();
__Multicall_init();
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
}

Expand Down
17 changes: 17 additions & 0 deletions contracts/test/PointTokenVault.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,23 @@ contract PointTokenVaultTest is Test {
assertEq(pointTokenVault.pointTokens(eigenPointsId).balanceOf(toly), 0.5e18);
}

function test_MulticallAuth(address lad) public {
vm.assume(lad != admin);
// Only admin can exec
vm.expectRevert(
abi.encodeWithSelector(
IAccessControl.AccessControlUnauthorizedAccount.selector, lad, pointTokenVault.MERKLE_UPDATER_ROLE()
)
);
vm.prank(lad);
bytes[] memory calls = new bytes[](1);
calls[0] = abi.encodeCall(pointTokenVault.updateRoot, (bytes32("123")));
pointTokenVault.multicall(calls);

vm.prank(merkleUpdater);
pointTokenVault.multicall(calls);
}

function test_SimpleRedemption() public {
bytes32 root = 0x4e40a10ce33f33a4786960a8bb843fe0e170b651acd83da27abc97176c4bed3c;

Expand Down

0 comments on commit 38ca388

Please sign in to comment.