Skip to content

wake.config.data_model module #

AnvilConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class AnvilConfig(WakeConfigModel):
    cmd_args: str = (
        "--prune-history 100 --transaction-block-keeper 10 --steps-tracing --silent"
    )
    """
    Command line arguments to pass to `anvil`.
    """

cmd_args = '--prune-history 100 --transaction-block-keeper 10 --steps-tracing --silent' class-attribute instance-attribute #

Command line arguments to pass to anvil.

CodeLensConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class CodeLensConfig(WakeConfigModel):
    enable: bool = True
    """
    Show code lenses.
    """
    sort_tag_priority: List[str] = [
        "lsp-references",
        "lsp-selectors",
        "lsp-inheritance-graph",
        "lsp-linearized-inheritance-graph",
    ]
    """
    Order of code lens with the same start and end position based on sort tags used in detectors/printers. Sort tags default to the printer/detector name.
    """

enable = True class-attribute instance-attribute #

Show code lenses.

sort_tag_priority = ['lsp-references', 'lsp-selectors', 'lsp-inheritance-graph', 'lsp-linearized-inheritance-graph'] class-attribute instance-attribute #

Order of code lens with the same start and end position based on sort tags used in detectors/printers. Sort tags default to the printer/detector name.

CompilerConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class CompilerConfig(WakeConfigModel):
    solc: SolcConfig = Field(default_factory=SolcConfig)

solc = Field(default_factory=SolcConfig) class-attribute instance-attribute #

ControlFlowGraphConfig class #

Bases: WakeConfigModel

Unstable, may change in the future.

Source code in wake/config/data_model.py
class ControlFlowGraphConfig(WakeConfigModel):
    """
    Unstable, may change in the future.
    """

    direction: GraphsDirection = GraphsDirection.TopBottom
    vscode_urls: bool = True

direction = GraphsDirection.TopBottom class-attribute instance-attribute #

vscode_urls = True class-attribute instance-attribute #

DeploymentConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class DeploymentConfig(WakeConfigModel):
    confirm_transactions: bool = True
    """
    Require confirmation for each transaction.
    """
    silent: bool = False
    """
    Do not require confirmation for each transaction and do not print transaction status.
    """

confirm_transactions = True class-attribute instance-attribute #

Require confirmation for each transaction.

silent = False class-attribute instance-attribute #

Do not require confirmation for each transaction and do not print transaction status.

DetectorConfig class #

Bases: WakeConfigModel

Namespace for detector-specific config options. Each attribute should be named after the detector name and hold a dictionary with string keys matching the Click option names.

Source code in wake/config/data_model.py
class DetectorConfig(WakeConfigModel, extra="allow"):
    """
    Namespace for detector-specific config options.
    Each attribute should be named after the detector name and hold a dictionary with string keys matching the Click option names.
    """

DetectorsConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class DetectorsConfig(WakeConfigModel):
    exclude: FrozenSet[str] = frozenset()
    """
    Names of detectors that should not be loaded.
    """
    only: Optional[FrozenSet[str]] = None
    """
    Names of detectors that should only be loaded.
    """
    ignore_paths: FrozenSet[PurePath] = Field(
        default_factory=lambda: frozenset(
            [
                Path.cwd() / "venv",
                Path.cwd() / ".venv",
                Path.cwd() / "test",
            ]
        )
    )
    """
    Detections in these paths must be ignored under all circumstances.
    Useful for ignoring detections in Solidity test files.
    """
    exclude_paths: FrozenSet[PurePath] = Field(
        default_factory=lambda: frozenset(
            [
                Path.cwd() / "node_modules",
                Path.cwd() / "lib",
                Path.cwd() / "script",
            ]
        )
    )
    """
    Detections in these paths are ignored unless linked to a (sub)detection in a non-excluded path.
    Useful for ignoring detections in dependencies.
    """

    _normalize_paths = field_validator("ignore_paths", "exclude_paths", mode="before")(
        normalize_paths
    )

_normalize_paths = field_validator('ignore_paths', 'exclude_paths', mode='before')(normalize_paths) class-attribute instance-attribute #

exclude = frozenset() class-attribute instance-attribute #

Names of detectors that should not be loaded.

exclude_paths = Field(default_factory=lambda: frozenset([Path.cwd() / 'node_modules', Path.cwd() / 'lib', Path.cwd() / 'script'])) class-attribute instance-attribute #

