Open code423n4 opened 3 years ago
pauliax
The check could be inclusive <= here to save some gas when debts = _amount (also 'unchecked' keyword can be used):
if (debts < _amount) { // safe gaurd to some underflows debts = 0; } else { debts -= _amount; }
duplicated with https://github.com/code-423n4/2021-10-mochi-findings/issues/75
I don't think it's a duplicate
Handle
pauliax
Vulnerability details
Impact
The check could be inclusive <= here to save some gas when debts = _amount (also 'unchecked' keyword can be used):
if (debts < _amount) { // safe gaurd to some underflows debts = 0; } else { debts -= _amount; }