When a user signs up, they are allowed to claim PizzaDrop
. Claiming PizzaDrop
will provide them a random amount of APT between 100 to 500 as per the documentation.
Aptos transfers in units called octas. 1 APT = 100,000,000 octas (8 decimals). When transacting on Aptos outside of normal UIs, you must pass the amount in Octas.
In the pizza_drop::get_random_slice
function, the calculation for the random_amount
incorrectly assumes the number calculated will be expressed as APT, when its established above that APT is expressed as Octas on Aptos. If we focus on the following 3 lines here
time
is expressed as epoch
format in microseconds. The calculation for the above will look like this based on the current epoch time:
This means the protocol is believed to provide the user with 233 APT when claiming their initial PizzaDrop
.
However, as expressed previously, Aptos is expressed as Octas (100,000,000 | 10^8) so the user will only receive 0.00000233 APT
, severely being underpaid on their claim.
As PizzaDrop is a core functional requirement of the Pizza Drop Protocol which all new users will utilise after signup, all users will be severely underpaid with "dust" amounts, therefore losing trust and favour in the protocol.
Likelihood: HIGH
Every user who signs up and claims PizzaDrop will be effected.
Impact: HIGH
Loss of trust with customers signing up
Heavy operational load to remediate customer issues
Immediately incident would be declared on release of Protocol to remediate core affected function
Declaration of APT/Octa should be added above the [event]
declaration section for improved code-quality and to ensure we reduce any "Magic Numbers" in our code.
And a modification to the get_random_slice
function
Aptos Tokenomics - https://aptosfoundation.org/currents/aptos-tokenomics-overview
Aptos Labs Transaction Explorer - https://explorer.aptoslabs.com/?network=mainnet
Epoch Clock - https://www.epochconverter.com/clock
APT Token - https://explorer.aptoslabs.com/coin/0x1::aptos_coin::AptosCoin/info?network=mainnet
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.