code-423n4 / 2021-07-sherlock-findings

0 stars 0 forks source link

`decreaseApproval` gas improval #99

Closed code423n4 closed 3 years ago

code423n4 commented 3 years ago

Handle

cmichel

Vulnerability details

The SherXERC20.decreaseApproval function reads the allowance from memory twice. It should be read once the newValue should be calculated and stored in a variable. The newValue should then be emitted in the event instead of reading from storage again.

Evert0x commented 3 years ago

81