Bridging Behaviors with EIP-7702
To avoid the risk of potential fund loss, always use the L1StandardBridge and L2StandardBridge contracts when bridging ETH and ERC-20 tokens, and use the L1ERC721Bridge and L2ERC721Bridge contracts when bridging ERC-721 tokens.
EIP-7702 enables EOAs to execute smart contract code directly. However, this comes with some nuances to be wary of when it comes to bridging.
Bridging ETH
ETH may be temporarily locked on the destination network if the receiving delegated account lacks a function to accept ETH (e.g.,
receive() external payable). To resolve this, either undelegate the code or update it to include an ETH-receiving function, then replay the message on the destination network.The
L1StandardBridgeandL2StandardBridgecontracts include a conveniencereceive()function that initiates the bridging process with a fixed gas limit for the destination network. If the receiving delegated account implements areceive()function with complex logic that consumes significant gas, it may trigger an out-of-gas error. To avoid unexpected behavior in such cases, usebridgeETHorbridgeETHToinstead, specifying a custom gas limit that ensures successful execution on the destination chain.
Bridging ERC-721
ERC-721 may be temporarily locked on the destination network if the receiving delegated account lacks a correctly implemented
onERC721Received()function. To resolve this, either undelegate the code or update it to include anonERC721Received()function, then replay the message on the destination network.
Recovering Temporarily Locked ETH/ERC-721 on L1
For delegated 7702 EOAs on L1, unset the code first.
Go to the
OptimismPortalProxypage on Etherscan. You can find the Mainnet link here.Open the transaction hash page where the
proveWithdrawalTransactionerrors occurred.Go to the
Internal Txnstab.Open and decode input data for the
Relay Messagemethod.Go to the
L1CrossDomainMessengerProxypage on Etherscan. You can find the Mainnet link here.Send a
relayMessagetransaction using the exact same decoded input data from Step 6. Set thepayableAmountto 0. Once the transaction is confirmed, the funds should appear in your wallet.
Recovering Temporarily Locked ETH/ERC-721 on L2
For delegated 7702 EOAs on L2, unset the code first.
Go to the
L2CrossDomainMessengerpage on Zircuit explorer. You can find the Mainnet link here.Open the transaction hash page where the
relayMessageerror occurred.Copy the
Input Dataand run the folllowing command:cast calldata-decode "relayMessage(uint256,address,address,uint256,uint256,bytes)" $INPUT_DATAGo to the
L2CrossDomainMessengerpage on Etherscan. You can find the Mainnet link here.Send a
relayMessagetransaction using the exact same decoded input data from Step 4. Set thepayableAmountto 0. Once the transaction is confirmed, the funds should appear in your wallet.
Last updated
Was this helpful?