-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
- Loading branch information
1 parent
a9ba742
commit ce98bf0
Showing
17 changed files
with
21,668 additions
and
6,311 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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
node_modules | ||
artifacts | ||
lib | ||
cache | ||
artifacts | ||
typechain-types | ||
coverage | ||
deployments | ||
forge-artifacts | ||
bin | ||
out |
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 |
---|---|---|
@@ -1,11 +1,49 @@ | ||
// eslint-disable-next-line no-undef | ||
module.exports = { | ||
root: true, | ||
parser: "@typescript-eslint/parser", | ||
plugins: ["@typescript-eslint"], | ||
extends: [ | ||
"eslint:recommended", | ||
"eslint-config-airbnb-base", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier", | ||
"plugin:prettier/recommended", | ||
], | ||
env: { | ||
browser: true, | ||
es6: true, | ||
jest: true, | ||
}, | ||
parser: "@typescript-eslint/parser", | ||
settings: { | ||
"import/resolver": { | ||
node: { | ||
extensions: [".js", ".jsx", ".ts", ".tsx"], | ||
}, | ||
}, | ||
}, | ||
plugins: ["prettier"], | ||
rules: { | ||
"@typescript-eslint/explicit-function-return-type": "off", | ||
"@typescript-eslint/no-shadow": "error", | ||
"@typescript-eslint/no-unused-vars": "off", // leave it to tsc | ||
"@typescript-eslint/no-use-before-define": "off", | ||
"@typescript-eslint/no-useless-constructor": "error", | ||
"arrow-parens": ["error", "always"], | ||
"class-methods-use-this": "off", | ||
"import/extensions": ["error", "never"], | ||
"import/no-extraneous-dependencies": [ | ||
"error", | ||
{ devDependencies: ["**/*.test.{js,jsx,ts,tsx}"] }, | ||
], | ||
"import/prefer-default-export": "off", | ||
"no-plusplus": ["error", { allowForLoopAfterthoughts: true }], | ||
"no-shadow": "off", // leave it to @typescript-eslint | ||
"no-use-before-define": "off", // leave it to @typescript-eslint | ||
"no-useless-constructor": "off", // leave it to @typescript-eslint | ||
}, | ||
overrides: [ | ||
{ | ||
files: "*.{js,jsx}", | ||
rules: { | ||
"@typescript-eslint/ban-ts-comment": "off", | ||
"@typescript-eslint/no-var-requires": "off", | ||
}, | ||
}, | ||
], | ||
}; |
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,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "monday" | ||
target-branch: "main" | ||
labels: | ||
- "dependencies" |
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,45 @@ | ||
name: 🕵️♂️ Test smart contracts | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ${{github.workflow}}-${{github.ref}} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
unit: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
node_version: | ||
- 16 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Cache node modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Use Node.js ${{ matrix.node_version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node_version }} | ||
|
||
- name: Install npm project with a clean slate | ||
run: npm ci --prefer-offline | ||
|
||
- name: Hardhat tests | ||
run: npx hardhat test | ||
|
||
- name: Slither static analyser | ||
uses: crytic/slither-action@v0.1.1 | ||
continue-on-error: true | ||
with: | ||
node-version: ${{ matrix.node_version }} |
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 |
---|---|---|
@@ -1,3 +1,69 @@ | ||
build | ||
# Ignore all Visual Studio Code settings | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
!.vscode/*.code-snippets | ||
|
||
# Local history for Visual Studio Code | ||
.history | ||
|
||
# Built Visual Studio Code extensions | ||
*.vsix | ||
|
||
# Dependency directory | ||
node_modules | ||
.env | ||
|
||
# dotenv environment variable files | ||
.env | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.env.local | ||
|
||
# Log files | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Yarn integrity file | ||
.yarn-integrity | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Modern Yarn files | ||
.pnp.* | ||
.yarn/* | ||
!.yarn/cache | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
# Hardhat files | ||
cache | ||
artifacts | ||
.deps | ||
|
||
# TypeScript bindings output directory | ||
typechain-types | ||
|
||
# solidity-coverage directory and output file | ||
coverage | ||
coverage.json | ||
|
||
# xdeployer output directory | ||
deployments | ||
|
||
# Foundry output directory | ||
forge-artifacts | ||
|
||
# Ignore flattened files | ||
flattened.sol | ||
|
||
# Miscellaneous files | ||
bin | ||
out |
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 |
---|---|---|
@@ -1 +1,10 @@ | ||
node_modules | ||
lib | ||
cache | ||
artifacts | ||
typechain-types | ||
coverage | ||
deployments | ||
forge-artifacts | ||
bin | ||
out |
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
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,40 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity 0.8.14; | ||
|
||
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
|
||
contract ERC20Mock is ERC20 { | ||
constructor( | ||
string memory name, | ||
string memory symbol, | ||
address initialAccount, | ||
uint256 initialBalance | ||
) payable ERC20(name, symbol) { | ||
_mint(initialAccount, initialBalance); | ||
} | ||
|
||
function mint(address account, uint256 amount) public { | ||
_mint(account, amount); | ||
} | ||
|
||
function burn(address account, uint256 amount) public { | ||
_burn(account, amount); | ||
} | ||
|
||
function transferInternal( | ||
address from, | ||
address to, | ||
uint256 value | ||
) public { | ||
_transfer(from, to, value); | ||
} | ||
|
||
function approveInternal( | ||
address owner, | ||
address spender, | ||
uint256 value | ||
) public { | ||
_approve(owner, spender, value); | ||
} | ||
} |
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 @@ | ||
/** | ||
* @type import('hardhat/config').HardhatUserConfig | ||
*/ | ||
require("@nomiclabs/hardhat-truffle5"); | ||
|
||
module.exports = { | ||
solidity: { | ||
version: "0.8.14", | ||
settings: { | ||
optimizer: { | ||
enabled: true, | ||
runs: 200, | ||
}, | ||
}, | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
const DeployBytecode = artifacts.require("DeployBytecode"); | ||
const Create = artifacts.require("Create"); | ||
|
||
module.exports = function (deployer) { | ||
deployer.deploy(DeployBytecode); | ||
deployer.deploy(Create); | ||
}; |
Oops, something went wrong.