Literal values are repeatedly used across multiple files in the codebase, which could lead to inconsistencies and difficulties in maintenance. Defining these literals as constant
variables will improve code readability and maintainability.
Instances
File: src/Escrow.sol
Lines: 86, 107
File: src/Protocol.sol
Lines: 177, 228
File: src/sn/Cairo.sol
Lines: 128, 149, 239, 451
Impact on Project:
Maintainability: Using constants instead of literals reduces the risk of errors during code updates and improves the readability of the code.
Consistency: Defining constants ensures consistent usage across the codebase, minimizing discrepancies and potential bugs.
Consistent Usage: Replace all repeated literals with constant
variables across the codebase.
Code Review: Perform a thorough code review to identify any additional instances where literals could be replaced with constants.
In src/Protocol.sol
:
In src/sn/Cairo.sol
:
Please, do not suppose impacts, think about the real impact of the bug and check the CodeHawks documentation to confirm: https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity A PoC always helps to understand the real impact possible.
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.