The pizza_drop::airdrop
module is designed to randomly assign each registered user between 100 and 500 APT during the registration phase. A user can then claim this amount from the resource account.
However, the code treats these values as octas (the smallest denomination of APT, 1 APT = 100_000_000 octas
) without scaling them properly. This means that instead of receiving 100–500 APT, users only receive 100–500 octas (≈0.000001–0.000005 APT).
The bug originates in the get_random_slice
function, which assigns random_amount
directly to the user’s claim amount:
The comment claims "100–500 APT," but the code delivers "100–500 octas," which is 1/100,000,000th of the intended value.
Likelihood: High
The code path is exercised every time a user registers.
All users are affected; no special conditions required.
Impact: Medium
Users receive effectively worthless payouts (~fractions of a cent) instead of full APT.
The contract owner may mistakenly fund far less than needed, believing payouts are in APT.
This is a severe economic bug: the contract fails its core purpose as an airdrop.
Convert the value to octas (10^8) in aptos tests will allow to catch the bug
Scale the payout by 1e8
to correctly express APT in octas:
Additionally, update the comment to clarify units and avoid confusion.
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.