alloy_dyn_abi

Trait FunctionExt

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

Provide ABI encoding and decoding for the Function type.

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

Required Methods§

Source

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

ABI-encodes the given values.

Note that, contrary to abi_encode_input, this method does not prefix the return data with the function selector.

§Errors

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

Source

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

ABI-decodes the given data according to this functions’s output types.

This method does not check for any prefixes or selectors.

Implementations on Foreign Types§

Source§

impl FunctionExt for Function

Source§

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

Source§

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

Implementors§