Skip to content

archethic-foundation/bridge

Repository files navigation

Platform

AE Bridge

Main features

  • Bridge native tokens and ERC20 from EVM Blockchain (Ethereum, BSC, Polygon) to Archethic blockchain
  • Bridge UCO and wrapped tokens from Archethic Blockchain to EVM Blockchain (Ethereum, BSC, Polygon)
  • Refund

Security

  • Security access with your Archethic Wallet and EVM compatible wallet (Metamask, Brave, ...)

Development

In order to develop and test the application, you need to have some prerequisites:

Steps

1) Create an EVM Wallet

  • Start your EVM wallet :
    • Add Hardhat network with these properties
    • Import an account using the private key from the first workspace's account

2) Create an Archethic Wallet

  • Start Archethic Node in the devnet environnment (ie local environnment) If you want to fill Pool and Factory chains with faucet, you can ,before start the node, update the Archethic.Bootstrap.NetworkInit section in config/dev.exs Node's file

    # Master Chain (pools' management): 000023ca0313eb76617060ae119b48e98e689f2b2ef030e6df063d426dc0b00f4428
    # Pool UCO: 0000f53a34560bfe06b01689e585d53c07671f6eaa1b31e62659d8f7d5292f066941
    # Faucet: 00001259AE51A6E63A1E04E308C5E769E0E9D15BFFE4E7880266C8FA10C3ADD7B7A2
    config :archethic, Archethic.Bootstrap.NetworkInit,
    genesis_pools: [
      %{
        address:
          "000023ca0313eb76617060ae119b48e98e689f2b2ef030e6df063d426dc0b00f4428"
          |> Base.decode16!(case: :mixed),
        amount: 1_000_000_000_000_000
      },
      %{
        address:
          "0000f53a34560bfe06b01689e585d53c07671f6eaa1b31e62659d8f7d5292f066941"
          |> Base.decode16!(case: :mixed),
        amount: 1_000_000_000_000_000
      },
      %{
        address:
          "00001259AE51A6E63A1E04E308C5E769E0E9D15BFFE4E7880266C8FA10C3ADD7B7A2"
          |> Base.decode16!(case: :mixed),
        amount: 1_000_000_000_000_000
      }
    ]  
  • Launch the Archethic Wallet in desktop version (Linux, Windows, MacOS)

  • Create a new account in the devnet environnment

  • Obtain UCO from the faucet for the account

3) Deploy Archethic Pools

  • Execute the following commands to deploy the contracts
    cd contracts/archethic;npm install;node bridge init_keychain;node bridge deploy_factory;node bridge deploy_pool --token UCO;node bridge deploy_pool --token aeETH;cd -

4) Deploy EVM Pools

  • Execute the following commands to install EVM contracts management's dependencies and to start a local node:

    cd contracts/evm;npm install;npx hardhat node;cd -;
  • Execute the following commands in another terminal to deploy the contracts and fill the pools with tokens:

  • cd contracts/evm;npm run deploy;npm run fill-eth; npm run fill-erc;cd -;

5) Run AEBridge

  • Execute the following command at the project's root to launch the app with Chrome extension availability:
    flutter run -d web-server 
  • Copy/Paste the app URL (ex: http://localhost:49316/) into Chrome NB: The port number could be different

If you want to debug the Flutter app, you should enable chrome extensions:

Note

*** This Application is currently in active development so it might fail to build. Please refer to issues or create new issues if you find any. Contributions are welcomed.

Contracts management

To get more details on the contracts, please take a look at the bridge's contract repository