Expand description
Common Ethereum utilities.
Structs§
- Keccak256
- Simple
Keccak-256
hasher. - Unit
- Ethereum unit. Always less than
77
.
Enums§
- Parse
Units - This enum holds the numeric types that a possible to be returned by
parse_units
and 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.
Functions§
- box_
try_ new - Allocates memory on the heap then places
x
into 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.
- keccak256
- Simple interface to the
Keccak-256
hash 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
Vec
with the given capacity.