pub trait ContractCall<SA>: Sizedwhere
    SA: CallTypeApi + 'static,{
    type OriginalResult: TopEncodeMulti;

    // Required method
    fn transfer_execute(self);

    // Provided methods
    fn push_raw_argument<RawArg: Into<ManagedBuffer<SA>>>(
        &mut self,
        raw_arg: RawArg
    ) { ... }
    fn with_raw_arguments(
        self,
        raw_argument_buffer: ManagedArgBuffer<SA>
    ) -> Self { ... }
    fn with_gas_limit(self, gas_limit: u64) -> Self { ... }
    fn async_call(self) -> AsyncCall<SA> { ... }
    fn execute_on_dest_context<RequestedResult>(self) -> RequestedResult
       where RequestedResult: TopDecodeMulti { ... }
    fn execute_on_dest_context_ignore_result(self) { ... }
    fn execute_on_dest_context_readonly<RequestedResult>(
        self
    ) -> RequestedResult
       where RequestedResult: TopDecodeMulti { ... }
    fn execute_on_same_context<RequestedResult>(self) -> RequestedResult
       where RequestedResult: TopDecodeMulti { ... }
}
Expand description

Defines a contract call object, which is the basis for all calls to other contracts.

Its implementations differ on the type of payment that gets sent with the call.

Required Associated Types§

Required Methods§

source

fn transfer_execute(self)

Immediately launches a transfer-execute call.

This is similar to an async call, but there is no callback and there can be more than one such call per transaction.

Provided Methods§

source

fn push_raw_argument<RawArg: Into<ManagedBuffer<SA>>>( &mut self, raw_arg: RawArg )

For cases where we build the contract call by hand.

No serialization occurs, just direct conversion to ManagedBuffer.

source

fn with_raw_arguments(self, raw_argument_buffer: ManagedArgBuffer<SA>) -> Self

For cases where we build the contract call by hand.

source

fn with_gas_limit(self, gas_limit: u64) -> Self

Sets an explicit gas limit to the call.

source

fn async_call(self) -> AsyncCall<SA>

Converts to a legacy async call.

source

fn execute_on_dest_context<RequestedResult>(self) -> RequestedResultwhere RequestedResult: TopDecodeMulti,

Executes immediately, synchronously, and returns contract call result. Only works if the target contract is in the same shard.

source

fn execute_on_dest_context_ignore_result(self)

👎Deprecated since 0.36.1: Redundant method, use let _: IgnoreValue = contract_call.execute_on_dest_context(...) instead

Executes immediately, synchronously.

The result (if any) is ignored.

Deprecated and will be removed soon. Use execute_on_dest_context::<IgnoreValue>(...) instead.

source

fn execute_on_dest_context_readonly<RequestedResult>(self) -> RequestedResultwhere RequestedResult: TopDecodeMulti,

Executes immediately, synchronously, and returns contract call result.

Performs a readonly call.

source

fn execute_on_same_context<RequestedResult>(self) -> RequestedResultwhere RequestedResult: TopDecodeMulti,

Executes immediately, synchronously, and returns contract call result.

Performs call on the same context, i.e. the target contract will operate with the data from this contract.

Implementors§

source§

impl<SA, OriginalResult> ContractCall<SA> for ContractCallNoPayment<SA, OriginalResult>where SA: CallTypeApi + 'static, OriginalResult: TopEncodeMulti,

§

type OriginalResult = OriginalResult

source§

impl<SA, OriginalResult> ContractCall<SA> for ContractCallWithEgld<SA, OriginalResult>where SA: CallTypeApi + 'static, OriginalResult: TopEncodeMulti,

§

type OriginalResult = OriginalResult

source§

impl<SA, OriginalResult> ContractCall<SA> for ContractCallWithEgldOrSingleEsdt<SA, OriginalResult>where SA: CallTypeApi + 'static, OriginalResult: TopEncodeMulti,

§

type OriginalResult = OriginalResult

source§

impl<SA, OriginalResult> ContractCall<SA> for ContractCallWithMultiEsdt<SA, OriginalResult>where SA: CallTypeApi + 'static, OriginalResult: TopEncodeMulti,

§

type OriginalResult = OriginalResult