Detections in these paths are ignored unless linked to a (sub)detection in a non-excluded path. Useful for ignoring detections in dependencies.

ignore_paths = Field(default_factory=lambda: frozenset([Path.cwd() / 'venv', Path.cwd() / '.venv', Path.cwd() / 'test'])) class-attribute instance-attribute #

Detections in these paths must be ignored under all circumstances. Useful for ignoring detections in Solidity test files.

only = None class-attribute instance-attribute #

Names of detectors that should only be loaded.

DetectorsLspConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class DetectorsLspConfig(WakeConfigModel):
    enable: bool = True
    """
    Run detectors in LSP.
    """

enable = True class-attribute instance-attribute #

Run detectors in LSP.

FindReferencesConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class FindReferencesConfig(WakeConfigModel):
    include_declarations: bool = False
    """
    Include declarations in the results.
    """

include_declarations = False class-attribute instance-attribute #

Include declarations in the results.

GeneralConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class GeneralConfig(WakeConfigModel):
    call_trace_options: FrozenSet[str] = frozenset(
        [
            "contract_name",
            "function_name",
            "named_arguments",
            "status",
            "call_type",
            "value",
            "return_value",
            "error",
            "events",
        ]
    )
    """
    Options to include in call traces.
    """
    json_rpc_timeout: float = 15
    """
    Timeout applied to JSON-RPC requests.
    """
    link_format: str = "vscode://file/{path}:{line}:{col}"
    """
    Format of links used in detectors and printers.
    """

call_trace_options = frozenset(['contract_name', 'function_name', 'named_arguments', 'status', 'call_type', 'value', 'return_value', 'error', 'events']) class-attribute instance-attribute #

Options to include in call traces.

json_rpc_timeout = 15 class-attribute instance-attribute #

Timeout applied to JSON-RPC requests.

Format of links used in detectors and printers.

GeneratorConfig class #

Bases: WakeConfigModel

Unstable, may change in the future.

Source code in wake/config/data_model.py
class GeneratorConfig(WakeConfigModel):
    """
    Unstable, may change in the future.
    """

    control_flow_graph: ControlFlowGraphConfig = Field(
        default_factory=ControlFlowGraphConfig
    )
    imports_graph: ImportsGraphConfig = Field(default_factory=ImportsGraphConfig)
    inheritance_graph: InheritanceGraphConfig = Field(
        default_factory=InheritanceGraphConfig
    )
    inheritance_graph_full: InheritanceGraphConfig = Field(
        default_factory=InheritanceGraphConfig
    )
    linearized_inheritance_graph: LinearizedInheritanceGraphConfig = Field(
        default_factory=LinearizedInheritanceGraphConfig
    )

control_flow_graph = Field(default_factory=ControlFlowGraphConfig) class-attribute instance-attribute #

imports_graph = Field(default_factory=ImportsGraphConfig) class-attribute instance-attribute #

inheritance_graph = Field(default_factory=InheritanceGraphConfig) class-attribute instance-attribute #

inheritance_graph_full = Field(default_factory=InheritanceGraphConfig) class-attribute instance-attribute #

linearized_inheritance_graph = Field(default_factory=LinearizedInheritanceGraphConfig) class-attribute instance-attribute #

GraphsDirection class #

Bases: StrEnum

Source code in wake/config/data_model.py
class GraphsDirection(StrEnum):
    TopBottom = "TB"
    BottomTop = "BT"
    LeftRight = "LR"
    RightLeft = "RL"

BottomTop = 'BT' class-attribute instance-attribute #

LeftRight = 'LR' class-attribute instance-attribute #

RightLeft = 'RL' class-attribute instance-attribute #

TopBottom = 'TB' class-attribute instance-attribute #

HardhatConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class HardhatConfig(WakeConfigModel):
    cmd_args: str = ""
    """
    Command line arguments to pass to `npx hardhat node`.
    """

cmd_args = '' class-attribute instance-attribute #

Command line arguments to pass to npx hardhat node.

ImportsDirection class #

Bases: StrEnum

Source code in wake/config/data_model.py
class ImportsDirection(StrEnum):
    ImportedToImporting = "imported-to-importing"
    ImportingToImported = "importing-to-imported"

ImportedToImporting = 'imported-to-importing' class-attribute instance-attribute #

