Module evm_helpers

Source
Expand description

Helper functions for EVM-specific operations.

This module provides utility functions for working with EVM-specific data types and formatting, including address and hash conversions, signature normalization, and token value formatting.

Functions§

are_same_address
Compares two addresses for equality, ignoring case and “0x” prefixes.
are_same_signature
Compares two function signatures for equality, ignoring case and whitespace.
b256_to_string
Converts an B256 hash to its hexadecimal string representation.
format_token_value
Formats an ethabi Token into a consistent string representation.
h160_to_string
Converts an H160 address to its hexadecimal string representation.
h256_to_string
Converts an H256 hash to its hexadecimal string representation.
normalize_address
Normalizes an address string by removing “0x” prefix, spaces, and converting to lowercase.
normalize_signature
Normalizes a function signature by removing spaces and converting to lowercase.
string_to_h256
Converts a hexadecimal string to an H256 hash.
string_to_i256
Converts a string to an I256 value.
string_to_u256
Converts a string to a U256 value.