The function MembershipFactory::upgradeTier() in a sponsored DAO allows users to burn 2 NFTs of a tier to mint 1 NFT of a better tier.
https://github.com/Cyfrin/2024-11-one-world/blob/main/contracts/dao/MembershipFactory.sol#L155-L161
However, the function lacks checks on the maximum supply of the better tier, allowing users to bypass the intended supply limits set in the tier's amount value.
Assume the following:
Alice has 2 tier 5 NFTs
Alice has 2 tier 4 NFTs
Tier 4 amount is 2 (meaning the maximum number of tier 4 NFTs is already reached)
When Alice calls upgradeTier(), only 2 requirements are enforced which have nothing to do with the maximum number of NFTs.
The IMembershipERC1155(daoMembershipAddress).mint() call will execute correctly meaning there will be 3 tier 4 NFTs while the maximum number is 2.
The maximum amount of token that can be minted for a tier can be exceeded in a sponsored DAO.
Add a check to ensure the mint operation doesn't exceed the maximum supply for the tier.
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.