SantasList declares a public constant that documents the intended cost of buying a present:
SantaToken implements the two functions that enforce that cost — mint (issued to EXTRA_NICE users as their reward) and burn (collected when anyone calls buyPresent). Both hardcode 1e18 instead of referencing the constant:
PURCHASED_PRESENT_COST is never referenced anywhere in the codebase. It is dead code. The actual price enforced on-chain is 1e18 — exactly half the documented amount.
A — Presents are bought at half the documented price.
buyPresent calls i_santaToken.burn(presentReceiver), which burns 1e18. The protocol documentation implies the cost should be 2e18. Any caller can buy a present NFT by consuming only 1e18 SantaTokens.
B — An EXTRA_NICE user can immediately spend their entire reward on a present.
collectPresent mints 1e18 SantaTokens to EXTRA_NICE users. Because burn also consumes exactly 1e18, a user's entire reward covers exactly one buyPresent call in the same session. If the documented 2e18 cost were enforced, a single collection reward would be insufficient — users would need to accumulate tokens across two collection cycles before affording a present.
C — The public constant misleads integrators and auditors.
PURCHASED_PRESENT_COST is public, meaning external contracts and front-ends can query it. Any system that reads this constant to determine the token cost will see 2e18 but observe 1e18 being burned on-chain — a semantic inconsistency that can cause off-chain accounting errors.
Added to test/unit/SantasListTest.t.sol:
Result: An EXTRA_NICE user collects 1e18 tokens and immediately uses them to buy a second NFT, paying 1e18 — half of PURCHASED_PRESENT_COST. The constant is never consulted.
Determine the intended cost and make the code and constant agree. Two valid resolutions:
Option A — Enforce the documented 2e18 cost (presents cost more, rewards cover half):
Option B — Correct the constant to match the implemented 1e18 cost:
Option A preserves the documented economic design (presents cost 2e18) and makes the constant live. Option B is simpler if 1e18 was always the intended price. Either way, hardcoded magic numbers in mint and burn should be replaced with the constant so future changes to the price only require editing one location.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.