The RAACNFT contract allows users to mint NFTs by transferring ERC20 tokens to the contract. However, the contract lacks a mechanism to withdraw these funds, leading to lockup of assets.
The RAACNFT::mint function transfers ERC20 tokens from the user to the contract during the NFT minting process. However, the contract does not provide any functionality to withdraw these funds. As a result, the tokens remain locked in the contract indefinitely, making them inaccessible to the protocol or its administrators.
The issue lies in the following line of the mint function:
While the contract collects ERC20 tokens during the minting process, there is no function to retrieve these tokens. This oversight results in:
Asset Lockup: Funds transferred to the contract cannot be accessed or utilized by the protocol.
Operational Inefficiency: The protocol cannot manage or redistribute collected funds, leading to inefficiencies in financial operations.
User Mints NFT: A user mints an NFT by transferring 100 ERC20 tokens to the contract.
Funds Locked: The 100 ERC20 tokens remain in the contract with no way to withdraw or utilize them.
Financial Loss: The protocol cannot access these funds, leading to potential financial losses.
Asset Lockup: Funds transferred to the contract are permanently locked, making them inaccessible to the protocol.
Financial Loss: The protocol cannot utilize or redistribute collected funds, leading to potential financial losses.
Manual Code Review: The vulnerability was identified through a manual review of the RAACNFT contract.
Foundry
Implement Withdrawal Mechanism:
Add a function to allow the contract owner or authorized administrators to withdraw collected ERC20 tokens.
Ensure that only authorized entities (e.g., the contract owner or a dedicated admin) can withdraw funds.
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.