Gas Optimizations #8
Labels
bug
Something isn't working
G (Gas Optimization)
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
general considerations
block.timestamp.safeCastTo32()
, which could be changed touint32(block.timestamp)
with no practical risk, and saves therequire()
checkuint256
should be used in many scenarios inside of the functions or as function parameters instead, and only cast it into a lower size uint, when storing it instead. reference. for exampletimestamp
is being casted way too early, and then being used, resulting in higher gas.forge snapshot --optimize --optimize-runs 1000000
use storage pointers where possible [ERC20MultiVotes]
use storage pointers where possible [ERC20Gauges]
unchecked i++ [FlywheelGaugeRewards]
The text was updated successfully, but these errors were encountered: