Module alloy_primitives::utils
source · Expand description
Common Ethereum utilities.
Structs
- Ethereum unit. Always less than
77
.
Enums
- This enum holds the numeric types that a possible to be returned by
parse_units
and that are taken byformat_units
. - Error type for
Unit
-related operations.
Constants
- The prefix used for hashing messages according to EIP-191.
Functions
- Hash a message according to EIP-191 (version
0x01
). - Constructs a message according to EIP-191 (version
0x01
). - Formats the given number of Wei as an Ether amount.
- Formats the given number of Wei as the given unit.
- Simple interface to the
Keccak-256
hash function. - Converts the input to a U256 and converts from Ether to Wei.
- Parses a decimal number and multiplies it with 10^units.