Skip to content

Commit

Permalink
add advance bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianscatularo committed Oct 17, 2023
1 parent 5f591ea commit c6b51ad
Show file tree
Hide file tree
Showing 432 changed files with 154,570 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
REACT_APP_COVALENT_API_KEY: ${{ secrets.REACT_APP_COVALENT_API_KEY }}
REACT_APP_WALLET_CONNECT_PROJECT_ID: ${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID }}
run: |
pushd apps/portal
pushd public
npm run set-version
popd
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Folder structure

### [apps/portal](./apps/portal/)

Legacy/Advance Portal Bridge

### [apps/connect](./apps/connect/)

Portal Bridge with Connect widget

### [apps/docs](./apps/docs/)

Portal Bridge documentation
12 changes: 12 additions & 0 deletions apps/portal/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2

# Derivative of ethereum/Dockerfile, look there for an explanation on how it works.
FROM node:16-alpine@sha256:f21f35732964a96306a84a8c4b5a829f6d3a0c5163237ff4b6b8b34f8d70064b

RUN mkdir -p /app
WORKDIR /app

COPY bridge_ui/package.json bridge_ui/package-lock.json ./
RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \
npm ci
COPY bridge_ui .
50 changes: 50 additions & 0 deletions apps/portal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Example Token Bridge UI

## Prerequisites

- NodeJS v14+
- NPM v7.18+

## Install

```bash
npm ci
```

## Develop

```bash
npm start
```

## Build for local tilt network

```bash
npm run build
```

## Build for testnet

```bash
REACT_APP_CLUSTER=testnet npm run build
```

## Build for mainnet

```bash
REACT_APP_CLUSTER=mainnet REACT_APP_COVALENT_API_KEY=YOUR_API_KEY REACT_APP_SOLANA_API_URL=YOUR_CUSTOM_RPC npm run build
```

## Test Server

```bash
npx serve -s build
```

## Environment Variables (optional)

Create `.env` from the sample file, then add your Covalent API key:

```bash
cp .env.sample .env
```
105 changes: 105 additions & 0 deletions apps/portal/config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
const { ProvidePlugin } = require("webpack");
const threadLoader = require('thread-loader');

