Skip to content

Commit

Permalink
VAnchor Substrate Implementation (Missing Withdraw/Transfer Flows) (#…
Browse files Browse the repository at this point in the history
…1139)

Co-authored-by: Dustin Brickwood <[email protected]>
Co-authored-by: Pavan Soratur <[email protected]>
Co-authored-by: vutuanlinh2k2 <[email protected]>
  • Loading branch information
4 people authored May 3, 2023
1 parent 9776cfd commit 72a773b
Show file tree
Hide file tree
Showing 77 changed files with 4,151 additions and 856 deletions.
14 changes: 14 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
NX_BRIDGE_APP_DOMAIN=http:localhost:3000

SENDINBLUE_API_KEY="<SENDINBLUE_API_KEY>"

PRIVACY_POLICY_PAGE_ID="<YOUR_PRIVACY_POLICY_PAGE_ID>"
TERMS_AND_CONDITIONS_PAGE_ID="<TERMS_AND_CONDITIONS_PAGE_ID>"

NOTION_TOKEN_V2="<NOTION_TOKEN_V2>"
NOTION_ACTIVE_USER="<NOTION_ACTIVE_USER>"

NOTION_BLOG_INTEGRATION_POSTS_DATABASE_ID="<NOTION_BLOG_INTEGRATION_POSTS_DATABASE_ID>"
NOTION_BLOG_INTEGRATION_TOKEN="<NOTION_BLOG_INTEGRATION_TOKEN>"
NOTION_BLOG_INTEGRATION_VIDEOS_DATABASE_ID="<NOTION_BLOG_INTEGRATION_VIDEOS_DATABASE_ID>"
NOTION_API_KEY="<NOTION_API_KEY>"
2 changes: 1 addition & 1 deletion .github/workflows/check-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
Expand All @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-bridge-dapp-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
if: github.ref != 'refs/heads/develop' && github.event.pull_request.draft == false
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-faucet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
if: github.ref != 'refs/heads/develop' && github.event.pull_request.draft == false
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/deploy-stats-dapp-dev.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# This action deploys a draft deployment using Netlify to view changes prior to being
# merged. This does NOT deploy to production site and will only be triggered
# merged. This does NOT deploy to production site and will only be triggered
# on changes in the specified paths below.
name: deploy-stats-dapp 🌐

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [ develop ]
branches: [develop]
paths:
- 'apps/stats-dapp/**'
- 'apps/stats-dapp/**'

workflow_dispatch:

