Description:
In the readLastCappedReserves
function of the MultiFlowPump
contract, the return value of the readLastReserves()
function is not fully utilized. The second return value, which likely represents the last timestamp, is ignored and not assigned to any variable. This can lead to incorrect behavior if the unused return value contains critical information needed for further processing.
Impact:
Ignoring the return value of readLastReserves()
has a few consequences:
If the ignored value contains important data, such as the last timestamp, it may lead to incorrect calculations or decisions within the readLastCappedReserves
function.
If the readLastReserves()
function performs computations or has side effects to generate the unused return value, those operations will be wasted, resulting in unnecessary gas consumption.
The code becomes less readable and maintainable, as it is not clear why the return value is being discarded (include natspec).
Proof of Concept:
The following line of code in the readLastCappedReserves
function demonstrates the unused return value:
The second return value is not assigned to any variable and is effectively ignored.
Recommended Mitigation:
To tackle this problem, it's advisable to manage the unused return value properly. If the value isn't required, assign it to a variable with an underscore prefix to signal that it's intentionally disregarded. For example:
If the unused return value contains important information, it should be assigned to a properly named variable and used accordingly within the function.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.