The attendPerformance function is intended to reward a user for attending a specific performance. The contract attempts to prevent a user from attending the same performance twice.
The attendance tracking mechanism uses a mapping hasAttended[performanceId][msg.sender]. This check is based only on the caller's address (msg.sender). If a user attends a performance and then transfers their pass to another user, the new user can also attend the same performance because their address is not yet in the hasAttended mapping. This allows a single pass to claim rewards multiple times for the same event.
Likelihood:
A user buys a pass, attends a performance, and then sells or transfers the pass on a secondary market to another user before the performance ends.
Impact:
The protocol mints more BEAT tokens than intended, leading to inflation and devaluing the token for all holders.
It creates an unfair economic advantage for users who can coordinate to transfer passes during a performance window, undermining the fairness of the reward system.
The current attendance tracking mechanism is insufficient as it is tied to the user's address and not the pass itself. A robust solution requires a design change to link attendance to a unique identifier for each pass. Since ERC1155 treats passes of the same type as fungible, this is non-trivial.
A complete fix would likely involve a significant re-architecture, such as treating each pass as a unique NFT (ERC721) to allow for individual tracking. However, a partial mitigation can be implemented to cap the potential damage:
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.