Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: low
Invalid

Logic of code execution in `Aidrop::claim` function differs from the function's natspec.

Summary

The code implementation of the Airdrop::claim function does not adhere to the specification provided in the natspec, which says: "Every person who have a Soulmate NFT token can claim 1 LoveToken per day.". However the test_Claim function in AirdropTest.t.sol file, proves that, actually any soulmate can claim more than 1 love token per day:

function test_Claim() public {
_mintOneTokenForBothSoulmates();
// Not enough day in relationship
vm.prank(soulmate1);
vm.expectRevert();
airdropContract.claim();
vm.warp(block.timestamp + 200 days + 1 seconds);
vm.prank(soulmate1);
airdropContract.claim();
assertTrue(loveToken.balanceOf(soulmate1) == 200 ether);
vm.prank(soulmate2);
airdropContract.claim();
assertTrue(loveToken.balanceOf(soulmate2) == 200 ether);
}

Impact

Low: There is a mismatch between the function's code logic and natspec.

Tools Used

Manual Review

Recommendations

Consider revising the function's logic, to a one token per day limit.

Updates

Lead Judging Commences

0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.