Steemhunt/mint.club-v2-contract

Audit: distribution Claimed check

Closed this issue · 2 comments

If you look at the claim function in MerkleDistributor.sol,
스크린샷 2023-12-09 오후 4 18 19
There is a part like the above.

If distrubution.walletCount is 2, when a claim is made once, isClaimed becomes true, so revert occurs at line 107, so the check at line 108 is useless. And the user will not be able to make more claim.
Therefore, revert using isClaimed does not seem to be necessary here.

if (distribution.isClaimed[msg.sender]) revert MerkleDistributor__AlreadyClaimed();

This line checks if msg.sender has already claimed the airdrop.

if (distribution.claimedCount >= distribution.walletCount) revert MerkleDistributor__NoClaimableTokensLeft();

This line checks if the total number of claims has reached the maximum wallet count (claimable count) for this distribution. For example, if the airdrop targets 100 users (wallet count) and 100 users have already claimed the airdrop, it will revert at this line.

I guess you might have misunderstood?

Yes, that's right, I misunderstood.
thank you for telling me. !