pub struct BaseContract {
    pub methods: HashMap<Selector, (String, usize)>,
    /* private fields */
}
Expand description

A reduced form of Contract which just takes the abi and produces ABI encoded data for its functions.

Fields§

§methods: HashMap<Selector, (String, usize)>

A mapping from method signature to a name-index pair for accessing functions in the contract ABI. This is used to avoid allocation when searching for matching functions by signature.

Implementations§

Returns the ABI encoded data for the provided function and arguments

If the function exists multiple times and you want to use one of the overloaded versions, consider using encode_with_selector

Returns the ABI encoded data for the provided function selector and arguments

Decodes the provided ABI encoded function arguments with the selected function name.

If the function exists multiple times and you want to use one of the overloaded versions, consider using decode_with_selector

Decodes the provided ABI encoded function arguments with the selected function name.

If the function exists multiple times and you want to use one of the overloaded versions, consider using decode_with_selector

Returns a [Token] vector, which lets you decode function arguments dynamically without knowing the return type.

Decodes the provided ABI encoded function output with the selected function name.

If the function exists multiple times and you want to use one of the overloaded versions, consider using decode_with_selector

Decodes the provided ABI encoded function output with the selected function name.

If the function exists multiple times and you want to use one of the overloaded versions, consider using decode_with_selector

Returns a [Token] vector, which lets you decode function arguments dynamically without knowing the return type.

Decodes for a given event name, given the log.topics and log.data fields from the transaction receipt

Decodes for a given event name, given the log.topics and log.data fields from the transaction receipt

Returns a [Token] vector, which lets you decode function arguments dynamically without knowing the return type.

Decodes the provided ABI encoded bytes with the selected function selector

Returns a [Token] vector, which lets you decode function arguments dynamically without knowing the return type.

Decodes the provided ABI encoded bytes with the selected function selector

Decodes the provided ABI encoded bytes with the selected function selector

Returns a [Token] vector, which lets you decode function arguments dynamically without knowing the return type.

Returns a reference to the contract’s ABI

Upgrades a BaseContract into a full fledged contract with an address and middleware.

Trait Implementations§

Converts this type into a shared reference of the (usually inferred) input type.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Creates a new BaseContract from the abi.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more