In the resolveTrick
function of the SpookySwap
contract, after successfully transferring an NFT from the contract to the user, the contract fails to emit the Swapped
event. This omission can lead to off-chain systems and users not being aware of the NFT transfer, causing inconsistencies between the on-chain state and external perceptions. The lack of event emission affects user experience and the reliability of applications that rely on these events to update NFT ownership statuses.
When a user calls the resolveTrick
function to complete their purchase (after initially not paying enough during a "trick" scenario), the contract correctly transfers the NFT to the user. However, it does not emit the Swapped
event to signal this transfer. Events are crucial for off-chain applications like wallets and explorers to track token movements and update user balances.
Missing Event Emission: After transferring the NFT to the user using _transfer(address(this), msg.sender, tokenId);
, the function does not emit the Swapped
event or any equivalent event to indicate the successful transfer.
Impact on Off-Chain Systems: Off-chain services that rely on event logs to update NFT ownership will not detect this transfer, leading to outdated or incorrect information displayed to users.
User Confusion: Users may not see their newly acquired NFT in wallets or platforms immediately, causing confusion and potential mistrust in the system.
Inaccurate Off-Chain Data: Wallets, explorers, and other applications may fail to update the user's NFT holdings, as they rely on emitted events to track changes.
User Experience Degradation: Users might believe the transaction failed or is pending, leading to unnecessary support requests or negative perceptions of the platform.
Operational Integrity: The contract's reliability is undermined when standard practices like event emissions are not consistently followed.
Severity Classification: Low
While the NFT transfer occurs correctly on-chain, the missing event affects the user experience and the accuracy of off-chain data. It does not, however, lead to a loss of funds, security vulnerabilities, or critical disruptions in contract functionality.
Manual code review
Emit the Swapped
Event After NFT Transfer
Add the emit Swapped
statement immediately after the NFT is transferred to the user within the resolveTrick
function.
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.