If a user has to pay 2x the cost of treat, the NFT is minted to the contract and if the user wants the NFT he has to call resolveTrickfunction. This can lead users paying only gas price for the NFT and never calling resolveTrickfunction, therefore flooding the contract with NFTs which will be forever there.
The problem lies in these lines of the function trickOrTreat:
As we can see the NFT is minted to the contract and the user paid partial or no amout of the cost.
Flooding the contract with NFTs
foundry
Mint the NFT in the resolveTrickfunction instead.
Remove the following lines from trickOrTreatfunction:
And modify function resolveTrickto call mintTreataccordingly.
The protocol can work correctly with more than 20000 tokens in it. It is informational.
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.