code-423n4 / 2021-09-sushitrident-2-findings

0 stars 0 forks source link

Adding unchecked directive can save gas #55

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

WatchPug

Vulnerability details

For the arithmetic operations that will never over/underflow, using the unchecked directive (Solidity v0.8 has default overflow/underflow checks) can save some gas from the unnecessary internal over/underflow checks.

For example: