ABI.TypeEncoder (ex_abi v0.8.2)

ABI.TypeEncoder is responsible for encoding types to the format expected by Solidity. We generally take a function selector and an array of data and encode that array according to the specification.

Summary

Functions

encode(data, selector_or_types, data_type \\ :input, mode \\ :standard)

Encodes the given data based on the function selector.

Parameters

  • data: The data to encode
  • selector_or_types: Either a FunctionSelector struct or a list of types to encode the data with
  • data_type: Determines which types to use from a FunctionSelector struct. Can be :input or :output.
  • mode: Encoding mode. Can be :standard or :packed.

encode_raw(data, types, mode)

mod(x, n)