Skip to content

Commit

Permalink
feat: variable rename and clarifying comment
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenvaleri committed Jul 22, 2024
1 parent 90a84e4 commit 7d72b64
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contracts/PointTokenVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ contract PointTokenVault is UUPSUpgradeable, AccessControlUpgradeable, Multicall
// Fees
uint256 public mintFee;
uint256 public redemptionFee;
mapping(bytes32 => uint256) public pTokenFeeAcc;
mapping(bytes32 => uint256) public rewardTokenFeeAcc;
mapping(bytes32 => uint256) public pTokenFeeAcc; // pTokenFeeAccumulator
mapping(bytes32 => uint256) public rewardTokenFeeAcc; // rewardTokenFeeAccumulator
mapping(address => mapping(bytes32 => uint256)) public feelesslyRedeemedPTokens; // user => pointsId => feelesslyRedeemedPTokens

struct Claim {
Expand Down Expand Up @@ -198,10 +198,10 @@ contract PointTokenVault is UUPSUpgradeable, AccessControlUpgradeable, Multicall
feelesslyRedeemedPTokens[msg.sender][pointsId] += pTokensToBurn;
} else {
// If some or all of the pTokens need to be charged a fee.
uint256 pTokensToFee = pTokensToBurn - feelesslyRedeemable;
uint256 redeemableWithFee = pTokensToBurn - feelesslyRedeemable;
// fee = amount of pTokens that are not feeless * rewardsPerPToken * redemptionFee
fee = FixedPointMathLib.mulWadUp(
FixedPointMathLib.mulWadUp(pTokensToFee, params.rewardsPerPToken), redemptionFee
FixedPointMathLib.mulWadUp(redeemableWithFee, params.rewardsPerPToken), redemptionFee
);

rewardTokenFeeAcc[pointsId] += fee;
Expand Down

0 comments on commit 7d72b64

Please sign in to comment.