Expand All @@ -18,7 +18,7 @@ jobs:
if: github.ref != 'refs/heads/develop' && github.event.pull_request.draft == false
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
Expand Down Expand Up @@ -60,8 +60,7 @@ jobs:
---
_To edit notification comments on pull requests, go to your [Netlify site settings](https://app.netlify.com/sites/development-stats/settings/deploys#deploy-notifications)._
with:
msg: ${{ env.OUTPUT }}
check_for_duplicate_msg: false # OPTIONAL

check_for_duplicate_msg: false # OPTIONAL
2 changes: 1 addition & 1 deletion .github/workflows/deploy-tangle-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
if: github.ref != 'refs/heads/develop' && github.event.pull_request.draft == false
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-webbsite-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
if: github.ref != 'refs/heads/develop' && github.event.pull_request.draft == false
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
Expand Down
24 changes: 14 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Release"
name: 'Release'
on:
push:
branches:
Expand Down Expand Up @@ -33,9 +33,9 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18

#Identify changes
#Identify changes
- uses: marceloprado/has-changed-path@v1
id: changed-hubble
with:
Expand All @@ -60,7 +60,7 @@ jobs:
id: changed-tangle
with:
paths: apps/tangle-website

- name: create env file for webbsite, tangle-site and faucet
run: |
touch .env
Expand All @@ -76,11 +76,15 @@ jobs:
echo NEXT_PUBLIC_FAUCET_BACKEND_URL=${{ secrets.NEXT_PUBLIC_FAUCET_BACKEND_URL }} >> .env
echo NEXT_PUBLIC_TWITTER_CLIENT_ID=${{ secrets.NEXT_PUBLIC_TWITTER_CLIENT_ID }} >> .env
echo TWITTER_CLIENT_SECRET=${{ secrets.TWITTER_CLIENT_SECRET }} >> .env
- name: Install deps
run: yarn install

- name: Generate stats-dapp codegen
run: yarn gql:codegen

- name: build
run: |
yarn install
yarn nx run-many --all --target=build
run: yarn nx run-many --all --target=build

# Create github release
- name: Release hubble
Expand Down Expand Up @@ -110,10 +114,10 @@ jobs:
with:
package-path: apps/webbsite
repo-token: ${{ secrets.REPO_TOKEN }}

- name: Release tangle
if: steps.changed-tangle.outputs.changed == 'true'
uses: ./.github/actions/create-release
with:
package-path: apps/tangle-website
repo-token: ${{ secrets.REPO_TOKEN }}
repo-token: ${{ secrets.REPO_TOKEN }}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ typings/
.yarn-integrity

# dotenv environment variables file
.env*
.env
.env.local
packages/apps/public/cached-fixtures

# next.js build output
Expand Down Expand Up @@ -89,4 +90,4 @@ tmp
/tools/scripts/protocol-solidity/
/tools/scripts/relayer/
/tools/scripts/webb-dapp/
apps/stats-dapp/graphql.schema.json
apps/stats-dapp/graphql.schema.json
3 changes: 3 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ https://github.com/webb-tools/webb-dapp/compare/v0.0.1...HEAD
https://github.com/webb-tools/webb-dapp/releases/tag/v0.0.1
https://github.com/webb-tools/webb-dapp/releases/tag/v0.0.2
https://github.com/webb-tools/webb-dapp/releases/tag/v0.0.3
https://github.com/webb-tools/webb-dapp/releases/tag/v0.0.4
https://github.com/webb-tools/webb-dapp/releases/tag/v0.0.5
https://github.com/webb-tools/webb-dapp/releases/tag/v0.0.6
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16
v18
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ For additional information, please refer to the [Webb Official Documentation](ht

## Prerequisites

This repository makes use of yarn, nodejs, and requires version node v16. To install node.js binaries, installers, and source tarballs, please visit https://nodejs.org/en/download/. Once node.js is installed you may proceed to install [`yarn`](https://classic.yarnpkg.com/en/docs/install):
This repository makes use of yarn, nodejs, and requires version node v18. To install node.js binaries, installers, and source tarballs, please visit https://nodejs.org/en/download/. Once node.js is installed you may proceed to install [`yarn`](https://classic.yarnpkg.com/en/docs/install):

```bash
npm install --global yarn
Expand Down Expand Up @@ -77,7 +77,7 @@ with a local EVM network and local relayer refer to the instructions [here](http

### Setting Up a Local EVM Network with Hubble Bridge

If you want to create a local EVM network with a local relayer and Hubble bridge, we have step-by-step instructions you can follow [here](https://github.com/webb-tools/webb-dapp/tree/develop/apps/bridge-dapp#webb-hubble-bridge). Before setting up a local EVM network be sure to clear your `localStorage`.
If you want to create a local EVM network with a local relayer and Hubble bridge, we have step-by-step instructions you can follow [here](https://github.com/webb-tools/webb-dapp/tree/develop/apps/bridge-dapp#webb-hubble-bridge). Before setting up a local EVM network be sure to clear your `localStorage`.

If you're comfortable running scripts and using a macOS environment, you can use the following scripts in the `/tools/scripts/` directory to quickly set up a local testing environment:

Expand All @@ -86,7 +86,7 @@ If you're comfortable running scripts and using a macOS environment, you can use
- `bridge.sh`: This script sets up and starts the Hubble bridge at `localhost:3000`. You can use this script on its own.
- `local-bridge-network.sh`: This script runs all the above scripts for an entire local network setup. It compiles the Webb smart contracts, sets up the EVM localnet, adds the required `.env` variables, fetches the `webb-relayer` binary, executes it, and starts the local Hubble bridge at `localhost:3000`. It opens three Terminal windows and can only be run in a macOS environment.

We now have our local environment running, next we will want to setup our MetaMask wallet to add test tokens and **reset the account** on Metamask to reset the account’s nonce and tx history. Please refer to the support article [here](https://metamask.zendesk.com/hc/en-us/articles/360015488891-How-to-reset-an-account) for instructions on how to reset a MetaMask account.
We now have our local environment running, next we will want to setup our MetaMask wallet to add test tokens and **reset the account** on Metamask to reset the account’s nonce and tx history. Please refer to the support article [here](https://metamask.zendesk.com/hc/en-us/articles/360015488891-How-to-reset-an-account) for instructions on how to reset a MetaMask account.

Lastly, we will want to one of the following accounts to obtain test tokens.

Expand All @@ -97,7 +97,7 @@ Lastly, we will want to one of the following accounts to obtain test tokens.
0xc0d375903fd6f6ad3edafc2c5428900c0757ce1da10e5dd864fe387b32b91d7e
```

If you are unfamiliar with how to import an account with MetaMask, please refer to the support article [here](https://metamask.zendesk.com/hc/en-us/articles/360015489331-How-to-import-an-account#:~:text=Click%20the%20circle%20icon%20at,key%20and%20click%20%E2%80%9CImport%E2%80%9D).
If you are unfamiliar with how to import an account with MetaMask, please refer to the support article [here](https://metamask.zendesk.com/hc/en-us/articles/360015489331-How-to-import-an-account#:~:text=Click%20the%20circle%20icon%20at,key%20and%20click%20%E2%80%9CImport%E2%80%9D).

## Run stats-dapp locally 💻

Expand Down
1 change: 1 addition & 0 deletions apps/bridge-dapp/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
POLKADOT_TEST_ACCOUNT_ADDRESS="<YOUR_POLKADOT_TEST_ACCOUNT_ADDRESS>"
26 changes: 24 additions & 2 deletions apps/bridge-dapp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,71 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added

- New feature or functionality
- New file or resource

### Changed

- Updates to existing features
- Changes to existing files or resources

### Deprecated

- Features or functionality that will be removed in future versions
- Files or resources that will be removed in future versions

### Removed

- Features or functionality that have been removed
- Files or resources that have been removed

### Fixed

- Bug fixes
- Corrections to existing files or resources

### Security

- Security-related changes, such as vulnerability patches

## [0.0.2] - 2023-04-17

### Added

- Relayer filter by environment: https://github.com/webb-tools/webb-dapp/commit/5c2ef97cd7e7788b858c414f4b9546bdcfcfc2d8
- Relayer fee and refund support: https://github.com/webb-tools/webb-dapp/commit/32ac5b0c7494c7ca746c6e56bda65cbfd692118f
- Added liquidity check on withdrawal: https://github.com/webb-tools/webb-dapp/commit/f9617e364f40b577f0a5bd4d9dc2bc2cea9f3168
- Added failed transaction monitoring: https://github.com/webb-tools/webb-dapp/commit/f9617e364f40b577f0a5bd4d9dc2bc2cea9f3168
- Added max fee calculation: https://github.com/webb-tools/webb-dapp/commit/6f3fa726513accda142dac87b03e2a06e7d094c3

### Changed

- Updated confirmation cards UI: https://github.com/webb-tools/webb-dapp/commit/094b85dbc469f1c8b2250e8030b9b02dcb30d9b1

### Fixed

- Fixed balance calculation: https://github.com/webb-tools/webb-dapp/commit/dece224d7fa739a7b9a02ee3397c9591330e9e9b

## [0.0.3] - 2023-04-25

### Added

- 2 new chains - Avalanche & Scroll: https://github.com/webb-tools/webb-dapp/pull/1048
- 8-sided Bridge with DKG Deployment: https://github.com/webb-tools/webb-dapp/pull/1048

## [0.0.4] - 2023-04-27

### Added

- Fixes quick action prompts: https://github.com/webb-tools/webb-dapp/pull/1147

## [0.0.5] - 2023-04-29

### Fixed

- Only query approval for non-native tokens
- Small UI nits

[Unreleased]: https://github.com/webb-tools/webb-dapp/compare/v0.0.1...HEAD
[0.0.2]: https://github.com/webb-tools/webb-dapp/releases/tag/v0.0.2
[0.0.3]: https://github.com/webb-tools/webb-dapp/releases/tag/v0.0.3
[0.0.4]: https://github.com/webb-tools/webb-dapp/releases/tag/v0.0.4
2 changes: 1 addition & 1 deletion apps/bridge-dapp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@webb-tools/bridge-dapp",
"version": "0.0.3",
"version": "0.0.5",
"main": "./src/index.js",
"dependencies": {
"@ngneat/falso": "^5.7.0",
Expand Down
12 changes: 12 additions & 0 deletions apps/bridge-dapp/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@
"jestConfig": "apps/bridge-dapp/jest.config.ts",
"passWithNoTests": true
}
},
"run-local-tangle": {
"executor": "nx:run-commands",
"options": {
"command": "node --loader ts-node/esm --experimental-specifier-resolution=node --no-warnings apps/bridge-dapp/scripts/localTangle"
}
},
"run-local-substrate": {
"executor": "nx:run-commands",
"options": {
"command": "node --loader ts-node/esm --experimental-specifier-resolution=node --no-warnings apps/bridge-dapp/scripts/localSubstrate"
}
}
},
"tags": []
Expand Down
Loading

0 comments on commit 72a773b

Please sign in to comment.