Open code423n4 opened 2 years ago
Looks like most of these are not valid. Seems like is just some script that is run to auto gen gas findings.
For example contracts/tokenomics/Minter.sol#L105
is this require(lastEvent == 0, "Inflation has already started.");
.
They are talking about initialising a variable. But we're not doing that here, we're doing a comparison...
In lack of math I can only rate it as 0 as when done as an external call it won't save gas
5 gas
Only 2 of the lines were above 32 chars, assuming 1 char = 1 bytes in lack of any explanation 6 * 2 = 12
The warden is suggesting to brick the functionality of the code to save gas, I'm gonna have to dispute
Disagree, it's the same code
Total Gas Saved 17 gas
Indeed could have done way better than this
GAS OPT
calldata
instead ofmemory
1.) File : contracts/tokenomics/FeeBurner.sol (Line.43)
epoch++
for saving more gasusing prefix is common that more saved gas than using postfix.
Tool Used
Remix
Recommended Mitigation
Occurances
KeeperGauge.sol#L59 KeeperGauge.sol#L98
Every reason string takes at least 32 bytes. Use short reason strings that fits in 32 bytes or it will become more expensive.
Tool Used
Manual Review
Occurances
e.g. (xxxxxx, IAS) //Inflation has Already Started
= 0
This implementation code can be saving more gas by removing = 0, it because If a variable was not set/initialized, it is assumed to have default value to 0
Tool Used
Manual Review
Mitigation Step
Remove
= 0
Occurances
This can be shorter code for gas opt
File : contracts/StakerVault.sol (Line.169)
changed to