ImportingToImported = 'importing-to-imported' class-attribute instance-attribute #

ImportsGraphConfig class #

Bases: WakeConfigModel

Unstable, may change in the future.

Source code in wake/config/data_model.py
class ImportsGraphConfig(WakeConfigModel):
    """
    Unstable, may change in the future.
    """

    direction: GraphsDirection = GraphsDirection.TopBottom
    imports_direction: ImportsDirection = ImportsDirection.ImportedToImporting
    vscode_urls: bool = True

direction = GraphsDirection.TopBottom class-attribute instance-attribute #

imports_direction = ImportsDirection.ImportedToImporting class-attribute instance-attribute #

vscode_urls = True class-attribute instance-attribute #

InheritanceGraphConfig class #

Bases: WakeConfigModel

Unstable, may change in the future.

Source code in wake/config/data_model.py
class InheritanceGraphConfig(WakeConfigModel):
    """
    Unstable, may change in the future.
    """

    direction: GraphsDirection = GraphsDirection.BottomTop
    vscode_urls: bool = True

direction = GraphsDirection.BottomTop class-attribute instance-attribute #

vscode_urls = True class-attribute instance-attribute #

InlayHintsConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class InlayHintsConfig(WakeConfigModel):
    enable: bool = True
    """
    Show inlay hints.
    """
    sort_tag_priority: List[str] = []
    """
    Order of inlay hints with the same position based on sort tags used in detectors/printers. Sort tags default to the printer/detector name.
    """

enable = True class-attribute instance-attribute #

Show inlay hints.

sort_tag_priority = [] class-attribute instance-attribute #

Order of inlay hints with the same position based on sort tags used in detectors/printers. Sort tags default to the printer/detector name.

LinearizedInheritanceGraphConfig class #

Bases: WakeConfigModel

Unstable, may change in the future.

Source code in wake/config/data_model.py
class LinearizedInheritanceGraphConfig(WakeConfigModel):
    """
    Unstable, may change in the future.
    """

    direction: GraphsDirection = GraphsDirection.LeftRight
    vscode_urls: bool = True

direction = GraphsDirection.LeftRight class-attribute instance-attribute #

vscode_urls = True class-attribute instance-attribute #

LspConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class LspConfig(WakeConfigModel):
    compilation_delay: float = 0
    """
    Delay to wait after a file content change before recompiling.
    """
    code_lens: CodeLensConfig = Field(default_factory=CodeLensConfig)
    """
    Code lens config options.
    """
    detectors: DetectorsLspConfig = Field(default_factory=DetectorsLspConfig)
    """
    Detectors config options specific to LSP.
    """
    find_references: FindReferencesConfig = Field(default_factory=FindReferencesConfig)
    """
    Find references config options.
    """
    inlay_hints: InlayHintsConfig = Field(default_factory=InlayHintsConfig)
    """
    Inlay hints config options.
    """

code_lens = Field(default_factory=CodeLensConfig) class-attribute instance-attribute #

Code lens config options.

compilation_delay = 0 class-attribute instance-attribute #

Delay to wait after a file content change before recompiling.

detectors = Field(default_factory=DetectorsLspConfig) class-attribute instance-attribute #

Detectors config options specific to LSP.

find_references = Field(default_factory=FindReferencesConfig) class-attribute instance-attribute #

Find references config options.

inlay_hints = Field(default_factory=InlayHintsConfig) class-attribute instance-attribute #

Inlay hints config options.

MetadataBytecodeHashEnum class #

Bases: StrEnum

Source code in wake/config/data_model.py
class MetadataBytecodeHashEnum(StrEnum):
    NONE = "none"
    IPFS = "ipfs"
    BZZR1 = "bzzr1"

BZZR1 = 'bzzr1' class-attribute instance-attribute #

IPFS = 'ipfs' class-attribute instance-attribute #

NONE = 'none' class-attribute instance-attribute #

PrinterConfig class #

Bases: WakeConfigModel

Namespace for printer-specific config options. Each attribute should be named after the printer name and hold a dictionary with string keys matching the Click option names.

Source code in wake/config/data_model.py
class PrinterConfig(WakeConfigModel, extra="allow"):
    """
    Namespace for printer-specific config options.
    Each attribute should be named after the printer name and hold a dictionary with string keys matching the Click option names.
    """

PrintersConfig class #

Bases: WakeConfigModel

Holds general printer config options for all printers.

