Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VEN-2138][VEN-2010]: add xvs-token-bridge and deployment scripts #1

Merged
merged 30 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
bf0ff62
feat: add xvs-token-bridge
GitGuru7 Nov 7, 2023
0d9e96f
chore: update package.json
GitGuru7 Nov 8, 2023
b2e8ae4
feat: add xvs bridge deployment script
GitGuru7 Nov 8, 2023
8fc946f
fix: build
GitGuru7 Nov 8, 2023
09021fc
chore: remove changelog plugin
GitGuru7 Nov 8, 2023
15bd3cb
fix: test styles
GitGuru7 Nov 8, 2023
aba9539
fix: resolve comments
GitGuru7 Nov 8, 2023
b0d9440
feat: add XVS deployment scripts
GitGuru7 Nov 10, 2023
5fe32a2
feat: add sepolia deployments of xvs-bridge
GitGuru7 Nov 10, 2023
06a8e0c
ci: add exporting deployments to ci
coreyar Nov 16, 2023
9bf3809
Merge pull request #3 from VenusProtocol/feat/xvs-bridge-export-deplo…
coreyar Nov 17, 2023
2e7357d
chore: fix linter and configure gitignore for yarn files
chechu Nov 20, 2023
598fc86
chore: fix generation of deployment files
chechu Nov 20, 2023
c37302e
feat: updating deployment files
chechu Nov 20, 2023
0d4d8ea
fix: typo
GitGuru7 Nov 22, 2023
9384b3c
feat: use contract addresses from packages
GitGuru7 Nov 22, 2023
c10a8f4
chore: unify env file
chechu Nov 27, 2023
e2f8e38
chore: fix env example format
chechu Nov 27, 2023
b6d06b7
chore: make .env.example compatible with the CI pipeline
chechu Nov 27, 2023
c6f6408
chore: use private key for ethereum deployments
chechu Nov 27, 2023
08854aa
feat: updating deployment files
chechu Nov 27, 2023
9d3a335
fix: resolve comments
GitGuru7 Nov 28, 2023
9172b7d
Merge branch 'feat/xvs-bridge' into feat/xvs-bridge-deployments
GitGuru7 Nov 28, 2023
b4b95cf
Merge pull request #2 from VenusProtocol/feat/xvs-bridge-deployments
GitGuru7 Nov 28, 2023
05a1ba9
feat: updating deployment files
GitGuru7 Nov 28, 2023
ad17933
feat: use custom error instead of require check
GitGuru7 Nov 28, 2023
a5200a4
fix: deployment scripts
GitGuru7 Nov 28, 2023
62aba9c
feat: update deployment for latest impl
GitGuru7 Nov 28, 2023
5ded843
feat: updating deployment files
GitGuru7 Nov 28, 2023
5de26e4
fix: bscmainnet lz end point
GitGuru7 Nov 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# true or false
FORK=false
FORKED_NETWORK=bscmainnet
#FORKED_NETWORK=bsctestnet
#FORKED_NETWORK=sepolia
#FORKED_NETWORK=ethereum

MNEMONIC="here is where your twelve words mnemonic should be put my friend"
DEPLOYER_PRIVATE_KEY=

## Archive nodes
#ARCHIVE_NODE_bsctestnet=https://bsc-testnet.nodereal.io/v1/API_KEY
#ARCHIVE_NODE_bscmainnet=https://bsc-mainnet.nodereal.io/v1/API_KEY
#ARCHIVE_NODE_bscmainnet=http://127.0.0.1:1248
#ARCHIVE_NODE_sepolia=https://ethereum-sepolia.blockpi.network/v1/rpc/public
#ARCHIVE_NODE_ethereum=https://eth-mainnet.nodereal.io/v1/API_KEY
12 changes: 12 additions & 0 deletions .eslint-tsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "./tsconfig.json",
"include": [
"jest.config.js",
".eslintrc.js",
"test",
"scenario",
"deploy",
"docgen-templates",
"commitlint.config.js"
]
}
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
artifacts
cache
coverage
dist
typechain
53 changes: 53 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"env": {
"browser": false,
"es2021": true,
"mocha": true,
"node": true,
},
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"project": ".eslint-tsconfig",
},
"root": true,
"rules": {
"@typescript-eslint/no-floating-promises": [
"error",
{
"ignoreIIFE": true,
"ignoreVoid": true,
},
],
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "_",
"varsIgnorePattern": "_",
},
],
"spaced-comment": [
"error",
"always",
{
"line": {
"exceptions": ["-", "+"],
"markers": ["=", "!", "/"],
},
"block": {
"exceptions": ["-", "+"],
"markers": ["=", "!", ":", "::"],
"balanced": true
}
}
]
}
}
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* text eol=lf
*.pdf binary
*.sol linguist-language=Solidity
17 changes: 17 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Description

