code-423n4 / 2022-03-sublime-findings

0 stars 0 forks source link

Gas Optimizations #62

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Use seperate LimitsUpdated event

Instead of using the first event argument to store a string, use seperate event to track individual limit https://github.com/sublime-finance/sublime-v1/blob/46536a6d25df4264c1b217bd3232af30355dcb95/contracts/PooledCreditLine/PooledCreditLine.sol#L233

Unnecessary safemath when div(SCALING_FACTOR)

https://github.com/sublime-finance/sublime-v1/blob/46536a6d25df4264c1b217bd3232af30355dcb95/contracts/PooledCreditLine/LenderPool.sol#L319

Check fromBalance != 0 then proceed without safemath

https://github.com/sublime-finance/sublime-v1/blob/46536a6d25df4264c1b217bd3232af30355dcb95/contracts/PooledCreditLine/LenderPool.sol#L707

ritik99 commented 2 years ago

All suggestions are valid