The trickOrTreat
function uses strict equality checks (==
) to determine pricing tiers based on random numbers. This implementation is problematic as it creates an overly precise comparison that could fail to evaluate as true
due to minor deviations (such as rounding or unexpected extra contributions), potentially causing users to miss out on intended price discounts or multipliers.
Issues here:
Strict equality (==
) is used to check for exact values 1
and 2
No range checks or fallback conditions
Single point of failure in price determination
Assumption that random number will always fall exactly on these values
The strict equality check in the trickOrTreat
function introduces potential issues in pricing determination for users. Since the function relies on the random
variable precisely matching 1
or 2
for discounted or increased pricing, any deviation results in the normal pricing tier by default. This precision may lead to missed discounts.
Manual Review
Slither
Foundry
The solution might be this as follow:
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.