Skip to content

Commit 86e85d6

Browse files
committed
feat(smart-contracts): 👾
0 parents  commit 86e85d6

File tree

109 files changed

+19449
-0
lines changed

Some content is hidden

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

109 files changed

+19449
-0
lines changed

‎.cz-config.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
module.exports = {
2+
// types
3+
types: [
4+
{ value: 'feat', name: 'feat: New feature' },
5+
{ value: 'fix', name: 'fix: Bug fix' },
6+
{ value: 'test', name: 'test: Adding missing tests' },
7+
{ value: 'docs', name: 'docs: Documentation only changes' },
8+
{ value: 'WIP', name: 'WIP: Work in progress (use this for unfinished EOD commits.)' },
9+
{
10+
value: 'refactor',
11+
name: 'refactor: A code change that neither fixes a bug nor adds a feature',
12+
},
13+
{
14+
value: 'chore',
15+
name: 'chore: Changes to the build process or auxiliary tools\n and libraries such as documentation generation',
16+
},
17+
{ value: 'revert', name: 'revert: Revert to a commit' },
18+
],
19+
20+
// scope
21+
scopes: [],
22+
23+
// scope override
24+
scopeOverrides: {
25+
feat: [
26+
{ name: 'smart-contracts' },
27+
{ name: 'logic' },
28+
{ name: 'test' },
29+
{ name: 'other' },
30+
{ name: 'audit' },
31+
],
32+
fix: [
33+
{ name: 'smart-contracts' },
34+
{ name: 'logic' },
35+
{ name: 'test' },
36+
{ name: 'other' },
37+
{ name: 'audit' },
38+
],
39+
},
40+
41+
// override the messages, defaults are as follows
42+
messages: {
43+
type: "Select the type of change that you're committing:",
44+
scope: '\nWhat is the scope of this change (e.g. component or file name): (press enter to skip)',
45+
// used if allowCustomScopes is true
46+
customScope: 'What is the scope of this change:',
47+
subject: 'Write a short, imperative tense description of the change:\n',
48+
body: 'Provide a longer description of the change (optional). Use "|" to break new line:\n',
49+
breaking: 'List any breaking changes (optional):\n',
50+
footer: 'List your associated Click-Up Ticket (optional):\n',
51+
confirmCommit: 'Are you sure you want to proceed with the commit above?',
52+
},
53+
54+
// settings
55+
allowCustomScopes: false,
56+
allowBreakingChanges: ['feat', 'fix'],
57+
58+
// skip any questions you want
59+
skipQuestions: ['customScope'],
60+
61+
// limit subject length
62+
subjectLimit: 100,
63+
};

‎.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# required for Fuji Testnet deployment
2+
FUJI_RPC=
3+
# required for AVAX Mainnet deployment
4+
MAINNET_RPC=
5+
# required for all non-local deployment onto AVAX mainnet
6+
PRIVATE_KEY=
7+
# required for all non-local deployment onto FUJI testnet
8+
PRIVATE_KEY_FUJI=

