Skip to content

Commit 8d87cbe

Browse files
authored
Merge pull request #1 from VenusProtocol/set-up
[VEN-3347]: Initial configurations
2 parents c694840 + 3d7c3c7 commit 8d87cbe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+17256
-2
lines changed

.env.example

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# true or false
2+
FORK=false
3+
FORKED_NETWORK=bscmainnet
4+
5+
# Replace with your deployer's private key
6+
DEPLOYER_PRIVATE_KEY=
7+
8+
#Archive nodes - Replace <YOUR_KEY_HERE> with your actual keys and uncomment the line you need
9+
#ARCHIVE_NODE_bsctestnet=https://bsc-testnet.nodereal.io/v1/<YOUR_KEY_HERE>
10+
#ARCHIVE_NODE_bscmainnet=https://bsc-mainnet.nodereal.io/v1/<YOUR_KEY_HERE>
11+
#ARCHIVE_NODE_sepolia=https://ethereum-sepolia.blockpi.network/v1/rpc/public
12+
#ARCHIVE_NODE_ethereum=https://eth-mainnet.nodereal.io/v1/<YOUR_KEY_HERE>
13+
#ARCHIVE_NODE_opbnbtestnet=https://opbnb-testnet.nodereal.io/v1/<YOUR_KEY_HERE>
14+
#ARCHIVE_NODE_opbnbmainnet=https://opbnb-mainnet.nodereal.io/v1/<YOUR_KEY_HERE>
15+
#ARCHIVE_NODE_arbitrumsepolia=https://sepolia-rollup.arbitrum.io/rpc
16+
#ARCHIVE_NODE_arbitrumone=https://open-platform.nodereal.io/<YOUR_KEY_HERE>/arbitrum-nitro/
17+
#ARCHIVE_NODE_zksyncsepolia=https://zksync-sepolia.g.alchemy.com/v2/<YOUR_KEY_HERE>
18+
#ARCHIVE_NODE_zksyncmainnet=https://open-platform.nodereal.io/<YOUR_KEY_HERE>/zksync
19+
#ARCHIVE_NODE_opsepolia=https://sepolia.optimism.io
20+
#ARCHIVE_NODE_opmainnet=https://opt-mainnet.nodereal.io/v1/<YOUR_KEY_HERE>
21+
#ARCHIVE_NODE_basesepolia=https://sepolia.base.org
22+
#ARCHIVE_NODE_basemainnet=https://open-platform.nodereal.io/<YOUR_KEY_HERE>/base
23+
#ARCHIVE_NODE_unichainsepolia=https://unichain-sepolia.g.alchemy.com/v2/<YOUR_KEY_HERE>
24+
#ARCHIVE_NODE_unichainmainnet=https://unichain-mainnet.g.alchemy.com/v2/<YOUR_KEY_HERE>
25+
26+
# Uncomment the lines below if you want to deploy on mainnet using Frame Wallet
27+
#ARCHIVE_NODE_ethereum=http://127.0.0.1:1248
28+
#ARCHIVE_NODE_bscmainnet=http://127.0.0.1:1248
29+
30+
# Replace with your Etherscan API key
31+
ETHERSCAN_API_KEY=
32+
33+
# Set to true or false to control gas reporting
34+
REPORT_GAS=
35+
36+
# Set to true or false to deploy contracts based on timestamp or block
37+
IS_TIME_BASED_DEPLOYMENT=false
38+
HARDHAT_FORK_NETWORK=

.eslint-tsconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"include": ["jest.config.js", ".eslintrc.js", "tests", "scenario", "deploy", "docgen-templates", "commitlint.config.js", "./hardhat.config.zksync.ts", "type-extensions.ts", "helpers"]
4+
}

.eslintignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
artifacts
3+
artifacts-zk
4+
cache
5+
cache-zk
6+
coverage
7+
dist
8+
typechain

