Skip to content

Commit

Permalink
🎂 Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ezynda3 committed Mar 4, 2022
0 parents commit 36f87e3
Show file tree
Hide file tree
Showing 89 changed files with 164,632 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.sol]
indent_size = 4
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# network specific node uri : `"ETH_NODE_URI_" + networkName.toUpperCase()`
ETH_NODE_URI_MAINNET=https://eth-mainnet.alchemyapi.io/v2/<apiKey>
# generic node uri (if no specific found) :
ETH_NODE_URI=https://{{networkName}}.infura.io/v3/<apiKey>

# network specific mnemonic : `"MNEMONIC_ " + networkName.toUpperCase()`
MNEMONIC_MAINNET=<mnemonic for mainnet>
# generic mnemonic (if no specific found):
MNEMONIC=<mnemonic>
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export/
deployments/
artifacts/
cache/
coverage/
node_modules/
package.json
typechain/
22 changes: 22 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
env: {
commonjs: true,
},
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
rules: {
'no-empty': 'off',
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'off',
},
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
42 changes: 42 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '14'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Installing dependencies
run: yarn install --frozen-lockfile

- name: Linting
run: yarn lint

- name: Formatting
run: yarn format

- name: Running tests
run: yarn test
env:
MNEMONIC: ${{ secrets.MNEMONIC }}
ETH_NODE_URI: ${{ secrets.ETH_NODE_URI }}
ETH_NODE_URI_POLYGON: ${{ secrets.ETH_NODE_URI_POLYGON }}
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cache/
artifacts/

coverage*
typechain/

.vscode/*
!.vscode/settings.json.default
!.vscode/launch.json.default
!.vscode/extensions.json.default

node_modules/
.env

.yalc
yalc.lock

contractsInfo.json
deployments/
16 changes: 16 additions & 0 deletions .mocharc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict'
process.env.TS_NODE_FILES = true
module.exports = {
'allow-uncaught': true,
diff: true,
extension: ['ts'],
recursive: true,
reporter: 'spec',
require: ['ts-node/register', 'hardhat/register'], // ['ts-node/register/transpile-only'], (for yarn link <plugin>)
slow: 300,
spec: 'test/**/*.test.ts',
timeout: 30000,
ui: 'bdd',
watch: false,
'watch-files': ['src/**/*.sol', 'test/**/*.ts'],
}
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export/
deployments/
artifacts/
cache/
coverage/
node_modules/
package.json
typechain/
16 changes: 16 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
singleQuote: true,
bracketSpacing: true,
semi: false,
overrides: [
{
files: '*.sol',
options: {
printWidth: 120,
tabWidth: 4,
singleQuote: false,
explicitTypes: 'always',
},
},
],
}
16 changes: 16 additions & 0 deletions .setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env node
const fs = require('fs')
function copyFromDefault(p) {
if (!fs.existsSync(p)) {
const defaultFile = `${p}.default`
if (fs.existsSync(defaultFile)) {
fs.copyFileSync(`${p}.default`, p)
}
}
}

;[
'.vscode/settings.json',
'.vscode/extensions.json',
'.vscode/launch.json',
].map(copyFromDefault)
20 changes: 20 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": "solhint:recommended",
"plugins": ["prettier"],
"rules": {
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
],
"code-complexity": ["error", 7],
"compiler-version": ["error", "^0.8.7"],
"const-name-snakecase": "off",
"func-name-mixedcase": "off",
"constructor-syntax": "error",
"func-visibility": ["error", {"ignoreConstructors": true}],
"not-rely-on-time": "off",
"reason-string": ["warn", {"maxLength": 64}]
}
}
7 changes: 7 additions & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export/
deployments/
artifacts/
cache/
coverage/
node_modules/
typechain/
10 changes: 10 additions & 0 deletions .vscode/extensions.json.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"hbenl.vscode-mocha-test-adapter",
"juanblanco.solidity"
],
"unwantedRecommendations": []
}
14 changes: 14 additions & 0 deletions .vscode/launch.json.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "hardhat node",
"skipFiles": ["<node_internals>/**"],
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/hardhat",
"args": ["node"],
"cwd": "${workspaceFolder}"
}
]
}
19 changes: 19 additions & 0 deletions .vscode/settings.json.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"solidity.linter": "solhint",
"solidity.defaultCompiler": "remote",
"solidity.compileUsingRemoteVersion": "v0.8.7+commit.e28d00a7",
"solidity.packageDefaultDependenciesContractsDirectory": "",
"solidity.enabledAsYouTypeCompilationErrorCheck": true,
"solidity.validationDelay": 1500,
"solidity.packageDefaultDependenciesDirectory": "node_modules",
"mochaExplorer.env": {
"HARDHAT_CONFIG": "hardhat.config.ts",
"HARDHAT_COMPILE": "true"
},
"mochaExplorer.require": ["ts-node/register/transpile-only"]
}
Loading

0 comments on commit 36f87e3

Please sign in to comment.