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

0 stars 0 forks source link

Striped Bronze Ferret - Lender cannot use auction functionality if lender called loan when contract is paused #282

Open sherlock-admin2 opened 2 days ago

sherlock-admin2 commented 2 days ago

Striped Bronze Ferret

High

Lender cannot use auction functionality if lender called loan when contract is paused

Summary

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

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

Root Cause

The call function does not have whenNotPaused modifier.

Internal pre-conditions

  1. Admin pause the contract.

External pre-conditions

No response

Attack Path

  1. Admin pause the contract.
  2. A lender whose loan duration is over, call his loan.
  3. Auction duration is started but new lender cannot use auction because contract is paused.
  4. Lender cannot use the functionality of auction of his loan.

Impact

Lender cannot use the functionality of auction on his loan.

PoC

No response

Mitigation

Protocol should add whenNotPaused modifier in call function. It has no adverse impact and protect lender in such cases.

-function call(uint256 loanId) external nonReentrant {
+function call(uint256 loanId) external nonReentrant whenNotPaused {