L1 Contracts

The following are brief descriptions of the L1 contracts and some of their notable features.

Staking Contract

For info on the Zircuit staking contract, please refer to https://stake.zircuit.com/faq.

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 Optimism 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.

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:

depositETH: Deposit ETH for self on L2.

depositETHTo: Deposit ETH for a target on L2.

receive: Bridge ETH via direct send to the bridge.

finalizeETHWithdrawal: Complete ETH withdrawal from L2 to L1.

depositERC20: Deposit an ERC20 for self on L2.

depositERC20To: Deposit an ERC20 for a target on L2.

finalizeERC20Withdrawal: Complete ERC20 withdrawal from L2 to L1.

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.

OptimismPortal

The OptimismPortal is responsible for managing cross-chain communication between L1 and Optimism 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.

finalizeWithdrawalTransaction: Finalizes a withdrawal transaction after it has been proven.

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 proofs.

Last updated