Bridge
GCD Stablecoin needs to be minted and moved from Layer 1 to Layer 2. So, moving GCD from L1 to L2 is necessary. The easiest way to move some GCD tokens from L1 to L2 is the GCD Bridge.
The GCD bridge is made up of two primary contracts:
Layer 1: L1CrossDomainMessenger
Layer 2: L2CrossDomainMessenger
Sending GCD Tokens from L1 to L2
Step 1: Lock GCD tokens on the L1CrossDomainMessenger contract.
Step 2: The L1CrossDomainMessenger contract will send a message to the L2CrossDomainMessenger contract, and L2CrossDomainMessenger will notice it.
Step 3: The L2CrossDomainMessenger will mint some GCD equal to the amount of GCD that was deposited on Layer 1.
Withdrawing GCD Tokens from L2 to L1
Step 1: Send a withdrawal request to the L2CrossDomainMessenger contract on Layer 2.
Step 2: The L2CrossDomainMessenger contract will burn an equal amount of GCD that you have requested for withdrawal and send a message to the L1CrossDomainMessenger contract to unlock the equal amount of GCD.
Step 3: Wait for a couple of days for the result of the fraud-proof process.
Step 4: At the end, send a second withdrawal transaction to the L2CrossDomainMessenger contract to get the funds.
All Contracts
The GTON Network L2 system contains an L1/L2 bridge system with the following contracts:
CrossDomainEnabled.sol
- a helper contract that enables cross-domain communications.ICrossDomainMessenger.sol
- an interface for cross-messenger contracts.IL1ERC20Bridge.sol
- an interface for L1 ERC20 bridge.IL1StandardBridge.sol
- an interface for L1 bridge.IL2ERC20Bridge.sol
- an interface for L2 ERC20 bridge.IL2StandardERC20.sol
- an interface for L2 bridge.L1ChugSplashProxy.sol
- a contract with proxy implementation functionality.L1StandardBridge.sol
- the L1 bridge with functionality for depositing ETH, depositing ERC20 tokens, finalizing ETH and ERC20 withdrawal.L2StandardBridge.sol
- the L2 bridge with functionality for withdrawing ETH and finalizing deposit.Lib_AddressManager.sol
- a library for setting and getting the address and name hash.Lib_AddressResolver.sol
- a library that resolves the address associated with a given name.Lib_PredeployAddresses.sol
- constant predeploy addresses.OVM_GasPriceOracle.sol
- a gas price oracle with functionality to update fees, gas price, ERC20 bridging parameters.iL1ChugSplashDeployer.sol
- an interface for the proxy contract.iMVM_DiscountOracle.sol
- an interface for the discount oracle.iOVM_SequencerFeeVault.sol
- a contract holding fees paid to the Sequencer.
Privileged roles
The owner can pause contracts, set the gas price, change the minimum L1 gas limit, and transfer fees to an address.
onlyFromCrossDomainAccount
is a role used to finalize deposits, ETH or ERC20 withdrawals, and finalize chain switching and chain configuration.
Last updated