The claimNft()
function in the TokenDivider contract contains a critical vulnerability where ERC20 tokens are burned before confirming the NFT transfer. This sequencing error can lead to a permanent loss of user tokens if the NFT transfer fails due to various reasons, leaving users with no compensation for their burned tokens.
in the Current Vulnerable Implementation, according to the order of operations in the claimNft() function. Tokens are burned immediately without ensuring the NFT transfer succeeds, creating a risk of permanent loss in scenarios where the transfer encounters unexpected failures.
The burn operation occurs before confirming the successful NFT transfer, Network or storage issues could cause the transfer to fail unexpectedly and there is no mechanism to revert the token burn if the NFT transfer fails.
Using real world scenario case,
Alice owns all fractional tokens for an NFT
She attempts to claim the full NFT
Tokens are immediately burned
NFT transfer fails due to:
Contract no longer owning the NFT or
Unexpected blockchain condition
Alice permanently loses her tokens WITHOUT receiving the NFT
Users can lose 100% of their token value
Potential complete loss of fractional NFT investment
Significant financial risk for all platform users
Reordering operations within the claimNft() function can eliminate this vulnerability. The NFT transfer must occur successfully before the ERC20 tokens are burned.
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.