The reward values initialized in the contract constructor differ from those used during contract execution. This inconsistency can lead to confusion among users, potential financial discrepancies, and unintended reward distributions
In the contract, reward values are initialized within the constructor as part of a rewardPool. However, these values are later used differently in other parts of the contract, such as the openBox function, which results in inconsistencies between the expected and actual rewards distributed.
For instance, the contract initializes reward values in the constructor as follows:
However, when distributing rewards in the openBox function, the values used differ;
The key inconsistency is between the initialized values (0.5 ether for Gold Coin and 0.25 ether for Silver Coin) and the actual values distributed (1 ether and 0.5 ether) respectively.
If the rewards are higher than intended, the contract could unintentionally favor users, resulting in more value being distributed than the contract was designed to handle. Conversely, if lower rewards are distributed, users may feel they are being shortchanged.
Manual Review
The reward values initialized in the constructor should match the values distributed in the openBox function and any other parts of the contract where rewards are issued. Consistent use ensures that users receive exactly what is outlined during contract deployment.
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.