Skip to content

Commit

Permalink
setup repo
Browse files Browse the repository at this point in the history
  • Loading branch information
peersky committed Sep 1, 2023
1 parent c31b8f4 commit d650f86
Show file tree
Hide file tree
Showing 10 changed files with 198 additions and 44 deletions.
24 changes: 24 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"env": {
"es2022": true,
"browser": true,
"node": true,
"mocha": true
},
"extends" : [
"eslint:recommended",
"plugin:promise/recommended",
"prettier" // eslint-config-prettier
],
"plugins": [
"promise"
],
"globals" : {
"artifacts": "readonly",
"contract": "readonly",
"assert": "readonly",
"web3": "readonly"
},
}
27 changes: 27 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"env": {
"es2022": true,
"browser": true,
"node": true,
"mocha": true
},
"extends" : [
"eslint:recommended",
"plugin:promise/recommended",
"prettier" // eslint-config-prettier
],
"plugins": [
"promise"
],
"globals" : {
"artifacts": "readonly",
"contract": "readonly",
"assert": "readonly",
"web3": "readonly"
},
"rules": {
"no-unused-vars": "off"
}
}
17 changes: 17 additions & 0 deletions .github/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: setup
runs:
using: 'composite'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.17.0
cache: 'yarn'

- name: Installing dependencies
run: yarn install --frozen-lockfile
shell: bash
21 changes: 21 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI
on: push
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: './.github/setup'
- name: Building
run: yarn build
- name: Linting
run: yarn lint

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: './.github/setup'

- name: Running tests
run: yarn test
4 changes: 4 additions & 0 deletions .mocharc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
require: 'hardhat/register',
timeout: 4000,
};
12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_modules
artifacts
cache
coverage*
gasReporterOutput.json
package.json
img
.env
.secrets
README.md
coverage.json
deployments
14 changes: 14 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"printWidth": 120,
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "avoid",
"overrides": [
{
"files": "*.sol",
"options": {
"singleQuote": false
}
}
]
}
15 changes: 15 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

{
"rules": {
"no-unused-vars": "error",
"const-name-snakecase": "error",
"contract-name-camelcase": "error",
"event-name-camelcase": "error",
"func-name-mixedcase": "error",
"func-param-name-mixedcase": "error",
"modifier-name-mixedcase": "error",
"private-vars-leading-underscore": "error",
"var-name-mixedcase": "error",
"imports-on-top": "error"
}
}
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
"private": true,
"description": "Contracts for vote4best.app",
"scripts": {
"frontend:dev": "source .secrets/dev.env && yarn workspace bestofweb run dev",
"frontend:build": "yarn workspace bestofweb run build",
"discord:dev": "source .secrets/bot_mumbai.env && yarn workspace discord-bot run dev",
"contracts:upgrade:game:mumbai": "source .secrets/hh_mumbai.env && yarn hardhat --network mumbai deploy --tags upgrade_game",
"contracts:test": "export NODE_ENV=TEST && yarn hardhat test",
"contracts:build": "yarn hardhat compile"
"lint:fix": "eslint ./ --ext js,jsx,ts,tsx --fix",
"lint": "eslint ./ --ext js,jsx,ts,tsx && yarn run lint:sol",
"upgrade:game:mumbai": "source .secrets/hh_mumbai.env && yarn hardhat --network mumbai deploy --tags upgrade_game",
"test": "export NODE_ENV=TEST && yarn hardhat test",
"build": "yarn hardhat compile"
},
"keywords": [],
"author": "Tim Pechersky (@Peersky)",
Expand All @@ -33,12 +32,12 @@
"@types/cli-table": "^0.3.0",
"@types/crypto-js": "^4.1.1",
"@types/node-fetch": "^2.6.2",
"@typescript-eslint/parser": "^5.48.1",
"chai": "^4.3.6",
"crypto-js": "^4.1.1",
"eslint": "^8.34.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.6.0",
"eslint-config-standard": "^17.0.0",
"eslint": "^8.31.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-promise": "^6.1.1",
"eth-create2-calculator": "^1.1.5",
"ethers": "^5.6.6",
"hardhat": "^2.10.0",
Expand Down
89 changes: 55 additions & 34 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2166,6 +2166,16 @@
"@typescript-eslint/typescript-estree" "4.33.0"
debug "^4.3.1"

"@typescript-eslint/parser@^5.48.1":
version "5.62.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.62.0.tgz#1b63d082d849a2fcae8a569248fbe2ee1b8a56c7"
integrity sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==
dependencies:
"@typescript-eslint/scope-manager" "5.62.0"
"@typescript-eslint/types" "5.62.0"
"@typescript-eslint/typescript-estree" "5.62.0"
debug "^4.3.4"

"@typescript-eslint/[email protected]":
version "4.33.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3"
Expand All @@ -2174,11 +2184,24 @@
"@typescript-eslint/types" "4.33.0"
"@typescript-eslint/visitor-keys" "4.33.0"

"@typescript-eslint/[email protected]":
version "5.62.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz#d9457ccc6a0b8d6b37d0eb252a23022478c5460c"
integrity sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==
dependencies:
"@typescript-eslint/types" "5.62.0"
"@typescript-eslint/visitor-keys" "5.62.0"

"@typescript-eslint/[email protected]":
version "4.33.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72"
integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==

"@typescript-eslint/[email protected]":
version "5.62.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f"
integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==

"@typescript-eslint/[email protected]":
version "4.33.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609"
Expand All @@ -2192,6 +2215,19 @@
semver "^7.3.5"
tsutils "^3.21.0"

