Description: The function attendPerformance
gives the possibility to the user to attends a performance with the following code.
When the user attend the performance the mapping hasAttended is set to true so that the user can't come back again. and then beatToken are minted
The problem is that an user can create multiple account and pass their nft to the others accounts that his created over and over again.
Impact:
If an user can pass their nft ticket to anyone after attending to performance and they can call attendPerformance function, an user can create multiple adddresses at once and pass his nft ticket to all the account that his created to earn more BeatToken that he/she suppose to, causing a minting inflation of the beatToken that could be reuse for anything, selling them for example.
Proof of Concept:
Put the following code into the test file :
Recommended Mitigation:
The developper can do the following to resolve the problem.
Create a mapping like that : mapping(uint256 => mapping(address => uint16)) public hasAttended
Create 3 constant :
uint16 constant NOTREGISTERED = 0;
uint16 constant HASNOTINTENDED = 1;
uint16 constant HASINTENDED = 2;
Create a function register before attending
4. add to the function attendPerformance thefollwing lines:
require(hasAttended[performanceId][msg.sender] != NOTREGISTERED && hasAttended[performanceId][msg.sender] != HASINTENDED)
hasAttended[performanceId][msg.sender] = HASINTENDED
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.