• Stars
    star
    153
  • Rank 243,453 (Top 5 %)
  • Language
    TypeScript
  • License
    Other
  • Created over 4 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

💙 Interface for bridging assets to and from Arbitrum chains

Arbitrum Token Bridge

The canonical token-bridge of Arbitrum

Are you a developer looking to explore the Arbitrum token bridge and its underlying technology? Then you've come to the right place! We'll walk you through the steps to run the Arbitrum token bridge website locally on your machine.


Offchain Labs ❤️ Open-source

Interested in contributing to this repo? We welcome your contribution. Check out the contribution guidelines and instructions here.




Prerequisites for running the code

  • Install Node.js for your platform

  • Install Node Version Manager (nvm) to setup the correct Node version for the project.

  • Install VS Code for your platform

  • Install Yarn (version 1) - Package manager

  • Within VS Code, we use a some tools to automate things (e.g. code formatting), maintain consistency and reduce noise for code reviews. For the optimal development experience, install the following tools:

    • Prettier - Automatic code formatting
      • Find Prettier integration for your code editor here
    • EditorConfig - Automatic file formatting
      • Find EditorConfig integration for your code editor here
    • ESLint - Static analysis for JavaScript
      • Find ESLint integration for your code editor here



Steps to run the code locally

  1. Clone the Arbitrum token bridge repository from Github onto your local machine

    $ git clone https://github.com/OffchainLabs/arb-token-bridge
  2. Use the Node version as per project settings to avoid any errors before project installation.

    $ nvm use
  3. Install dependencies in all packages using yarn.

    $ yarn
  4. Set env vars:

    1. Copy the existing env.sample file present.

      $ cp ./packages/arb-token-bridge-ui/.env.local.sample  ./packages/arb-token-bridge-ui/.env
    2. In .env created, add NEXT_PUBLIC_INFURA_KEY=my-infura-key

    3. For custom urls, set optional vars:

    • NEXT_PUBLIC_ETHEREUM_RPC_URL=my-eth-node
    • NEXT_PUBLIC_GOERLI_RPC_URL=my-goerli-node (see .env.sample) If no custom URL is provided, Infura will be used by default.
  5. Build the project and internal packages

    $ yarn build
  6. Finally, running the project

    1. (back in root dir:)

      $ yarn dev
    2. Visit http://localhost:3000/




Testing changes

It is important for any code change to pass both unit and end-to-end tests. This is generally done before raising the PR to ensure it doesn't break any existing feature.


Run Unit Tests

  1. Run the token bridge UI locally on http://localhost:3000/
  2. Run the tests
    $ yarn test:ci

Run End-to-End (E2E) Tests

  1. Set up the Nitro node

    1. Download and install Docker

    2. Check out the Nitro repo

    3. Run: (Make sure your Docker App is running)

      $ ./test-node.bash --init
    4. When the Nitro node is up and running you should see logs like sequencer_1 and staker-unsafe_1 in the terminal. This can take up to 10 minutes

  2. At the root of the token bridge UI:

    1. Run:
    $ cp ./packages/arb-token-bridge-ui/.e2e.env.sample ./packages/arb-token-bridge-ui/.e2e.env
    1. In the newly created file, .e2e.env, update your NEXT_PUBLIC_INFURA_KEY
  3. Run the token bridge UI locally on http://localhost:3000/ with:

    $ yarn dev
  4. Run e2e tests

    $ yarn test:e2e

Read more about the test setup here.




More Repositories

1

arbitrum-classic

Powers fast, private, decentralized applications
Go
1,975
star
2

nitro

Nitro goes vroom and fixes everything
Go
738
star
3

arbitrum-tutorials

Get started developing on Arbitrum
JavaScript
451
star
4

arbitrum-sdk

TypeScript
226
star
5

stylus-sdk-rs

Rust Smart Contracts on Arbitrum
Rust
222
star
6

arbitrum-docs

Arbitrum Docs! Content + Webapp
MDX
180
star
7

token-bridge-contracts

Arbitrum token bridge and peripheral contracts
Solidity
149
star
8

bold

Efficient, all-vs-all dispute protocol for Optimistic Rollups
Go
111
star
9

eth-pos-devnet

Shell
111
star
10

stylus

Stylus VM and Fraud Prover
Go
107
star
11

nitro-contracts

The core Arbitrum Nitro contracts deployed to the parent chain to host the rollup
Solidity
97
star
12

arb-os

ArbOS operating system, to run at Layer 2 on Arbitrum chains. Also a compiler for Mini, the language in which ArbOS is written.
Rust
93
star
13

go-ethereum

Go
55
star
14

cargo-stylus

Cargo subcommand for developing Arbitrum Stylus projects in Rust
Rust
55
star
15

awesome-stylus

A curated list of Arbitrum Stylus code examples, libraries and resources
54
star
16

blockscout

Elixir
45
star
17

orbit-setup-script

TypeScript
42
star
18

stylus-hello-world

