diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7bf34e..935e74b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,11 +32,6 @@ jobs: node-version: 18.15 - run: npm install - run: npm test - - uses: actions/cache@v4 - with: - path: fuzzing/corpus - key: fuzzing - - run: npm run fuzz verify: runs-on: ubuntu-latest diff --git a/Readme.md b/Readme.md index c5e8872..2c0efb6 100644 --- a/Readme.md +++ b/Readme.md @@ -14,10 +14,6 @@ To run the tests, execute the following commands: npm install npm test -You can also run fuzzing tests (using [Echidna][echidna]) on the contracts: - - npm run fuzz - To start a local Ethereum node with the contracts deployed, execute: npm start diff --git a/contracts/FuzzMarketplace.sol b/contracts/FuzzMarketplace.sol deleted file mode 100644 index 1520522..0000000 --- a/contracts/FuzzMarketplace.sol +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.28; - -import "./TestToken.sol"; -import "./Marketplace.sol"; -import "./Vault.sol"; -import "./TestVerifier.sol"; - -contract FuzzMarketplace is Marketplace { - constructor() - Marketplace( - MarketplaceConfig( - CollateralConfig(10, 5, 10, 20), - ProofConfig(10, 5, 64, 67, ""), - SlotReservationsConfig(20), - Duration.wrap(60 * 60 * 24 * 30) // 30 days - ), - new Vault(new TestToken()), - new TestVerifier() - ) - {} - - // Properties to be tested through fuzzing - - MarketplaceTotals private _lastSeenTotals; - - function neverDecreaseTotals() public { - assert(_marketplaceTotals.received >= _lastSeenTotals.received); - assert(_marketplaceTotals.sent >= _lastSeenTotals.sent); - _lastSeenTotals = _marketplaceTotals; - } - - function neverLoseFunds() public view { - uint256 total = _marketplaceTotals.received - _marketplaceTotals.sent; - assert(token().balanceOf(address(this)) >= total); - } -} diff --git a/fuzzing/corpus/.gitignore b/fuzzing/corpus/.gitignore deleted file mode 100644 index 1c0813e..0000000 --- a/fuzzing/corpus/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!.gitignore -!.keep diff --git a/fuzzing/corpus/.keep b/fuzzing/corpus/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/fuzzing/echidna.yaml b/fuzzing/echidna.yaml deleted file mode 100644 index feb64ee..0000000 --- a/fuzzing/echidna.yaml +++ /dev/null @@ -1,11 +0,0 @@ -# configure Echidna fuzzing tests - -testMode: "assertion" # check that solidity asserts are never triggered -allContracts: true # allow calls to e.g. TestToken in test scenarios -format: "text" # disable interactive ui - -# For a longer test run, consider these options: -# timeout: 3600 # limit test run to one hour -# testLimit: 100000000000 # do not limit the amount of test sequences -# stopOnFail: true # stop on first failure -# workers: 8 # use more cpu cores diff --git a/fuzzing/fuzz.sh b/fuzzing/fuzz.sh deleted file mode 100755 index a869e18..0000000 --- a/fuzzing/fuzz.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -set -e - -root=$(cd $(dirname "$0")/.. && pwd) -arch=$(arch) - -if command -v echidna; then - fuzz () { - echidna ${root} \ - --config ${root}/fuzzing/echidna.yaml \ - --corpus-dir ${root}/fuzzing/corpus \ - --crytic-args --ignore-compile \ - --contract $1 - } -elif [ "${arch}" = "x86_64" ]; then - fuzz () { - docker run \ - --rm \ - -v ${root}:/src ghcr.io/crytic/echidna/echidna \ - bash -c \ - "cd /src && echidna . \ - --config fuzzing/echidna.yaml \ - --corpus-dir fuzzing/corpus \ - --crytic-args --ignore-compile \ - --contract $1" - } -else - echo "Error: echidna not found, and the docker image does not support ${arch}" - echo "Please install echidna: https://github.com/crytic/echidna#installation" - exit 1 -fi - -fuzz FuzzMarketplace diff --git a/package.json b/package.json index cb36df8..c2948fc 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,6 @@ "license": "MIT", "scripts": { "test": "npm run lint && hardhat test", - "fuzz": "hardhat compile && fuzzing/fuzz.sh", "start": "hardhat node --export deployment-localhost.json", "compile": "hardhat compile", "format": "prettier --write contracts/*.sol contracts/**/*.sol test/**/*.js",