Function ink_env::invoke_contract

source ·
pub fn invoke_contract<E, Args, R>(
    params: &CallParams<E, Call<E>, Args, R>
) -> Result<MessageResult<R>>where
    E: Environment,
    Args: Encode,
    R: Decode,
Expand description

Invokes a contract message and returns its result.


This is a low level way to evaluate another smart contract. Prefer to use the ink! guided and type safe approach to using this.


  • If the called account does not exist.
  • If the called account is not a contract.
  • If arguments passed to the called contract message are invalid.
  • If the called contract execution has trapped.
  • If the called contract ran out of gas upon execution.
  • If the returned value failed to decode properly.