hats-finance / Inverter-Network-0xe47e52c4fea05e555920f1dcdcc6fb8eca103eeb

Fork of the Inverter Smart Contracts Repository
GNU Lesser General Public License v3.0
0 stars 3 forks source link

Use of `src/modules/lib/SafeMath.sol` is unnecessary for solidity version >= 0.8.0. #30

Open hats-bug-reporter[bot] opened 2 months ago

hats-bug-reporter[bot] commented 2 months ago

Github username: @erictee2802 Twitter username: 0xEricTee Submission hash (on-chain): 0x019fa3d9a18635e2a56bc69b694244390db095cee79870f7a9c6a080ad023a87 Severity: low

Description: Description\

Solidity version greater or equal to 0.8.0, the solidity will auto revert if the calculation overflow/underflow. Therefore, the use of SafeMath.sol library is unnecessary.

Attack Scenario\

Use of unnecessary library might cause waste of gas in contract deployment.

Attachments

NA

  1. Proof of Concept (PoC) File

Manual Analysis

  1. Revised Code File (Optional)
    • The contract should use the built-in checks and remove SafeMath from the dependencies.
0xmahdirostami commented 2 months ago

Use of unnecessary library might cause waste of gas in contract deployment.

Gas optimization, so it's invalid for low-label issues.