Instantiates a new contract from the supplied code optionally transferring
some balance.
This dispatchable has the same effect as calling [Self::upload_code] +
[Self::instantiate]. Bundling them together provides efficiency gains. Please
also check the documentation of [Self::upload_code].
Parameters
value: The balance to transfer from the origin to the newly created contract.
gas_limit: The gas limit enforced when executing the constructor.
storage_deposit_limit: The maximum amount of balance that can be charged/reserved
from the caller to pay for the storage consumed.
code: The contract code to deploy in raw bytes.
data: The input data to pass to the contract constructor.
salt: Used for the address derivation. If Some is supplied then CREATE2
semantics are used. If None then CRATE1 is used.
Instantiation is executed as follows:
The supplied code is deployed, and a code_hash is created for that code.
If the code_hash already exists on the chain the underlying code will be shared.
The destination address is computed based on the sender, code_hash and the salt.
The smart-contract account is created at the computed address.
The value is transferred to the new account.
The deploy function is executed in the context of the newly-created account.
Instantiates a new contract from the supplied
code
optionally transferring some balance.This dispatchable has the same effect as calling [
Self::upload_code
] + [Self::instantiate
]. Bundling them together provides efficiency gains. Please also check the documentation of [Self::upload_code
].Parameters
value
: The balance to transfer from theorigin
to the newly created contract.gas_limit
: The gas limit enforced when executing the constructor.storage_deposit_limit
: The maximum amount of balance that can be charged/reserved from the caller to pay for the storage consumed.code
: The contract code to deploy in raw bytes.data
: The input data to pass to the contract constructor.salt
: Used for the address derivation. IfSome
is supplied thenCREATE2
semantics are used. IfNone
thenCRATE1
is used.Instantiation is executed as follows:
code
is deployed, and acode_hash
is created for that code.code_hash
already exists on the chain the underlyingcode
will be shared.value
is transferred to the new account.deploy
function is executed in the context of the newly-created account.