-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f963fa1
Showing
32 changed files
with
13,967 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#FORK_TESTNET=true | ||
#BSC_ARCHIVE_NODE=https://bsc-testnet.nodereal.io/v1/<API key> | ||
#FORK_MAINNET=true | ||
#BSC_ARCHIVE_NODE=https://bsc-mainnet.nodereal.io/v1/<API key> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"include": ["jest.config.js", ".eslintrc.js", "tests", "scenario", "deploy", "docgen-templates", "commitlint.config.js"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules | ||
artifacts | ||
cache | ||
coverage | ||
dist | ||
typechain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* text eol=lf | ||
*.pdf binary | ||
*.sol linguist-language=Solidity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: tools@venus.io | ||
GIT_COMMITTER_NAME: Venus Tools | ||
GIT_COMMITTER_EMAIL: tools@venus.io | ||
run: yarn semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
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/CodeCoverageSummary@v1.3.0 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
node_modules | ||
.env | ||
coverage | ||
coverage.json | ||
typechain | ||
.openzeppelin | ||
#Hardhat files | ||
cache | ||
artifacts | ||
|
||
# yarn | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/releases | ||
!.yarn/plugins | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
# Build | ||
dist | ||
docs | ||
|
||
deployments/localhost | ||
|
||
# OSX | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
hardhat.config.ts | ||
scripts | ||
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
node_modules | ||
artifacts | ||
cache | ||
coverage* | ||
gasReporterOutput.json | ||
dist | ||
typechain | ||
CHANGELOG.md | ||
docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } }], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"plugins": [ | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
"preset": "conventionalcommits", | ||
"releaseRules": [ | ||
{"breaking": true, "release": "major"}, | ||
{ | ||
"type": "build", | ||
"release": false | ||
}, | ||
{ | ||
"type": "chore", | ||
"release": false | ||
}, | ||
{ | ||
"type": "docs", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "ci", | ||
"release": false | ||
}, | ||
{ | ||
"type": "feat", | ||
"release": "minor" | ||
}, | ||
{ | ||
"type": "fix", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "refactor", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "test", | ||
"release": false | ||
} | ||
], | ||
"parserOpts": { | ||
"noteKeywords": [ | ||
"BREAKING CHANGE", | ||
"BREAKING CHANGES" | ||
] | ||
} | ||
} | ||
], | ||
[ | ||
"@semantic-release/release-notes-generator", | ||
{ | ||
"preset": "conventionalcommits" | ||
} | ||
], | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
"changelogFile": "CHANGELOG.md" | ||
} | ||
], | ||
[ | ||
"@semantic-release/npm", | ||
{ | ||
"npmPublish": true | ||
} | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": [ | ||
"package.json", | ||
"CHANGELOG.md" | ||
], | ||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
} | ||
] | ||
], | ||
"branches": [ | ||
{ | ||
"name": "main" | ||
}, | ||
{ | ||
"name": "develop", | ||
"prerelease": "dev" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const { execSync } = require("child_process"); | ||
|
||
module.exports = { | ||
port: 8555, | ||
providerOpts: { | ||
// See example coverage settings at https://github.com/sc-forks/solidity-coverage | ||
gas: 0xfffffff, | ||
gasPrice: 0x01, | ||
}, | ||
mocha: { | ||
enableTimeouts: false, | ||
grep: /@gas|@no-cov/, | ||
invert: true, | ||
}, | ||
skipFiles: ["test"], | ||
istanbulReporter: ["html", "lcov", "text", "json", "cobertura"], | ||
}; |
Oops, something went wrong.