# L1 Bridge

Contracts involved in canonical messaging between Ethereum and Zircuit

## Ethereum

| Contract Name                       | Contract Address                                                                                                      |
| ----------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| `L1CrossDomainMessengerProxy`       | [0x2a721cBE81a128be0F01040e3353c3805A5EA091](https://etherscan.io/address/0x2a721cBE81a128be0F01040e3353c3805A5EA091) |
| `L1StandardBridgeProxy`             | [0x386B76D9cA5F5Fb150B6BFB35CF5379B22B26dd8](https://etherscan.io/address/0x386B76D9cA5F5Fb150B6BFB35CF5379B22B26dd8) |
| `ProxyAdmin`                        | [0x5B1Ef673d9c316b3eE9Ed3B4E3cC84952bfC5257](https://etherscan.io/address/0x5B1Ef673d9c316b3eE9Ed3B4E3cC84952bfC5257) |
| `SystemConfigProxy`                 | [0x30F82a1Ca89226E8b8815d6EbB728e3b18a428ff](https://etherscan.io/address/0x30F82a1Ca89226E8b8815d6EbB728e3b18a428ff) |
| `SP1VerifierGateway`                | [0xf35A4088eA0231C44B9DB52D25c0E9E2fEe31f67](https://etherscan.io/address/0xf35A4088eA0231C44B9DB52D25c0E9E2fEe31f67) |
| `OptimismPortalProxy`               | [0x17bfAfA932d2e23Bd9B909Fd5B4D2e2a27043fb1](https://etherscan.io/address/0x17bfAfA932d2e23Bd9B909Fd5B4D2e2a27043fb1) |
| `OptimismMintableERC20FactoryProxy` | [0xc77ece87C91C44AFb5f19638f9a0F75b5d90E932](https://etherscan.io/address/0xc77ece87C91C44AFb5f19638f9a0F75b5d90E932) |
| `L2OutputOracleProxy`               | [0x92Ef6Af472b39F1b363da45E35530c24619245A4](https://etherscan.io/address/0x92Ef6Af472b39F1b363da45E35530c24619245A4) |
| `L1ERC721BridgeProxy`               | [0x994eEb321F9cD79B077a5455fC248c77f30Dd244](https://etherscan.io/address/0x994eEb321F9cD79B077a5455fC248c77f30Dd244) |
| `SuperchainConfigProxy`             | [0x745393Cc03b5fE668ECd52c0E625f59aAD6D3Da0](https://etherscan.io/address/0x745393Cc03b5fE668ECd52c0E625f59aAD6D3Da0) |
| `ResolverRegistryProxy`             | [0x6c89104690452AD7e209f0ab72287C2561d5cF0E](https://etherscan.io/address/0x6c89104690452AD7e209f0ab72287C2561d5cF0E) |
| `CrisisControlRegistryProxy`        | [0x7d43EB137185aEa81A020563099e940Bb380F35e](https://etherscan.io/address/0x7d43EB137185aEa81A020563099e940Bb380F35e) |

## Sepolia

| Contract Name                       | Contract Address                                                                                                              |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `L1CrossDomainMessengerProxy`       | [0x6aC894b2a32fED0DC09c2c617277c2F2BF1cf130](https://sepolia.etherscan.io/address/0x6aC894b2a32fED0DC09c2c617277c2F2BF1cf130) |
| `L1StandardBridgeProxy`             | [0x87a7E2bCA9E35BA49282E832a28A6023904460D8](https://sepolia.etherscan.io/address/0x87a7E2bCA9E35BA49282E832a28A6023904460D8) |
| `ProxyAdmin`                        | [0x540fF7ab7bb9894E408bb650ed4f060c390c9B6d](https://sepolia.etherscan.io/address/0x540fF7ab7bb9894E408bb650ed4f060c390c9B6d) |
| `SystemConfigProxy`                 | [0x3D3fC87Ec70705Ba6FDDAcc72D5C71440F64463F](https://sepolia.etherscan.io/address/0x3D3fC87Ec70705Ba6FDDAcc72D5C71440F64463F) |
| `SP1VerifierGateway`                | [0xb9985758eed32892441fAF6FE852B8c6d6847205](https://sepolia.etherscan.io/address/0xb9985758eed32892441fAF6FE852B8c6d6847205) |
| `OptimismPortalProxy`               | [0x4E21A71Ac3F7607Da5c06153A17B1DD20E702c21](https://sepolia.etherscan.io/address/0x4E21A71Ac3F7607Da5c06153A17B1DD20E702c21) |
| `OptimismMintableERC20FactoryProxy` | [0x9641B86870bbe53264492854Ad7af32E39079dfe](https://sepolia.etherscan.io/address/0x9641B86870bbe53264492854Ad7af32E39079dfe) |
| `L2OutputOracleProxy`               | [0xd69D3AC5CA686cCF94b258291772bc520FEAf211](https://sepolia.etherscan.io/address/0xd69D3AC5CA686cCF94b258291772bc520FEAf211) |
| `L1ERC721BridgeProxy`               | [0x987d6008BB5C1e94a72b60a4bbFaAF67Ef09746E](https://sepolia.etherscan.io/address/0x987d6008BB5C1e94a72b60a4bbFaAF67Ef09746E) |
| `SuperchainConfigProxy`             | [0x9da6c219742518AE98E364184cE32fe81c08Ba2A](https://sepolia.etherscan.io/address/0x9da6c219742518AE98E364184cE32fe81c08Ba2A) |
| `ResolverRegistryProxy`             | [0x2B49136665Dc78347893BFaCf3F9e2af546A1069](https://sepolia.etherscan.io/address/0x2B49136665Dc78347893BFaCf3F9e2af546A1069) |
| `CrisisControlRegistryProxy`        | [0xBEa946FF59F97Eec54e4B32a01e68d67fb4Df5A6](https://sepolia.etherscan.io/address/0xBEa946FF59F97Eec54e4B32a01e68d67fb4Df5A6) |

## Definitions

### L1Standard Bridge

The `L1StandardBridge` handles ETH and ERC20 transfers between L1 and L2. For L1-native ERC20 tokens, they're escrowed in this contract, while L2-native ones are burnt. ETH is stored in the OptimismPortal contract.

*NOTE: The contract doesn't support all ERC20 variations, e.g., those with transfer fees, rebasing tokens, or blocklists.*

#### Functions:

`bridgeETH`: Sends ETH the sender's address on L2.

`bridgeETHTo`: Sends ETH to a receiver's address on L2.

`bridgeERC20`: Sends ERC20 tokens to the sender's address onon L2.

`depositERC20To`: Deposit an ERC20 for a target on L2.

`receive`: Bridge ETH via direct send to the bridge.

`finalizeBridgeETH`: Finalizes an ETH bridge.

`finalizeBridgeERC20`: Finalizes an ERC20 bridge.

### L1CrossDomainMessenger

The contract serves as an interface for managing cross-layer communication between L1 and L2. It provides functionalities to send and receive messages, potentially facilitating interactions like token transfers or contract calls between different layers of the network.

### L1ERC721Bridge

The `L1ERC721Bridge` contract facilitates ERC721 token transfers between Ethereum and Zircuit by escrowing tokens on L1, liaising with the L2 bridge, and ensuring secure, transparent transfers. It's vital for scaling NFTs and ERC721 assets across blockchain layers.

### L2OutputOracle

The contract holds an array of L2 state outputs, each representing the L2 chain state at specific block numbers. It permits adding new outputs and removing existing ones based on conditions.

#### Events:

`OutputProposed`: Announces a new output with its details.

#### Functions:

`proposeL2Output`: Submits a new L2 output, ensuring block number and timestamp accuracy.

`getL2Output`: Retrieves an output by index.

`getL2OutputIndexAfter` & `getL2OutputAfter`: Uses binary search to find and return outputs based on block numbers.

`finalizationPeriodSeconds`: The minimum time (in seconds) that must elapse before a withdrawal can be finalized.

### OptimismPortal

The OptimismPortal is responsible for managing cross-chain communication between L1 and Zircuit L2. It handles depositing messages from L1 to L2 and proving and finalizing withdrawal messages from L2 to L1.

#### Functions

`minimumGasLimit`: Computes the minimum gas limit for a deposit.

`receive()`: Allows users to send ETH directly to the contract and have the funds deposited to their address on L2.

`donateETH`: Accepts ETH without triggering a deposit to L2.

`proveWithdrawalTransaction`: Allows a user to prove a withdrawal transaction by providing necessary proofs, upon which the withdrawn funds are released and forwarded to the targeted receiver.

`depositTransaction`: Accepts deposits of ETH and data, and triggers a TransactionDeposited event.

`isOutputFinalized`: Checks if a given L2 output is finalized.

### Verifier

The `Verifier` is responsible for checking Zircuit validity and template proofs.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zircuit.com/addresses/bridge.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
