The mint function incorrectly assumes that when amountToMint is 0, the mint operation is not the first mint for a user. This can lead to logical inconsistencies in tracking user balances and minting events.
The function includes the following logic:
If amountToMint is 0, the function immediately returns (false, 0, 0, 0), indicating that the operation is not the first mint.
However, if this is the first interaction of the onBehalfOf user with the contract, it should still be recognized as their first mint.
This incorrect assumption could lead to issues in subsequent logic that relies on isFirstMint.
The first mint for a user may not be properly recorded, leading to inconsistencies in reward distributions or future minting logic.
Manual code review
Modify the First Mint Check: Ensure that isFirstMint is set based on the actual user balance before returning for amountToMint == 0.
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.