Skip to content

Commit

Permalink
(doc) more details for contract instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-valerio committed Nov 19, 2024
1 parent 9b162a5 commit aa802f9
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 15 deletions.
1 change: 0 additions & 1 deletion book/documentation/CONCEPT.html
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ <h3 id="coverage"><a class="header" href="#coverage">Coverage</a></h3>
<h3 id="contract-selectors"><a class="header" href="#contract-selectors">Contract selectors</a></h3>
<p><strong>ink! contract selectors</strong> are unique identifiers for functions within ink! smart contracts. Selectors are derived from
function signatures and are used to call specific functions within a contract deployed on the blockchain.</p>
<hr />

</main>

Expand Down
3 changes: 1 addition & 2 deletions book/documentation/TECH.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@ <h2 id="execution-and-validation"><a class="header" href="#execution-and-validat
invariants hold across different message calls.</p>
<h2 id="contract-instrumentation"><a class="header" href="#contract-instrumentation">Contract instrumentation</a></h2>
<p>Phink instruments contracts using the <code>syn</code> crate, allowing for precise modification and analysis of the smart contract
code. This instrumentation is pivotal for identifying potential vulnerabilities and safeguarding the integrity of the
fuzz testing process.</p>
code. For each high-level Rust instructions, a feedback is returned via the <code>debug_message</code> map to the fuzzing engine, mapping each instruction to a unique <code>u64</code> identifier. This map is then “expanded”, instrumented by AFL++ compiler, and ultimately updated the AFL++ shared map everytime a new edge is hit.</p>

</main>

Expand Down
4 changes: 1 addition & 3 deletions book/documentation/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,6 @@ <h3 id="coverage-1"><a class="header" href="#coverage-1">Coverage</a></h3>
<h3 id="contract-selectors"><a class="header" href="#contract-selectors">Contract selectors</a></h3>
<p><strong>ink! contract selectors</strong> are unique identifiers for functions within ink! smart contracts. Selectors are derived from
function signatures and are used to call specific functions within a contract deployed on the blockchain.</p>
<hr />
<div style="break-before: page; page-break-before: always;"></div><h1 id="how-phink-works"><a class="header" href="#how-phink-works">How Phink works</a></h1>
<p>Phink is built on top of AFL++, leveraging its capabilities to provide effective fuzz testing for ink! smart contracts.
Here’s an overview of how the fuzzer operates.</p>
Expand Down Expand Up @@ -885,8 +884,7 @@ <h2 id="execution-and-validation"><a class="header" href="#execution-and-validat
invariants hold across different message calls.</p>
<h2 id="contract-instrumentation"><a class="header" href="#contract-instrumentation">Contract instrumentation</a></h2>
<p>Phink instruments contracts using the <code>syn</code> crate, allowing for precise modification and analysis of the smart contract
code. This instrumentation is pivotal for identifying potential vulnerabilities and safeguarding the integrity of the
fuzz testing process.</p>
code. For each high-level Rust instructions, a feedback is returned via the <code>debug_message</code> map to the fuzzing engine, mapping each instruction to a unique <code>u64</code> identifier. This map is then “expanded”, instrumented by AFL++ compiler, and ultimately updated the AFL++ shared map everytime a new edge is hit.</p>
<div style="break-before: page; page-break-before: always;"></div><h1 id="troubleshooting"><a class="header" href="#troubleshooting">Troubleshooting</a></h1>
<h2 id="debugging-phink"><a class="header" href="#debugging-phink">Debugging Phink</a></h2>
<h3 id="afl-logs"><a class="header" href="#afl-logs">AFL++ logs</a></h3>
Expand Down
2 changes: 1 addition & 1 deletion book/documentation/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion book/documentation/searchindex.json

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions book/src/CONCEPT.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,4 @@ good assessment of the contract's logic.
### Contract selectors

**ink! contract selectors** are unique identifiers for functions within ink! smart contracts. Selectors are derived from
function signatures and are used to call specific functions within a contract deployed on the blockchain.

---
function signatures and are used to call specific functions within a contract deployed on the blockchain.
3 changes: 1 addition & 2 deletions book/src/TECH.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,4 @@ invariants hold across different message calls.
## Contract instrumentation

Phink instruments contracts using the `syn` crate, allowing for precise modification and analysis of the smart contract
code. This instrumentation is pivotal for identifying potential vulnerabilities and safeguarding the integrity of the
fuzz testing process.
code. For each high-level Rust instructions, a feedback is returned via the `debug_message` map to the fuzzing engine, mapping each instruction to a unique `u64` identifier. This map is then "expanded", instrumented by AFL++ compiler, and ultimately updated the AFL++ shared map everytime a new edge is hit.
1 change: 0 additions & 1 deletion tests/fixtures/corpus/.tmp6KWACT

This file was deleted.

1 change: 0 additions & 1 deletion tests/fixtures/corpus/.tmpKJxozO

This file was deleted.

0 comments on commit aa802f9

Please sign in to comment.