Closed sherlock-admin4 closed 3 months ago
1 comment(s) were left on this issue during the judging contest.
infect3d commented:
low__ MIN_PRICE from LiquidationPair make this very unlikely to happen
Invalid/low severity, in addition to the a minimum 100 wei price implemented for each auction, the amount loss from yield is almost zero. Gas costs would disincentive this as well.
0xSpearmint1
high
Liquidator can avoid paying the yieldFee by liquidating small amounts
Summary
Liquidator can avoid paying the yieldFee by liquidating small amounts
Vulnerability Detail
A PrizeVault owner will set the
yieldFeePercentage
that they expect liquidators to pay when liquidating yield.It is calculated in
transferTokensOut
by the following formulaeA malicious liquidator can calculate an
_amountOut
such that for a given_yieldFeePercentage
, the_yieldFee
= 0See the POC section for an example of a liquidator avoiding paying the fee
Impact
Liquidator has avoided paying the fee that they should pay to PrizeVault owners
If all liquidators employ this profitable strategy, PrizeVault owners will never accumulate
yieldFeeBalance
Proof of Concept
Paste the following code into remix
Input the following _amountOut = 9998 _yieldFeePercentage = 100000 (1 basis point)
Output 0: uint256: _yieldFee 0
Another Example
Input the following _amountOut = 998 _yieldFeePercentage = 1000000 (10 basis points)
Output 0: uint256: _yieldFee 0
Code Snippet
https://github.com/sherlock-audit/2024-05-pooltogether/blob/1aa1b8c028b659585e4c7a6b9b652fb075f86db3/pt-v5-vault/src/PrizeVault.sol#L731
Tool used
Manual Review
Recommendation
If
_yieldFeePercentage != 0
then if_yieldFee = 0
revert the Tx