Core Contracts

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

Redundant Batch Minting State Variables and Documentation Mismatch

Summary

The RAACNFT contract contains state variables and functions related to batch minting functionality that are not implemented. This creates a discrepancy between the contract's implied functionality, documentation, and actual implementation. The presence of unused code leads to unnecessary gas consumption and potential confusion for integrators.

Vulnerability Details

  • Unused State Variable and Functionality:

    • The contract defines a currentBatchSize state variable initialized to 3 and includes the addNewBatch(uint256 _batchSize) function to modify it.

    • There is no implementation for actual batch minting, despite documentation implying its availability.

  • Documentation and Interface Inconsistency:

    • The official documentation suggests that batch minting is supported.

    • The contract’s observable interface, however, only implements single-token minting through the mint(uint256 _tokenId, uint256 _amount) function.

  • Potential Gas Waste and Confusion:

    • Maintaining unused state variables leads to unnecessary gas consumption over the contract's lifetime.

    • The discrepancy may result in integrators building systems based on incorrect assumptions about NFT batch processing capabilities.

  • Error Handling and Limits:

    • While functions like addNewBatch include minimal input validation (rejecting zero values), there is no guard against potential unbounded increases.

    • The contract lacks formal definitions and events related to batch operations, further obfuscating intended functionality.

Impact

  • Unnecessary state variables and functions complicate the codebase, increasing maintenance overhead and the potential for future errors.

  • Operational Efficiency:

    • Users are forced to mint NFTs one at a time, leading to higher cumulative gas costs when minting multiple tokens.

  • Integration Risks:

    • Third-party systems and integrators may rely on the documentation to support batch operations, resulting in failed integrations or unexpected behavior.

Tools Used

Manual review

Recommendations

  1. Short-Term Remediation:

    • Remove Unused Code:
      Remove the currentBatchSize variable and addNewBatch function if batch minting is not intended to be supported.

    • Documentation Update:
      Update the documentation to accurately reflect the contract's functionality, clarifying that batch minting is not currently implemented.

  2. Long-Term Remediation:

    • Implement Batch Minting Functionality:
      If batch minting is a desired feature, implement a robust batchMint(uint256[] calldata tokenIds, uint256 totalAmount) function that:

      • Validates the number of token IDs against a defined batch size (with maximum limits).

      • Computes the total price for the entire batch and validates the provided payment.

      • Executes minting of multiple NFTs in a single transaction and processes any necessary refund.

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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