mrKaplan - matchProposals
function will revert while a proposal (borrowRequest/loanOffer
) has less than 10% remaining value.
#324
Labels
Sponsor Disputed
The sponsor disputed this issue's validity
mrKaplan
Medium
matchProposals
function will revert while a proposal (borrowRequest/loanOffer
) has less than 10% remaining value.Summary
According to the
README
:'''
Proposals can be matched against each other, instead of just asking the takers to accept the offers so that the best deals can be made.
'''
As proposals can never be allocated inside
matchProposals
function while one of them has less than 10% fulfill amount remaining, then the function becomes useless and then you will need to do it manually.Root Cause
In
PredictDotLoan.sol
there's a function called_assertFulfillAmountNotTooLow
that checks if the amount fulfilled is too low.As this function is done in a way that when the amount is less than 10% of the amount fulfilled of one proposal, it passes with that same proposal, but not the other. The other proposal has different fulfillment so it reverts with
FulfillAmountTooLow()
.Internal pre-conditions
positionID
positionID
.>90%
of the fulfillment.External pre-conditions
No response
Attack Path
matchProposals
.Impact
matchProposals
.PoC
borrowRequest
proposal scenario.scenario
:Mitigation
Check first if one of the proposals remaining fulfillment is less than 10% of the total. If yes, then avoid the checks
_assertFulfillAmountNotTooLow
of that proposal. But watch out by the storage manipulation on_updateFulfillment
.The text was updated successfully, but these errors were encountered: