Closed code423n4 closed 2 years ago
getSwapAmountToEndWithEqualShares gas before: 57339
getSwapAmountToEndWithEqualShares gas after: 57396
After measuring, it appears gas usage with pre-defined variables takes more gas, so this report does not hold water. Most likely because it prevents certain optimizations in Solidity 0.7.6
Closing as invalid. Line 191 refers to
amountIn = (difference * _TEMPUS_SHARE_PRECISION) / (rate + _TEMPUS_SHARE_PRECISION);
amountIn
is initialized in the function definition
) public view returns (uint256 amountIn) {
and solidity initializes a uint256 to 0.
Handle
pants
Vulnerability details
Initialize local vars before the for loop is more gas efficient. See line 191 TempusAMM. There might be other places where it's more severe due to a longer for loop .