The smart contract system in GTON Network is inherited from Optimism and Metis. Below are the key parts that support the logic of the Layer 2 platform.
L1 is composed of different kinds of contracts, primarily used to facilitate messaging from L1 to L2 and ensure a correct ordering of transactions:
Contracts that support message exchange from L1 to L2.
L1 Cross Domain Messenger
The role of the L1 Cross Domain Messenger contract is to send messages from L1 to L2. It also relays messages from L2 to L1 and is responsible for keeping rejected messages that are passing from L1 to L2. Please note: if a message sent from L1 to L2 is rejected, it can be resubmitted via the replay function of this contract.
L1 Standard Bridge
The L1 Standard Bridge contract is used for storing locked L1 funds that users intend to bridge from L1 to L2 and are already locked on the L2. The contract synchronizes with a corresponding L2 bridge to get information about deposits and newly finalized withdrawals.
Contracts on L1 (Ethereum mainnet) that store ordered lists of transactions and of commitments to the L2 state roots.
L1 Rollup Contracts
They store an ordered list of all transactions that are submitted to the L2 state, such as:
The proposed state root that results from the application of each transaction.
Transactions sent from L1 to L2 that are pending in the ordered list.
Canonical Transaction Chain CTC (append only)
Defines the ordering of transactions by writing them to the Chain Storage Container (CSC). Allows any account to ‘enqueue’ L2 transactions that the sequencer will eventually append to the state.
State Commitment Chain SCC
Contains a list of proposed state roots.
Chain Storage Container CSC
Gives reusable storage and provides its owner contract with read, write, and delete functionality.
Verification on L1 is necessary to prove the integrity of the proposed state roots that come from each transaction. If the state root is deemed correct, the verifier will receive a reward. If not, the verifier can initiate a transaction challenge.
Contracts that support message exchange from L2 to L1.
Layer 2 Cross Domain Messenger
Sends messages from L2 to L1.
L2 Standard Bridge
The L2 Standard Bridge works together with the L1 Standard Bridge to enable the transfer of GCD between L1 and L2. It mints new tokens on L2 deposited into the L1 Standard Bridge, or burns the withdrawn tokens and informs their unlock on L1.
Can be found at addresses with 0x42 prefixes. They handle common operations.
It is owned by the GTON team and helps with mainnet rollout by allowing whitelisted addresses to do ovmCREATE or ovmCREATE2 operations.
The OVM ETH predeploy provides an ERC20 interface for GCD deposited to L2. Unlike L1, L2 accounts do not have a balance field.
This contract determines the current L2 gas price. The gas fee depends on network congestion.
A utility contract that facilitates an proof of a L1 message on L2. This proof is performed in its _verifyStorageProof function. As a result, it verifies the existence of the transaction hash in the ‘sendMessages’ mapping of the L2ToL1MessagePasser contract.