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

Unused custom error in `Bridge.sol`

Summary

The Bridge.solcontract contains a custom error CollectionMappingError that is not being utilized in any function and error handling. This indicates a possible oversight in the implementation of error handling mechanisms.

Vulnerability Details

Solidity allows for the definition of custom errors to efficiently handle exceptions and provide clear, gas-efficient error messages. The unused custom error suggests that certain error conditions might not be appropriately addressed within the contract's logic or that there is redundant code that unnecessarily increases the contract's complexity and size.

Contract: Bridge.sol

Link: https://github.com/Cyfrin/2024-07-ark-project/blob/273b7b94986d3914d5ee737c99a59ec8728b1517/apps/blockchain/ethereum/src/Bridge.sol#L20C1-L20C32

Snippet:

error CollectionMappingError();

Impact

  • The intended error handling using the custom error may not be functioning as designed, which could lead to inadequate feedback on transactions or failure conditions, potentially complicating debugging and user interaction.

Tools Used

Recommendations

  1. It is recommended to review the Bridge.sol contract to determine if the unutilized custom error was intended for certain conditions that are currently not handled. In this case, implement the error handling where appropriate.

  2. If the error is indeed unnecessary, it should be removed to optimize the contract's size and clarity.

Updates

Lead Judging Commences

n0kto Lead Judge 11 months 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.