solidity_parser.ast.solnodes

Attributes

Classes

AST1Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Ident

String identifier node

Location

Solidity reference type storage locations

NamedArg

A name-value pair used for calling functions with options

Unit

Solidity numerical unit types

Literal

Constant value expression that can have an optional unit associated with it

UnaryOpCode

Single operand operation types

UnaryOp

Single operand expression

BinaryOpCode

Binary/two operand operation types, including assignment types

BinaryOp

Binary/two operand expression

TernaryOp

Choice expression that evaluates the given condition and returns one of the two given expressions

New

New object allocation expression without constructor invocation

NewInlineArray

Solidity 8 inline array creation

PayableConversion

Converts an address to a payable address

GetArrayValue

Gets the value at the given index from the given array

GetArraySlice

Gets a subarray at the given start and end indices from the given array

GetMember

Gets a member field or method from a given object

CallFunction

Invokes the given callee

Var

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

VarDecl

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Parameter

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ExprStmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Block

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

If

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Catch

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Try

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

While

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

For

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Emit

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Revert

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

AssemblyStmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

DoWhile

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Continue

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Break

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Return

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Throw

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Modifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

VisibilityModifierKind

Create a collection of name/value pairs.

MutabilityModifierKind

Create a collection of name/value pairs.

VisibilityModifier2

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

MutabilityModifier2

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

InvocationModifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

OverrideSpecifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

SourceUnit

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

PragmaDirective

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ImportDirective

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

GlobalImportDirective

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

UnitImportDirective

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

SymbolAlias

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

SymbolImportDirective

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ContractPart

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

SpecialFunctionKind

Create a collection of name/value pairs.

FunctionDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ModifierDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

StructMember

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

StructDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

EnumDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

StateVariableDeclaration

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ConstantVariableDeclaration

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

UserValueType

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

EventParameter

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

EventDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ErrorParameter

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ErrorDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

UsingAttachment

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

UsingOperatorBinding

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

UsingDirective

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

InheritSpecifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

ContractDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

InterfaceDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

LibraryDefinition

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

CreateMetaType

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that

Functions

has_modifier_kind(node, *kinds)

Module Contents

class solidity_parser.ast.solnodes.AST1Node

Bases: solidity_parser.ast.nodebase.Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

scope: Scope
ast2_node: AST2Node
class solidity_parser.ast.solnodes.Stmt

Bases: AST1Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

class solidity_parser.ast.solnodes.Expr

Bases: AST1Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

class solidity_parser.ast.solnodes.Ident

Bases: Expr

String identifier node

text: str
__str__()

Return str(self).

class solidity_parser.ast.solnodes.Location

Bases: enum.Enum

Solidity reference type storage locations

These are used to specify in what type of memory context/area a struct/array/mapping is stored

MEMORY = 'memory'

An location that does not persist between function calls

STORAGE = 'storage'

A location persists between function calls

Contract state variables are stored here also

CALLDATA = 'calldata'

A location that contains the function call arguments for external function call parameters

__str__()

Return str(self).

class solidity_parser.ast.solnodes.NamedArg

Bases: Expr

A name-value pair used for calling functions with options

name: Ident
value: Expr
class solidity_parser.ast.solnodes.Unit(_: str, multiplier: int)

Bases: enum.Enum

Solidity numerical unit types

WEI = ('wei', 1)
GWEI = ('gwei', 1000000000.0)
SZABO = ('szabo', 1000000000000.0)
FINNEY = ('finney', 1000000000000000.0)
ETHER = ('ether', 1e+18)
SECONDS = ('seconds', 1)
MINUTES = ('minutes', 60)
HOURS
DAYS
WEEKS
YEARS
_multiplier_
__str__()

Return str(self).

property multiplier: int
class solidity_parser.ast.solnodes.Literal

Bases: Expr

Constant value expression that can have an optional unit associated with it

The value may be a python primitive, e.g. an integer, boolean, string, tuple, etc

