As per solidity guidelines, the underscore prefix convention is suggested for non-external functions and state variables (private or internal). State variables without a specified visibility are internal by default.
Commit Hash: 04fd8634701697184a3f3a5558b41c109866e5f8
Repository URL: https://github.com/Cyfrin/2024-08-tadle/tree/main
This convention is suggested for non-external functions and state variables (private or internal). State variables without a specified visibility are internal by default.
When designing a smart contract, the public-facing API (functions that can be called by any account) is an important consideration. Leading underscores allow you to immediately recognize the intent of such functions, but more importantly, if you change a function from non-external to external (including public) and rename it accordingly, this forces you to review every call site while renaming. This can be an important manual check against unintended external functions and a common source of security vulnerabilities (avoid find-replace-all tooling for this change).
This is observed in the following functions
Address::isContract
GenerateAddress::generateMakerAddress
GenerateAddress::generateOfferAddress
GenerateAddress::generateStockAddress
GenerateAddress::generateMarketPlaceAddress
RelatedContractLibraries::getCapitalPool
RelatedContractLibraries::getSystemConfig
RelatedContractLibraries::getPerMarkets
RelatedContractLibraries::getDeliveryPlace
RelatedContractLibraries::getCapitalPool
RelatedContractLibraries::getTokenManager
Manual Code Review: Analyzing the contract code directly.
Static Analysis Tools: Slither - https://github.com/crytic/slither
Refactor the functions to include an underscore prefix, to comply with the Solidity convention.
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.