Project starter template for writing Arbitrum Stylus programs in Rust
Rust
39
star
19

arbitrum

35
star
20

arbitrum-orbit-sdk

💙 SDK for building Arbitrum Orbit chains
TypeScript
29
star
21

sszpp

C++ SSZ library
C++
25
star
22

arbitrum-token-lists

TypeScript
22
star
23

demo-dapp-pet-shop

Pet shop dapp, for use as an Arbitrum demo
JavaScript
20
star
24

arbitrum-orbit-deployment-ui

Introducing the L3 Orbit Chain Deployment Interface, a user-friendly tool to effortlessly deploy your own Layer 3 Orbit Chain. This repository streamlines the setup process, allowing developers to focus on their decentralized applications.
TypeScript
20
star
25

methodical-ssz

Code generation tool for adding Ethereum SimpleSerialiZe support methods to existing go types
Go
19
star
26

zig-on-stylus

EVM-interoperable smart contracts written in Zig!
Zig
18
star
27

nitro-testnode

A complete environment for nitro-based service including sequencer, batch-poster, validator, and a coordinator.
TypeScript
18
star
28

stylus-sdk-c

C/C++ Smart Contracts on Arbitrum
C
17
star
29

arbitrum-subgraphs

TypeScript
16
star
30

bold-validator-starter-kit

Starter kit repo for running Arbitrum BOLD validators
Shell
16
star
31

nft-bridge-workshop-demo

TypeScript
12
star
32

fund-distribution-contracts

Contracts for distributing rewards data availability committee members
Solidity
11
star
33

stylus-by-example

Simple examples of Arbitrum Stylus Rust & WASM smart contracts
MDX
11
star
34

arbitrum-monitoring

A collection of scripts designed for monitoring various aspects of Arbitrum chains.
TypeScript
10
star
35

Blobwatcher

Blob Monitoring Tool
Go
10
star
36

stylus-geth

Go
10
star
37

timeboost-design

Go
9
star
38

token-bridge-sdk

TypeScript
9
star
39

demo-dapp-election

JavaScript
9
star
40

stylus-sdk-bf

Bf Smart Contracts on Arbitrum 😅
WebAssembly
8
star
41

upgrade-executor

Support system for performing contract upgrades
Solidity
6
star
42

Arbiswap_V2_mono

TypeScript
6
star
43

arbitrum-cli-tools

TypeScript
6
star
44

community-helm-charts

Community Helm Charts provided by Offchain Labs
Smarty
6
star
45

retryable-tx-panel

TypeScript
5
star
46

actions

Collection of reusable GitHub actions and workflows
Shell
5
star
47

stylus-workshop-rust-solidity

Stylus workshop for interaction between Rust and Solidity
Solidity
5
star
48

stylus-contracts

Solidity
5
star
49

stylus-workshop-nft

Rust
5
star
50

config-monorepo

JavaScript
4
star
51

arbitrum-interop-quickstart

JavaScript
4
star
52

RescuETH

TypeScript
4
star
53

decentralized-timeboost-spec

4
star
54

keccak-const

Rust
4
star
55

arbitrum-deployment-website

Ethers interface form Arbitrum chain deployment
TypeScript
3
star
56

l1-l3-teleport-contracts

Solidity
3
star
57

crosschain-oracle-workshop-demo

Solidity
3
star
58

arb-compiler-evm-archive

Python
3
star
59

gnosis-safe-contracts

TypeScript
3
star
60

arb_reddit_community_points

TypeScript
3
star
61

deposits_tracker

TypeScript
2
star
62

stylus-erc20

Solidity
2
star
63

fastcache

Go
2
star
64

retryables_tracker

TypeScript
2
star
65

SoftFloat

SoftFloat-3e with WASM build support
C
2
star
66

wasmer

Rust
2
star
67

token-bridge-sdk-old

TypeScript
2
star
68

stylus-hello-world-minimal

Shell
1
star
69

orbit-actions

Solidity
1
star
70

encode-workshop-crosschain-messaging

JavaScript
1
star
71

token-mock

JavaScript
1
star
72

arb-provider-ethers-deprecated-

TypeScript
1
star
73

paired-erc20

Solidity
1
star
74

fakerdao

JavaScript
1
star
75

Arb-Burner-Wallet

TypeScript
1
star
76

arbtoken_twitter_faucet

TypeScript
1
star
77

ethers-bls-signer

TypeScript
1
star
78

arb-peripheral-template

An easy to use template to integrate with Arbitrum peripheral contracts
JavaScript
1
star
79

stylus-workshop-counter

Rust
1
star
80

stylus-chess

Rust
1
star
81

navigator

HTML
1
star
82

cuckoocache

Go
1
star
83

arb-ethers-web3-bridge

Arbitrum bridge for converting ethers provider into web3
JavaScript
1
star
84

arbitrum-funds-recovery-tool

Tool to recover funds that are stuck on an L2 aliased address
TypeScript
1
star