value: Any
unit: Unit = None
code_str()
class solidity_parser.ast.solnodes.UnaryOpCode

Bases: enum.Enum

Single operand operation types

INC = '++'
DEC = '--'
SIGN_POS = '+'
SIGN_NEG = '-'
BOOL_NEG = '!'
BIT_NEG = '~'
DELETE = 'delete'
class solidity_parser.ast.solnodes.UnaryOp

Bases: Expr

Single operand expression

expr: Expr
op: UnaryOpCode
is_pre: bool

Whether the operation is pre or post, e.g. ++x or x++

class solidity_parser.ast.solnodes.BinaryOpCode

Bases: enum.Enum

Binary/two operand operation types, including assignment types

EXPONENTIATE = '**'
MUL = '*'
DIV = '/'
MOD = '%'
ADD = '+'
SUB = '-'
LSHIFT = '<<'
RSHIFT = '>>'
BIT_AND = '&'
BIT_XOR = '^'
BIT_OR = '|'
LT = '<'
GT = '>'
LTEQ = '<='
GTEQ = '>='
EQ = '=='
NEQ = '!='
BOOL_AND = '&&'
BOOL_OR = '||'
ASSIGN = '='
ASSIGN_OR = '|='
ASSIGN_BIT_NEG = '^='
ASSIGN_BIT_AND = '&='
ASSIGN_LSHIFT = '<<='
ASSIGN_RSHIFT = '>>='
ASSIGN_ADD = '+='
ASSIGN_SUB = '-='
ASSIGN_MUL = '*='
ASSIGN_DIV = '/='
ASSIGN_MOD = '%='
class solidity_parser.ast.solnodes.BinaryOp

Bases: Expr

Binary/two operand expression

left: Expr
right: Expr
op: BinaryOpCode
class solidity_parser.ast.solnodes.TernaryOp

Bases: Expr

Choice expression that evaluates the given condition and returns one of the two given expressions

If the condition evaluates to false then the left expression is returned, otherwise the right one is

condition: Expr
left: Expr
right: Expr
class solidity_parser.ast.solnodes.New

Bases: Expr

New object allocation expression without constructor invocation

Note that this expression only represents the ‘new X’ part of a new objects creation ‘new X(a,b)’. This expression must then be used as the base object in a constructor call to instantiate it.

type_name: solidity_parser.ast.types.Type
class solidity_parser.ast.solnodes.NewInlineArray

Bases: Expr

Solidity 8 inline array creation

An inline array is one where the elements are explicitly stated in the definition, for example: ‘int[5] foo2 = [1, 0, 0, 0, 0];’

elements: list[Expr]
class solidity_parser.ast.solnodes.PayableConversion

Bases: Expr

Converts an address to a payable address

For example: ‘payable(address(myAddressHex))’

args: list[Expr]
class solidity_parser.ast.solnodes.GetArrayValue

Bases: Expr

Gets the value at the given index from the given array

array_base: Expr
index: Expr
class solidity_parser.ast.solnodes.GetArraySlice

Bases: Expr

Gets a subarray at the given start and end indices from the given array

array_base: Expr
start_index: Expr
end_index: Expr
class solidity_parser.ast.solnodes.GetMember

Bases: Expr

Gets a member field or method from a given object

obj_base: Expr
name: Ident
class solidity_parser.ast.solnodes.CallFunction

Bases: Expr

Invokes the given callee

callee: Expr

This callee is most likely a GetMember expression but can be any callable

special_call_options: list[NamedArg]

See https://docs.soliditylang.org/en/v0.8.21/control-structures.html#external-function-calls

args: list[Expr]

The actual arguments in the () brackets of the call, may include positional and named arguments

class solidity_parser.ast.solnodes.Var

Bases: AST1Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

var_type: solidity_parser.ast.types.Type
var_name: Ident
var_loc: Location | None = None
class solidity_parser.ast.solnodes.VarDecl

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

variables: list[Var]
value: Expr
is_lhs_tuple: bool = False
class solidity_parser.ast.solnodes.Parameter

