pub fn instantiate_contract<E, ContractRef, Args, Salt, R>(
    params: &CreateParams<E, ContractRef, LimitParamsV2<E>, Args, Salt, R>
) -> Result<ConstructorResult<<R as ConstructorReturnType<ContractRef>>::Output>>
where E: Environment, ContractRef: FromAccountId<E>, Args: Encode, Salt: AsRef<[u8]>, R: ConstructorReturnType<ContractRef>,
Expand description

Instantiates another contract.

§Note

This is a low level way to instantiate another smart contract, calling the latest instantiate_v2 host function.

Prefer to use methods on a ContractRef or the CreateBuilder through build_create instead.

§Errors

  • If the code hash is invalid.
  • If the arguments passed to the instantiation process are invalid.
  • If the instantiation process traps.
  • If the instantiation process runs out of gas.
  • If given insufficient endowment.
  • If the returned account ID failed to decode properly.