erc7730.convert.calldata.v1.abi module

Conversion of a function ABI to an ABI tree.

An ABI tree is a tree representation of the ABI of a function inputs, enriched with some metadata to ease crafting paths to access values in the serialized calldata.

class erc7730.convert.calldata.v1.abi.ABIDynamicArray[source]View on GitHub

Bases: ABINode

ABI node representing an array with dynamic size.

component: ABITree
property is_dynamic: boolView on GitHub
model_config = {'allow_inf_nan': False, 'arbitrary_types_allowed': False, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True, 'validate_default': True, 'validate_return': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property size: intView on GitHub
type: Literal['dynamic_array']
class erc7730.convert.calldata.v1.abi.ABIDynamicLeaf(*, type_family: CalldataDescriptorTypeFamily, type_size: int | None = None, type: Literal['dynamic_leaf'] = 'dynamic_leaf')[source]View on GitHub

Bases: ABILeafNode

ABI node representing a scalar type with dynamic size.

property is_dynamic: boolView on GitHub
model_config = {'allow_inf_nan': False, 'arbitrary_types_allowed': False, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True, 'validate_default': True, 'validate_return': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property size: intView on GitHub
type: Literal['dynamic_leaf']
class erc7730.convert.calldata.v1.abi.ABILeafNode(*, type_family: CalldataDescriptorTypeFamily, type_size: int | None = None)[source]View on GitHub

Bases: ABINode, ABC

Represents a leaf node in the tree defined by a function ABI.

model_config = {'allow_inf_nan': False, 'arbitrary_types_allowed': False, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True, 'validate_default': True, 'validate_return': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

type_family: CalldataDescriptorTypeFamily
type_size: int | None
class erc7730.convert.calldata.v1.abi.ABINode[source]View on GitHub

Bases: Model, ABC

Represents a node in the tree defined by a function ABI.

abstract property is_dynamic: boolView on GitHub
model_config = {'allow_inf_nan': False, 'arbitrary_types_allowed': False, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True, 'validate_default': True, 'validate_return': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

abstract property size: intView on GitHub
class erc7730.convert.calldata.v1.abi.ABIStaticArray[source]View on GitHub

Bases: ABINode

ABI node representing an array with static size.

component: ABITree
dimension: int
property is_dynamic: boolView on GitHub
model_config = {'allow_inf_nan': False, 'arbitrary_types_allowed': False, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True, 'validate_default': True, 'validate_return': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property size: intView on GitHub
type: Literal['static_array']
class erc7730.convert.calldata.v1.abi.ABIStaticLeaf(*, type_family: CalldataDescriptorTypeFamily, type_size: int | None = None, type: Literal['static_leaf'] = 'static_leaf')[source]View on GitHub

Bases: ABILeafNode

ABI node representing a scalar type with static size.

property is_dynamic: boolView on GitHub
model_config = {'allow_inf_nan': False, 'arbitrary_types_allowed': False, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True, 'validate_default': True, 'validate_return': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property size: intView on GitHub
type: Literal['static_leaf']
class erc7730.convert.calldata.v1.abi.ABIStruct[source]View on GitHub

Bases: ABINode

ABI node representing a function or a tuple.

components: dict[str, ABITree]
property is_dynamic: boolView on GitHub
model_config = {'allow_inf_nan': False, 'arbitrary_types_allowed': False, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True, 'validate_default': True, 'validate_return': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

offsets: dict[str, int]
property size: intView on GitHub
type: Literal['struct']
erc7730.convert.calldata.v1.abi.function_to_abi_tree(function: Function) Annotated[ABIStruct | ABIStaticArray | ABIDynamicArray | ABIStaticLeaf | ABIDynamicLeaf, FieldInfo(annotation=NoneType, required=True, discriminator='type')][source]View on GitHub

Convert a function ABI to an ABI tree.

An ABI tree is a tree representation of the ABI of a function inputs, enriched with some metadata to ease crafting paths to access values in the serialized calldata.

@param function: function ABI @return: