Contract Overview
# L1 contracts
# L2OutputOracle
The L2OutputOracle
contract (opens new window) contains the state root of the Optimism blockchain (OP Mainnet, OP Goerli, etc.).
Once fault proofs are activated, it will be the one that receives the result of the fault proof process.
This is the contract that replaces the old State Commitment Chain.
# OptimismPortal
The OptimismPortal
contract (opens new window) provides the low-level API for communications between layers. Unless you are trying to send L2 transactions via L1 to bypass the sequencer, we strongly recommend sending messages between L1 and L2 via the L1CrossDomainMessenger and L2CrossDomainMessenger.
# L1CrossDomainMessenger
The L1CrossDomainMessenger
contract (opens new window) is used for sending messages between the underlying L1 (Ethereum, Goerli, etc.) and L2 (OP Mainnet, OP Goerli, etc.). Those messages may or may not have assets attached to them.
# L1StandardBridge
The L1StandardBridge
contract (opens new window) uses L1CrossDomainMessenger
to transfer ETH and ERC-20 tokens between the underlying L1 (Ethereum, Goerli, etc.) and L2 (OP Mainnet, OP Goerli, etc.).
# L2 contracts (predeploys)
# L1Block
The L1Block
contract (opens new window) sits at address 0x4200000000000000000000000000000000000015
.
You can use the getter functions (opens new window) to get these parameters:
number
: The latest L1 block number known to L2 (theL1BlockNumber
contract is still supported to avoid breaking existing applications)timestamp
: The timestamp of the latest L1 blockbasefee
: The base fee of the latest L1 blockhash
: The hash of the latest L1 blocksequenceNumber
: The number of the L2 block within the epoch (the epoch changes when there is a new L1 block)
Currently the L1 information is delayed by two block confirmations (~24 seconds) to minimize the impact of reorgs.
# SequencerFeeVault
The SequencerFeeVault
contract (opens new window) handles funding the sequencer on L1 using the ETH base fee on L2.
The fees are calculated using EIP 1559 (opens new window), the same mechanism that Ethereum uses (but with different parameter values).
# L2ToL1MessagePasser
The L2ToL1MessagePasser
contract (opens new window) is used internally by L2CrossDomainMessenger
to initiate withdrawals.
Note that there are two contracts under this name:
- The legacy contract (opens new window) at address
0x4200000000000000000000000000000000000000
- The new contract (opens new window) at address
0x4200000000000000000000000000000000000016
# L2CrossDomainMessenger
The L2CrossDomainMessenger
contract (opens new window) is used to send messages from L2 (OP Mainnet, OP Goerli, etc.) to the underlying L1 (Ethereum, Goerli, etc.).
# L2StandardBridge
The L2StandardBridge
contract (opens new window) is used to "attach" assets (ETH and ERC-20 tokens) to messages that are then sent by L2CrossDomainMessenger
.
# WETH9
The WETH9 contract (opens new window) is an ERC-20 token that wraps around ETH to provide extra functionality, such as approvals.
# Legacy Contracts
Those are contracts that have been superceded, but are kept in case any deployed contract depends on them.
L1BlockNumber (opens new window): The
L1BlockNumber
contract provides the number of the latest L1 block. In Bedrock it is simply a proxy toL1Block
.DeployerWhitelist (opens new window): The
DeployerWhitelist
contract used to manage the whitelist before OP Mainnet moved out of beta (opens new window).OVM_ETH (opens new window): The
OVM_ETH
contract used to manage users ETH balances prior to Bedrock.