{"id":19830758,"url":"https://github.com/crytic/echidna-spearbit-demo","last_synced_at":"2025-05-01T15:30:49.666Z","repository":{"id":43265732,"uuid":"510346197","full_name":"crytic/echidna-spearbit-demo","owner":"crytic","description":"Example code for testing using Echidna explained during the Spearbit presentation","archived":true,"fork":false,"pushed_at":"2022-07-06T11:25:56.000Z","size":19,"stargazers_count":40,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T05:32:16.404Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crytic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-04T12:15:19.000Z","updated_at":"2025-02-14T16:17:43.000Z","dependencies_parsed_at":"2022-07-08T05:51:54.800Z","dependency_job_id":null,"html_url":"https://github.com/crytic/echidna-spearbit-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crytic%2Fechidna-spearbit-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crytic%2Fechidna-spearbit-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crytic%2Fechidna-spearbit-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crytic%2Fechidna-spearbit-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crytic","download_url":"https://codeload.github.com/crytic/echidna-spearbit-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251898558,"owners_count":21661843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T11:25:16.585Z","updated_at":"2025-05-01T15:30:45.491Z","avatar_url":"https://github.com/crytic.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fuzz tests explained during the Spearbit presentation\n\n## Before starting\n\nInstall Echidna 2.0.2:\n\n* Install/upgrade [slither](https://github.com/crytic/slither): `pip3 install slither-analyzer --upgrade`\n* Recommended option: [precompiled binaries](https://github.com/crytic/echidna/releases/tag/v2.0.2) (Linux and MacOS supported). \n* Alternative option: [use docker](https://hub.docker.com/layers/echidna/trailofbits/echidna/v2.0.2/images/sha256-2d8f87daad48818c8f0e6aca68be6add7d2e7016e950f22a0ceafa1224f03cde?context=explore).\n\nIf you do not have experience with Echidna, please start reviewing the [Echidna README](https://github.com/crytic/echidna#echidna-a-fast-smart-contract-fuzzer-), as well as [the official tutorials](https://github.com/crytic/building-secure-contracts/tree/master/program-analysis/echidna). \n\n## The demo\n\nThis repository contains everything necessary to test simple properties of *SomeDeFi*, a syntetic minimalistic DeFi protocol. Users should complete the `TestSomeDefi` contract creating functions to test different invariants from function (e.g. mintShares, withdrawShares, etc) using assertions. \n\nA few pointers to start:\n\n0. Read the implementation code of *SomeDeFi* (it is very small).\n1. Think of basic properties for every operation\n2. Consider when an operation should or it should *not* revert\n3. Optimize the resulting properties, perhaps merging some of them.\n\nTo start a Echidna fuzzing campaign use:\n\n```\n$ echidna-test --test-mode assertion --contract TestSomeDefi --config SomeDeFi.yaml SomeDeFi.sol\n```\n\nThe recommended Solidity version for the fuzzing campaign is 0.8.1, however, more recent releases can be used as well.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrytic%2Fechidna-spearbit-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrytic%2Fechidna-spearbit-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrytic%2Fechidna-spearbit-demo/lists"}