Open code423n4 opened 2 years ago
pauliax
It is unclear why you need this new local variable called newIbRatio if you instantly update and use the storage variable afterwards: uint256 newIbRatio = ibRatio * startSupply / totalSupply(); ibRatio = newIbRatio;
ibRatio = ibRatio * startSupply / totalSupply();
Agree with the finding, note that would save only 6 gas (3 for storing in memory, 3 for reading for the copy to storage)
Handle
pauliax
Vulnerability details
Impact
It is unclear why you need this new local variable called newIbRatio if you instantly update and use the storage variable afterwards: uint256 newIbRatio = ibRatio * startSupply / totalSupply(); ibRatio = newIbRatio;
Recommended Mitigation Steps
ibRatio = ibRatio * startSupply / totalSupply();