Bases: AST1Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

var_type: Ident
var_loc: Location
var_name: Ident
__str__()

Return str(self).

class solidity_parser.ast.solnodes.ExprStmt

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

expr: Expr
class solidity_parser.ast.solnodes.Block

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

stmts: list[Stmt]
is_unchecked: bool = False
class solidity_parser.ast.solnodes.If

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

condition: Expr
true_branch: Stmt
false_branch: Stmt
class solidity_parser.ast.solnodes.Catch

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

ident: Ident
parameters: list[Parameter]
body: Block
class solidity_parser.ast.solnodes.Try

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

expr: Expr
return_parameters: list[Parameter]
body: Block
catch_clauses: list[Catch]
class solidity_parser.ast.solnodes.While

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

expr: Expr
body: Stmt
class solidity_parser.ast.solnodes.For

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

initialiser: Stmt
condition: Expr
advancement: Expr
body: Stmt
class solidity_parser.ast.solnodes.Emit

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

call: CallFunction
class solidity_parser.ast.solnodes.Revert

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

call: CallFunction
class solidity_parser.ast.solnodes.AssemblyStmt

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

code: str
class solidity_parser.ast.solnodes.DoWhile

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

body: Stmt
condition: Expr
class solidity_parser.ast.solnodes.Continue

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

class solidity_parser.ast.solnodes.Break

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

class solidity_parser.ast.solnodes.Return

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

value: Expr
class solidity_parser.ast.solnodes.Throw

Bases: Stmt

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

class solidity_parser.ast.solnodes.Modifier

Bases: AST1Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

class solidity_parser.ast.solnodes.VisibilityModifierKind

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

>>> Color.RED
<Color.RED: 1>
  • value lookup:

>>> Color(1)
<Color.RED: 1>
  • name lookup:

>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

EXTERNAL = 'external'
PUBLIC = 'public'
INTERNAL = 'internal'
PRIVATE = 'private'
VIRTUAL = 'virtual'
class solidity_parser.ast.solnodes.MutabilityModifierKind

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

>>> Color.RED
<Color.RED: 1>
  • value lookup:

>>> Color(1)
<Color.RED: 1>
  • name lookup:

>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

PURE = 'pure'
CONSTANT = 'constant'
VIEW = 'view'
PAYABLE = 'payable'
IMMUTABLE = 'immutable'
class solidity_parser.ast.solnodes.VisibilityModifier2

Bases: Modifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

kind: VisibilityModifierKind
class solidity_parser.ast.solnodes.MutabilityModifier2

Bases: Modifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

kind: MutabilityModifierKind
class solidity_parser.ast.solnodes.InvocationModifier

Bases: Modifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
arguments: list[Expr]
class solidity_parser.ast.solnodes.OverrideSpecifier

Bases: Modifier

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

arguments: list[solidity_parser.ast.types.UserType]
class solidity_parser.ast.solnodes.SourceUnit

Bases: AST1Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

class solidity_parser.ast.solnodes.PragmaDirective

Bases: SourceUnit

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
value: str | Expr
class solidity_parser.ast.solnodes.ImportDirective

Bases: SourceUnit

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

path: str
class solidity_parser.ast.solnodes.GlobalImportDirective

Bases: ImportDirective

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

class solidity_parser.ast.solnodes.UnitImportDirective

Bases: ImportDirective

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

alias: Ident
class solidity_parser.ast.solnodes.SymbolAlias

Bases: AST1Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

symbol: Ident
alias: Ident
class solidity_parser.ast.solnodes.SymbolImportDirective

Bases: ImportDirective

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

aliases: list[SymbolAlias]
class solidity_parser.ast.solnodes.ContractPart

Bases: AST1Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

class solidity_parser.ast.solnodes.SpecialFunctionKind

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

>>> Color.RED
<Color.RED: 1>
  • value lookup:

>>> Color(1)
<Color.RED: 1>
  • name lookup:

>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

