Skip to content

Commit

Permalink
📝 Add c3-linearization printer docs
Browse files Browse the repository at this point in the history
  • Loading branch information
michprev committed Dec 24, 2023
1 parent 45b32d5 commit dcdad1e
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/static-analysis/printers/c3-linearization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# C3 linearization printer

Prints the [C3 linearization](https://docs.soliditylang.org/en/latest/contracts.html#multiple-inheritance-and-linearization) of a contract.

## Example

<div>
--8<-- "docs/static-analysis/printers/c3-linearization.svg"
</div>

## Parameters

| Command-line name | TOML name | Type | Default value | Description |
|-------------------|---------------------------|--------|---------------|--------------------------------------------------------------------------|
| `--interfaces` | <nobr>`interfaces`</nobr> | `bool` | `False` | Whether to include interfaces in the output. |
| `--verbose` | <nobr>`verbose`</nobr> | `bool` | `False` | Whether to print more verbose input with base contracts and constructor. |
96 changes: 96 additions & 0 deletions docs/static-analysis/printers/c3-linearization.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ nav:
- Unused modifier: 'static-analysis/detectors/unused-modifier.md'
- Printers:
- ABI: 'static-analysis/printers/abi.md'
- C3 linearization: 'static-analysis/printers/c3-linearization.md'
- Control flow graph: 'static-analysis/printers/control-flow-graph.md'
- Imports graph: 'static-analysis/printers/imports-graph.md'
- Inheritance graph: 'static-analysis/printers/inheritance-graph.md'
Expand Down
3 changes: 3 additions & 0 deletions wake_printers/c3_linearization.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,8 @@ def add_contract_to_tree(parent_node, n, index):
help="Show inheritance and constructors",
)
def cli(self, interfaces: bool, verbose: bool) -> None:
"""
Print the C3 linearization of contracts.
"""
self._interfaces = interfaces
self._verbose = verbose

0 comments on commit dcdad1e

Please sign in to comment.