claimYieldFeeShares(_shares) mints _shares shares but always sets yieldFeeBalance = 0 instead of yieldFeeBalance -= _shares, even when _shares < yieldFeeBalance. A subsequent call to claim the remaining yieldFeeBalance - _shares fees would therefore revert, i.e. the remaining yield fees are lost.
Lines of code
https://github.com/code-423n4/2024-03-pooltogether/blob/480d58b9e8611c13587f28811864aea138a0021a/pt-v5-vault/src/PrizeVault.sol#L617
Vulnerability details
Impact
Yield fees are lost.
Proof of Concept
Yield fees are intermediately accounted for in
yieldFeeBalance
, later to be minted as normal shares by callingclaimYieldFeeShares()
:claimYieldFeeShares(_shares)
mints_shares
shares but always setsyieldFeeBalance = 0
instead ofyieldFeeBalance -= _shares
, even when_shares < yieldFeeBalance
. A subsequent call to claim the remainingyieldFeeBalance - _shares
fees would therefore revert, i.e. the remaining yield fees are lost.Recommended Mitigation Steps
Assessed type
Math