# sFuzz

## 1. Prepare smart contracts

Create `contracts/` folder and put your solidity files there. Since one solidity file can contains more than 1 contract, rename your file to the name of contract which you want to test.

E.g: a file `Sample.sol` contains two contracts `Bank` and `ERC20`. To test contract `Bank`, rename `Sample.sol` to `Bank.sol`

## 2. Quick start <a href="#id-2-quick-start" id="id-2-quick-start"></a>

Pull docker image

```
docker pull sfuzz/ethfuzzer
```

Start container and map `contracts/` folder to container.

```
docker run -it -v /path/to/contracts/folder/:/home/contracts/ sfuzz/ethfuzzer
```

Note that: **/path/to/contracts/folder/** is absolute path to `contracts` folder

Test solidity file in `contracts/` folder

```
cd /home/ && ./fuzzer -g -r 0 -d 120 && chmod +x fuzzMe && ./fuzzMe
```

Fuzzer shows progress in terminal

![Terminal output](/files/-LeRGWYHgTnG90qGOkzY)

output files are saved to `contracts/`folder

## 3. Common Errors

#### Q: Can not compile solidity source code ?

sFuzz relies on external compiler to compile solidity source code. In docker container, we installed `solc` `v0.4.24`. If you want to fuzz with other solidity versions, replace our `solc` at `/usr/bin/solc` with your own `solc`. Visit <https://github.com/ethereum/solidity/releases> to download specific solidity version.

#### Q: Contract is not found ?

Make sure file name of solidity is one of the contract names in that file

#### Q: Core dump ?

Make sure your contract is compiled by container’s `solc` without errors


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fuzzing.gitbook.io/sfuzz/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