Source code in wake/config/data_model.py
class PrintersConfig(WakeConfigModel):
    """
    Holds general printer config options for all printers.
    """

    exclude: FrozenSet[str] = frozenset()
    """
    Names of printers that should not be loaded.
    """
    only: Optional[FrozenSet[str]] = None
    """
    Names of printers that should only be loaded.
    """

exclude = frozenset() class-attribute instance-attribute #

Names of printers that should not be loaded.

only = None class-attribute instance-attribute #

Names of printers that should only be loaded.

SolcConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class SolcConfig(WakeConfigModel):
    allow_paths: FrozenSet[PurePath] = frozenset()
    """Wake should set solc `--allow-paths` automatically. This option allows to specify additional allowed paths."""
    evm_version: Optional[EvmVersionEnum] = None
    """Version of the EVM to compile for. Leave unset to let the solc decide."""
    exclude_paths: FrozenSet[PurePath] = Field(
        default_factory=lambda: frozenset(
            [
                Path.cwd() / "node_modules",
                Path.cwd() / "venv",
                Path.cwd() / ".venv",
                Path.cwd() / "lib",
                Path.cwd() / "script",
                Path.cwd() / "test",
            ]
        )
    )
    """
    Solidity files in these paths are excluded from compilation unless imported from a non-excluded file.
    """
    include_paths: FrozenSet[PurePath] = Field(
        default_factory=lambda: frozenset([Path.cwd() / "node_modules"])
    )
    """
    Paths where to search for Solidity files imported using direct (non-relative) import paths.
    """
    optimizer: SolcOptimizerConfig = Field(default_factory=SolcOptimizerConfig)
    """
    Optimizer config options.
    """
    remappings: List[
        Annotated[
            SolcRemapping,
            BeforeValidator(convert_remapping),
            PlainSerializer(lambda r: str(r), when_used="json"),
        ]
    ] = []
    """
    Remappings to apply during compilation.
    """
    target_version: Optional[SolidityVersion] = None
    """
    Target Solidity version to use for all files during compilation.
    """
    via_IR: Optional[bool] = None
    """
    Use new IR-based compiler pipeline.
    """
    metadata: SolcMetadataConfig = Field(default_factory=SolcMetadataConfig)
    """
    Metadata config options.
    """
    experimental: SolcExperimentalConfig = Field(default_factory=SolcExperimentalConfig)
    """
    Experimental (unstable) compiler features, gated behind solc's experimental mode.
    """

    _normalize_paths = field_validator(
        "allow_paths", "include_paths", "exclude_paths", mode="before"
    )(normalize_paths)

    @field_serializer("target_version", when_used="json")
    def serialize_target_version(self, version: Optional[SolidityVersion], info):
        return str(version) if version is not None else None

_normalize_paths = field_validator('allow_paths', 'include_paths', 'exclude_paths', mode='before')(normalize_paths) class-attribute instance-attribute #

allow_paths = frozenset() class-attribute instance-attribute #

Wake should set solc --allow-paths automatically. This option allows to specify additional allowed paths.

evm_version = None class-attribute instance-attribute #

Version of the EVM to compile for. Leave unset to let the solc decide.

exclude_paths = Field(default_factory=lambda: frozenset([Path.cwd() / 'node_modules', Path.cwd() / 'venv', Path.cwd() / '.venv', Path.cwd() / 'lib', Path.cwd() / 'script', Path.cwd() / 'test'])) class-attribute instance-attribute #

Solidity files in these paths are excluded from compilation unless imported from a non-excluded file.

experimental = Field(default_factory=SolcExperimentalConfig) class-attribute instance-attribute #

Experimental (unstable) compiler features, gated behind solc's experimental mode.

include_paths = Field(default_factory=lambda: frozenset([Path.cwd() / 'node_modules'])) class-attribute instance-attribute #

Paths where to search for Solidity files imported using direct (non-relative) import paths.

metadata = Field(default_factory=SolcMetadataConfig) class-attribute instance-attribute #

Metadata config options.

optimizer = Field(default_factory=SolcOptimizerConfig) class-attribute instance-attribute #

Optimizer config options.

remappings = [] class-attribute instance-attribute #

Remappings to apply during compilation.

target_version = None class-attribute instance-attribute #

Target Solidity version to use for all files during compilation.

via_IR = None class-attribute instance-attribute #

