Documentation

AbstractABIValue
in package

AbstractYes

Base class for encoding and decoding ABI (Application Binary Interface) types for Ethereum contracts.

Tags
author

DubbaThony (structure, abstraction, bugs)

author

gh/VOID404 (maths)

Table of Contents

Methods

__toString()  : string
Returns string representation of structure, for known sized arrays with prefix k, for unknown size u, works recursively. The stringified representation purpose is debugging - to see what data and structure was created by bindings etc. It's often more useful representation than print_r or var_dump (with or without XDebug).
decodeBin()  : int
Decodes the binary data and updates the object(recursive).
encodeBin()  : string
Encodes the ABI value to its binary representation (recursive).
isDynamic()  : bool
Checks whether the ABI value is dynamic or not.
parseValue()  : AbstractABIValue
Parse the ABI type and value and returns the corresponding AbstractABIValue object.
splitTypeBits()  : array<string|int, mixed>
Splits the ABI type into its type and bit-length components. Also works for amount of bytes for non-dynamic bytes.
unwrapToPhpFriendlyVals()  : mixed
Transforms the ABI value into a more PHP-friendly types, such as Common\Address, OOGmp, and such (recursive).

Methods

__toString()

Returns string representation of structure, for known sized arrays with prefix k, for unknown size u, works recursively. The stringified representation purpose is debugging - to see what data and structure was created by bindings etc. It's often more useful representation than print_r or var_dump (with or without XDebug).

public abstract __toString() : string

It's meant to be called on top level tuple, but should work just fine on any part of tree

Return values
string

stringified structure, for example (u[k[123,0xabcd],k[456,0x1234]],256)

encodeBin()

Encodes the ABI value to its binary representation (recursive).

public abstract encodeBin() : string
Tags
throws
InvalidHexException
Return values
string

The binary-encoded string.

isDynamic()

Checks whether the ABI value is dynamic or not.

public abstract isDynamic() : bool
Return values
bool

True if dynamic, false otherwise.

splitTypeBits()

Splits the ABI type into its type and bit-length components. Also works for amount of bytes for non-dynamic bytes.

public static splitTypeBits(string $type) : array<string|int, mixed>
Parameters
$type : string

The ABI type.

Return values
array<string|int, mixed>

unwrapToPhpFriendlyVals()

Transforms the ABI value into a more PHP-friendly types, such as Common\Address, OOGmp, and such (recursive).

public abstract unwrapToPhpFriendlyVals(array<string|int, mixed>|null $tuplerData) : mixed
Parameters
$tuplerData : array<string|int, mixed>|null

Data structure for wanted tuples, tightly related to ABIGen logic. Always null-safe.

Return values
mixed

The PHP-friendly value.


        
On this page

Search results