-
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.
✨ upgrade project to a newer version
- Loading branch information
1 parent
5458fd1
commit 6ff84c4
Showing
21 changed files
with
248 additions
and
602 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
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 @@ | ||
export API_KEY_INFURA="YOUR_API_KEY_INFURA" | ||
export MNEMONIC="YOUR_MNEMONIC" | ||
|
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,38 +1,97 @@ | ||
name: CI | ||
name: "CI" | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
- "main" | ||
|
||
jobs: | ||
run-ci: | ||
runs-on: ubuntu-latest | ||
lint: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@v3" | ||
with: | ||
submodules: "recursive" | ||
- name: "Check out the repo" | ||
uses: "actions/checkout@v4" | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
- name: "Install Foundry" | ||
uses: "foundry-rs/foundry-toolchain@v1" | ||
|
||
- name: "Install Bun" | ||
uses: "oven-sh/setup-bun@v1" | ||
|
||
- name: "Install the Node.js dependencies" | ||
run: "bun install" | ||
|
||
- name: Build the contracts | ||
- name: "Lint the code" | ||
run: "bun run lint" | ||
|
||
- name: "Add lint summary" | ||
run: | | ||
forge --version | ||
forge build --sizes | ||
echo "## Lint result" >> $GITHUB_STEP_SUMMARY | ||
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | ||
build: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: "Check out the repo" | ||
uses: "actions/checkout@v4" | ||
|
||
- name: "Install Foundry" | ||
uses: "foundry-rs/foundry-toolchain@v1" | ||
|
||
- name: "Install Bun" | ||
uses: "oven-sh/setup-bun@v1" | ||
|
||
- name: "Install the Node.js dependencies" | ||
run: "bun install" | ||
|
||
- name: "Build the contracts and print their size" | ||
run: "forge build --sizes" | ||
|
||
- name: "Add build summary" | ||
run: | | ||
echo "## Build result" >> $GITHUB_STEP_SUMMARY | ||
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | ||
- name: "Cache the build and the node modules so that they can be re-used by the other jobs" | ||
uses: "actions/cache/save@v3" | ||
with: | ||
key: "build-and-modules-${{ github.sha }}" | ||
path: | | ||
cache | ||
node_modules | ||
out | ||
out-optimized | ||
test: | ||
needs: ["lint", "build"] | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: "Check out the repo" | ||
uses: "actions/checkout@v4" | ||
|
||
- name: "Install Foundry" | ||
uses: "foundry-rs/foundry-toolchain@v1" | ||
|
||
- name: "Install Bun" | ||
uses: "oven-sh/setup-bun@v1" | ||
|
||
- name: "Restore the cached build and the node modules" | ||
uses: "actions/cache/restore@v3" | ||
with: | ||
fail-on-cache-miss: true | ||
key: "build-and-modules-${{ github.sha }}" | ||
path: | | ||
cache | ||
node_modules | ||
out | ||
out-optimized | ||
- name: Run tests | ||
run: forge test | ||
- name: "Run the tests" | ||
run: "forge test" | ||
|
||
- name: Add test summary | ||
- name: "Add test summary" | ||
run: | | ||
echo ## Tests >> $GITHUB_STEP_SUMMARY | ||
echo ✅ Passed >> $GITHUB_STEP_SUMMARY | ||
echo "## Tests result" >> $GITHUB_STEP_SUMMARY | ||
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY |
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,20 @@ | ||
# MacOS | ||
.DS_Store | ||
|
||
# Foundry | ||
/cache | ||
# directories | ||
cache | ||
coverage | ||
node_modules | ||
out | ||
|
||
# Node | ||
/node_modules | ||
# files | ||
*.env | ||
*.log | ||
.DS_Store | ||
.pnp.* | ||
lcov.info | ||
package-lock.json | ||
pnpm-lock.yaml | ||
yarn.lock | ||
|
||
# Dapptools | ||
/out | ||
# broadcasts | ||
!broadcast | ||
broadcast/* | ||
broadcast/*/31337/ |
This file was deleted.
Oops, something went wrong.
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,10 +1,17 @@ | ||
# directories | ||
/broadcast | ||
/cache | ||
/lib | ||
/node_modules | ||
/out | ||
broadcast | ||
cache | ||
coverage | ||
node_modules | ||
out | ||
|
||
# files | ||
.env | ||
yarn.lock | ||
*.env | ||
*.log | ||
.DS_Store | ||
.pnp.* | ||
bun.lockb | ||
lcov.info | ||
package-lock.json | ||
pnpm-lock.yaml | ||
yarn.lock |
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 @@ | ||
bracketSpacing: true | ||
printWidth: 120 | ||
proseWrap: "always" | ||
singleQuote: false | ||
tabWidth: 2 | ||
trailingComma: "all" | ||
useTabs: 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 |
---|---|---|
@@ -1,17 +1,14 @@ | ||
{ | ||
"extends": "solhint:recommended", | ||
"rules": { | ||
"avoid-low-level-calls": "off", | ||
"code-complexity": ["error", 9], | ||
"compiler-version": ["error", ">=0.8.4"], | ||
"contract-name-camelcase": "off", | ||
"const-name-snakecase": "off", | ||
"code-complexity": ["error", 8], | ||
"compiler-version": ["error", ">=0.8.23"], | ||
"func-name-mixedcase": "off", | ||
"func-visibility": ["error", { "ignoreConstructors": true }], | ||
"max-line-length": ["error", 123], | ||
"max-line-length": ["error", 120], | ||
"named-parameters-mapping": "warn", | ||
"no-empty-blocks": "off", | ||
"no-console": "off", | ||
"not-rely-on-time": "off", | ||
"var-name-mixedcase": "off" | ||
"one-contract-per-file": "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
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,21 +1,16 @@ | ||
MIT License | ||
This is free and unencumbered software released into the public domain. | ||
|
||
Copyright (c) 2022 Andrei Vlad Birgaoanu | ||
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or | ||
as a compiled binary, for any purpose, commercial or non-commercial, and by any means. | ||
|
||
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: | ||
In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright | ||
interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the | ||
detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of | ||
all present and future rights to this software under copyright law. | ||
|
||
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 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. | ||
|
||
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. | ||
For more information, please refer to <http://unlicense.org/> |
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 |
---|---|---|
@@ -1,23 +1,38 @@ | ||
# Full reference https://github.com/foundry-rs/foundry/tree/master/config | ||
# Full reference https://github.com/foundry-rs/foundry/tree/master/crates/config | ||
|
||
[profile.default] | ||
auto_detect_solc = false | ||
bytecode_hash = "none" | ||
gas_reports = ["*"] | ||
optimizer = true | ||
optimizer_runs = 10_000 | ||
solc = "0.8.17" | ||
|
||
[profile.ci] | ||
fuzz_runs = 10_000 | ||
verbosity = 4 | ||
auto_detect_solc = false | ||
block_timestamp = 1_704_067_200 # January 1, 2024 at 00:00 GMT | ||
bytecode_hash = "none" | ||
evm_version = "paris" # See https://www.evmdiff.com/features?name=PUSH0&kind=opcode | ||
fuzz = { runs = 1_000 } | ||
gas_reports = ["*"] | ||
optimizer = true | ||
optimizer_runs = 10_000 | ||
out = "out" | ||
script = "script" | ||
solc = "0.8.23" | ||
src = "src" | ||
test = "test" | ||
libs = ["node_modules", "lib"] | ||
|
||
[fmt] | ||
bracket_spacing = true | ||
int_types = "long" | ||
line_length = 120 | ||
multiline_func_header = "all" | ||
number_underscore = "thousands" | ||
quote_style = "double" | ||
tab_width = 4 | ||
wrap_comments = true | ||
bracket_spacing = true | ||
int_types = "long" | ||
line_length = 120 | ||
multiline_func_header = "all" | ||
number_underscore = "thousands" | ||
quote_style = "double" | ||
tab_width = 4 | ||
wrap_comments = true | ||
|
||
[rpc_endpoints] | ||
arbitrum = "https://arbitrum-mainnet.infura.io/v3/${API_KEY_INFURA}" | ||
avalanche = "https://avalanche-mainnet.infura.io/v3/${API_KEY_INFURA}" | ||
bnb_smart_chain = "https://bsc-dataseed.binance.org" | ||
gnosis_chain = "https://rpc.gnosischain.com" | ||
localhost = "http://localhost:8545" | ||
mainnet = "https://mainnet.infura.io/v3/${API_KEY_INFURA}" | ||
optimism = "https://optimism-mainnet.infura.io/v3/${API_KEY_INFURA}" | ||
polygon = "https://polygon-mainnet.infura.io/v3/${API_KEY_INFURA}" | ||
sepolia = "https://sepolia.infura.io/v3/${API_KEY_INFURA}" |
Submodule forge-std
deleted from
a2edd3
Oops, something went wrong.