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

Approve not required in buyPresent

Summary

For some reason, the documentation states that users must first approve tokens to SantasList, but this is not necessary as it internally uses the burn function, causing confusion about whether the desired result is actually achieved.

Vulnerability Details

There are various issues in this function, but it seemed appropriate to address this inconsistency in a separate issue.

Impact

Possible unexpected results.

POC

function testBuyPresentWithoutApprove() external {
vm.startPrank(address(santasList));
santaToken.mint(user);
vm.stopPrank();
vm.startPrank(user);
santasList.buyPresent(user);
vm.stopPrank();
}

Tools Used

Foundry

Recommendations

Review the implementation to clarify any confusion. Ensure that the documentation accurately reflects the behavior of the buyPresent function and consider updating it accordingly.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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