code-423n4 / 2021-10-mochi-findings

0 stars 0 forks source link

debts <= _amount #159

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

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; }

r2moon commented 3 years ago

duplicated with https://github.com/code-423n4/2021-10-mochi-findings/issues/75

ghoul-sol commented 3 years ago

I don't think it's a duplicate