Expand description
Common Ethereum utilities.
Structs§
- Keccak256
- Simple
Keccak-256hasher. - Unit
- Ethereum unit. Always less than
77.
Enums§
- Decimal
Separator - Decimal separator for number formatting
- Parse
Units - This enum holds the numeric types that a possible to be returned by
parse_unitsand that are taken byformat_units. - Units
Error - Error type for
Unit-related operations.
Constants§
- EIP191_
PREFIX - The prefix used for hashing messages according to EIP-191.
- KECCA
K256_ EMPTY - The Keccak-256 hash of the empty string
"".
Functions§
- box_
try_ new - Allocates memory on the heap then places
xinto it, returning an error if the allocation fails. - box_
try_ new_ uninit - Constructs a new box with uninitialized contents on the heap, returning an error if the allocation fails.
- eip191_
hash_ message - Hash a message according to EIP-191 (version
0x01). - eip191_
message - Constructs a message according to EIP-191 (version
0x01). - format_
ether - Formats the given number of Wei as an Ether amount.
- format_
units - Formats the given number of Wei as the given unit.
- format_
units_ with - Formats the given number of Wei as the given unit with a custom decimal separator.
- keccak256
- Simple interface to the
Keccak-256hash function. - parse_
ether - Converts the input to a U256 and converts from Ether to Wei.
- parse_
units - Parses a decimal number and multiplies it with 10^units.
- try_
collect_ vec - Tries to collect the elements of an iterator into a
Vec. - vec_
try_ with_ capacity - Tries to create a
Vecwith the given capacity.