Get current admin
fn admin_get(env: soroban_sdk::Env) -> Option
Transfer to new admin Should be called in the same transaction as deploying the contract to ensure that a different account try to become admin
fn admin_set(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)
Admin can upgrade the contract with given hash.
fn upgrade(env: soroban_sdk::Env, wasm_hash: soroban_sdk::BytesN<32>)
Constructor to set the admin
fn __constructor(env: soroban_sdk::Env, admin: soroban_sdk::Address)
Fetch the hash of a Wasm binary from the registry
fn fetch_hash(
env: soroban_sdk::Env,
wasm_name: soroban_sdk::String,
version: Option,
) -> Result, soroban_sdk::Error>
Most recent version of the published Wasm binary
fn current_version(
env: soroban_sdk::Env,
wasm_name: soroban_sdk::String,
) -> Result
Publish a binary. If contract had been previously published only previous author can publish again
fn publish(
env: soroban_sdk::Env,
wasm_name: soroban_sdk::String,
author: soroban_sdk::Address,
wasm: soroban_sdk::Bytes,
version: soroban_sdk::String,
) -> Result<(), soroban_sdk::Error>
Publish a binary. If contract had been previously published only previous author can publish again
fn publish_hash(
env: soroban_sdk::Env,
wasm_name: soroban_sdk::String,
author: soroban_sdk::Address,
wasm_hash: soroban_sdk::BytesN<32>,
version: soroban_sdk::String,
) -> Result<(), soroban_sdk::Error>
Deploys a new published contract returning the deployed contract's id. If no salt provided it will use the current sequence number.
fn deploy(
env: soroban_sdk::Env,
wasm_name: soroban_sdk::String,
version: Option,
contract_name: soroban_sdk::String,
admin: soroban_sdk::Address,
init: Option>,
) -> Result
Look up the contract id of a deployed contract
fn fetch_contract_id(
env: soroban_sdk::Env,
contract_name: soroban_sdk::String,
) -> Result
Skips the publish step to deploy a contract directly, keeping the name
fn dev_deploy(
env: soroban_sdk::Env,
name: soroban_sdk::String,
wasm: soroban_sdk::Bytes,
upgrade_fn: Option,
) -> Result
Upgrades a contract by calling the upgrade function. Default is 'upgrade' and expects that first arg is the corresponding wasm hash
fn upgrade_contract(
env: soroban_sdk::Env,
name: soroban_sdk::String,
wasm_name: soroban_sdk::String,
version: Option,
upgrade_fn: Option,
) -> Result