OrderBook::getOrderDetailsString
contains redundant and verbose status logicThe getOrderDetailsString
function contains redundant status determination logic that makes the code verbose and harder to maintain.
The function first correctly calculates the status using a ternary operator, then immediately overwrites it with redundant if-else logic that produces the same results.
Likelihood: Code quality issue present in every call to the function
Impact:
Reduced code readability and maintainability
Potential for bugs if logic is modified in one place but not the other
Increased gas consumption due to unnecessary operations
Makes the codebase harder to understand and audit
Remove the redundant if-else chain as the ternary operator already handles all cases correctly:
This simplification maintains the same functionality while improving code clarity and reducing gas costs.
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.