Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: variable rename and clarifying comment #24

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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