Skip to content

Using printers#

Printers are Python scripts used to extract useful information from Solidity smart contracts. Wake is installed together with the wake_printers module, which provides a set of printers for common use cases.

Basic usage#

To list all available printers, run:

wake print --help

To run a printer, use:

wake print printer-name

A printer accepts a list of paths to contracts to be analyzed as arguments. For example:

wake print inheritance-graph contracts/utils

Printer configuration#

Printers may accept additional arguments and options. To list them, run:

wake print printer-name --help

The output also describes environment variables that can be used to configure given arguments and options.

Additionally, printer configuration can be specified in the project-specific and global configuration TOML file, for example:

custom_option = "value"

See Configuration for more information.

Changing printer loading priorities#

Printers may be loaded from local directories:

  • ./printers (project-specific)
  • $XDG_DATA_HOME/wake/global-printers (global)

and from printer packages (plugins), for example wake_printers.

A printer of the same name may be present in multiple packages (plugins). To see the list of available sources for each printer, run:

wake print list

Project-specific and global printers take precedence over printers from packages, with project-specific printers having the highest priority.

After that, printers are loaded from packages in the alphabetical order of package module names, making the first package the lowest priority.

The loading priorities can be changed in the global plugins.toml configuration file. See Configuration for more information.