get_random_slice()
should not be psuedo random depending on block time for randomness.
Any user is able to call get_random_slice() at a certain block time in their favour.
Likelihood:
A user calls get_random_slice()
when the current time in microseconds % 401 at a good maximum.
Impact:
Any user is able to bias get_random_slice() in their favour to recieve a high amount of APT PizzaDrop near 500 APT.
On lines 47 to 52, a user waits until the current time in microseconds % 401 at a good maximum before calling get_random_slice()
.
Run with:
Output:
Don't use the block timestamp for randomness.
Use the Aptos Randomness API instead.
The `get_random_slice` function should only be called by the owner via the `register_pizza_lover` function. Also, the `owner` is trusted and will not choose a specific time for a new user to register. Therefore, I disagree with the claim of most reports in this group that an attacker can manipulate the random number of pizza slices. But I agree with the root cause of the reports in this group, that the random distribution is not completely random.
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.