Skip to content

wake.ir.yul.abc module #

YulAbc class #

Bases: IrAbc, ABC

Abstract base class for all Yul IR nodes.

Source code in wake/ir/yul/abc.py
class YulAbc(IrAbc, ABC):
    """
    Abstract base class for all Yul IR nodes.
    """

    _ast_node: YulNode
    _inline_assembly: InlineAssembly

    def __init__(self, init: IrInitTuple, yul: YulNode, parent: IrAbc):
        super().__init__(init, yul, parent)
        assert init.inline_assembly is not None
        self._inline_assembly = init.inline_assembly

    def __iter__(self) -> Iterator[YulAbc]:
        yield self

    @property
    def ast_node(self) -> YulNode:
        return self._ast_node

    @property
    @abstractmethod
    def modifies_state(
        self,
    ) -> Set[Tuple[Union[ExpressionAbc, StatementAbc, YulAbc], ModifiesStateFlag]]:
        """
        WARNING:
            Is not considered stable and so is not exported in the documentation.

        Returns:
            Set of child IR nodes (including `self`) that modify the blockchain state and flags describing how the state is modified.
        """
        ...

    @property
    def inline_assembly(self) -> InlineAssembly:
        """
        Returns:
            Inline assembly statement that contains this Yul node.
        """
        return self._inline_assembly

inline_assembly: InlineAssembly property #

Returns:

Type Description
InlineAssembly

Inline assembly statement that contains this Yul node.

modifies_state: Set[Tuple[Union[ExpressionAbc, StatementAbc, YulAbc], ModifiesStateFlag]] abstractmethod property #

WARNING

Is not considered stable and so is not exported in the documentation.

Returns:

Type Description
Set[Tuple[Union[ExpressionAbc, StatementAbc, YulAbc], ModifiesStateFlag]]

Set of child IR nodes (including self) that modify the blockchain state and flags describing how the state is modified.

YulStatementAbc class #

Bases: YulAbc, ABC

Abstract base class for all Yul IR statements.

Source code in wake/ir/yul/abc.py
class YulStatementAbc(YulAbc, ABC):
    """
    Abstract base class for all Yul IR statements.
    """