Ether Binder
Set of utilities for interacting with Ethereum and it's smart contracts with PHP, with generating ABI bindings and Ethereum-related types
Loading...
Searching...
No Matches
M8B\EtherBinder\Common\Address Class Reference
Inheritance diagram for M8B\EtherBinder\Common\Address:
M8B\EtherBinder\Common\Hash M8B\EtherBinder\Common\BinarySerializableInterface M8B\EtherBinder\Common\HashSerializable

Public Member Functions

 checksummed ()
 
 __toString ()
 
 toHex (bool $with0x=true)
 
 toHex ()
 
 toHex ()
 
 toBin ()
 
 eq (Hash $b)
 
 isNull ()
 

Static Public Member Functions

static fromHex (string $hex)
 
static testChecksum (string $hexAddr)
 
static fromBin (string $bin)
 
static NULL ()
 

Protected Attributes

const dataSizeBytes = 20
 
string $bytes
 

Detailed Description

Address is a class for representing and manipulating Ethereum addresses.

Author
DubbaThony

Member Function Documentation

◆ __toString()

M8B\EtherBinder\Common\Address::__toString ( )
Exceptions
EthBinderLogicException

◆ checksummed()

M8B\EtherBinder\Common\Address::checksummed ( )

Returns checksummed hex representation of the address.

Returns
string Checksummed address.
Exceptions
EthBinderLogicException

◆ eq()

M8B\EtherBinder\Common\Hash::eq ( Hash $b)
inherited

Checks for equality with another Hash or Hash-derivative object.

Parameters
static$bAnother object to compare against.
Returns
bool True if equal, false otherwise.

◆ fromBin()

static M8B\EtherBinder\Common\Hash::fromBin ( string $bin)
staticinherited

Initializes from a binary string.

Parameters
string$binBinary data.
Returns
static
Exceptions
InvalidLengthException

Implements M8B\EtherBinder\Common\BinarySerializableInterface.

◆ fromHex()

static M8B\EtherBinder\Common\Address::fromHex ( string $hex)
static

Initializes from a hexadecimal string. Validates checksum and throws a BadAddressChecksumException when it does not match. If entire address is upper or lower case, the checksum is ommited.

Parameters
string$hexHexadecimal representation of the address.
Returns
static The Address object.
Exceptions
BadAddressChecksumException
InvalidHexException
InvalidHexLengthException
EthBinderLogicException

Reimplemented from M8B\EtherBinder\Common\Hash.

◆ isNull()

M8B\EtherBinder\Common\Hash::isNull ( )
inherited

Checks if inner data contains only zeroes (equals to static::NULL())

Returns
bool true if inner data is null data, false otherwise

◆ NULL()

static M8B\EtherBinder\Common\Hash::NULL ( )
staticinherited

Initializes object with all zeros.

Returns
static The null object.

◆ testChecksum()

static M8B\EtherBinder\Common\Address::testChecksum ( string $hexAddr)
static

Validates the checksum of a hexadecimal address. If all characters are upper or lower case, it skips the check and returns true.

Parameters
string$hexAddrHexadecimal address to test.
Returns
bool True if valid, false otherwise.
Exceptions
EthBinderLogicException

◆ toBin()

M8B\EtherBinder\Common\Hash::toBin ( )
inherited

Converts the internal data into to a binary string.

Returns
string Binary representation.

Implements M8B\EtherBinder\Common\BinarySerializableInterface.

◆ toHex() [1/3]

M8B\EtherBinder\Common\BinarySerializableInterface::toHex ( )
inherited

◆ toHex() [2/3]

M8B\EtherBinder\Common\Hash::toHex ( bool $with0x = true)
inherited

Converts the internal data into to a hexadecimal string.

Parameters
bool$with0xFlag to include "0x" prefix or not.
Returns
string Hexadecimal representation.

◆ toHex() [3/3]

M8B\EtherBinder\Common\HashSerializable::toHex ( )
inherited

Implemented in M8B\EtherBinder\Utils\OOGmp.


The documentation for this class was generated from the following file: