NFTBridge
60,000 USDC
View results
Submission Details
Severity: low
Invalid

Declared and not used error `Starklane::CollectionMappingError` should be reviewed

Summary

The custom error Starklane::CollectionMappingError is declared but never used. It is advisable to review it to determine if it should be implemented, or if it should be commented out or deleted.

Vulnerability Details

In the line L20 of the contract Bridge.sol it is noted that the error CollectionMappingError is declared as follows:

Bridge.sol#L20

error CollectionMappingError();

The name suggests that it may be intended to handle errors related to mapping collections. Some possible functions where this error might be relevant are:

Bridge.sol#L368-L375

function setL1L2CollectionMapping(
address collectionL1,
snaddress collectionL2,
bool force
) external onlyOwner {
_setL1L2AddressMapping(collectionL1, collectionL2, force);
emit L1L2CollectionMappingUpdated(collectionL1, snaddress.unwrap(collectionL2));
}

Bridge.sol#L340-L356

function _whiteListCollection(address collection, bool enable) internal {
if (enable && !_whiteList[collection]) {
bool toAdd = true;
uint256 i = 0;
while(i < _collections.length) {
if (collection == _collections[i]) {
toAdd = false;
break;
}
i++;
}
if (toAdd) {
_collections.push(collection);
}
}
_whiteList[collection] = enable;
}

Impact

This issue can lead to inadequate error handling and less informative error reporting, potentially obscuring issues and complicating maintenance. It may also indicate incomplete functionality.

Tools Used

Manual review

Recommendations

It is advisable to review the custom error Starklane::CollectionMappingError to determine if it needs to be implemented, commented out, or removed.

Updates

Lead Judging Commences

n0kto Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational / Gas

Please, do not suppose impacts, think about the real impact of the bug and check the CodeHawks documentation to confirm: https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity A PoC always helps to understand the real impact possible.

Support

FAQs

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