Explorar el Código

docs: write a README

docs: add a license (WTFPL)
fix: make solhint work with windows crlf
Paul Razvan Berg hace 4 años
padre
commit
7e4eb7e3a8
Se han modificado 6 ficheros con 93 adiciones y 5 borrados
  1. 1 0
      .prettierrc
  2. 4 1
      .solhint.json
  3. 7 0
      LICENSE.md
  4. 79 2
      README.md
  5. 1 1
      package.json
  6. 1 1
      tasks/typechain.ts

+ 1 - 0
.prettierrc

@@ -1,6 +1,7 @@
 {
   "arrowParens": "avoid",
   "bracketSpacing": true,
+  "endOfLine":"auto",
   "printWidth": 120,
   "singleQuote": false,
   "tabWidth": 2,

+ 4 - 1
.solhint.json

@@ -5,9 +5,12 @@
     "code-complexity": ["error", 7],
     "compiler-version": ["error", "^0.7.2"],
     "constructor-syntax": "error",
+    "func-visibility": ["error", { "ignoreConstructors": true }],
     "max-line-length": ["error", 120],
     "not-rely-on-time": "off",
-    "prettier/prettier": "error",
+    "prettier/prettier": ["error", {
+      "endOfLine":"auto"
+    }],
     "reason-string": ["warn", { "maxLength": 64 }]
   }
 }

+ 7 - 0
LICENSE.md

@@ -0,0 +1,7 @@
+# WTFPL
+
+by Paul Razvan Berg (@PaulRBerg)
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. You just DO WHAT THE FUCK YOU WANT TO.

+ 79 - 2
README.md

@@ -1,3 +1,80 @@
-## Solidity Template
+# Solidity Template
 
-To be used when building a new solidity project from scratch.
+My favourite setup for writing Solidity smart contracts.
+
+- [Buidler](https://github.com/nomiclabs/buidler): compile and run the smart contracts on a local development network
+- [TypeChain](https://github.com/ethereum-ts/TypeChain): generate TypeScript types for smart contracts
+- [Ethers](https://github.com/ethers-io/ethers.js/): renowned Ethereum library and wallet implementation
+- [Waffle](https://github.com/Waffle/waffle): tooling for writing comprehensive smart contract tests
+- [Solhint](https://github.com/protofire/solhint): linter
+- [Solcover](https://github.com/sc-forks/solidity-coverage) code coverage
+- [Prettier Plugin Solidity](https://github.com/prettier-solidity/prettier-plugin-solidity): code formatter
+
+This is a GitHub template, which means you can reuse it as many times as you want. You can do that by clicking the "Use this
+template" button at the top of the page.
+
+## Usage
+
+### Pre Requisites
+
+Before running any command, make sure to install dependencies:
+
+```sh
+$ yarn install
+```
+
+### Compile
+
+Compile the smart contracts with Buidler:
+
+```sh
+$ yarn compile
+```
+
+### Build
+
+Compile the smart contracts and generate TypeChain artifacts:
+
+```sh
+$ yarn build
+```
+
+### Lint Solidity
+
+Lint the Solidity code:
+
+```sh
+$ yarn lint:sol
+```
+
+### Lint TypeScript
+
+Lint the TypeScript code:
+
+```sh
+$ yarn lint:ts
+```
+
+### Test
+
+Run the Mocha tests:
+
+```sh
+$ yarn test
+```
+
+### Coverage
+
+Generate the code coverage report:
+
+```sh
+$ yarn coverage
+```
+
+### Clean
+
+Delete the smart contract artifacts, the coverage reports and the Buidler cache:
+
+```sh
+$ yarn clean
+```

+ 1 - 1
package.json

@@ -58,7 +58,7 @@
     "smart-contracts",
     "solidity"
   ],
-  "license": "LGPL-3.0-or-later",
+  "license": "WTFPL",
   "publishConfig": {
     "access": "public"
   },

+ 1 - 1
tasks/typechain.ts

@@ -5,7 +5,7 @@ import { tsGenerator } from "ts-generator";
 
 import { TASK_TYPECHAIN } from "./task-names";
 
-task(TASK_TYPECHAIN, "Generate Typechain typings for compiled contracts", async function (_taskArgs, { config, run }) {
+task(TASK_TYPECHAIN, "Generate TypeChain typings for compiled contracts", async function (_taskArgs, { config, run }) {
   if (!config.typechain || !config.typechain?.outDir || !config.typechain?.target) {
     throw new Error("Invalid TypeChain configuration. Please provide it via buidler.config.ts");
   }