sherlock-audit / 2024-08-flayer-judging

2 stars 0 forks source link

zzykxx - Calling `depositTransaction()` on the optimism portal directly doesn't allow to replay transaction in case they fail #769

Open sherlock-admin4 opened 1 month ago

sherlock-admin4 commented 1 month ago

zzykxx

High

Calling depositTransaction() on the optimism portal directly doesn't allow to replay transaction in case they fail

Summary

No response

Root Cause

To bridge assets from L1 to L2 using Moongate a user starts by calling crossTheThreshold()/crossTheThreshold1155, which calls depositTransaction() on the optimism portal directly.

Using the optimism portal directly doesn't allow transactions to be replayed:

@notice The OptimismPortal is a low-level contract responsible for passing messages between L1 and L2. Messages sent directly to the OptimismPortal have no form of replayability. Users are encouraged to use the L1CrossDomainMessenger for a higher-level interface.

This means that if the L2 transactions fail, NFTs will be stuck on the L1 InfernalRiftAbove contract, as there is no way to replay the transaction and no tokens are minted by InfernalRiftAbove. The L2 transaction can when:

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

ERC721/ERC1155 tokens bridged via Moongate can get stuck in the L1 InfernalRiftAbove contract if the L2 transaction to InfernalRiftBelow::thresholdCross() fails.

PoC

No response

Mitigation

Use the L1CrossDomainMessenger contract to bridge assets.