Documentation

AbiInt extends AbiUint
in package

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

Properties

$value  : OOGmp
$maxBits  : int

Methods

__construct()  : mixed
__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).

Properties

Methods

__construct()

public __construct(null|int|OOGmp $val, int $maxBits) : mixed
Parameters
$val : null|int|OOGmp
$maxBits : int
Tags
throws
EthBinderArgumentException
noinspection

PhpMissingParentConstructorInspection

__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 __toString() : string
Tags
inheritDoc
Return values
string

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

decodeBin()

Decodes the binary data and updates the object(recursive).

public decodeBin(string &$dataBin, int $globalOffset) : int
Parameters
$dataBin : string

The binary data to be decoded.

$globalOffset : int

The global offset in the binary data.

Tags
inheritDoc
Return values
int

The new global offset.

encodeBin()

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

public encodeBin() : string
Tags
inheritDoc
Return values
string

The binary-encoded string.

isDynamic()

Checks whether the ABI value is dynamic or not.

public isDynamic() : bool
Tags
inheritDoc
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 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.

Tags
inheritDoc
Return values
mixed

The PHP-friendly value.


        
On this page

Search results