Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: high
Valid

Locked Funds in RAACNFT::mint function

Description

The RAACNFT contract allows users to mint NFTs by paying the house price in RAAC tokens. While the contract correctly handles the initial payment and minting, it lacks a mechanism to recover the locked funds when a user wants to exit their position by burning their NFT.

function mint(uint256 _tokenId, uint256 _amount) public override {
uint256 price = raac_hp.tokenToHousePrice(_tokenId);
if(price == 0) { revert RAACNFT__HousePrice(); }
if(price > _amount) { revert RAACNFT__InsufficientFundsMint(); }
@> // Tokens are transferred to contract and locked
@> token.safeTransferFrom(msg.sender, address(this), _amount);
_safeMint(msg.sender, _tokenId);
if (_amount > price) {
uint256 refundAmount = _amount - price;
token.safeTransfer(msg.sender, refundAmount);
}
emit NFTMinted(msg.sender, _tokenId, price);

Risk

Likelihood: High

  • Users regularly mint NFTs to participate in the protocol

  • The locked funds accumulate with each mint operation

  • The protocol's treasury cannot access these funds

Impact: High

  • User funds are permanently locked in the contract

  • Users cannot exit their positions and recover their initial investment

  • Protocol's treasury cannot receive its share of the fees

  • Repair fund cannot receive funds for future house maintenance

Recommendations

Implement a mecanism to allow a user to burn its NFT and

The protocol needs both mechanisms:

  • transfer fund distribution during mint (to Treasury)

  • a burn function allowing users to exit their positions.
    This ensures proper fund flow and prevents tokens from being locked in the contract.

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

RAACNFT collects payment for NFT minting but lacks withdrawal functionality, permanently locking all tokens in the contract

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

RAACNFT collects payment for NFT minting but lacks withdrawal functionality, permanently locking all tokens in the contract

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.