Trick or Treat

First Flight #27
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Invalid

ETH Locking on Pending Purchases

Summary

When users face the double-price scenario and do not complete the transaction via resolveTrick(), their paid ETH remains locked in the contract.

Vulnerability Details

  • Function: resolveTrick()

  • Code Reference:

mapping(uint256 => uint256) public pendingNFTsAmountPaid;

The pending ETH associated with a partially paid trick is stored in pendingNFTsAmountPaid, but there's no mechanism for users to reclaim this ETH if they abandon the transaction.

Impact

Funds could be permanently locked in the contract, negatively affecting both users and the contract's liquidity.

Tools Used

Manual Code Review

Recommendations

Implement a timeout for users to claim their pending NFTs or refunds:

mapping(uint256 => uint256) public pendingNFTTimestamp; // Store timestamp of pending NFTs
function resolveTrick(uint256 tokenId) public payable nonReentrant {
require(block.timestamp < pendingNFTTimestamp[tokenId] + 7 days, "Pending trick expired");
// Continue with logic...
}
Updates

Appeal created

bube Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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