In FraxlendPairCore.constructor() function, value of dirtyLiquidationFee should be 90% of clean fee (in comment). But actually, in implementation, it’s only equal to 9% of clean fee because LIQ_PRECISION = 1e5 and 9000 is only 9% of 1e5.
This basically resulted in less amount of collateral liquidators will receive in liquidateClean() function.
Lines of code
https://github.com/code-423n4/2022-08-frax/blob/c4189a3a98b38c8c962c5ea72f1a322fbc2ae45f/src/contracts/FraxlendPairCore.sol#L194
Vulnerability details
Impact
In
FraxlendPairCore.constructor()
function, value ofdirtyLiquidationFee
should be 90% of clean fee (in comment). But actually, in implementation, it’s only equal to 9% of clean fee becauseLIQ_PRECISION = 1e5
and 9000 is only 9% of 1e5.This basically resulted in less amount of collateral liquidators will receive in
liquidateClean()
function.Proof of Concept
Line 194 init value of
dirtyLiquidationFee
This variable is used to calculate amount of collateral received by liquidators in line 988-990
Tools Used
Manual Review
Recommended Mitigation Steps
Fix line 194 to