Internal utility functions should be marked as public
when only called by other contract functions to maintain proper access control
The get_random_slice()
function is marked as public entry
but is only used internally by claim_slice()
, allowing unnecessary external calls
Likelihood:
External actors can directly call get_random_slice()
without going through proper claim mechanics
Direct calls consume gas and provide no meaningful functionality to external callers
Impact:
Unnecessary gas expenditure for external callers who invoke the function directly
Potential confusion about contract interface and intended usage patterns
The public entry
modifier makes the function callable by external transactions, but the function only returns a random number without any state changes or meaningful operations. External callers waste gas calling a function that provides no benefit outside the internal contract logic.
Removing the entry
modifier prevents direct external calls while maintaining internal accessibility. The public
visibility allows claim_slice()
to call the function internally, but external transactions cannot invoke it directly. This follows the principle of least privilege by restricting function access to its intended usage pattern.
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.