Skip to content

Commit 1eaed76

Browse files
committed
Initial development environment setup
Initial development environment setup based on keep-network/tbtc-v2 and keep-network/coverage-pools. Hardhat, eslint, solhint, prettier, slither. Proven weapons for our upcoming Solidity battle.
1 parent 24f106b commit 1eaed76

15 files changed

+9133
-1
lines changed

.eslintrc

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": ["eslint-config-keep"],
3+
"parserOptions": {
4+
"ecmaVersion": 2017,
5+
"sourceType": "module"
6+
},
7+
"env": {
8+
"es6": true,
9+
"mocha": true
10+
},
11+
"rules": {
12+
"new-cap": "off"
13+
}
14+
}

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.sol linguist-language=Solidity

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
artifacts/
3+
cache/
4+
typechain/
5+
.vscode/

.pre-commit-config.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
repos:
2+
- repo: https://github.com/keep-network/pre-commit-hooks.git
3+
rev: v1.3.0
4+
hooks:
5+
- id: check-added-large-files
6+
- repo: local
7+
hooks:
8+
- id: lint-js
9+
name: "lint js"
10+
entry: /usr/bin/env bash -c "npx run lint:js"
11+
files: '\.js$'
12+
language: script
13+
description: "Checks JS code according to the package's linter configuration"
14+
- id: lint-sol
15+
name: "lint solidity"
16+
entry: /usr/bin/env bash -c "npx run lint:sol"
17+
files: '\.sol$'
18+
language: script
19+
description: "Checks Solidity code according to the package's linter configuration"
20+
- id: prettier
21+
name: "prettier"
22+
entry: /usr/bin/env bash -c "npx prettier --check ."
23+
language: script
24+
description: "Checks code according to the package's formatting configuration"

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
artifacts/
2+
build/
3+
cache/
4+
deployments/

.prettierrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
...require("@keep-network/prettier-config-keep"),
3+
plugins: ["prettier-plugin-sh"],
4+
}

.solhint.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "keep",
3+
"plugins": [],
4+
"rules": {
5+
"func-visibility": ["error", { "ignoreConstructors": true }]
6+
}
7+
}

.solhintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# solidity-contracts
1+
# solidity-contracts

contracts/token/TToken.sol

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// SPDX-License-Identifier: MIT
2+
3+
pragma solidity 0.8.4;
4+
5+
contract TToken {}

hardhat.config.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
require("@nomiclabs/hardhat-waffle")
2+
require("hardhat-gas-reporter")
3+
4+
module.exports = {
5+
solidity: {
6+
version: "0.8.4",
7+
},
8+
}

package.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "@t-network/solidity-contracts",
3+
"version": "0.0.1",
4+
"license": "MIT",
5+
"scripts": {
6+
"build": "hardhat compile",
7+
"format": "npm run lint && prettier --check .",
8+
"format:fix": "npm run lint:fix && prettier --write .",
9+
"lint": "npm run lint:js && npm run lint:sol",
10+
"lint:fix": "npm run lint:fix:js && npm run lint:fix:sol",
11+
"lint:fix:js": "eslint . --fix",
12+
"lint:fix:sol": "solhint 'contracts/**/*.sol' --fix",
13+
"lint:js": "eslint . ",
14+
"lint:sol": "solhint 'contracts/**/*.sol'",
15+
"test": "hardhat test"
16+
},
17+
"devDependencies": {
18+
"@keep-network/prettier-config-keep": "github:keep-network/prettier-config-keep#d6ec02e",
19+
"@nomiclabs/hardhat-ethers": "^2.0.2",
20+
"@nomiclabs/hardhat-waffle": "^2.0.1",
21+
"chai": "^4.3.4",
22+
"eslint": "^7.27.0",
23+
"eslint-config-keep": "github:keep-network/eslint-config-keep#0c27ade",
24+
"ethereum-waffle": "^3.4.0",
25+
"ethers": "^5.4.1",
26+
"hardhat": "^2.4.3",
27+
"hardhat-gas-reporter": "^1.0.4",
28+
"prettier": "^2.3.2",
29+
"prettier-plugin-sh": "^0.7.1",
30+
"prettier-plugin-solidity": "^1.0.0-beta.14 ",
31+
"solhint": "^3.3.6",
32+
"solhint-config-keep": "github:keep-network/solhint-config-keep",
33+
"typescript": "^4.3.2"
34+
}
35+
}

slither.config.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"detectors_to_exclude": "assembly,naming-convention,solc-version,timestamp,too-many-digits",
3+
"filter_paths": "contracts/test|node_modules"
4+
}

test/token/TToken.test.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const { expect } = require("chai")
2+
3+
describe("TToken", () => {
4+
it("should work", async () => {
5+
expect(true).to.be.true
6+
})
7+
})

0 commit comments

Comments
 (0)