.eslintrc

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"env": {
3+
"browser": false,
4+
"es2021": true,
5+
"mocha": true,
6+
"node": true,
7+
},
8+
"plugins": ["@typescript-eslint"],
9+
"extends": [
10+
"eslint:recommended",
11+
"plugin:@typescript-eslint/eslint-recommended",
12+
"plugin:@typescript-eslint/recommended",
13+
"prettier",
14+
],
15+
"parser": "@typescript-eslint/parser",
16+
"parserOptions": {
17+
"ecmaVersion": 12,
18+
"project": ".eslint-tsconfig",
19+
},
20+
"root": true,
21+
"rules": {
22+
"@typescript-eslint/no-floating-promises": [
23+
"error",
24+
{
25+
"ignoreIIFE": true,
26+
"ignoreVoid": true,
27+
},
28+
],
29+
"@typescript-eslint/no-inferrable-types": "off",
30+
"@typescript-eslint/no-unused-vars": [
31+
"error",
32+
{
33+
"argsIgnorePattern": "_",
34+
"varsIgnorePattern": "_",
35+
},
36+
],
37+
"spaced-comment": [
38+
"error",
39+
"always",
40+
{
41+
"line": {
42+
"exceptions": ["-", "+"],
43+
"markers": ["=", "!", "/"],
44+
},
45+
"block": {
46+
"exceptions": ["-", "+"],
47+
"markers": ["=", "!", ":", "::"],
48+
"balanced": true
49+
}
50+
}
51+
]
52+
}
53+
}

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text eol=lf
2+
*.pdf binary
3+
*.sol linguist-language=Solidity

.github/pull_request_template.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Description
2+
3+
<!-- Describe your changes here -->
4+
5+
Resolves #<!-- issue id -->
6+
7+
## Checklist
8+
9+
<!--
10+
Any non-WIP PR should have all the checkmarks set.
11+
If a checkmark is not applicable to your PR, mark it as done
12+
-->
13+
14+
- [ ] I have updated the documentation to account for the changes in the code.
15+
- [ ] If I added new functionality, I added tests covering it.
16+
- [ ] If I fixed a bug, I added a test preventing this bug from silently reappearing again.
17+
- [ ] My contribution follows [Venus contribution guidelines](docs/CONTRIBUTING.md).

.github/workflows/cd.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
persist-credentials: false
18+
19+
- uses: actions/setup-node@v4
20+
with:
21+
cache: "yarn"
22+
23+
- name: Install dependencies
24+
run: yarn
25+
26+
- name: Build
27+
run: yarn build
28+
29+
- name: Release
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.VENUS_TOOLS_TOKEN }}
32+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
33+
GIT_AUTHOR_NAME: Venus Tools
34+
GIT_AUTHOR_EMAIL: tools@venus.io
35+
GIT_COMMITTER_NAME: Venus Tools
36+
GIT_COMMITTER_EMAIL: tools@venus.io
37+
run: yarn semantic-release

