code-423n4 / 2021-04-vader-findings

1 stars 0 forks source link

Fee on transfer conditions #293

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

paulius.eth

Vulnerability details

Impact

Could save some gas on every transfer if storage access of mapAddress_Excluded is replaced here: if (!mapAddress_Excluded[_from] && !mapAddress_Excluded[_to]) with: if (_fee > 0) then inside this if block you can also include this sentence: totalFees += _fee; also the initialization of totalFees is useless as it automatically gets assigned a default value of 0: totalFees = 0;