Skip to content

Commit b28e2cd

Browse files
committed
crashed.png
1 parent 97cb74e commit b28e2cd

File tree

10 files changed

+63
-94
lines changed

10 files changed

+63
-94
lines changed

assets/crashed.png

21.8 KB
Loading

book/documentation/CAMPAIGN.html

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -224,36 +224,24 @@ <h3 id="1-instrument-the-contract"><a class="header" href="#1-instrument-the-con
224224
<p>This step modifies the contract to include necessary hooks for Phink’s fuzzing process. It creates a fork of the
225225
contract, so you don’t have to make a copy before.</p>
226226
<h3 id="2-run-the-fuzzer"><a class="header" href="#2-run-the-fuzzer">2. Run the fuzzer</a></h3>
227-
<p>After instrumenting your contract and writing properties, execute the fuzzing process:</p>
227+
<p>After <strong>instrumenting</strong> your contract and <strong>writing</strong> properties and <strong>configuring</strong> your <code>phink.toml</code>, execute the
228+
fuzzing process:</p>
228229
<pre><code class="language-sh">phink fuzz
229230
</code></pre>
230231
<p>This command runs your fuzzing tests based on the configuration set in your <code>phink.toml</code> file. A user interface should
231232
appear.</p>
232233
<h2 id="analyzing-results"><a class="header" href="#analyzing-results">Analyzing Results</a></h2>
233-
<h3 id="coverage-reports"><a class="header" href="#coverage-reports">Coverage Reports</a></h3>
234+
<h3 id="crashes"><a class="header" href="#crashes">Crashes</a></h3>
235+
<p>In case of crashes, you should see something like</p>
236+
<h3 id="coverage"><a class="header" href="#coverage">Coverage</a></h3>
237+
<p><strong>IMPORTANT: this feature is in alpha.</strong></p>
238+
<h4 id="generating-a-coverage-report"><a class="header" href="#generating-a-coverage-report">Generating a coverage report</a></h4>
234239
<p>Generate coverage reports to analyze which parts of the contract were tested:</p>
235-
<pre><code class="language-sh">phink coverage
240+
<pre><code class="language-sh">phink coverage my_contract/
236241
</code></pre>
237-
<h3 id="log-analysis"><a class="header" href="#log-analysis">Log Analysis</a></h3>
238-
<p>Check detailed logs if <code>verbose</code> is enabled in your configuration. Logs provide insights into fuzzing processes and
239-
detected issues.</p>
240-
<h2 id="interpreting-coverage-reports"><a class="header" href="#interpreting-coverage-reports">Interpreting Coverage Reports</a></h2>
241-
<p>The coverage report provides a visual representation of tested code areas. Ensure that all critical paths of your
242-
contract are covered.</p>
243-
<h2 id="debugging-fuzzing-results"><a class="header" href="#debugging-fuzzing-results">Debugging Fuzzing Results</a></h2>
244-
<h3 id="harness-coverage"><a class="header" href="#harness-coverage">Harness Coverage</a></h3>
245-
<p>Use the harness coverage feature for debugging:</p>
246-
<pre><code class="language-sh">phink harness-cover
247-
</code></pre>
248-
<p>This isolates test harness issues from contract logic problems.</p>
249-
<h2 id="writing-effective-properties"><a class="header" href="#writing-effective-properties">Writing Effective Properties</a></h2>
250-
<h3 id="key-tips"><a class="header" href="#key-tips">Key Tips:</a></h3>
251-
<ul>
252-
<li>Ensure properties are clear and address potential vulnerabilities.</li>
253-
<li>Regularly update properties based on contract changes.</li>
254-
</ul>
255-
<p>By following these guidelines, you can effectively leverage Phink to ensure the reliability and security of your ink!
256-
smart contracts.</p>
242+
<p>Some HTML files should then be generated in the path you’ve configured inside your <code>phink.toml</code>.</p>
243+
<h4 id="interpreting-coverage-reports"><a class="header" href="#interpreting-coverage-reports">Interpreting Coverage Reports</a></h4>
244+
<p>The coverage report provides a visual representation of tested code areas. Basically, the more green lines, the better.</p>
257245

