-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from crytic/dev-medusa
Initial medusa support for the CI
- Loading branch information
Showing
10 changed files
with
615 additions
and
13 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
.github/workflows/examples.yaml → .github/workflows/echidna.yaml
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,4 @@ | ||
name: Test examples | ||
name: Test examples using Echidna | ||
|
||
on: | ||
push: | ||
|
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,117 @@ | ||
name: Test examples using Medusa | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
|
||
jobs: | ||
foundry: | ||
name: Test Foundry examples | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Go setup | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "^1.18.1" | ||
|
||
- name: Install medusa | ||
run: | | ||
git clone https://github.com/crytic/medusa.git | ||
cd medusa | ||
go build -o medusa -v . | ||
go install -v . | ||
sudo cp medusa /usr/bin | ||
pip install crytic-compile | ||
- name: Compile ERC20 Foundry example | ||
working-directory: tests/ERC20/foundry | ||
run: forge build --build-info | ||
|
||
- name: Run Medusa for Internal ERC20 tests | ||
working-directory: tests/ERC20/foundry | ||
run: | | ||
medusa fuzz --target-contracts CryticERC20InternalHarness --config medusa-config.json | ||
- name: Run Medusa for External ERC20 tests | ||
working-directory: tests/ERC20/foundry | ||
run: | | ||
medusa fuzz --target-contracts CryticERC20ExternalHarness --config medusa-config-ext.json | ||
- name: Compile ERC4646 Foundry example | ||
working-directory: tests/ERC4626/foundry | ||
run: forge build --build-info | ||
|
||
- name: Run Medusa for External ERC4626 tests | ||
working-directory: tests/ERC4626/foundry | ||
run: | | ||
medusa fuzz --target-contracts CryticERC4626InternalHarness --config medusa-config.json | ||
hardhat: | ||
name: Test Hardhat examples | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set up Nodejs | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Install dependencies and compile ERC20 example | ||
working-directory: tests/ERC20/hardhat | ||
run: | | ||
npm ci | ||
npx hardhat compile --force | ||
- name: Install dependencies and compile ERC4626 example | ||
working-directory: tests/ERC4626/hardhat | ||
run: | | ||
npm ci | ||
npx hardhat compile --force | ||
- name: Go setup | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "^1.18.1" | ||
|
||
- name: Install medusa | ||
run: | | ||
git clone https://github.com/crytic/medusa.git | ||
cd medusa | ||
go build -o medusa -v . | ||
go install -v . | ||
sudo cp medusa /usr/bin | ||
pip install crytic-compile | ||
- name: Run Medusa for Internal ERC20 tests | ||
working-directory: tests/ERC20/hardhat | ||
run: | | ||
medusa fuzz --target-contracts CryticERC20InternalHarness --config medusa-config.json | ||
- name: Run Medusa for External ERC20 tests | ||
working-directory: tests/ERC20/hardhat | ||
run: | | ||
medusa fuzz --target-contracts CryticERC20ExternalHarness --config medusa-config-ext.json | ||
- name: Run Medusa for External ERC4626 tests | ||
working-directory: tests/ERC4626/hardhat | ||
run: | | ||
medusa fuzz --target-contracts CryticERC4626Harness --config medusa-config.json |
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
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,80 @@ | ||
{ | ||
"fuzzing": { | ||
"workers": 10, | ||
"workerResetLimit": 50, | ||
"timeout": 0, | ||
"testLimit": 500000, | ||
"callSequenceLength": 100, | ||
"corpusDirectory": "tests/medusa-corpus-ext", | ||
"coverageEnabled": true, | ||
"targetContracts": [], | ||
"targetContractsBalances": [], | ||
"constructorArgs": {}, | ||
"deployerAddress": "0x10000", | ||
"senderAddresses": [ | ||
"0x10000", | ||
"0x20000", | ||
"0x30000" | ||
], | ||
"blockNumberDelayMax": 60480, | ||
"blockTimestampDelayMax": 604800, | ||
"blockGasLimit": 125000000, | ||
"transactionGasLimit": 12500000, | ||
"testing": { | ||
"stopOnFailedTest": true, | ||
"stopOnFailedContractMatching": false, | ||
"stopOnNoTests": true, | ||
"testAllContracts": true, | ||
"traceAll": false, | ||
"assertionTesting": { | ||
"enabled": true, | ||
"testViewMethods": false, | ||
"panicCodeConfig": { | ||
"failOnCompilerInsertedPanic": false, | ||
"failOnAssertion": true, | ||
"failOnArithmeticUnderflow": false, | ||
"failOnDivideByZero": false, | ||
"failOnEnumTypeConversionOutOfBounds": false, | ||
"failOnIncorrectStorageAccess": false, | ||
"failOnPopEmptyArray": false, | ||
"failOnOutOfBoundsArrayAccess": false, | ||
"failOnAllocateTooMuchMemory": false, | ||
"failOnCallUninitializedVariable": false | ||
} | ||
}, | ||
"propertyTesting": { | ||
"enabled": false, | ||
"testPrefixes": [ | ||
"property_" | ||
] | ||
}, | ||
"optimizationTesting": { | ||
"enabled": false, | ||
"testPrefixes": [ | ||
"optimize_" | ||
] | ||
} | ||
}, | ||
"chainConfig": { | ||
"codeSizeCheckDisabled": true, | ||
"cheatCodes": { | ||
"cheatCodesEnabled": true, | ||
"enableFFI": false | ||
} | ||
} | ||
}, | ||
"compilation": { | ||
"platform": "crytic-compile", | ||
"platformConfig": { | ||
"target": ".", | ||
"solcVersion": "", | ||
"exportDirectory": "", | ||
"args": ["--foundry-compile-all"] | ||
} | ||
}, | ||
"logging": { | ||
"level": "info", | ||
"logDirectory": "", | ||
"noColor": false | ||
} | ||
} |
Oops, something went wrong.