A flaw has been identified in the trickOrTreat
function within the smart contract, specifically in the implementation of the half-price discount mechanism for NFT minting. Users eligible for this discount cannot utilize it properly, which may result in unintended overcharges, affecting user satisfaction and platform trust.
The trickOrTreat
function utilizes a pseudo-random number generator to determine pricing adjustments for treats, including a potential half-price discount. However, the current logic does not correctly apply the discount when the random number matches the condition for a half-price offer. As a result, users may be charged the full price even when a discount is due, or face confusion regarding the actual payment required. This could lead to overpayment or missed discounts, adversely affecting the user experience.
The issue leads to:
Financial Discrepancies: Users who qualify for the half-price discount (1/2 multiplier) are not able to receive the discounted rate. This could cause financial losses and potential dissatisfaction among users.
Reduced Trust in Platform: The random reward mechanism is inconsistent, leading to a perception of unfairness and potentially damaging the reputation of the platform.
Manual Code Analysis
To address this issue, update the function logic to properly handle the half-price scenario. Ensure that users who receive a 1/2
cost multiplier are charged the appropriate discounted amount.
This modification ensures that each price adjustment scenario is handled correctly, allowing users to benefit from the intended discounts or price increases.
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.