CONSTRUCTOR = '<<constructor>>'
RECEIVE = '<<receive>>'
FALLBACK = '<<fallback>>'
__str__()

Return str(self).

class solidity_parser.ast.solnodes.FunctionDefinition

Bases: SourceUnit, ContractPart

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident | SpecialFunctionKind
parameters: list[Parameter]
modifiers: list[Modifier]
returns: list[Parameter]
code: Block
class solidity_parser.ast.solnodes.ModifierDefinition

Bases: ContractPart

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
parameters: list[Parameter]
modifiers: list[Modifier]
code: Block
class solidity_parser.ast.solnodes.StructMember

Bases: AST1Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

member_type: solidity_parser.ast.types.Type
name: Ident
class solidity_parser.ast.solnodes.StructDefinition

Bases: SourceUnit, ContractPart

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
members: list[StructMember]
class solidity_parser.ast.solnodes.EnumDefinition

Bases: SourceUnit, ContractPart

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
values: list[Ident]
class solidity_parser.ast.solnodes.StateVariableDeclaration

Bases: ContractPart

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

var_type: solidity_parser.ast.types.Type
modifiers: list[Modifier]
name: Ident
initial_value: Expr
class solidity_parser.ast.solnodes.ConstantVariableDeclaration

Bases: SourceUnit

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

var_type: solidity_parser.ast.types.Type
name: Ident
initial_value: Expr
class solidity_parser.ast.solnodes.UserValueType

Bases: SourceUnit, ContractPart

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
value: solidity_parser.ast.types.Type
class solidity_parser.ast.solnodes.EventParameter

Bases: AST1Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

var_type: solidity_parser.ast.types.Type
name: Ident
is_indexed: bool
class solidity_parser.ast.solnodes.EventDefinition

Bases: ContractPart

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
is_anonymous: bool
parameters: list[EventParameter]
class solidity_parser.ast.solnodes.ErrorParameter

Bases: AST1Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

var_type: solidity_parser.ast.types.Type
name: Ident
class solidity_parser.ast.solnodes.ErrorDefinition

Bases: SourceUnit, ContractPart

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
parameters: list[ErrorParameter]
class solidity_parser.ast.solnodes.UsingAttachment

Bases: AST1Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

member_name: Ident
class solidity_parser.ast.solnodes.UsingOperatorBinding

Bases: AST1Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

member_name: Ident
operator: UnaryOpCode | BinaryOpCode
class solidity_parser.ast.solnodes.UsingDirective

Bases: ContractPart

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

library_name: Ident
override_type: solidity_parser.ast.types.Type
attachments_or_bindings: list[UsingAttachment | UsingOperatorBinding]
is_global: bool
class solidity_parser.ast.solnodes.InheritSpecifier

Bases: AST1Node

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: solidity_parser.ast.types.UserType
args: list[Expr]
class solidity_parser.ast.solnodes.ContractDefinition

Bases: SourceUnit

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
is_abstract: bool
inherits: list[InheritSpecifier]
parts: list[ContractPart]
class solidity_parser.ast.solnodes.InterfaceDefinition

Bases: SourceUnit

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
inherits: list[InheritSpecifier]
parts: list[ContractPart]
class solidity_parser.ast.solnodes.LibraryDefinition

Bases: SourceUnit

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

name: Ident
parts: list[ContractPart]
class solidity_parser.ast.solnodes.CreateMetaType

Bases: Expr

Base class for all AST nodes. Includes source location information, code comments and a parenting mechanism so that clients can traverse all child and parent nodes.

base_type: solidity_parser.ast.types.Type
solidity_parser.ast.solnodes.has_modifier_kind(node, *kinds: VisibilityModifierKind | MutabilityModifierKind)
solidity_parser.ast.solnodes.ModFunErrEvt: TypeAlias = ModifierDefinition | FunctionDefinition | ErrorDefinition | EventDefinition
solidity_parser.ast.solnodes.Types: TypeAlias = soltypes.VariableLengthArrayType | soltypes.VoidType | soltypes.IntType | soltypes.FunctionType...