Crate foundry_common_fmt

Source
Expand description

Helpers for formatting Ethereum types.

Modulesยง

  • console ๐Ÿ”’
  • dynamic ๐Ÿ”’
  • eof ๐Ÿ”’
  • exp ๐Ÿ”’
  • ui ๐Ÿ”’
    Helper trait and functions to format Ethereum types.

Enumsยง

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

Traitsยง

Functionsยง

  • Formats a string using the input values.
  • Formats a U256 number to string, adding an exponential notation hint.
  • Pretty-prints the given value into a string suitable for user output.
  • Pretty-prints the given value into a string suitable for re-parsing as values later.
  • Pretty-prints a slice of tokens using format_token.
  • Pretty-prints a slice of tokens using format_token_raw.
  • 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.
  • Returns the UiFmt::pretty() formatted attribute of the given block
  • Returns the UiFmt::pretty() formatted attribute of the transactions
  • Parses string input as Token against the expected ParamType
  • 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.