Core Contracts

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

Inability to Reduce Batch Size After Increasing

Summary

The addNewBatch function allows the protocol to increase the currentBatchSize but lacks any mechanism to decrease it. This one-sided adjustment could lead to unintentional or excessive batch sizes without a way to revert them.

Vulnerability Details

function addNewBatch(uint256 _batchSize) public override onlyOwner {
if (_batchSize == 0) revert RAACNFT__BatchSize();
currentBatchSize += _batchSize;
}

Issue

  • Once the batch size is increased, there is no function to reduce it.

  • May result in oversized batches that exceed intended limits.

Impact

  • Inflexibility in contract management, hindering batch size adjustments.

  • Potential operational issues if large batch sizes become problematic.

Tools Used

Manual code review.

Recommendations

Implement a reduceBatchSize function with appropriate checks to prevent underflow and ensure valid batch sizes:

function reduceBatchSize(uint256 _batchSize) external onlyOwner {
require(_batchSize > 0, "Invalid batch size");
require(_batchSize <= currentBatchSize, "Reduction exceeds current batch size");
currentBatchSize -= _batchSize;
}

This addition provides flexibility and improves contract maintainability.

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 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.

Give us feedback!