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

Redundant code logic in `Bridge.sol`

Summary

Redundant code logic exists in the Bridge.sol contract within the depositTokens function, where there are unnecessary checks for the token type that are not required given the existing conditions.

Vulnerability Details

The function depositTokens will revert if the token type is ERC1155 as stated in this lines. there is redundant logic that checks if the token type is ERC1155 again in these lines which comes after the first condition.

Given this conditions set on the contract, the else branch will never be executed, instead there shouldnt be an if statement at all because this line will only go through if the token type is ERC721 or ERC1155.

Locations:

  • https://github.com/Cyfrin/2024-07-ark-project/blob/273b7b94986d3914d5ee737c99a59ec8728b1517/apps/blockchain/ethereum/src/Bridge.sol#L119-L128

Impact

The redundant logic does not present a security risk but contributes to unnecessary complexity in the code. Removing redundant checks can improve code readability and maintainability.

Tools Used

  • Manual code review

Recommendations

  • Remove the redundant logic to simplify the code.

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.

Give us feedback!