sherlock-audit / 2024-09-predict-fun-judging

0 stars 0 forks source link

Decent Marmalade Blackbird - PredictDotLoan::auction() doesn't allow new lenders to specify a minimum interest rate #279

Open sherlock-admin2 opened 2 days ago

sherlock-admin2 commented 2 days ago

Decent Marmalade Blackbird

Medium

PredictDotLoan::auction() doesn't allow new lenders to specify a minimum interest rate

Summary

PredictDotLoan::auction() doesn't allow users to specify a minimum interest rate. Due to the dutch auction this doesn't seem an issue since the interest rate always increases the more time elapses. However, this can be an issue if the chain where the contracts are deployed suffers a reorg attack. This may place the transaction earlier than the actor (Alice) anticipated. Therefore the interest rate that Alice expected may be lower causing a loss for Alice, since they expected a higher interest rate to achieve with their PredictDotLoan::auction() tx.

According to the contest page, the protocol contracts may be deployed to compatible EVM chains, many of which are frequently reorganized.

potentially any EVM chains with a prediction market

Root Cause

PredictDotLoan::auction() doesn't allow actors to specify a minInterestRate.

https://github.com/sherlock-audit/2024-09-predict-fun/blob/41e70f9eed3f00dd29aba4038544150f5b35dccb/predict-dot-loan/contracts/PredictDotLoan.sol#L561

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

An actor (the new lender) that is participating on an auction may receive less interest than intended, suffering a loss due to the lower interest rate.

PoC

No response

Mitigation

Consider allowing actors to specify a minInterestRate when they auction, and revert if the actual interest rate that is based on time elapsed is smaller than the minInterestRate.