‎.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!--- Provide a general summary of your changes in the Title above -->
2+
3+
## Description
4+
5+
<!--- Describe your changes in detail -->
6+
7+
## Motivation and Context
8+
9+
<!--- Why is this change required? What problem does it solve? -->
10+
<!--- If it fixes an open issue, please link to the issue here. -->
11+
12+
## How Has This Been Tested?
13+
14+
<!--- Please describe in detail how you tested your changes. -->
15+
<!--- Include details of your testing environment, and the tests you ran to -->
16+
<!--- see how your change affects other areas of the code, etc. -->
17+
18+
## Screenshots (if appropriate):
19+
20+
## Types of changes
21+
22+
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
23+
24+
- [ ] Bug fix (non-breaking change which fixes an issue)
25+
- [ ] New feature (non-breaking change which adds functionality)
26+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
27+
- [ ] Doc (documentation only changes)
28+
- [ ] Refactor (change that neither fixes a bug nor adds a feature)
29+
- [ ] Test (adding missing tests or correcting existing tests)
30+
- [ ] Style (changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc))
31+
32+
## Checklist:
33+
34+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
35+
36+
- [ ] My code follows the code style of this project.
37+
- [ ] My change requires a change to the documentation.
38+
- [ ] I have updated the documentation accordingly.
39+
- [ ] I have added tests to cover my changes.
40+
- [ ] All new and existing tests passed.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Foundry Tests
2+
3+
on: [push]
4+
5+
jobs:
6+
tests:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v3
11+
with:
12+
submodules: recursive
13+
14+
- name: Install Foundry
15+
uses: foundry-rs/foundry-toolchain@v1
16+
with:
17+
version: nightly-e15e33a07c0920189fc336391f538c3dad53da73
18+
19+
- name: Run Unit Tests
20+
run: npm run forge:unit-tests
21+
22+
- name: Run Fork Tests
23+
run: npm run forge:fork-tests
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Code Coverage
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
coverage:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-node@v3
12+
with:
13+
node-version: 16.x
14+
15+
- name: Cache Dependencies
16+
id: cache
17+
uses: actions/cache@v3
18+
with:
19+
path: ./node_modules
20+
key: coverage-${{ hashFiles('package-lock.json') }}
21+
22+
- name: Install Dependencies
23+
if: steps.cache.outputs.cache-hit != 'true'
24+
run: npm install
25+
26+
- name: Run Code Coverage
27+
run: npm run coverage
28+
29+
- name: Coveralls
30+
uses: coverallsapp/github-action@master
31+
with:
32+
github-token: ${{ secrets.GITHUB_TOKEN }}

‎.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
node_modules
2+
.env
3+
4+
#foundry
5+
build
6+
broadcast
7+
typechain-types
8+
cache
9+
10+
# Coverage files
11+
lcov.info
12+
coverage
13+
coverage.json
14+
15+
# OS
16+
.DS_Store
17+
18+
# IDE
19+
.idea/
20+
.vscode

‎.gitmodules

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[submodule "lib/ds-test"]
2+
path = lib/ds-test
3+
url = https://github.com/dapphub/ds-test
4+
[submodule "lib/openzeppelin-contracts"]
5+
path = lib/openzeppelin-contracts
6+
url = https://github.com/OpenZeppelin/openzeppelin-contracts
7+
[submodule "lib/chainlink-brownie-contracts"]
8+
path = lib/chainlink-brownie-contracts
9+
url = https://github.com/smartcontractkit/chainlink-brownie-contracts
10+
[submodule "lib/openzeppelin-upgrades"]
11+
path = lib/openzeppelin-upgrades
12+
url = https://github.com/OpenZeppelin/openzeppelin-upgrades
13+
[submodule "lib/openzeppelin-contracts-upgradeable"]
14+
path = lib/openzeppelin-contracts-upgradeable
15+
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
16+
[submodule "lib/chainlink"]
17+
path = lib/chainlink
18+
url = https://github.com/smartcontractkit/chainlink
19+
[submodule "lib/forge-std"]
20+
path = lib/forge-std
21+
url = https://github.com/foundry-rs/forge-std

‎.husky/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run solhint
5+
npm run format-sol
6+
npm run compile

‎.solhint.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"extends": "solhint:recommended",
3+
"plugins": [],
4+
"rules": {
5+
"mark-callable-contracts": "off",
6+
"no-empty-blocks": "off",
7+
"compiler-version": ["warn", "0.8.11"],
8+
"private-vars-leading-underscore": "off",
9+
"code-complexity": "warn",
10+
"const-name-snakecase": "warn",
11+
"function-max-lines": "warn",
12+
"func-visibility": ["warn", { "ignoreConstructors": true }],
13+
"max-line-length": ["warn", 160],
14+
"avoid-suicide": "error",
15+
"avoid-sha3": "warn",
16+
"reentrancy": "error",
17+
"not-rely-on-time": "off",
18+
"reason-string": ["warn", { "maxLength": 64 }],
19+
"ordering": "warn"
20+
}
21+
}

‎.solhintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
mocks/
3+
lib/
4+
test/

0 commit comments

Comments
 (0)