-
Derives the contract id a deployment by the given deployer with the given salt creates on the given network.
The id depends only on the deployer address, the salt and the network; the executable the contract is created with (wasm hash, CAP-85 external reference or Stellar asset) does not enter the derivation. Use it to know a contract’s address before deploying, for example when the address is needed in constructor arguments of another contract.
Throws
StellarSDKError.invalidArgument if the salt is not exactly 32 bytesDeclaration
Swift
public static func deriveContractId(deployer: SCAddressXDR, salt: Data, network: Network) throws -> StringParameters
deployerthe address the deployment is issued from (account or contract)
saltthe 32 byte salt the deployment uses
networkthe network the contract is deployed to
Return Value
the derived contract id (“C…”)
View on GitHub
Install in Dash