Crate foundry_common_fmt

Crate foundry_common_fmt 

Source
Expand description

Helpers for formatting Ethereum types.

Modules§

console 🔒
dynamic 🔒
exp 🔒
ui 🔒
Helper trait and functions to format Ethereum types.

Structs§

StructDefinitions

Enums§

EthValue
Various numerical ethereum types used for pretty printing
FormatSpec
A format specifier.

Traits§

ConsoleFmt
Formats a value using a FormatSpec.
UIfmt
Helper trait to format Ethereum types.

Functions§

console_format
Formats a string using the input values.
format_int_exp
Formats a U256 number to string, adding an exponential notation hint.
format_token
Pretty-prints the given value into a string suitable for user output.
format_token_raw
Pretty-prints the given value into a string suitable for re-parsing as values later.
format_tokens
Pretty-prints a slice of tokens using format_token.
format_tokens_raw
Pretty-prints a slice of tokens using format_token_raw.
format_uint_exp
Formats a U256 number to string, adding an exponential notation hint if it is larger than 10_000, with a precision of 4 figures, and trimming the trailing zeros.
get_pretty_block_attr
Returns the UiFmt::pretty() formatted attribute of the given block
get_pretty_tx_attr
Returns the UiFmt::pretty() formatted attribute of the transactions
parse_tokens
Parses string input as Token against the expected ParamType
serialize_value_as_json
Serializes given [DynSolValue] into a serde_json::Value.
to_exp_notation
Returns the number expressed as a string in exponential notation with the given precision (number of significant figures), optionally removing trailing zeros from the mantissa.

Type Aliases§

TypeDefMap