The TimeWeightedAverage library's calculateTimeWeightedAverage function is incorrectly marked as public when it should be internal since it's part of a library. This incorrect visibility could lead to confusion and potential misuse of the library functions.
The issue exists because:
Libraries are meant to be used by other contracts
Library functions marked as public suggest they can be called directly
This violates the intended usage pattern of library functions
Code Clarity: Creates confusion about how the library should be used
Gas Costs: Public functions in libraries require additional deployment overhead
Maintenance Issues:
Makes it harder to refactor the library
Creates unclear boundaries between library and contract code
May lead to incorrect implementations by other developers
Documentation Mismatch: Inconsistent with standard library implementation patterns
Change Visibility to Internal
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.