Module soroban_sdk::deploy

source ·
Expand description

Deploy contains types for deploying contracts.

Contracts are assigned an ID that is derived from a set of arguments. A contract may choose which set of arguments to use to deploy with:

  • Deployer::with_current_contract – A contract deployed by the currently executing contract will have an ID derived from the currently executing contract’s ID.

  • Deployer::with_ed25519 – A contract deployed by the currently executing contract with an ed25519 public key will have an ID derived from the ed25519 public key.

The deployer can be created using Env::deployer.

Examples

let deployer = env.deployer().with_current_contract(&salt);
let contract_id = deployer.deploy(&wasm);

Structs

Deployer provides access to deploying contracts.
A deployer that deploys a contract that has its ID derived from the current contract ID and the provided salt.