258246
</main>
259247

book/documentation/START.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,7 @@ <h5 id="building-from-source"><a class="header" href="#building-from-source">Bui
195195
<ol>
196196
<li>
197197
<p><strong>Clone the Repository</strong></p>
198-
<pre><code class="language-bash">git clone https://github.com/srlabs/phink
199-
cd phink/
198+
<pre><code class="language-bash">git clone https://github.com/srlabs/phink &amp;&amp; cd phink/
200199
</code></pre>
201200
<p>You can also use:</p>
202201
<pre><code class="language-bash">cargo +nightly install --git https://github.com/srlabs/phink
@@ -221,9 +220,7 @@ <h5 id="building-from-source"><a class="header" href="#building-from-source">Bui
221220
<li>
222221
<p><strong>Run Phink</strong></p>
223222
<pre><code class="language-bash">./target/release/phink --help
224-
</code></pre>
225-
<p>Or if installed via <code>cargo install</code>:</p>
226-
<pre><code class="language-bash">phink --help
223+
phink --help # if installed via `cargo install`
227224
</code></pre>
228225
</li>
229226
</ol>

book/documentation/TROUBLESHOTING.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ <h1 class="menu-title">Phink Book</h1>
182182
<p>Common Issues and Solutions
183183
Performance Tuning
184184
Community Support Channels</p>
185+
<h3 id="debugging-phink"><a class="header" href="#debugging-phink">Debugging Phink</a></h3>
186+
<p>Use the harness coverage feature for debugging. You should only use this if you want to have a coverage of Phink itself,
187+
for instance if you are planning to contribute to Phink, or to debug it.</p>
188+
<pre><code class="language-sh">phink harness-cover
189+
</code></pre>
185190

186191
</main>
187192

