alloy_dyn_abi

Trait JsonAbiExt

Source
pub trait JsonAbiExt: Sealed {
    // Required methods
    fn abi_encode_input(&self, values: &[DynSolValue]) -> Result<Vec<u8>>;
    fn abi_encode_input_raw(&self, values: &[DynSolValue]) -> Result<Vec<u8>>;
    fn abi_decode_input(
        &self,
        data: &[u8],
        validate: bool,
    ) -> Result<Vec<DynSolValue>>;
}
Expand description

Provides ABI encoding and decoding functionality.

This trait is sealed and cannot be implemented for types outside of this crate. It is implemented only for the following types:

Required Methods§

Source

fn abi_encode_input(&self, values: &[DynSolValue]) -> Result<Vec<u8>>

ABI-encodes the given values, prefixed by this item’s selector, if any.

The selector is:

This behaviour is to ensure consistency with ethabi.

To encode the data without the selector, use abi_encode_input_raw.

§Errors

This function will return an error if the given values do not match the expected input types.

Source

fn abi_encode_input_raw(&self, values: &[DynSolValue]) -> Result<Vec<u8>>

ABI-encodes the given values, without prefixing the data with the item’s selector.

For Constructor, this is the same as abi_encode_input.

§Errors

This function will return an error if the given values do not match the expected input types.

Source

fn abi_decode_input( &self, data: &[u8], validate: bool, ) -> Result<Vec<DynSolValue>>

ABI-decodes the given data according to this item’s input types.

§Errors

This function will return an error if the decoded data does not match the expected input types.

Implementations on Foreign Types§

Source§

impl JsonAbiExt for Constructor

Source§

fn abi_encode_input(&self, values: &[DynSolValue]) -> Result<Vec<u8>>

Source§

fn abi_encode_input_raw(&self, values: &[DynSolValue]) -> Result<Vec<u8>>

Source§

fn abi_decode_input( &self, data: &[u8], validate: bool, ) -> Result<Vec<DynSolValue>>

Source§

impl JsonAbiExt for Error

Source§

fn abi_encode_input(&self, values: &[DynSolValue]) -> Result<Vec<u8>>

Source§

fn abi_encode_input_raw(&self, values: &[DynSolValue]) -> Result<Vec<u8>>

Source§

fn abi_decode_input( &self, data: &[u8], validate: bool, ) -> Result<Vec<DynSolValue>>

Source§

impl JsonAbiExt for Function

Source§

fn abi_encode_input(&self, values: &[DynSolValue]) -> Result<Vec<u8>>

Source§

fn abi_encode_input_raw(&self, values: &[DynSolValue]) -> Result<Vec<u8>>

Source§

fn abi_decode_input( &self, data: &[u8], validate: bool, ) -> Result<Vec<DynSolValue>>

Implementors§