Module codec

Source
Expand description

Solidity encoding following the Contract ABI Specification

Re-exports§

pub use bytes::BoundedBytes;
pub use bytes::BoundedString;
pub use bytes::UnboundedBytes;
pub use bytes::UnboundedString;
pub use native::Address;
pub use native::BoundedVec;
pub use self::encode_arguments as encode_return_value;
pub use self::encode_arguments as encode_event_data;
pub use self::decode_arguments as decode_return_value;
pub use self::decode_arguments as decode_event_data;

Modules§

bytes
native

Structs§

Convert
Adapter to parse data as a first type then convert it to another one. Useful for old precompiles in which Solidity arguments where set larger than the needed Rust type.
Reader
Wrapper around an EVM input slice.
String
A UTF-8–encoded, growable string.
Writer
Help build an EVM input/output data.

Traits§

Codec
Data that can be encoded/encoded following the Solidity ABI Specification.

Functions§

decode_arguments
Decode the value from its Solidity ABI format. If T is a tuple every element is decoded without a prefixed offset. It matches the encoding of Solidity function arguments and return value, or event data.
encode_arguments
Encode the value into its Solidity ABI format. If T is a tuple every element is encoded without a prefixed offset. It matches the encoding of Solidity function arguments and return value, or event data.
encode_with_selector
Encode the value as the arguments of a Solidity function with given selector. If T is a tuple each member represents an argument of the function.
selector
Extracts the selector from the start of the input, or returns None if the input is too short.

Derive Macros§

Codec