diff --git a/contracts/PointTokenVault.sol b/contracts/PointTokenVault.sol index 4f4cb24..545e72d 100644 --- a/contracts/PointTokenVault.sol +++ b/contracts/PointTokenVault.sol @@ -41,7 +41,7 @@ contract PointTokenVault is UUPSUpgradeable, AccessControlUpgradeable, Multicall mapping(address => uint256) public caps; // asset => deposit cap - mapping(address => mapping(address => bool)) public trustedClaimers; // owner => delegate => trustedClaimers + mapping(address => mapping(address => bool)) public trustedReceivers; // owner => delegate => trustedReceivers // Fees uint256 public mintFee; @@ -66,7 +66,7 @@ contract PointTokenVault is UUPSUpgradeable, AccessControlUpgradeable, Multicall event Deposit(address indexed depositor, address indexed receiver, address indexed token, uint256 amount); event Withdraw(address indexed withdrawer, address indexed receiver, address indexed token, uint256 amount); - event TrustClaimer(address indexed owner, address indexed delegate, bool isTrusted); + event TrustReceiver(address indexed owner, address indexed delegate, bool isTrusted); event RootUpdated(bytes32 prevRoot, bytes32 newRoot); event PTokensClaimed( address indexed account, address indexed receiver, bytes32 indexed pointsId, uint256 amount, uint256 fee @@ -95,7 +95,7 @@ contract PointTokenVault is UUPSUpgradeable, AccessControlUpgradeable, Multicall error DepositExceedsCap(); error PTokenNotDeployed(); error AmountTooSmall(); - error NotTrustedClaimer(); + error NotTrustedReceiver(); /// @custom:oz-upgrades-unsafe-allow constructor constructor() { @@ -149,8 +149,8 @@ contract PointTokenVault is UUPSUpgradeable, AccessControlUpgradeable, Multicall revert PTokenNotDeployed(); } - if (_account != _receiver && !trustedClaimers[_account][_receiver]) { - revert NotTrustedClaimer(); + if (_account != _receiver && !trustedReceivers[_account][_receiver]) { + revert NotTrustedReceiver(); } uint256 pTokenFee = FixedPointMathLib.mulWadUp(_claim.amountToClaim, mintFee); @@ -161,9 +161,9 @@ contract PointTokenVault is UUPSUpgradeable, AccessControlUpgradeable, Multicall emit PTokensClaimed(_account, _receiver, pointsId, _claim.amountToClaim, pTokenFee); } - function trustClaimer(address _account, bool _isTrusted) public { - trustedClaimers[msg.sender][_account] = _isTrusted; - emit TrustClaimer(msg.sender, _account, _isTrusted); + function trustReceiver(address _account, bool _isTrusted) public { + trustedReceivers[msg.sender][_account] = _isTrusted; + emit TrustReceiver(msg.sender, _account, _isTrusted); } /// @notice Redeems point tokens for rewards diff --git a/contracts/test/PointTokenVault.t.sol b/contracts/test/PointTokenVault.t.sol index 05d2d57..159fb89 100644 --- a/contracts/test/PointTokenVault.t.sol +++ b/contracts/test/PointTokenVault.t.sol @@ -478,7 +478,7 @@ contract PointTokenVaultTest is Test { assertEq(pointTokenVault.pTokens(eigenPointsId).balanceOf(vitalik), 1e18); } - function test_TrustedClaimer() public { + function test_TrustedReceiver() public { bytes32 root = 0x4e40a10ce33f33a4786960a8bb843fe0e170b651acd83da27abc97176c4bed3c; bytes32[] memory proof = new bytes32[](1); @@ -489,12 +489,12 @@ contract PointTokenVaultTest is Test { // Toly tries to claim vitalik's pTokens (should fail) vm.prank(toly); - vm.expectRevert(PointTokenVault.NotTrustedClaimer.selector); + vm.expectRevert(PointTokenVault.NotTrustedReceiver.selector); pointTokenVault.claimPTokens(PointTokenVault.Claim(eigenPointsId, 1e18, 0.6e18, proof), vitalik, toly); // Vitalik delegates claiming rights to Toly vm.prank(vitalik); - pointTokenVault.trustClaimer(toly, true); + pointTokenVault.trustReceiver(toly, true); // Toly claims the half of Vitalik's pTokens vm.prank(toly); @@ -565,16 +565,18 @@ contract PointTokenVaultTest is Test { } event FeeCollectorSet(address feeCollector); - + function test_setFeeCollector() public { vm.prank(admin); - vm.expectEmit(true,true,true,true); + vm.expectEmit(true, true, true, true); emit FeeCollectorSet(toly); pointTokenVault.setFeeCollector(toly); vm.expectRevert( abi.encodeWithSelector( - IAccessControl.AccessControlUnauthorizedAccount.selector, address(vitalik), pointTokenVault.DEFAULT_ADMIN_ROLE() + IAccessControl.AccessControlUnauthorizedAccount.selector, + address(vitalik), + pointTokenVault.DEFAULT_ADMIN_ROLE() ) ); vm.prank(vitalik);