book/documentation/print.html

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,7 @@ <h5 id="building-from-source"><a class="header" href="#building-from-source">Bui
221221
<ol>
222222
<li>
223223
<p><strong>Clone the Repository</strong></p>
224-
<pre><code class="language-bash">git clone https://github.com/srlabs/phink
225-
cd phink/
224+
<pre><code class="language-bash">git clone https://github.com/srlabs/phink &amp;&amp; cd phink/
226225
</code></pre>
227226
<p>You can also use:</p>
228227
<pre><code class="language-bash">cargo +nightly install --git https://github.com/srlabs/phink
@@ -247,9 +246,7 @@ <h5 id="building-from-source"><a class="header" href="#building-from-source">Bui
247246
<li>
248247
<p><strong>Run Phink</strong></p>
249248
<pre><code class="language-bash">./target/release/phink --help
250-
</code></pre>
251-
<p>Or if installed via <code>cargo install</code>:</p>
252-
<pre><code class="language-bash">phink --help
249+
phink --help # if installed via `cargo install`
253250
</code></pre>
254251
</li>
255252
</ol>
@@ -408,36 +405,24 @@ <h3 id="1-instrument-the-contract"><a class="header" href="#1-instrument-the-con
408405
<p>This step modifies the contract to include necessary hooks for Phink’s fuzzing process. It creates a fork of the
409406
contract, so you don’t have to make a copy before.</p>
410407
<h3 id="2-run-the-fuzzer"><a class="header" href="#2-run-the-fuzzer">2. Run the fuzzer</a></h3>
411-
<p>After instrumenting your contract and writing properties, execute the fuzzing process:</p>
408+
<p>After <strong>instrumenting</strong> your contract and <strong>writing</strong> properties and <strong>configuring</strong> your <code>phink.toml</code>, execute the
409+
fuzzing process:</p>
412410
<pre><code class="language-sh">phink fuzz
413411
</code></pre>
414412
<p>This command runs your fuzzing tests based on the configuration set in your <code>phink.toml</code> file. A user interface should
415413
appear.</p>
416414
<h2 id="analyzing-results"><a class="header" href="#analyzing-results">Analyzing Results</a></h2>
417-
<h3 id="coverage-reports"><a class="header" href="#coverage-reports">Coverage Reports</a></h3>
415+
<h3 id="crashes"><a class="header" href="#crashes">Crashes</a></h3>
416+
<p>In case of crashes, you should see something like</p>
417+
<h3 id="coverage"><a class="header" href="#coverage">Coverage</a></h3>
418+
<p><strong>IMPORTANT: this feature is in alpha.</strong></p>
419+
<h4 id="generating-a-coverage-report"><a class="header" href="#generating-a-coverage-report">Generating a coverage report</a></h4>
418420
<p>Generate coverage reports to analyze which parts of the contract were tested:</p>
419-
<pre><code class="language-sh">phink coverage
421+
<pre><code class="language-sh">phink coverage my_contract/
420422
</code></pre>
421-
<h3 id="log-analysis"><a class="header" href="#log-analysis">Log Analysis</a></h3>
422-
<p>Check detailed logs if <code>verbose</code> is enabled in your configuration. Logs provide insights into fuzzing processes and
423-
detected issues.</p>
424-
<h2 id="interpreting-coverage-reports"><a class="header" href="#interpreting-coverage-reports">Interpreting Coverage Reports</a></h2>
425-
<p>The coverage report provides a visual representation of tested code areas. Ensure that all critical paths of your
426-
contract are covered.</p>
427-
<h2 id="debugging-fuzzing-results"><a class="header" href="#debugging-fuzzing-results">Debugging Fuzzing Results</a></h2>
428-
<h3 id="harness-coverage"><a class="header" href="#harness-coverage">Harness Coverage</a></h3>
429-
<p>Use the harness coverage feature for debugging:</p>
430-
<pre><code class="language-sh">phink harness-cover
431-
</code></pre>
432-
<p>This isolates test harness issues from contract logic problems.</p>
433-
<h2 id="writing-effective-properties"><a class="header" href="#writing-effective-properties">Writing Effective Properties</a></h2>
434-
<h3 id="key-tips"><a class="header" href="#key-tips">Key Tips:</a></h3>
435-
<ul>
436-
<li>Ensure properties are clear and address potential vulnerabilities.</li>
437-
<li>Regularly update properties based on contract changes.</li>
438-
</ul>
439-
<p>By following these guidelines, you can effectively leverage Phink to ensure the reliability and security of your ink!
440-
smart contracts.</p>
423+
<p>Some HTML files should then be generated in the path you’ve configured inside your <code>phink.toml</code>.</p>
424+
<h4 id="interpreting-coverage-reports"><a class="header" href="#interpreting-coverage-reports">Interpreting Coverage Reports</a></h4>
425+
<p>The coverage report provides a visual representation of tested code areas. Basically, the more green lines, the better.</p>
441426
<div style="break-before: page; page-break-before: always;"></div><p>Maximizing Coverage
442427
Ensuring Robustness and Security
443428
Simple ink! Contract Example
@@ -481,7 +466,7 @@ <h3 id="instrumentation"><a class="header" href="#instrumentation">Instrumentati
481466
instrumentation is used to trace execution paths, enabling coverage-guided techniques to generate more informed and
482467
effective test cases.</p>
483468
<hr />
484-
<h3 id="coverage"><a class="header" href="#coverage">Coverage</a></h3>
469+
<h3 id="coverage-1"><a class="header" href="#coverage-1">Coverage</a></h3>
485470
<p><strong>Coverage</strong> is a measure of how much of a program’s code is tested during fuzzing. High coverage corresponds to a
486471
good assessment of the contracts logic.</p>
487472
<hr />
@@ -493,6 +478,11 @@ <h3 id="contract-selectors"><a class="header" href="#contract-selectors">Contrac
493478
<div style="break-before: page; page-break-before: always;"></div><p>Common Issues and Solutions
494479
Performance Tuning
495480
Community Support Channels</p>
481+
<h3 id="debugging-phink"><a class="header" href="#debugging-phink">Debugging Phink</a></h3>
482+
<p>Use the harness coverage feature for debugging. You should only use this if you want to have a coverage of Phink itself,
483+
for instance if you are planning to contribute to Phink, or to debug it.</p>
484+
<pre><code class="language-sh">phink harness-cover
485+
</code></pre>
496486

