pub struct EvmEncoder { /* private fields */ }Expand description
ABI encoder for EVM function calls.
Implementations§
Source§impl EvmEncoder
impl EvmEncoder
Sourcepub fn from_abi_json(abi_json: &str) -> Result<Self, DecodeError>
pub fn from_abi_json(abi_json: &str) -> Result<Self, DecodeError>
Create an encoder from a standard Ethereum ABI JSON string.
Sourcepub fn encode_call(
&self,
function_name: &str,
args: &[NormalizedValue],
) -> Result<Vec<u8>, DecodeError>
pub fn encode_call( &self, function_name: &str, args: &[NormalizedValue], ) -> Result<Vec<u8>, DecodeError>
Encode a function call to calldata bytes.
Returns selector ++ abi_encode_packed(args...) — the standard
EVM calldata format suitable for eth_sendRawTransaction.
§Arguments
function_name- the Solidity function nameargs- values in declaration order (must match ABI parameter count & types)
Sourcepub fn encode_tuple(
&self,
type_strings: &[&str],
args: &[NormalizedValue],
) -> Result<Vec<u8>, DecodeError>
pub fn encode_tuple( &self, type_strings: &[&str], args: &[NormalizedValue], ) -> Result<Vec<u8>, DecodeError>
Encode raw ABI tuple without a function selector.
Useful for encoding constructor arguments.
Auto Trait Implementations§
impl Freeze for EvmEncoder
impl RefUnwindSafe for EvmEncoder
impl Send for EvmEncoder
impl Sync for EvmEncoder
impl Unpin for EvmEncoder
impl UnsafeUnpin for EvmEncoder
impl UnwindSafe for EvmEncoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more