.github/workflows/ci.yaml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [main, develop]
5+
pull_request:
6+
branches: [main, develop]
7+
workflow_dispatch:
8+
jobs:
9+
lint:
10+
name: Lint
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- name: Check out code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js environment
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
cache: "yarn"
21+
22+
- name: Install dependencies
23+
run: yarn
24+
25+
- name: Check linting of solidity and typescript
26+
run: yarn lint
27+
28+
test:
29+
name: Test
30+
runs-on: ubuntu-22.04
31+
env:
32+
NODE_OPTIONS: --max-old-space-size=4096
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- uses: actions/setup-node@v4
37+
with:
38+
node-version: 20
39+
cache: "yarn"
40+
41+
- name: Install deps
42+
run: yarn
43+
44+
- name: Run hardhat compile and tests coverage
45+
run: |
46+
source .env.example
47+
yarn hardhat:compile && yarn hardhat:coverage
48+
49+
- name: Code Coverage Report
50+
uses: irongut/CodeCoverageSummary@v1.3.0
51+
with:
52+
filename: coverage/cobertura-coverage.xml
53+
badge: true
54+
fail_below_min: false
55+
format: markdown
56+
hide_branch_rate: false
57+
hide_complexity: true
58+
indicators: true
59+
output: both
60+
thresholds: "50 80"
61+
62+
- name: Add Coverage PR Comment
63+
uses: marocchino/sticky-pull-request-comment@v2
64+
if: github.event_name == 'pull_request'
65+
with:
66+
recreate: true
67+
path: code-coverage-results.md
68+
69+
deploy:
70+
name: Deploy
71+
runs-on: ubuntu-22.04
72+
steps:
73+
- name: Check out code
74+
uses: actions/checkout@v4
75+
76+
- name: Setup Node.js environment
77+
uses: actions/setup-node@v4
78+
with:
79+
node-version: 20
80+
cache: "yarn"
81+
82+
- name: Install dependencies
83+
run: yarn
84+
85+
- name: Build
86+
run: yarn build
87+
88+
- name: Verify deployments work
89+
run: yarn hardhat deploy
90+
91+
export-deployments:
92+
runs-on: ubuntu-latest
93+
permissions:
94+
contents: write
95+
96+
steps:
97+
- name: Check out code
98+
uses: actions/checkout@v4
99+
with:
100+
ref: ${{ github.head_ref }}
101+
token: ${{ secrets.VENUS_TOOLS_TOKEN }}
102+
103+
- name: Setup Node.js environment
104+
uses: actions/setup-node@v4
105+
with:
106+
node-version: 20
107+
cache: "yarn"
108+
109+
- name: Install dependencies
110+
run: yarn
111+
112+
- name: Export deployments
113+
run: |
114+
for NETWORK in bsctestnet bscmainnet ethereum sepolia opbnbtestnet opbnbmainnet arbitrumsepolia arbitrumone opsepolia opmainnet basesepolia basemainnet unichainsepolia unichainmainnet; do
115+
EXPORT=true yarn hardhat export --network ${NETWORK} --export ./deployments/${NETWORK}.json
116+
jq -M '{name, chainId, addresses: .contracts | map_values(.address)}' ./deployments/${NETWORK}.json > ./deployments/${NETWORK}_addresses.json
117+
done
118+
for NETWORK in zksyncsepolia zksyncmainnet; do
119+
EXPORT=true yarn hardhat export --network ${NETWORK} --export ./deployments/${NETWORK}.json --config hardhat.config.zksync.ts
120+
jq -M '{name, chainId, addresses: .contracts | map_values(.address)}' ./deployments/${NETWORK}.json > ./deployments/${NETWORK}_addresses.json
121+
done
122+
yarn prettier
123+
124+
- uses: stefanzweifel/git-auto-commit-action@v5
125+
with:
126+
commit_message: "feat: updating deployment files"
127+
file_pattern: "deployments/*.json"

.gitignore

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
node_modules
2+
.env
3+
coverage
4+
coverage.json
5+
typechain
6+
.openzeppelin
7+
#Hardhat files
8+
cache
9+
cache-zk
10+
artifacts
11+
artifacts-zk
12+
13+
#Compound
14+
allFiredEvents
15+
.build-temp
16+
build
17+
build_
18+
node_modules
19+
.env
20+
.certora*
21+
certora_*
22+
coverage/
23+
coverage.json
24+
coverageEnv/
25+
emv-*/
26+
formulas/
27+
outputs/
28+
Reports/
29+
scTopics
30+
test-results.xml
31+
.tsbuilt
32+
yarn-error.log
33+
scenario/build/webpack.js
34+
.scencache
35+
.solcache
36+
.solcachecov
37+
scenario/.tscache
38+
script/certora
39+
tests/scenarios/
40+
tests/Scenarios/
41+
junit.xml
42+
.build
43+
.last_confs
44+
node_modules_tmp
45+
.idea
46+
47+
secrets.json
48+
49+
# yarn
50+
.yarn/*
51+
!.yarn/patches
52+
!.yarn/releases
53+
!.yarn/plugins
54+
!.yarn/sdks
55+
!.yarn/versions
56+
57+
# Build
58+
dist
59+
docs
60+
61+
contracts/oracle/*
62+
contracts/generated
63+
deployments/localhost
64+
65+
# OSX
66+
.DS_Store

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit ${1} --config ./commitlint.config.js

0 commit comments

Comments
 (0)