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

0 stars 0 forks source link

Adding unchecked directive can save gas #27

Open code423n4 opened 3 years ago

code423n4 commented 3 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:

CalabashSquash commented 3 years ago

Duplicate of https://github.com/code-423n4/2021-10-tracer-findings/issues/34

Although #27 does provide more in-depth examples.

GalloDaSballo commented 3 years ago

Agree with finding