Contract 533c71f7ba73500c92cff62c1621e8deaa5f9496ade12a5e8ca52e8219c288c3

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.7#211569aa49c8d896877dfca1f2eb4fe9071121c8
rsver 1.82.0

Instances

  • CDVEX22YYCFAMYO5WFGOUIOXQFWXA6Y6LQF4TOF7MXFUS3BOEEC7FMQG

Interface

Deploys the Stellar Asset Contract (SAC) address for a given asset XDR.

This function takes an asset's XDR representation and deploys the corresponding Stellar Asset Contract. It will fail if the contract is already deployed.

This utility is specifically designed for Stellar Classic tokens (native Stellar assets), allowing them to be used in Soroban smart contracts through the SAC interface.

Arguments

  • asset_xdr - The XDR byte representation of the Stellar asset

Returns

  • Ok(Address) - The deployed Stellar Asset Contract address
  • Err(ContractError::InvalidAssetXdr) - If the asset XDR is invalid
  • Err - If the contract is already deployed (deployment error)

Usage

This function is used to deploy a new Stellar Asset Contract for a specific asset. It takes the XDR representation of a Stellar asset (code and issuer) and creates a new contract instance for that asset.

To obtain the asset XDR:

  1. Use Stellar SDK libraries (like js-stellar-sdk) to create an Asset object
  2. Serialize the Asset to
fn deploy_stellar_asset_contract(
    env: soroban_sdk::Env,
    asset_xdr: soroban_sdk::Bytes,
) -> Result

Imports

WebAssembly Text (WAT) ▶