497487
</main>
498488

book/documentation/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

book/documentation/searchindex.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

book/src/CAMPAIGN.md

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ contract, so you don't have to make a copy before.
5858

5959
### 2. Run the fuzzer
6060

61-
After instrumenting your contract and writing properties, execute the fuzzing process:
61+
After **instrumenting** your contract and **writing** properties and **configuring** your `phink.toml`, execute the
62+
fuzzing process:
6263

6364
```sh
6465
phink fuzz
@@ -69,42 +70,24 @@ appear.
6970

7071
## Analyzing Results
7172

72-
### Coverage Reports
73+
### Crashes
7374

74-
Generate coverage reports to analyze which parts of the contract were tested:
75-
76-
```sh
77-
phink coverage
78-
```
79-
80-
### Log Analysis
75+
In case of crashes, you should see something like
8176

82-
Check detailed logs if `verbose` is enabled in your configuration. Logs provide insights into fuzzing processes and
83-
detected issues.
77+
### Coverage
8478

85-
## Interpreting Coverage Reports
79+
**IMPORTANT: this feature is in alpha.**
8680

87-
The coverage report provides a visual representation of tested code areas. Ensure that all critical paths of your
88-
contract are covered.
81+
#### Generating a coverage report
8982

90-
## Debugging Fuzzing Results
91-
92-
### Harness Coverage
93-
94-
Use the harness coverage feature for debugging:
83+
Generate coverage reports to analyze which parts of the contract were tested:
9584

9685
```sh
97-
phink harness-cover
86+
phink coverage my_contract/
9887
```
9988

100-
This isolates test harness issues from contract logic problems.
101-
102-
## Writing Effective Properties
103-
104-
### Key Tips:
89+
Some HTML files should then be generated in the path you've configured inside your `phink.toml`.
10590

106-
- Ensure properties are clear and address potential vulnerabilities.
107-
- Regularly update properties based on contract changes.
91+
#### Interpreting Coverage Reports
10892

109-
By following these guidelines, you can effectively leverage Phink to ensure the reliability and security of your ink!
110-
smart contracts.
93+
The coverage report provides a visual representation of tested code areas. Basically, the more green lines, the better.

book/src/START.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ You can install Phink by building it from the source or by using Docker. Choose
1919

2020
1. **Clone the Repository**
2121
```bash
22-
git clone https://github.com/srlabs/phink
23-
cd phink/
22+
git clone https://github.com/srlabs/phink && cd phink/
2423
```
24+
2525
You can also use:
2626
```bash
2727
cargo +nightly install --git https://github.com/srlabs/phink
@@ -46,10 +46,7 @@ You can install Phink by building it from the source or by using Docker. Choose
4646
5. **Run Phink**
4747
```bash
4848
./target/release/phink --help
49-
```
50-
Or if installed via `cargo install`:
51-
```bash
52-
phink --help
49+
phink --help # if installed via `cargo install`
5350
```
5451

5552
##### Using Docker

book/src/TROUBLESHOTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
Common Issues and Solutions
22
Performance Tuning
33
Community Support Channels
4+
5+
### Debugging Phink
6+
7+
Use the harness coverage feature for debugging. You should only use this if you want to have a coverage of Phink itself,
8+
for instance if you are planning to contribute to Phink, or to debug it.
9+
10+
```sh
11+
phink harness-cover
12+
```

0 commit comments

Comments
 (0)