During the audit of the DAO membership contract, a critical issue was identified in the upgradeTier
function. The code does not validate whether fromTierIndex
is greater than zero before performing a decrement operation, which could lead to an underflow and unintended behavior.
The following line in the upgradeTier
function poses a risk:
Issue:
The code directly subtracts 1 from fromTierIndex
without checking if fromTierIndex
is greater than zero. If fromTierIndex
is 0, this operation will result in an underflow, causing fromTierIndex - 1
to wrap around to a very large value (2^256 - 1), which can lead to unintended consequences.
If this vulnerability is exploited, it could lead to:
Incorrect Token Minting: Users may receive tokens for a non-existent or unintended tier.
Contract Integrity Issues: The logic of the DAO membership system could be compromised, leading to confusion and loss of trust among users.
Manual code review
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.