-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
major package cleanup; deployment related files moved; settings file …
…added
- Loading branch information
Showing
171 changed files
with
362 additions
and
88,806 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
node_modules | ||
.env | ||
coverage | ||
coverage.json | ||
typechain | ||
typechain-types | ||
|
||
# Hardhat files | ||
cache | ||
artifacts | ||
|
||
# generated docs | ||
generated-markups | ||
|
||
# editors | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const path = require('path'); | ||
const tsconfigPath = path.join(__dirname, 'tsconfig.json'); | ||
module.exports = { | ||
root: true, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:mocha/recommended', | ||
'plugin:prettier/recommended', | ||
], | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
}, | ||
plugins: ['mocha'], | ||
env: { | ||
commonjs: true, | ||
node: true, | ||
mocha: true, | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.ts'], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: [tsconfigPath], | ||
ecmaVersion: 2020, | ||
sourceType: 'module', | ||
}, | ||
plugins: ['mocha', '@typescript-eslint'], | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:mocha/recommended', | ||
'plugin:prettier/recommended', | ||
], | ||
rules: { | ||
'@typescript-eslint/no-misused-promises': 'error', | ||
'@typescript-eslint/no-floating-promises': 'error', | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
node_modules | ||
.env | ||
coverage | ||
coverage.json | ||
typechain | ||
typechain-types | ||
|
||
# Hardhat files | ||
cache | ||
artifacts | ||
|
||
# generated docs | ||
generated-markups | ||
|
||
# editors | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
node_modules | ||
.env | ||
coverage | ||
coverage.json | ||
typechain | ||
typechain-types | ||
|
||
# Hardhat files | ||
cache | ||
artifacts | ||
|
||
# generated docs | ||
generated-markups | ||
|
||
# editors | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = { | ||
singleQuote: true, | ||
bracketSpacing: false, | ||
plugins: ['prettier-plugin-solidity'], | ||
overrides: [ | ||
{ | ||
files: '*.sol', | ||
options: { | ||
printWidth: 120, | ||
tabWidth: 4, | ||
singleQuote: false, | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
mocha: { | ||
grep: '@skip-on-coverage', // Find everything with this tag | ||
invert: true, // Run the grep's inverse set. | ||
}, | ||
skipFiles: ['/contracts/mock'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"extends": "solhint:recommended", | ||
"plugins": ["prettier"], | ||
"rules": { | ||
"prettier/prettier": [ | ||
"error", | ||
{ | ||
"endOfLine": "auto" | ||
} | ||
], | ||
"code-complexity": ["error", 7], | ||
"compiler-version": ["error", "^0.8.0"], | ||
"const-name-snakecase": "off", | ||
"func-name-mixedcase": "off", | ||
"constructor-syntax": "error", | ||
"func-visibility": ["error", {"ignoreConstructors": true}], | ||
"not-rely-on-time": "off", | ||
"no-inline-assembly": "off", | ||
"reason-string": ["warn", {"maxLength": 64}] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# <PACKAGE> | ||
|
||
*Include a high level description of your package here* | ||
|
||
This example project is based on the template generated by hardhat when run in an empty directory. | ||
|
||
This project demonstrates a basic Hardhat use case. It comes with a sample contract, a sample test fixture for that contract, | ||
and tests. | ||
|
||
## Creating a new package | ||
|
||
You can copy-paste this example package: `cp -a packages/example-hardhat packages/<package>` | ||
|
||
## Running the project locally | ||
|
||
Install dependencies with `yarn` | ||
|
||
Testing: Use `yarn test` inside `packages/<package>` to run tests locally inside this package | ||
|
||
For testing from root (with workspace feature) use: `yarn workspace @sandbox-smart-contracts/<package> test` | ||
|
||
Coverage: Run `yarn coverage` | ||
|
||
Formatting: Run `yarn prettier` to check and `yarn prettier:fix` to fix formatting errors | ||
|
||
Linting: Run `yarn lint` to check and `yarn lint:fix` to fix static analysis errors | ||
|
||
## Package structure and minimum standards | ||
|
||
#### A NOTE ON DEPENDENCIES | ||
|
||
1. Add whatever dependencies you like inside your package; this template is for hardhat usage. OpenZeppelin contracts | ||
are highly recommended and should be installed as a dev dependency | ||
2. For most Pull Requests there should be minimum changes to `yarn.lock` at root level | ||
3. Changes to root-level dependencies are permissible, however they should not be downgraded | ||
4. Take care to run `yarn` before pushing your changes | ||
5. You shouldn't need to install dotenv since you won't be deploying inside this package (see below) | ||
|
||
#### UNIT TESTING | ||
|
||
1. Unit tests are to be added in `packages/<package>/test` | ||
2. Coverage must meet minimum requirements for CI to pass | ||
3. `getSigners` return an array of addresses, the first one is the default `deployer` for contracts, under no | ||
circumstances should tests be written as `deployer` | ||
4. It's permissible to create mock contracts at `packages/<package>/contracts/mock` e.g. for third-party contracts | ||
5. Tests must not rely on any deploy scripts from the `deploy` package; your contracts must be deployed inside the test | ||
fixture. See `test/fixtures.ts` | ||
|
||
# Deployment | ||
|
||
Each package must unit-test the contracts by running everything inside the `hardhat node`. Deployment to "real" | ||
networks, configuration of our environment and integration tests must be done inside the `deploy` package. | ||
|
||
The `deploy` package only imports `.sol` files. The idea is to recompile everything inside it and manage the entire | ||
deploy strategy from one place. | ||
|
||
1. Your deploy scripts should not be included inside `packages/<package>`: deploy scripts live inside `packages/deploy/` | ||
2. The `deploy` package doesn't use the hardhat config file from the specific package. Instead, it | ||
uses `packages/deploy/hardhat.config.ts` | ||
3. You will need to review `packages/deploy/hardhat.config.ts` and update it as needed for any new namedAccounts you | ||
added to your package | ||
4. When it comes to deploy time, it is preferred to include deploy scripts and end-to-end tests as a separate PR | ||
5. The named accounts inside the `deploy` package must use the "real-life" values | ||
6. Refer to the readme at `packages/deploy` to learn more about importing your package | ||
|
||
#### INTEGRATION TESTING | ||
|
||
1. End-to-end tests live at `packages/deploy/` | ||
2. You must add end-to-end tests ahead of deploying your package. Importantly, these tests should verify deployment and | ||
initialization configuration | ||
|
||
# A NOTE ON MAKING PULL REQUESTS | ||
|
||
1. Follow the PR template checklist | ||
2. Your PR will not be approved if the above criteria are not met |
50 changes: 0 additions & 50 deletions
50
packages/avatar/deploy_polygon/17_raffle_care_bears/010_deploy_raffle_care_bears.ts
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
packages/avatar/deploy_polygon/17_raffle_care_bears/011_setup_raffle_care_bears_minter.ts
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
packages/avatar/deploy_polygon/17_raffle_care_bears/013_setup_raffle_care_bears_wave_0.ts
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
packages/avatar/deploy_polygon/17_raffle_care_bears/014_setup_raffle_care_bears_signer.ts
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
packages/avatar/deploy_polygon/17_raffle_care_bears/015_change_owner_care_bears.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.