module.exports = function override(config, env) {
config.module.rules.forEach(rule => {
if (rule.loader && rule.loader.includes('babel-loader')) {
// Use thread-loader for Babel
threadLoader(rule.loader, {
// Number of worker threads to use
workers: 2, // Adjust as needed
});
}
});
return {
...config,
module: {
...config.module,
rules: [
...config.module.rules,
{
test: /\.js$/,
enforce: "pre",
use: ["source-map-loader"],
resolve: {
fullySpecified: false,
},
},
{
test: /\.wasm$/,
type: "webassembly/async",
},
],
},
plugins: [
...config.plugins,
new ProvidePlugin({
Buffer: ["buffer", "Buffer"],
process: "process/browser",
})
],
resolve: {
...config.resolve,
fallback: {
assert: "assert",
buffer: "buffer",
console: "console-browserify",
constants: "constants-browserify",
crypto: "crypto-browserify",
domain: "domain-browser",
events: "events",
fs: false,
http: "stream-http",
https: "https-browserify",
os: "os-browserify/browser",
path: "path-browserify",
punycode: "punycode",
process: "process/browser",
querystring: "querystring-es3",
stream: "stream-browserify",
_stream_duplex: "readable-stream/duplex",
_stream_passthrough: "readable-stream/passthrough",
_stream_readable: "readable-stream/readable",
_stream_transform: "readable-stream/transform",
_stream_writable: "readable-stream/writable",
string_decoder: "string_decoder",
sys: "util",
timers: "timers-browserify",
tty: "tty-browserify",
url: "url",
util: "util",
vm: "vm-browserify",
zlib: "browserify-zlib",
},
},
experiments: {
asyncWebAssembly: true,
},
ignoreWarnings: [/Failed to parse source map/],
optimization: {
...config.optimization,
splitChunks: env === "production" ? {
chunks: "all",
minSize: 1024 * 20,
maxSize: 1024 * 1024 * 20,
minRemainingSize: 0,
minChunks: 1,
// maxAsyncRequests: 30,
// maxInitialRequests: 30,
// enforceSizeThreshold: 50000,
cacheGroups: {
defaultVendors: {
test: /[\\/]node_modules[\\/]/,
priority: -10,
reuseExistingChunk: true,
},
default: {
// minChunks: 2,
priority: -20,
reuseExistingChunk: true,
},
},
} : config.optimization.splitChunks,
},
};
};
20 changes: 20 additions & 0 deletions apps/portal/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions apps/portal/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions apps/portal/docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
3 changes: 3 additions & 0 deletions apps/portal/docs/docs/faqs/_liquid-markets/aptos-osmosis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
| Token (Origin) | Token (Target) | Markets | Contract address |
| -------------- | -------------- | --------------------------------------------- | ---------------- |
| APT | APT(Wormhole) | [Osmosis](https://app.osmosis.zone/pool/1125) | |
3 changes: 3 additions & 0 deletions apps/portal/docs/docs/faqs/_liquid-markets/avax-algorand.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
| Token (Origin) | Token (Target) | Markets | Contract address |
| -------------- | -------------- | ------------------------------------------- | ---------------- |
| AVAX | AVAX(Wormhole) | [Folks Finance](https://app.folks.finance/) | |
3 changes: 3 additions & 0 deletions apps/portal/docs/docs/faqs/_liquid-markets/avax-klaytn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
| Token (Origin) | Token (Target) | Markets | Contract address |
| -------------- | -------------- | --------------------------------- | ------------------------------------------ |
| AVAX | AVAX(Wormhole) | [Klap](https://www.klap.finance/) | 0x45830b92443a8f750247da2A76C85c70d0f1EBF3 |
3 changes: 3 additions & 0 deletions apps/portal/docs/docs/faqs/_liquid-markets/avax-matic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
| Token (origin) | Token (target) | Markets | Contract address |
| --------------- | -------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| Matic(Wormhole) | Wrapped Matic | [Quickswap](https://quickswap.exchange/#/swap?inputCurrency=0xa8d394fe7380b8ce6145d5f85e6ac22d4e91acde) | 0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270 |
4 changes: 4 additions & 0 deletions apps/portal/docs/docs/faqs/_liquid-markets/bsc-klaytn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
| Token (Origin) | Token (Target) | Markets | Contract Address |
| -------------- | -------------- | --------------------------------- | ------------------------------------------ |
| BNB | BNB(Wormhole) | [Klap](https://www.klap.finance/) | 0xaC9C1E4787139aF4c751B1C0fadfb513C44Ed833 |
| BUSD | BUSD(Wormhole) | [Klap](https://www.klap.finance/) | 0xE2765F3721dab5f080Cf14ACe661529e1ab9adE7 |
4 changes: 4 additions & 0 deletions apps/portal/docs/docs/faqs/_liquid-markets/bsc-moonbeam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

| Token(Origin) | Token(Target) | Markets | Contract address |
| ------------- | ---------------- | ------------------------------------------------------------------------------------- | ------------------------------------------ |
| BUSD | BUSDbs(Wormhole) | [Stellaswap](https://stellaswap.com/), [Moonwell](https://moonwell.fi/artemis/ETH.wh) | 0x692C57641fc054c2Ad6551Ccc6566EbA599de1BA |
5 changes: 5 additions & 0 deletions apps/portal/docs/docs/faqs/_liquid-markets/bsc-sol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
| Token (origin) | Token (target) | Markets | Contract address |
| -------------- | ---------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------- |
| USDC | USDCbs(Wormhole) | [Jupiter](https://jup.ag/) | FCqfQSujuPxy6V42UvafBhsysWtEq1vhjfMN1PUbgaxA |
| USDT | USDTbs(Wormhole) | [Jupiter](https://jup.ag/) | 8qJSyQprMC57TWKaYEmetUR3UUiTP2M3hXdcvFhkZdmv |
| BUSD | BUSD(Wormhole) | [Jupiter](https://jup.ag/) | 5RpUwQ8wtdPCZHhu6MERp2RGrpobsbZ6MH5dDHkUjs2 |
5 changes: 5 additions & 0 deletions apps/portal/docs/docs/faqs/_liquid-markets/eth-algorand.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
| Token Origin | Token (Target) | Markets |
| ------------ | -------------- | ----------------------------------------------------------------------------------------- |
| ETH | WETH(Wormhole) | [Algofi](https://info.algofi.org/pool-info/892525155/), [Pact](https://app.pact.fi/pools) , [Folks Finance](https://app.folks.finance/)|
| WBTC | WBTC(Wormhole) | [Pact](https://app.pact.fi/pools) , [Folks Finance](https://app.folks.finance/) |
| MPL | MPL(Wormhole) | [Folks Finance](https://app.folks.finance/) |
4 changes: 4 additions & 0 deletions apps/portal/docs/docs/faqs/_liquid-markets/eth-aptos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
| Token Origin | Token (Target) | Markets | Contract Address |
| ------------ | ----------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| USDC | USDCet (Wormhole) | [Hippo Labs](https://hippo.space/swap), [Liquidswap](https://liquidswap.com), [Aries Markets](https://app.ariesmarkets.xyz/swap) | 0x5e156f1207d0ebfa19a9eeff00d62a282278fb8719f4fab3a586a0a2c0fffbea |
| ETH | WETH (Wormhole) | [Hippo Labs](https://hippo.space/swap), [Aries Markets](https://app.ariesmarkets.xyz/swap) | 0xcc8a89c8dce9693d354449f1f73e60e14e347417854f029db5bc8e7454008abb |
5 changes: 5 additions & 0 deletions apps/portal/docs/docs/faqs/_liquid-markets/eth-celo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
| Token (Origin) | Token (Target) | Markets | Contract Address |
|----------------|------------------|---------------------------------------|--------------------------------------------|
| ETH | ETH(Wormhole) | [Ubeswap](https://app.ubeswap.org/) | 0x66803FB87aBd4aaC3cbB3fAd7C3aa01f6F3FB207 |
| USDT | USDTet(Wormhole) | [Curve](https://curve.fi/#/celo/swap) | 0x617f3112bf5397D0467D315cC709EF968D9ba546 |
| USDC | USDCet(Wormhole) | [Curve](https://curve.fi/#/celo/swap) | 0x37f750B7cC259A2f741AF45294f6a16572CF5cAd |
4 changes: 4 additions & 0 deletions apps/portal/docs/docs/faqs/_liquid-markets/eth-injective.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

| Token Origin | Token (Target) | Markets |
| ------------ | -------------- | ------------------------------ |
| CHZ | CHZ | [Helix](https://helixapp.com/) |
3 changes: 3 additions & 0 deletions apps/portal/docs/docs/faqs/_liquid-markets/eth-karura.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
| Token (Origin) | Token (Target) | Markets | Contract address |
| -------------- | ---------------- | ------------------------------------- | -------------------------------------------- |
| USDC | USDCet(Wormhole) | [Karura](https://apps.karura.network) | 0x1F3a10587A20114EA25Ba1b388EE2dD4A337ce27 |
7 changes: 7 additions & 0 deletions apps/portal/docs/docs/faqs/_liquid-markets/eth-klaytn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
| Token (Origin) | Token (Target) | Markets | Contract Address |
| -------------- | ---------------- | --------------------------------- | ------------------------------------------ |
| ETH | ETH(Wormhole) | [Klap](https://www.klap.finance/) | 0x98A8345bB9D3DDa9D808Ca1c9142a28F6b0430E1 |
| WBTC | WBTC(Wormhole) | [Klap](https://www.klap.finance/) | 0x981846be8d2d697f4dfef6689a161a25ffbab8f9 |
| USDC | USDCet(Wormhole) | [Klap](https://www.klap.finance/) | 0x608792Deb376CCE1c9FA4D0E6B7b44f507CfFa6A |
| USDT | USDTet(Wormhole) | [Klap](https://www.klap.finance/) | 0x5C13E303a62Fc5DEdf5B52D66873f2E59fEdADC2 |
| DAI | DAI(Wormhole) | [Klap](https://www.klap.finance/) | 0xCB2C7998696Ef7a582dFD0aAFadCd008D03E791A |
6 changes: 6 additions & 0 deletions apps/portal/docs/docs/faqs/_liquid-markets/eth-moonbeam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

| Token (Origin) | Token (Target) | Markets | Contract Address |
| -------------- | ---------------- | -------------------------------------------------------------------------------------- | ------------------------------------------ |
| ETH | ETH(Wormhole) | [Stellaswap](https://stellaswap.com/), [Moonwell](https://moonwell.fi/artemis/ETH.wh) | 0xab3f0245b83feb11d15aaffefd7ad465a59817ed |
| WBTC | WBTC(Wormhole) | [Stellaswap](https://stellaswap.com/), [Moonwell](https://moonwell.fi/artemis/BTC.wh) | 0xE57eBd2d67B462E9926e04a8e33f01cD0D64346D |
| USDC | USDCet(Wormhole) | [Stellaswap](https://stellaswap.com/), [Moonwell](https://moonwell.fi/artemis/USDC.wh) | 0x931715FEE2d06333043d11F658C8CE934aC61D0c |
4 changes: 4 additions & 0 deletions apps/portal/docs/docs/faqs/_liquid-markets/eth-oasis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
| Token (Origin) | Token (target) | Markets | Contract address |
| -------------- | ---------------- | --------------------------------------------- | ------------------------------------------ |
| USDT | USDTet(Wormhole) | [Yuzu Swap](https://app.yuzu-swap.com/#/pool) | 0xdC19A122e268128B5eE20366299fc7b5b199C8e3 |
| WETH | Ether(Wormhole) | [Yuzu Swap](https://app.yuzu-swap.com/#/pool) | 0x3223f17957Ba502cbe71401D55A0DB26E5F7c68F |
14 changes: 14 additions & 0 deletions apps/portal/docs/docs/faqs/_liquid-markets/eth-sol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
| Token (origin) | Token (target) | Markets | Contract address |
| -------------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
| USDC | USDCet (Wormhole) | [Jupiter](https://jup.ag/) | A9mUU4qviSctJVPJdBJWkb28deg915LYJKrzQ19ji3FM |
| USDT | USDTet (Wormhole) | [Jupiter](https://jup.ag/) | Dn4noZ5jgGfkntzcQSUZ8czkreiZ1ForXYoV2H8Dm7S1 |
| ETH/WETH | Ether(Wormhole) | [Jupiter](https://jup.ag/) , [Orca](https://www.orca.so/), [Tulip](https://tulip.garden/), [Port](https://mainnet.port.finance/#/markets), | 7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs |
| DAI | DAI(Wormhole) | [Jupiter](https://jup.ag/) | EjmyN6qEC1Tf1JxiG1ae7UTJhUxSwk1TCWNWqxWV4J6o |
| wBTC | wBTC(Wormhole) | [Orca](https://www.orca.so/) | 3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh |
| SHIB | SHIBA INU(Wormhole) | [Raydium](https://raydium.io/swap/) | CiKu4eHsVrc1eueVQeHn7qhXTcVu95gSQmBpX4utjL9z |
| SUSHI | SushiToken (Wormhole) | [Raydium](https://raydium.io/swap/) | ChVzxWRmrTeSgwd3Ui3UumcN8KX7VK3WaD4KGeSKpypj |
| DYDX | DYDX (Wormhole) | [Raydium](https://raydium.io/swap/) | 4Hx6Bj56eGyw8EJrrheM6LBQAvVYRikYCWsALeTrwyRU |
| MANA | MANA(Wormhole) | [Raydium](https://raydium.io/swap/) | 7dgHoN8wBZCc5wbnQ2C47TDnBMAxG4Q5L3KjP67z8kNi |
| SAND | The Sandbox(Wormhole) | [Raydium](https://raydium.io/swap/) | 49c7WuCZkQgc3M4qH8WuEUNXfgwupZf1xqWkDQ7gjRGt | | 8FU95xFJhUUkyyCLU13HSzDLs7oC4QZdXQHL6SCeab36 |
| LDO | Lido DAO Token(Wormhole) | [Jupiter](https://jup.ag/), [Orca](https://www.orca.so/) | HZRCwxP2Vq9PCpPXooayhJ2bxTpo5xfpQrwB1svh332p |
| HXRO | HXRO (Wormhole) | [Raydium](https://raydium.io/swap/), [Orca](https://www.orca.so/) , [Jupiter](https://jup.ag/) | HxhWkVpk5NS4Ltg5nij2G671CKXFRKPK8vy271Ub4uEK |
6 changes: 6 additions & 0 deletions apps/portal/docs/docs/faqs/_liquid-markets/eth-sui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

| Token Origin | Token (Target) | Markets | Token contract address |
| ------------ | -------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| USDC | USDC | [Cetus](https://app.cetus.zone/), [Turbos](https://app.turbos.finance/trade), [BlueMove](https://dex.bluemove.net/) | 0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf |
| WETH | WETH | [Cetus](https://app.cetus.zone/), [Turbos](https://app.turbos.finance/trade) | 0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5 |
| USDT | USDT | [Cetus](https://app.cetus.zone/), [Turbos](https://app.turbos.finance/trade), [BlueMove](https://dex.bluemove.net/) | 0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c |
3 changes: 3 additions & 0 deletions apps/portal/docs/docs/faqs/_liquid-markets/matic-avax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
| Token (origin) | Token (target) | Markets | Contract address | Notes |
| -------------- | --------------- | ----------------------------------------------- | ------------------------------------------ | ----- |
| MATIC | MATIC(Wormhole) | [Traderjoe](https://traderjoexyz.com/avalanche) | 0xf2f13f0B7008ab2FA4A2418F4ccC3684E49D20Eb | |
Loading

0 comments on commit c6b51ad

Please sign in to comment.