code-423n4 / 2021-05-88mph-findings

0 stars 0 forks source link

Add extra error message in_depositRecordData #7

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

gpersoon

Vulnerability details

Impact

In the function _depositRecordData of DInterest.sol, interestAmount is lowered with feeAmount. If by accident feeAmount happens to be larger than interestAmount an error occurs and the execution stops, without an error message. This might make troubleshooting this situation more difficult.

Proof of Concept

DInterest.sol: function _depositRecordData(..) { ... interestAmount -= feeAmount;

Tools Used

Editor

Recommended Mitigation Steps

Perhaps add something like: require(interestAmount >= feeAmount,"DInterest: fee too large");