Skip to content

Commit ab084f7

Browse files
author
happenwah
committed
chore: first commit
0 parents  commit ab084f7

21 files changed

+19649
-0
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cache
2+
dist
3+
typechain

.eslintrc.json

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"env": {
3+
"commonjs": true,
4+
"es2021": true,
5+
"node": true,
6+
"mocha": true
7+
},
8+
"extends": ["eslint:recommended", "prettier"],
9+
"parserOptions": {
10+
"ecmaVersion": 12
11+
},
12+
// Typescript config
13+
"overrides": [
14+
{
15+
"files": ["*.ts"],
16+
"parser": "@typescript-eslint/parser",
17+
"parserOptions": { "project": "./tsconfig.json" },
18+
"plugins": ["@typescript-eslint", "prettier"],
19+
"extends": [
20+
"eslint:recommended",
21+
"plugin:@typescript-eslint/recommended",
22+
"plugin:@typescript-eslint/eslint-recommended",
23+
"prettier"
24+
],
25+
"rules": {
26+
"prettier/prettier": "error",
27+
"@typescript-eslint/no-unused-vars": "error",
28+
"@typescript-eslint/no-explicit-any": "warn",
29+
"@typescript-eslint/naming-convention": [
30+
"error",
31+
{
32+
"selector": "default",
33+
"format": ["camelCase"]
34+
},
35+
{
36+
"selector": "variable",
37+
"format": ["camelCase", "UPPER_CASE"]
38+
},
39+
{
40+
"selector": "parameter",
41+
"format": ["camelCase"],
42+
"leadingUnderscore": "allow"
43+
},
44+
{
45+
"selector": ["objectLiteralProperty"],
46+
"format": ["camelCase", "PascalCase"]
47+
},
48+
{
49+
"selector": ["classProperty"],
50+
"modifiers": ["private", "static"],
51+
"format": ["PascalCase", "UPPER_CASE"]
52+
},
53+
{
54+
"selector": ["classProperty", "classMethod"],
55+
"modifiers": ["private"],
56+
"format": ["camelCase"],
57+
"leadingUnderscore": "require"
58+
},
59+
{
60+
"selector": ["classProperty", "classMethod"],
61+
"modifiers": ["protected"],
62+
"format": ["camelCase"],
63+
"leadingUnderscore": "require"
64+
},
65+
{
66+
"selector": "typeLike",
67+
"format": ["PascalCase"]
68+
},
69+
{
70+
"selector": ["enumMember"],
71+
"format": ["camelCase", "PascalCase"]
72+
},
73+
{
74+
"selector": "variable",
75+
"types": ["boolean"],
76+
"format": ["PascalCase"],
77+
"prefix": ["is", "should", "has", "can", "did", "will"]
78+
}
79+
]
80+
}
81+
}
82+
]
83+
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.sol linguist-language=Solidity

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Dependency directory
2+
node_modules
3+
4+
# local env variables
5+
.env
6+
7+
# coverage
8+
coverage
9+
.nyc_output
10+
11+
# cache
12+
.eslintcache
13+
14+
# hardhat
15+
artifacts
16+
cache
17+
18+
# macOS
19+
.DS_Store
20+
*.icloud
21+
22+
# redis
23+
dump.rdb
24+
25+
# typechain
26+
typechain
27+
28+
# typescript
29+
dist
30+
31+
# VS Code
32+
.vscode
33+

.husky/pre-commit

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+
yarn install && yarn build && yarn lint-staged && yarn lint:sol

.husky/pre-push

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+
yarn test

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
artifacts
2+
dist
3+
cache
4+
typechain
5+
deployments

.prettierrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"overrides": [
3+
{
4+
"files": "*.sol",
5+
"options": {
6+
"compiler": "0.8.11"
7+
}
8+
}
9+
]
10+
}

.solhint.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"extends": "solhint:recommended",
3+
"plugins": ["prettier"],
4+
"rules": {
5+
"prettier/prettier": "error",
6+
"code-complexity": ["error", 5],
7+
"function-max-lines": ["error", 40],
8+
"max-line-length": ["error", 100],
9+
"max-states-count": ["error", 3],
10+
"no-empty-blocks": "error",
11+
"no-unused-vars": "error",
12+
"payable-fallback": "off",
13+
"reason-string": ["off", { "maxLength": 32 }],
14+
"constructor-syntax": "off",
15+
"comprehensive-interface": "off",
16+
"quotes": ["error", "double"],
17+
"const-name-snakecase": "error",
18+
"contract-name-camelcase": "error",
19+
"event-name-camelcase": "error",
20+
"func-name-mixedcase": "error",
21+
"func-param-name-mixedcase": "error",
22+
"modifier-name-mixedcase": "error",
23+
"private-vars-leading-underscore": ["error", { "strict": false }],
24+
"var-name-mixedcase": "error",
25+
"imports-on-top": "error",
26+
"ordering": "error",
27+
"visibility-modifier-order": "error",
28+
"avoid-call-value": "off",
29+
"avoid-low-level-calls": "off",
30+
"avoid-sha3": "error",
31+
"avoid-suicide": "error",
32+
"avoid-throw": "error",
33+
"avoid-tx-origin": "off",
34+
"check-send-result": "error",
35+
"compiler-version": ["error", "0.8.11"],
36+
"mark-callable-contracts": "off",
37+
"func-visibility": ["error", { "ignoreConstructors": true }],
38+
"multiple-sends": "error",
39+
"no-complex-fallback": "error",
40+
"no-inline-assembly": "off",
41+
"not-rely-on-block-hash": "error",
42+
"not-rely-on-time": "error",
43+
"reentrancy": "error",
44+
"state-visibility": "error"
45+
}
46+
}

.solhintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
contracts/functions
3+
contracts/vendor
4+
contracts/interfaces

0 commit comments

Comments
 (0)