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.

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

Bases: ABINode

ABI node representing an array with dynamic size.

Fields:
field component: ABITree [Required]
field type: Literal['dynamic_array'] = 'dynamic_array'
property is_dynamic: boolView on GitHub
property size: intView on GitHub
pydantic model erc7730.convert.calldata.v1.abi.ABIDynamicLeaf[source]View on GitHub

Bases: ABILeafNode

ABI node representing a scalar type with dynamic size.

Fields:
field type: Literal['dynamic_leaf'] = 'dynamic_leaf'
property is_dynamic: boolView on GitHub
property size: intView on GitHub
pydantic model erc7730.convert.calldata.v1.abi.ABILeafNode[source]View on GitHub

Bases: ABINode, ABC

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

Fields:
field type_family: CalldataDescriptorTypeFamily [Required]
field type_size: int | None = None
pydantic model 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
abstract property size: intView on GitHub
pydantic model erc7730.convert.calldata.v1.abi.ABIStaticArray[source]View on GitHub

Bases: ABINode

ABI node representing an array with static size.

Fields:
field component: ABITree [Required]
field dimension: int [Required]
Constraints:
  • ge = 0

field type: Literal['static_array'] = 'static_array'
property is_dynamic: boolView on GitHub
property size: intView on GitHub
pydantic model erc7730.convert.calldata.v1.abi.ABIStaticLeaf[source]View on GitHub

Bases: ABILeafNode

ABI node representing a scalar type with static size.

Fields:
field type: Literal['static_leaf'] = 'static_leaf'
property is_dynamic: boolView on GitHub
property size: intView on GitHub
pydantic model erc7730.convert.calldata.v1.abi.ABIStruct[source]View on GitHub

Bases: ABINode

ABI node representing a function or a tuple.

Fields:
field components: dict[str, ABITree] [Required]
field offsets: dict[str, int] [Required]
field type: Literal['struct'] = 'struct'
property is_dynamic: boolView on GitHub
property size: intView on GitHub
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: