Skip to content

Commit ec883fc

Browse files
authored
Merge pull request #1363 from crytic/lints
Fix links and typos
2 parents 6d134ed + 866d74b commit ec883fc

9 files changed

Lines changed: 22 additions & 22 deletions

File tree

.github/scripts/install-libff.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ cd libff
1818
git checkout v0.2.1
1919
git submodule init && git submodule update
2020

21-
ARGS=("-DCMAKE_INSTALL_PREFIX=$PREFIX" "-DWITH_PROCPS=OFF")
21+
ARGS=("-DCMAKE_INSTALL_PREFIX=$PREFIX" "-DWITH_PROCPS=OFF" "-DCMAKE_POLICY_VERSION_MINIMUM=3.5")
2222
CXXFLAGS=""
2323
if [ "$HOST_OS" = "macOS" ]; then
2424
OPENSSL_PREFIX=$(brew --prefix openssl)

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ response if you ask in our [chat room](https://slack.empirehacking.nyc/)
2727

2828
Echidna uses the pull request contribution model. Please make an account on
2929
Github, fork this repo, and submit code contributions via pull request. For
30-
more documentation, look [here](https://guides.github.com/activities/forking/).
30+
more documentation, look [here](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project).
3131

3232
Some pull request guidelines:
3333

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Echidna is a weird creature that eats bugs and is highly electrosensitive (with apologies to Jacob Stanley)
66

7-
More seriously, Echidna is a Haskell program designed for fuzzing/property-based testing of Ethereum smart contracts. It uses sophisticated grammar-based fuzzing campaigns based on a [contract ABI](https://solidity.readthedocs.io/en/develop/abi-spec.html) to falsify user-defined predicates or [Solidity assertions](https://solidity.readthedocs.io/en/develop/control-structures.html#id4). We designed Echidna with modularity in mind, so it can be easily extended to include new mutations or test specific contracts in specific cases.
7+
More seriously, Echidna is a Haskell program designed for fuzzing/property-based testing of Ethereum smart contracts. It uses sophisticated grammar-based fuzzing campaigns based on a [contract ABI](https://docs.soliditylang.org/en/develop/abi-spec.html) to falsify user-defined predicates or [Solidity assertions](https://docs.soliditylang.org/en/develop/control-structures.html#error-handling-assert-require-revert-and-exceptions). We designed Echidna with modularity in mind, so it can be easily extended to include new mutations or test specific contracts in specific cases.
88

99
## Features
1010

@@ -83,9 +83,9 @@ Our tool signals each execution trace in the corpus with the following "line mar
8383

8484
### Support for smart contract build systems
8585

86-
Echidna can test contracts compiled with different smart contract build systems, including [Truffle](https://truffleframework.com/) or [hardhat](https://hardhat.org/) using [crytic-compile](https://github.com/crytic/crytic-compile). To invoke echidna with the current compilation framework, use `echidna .`.
86+
Echidna can test contracts compiled with different smart contract build systems, including [Foundry](https://book.getfoundry.sh/), [Hardhat](https://hardhat.org/), and [Truffle](https://archive.trufflesuite.com/), using [crytic-compile](https://github.com/crytic/crytic-compile). To invoke Echidna with the current compilation framework, use `echidna .`.
8787

88-
On top of that, Echidna supports two modes of testing complex contracts. Firstly, one can [describe an initialization procedure with Truffle and Etheno](https://github.com/crytic/building-secure-contracts/blob/master/program-analysis/echidna/end-to-end-testing.md) and use that as the base state for Echidna. Secondly, Echidna can call into any contract with a known ABI by passing in the corresponding Solidity source in the CLI. Use `allContracts: true` in your config to turn this on.
88+
On top of that, Echidna supports two modes of testing complex contracts. Firstly, one can [describe an initialization procedure with Truffle and Etheno](https://github.com/crytic/building-secure-contracts/blob/master/program-analysis/echidna/advanced/end-to-end-testing.md) and use that as the base state for Echidna. Secondly, Echidna can call into any contract with a known ABI by passing in the corresponding Solidity source in the CLI. Use `allContracts: true` in your config to turn this on.
8989

9090
### Crash course on Echidna
9191

@@ -111,8 +111,8 @@ The configuration file allows users to choose EVM and test generation
111111
parameters. An example of a complete and annotated config file with the default
112112
options can be found at
113113
[tests/solidity/basic/default.yaml](tests/solidity/basic/default.yaml).
114-
More detailed documentation on the configuration options is available in our
115-
[wiki](https://github.com/trailofbits/echidna/wiki/Config).
114+
See the [documentation](https://secure-contracts.com/program-analysis/echidna/configuration.html)
115+
for more detailed information on the available configuration options.
116116

117117
Echidna supports three different output drivers. There is the default `text`
118118
driver, a `json` driver, and a `none` driver, which should suppress all
@@ -164,7 +164,7 @@ $ less echidna.prof
164164

165165
This produces a report file (`echidna.prof`), that shows which functions take up the most CPU and memory usage.
166166

167-
If the basic profiling doesn't help, you can use more [advanced profiling techniques](https://input-output-hk.github.io/hs-opt-handbook.github.io/src/Measurement_Observation/Heap_Ghc/eventlog.html).
167+
If the basic profiling doesn't help, you can use more [advanced profiling techniques](https://haskell.foundation/hs-opt-handbook.github.io/src/Measurement_Observation/Haskell_Profiling/eventlog.html).
168168

169169
Common causes for performance issues that we observed:
170170

@@ -251,15 +251,15 @@ $ docker run -it -v `pwd`:/src echidna bash -c "solc-select install 0.5.7 && sol
251251

252252
### Building using Stack
253253

254-
If you'd prefer to build from source, use [Stack](https://docs.haskellstack.org/en/stable/README/). `stack install` should build and compile `echidna` in `~/.local/bin`. You will need to link against libreadline and libsecp256k1 (built with recovery enabled), which should be installed with the package manager of your choosing. You also need to install the latest release of [libff](https://github.com/scipr-lab/libff). Refer to our [CI tests](.github/scripts/install-libff.sh) for guidance.
254+
If you'd prefer to build from source, use [Stack](https://docs.haskellstack.org/en/stable/). `stack install` should build and compile `echidna` in `~/.local/bin`. You will need to link against libreadline and libsecp256k1 (built with recovery enabled), which should be installed with the package manager of your choosing. You also need to install the latest release of [libff](https://github.com/scipr-lab/libff). Refer to our [CI tests](.github/scripts/install-libff.sh) for guidance.
255255

256256
Some Linux distributions do not ship static libraries for certain things that Haskell needs, e.g. Arch Linux, which will cause `stack build` to fail with linking errors because we use the `-static` flag. In that case, use `--flag echidna:-static` to produce a dynamically linked binary.
257257

258258
If you're getting errors building related to linking, try tinkering with `--extra-include-dirs` and `--extra-lib-dirs`.
259259

260260
### Building using Nix (works natively on Apple M1 systems)
261261

262-
[Nix users](https://nixos.org/download.html) can install the latest Echidna with:
262+
[Nix users](https://nixos.org/download/) can install the latest Echidna with:
263263

264264
```sh
265265
$ nix-env -i -f https://github.com/crytic/echidna/tarball/master
@@ -300,14 +300,14 @@ This is a partial list of smart contracts projects that use Echidna for testing:
300300
* [Curvance](https://github.com/curvance/Curvance-CantinaCompetition/tree/CodeFAQAndAdjustments/tests/fuzzing)
301301
* [Primitive](https://github.com/primitivefinance/rmm-core/tree/main/contracts/crytic)
302302
* [Uniswap-v3](https://github.com/search?q=org%3AUniswap+echidna&type=commits)
303-
* [Balancer](https://github.com/balancer-labs/balancer-core/tree/master/echidna)
303+
* [Balancer](https://github.com/balancer/balancer-core/tree/master/echidna)
304304
* [MakerDAO vest](https://github.com/makerdao/dss-vest/pull/16)
305-
* [Optimism DAI Bridge](https://github.com/BellwoodStudios/optimism-dai-bridge/blob/master/contracts/test/DaiEchidnaTest.sol)
305+
* [Optimism DAI Bridge](https://github.com/makerdao/optimism-dai-bridge/blob/master/contracts/test/DaiEchidnaTest.sol)
306306
* [WETH10](https://github.com/WETH10/WETH10/tree/main/contracts/fuzzing)
307307
* [Yield](https://github.com/yieldprotocol/fyDai/pull/312)
308308
* [Convexity Protocol](https://github.com/opynfinance/ConvexityProtocol/tree/dev/contracts/echidna)
309309
* [Aragon Staking](https://github.com/aragon/staking/blob/82bf54a3e11ec4e50d470d66048a2dd3154f940b/packages/protocol/contracts/test/lib/EchidnaStaking.sol)
310-
* [Centre Token](https://github.com/centrehq/centre-tokens/tree/master/echidna_tests)
310+
* [Centre Token](https://github.com/circlefin/stablecoin-evm/tree/release-2024-03-15T223309/echidna_tests)
311311
* [Tokencard](https://github.com/tokencard/contracts/tree/master/tools/echidna)
312312
* [Minimalist USD Stablecoin](https://github.com/usmfum/USM/pull/41)
313313

@@ -373,17 +373,17 @@ We can also use Echidna to reproduce research examples from smart contract fuzzi
373373
| Source | Code
374374
|--|--
375375
[Using automatic analysis tools with MakerDAO contracts](https://forum.openzeppelin.com/t/using-automatic-analysis-tools-with-makerdao-contracts/1021) | [SimpleDSChief](https://github.com/crytic/echidna/blob/master/tests/solidity/research/vera_dschief.sol)
376-
[Integer precision bug in Sigma Prime](https://github.com/b-mueller/sabre#example-2-integer-precision-bug) | [VerifyFunWithNumbers](https://github.com/crytic/echidna/blob/master/tests/solidity/research/solcfuzz_funwithnumbers.sol)
376+
[Integer precision bug in Sigma Prime](https://github.com/muellerberndt/sabre#example-2-integer-precision-bug) | [VerifyFunWithNumbers](https://github.com/crytic/echidna/blob/master/tests/solidity/research/solcfuzz_funwithnumbers.sol)
377377
[Learning to Fuzz from Symbolic Execution with Application to Smart Contracts](https://files.sri.inf.ethz.ch/website/papers/ccs19-ilf.pdf) | [Crowdsale](https://github.com/crytic/echidna/blob/master/tests/solidity/research/ilf_crowdsale.sol)
378-
[Harvey: A Greybox Fuzzer for Smart Contracts](https://arxiv.org/abs/1905.06944) | [Foo](https://github.com/crytic/echidna/blob/master/test/solidity/research/harvey_foo.sol), [Baz](https://github.com/crytic/echidna/blob/master/tests/solidity/research/harvey_baz.sol)
378+
[Harvey: A Greybox Fuzzer for Smart Contracts](https://arxiv.org/abs/1905.06944) | [Foo](https://github.com/crytic/echidna/blob/master/tests/solidity/research/harvey_foo.sol), [Baz](https://github.com/crytic/echidna/blob/master/tests/solidity/research/harvey_baz.sol)
379379

380380
### Academic Publications
381381

382382
| Paper Title | Venue | Publication Date |
383383
| --- | --- | --- |
384384
| [echidna-parade: Diverse multicore smart contract fuzzing](https://agroce.github.io/issta21.pdf) | [ISSTA 2021](https://conf.researchr.org/home/issta-2021) | July 2021 |
385385
| [Echidna: Effective, usable, and fast fuzzing for smart contracts](https://agroce.github.io/issta20.pdf) | [ISSTA 2020](https://conf.researchr.org/home/issta-2020) | July 2020 |
386-
| [Echidna: A Practical Smart Contract Fuzzer](papers/echidna_fc_poster.pdf) | [FC 2020](https://fc20.ifca.ai/program.html) | Feb 2020 |
386+
| [Echidna: A Practical Smart Contract Fuzzer](https://github.com/trailofbits/publications/blob/master/papers/echidna_fc_poster.pdf) | [FC 2020](https://fc20.ifca.ai/program.html) | Feb 2020 |
387387

388388
If you are using Echidna for academic work, consider applying to the [Crytic $10k Research Prize](https://blog.trailofbits.com/2019/11/13/announcing-the-crytic-10k-research-prize/).
389389

lib/Echidna/ABI.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ mutateAbiValue = \case
344344
AbiFunction v -> pure $ AbiFunction v
345345

346346
-- | Given a 'SolCall', generate a random \"similar\" call with the same 'SolSignature'.
347-
-- Note that this funcion will mutate a *single* argument (if any)
347+
-- Note that this function will mutate a *single* argument (if any)
348348
mutateAbiCall :: MonadRandom m => SolCall -> m SolCall
349349
mutateAbiCall = traverse f
350350
where f [] = pure []

lib/Echidna/Config.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ instance FromJSON EConfigWithUsage where
3232
-- this runs the parser in a StateT monad which keeps track of the keys
3333
-- utilized by the config parser
3434
-- we can then compare the set difference between the keys found in the config
35-
-- file and the keys used by the parser to comopute which keys were set in the
35+
-- file and the keys used by the parser to compute which keys were set in the
3636
-- config and not used and which keys were unset in the config and defaulted
3737
parseJSON o = do
3838
let v' = case o of

lib/Echidna/Types/Solidity.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ data SolConf = SolConf
6464
, sender :: Set Addr -- ^ Sender addresses to use
6565
, balanceAddr :: Integer -- ^ Initial balance of deployer and senders
6666
, balanceContract :: Integer -- ^ Initial balance of contract to test
67-
, codeSize :: Integer -- ^ Max code size for deployed contratcs (default 0xffffffff)
67+
, codeSize :: Integer -- ^ Max code size for deployed contracts (default 0xffffffff)
6868
, prefix :: Text -- ^ Function name prefix used to denote tests
6969
, disableSlither :: Bool -- ^ Whether or not to skip running Slither
7070
, cryticArgs :: [String] -- ^ Args to pass to crytic

lib/Echidna/Types/Test.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ data TestConf = TestConf
3434
-- call sequence was found.
3535
data TestState
3636
= Open
37-
| Large !Int -- ^ Solved, maybe shrinable, tracking shrinks tried
37+
| Large !Int -- ^ Solved, maybe shrinkable, tracking shrinks tried
3838
| Passed -- ^ Presumed unsolvable
3939
| Solved -- ^ Solved with no need for shrinking
4040
| Failed ExecException -- ^ Broke the execution environment

tests/solidity/basic/default.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ sender: ["0x10000", "0x20000", "0x30000"]
3838
balanceAddr: 0xffffffff
3939
#balanceContract overrides balanceAddr for the contract address
4040
balanceContract: 0
41-
#codeSize max code size for deployed contratcs (default 0xffffffff)
41+
#codeSize max code size for deployed contracts (default 0xffffffff)
4242
codeSize: 0xffffffff
4343
#whether or not to disable running slither (default false, uses slither)
4444
disableSlither: false

tests/solidity/research/solcfuzz_funwithnumbers.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Original example from https://github.com/b-mueller/sabre#example-2-integer-precision-bug
1+
// Original example from https://github.com/muellerberndt/sabre#example-2-integer-precision-bug
22

33
contract FunWithNumbers {
44
uint constant public tokensPerEth = 10;

0 commit comments

Comments
 (0)