sherlock-audit / 2024-08-tokamak-network-judging

1 stars 0 forks source link

Tame Plum Ram - Incorrect `OptimismPortal` file being imported in `L1CrossDomainMessenger` #85

Closed sherlock-admin3 closed 1 month ago

sherlock-admin3 commented 1 month ago

Tame Plum Ram

Low/Info

Incorrect OptimismPortal file being imported in L1CrossDomainMessenger

Summary

The protocol intends to use OptimismPortal2 in their codebase which is in-scope, however L1CrossDomainMessenger imports OptimismPortal instead.

Vulnerability Detail

The protocol intends to use OptimismPortal2 in their codebase which is in-scope, however L1CrossDomainMessenger imports OptimismPortal instead.

import { OptimismPortal } from "src/L1/OptimismPortal.sol";

Impact

Incorrect import, but since it is used as an interface, the logic will still work from the deployed OptimismPortal2 contract.

Code Snippet

https://github.com/sherlock-audit/2024-08-tokamak-network/blob/main/tokamak-thanos/packages/tokamak/contracts-bedrock/src/L1/L1CrossDomainMessenger.sol#L7

Tool used

Manual Review

Recommendation

Import OptimismPortal2 in L1CrossDomainMessenger

- import { OptimismPortal } from "src/L1/OptimismPortal.sol";
+ import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol";