Package com.norswap.nanoeth.data
Class Address
java.lang.Object
com.norswap.nanoeth.data.Address
- All Implemented Interfaces:
RLPLayoutable
@Wrapper public final class Address extends Object implements RLPLayoutable
Represents a 160-bit (20 bytes) Ethereum address.
-
Field Summary
Fields Modifier and Type Field Description byte[]
bytes
The big-endian representation of the address.static Address
EMPTY
The address the yellow paper denotes as "∅" and is represent by a zero-length byte sequence, unlike all other addresses which are 20-bytes long.static Address
ZERO
An address composed of 20 zero bytes. -
Constructor Summary
-
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.norswap.nanoeth.rlp.RLPLayoutable
rlpEncode, rlpHexString
-
Field Details
-
EMPTY
The address the yellow paper denotes as "∅" and is represent by a zero-length byte sequence, unlike all other addresses which are 20-bytes long.Not to be confused with
ZERO
.Used as destination for contract creation.
-
ZERO
An address composed of 20 zero bytes.Not to be confused with
EMPTY
.Used as coinbase for the
genesis block
. -
bytes
public final byte[] bytesThe big-endian representation of the address. Usually 20-bytes long, zero-length ifEMPTY
.
-
-
Constructor Details
-
Address
-
Address
-
-
Method Details
-
from
Creates a natural from a hex-string (e.g. "0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce").If the hex string is empty or simply "0x", then the
EMPTY
address is returned.If the post-0x part of the hex string is not 40 characters long, the address will be padded with zeroes at the start so that it is 20 bytes long.
-
parse
- Throws:
RLPParsingException
-
rlpLayout
Description copied from interface:RLPLayoutable
Returns the RLP layout for the object.- Specified by:
rlpLayout
in interfaceRLPLayoutable
-
equals
-
hashCode
public int hashCode() -
toString
-