Use new IR-based compiler pipeline.

serialize_target_version(version, info) #

Source code in wake/config/data_model.py
@field_serializer("target_version", when_used="json")
def serialize_target_version(self, version: Optional[SolidityVersion], info):
    return str(version) if version is not None else None

SolcExperimentalConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class SolcExperimentalConfig(WakeConfigModel):
    enable: bool = False
    """
    Enable solc experimental mode (maps to Standard JSON `settings.experimental`, requires solc >= 0.8.35).
    On its own it only unlocks experimental features; it does not activate any of them. Experimental
    features have no stability guarantees between releases and are not suited for production, and enabling
    this marks the compiled contract metadata as experimental.
    """
    via_ssa_cfg: bool = False
    """
    Use the experimental SSA CFG-based code generator (maps to `settings.viaSSACFG`). Requires
    `enable = true` and solc >= 0.8.35.
    """

    @model_validator(mode="after")
    def _require_experimental_mode(self):
        if self.via_ssa_cfg and not self.enable:
            raise ValueError(
                "`compiler.solc.experimental.via_ssa_cfg` requires `compiler.solc.experimental.enable = true`"
            )
        return self

enable = False class-attribute instance-attribute #

Enable solc experimental mode (maps to Standard JSON settings.experimental, requires solc >= 0.8.35). On its own it only unlocks experimental features; it does not activate any of them. Experimental features have no stability guarantees between releases and are not suited for production, and enabling this marks the compiled contract metadata as experimental.

via_ssa_cfg = False class-attribute instance-attribute #

Use the experimental SSA CFG-based code generator (maps to settings.viaSSACFG). Requires enable = true and solc >= 0.8.35.

_require_experimental_mode() #

Source code in wake/config/data_model.py
@model_validator(mode="after")
def _require_experimental_mode(self):
    if self.via_ssa_cfg and not self.enable:
        raise ValueError(
            "`compiler.solc.experimental.via_ssa_cfg` requires `compiler.solc.experimental.enable = true`"
        )
    return self

SolcMetadataConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class SolcMetadataConfig(WakeConfigModel):
    append_CBOR: Optional[bool] = None
    use_literal_content: Optional[bool] = None
    bytecode_hash: Optional[MetadataBytecodeHashEnum] = None

append_CBOR = None class-attribute instance-attribute #

bytecode_hash = None class-attribute instance-attribute #

use_literal_content = None class-attribute instance-attribute #

SolcOptimizerConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class SolcOptimizerConfig(WakeConfigModel):
    enabled: Optional[bool] = None
    runs: int = 200
    details: SolcOptimizerDetailsConfig = Field(
        default_factory=SolcOptimizerDetailsConfig
    )

details = Field(default_factory=SolcOptimizerDetailsConfig) class-attribute instance-attribute #

enabled = None class-attribute instance-attribute #

runs = 200 class-attribute instance-attribute #

SolcOptimizerDetailsConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class SolcOptimizerDetailsConfig(WakeConfigModel):
    peephole: Optional[bool] = None
    inliner: Optional[bool] = None
    jumpdest_remover: Optional[bool] = None
    order_literals: Optional[bool] = None
    deduplicate: Optional[bool] = None
    cse: Optional[bool] = None
    constant_optimizer: Optional[bool] = None
    simple_counter_for_loop_unchecked_increment: Optional[bool] = None
    # no need to add yul option here, since it applies only to solc < 0.6.0
    yul_details: SolcOptimizerYulDetailsConfig = Field(
        default_factory=SolcOptimizerYulDetailsConfig
    )

constant_optimizer = None class-attribute instance-attribute #

cse = None class-attribute instance-attribute #

deduplicate = None class-attribute instance-attribute #

inliner = None class-attribute instance-attribute #

jumpdest_remover = None class-attribute instance-attribute #

order_literals = None class-attribute instance-attribute #

peephole = None class-attribute instance-attribute #

simple_counter_for_loop_unchecked_increment = None class-attribute instance-attribute #

yul_details = Field(default_factory=SolcOptimizerYulDetailsConfig) class-attribute instance-attribute #

SolcOptimizerYulDetailsConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class SolcOptimizerYulDetailsConfig(WakeConfigModel):
    stack_allocation: Optional[bool] = None
    optimizer_steps: Optional[str] = None

optimizer_steps = None class-attribute instance-attribute #

