Closed chasebrownn closed 5 months ago
The RevenueStreamETH::depositETH function will push the current cycle to the cycles entry as block.timestamp yet will dynamically query the same value via RevenueStreamETH::currentCycle.
RevenueStreamETH::depositETH
cycles
block.timestamp
RevenueStreamETH::currentCycle
if (revenue[block.timestamp] == 0) { cycles.push(block.timestamp); revenue[currentCycle()] = msg.value; }
We advise the block.timestamp to be utilized, optimizing the gas cost of the function.
Acknowledged
RSE-04C: Redundant Query of Current Cycle
Description:
The
RevenueStreamETH::depositETH
function will push the current cycle to thecycles
entry asblock.timestamp
yet will dynamically query the same value viaRevenueStreamETH::currentCycle
.Example:
Recommendation:
We advise the
block.timestamp
to be utilized, optimizing the gas cost of the function.