Open hats-bug-reporter[bot] opened 5 months ago
Correct me If I'm wrong, but that's how it's supposed to work.
Each epoch, a user gets his new aoTAP with his eligible amount in participate()
.
The user can exercise to his convenience with partial amounts, the logic you mentioned above is just logic accounting to keep track of what was previously exercised.
Github username: @Emedudu Twitter username: -- Submission hash (on-chain): 0x8cbb31b6b61e73f909da1bbf1d068dd2b8204b6bc8b8dec33ebb0dbb1d7277f8 Severity: high
Description: Description\ Since
epoch
is used inaoTAPCalls
mapping, participants will be able to withdraw their eligible amount each time a new epoch starts.Attack Scenario\ When a user(who was prelisted for the first phase) calls AirdropBroker#participate, _participatePhase1 gets called:
An aoTAP token, which contains the eligible amount to claim, is minted to the user.
User can immediately call
AirdropBroker#exerciseOption
to claim the "eligible amount" for that his aoTAP tokenID.The issue is that the user can claim this "eligible amount" each time a new epoch starts for as many times as possible. This is because of what is done in
exerciseOption
function:Since epoch is included in the aoTAPCalls mapping, participants wiil be able to claim the full eligible amount each time a new epoch starts.
This may also cause payment issues for participants of later phases as earlier participants have claimed more than they should.
Attachments
Proof of Concept (PoC) File
Revised Code File (Optional)
cachedEpoch
should not be used in the aoTAPCalls mapping