The trigger_demand() function in CustomerEngine.vy simulates customer demand, which includes a random chance of success based on the company's reputation.
The "randomness" is generated using block.timestamp and block.number.
Since both block.timestamp and block.number are public blockchain variables, they can be predicted and manipulated by miners or sophisticated attackers.
Likelihood: Low
The attack requires a miner or a sophisticated attacker to front-run the transaction and calculate the exact outcome of the sale before it is executed. While possible, the economic incentive for this specific attack is low.
Impact: Low
The impact is limited to the outcome of a single sale, allowing an attacker to guarantee a successful sale when the reputation is low, or avoid a transaction that would fail. No funds are directly at risk.
A miner can calculate the exact random_number before including the transaction in a block.
If the attacker_random is greater than the success_probability, the attacker can choose not to submit the transaction, saving gas.
For on-chain randomness, it is recommended to use a more secure solution like Chainlink VRF or a commit-reveal scheme.
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.