#Can you deploy an SAC from another contract?

1 messages · Page 1 of 1 (latest)

fossil harbor
livid needle
#

Theres a way with token i think

#

Yeah its deployer.with_stellar_asset

#
    /// corresponding to the provided serialized asset.
    ///
    /// `serialized_asset` is the Stellar `Asset` XDR serialized to bytes. Refer
    /// to `[soroban_sdk::xdr::Asset]`
    pub fn with_stellar_asset(
        &self,
        serialized_asset: impl IntoVal<Env, Bytes>,
    ) -> DeployerWithAsset {
        DeployerWithAsset {
            env: self.env.clone(),
            serialized_asset: serialized_asset.into_val(&self.env),
        }
    }```
#

U gotta build the asset xdr into the byte array

#

Then pass that in.

#

Ive found it easiest to calculate that part off chain but u could do it in the contract with a little effort

fossil harbor
#

Thank you!

livid needle