GTON Capital | GC
  • GTON Capital ⚜️ Explained
  • LEARN
    • Brief Intro
    • GTON Capital in Detail
    • GameFi, SocialFi, & Real World Assets
    • GTON Network
      • Basics of Rollups
      • Protocol Overview
      • L2 Processes
      • Bridge
    • GTON Dollar (GCD)
      • Lending, CDP, and Money Markets
      • Fees
      • GCD Contracts
        • Solidity API
    • OGXT
    • Oracles
  • USE
    • GTON → OGXT Token Swap
    • OGXT/GCD Ratio
    • GTON CLI
    • Connect to GTON Testnet
    • Metamask Settings
    • Deploy to GTON Network
    • Contract Verification
    • Mint & Bridge GCD
    • Tech Support
    • Positions Liquidation and Closing the Project
  • GTON Ecosystem
    • GTON Ecosystem
  • Contributors
    • Multisig
    • Github
  • Treasury
    • Treasury Management
    • Treasury Snapshot Reports (TSR)
      • TSR 1 - 19 Jan 2022
      • TSR 2 - 19 Feb 2022
      • TSR 3 - 19 Mar 2022
      • TSR 4 - 19 Apr 2022
      • TSR 5 - 19 May 2022
      • TSR 6 - 19 Jun 2022
      • TSR 7 - 19 Jul 2022
      • TSR 8 - 19 Aug 2022
      • TSR 9 - 19 Sept 2022
      • TSR 10 - 19 Oct 2022
      • TSR 11 - 19 Nov 2022
      • TSR 12 - 19 Dec 2022
      • TSR 13 - 19 Jan 2023
      • TSR 14 - 19 Feb 2023
      • TSR 15 - 19 Mar 2023
      • TSR 16 - 19 Apr 2023
      • TSR 17 - 19 May 2023
      • TSR 18 - 19 Jun 2023
      • TSR 19 - 19 Jul 2023
      • TSR 20 - 19 Aug 2023
      • TSR 21 - 27 Feb 2024
  • Audits
    • Certik Audit
    • Securing Audit
    • Hacken Audit
  • Community
    • Snapshot (Fantom)
    • Snapshot (Ethereum)
    • ⚠️Legal Disclaimer
    • Code of Conduct
  • History & Legacy
    • Legacy Articles
      • 🪙Staking
      • 🪢Bonding
      • 🧬Pathway (PW)
        • PW FAQ
      • Roadmap
      • 👼Angels
    • Timeline Overview
    • Unlocking from staking v0/v1
    • 2021 Vision
    • GTON Token
Powered by GitBook
On this page
  • Sending GCD Tokens from L1 to L2
  • Withdrawing GCD Tokens from L2 to L1
  • All Contracts
Export as PDF
  1. LEARN
  2. GTON Network

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.

PreviousL2 ProcessesNextGTON Dollar (GCD)

Last updated 2 years ago