Open code423n4 opened 3 years ago
pauliax
Before:
require(currentAllowance >= amount + burnt, "OVL:allowance<amount+burnt"); unchecked { _approve(sender, msg.sender, currentAllowance - amount - burnt); }
After:
uint totalAmount = amount + burnt; require(currentAllowance >= totalAmount, "OVL:allowance<amount+burnt"); unchecked { _approve(sender, msg.sender, currentAllowance - totalAmount); }
This approach can be applied in several functions, e.g. transferFromBurn, _transferBurn.
Super tiny savings here.
Handle
pauliax
Vulnerability details
Impact
Before:
After:
This approach can be applied in several functions, e.g. transferFromBurn, _transferBurn.