Using private
rather than public
for constants, saves gas
If needed, the values can be read from the verified contract
source code, or if there are multiple values there can be a
single getter function that
returns a tuple
of the values of all currently-public constants.
Saves 3406-3606 gas in deployment gas due to the compiler
not having to create non-payable getter functions for deployment
calldata, not having to store the bytes of the value outside of
where it's used, and not adding another entry to the method ID table.
Link to code - https://github.com/Cyfrin/2023-07-beedle/tree/main/src/Fees.sol
Link to code - https://github.com/Cyfrin/2023-07-beedle/tree/main/src/Staking.sol
Code Review
Use private
rather than public
for constants
NeoCrao
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.