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.
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
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.
Manual code review
Remove the redundant logic to simplify the code.
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.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.