stack_allocation = None class-attribute instance-attribute #

SolcRemapping class #

Source code in wake/config/data_model.py
@dataclass
class SolcRemapping:
    context: Optional[str]
    prefix: str
    target: Optional[str]

    def __iter__(self):
        return iter(astuple(self))

    def __str__(self):
        if self.context is None:
            return f"{self.prefix}={self.target or ''}"
        else:
            return f"{self.context}:{self.prefix}={self.target or ''}"

context instance-attribute #

prefix instance-attribute #

target instance-attribute #

__iter__() #

Source code in wake/config/data_model.py
def __iter__(self):
    return iter(astuple(self))

SubprojectConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class SubprojectConfig(WakeConfigModel):
    paths: FrozenSet[PurePath] = frozenset()
    target_version: Optional[SolidityVersion] = None
    evm_version: Optional[EvmVersionEnum] = None
    optimizer: SolcOptimizerConfig = Field(default_factory=SolcOptimizerConfig)
    via_IR: Optional[bool] = None
    metadata: SolcMetadataConfig = Field(default_factory=SolcMetadataConfig)
    experimental: SolcExperimentalConfig = Field(default_factory=SolcExperimentalConfig)

    _normalize_paths = field_validator("paths", mode="before")(normalize_paths)

    @field_serializer("target_version", when_used="json")
    def serialize_target_version(self, version: Optional[SolidityVersion], info):
        return str(version) if version is not None else None

_normalize_paths = field_validator('paths', mode='before')(normalize_paths) class-attribute instance-attribute #

evm_version = None class-attribute instance-attribute #

experimental = Field(default_factory=SolcExperimentalConfig) class-attribute instance-attribute #

metadata = Field(default_factory=SolcMetadataConfig) class-attribute instance-attribute #

optimizer = Field(default_factory=SolcOptimizerConfig) class-attribute instance-attribute #

paths = frozenset() class-attribute instance-attribute #

target_version = None class-attribute instance-attribute #

via_IR = None class-attribute instance-attribute #

serialize_target_version(version, info) #

Source code in wake/config/data_model.py
@field_serializer("target_version", when_used="json")
def serialize_target_version(self, version: Optional[SolidityVersion], info):
    return str(version) if version is not None else None

TestingConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class TestingConfig(WakeConfigModel):
    coverage_sync_timeout: float = 5
    """
    Timeout for syncing coverage data.
    """
    cmd: str = "revm"
    """
    Which development chain to use for testing. Should be one of `revm`, `anvil`, or
    `hardhat`.
    """
    block_history: Optional[int] = Field(default=256, ge=0)
    """
    Target number of blocks each chain keeps. Pruning uses a small hysteresis window,
    temporarily retaining `ceil(target / 8)` extra blocks (at least 1 and at most
    32) before draining back to the target. `0` is treated as `1`, so the latest
    block remains resolvable. `null` keeps everything, at the cost of memory linear
    in transactions executed.

    Blocks are the unit of retention: a transaction is kept exactly as long as the block
    containing it, and the EVM journal keeps only what those blocks need to re-execute.
    Reaching further back than the window raises `HistoryPrunedError` - including
    `chain.txs[-1]` once the newest transaction's own block has aged out, so hold the
    transaction object if you need it beyond that. `chain.blocks["latest"]` always
    resolves.

    The bound is in blocks, and a block's journal cost is proportional to the writes it
    contains. With automine off a block can hold any number of transactions or state
    assignments, and an unmined block never closes, so retention is bounded only once
    blocks are mined. `revm` only.
    """
    anvil: AnvilConfig = Field(default_factory=AnvilConfig)
    """
    Anvil-specific config options.
    """
    hardhat: HardhatConfig = Field(default_factory=HardhatConfig)
    """
    Hardhat-specific config options.
    """

anvil = Field(default_factory=AnvilConfig) class-attribute instance-attribute #

Anvil-specific config options.

block_history = Field(default=256, ge=0) class-attribute instance-attribute #

Target number of blocks each chain keeps. Pruning uses a small hysteresis window, temporarily retaining ceil(target / 8) extra blocks (at least 1 and at most 32) before draining back to the target. 0 is treated as 1, so the latest block remains resolvable. null keeps everything, at the cost of memory linear in transactions executed.