<!-- Describe your changes here -->

Resolves #<!-- issue id -->

## Checklist

<!--
Any non-WIP PR should have all the checkmarks set.
If a checkmark is not applicable to your PR, mark it as done
-->

- [ ] I have updated the documentation to account for the changes in the code.
- [ ] If I added new functionality, I added tests covering it.
- [ ] If I fixed a bug, I added a test preventing this bug from silently reappearing again.
- [ ] My contribution follows [Venus contribution guidelines](docs/CONTRIBUTING.md).
38 changes: 38 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
push:
branches:
- main
- develop

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-node@v2
with:
cache: "yarn"

- name: Install dependencies
# Hack to get around failing "ethereumjs-abi The remote archive doesn't match the expected checksum" error
run: YARN_CHECKSUM_BEHAVIOR=update yarn

- name: Build
run: yarn build

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.VENUS_TOOLS_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_NAME: Venus Tools
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: Venus Tools
GIT_COMMITTER_EMAIL: [email protected]
run: yarn semantic-release
126 changes: 126 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
workflow_dispatch:
jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 18
cache: "yarn"

- name: Install dependencies
# Hack to get around failing "ethereumjs-abi The remote archive doesn't match the expected checksum" error
run: YARN_CHECKSUM_BEHAVIOR=update yarn

- name: Check linting of solidity and typescript
run: yarn lint

test:
name: Test
runs-on: ubuntu-22.04
env:
NODE_OPTIONS: --max-old-space-size=4096
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: 18
cache: "yarn"

- name: Install deps
run: yarn

- name: Run hardhat compile and tests coverage
run: |
source .env.example
yarn hardhat:compile && yarn hardhat:coverage

- name: Code Coverage Report
uses: irongut/[email protected]
with:
filename: coverage/**/cobertura-coverage.xml
badge: true
fail_below_min: false
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: "50 80"

- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md

deploy:
name: Deploy
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 18
cache: "yarn"

- name: Install dependencies
# Hack to get around failing "ethereumjs-abi The remote archive doesn't match the expected checksum" error
run: YARN_CHECKSUM_BEHAVIOR=update yarn

- name: Build
run: yarn build

- name: Verify deployments work
run: yarn hardhat deploy

export-deployments:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Check out code
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.VENUS_TOOLS_TOKEN }}

- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 18
cache: "yarn"

- name: Install dependencies
# Hack to get around failing "ethereumjs-abi The remote archive doesn't match the expected checksum" error
run: YARN_CHECKSUM_BEHAVIOR=update yarn

- name: Export deployments
run: |
yarn hardhat export --network bsctestnet --export ./deployments/bsctestnet.json
yarn hardhat export --network bscmainnet --export ./deployments/bscmainnet.json
yarn hardhat export --network sepolia --export ./deployments/sepolia.json
yarn hardhat export --network ethereum --export ./deployments/ethereum.json
yarn prettier

- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "feat: updating deployment files"
file_pattern: "deployments/*.json"
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
node_modules
.env
coverage
coverage.json
typechain
typechain-types

# Hardhat files
cache
artifacts

# yarn
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hardhat.config.ts
scripts
test
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
artifacts
cache
coverage*
gasReporterOutput.json
dist
typechain
docs
14 changes: 14 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"arrowParens": avoid,
"bracketSpacing": true,
"endOfLine": "auto",
"importOrder": ["module-alias/register", "<THIRD_PARTY_MODULES>", "^[./]"],
"importOrderParserPlugins": ["typescript"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"printWidth": 120,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": all,
"overrides": [{ "files": "*.sol", "options": { "tabWidth": 4 } }],
}
Loading