"@typescript-eslint/[email protected]":
version "5.62.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz#7d17794b77fabcac615d6a48fb143330d962eb9b"
integrity sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==
dependencies:
"@typescript-eslint/types" "5.62.0"
"@typescript-eslint/visitor-keys" "5.62.0"
debug "^4.3.4"
globby "^11.1.0"
is-glob "^4.0.3"
semver "^7.3.7"
tsutils "^3.21.0"

"@typescript-eslint/[email protected]":
version "4.33.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd"
Expand All @@ -2200,6 +2236,14 @@
"@typescript-eslint/types" "4.33.0"
eslint-visitor-keys "^2.0.0"

"@typescript-eslint/[email protected]":
version "5.62.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz#2174011917ce582875954ffe2f6912d5931e353e"
integrity sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==
dependencies:
"@typescript-eslint/types" "5.62.0"
eslint-visitor-keys "^3.3.0"

abbrev@1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
Expand Down Expand Up @@ -3594,11 +3638,6 @@ config-chain@^1.1.11:
ini "^1.3.4"
proto-list "~1.2.1"

confusing-browser-globals@^1.0.10:
version "1.0.11"
resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81"
integrity sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==

constant-case@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/constant-case/-/constant-case-2.0.0.tgz#4175764d389d3fa9c8ecd29186ed6005243b6a46"
Expand Down Expand Up @@ -4478,34 +4517,11 @@ [email protected]:
optionalDependencies:
source-map "~0.2.0"

eslint-config-airbnb-base@^14.2.1:
version "14.2.1"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz#8a2eb38455dc5a312550193b319cdaeef042cd1e"
integrity sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA==
dependencies:
confusing-browser-globals "^1.0.10"
object.assign "^4.1.2"
object.entries "^1.1.2"

eslint-config-airbnb@^18.2.1:
version "18.2.1"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-18.2.1.tgz#b7fe2b42f9f8173e825b73c8014b592e449c98d9"
integrity sha512-glZNDEZ36VdlZWoxn/bUR1r/sdFKPd1mHPbqUtkctgNG4yT2DLLtJ3D+yCV+jzZCc2V1nBVkmdknOJBZ5Hc0fg==
dependencies:
eslint-config-airbnb-base "^14.2.1"
object.assign "^4.1.2"
object.entries "^1.1.2"

eslint-config-prettier@^8.3.0, eslint-config-prettier@^8.6.0:
eslint-config-prettier@^8.3.0, eslint-config-prettier@^8.5.0:
version "8.10.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz#3a06a662130807e2502fc3ff8b4143d8a0658e11"
integrity sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==

eslint-config-standard@^17.0.0:
version "17.1.0"
resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-17.1.0.tgz#40ffb8595d47a6b242e07cbfd49dc211ed128975"
integrity sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q==

eslint-import-resolver-node@^0.3.7:
version "0.3.9"
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz#d4eaac52b8a2e7c3cd1903eb00f7e053356118ac"
Expand Down Expand Up @@ -4636,6 +4652,11 @@ eslint-plugin-promise@^5.1.0:
resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-5.2.0.tgz#a596acc32981627eb36d9d75f9666ac1a4564971"
integrity sha512-SftLb1pUG01QYq2A/hGAWfDRXqYD82zE7j7TopDOyNdU+7SvvoXREls/+PRTY17vUXzXnZA/zfnyKgRH6x4JJw==

eslint-plugin-promise@^6.1.1:
version "6.1.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz#269a3e2772f62875661220631bd4dafcb4083816"
integrity sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==

eslint-plugin-react-hooks@^4.2.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz#4c3e697ad95b77e93f8646aaa1630c1ba607edd3"
Expand Down Expand Up @@ -4718,7 +4739,7 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800"
integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==

eslint@^8.34.0:
eslint@^8.31.0:
version "8.48.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.48.0.tgz#bf9998ba520063907ba7bfe4c480dc8be03c2155"
integrity sha512-sb6DLeIuRXxeM1YljSe1KEx9/YYeZFQWcV8Rq9HfigmdDEugjLEVEa1ozDjL6YDjBpQHPJxJzze+alxi4T3OLg==
Expand Down Expand Up @@ -5892,7 +5913,7 @@ globby@^10.0.1:
merge2 "^1.2.3"
slash "^3.0.0"

globby@^11.0.3:
globby@^11.0.3, globby@^11.1.0:
version "11.1.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"
integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==
Expand Down Expand Up @@ -8280,7 +8301,7 @@ [email protected]:
has-symbols "^1.0.0"
object-keys "^1.0.11"

object.assign@^4.1.2, object.assign@^4.1.4:
object.assign@^4.1.4:
version "4.1.4"
resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f"
integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==
Expand All @@ -8290,7 +8311,7 @@ object.assign@^4.1.2, object.assign@^4.1.4:
has-symbols "^1.0.3"
object-keys "^1.1.1"

object.entries@^1.1.2, object.entries@^1.1.6:
object.entries@^1.1.6:
version "1.1.7"
resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.7.tgz#2b47760e2a2e3a752f39dd874655c61a7f03c131"
integrity sha512-jCBs/0plmPsOnrKAfFQXRG2NFjlhZgjjcBLSmTnEhU8U6vVTsVe8ANeQJCHTl3gSsI4J+0emOoCgoKlmQPMgmA==
Expand Down Expand Up @@ -9480,7 +9501,7 @@ semver@^6.1.0, semver@^6.3.0, semver@^6.3.1:
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==

semver@^7.3.4, semver@^7.3.5, semver@^7.3.8:
semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8:
version "7.5.4"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
Expand Down

0 comments on commit d650f86

Please sign in to comment.