Blocks are the unit of retention: a transaction is kept exactly as long as the block containing it, and the EVM journal keeps only what those blocks need to re-execute. Reaching further back than the window raises HistoryPrunedError - including chain.txs[-1] once the newest transaction's own block has aged out, so hold the transaction object if you need it beyond that. chain.blocks["latest"] always resolves.

The bound is in blocks, and a block's journal cost is proportional to the writes it contains. With automine off a block can hold any number of transactions or state assignments, and an unmined block never closes, so retention is bounded only once blocks are mined. revm only.

cmd = 'revm' class-attribute instance-attribute #

Which development chain to use for testing. Should be one of revm, anvil, or hardhat.

coverage_sync_timeout = 5 class-attribute instance-attribute #

Timeout for syncing coverage data.

hardhat = Field(default_factory=HardhatConfig) class-attribute instance-attribute #

Hardhat-specific config options.

TopLevelConfig class #

Bases: WakeConfigModel

Source code in wake/config/data_model.py
class TopLevelConfig(WakeConfigModel):
    subconfigs: List[Annotated[Path, BeforeValidator(lambda p: Path(p).resolve())]] = []
    api_keys: Dict[str, str] = {}
    compiler: CompilerConfig = Field(default_factory=CompilerConfig)
    subproject: Dict[str, SubprojectConfig] = {}
    detectors: DetectorsConfig = Field(default_factory=DetectorsConfig)
    detector: DetectorConfig = Field(default_factory=DetectorConfig)
    generator: GeneratorConfig = Field(default_factory=GeneratorConfig)
    lsp: LspConfig = Field(default_factory=LspConfig)
    testing: TestingConfig = Field(default_factory=TestingConfig)
    deployment: DeploymentConfig = Field(default_factory=DeploymentConfig)
    printers: PrintersConfig = Field(default_factory=PrintersConfig)
    printer: PrinterConfig = Field(default_factory=PrinterConfig)
    general: GeneralConfig = Field(default_factory=GeneralConfig)

api_keys = {} class-attribute instance-attribute #

compiler = Field(default_factory=CompilerConfig) class-attribute instance-attribute #

deployment = Field(default_factory=DeploymentConfig) class-attribute instance-attribute #

detector = Field(default_factory=DetectorConfig) class-attribute instance-attribute #

detectors = Field(default_factory=DetectorsConfig) class-attribute instance-attribute #

general = Field(default_factory=GeneralConfig) class-attribute instance-attribute #

generator = Field(default_factory=GeneratorConfig) class-attribute instance-attribute #

lsp = Field(default_factory=LspConfig) class-attribute instance-attribute #

printer = Field(default_factory=PrinterConfig) class-attribute instance-attribute #

printers = Field(default_factory=PrintersConfig) class-attribute instance-attribute #

subconfigs = [] class-attribute instance-attribute #

subproject = {} class-attribute instance-attribute #

testing = Field(default_factory=TestingConfig) class-attribute instance-attribute #

WakeConfigModel class #

Bases: BaseModel

Source code in wake/config/data_model.py
class WakeConfigModel(BaseModel):
    model_config = ConfigDict(
        extra="forbid",
        frozen=True,
    )

model_config = ConfigDict(extra='forbid', frozen=True) class-attribute instance-attribute #

convert_remapping(v) #

Source code in wake/config/data_model.py
def convert_remapping(v):
    if isinstance(v, SolcRemapping):
        return v
    elif isinstance(v, dict):
        return SolcRemapping(**v)

    remapping_re = re.compile(
        r"(?:(?P<context>[^:\s]+)?:)?(?P<prefix>[^\s=]+)=(?P<target>[^\s]+)?"
    )
    match = remapping_re.match(v)
    assert match, f"`{v}` is not a valid solc remapping."

    groupdict = match.groupdict()
    context = groupdict["context"]
    prefix = groupdict["prefix"]
    target = groupdict["target"]
    return SolcRemapping(context=context, prefix=prefix, target=target)

normalize_paths(paths, info) #

Source code in wake/config/data_model.py
def normalize_paths(paths: Iterable[str], info: ValidationInfo) -> FrozenSet[PurePath]:
    if info.context and info.context.get("paths_mode") is not None:
        if info.context["paths_mode"] == "Windows":
            return frozenset(PureWindowsPath(path) for path in paths)
        else:
            return frozenset(PurePosixPath(path) for path in paths)
    else:
        return frozenset(Path(path).resolve() for path in paths)