-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b585abd
Showing
25 changed files
with
10,907 additions
and
0 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,7 @@ | ||
node_modules | ||
artifacts | ||
cache | ||
coverage* | ||
gasReporterOutput.json | ||
typechain | ||
lib/ds-test |
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,27 @@ | ||
{ | ||
"env": { | ||
"browser": false, | ||
"es2021": true, | ||
"mocha": true, | ||
"node": true | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"extends": [ | ||
"standard", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:prettier/recommended", | ||
"plugin:node/recommended" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 12 | ||
}, | ||
"rules": { | ||
"node/no-unsupported-features/es-syntax": ["error", { "ignores": ["modules"] }] | ||
}, | ||
"settings": { | ||
"node": { | ||
"tryExtensions": [".js", ".json", ".ts", ".d.ts"] | ||
} | ||
} | ||
} |
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,36 @@ | ||
name: Format and lint checks | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14.x | ||
- 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: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Run format checks | ||
run: yarn format:check | ||
- name: Run lint | ||
run: yarn lint |
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,42 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14.x | ||
- 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: Install dev dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Install Foundry | ||
uses: onbjerg/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
- name: Compile code (Hardhat) | ||
run: yarn compile:force | ||
- name: Run TypeScript/Waffle tests | ||
run: yarn test | ||
- name: Run Solidity/Forge tests | ||
run: forge test |
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 @@ | ||
node_modules | ||
.env | ||
.env* | ||
coverage | ||
coverage.json | ||
typechain | ||
.DS_Store | ||
|
||
# Hardhat files | ||
cache | ||
artifacts | ||
abis/ | ||
|
||
# Others | ||
lib |
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,3 @@ | ||
[submodule "lib/ds-test"] | ||
path = lib/ds-test | ||
url = https://github.com/dapphub/ds-test |
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,5 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn lint | ||
yarn format:check |
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,18 @@ | ||
node_modules | ||
.env | ||
.env* | ||
coverage | ||
coverage.json | ||
typechain | ||
|
||
# Hardhat files | ||
cache | ||
artifacts | ||
|
||
hardhat.config.ts | ||
contracts/test | ||
test/ | ||
|
||
# Others | ||
lib | ||
.DS_Store |
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 @@ | ||
node_modules | ||
artifacts | ||
cache | ||
coverage* | ||
gasReporterOutput.json | ||
typechain | ||
lib/ds-test |
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,3 @@ | ||
{ | ||
"printWidth": 120 | ||
} |
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 = { | ||
silent: true, | ||
measureStatementCoverage: true, | ||
measureFunctionCoverage: true, | ||
skipFiles: ["interfaces", "test"], | ||
configureYulOptimizer: true, | ||
}; |
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 @@ | ||
{ | ||
"extends": "solhint:recommended", | ||
"rules": { | ||
"compiler-version": ["error", "^0.8.0"], | ||
"func-visibility": [{ "ignoreConstructors": true }], | ||
"func-name-mixedcase": "off", | ||
"reason-string": "off", | ||
"var-name-mixedcase": "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,4 @@ | ||
node_modules | ||
test | ||
demo.sol | ||
*.t.sol |
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,3 @@ | ||
{ | ||
"editor.formatOnSave": true | ||
} |
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 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 LooksRare | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,3 @@ | ||
# Solidity template | ||
|
||
This is a template for GitHub repos with Solidity smart contracts using Forge and Hardhat. |
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,18 @@ | ||
//SPDX-License-Identifier: Unlicense | ||
pragma solidity ^0.8.0; | ||
|
||
contract Greeter { | ||
string private greeting; | ||
|
||
constructor(string memory _greeting) { | ||
greeting = _greeting; | ||
} | ||
|
||
function greet() public view returns (string memory) { | ||
return greeting; | ||
} | ||
|
||
function setGreeting(string memory _greeting) public { | ||
greeting = _greeting; | ||
} | ||
} |
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,36 @@ | ||
[default] | ||
auto_detect_solc = true | ||
block_base_fee_per_gas = 0 | ||
block_coinbase = '0x0000000000000000000000000000000000000000' | ||
block_difficulty = 0 | ||
block_number = 0 | ||
block_timestamp = 0 | ||
cache = true | ||
cache_path = 'cache' | ||
evm_version = 'london' | ||
extra_output = [] | ||
extra_output_files = [] | ||
ffi = false | ||
force = false | ||
fuzz_max_global_rejects = 65536 | ||
fuzz_max_local_rejects = 1024 | ||
fuzz_runs = 1000 | ||
gas_limit = 9223372036854775807 | ||
gas_price = 0 | ||
gas_reports = ['*'] | ||
ignored_error_codes = [1878] | ||
initial_balance = '0xffffffffffffffffffffffff' | ||
libraries = [] | ||
libs = ['node_modules'] | ||
names = false | ||
offline = false | ||
optimizer = true | ||
optimizer_runs = 888888 | ||
out = 'artifacts' | ||
sender = '0x00a329c0648769a73afac7f9381e08fb43dbea72' | ||
sizes = false | ||
src = 'contracts' | ||
test = 'test' | ||
tx_origin = '0x00a329c0648769a73afac7f9381e08fb43dbea72' | ||
verbosity = 0 | ||
via_ir = 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,65 @@ | ||
import type { HardhatUserConfig } from "hardhat/types"; | ||
import { task } from "hardhat/config"; | ||
|
||
import "@nomiclabs/hardhat-etherscan"; | ||
import "@nomiclabs/hardhat-waffle"; | ||
import "@typechain/hardhat"; | ||
import "hardhat-abi-exporter"; | ||
import "hardhat-gas-reporter"; | ||
import "solidity-coverage"; | ||
import "dotenv/config"; | ||
|
||
task("accounts", "Prints the list of accounts", async (_args, hre) => { | ||
const accounts = await hre.ethers.getSigners(); | ||
accounts.forEach(async (account) => console.info(account.address)); | ||
}); | ||
|
||
const config: HardhatUserConfig = { | ||
defaultNetwork: "hardhat", | ||
networks: { | ||
hardhat: { | ||
allowUnlimitedContractSize: false, | ||
hardfork: "berlin", // Berlin is used (temporarily) to avoid issues with coverage | ||
mining: { | ||
auto: true, | ||
interval: 50000, | ||
}, | ||
gasPrice: "auto", | ||
}, | ||
}, | ||
etherscan: { | ||
apiKey: process.env.ETHERSCAN_KEY, | ||
}, | ||
solidity: { | ||
compilers: [ | ||
{ | ||
version: "0.8.7", | ||
settings: { optimizer: { enabled: true, runs: 888888 } }, | ||
}, | ||
{ | ||
version: "0.4.18", | ||
settings: { optimizer: { enabled: true, runs: 999 } }, | ||
}, | ||
], | ||
}, | ||
paths: { | ||
sources: "./contracts/", | ||
tests: "./test", | ||
cache: "./cache", | ||
artifacts: "./artifacts", | ||
}, | ||
abiExporter: { | ||
path: "./abis", | ||
runOnCompile: true, | ||
clear: true, | ||
flat: true, | ||
pretty: false, | ||
except: ["test*", "@openzeppelin*", "uniswap*"], | ||
}, | ||
gasReporter: { | ||
enabled: !!process.env.REPORT_GAS, | ||
excludeContracts: ["test*", "@openzeppelin*"], | ||
}, | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.