The implementation of the RelatedContractLibraries
library uses magic numbers to represent related contract types (e.g., SYSTEM_CONFIG
, PRE_MARKETS
, etc.). These numbers are hardcoded and lack descriptive context.
Using magic numbers can lead to confusion and errors during development and maintenance. It reduces code readability and increases the risk of misinterpretation, especially for new developers or when revisiting the code after some time.
The constants defined in the library:
These values are used directly in function calls without any context, making it unclear what each number represents for example in the TadleFactory::deployUpgradeableProxy
function:
Using magic numbers can lead to confusion and errors during development and maintenance.
It reduces code readability and increases the risk of misinterpretation, especially for new developers or when revisiting the code after some time.
Manual Review
Replace magic numbers with enums, as it's done elsewhere in the code, to improve code clarity and maintainability. For example:
This change would enhance readability and reduce the likelihood of errors related to misinterpretation of the numbers.
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.