clober-dex / coupon-finance

Coupon Finance Solidity Contracts
Other
1 stars 0 forks source link

Redundant conditional check #114

Closed detectivekim closed 1 year ago

detectivekim commented 1 year ago

Details

The former condition repayAmount > newRepayAmount is a subset of the latter condition newRepayAmount < minDebtAmount + repayAmount, and is therefore redundant.

Mitigation

- } else if (repayAmount > newRepayAmount || newRepayAmount < minDebtAmount + repayAmount) {
+ } else if (newRepayAmount < minDebtAmount + repayAmount) {