code-423n4 / 2022-01-openleverage-findings

0 stars 0 forks source link

Gas Optimization: No need to use SafeMath everywhere #225

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

gzeon

Vulnerability details

Impact

For example, the following rounding operation is safe

https://github.com/code-423n4/2022-01-openleverage/blob/501e8f5c7ebaf1242572712626a77a3d65bdd3ad/openleverage-contracts/contracts/XOLE.sol#L249

        uint256 unlock_time = _unlock_time.div(WEEK).mul(WEEK);

to

        uint256 unlock_time = (_unlock_time/WEEK)*WEEK;