Stellar PHP SDK API Documentation

DeploySACWithAssetHostFunction extends HostFunction
in package

Represents a Soroban host function for deploying a Stellar Asset Contract (SAC)

This host function deploys a Stellar Asset Contract for a given asset. SACs are standardized smart contracts that provide token functionality for Stellar assets on the Soroban smart contract platform.

Stellar Asset Contracts enable:

  • Interoperability between Stellar assets and Soroban contracts
  • Standard token interface (similar to ERC-20)
  • Native asset support in smart contract environments

Each Stellar asset can have one canonical SAC, deployed using this host function. The contract address is deterministically generated from the asset.

Usage: // Deploy SAC for a custom asset $asset = Asset::createNonNativeAsset("USD", "GBBB..."); $hostFunction = new DeploySACWithAssetHostFunction($asset);

// Deploy SAC for native XLM $xlmAsset = new AssetTypeNative(); $hostFunction = new DeploySACWithAssetHostFunction($xlmAsset);

// Use in an InvokeHostFunctionOperation $operation = (new InvokeHostFunctionOperationBuilder($hostFunction))->build();

Tags
see
HostFunction

Base class for all host functions

see
Asset

For asset representation

see
https://developers.stellar.org

Stellar developer docs

since
1.0.0

Table of Contents

Properties

$asset  : Asset

Methods

__construct()  : mixed
Constructs a new DeploySACWithAssetHostFunction
fromXdr()  : DeploySACWithAssetHostFunction
Creates a DeploySACWithAssetHostFunction from XDR format
getAsset()  : Asset
Gets the asset
setAsset()  : void
Sets the asset
toXdr()  : XdrHostFunction
Converts the deploy SAC host function to XDR format

Properties

Methods


        
On this page

Search results