The function airdrop::claim_pizza_slice
has an assert that checks if there is sufficiency balance to give the pizza lovers their slices.
The business logic flaw here is that the owner gives claim pizza that his/her doesn't have and when the pizza lovers want to take their parts, they will see that there is not sufficient funds they will need to call the owner for the explanation.
No money lost but a potentially bad user experience.
You can create the following scenario :
Owner funded the pizza pool for 10000 APT.
50 users want to register
the owners register 50 users
The average claim is 300.
50 x 300 = 15000
approximately 33 users will have their claim and the rest will have the message E_INSUFFICIENT_FUND
The owner will need to calculate the right amount of APT to refund the pool.
A better approach is to change the position of the check directly in the function airdrop::registers_pizza_lover
, like below :
If the owner can't add another pizza lover because of the check, he will know at least how much he needs to refund the pool for this person to be registered.
With that the owner will know for sure that everyone registered will have their own slices.
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.