code-423n4 / 2022-04-phuture-findings

0 stars 0 forks source link

Gas Optimizations #47

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Use memory variable to store decimals()

Affected code

Use newWeight != 0 instead of newWeight > 0

Affected code

Use _totalSupply != 0 instead of _totalSupply > 0

Affected code

Use uint _balance = oldShares instead of uint _balance = _NAV.balanceOf[_account]

Affected code

Add condition (i != 0) to if block

Affected code

Proof of concept