-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: init from https://github.com/giuseppecrj/smart-contract-templa…
…te.git at 28e15c0
- Loading branch information
0 parents
commit 8ca6af8
Showing
630 changed files
with
100,320 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,10 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
[*.{js,json,yml}] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 |
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 @@ | ||
GOERLI_RPC_URL=goerli_rpc | ||
PRIVATE_KEY=private_key | ||
ETHERSCAN_API_KEY=etherscan_key |
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,34 @@ | ||
name: test | ||
|
||
on: workflow_dispatch | ||
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
|
||
jobs: | ||
check: | ||
strategy: | ||
fail-fast: true | ||
|
||
name: Foundry project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Run Forge build | ||
run: | | ||
forge --version | ||
forge build --sizes | ||
id: build | ||
|
||
- name: Run Forge tests | ||
run: | | ||
forge test -vvv | ||
id: 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,12 @@ | ||
# Compiler files | ||
cache/ | ||
out/ | ||
|
||
# Ignores development broadcast logs | ||
!/broadcast | ||
/broadcast/*/31337/ | ||
/broadcast/*/5/ | ||
/broadcast/**/dry-run/ | ||
|
||
# Dotenv file | ||
.env |
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,8 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
branch = v1.2.0 | ||
[submodule "lib/openzeppelin-contracts"] | ||
path = lib/openzeppelin-contracts | ||
url = https://github.com/openzeppelin/openzeppelin-contracts | ||
branch = v4.8.0 |
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 @@ | ||
build | ||
coverage | ||
out | ||
lib | ||
assets | ||
node_modules | ||
.next |
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,9 @@ | ||
{ | ||
"arrowParens": "always", | ||
"endOfLine": "lf", | ||
"printWidth": 80, | ||
"semi": true, | ||
"singleQuote": false, | ||
"tabWidth": 2, | ||
"trailingComma": "all" | ||
} |
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,12 @@ | ||
{ | ||
"extends": ["solhint:recommended"], | ||
"rules": { | ||
"prettier/prettier": "error", | ||
"compiler-version": "off", | ||
"avoid-throw": "off", | ||
"avoid-suicide": "error", | ||
"avoid-sha3": "warn", | ||
"func-name-mixedcase": "off" | ||
}, | ||
"plugins": ["prettier"] | ||
} |
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 @@ | ||
-include .env | ||
|
||
.PHONY: all test clean deploy-anvil | ||
|
||
all: clean remove install update build | ||
|
||
# Clean the repo | ||
clean :; forge clean | ||
|
||
# Remappings | ||
remap :; forge remappings > remappings.txt | ||
|
||
# Remove modules | ||
remove :; rm -rf .gitmodules && rm -rf .git/modules/* && rm -rf lib && touch .gitmodules && git add . && git commit -m "modules" | ||
|
||
install :; forge install smartcontractkit/chainlink-brownie-contracts && forge install rari-capital/solmate && forge install foundry-rs/forge-std | ||
|
||
# Update Dependencies | ||
update:; forge update | ||
|
||
build:; forge build | ||
|
||
test :; forge test | ||
|
||
snapshot :; forge snapshot | ||
|
||
slither :; slither ./src | ||
|
||
format :; prettier --write src/**/*.sol && prettier --write src/*.sol | ||
|
||
# solhint should be installed globally | ||
lint :; solhint src/**/*.sol && solhint src/*.sol | ||
|
||
anvil :; anvil -m 'test test test test test test test test test test test junk' | ||
|
||
# use the "@" to hide the command from your shell | ||
deploy-goerli :; @forge script script/${contract}.s.sol:${contract} --rpc-url ${GOERLI_RPC_URL} --private-key ${PRIVATE_KEY} --broadcast --verify --etherscan-api-key ${ETHERSCAN_API_KEY} -vvvv | ||
|
||
# This is the private key of account from the mnemonic from the "make anvil" command | ||
deploy-anvil :; @forge script script/${contract}.s.sol:${contract} --rpc-url http://localhost:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --broadcast |
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 @@ | ||
[profile.default] | ||
src = 'src' | ||
out = 'out' | ||
libs = ['lib'] | ||
|
||
# See more config options https://github.com/foundry-rs/foundry/tree/master/config[profile.default] | ||
src = 'src' | ||
out = 'out' | ||
libs = ['lib', "node_modules"] | ||
gas_reports = ["*"] | ||
optimizer = true | ||
optimizer_runs = 20000 | ||
|
||
|
||
[rpc_endpoints] | ||
goerli = "${GOERLI_RPC_URL}" | ||
|
||
[etherscan] | ||
goerli = { key = "${ETHERSCAN_API_KEY}" } | ||
|
||
# See more config options https://github.com/foundry-rs/foundry/tree/master/config |
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,92 @@ | ||
name: CI | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Foundry | ||
uses: onbjerg/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Print forge version | ||
run: forge --version | ||
|
||
# Backwards compatibility checks. | ||
- name: Check compatibility with 0.8.0 | ||
if: always() | ||
run: forge build --skip test --use solc:0.8.0 | ||
|
||
- name: Check compatibility with 0.7.6 | ||
if: always() | ||
run: forge build --skip test --use solc:0.7.6 | ||
|
||
- name: Check compatibility with 0.7.0 | ||
if: always() | ||
run: forge build --skip test --use solc:0.7.0 | ||
|
||
- name: Check compatibility with 0.6.12 | ||
if: always() | ||
run: forge build --skip test --use solc:0.6.12 | ||
|
||
- name: Check compatibility with 0.6.2 | ||
if: always() | ||
run: forge build --skip test --use solc:0.6.2 | ||
|
||
# via-ir compilation time checks. | ||
- name: Measure compilation time of Test with 0.8.17 --via-ir | ||
if: always() | ||
run: forge build --skip test --contracts test/compilation/CompilationTest.sol --use solc:0.8.17 --via-ir | ||
|
||
- name: Measure compilation time of TestBase with 0.8.17 --via-ir | ||
if: always() | ||
run: forge build --skip test --contracts test/compilation/CompilationTestBase.sol --use solc:0.8.17 --via-ir | ||
|
||
- name: Measure compilation time of Script with 0.8.17 --via-ir | ||
if: always() | ||
run: forge build --skip test --contracts test/compilation/CompilationScript.sol --use solc:0.8.17 --via-ir | ||
|
||
- name: Measure compilation time of ScriptBase with 0.8.17 --via-ir | ||
if: always() | ||
run: forge build --skip test --contracts test/compilation/CompilationScriptBase.sol --use solc:0.8.17 --via-ir | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Foundry | ||
uses: onbjerg/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Print forge version | ||
run: forge --version | ||
|
||
- name: Run tests | ||
run: forge test -vvv | ||
|
||
fmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Foundry | ||
uses: onbjerg/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Print forge version | ||
run: forge --version | ||
|
||
- name: Check formatting | ||
run: forge fmt --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,4 @@ | ||
cache/ | ||
out/ | ||
.vscode | ||
.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,3 @@ | ||
[submodule "lib/ds-test"] | ||
path = lib/ds-test | ||
url = https://github.com/dapphub/ds-test |
Oops, something went wrong.