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

0 stars 0 forks source link

`SafeMath` is unnecessary in Solidity 0.8.0 or higher #60

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

pants

Vulnerability details

The contract Swap uses OpenZeppelin's SafeMath library to avoid overflows and underflows in math calculations, although Solidity 0.8.0 and higher versions has built-in checks for overflows and underflows in math operations.

Impact

The use of SafeMath adds overhead and increase gas usage.

Tool Used

Manual code review.

Recommended Mitigation Steps

Don't use this library in Swap.

Shadowfiend commented 2 years ago

Duplicate of #42.