createContractFromExternalRef

fun createContractFromExternalRef(executableOwner: Address, tag: String, address: Address, constructorArgs: List<SCValXdr>? = null, salt: ByteArray? = null): InvokeHostFunctionOperation

Creates an operation to instantiate a contract from a CAP-85 external reference (Protocol 28), with the tag given as text.

The tag bytes put on the wire are the UTF-8 encoding of tag; everything else matches the ByteArray overload.

Parameters

executableOwner

The contract holding the executable tag entry

tag

The tag of the executable entry on the owner, as text

address

The deployer address (account or contract)

constructorArgs

Optional arguments passed to the contract constructor

salt

Optional 32 byte salt for contract id generation; random if not provided

Throws

if a provided salt is not exactly 32 bytes


fun createContractFromExternalRef(executableOwner: Address, tag: ByteArray, address: Address, constructorArgs: List<SCValXdr>? = null, salt: ByteArray? = null): InvokeHostFunctionOperation

Creates an operation to instantiate a contract from a CAP-85 external reference (Protocol 28).

The executable names an owner contract and a tag; the owner holds a persistent contract data entry under that tag whose value is the 32-byte hash of an already uploaded WASM, and the created instance runs that code. Nothing is uploaded as part of the deployment.

Uses CREATE_CONTRACT when constructorArgs is null or empty and CREATE_CONTRACT_V2 otherwise, like createContract.

Parameters

executableOwner

The contract holding the executable tag entry

tag

The tag of the executable entry on the owner; matched byte for byte

address

The deployer address (account or contract)

constructorArgs

Optional arguments passed to the contract constructor

salt

Optional 32 byte salt for contract id generation; random if not provided

Throws

if a provided salt is not exactly 32 bytes