The contract initializes the string memory status variable at the time of declaration, even though its value is always reassigned in subsequent conditional branches. This results in unnecessary memory allocation and increased gas consumption.
Likelihood:
This will occur every time the getOrderDetailsString function is called, as the string variable is always initialized before being conditionally assigned.
Impact:
Increased gas costs for every call to the function due to unnecessary memory allocation.
Reduced overall efficiency, especially when the function is called frequently or in a loop.
the script for comparing difference in gas cost.
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.