The upgradeTier
function in MembershipFactory
contract does not validate whether the source tier's minted
value is sufficient for burning tokens. While this does not lead to a security vulnerability due to ERC1155's built-in balance checks, it highlights a potential inconsistency in tier accounting validation.
The upgradeTier
function in MembershipFactory
contract processes tier upgrades by burning tokens from a source tier without validating the tier's minted
value:
Before burning tokens, it would be more consistent to verify tiers[fromTierIndex].minted >= 2
even though:
The ERC1155's burn operation provides inherent safety:
The operation will safely revert if the user's balance is insufficient, making this an issue of validation consistency rather than security.
This represents a pattern inconsistency when compared with the diligent validation in joinDAO
:
The lack of explicit tier minted value validation has minimal practical impact:
No Security Risk:
ERC1155's built-in balance checks prevent any unauthorized token burns
The operation will safely revert if a user attempts to burn more tokens than they own
No possibility of token theft or unauthorized operations
Code Pattern Inconsistency:
Different validation approaches between joinDAO
and upgradeTier
functions
Could make future maintenance and auditing more challenging
May cause confusion about validation responsibilities between factory and token contracts
Developer Experience:
Error messages are less specific (ERC1155 balance errors vs. clear tier validation messages)
Makes debugging slightly more difficult as errors come from token contract rather than business logic layer
The impact is purely organizational and relates to code quality rather than security or functionality.
For consistency with other validation patterns, consider adding tier minted value validation:
This change would:
Maintain consistent validation patterns across the codebase
Provide clearer error messages at the business logic layer
Make validation responsibility explicit in the factory contract
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.