Module utils

Module utils 

Source

Functions§

biguint_to_u256
Converts a general BigUint to an EVM-specific U256 value.
bytes_to_address
Safely converts a Bytes object to an Address object.
get_client
Gets the client used for interacting with the EVM-compatible network.
get_runtime
Returns the current Tokio runtime handle, or creates a new one if it doesn’t exist. It also returns the runtime to prevent it from being dropped before use. This is required since tycho-execution does not have a pre-existing runtime.
get_static_attribute
Extracts a static attribute from a swap.
get_token_position
Gets the position of a token in a list of tokens.
pad_or_truncate_to_size
Pads or truncates a byte slice to a fixed size array of N bytes. If input is shorter than N, it pads with zeros at the start. If input is longer than N, it truncates from the start (keeps last N bytes).
percentage_to_uint24
Converts a decimal to a U24 value. The percentage is a f64 value between 0 and 1. MAX_UINT24 corresponds to 100%.
ple_encode
Uses prefix-length encoding to efficient encode action data.
write_calldata_to_file

Type Aliases§

EVMProvider