The RAACNFT contract lacks a mechanism to withdraw ERC20 tokens that accumulate in the contract during the minting process. This oversight creates a permanent lock of funds in the contract, preventing the protocol from accessing or managing these assets.
During the minting process of RAACNFT tokens, users send ERC20 tokens (likely crvUSD) to the contract as payment for the NFTs. The contract correctly handles the initial payment and any immediate refunds for overpayment, but it does not implement any functionality to withdraw the collected payments. This creates a permanent accumulation of funds in the contract with no way to access them.
Vulnerable Code
The contract receives and holds the price amount of tokens but provides no mechanism to withdraw these accumulated funds.
To demonstrate this issue:
User A mints an NFT by sending 1000 tokens
The NFT costs 900 tokens
User A receives a 100 token refund
The remaining 900 tokens are permanently locked in the contract
This process repeats with each mint, continuously accumulating locked tokens
This vulnerability has several significant implications:
Protocol Revenue Lock: All revenue generated from NFT minting becomes permanently locked in the contract.
Financial Inefficiency: The protocol cannot utilize these funds for operational expenses or protocol improvements.
Emergency Situations: In case of critical issues, there's no way to rescue the locked funds.
Business Operations: The inability to access collected fees could impact the protocol's ability to maintain and service the real-world properties these NFTs represent.
Manual Review
Implement a secure withdrawal mechanism that allows authorized parties to access the accumulated tokens.
Here's a suggested implementation:
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.