Helper functions like encodeTokenId
and decodeTokenId
are declared public pure
in the FestivalPass
contract.
According to SoloDit/Cyfrin and Solidity best practices, marking utility functions that are only ever called externally as external
can save gas by avoiding internal memory copying of parameters, especially when using arrays or large calldata.
Likelihood:
Pure helper functions are frequently invoked by external tooling, UI, and off-chain scripts.
While they work correctly as public
, they could be marked external
for improved efficiency if they are never called internally.
Impact:
Annual gas savings are marginal (0.3% per call), as noted in SoloDit’s gas optimization guide reddit.com+15cyfrin.io+15soliditylibraries.com+15.
Total cost savings are minimal but easy to implement with no risk.
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.