The RAACNFT contract allows users to mint NFTs by paying with an ERC20 token. However, there is no function to withdraw the collected tokens from the contract. This results in permanently locked funds, rendering the contract incapable of utilizing the tokens for any purpose.
mint Function (Tokens are Collected but Not Withdrawable)In the above function, ERC20 tokens are transferred into the contract upon minting an NFT. However, there is no function to withdraw these tokens, effectively locking them inside the contract.
Without a withdrawal mechanism, all ERC20 tokens sent to the contract remain inaccessible. This can lead to financial losses, particularly if the contract accumulates a large balance of tokens that are meant to be used for operations, rewards, or transfers to other addresses.
Introduce a function to allow the contract owner to withdraw accumulated ERC20 tokens. Below is a suggested implementation:
This function:
Ensures only the contract owner can withdraw funds.
Prevents sending funds to the zero address.
Checks if the contract has enough balance before withdrawing.
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.