In case of minting 1 or multiple tokens with a token ID > or equal to 8, after using the function burnBatch() or burnBatchMultiple() to burn those tokens, sendProfit() will always transfer the tokens to the contract instead of the creator as it is supposed to.
https://github.com/Cyfrin/2024-11-one-world/blob/main/contracts/dao/tokens/MembershipERC1155.sol
=> mint() authorizes minting NFTs with any ID number we want, there is no restriction.
(Note: Even if we could assume that it was supposed to mint only from ID=0 to ID=6 (7 IDs) in regard to the ShareOf() function that only takes in consideration from ID=0 to ID=6)
=> burnBatch() and burnBatchMultiple() don't erase all the NFTs as they are supposed to do, only the 8th first IDs, from ID=0 to ID=7. Then, if more than ID number 7 are minted, TotalSupply will always be != 0 after using burnBatch() and burnBatchMultiple() because of the for loops, looping only from ID=0 to ID=7.
Then if ID(s) minted is/are > or equal to 8, all IDs > 7 will not be burned, resulting in a TotalSupply always > 0.
==> sendProfit() will always transfer tokens to the contract instead of the creator in case we mint tokens with IDs >= 8 and try to burn them using burnBatch() or burnBatchMultiple() afterward.
Tokens should be transfered to the creator but they won't be.
Tokens transfered to the wrong address when executing sendProfit() in those specific conditions.
Manual review, Github.
Cap the minting with a limit/maximum ID and use this limit ID for the loop in the burning process of burnBatch() and burnBatchMultiple().
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.