Repository navigation
Docs: Comprehensive Guide for Deploying Stellar Asset Contracts (SAC) within Smart Contracts - #902
Conversation
ElliotFriend
left a comment
There was a problem hiding this comment.
Couple really small things, and we'll be ready.
Thanks again!!
| The SacDeployer contract will be responsible for deploying the Stellar Asset Contract. Here is the code for the SacDeployer contract: | ||
|
|
||
| ```rust title="lib.rs" | ||
|
|
There was a problem hiding this comment.
Got another empty line here
| - `deploy_sac(env.clone(), serialized_asset)`: calls the `deploy_sac` function to deploy the SAC and retrieves the address. | ||
| - `println!("SAC Address: {}", sac_address.to_string())`: prints the address of the deployed SAC. | ||
| - `assert!(sac_address.to_string().len() > 0, "SAC address should be non-empty")`: asserts that the SAC address is non-empty, ensuring a successful deployment. | ||
| - `serialized_asset`is the Stellar `Asset` XDR serialized to bytes. Refer to `[soroban_sdk::xdr::Asset]` [XDR](https://github.com/stellar/rs-soroban-sdk/blob/main/soroban-sdk/src/xdr.rs) |
There was a problem hiding this comment.
I think this is a more useful link to point towards for the XDR: https://docs.rs/stellar-xdr/latest/stellar_xdr/curr/enum.Asset.html
I'm gonna double-check around to make sure, but I think that one is at least close enough to move forward. We can always change the links pretty easily.
There was a problem hiding this comment.
should i change the link to this?, ": https://docs.rs/stellar-xdr/latest/stellar_xdr/curr/enum.Asset.html
"
|
Almost didn't realize, let's also change the filename to all lowercase, please: |
|
i just made changes @ElliotFriend |
There was a problem hiding this comment.
Looks great! I think the build error we're seeing is some markdown formatting thing. If you run yarn format:mdx in your local copy of the repository (then commit and push the change), that should take care of it. If you want, I'm more than happy to do that, as well.
Thanks!
|
Build error is gone @ElliotFriend |
ElliotFriend
left a comment
There was a problem hiding this comment.
Looks great! Thanks @briwylde08 for taking care of the build error. This one's ready to go whenever you're ready! 🎉
|
Thank you for your contribution @KoxyG! I'll get this merged and we can take the award conversation back to the corresponding issue. Thanks again! |
* working on deploying a SAC * editorial and formatting * made contributions to stellar doc * updated XDR reference link * Rename deploying-a-SAC.mdx to deploying-a-sac.mdx * formatting --------- Co-authored-by: Bri <[email protected]>
🎯 Overview
This PR resolves issue #625 by introducing comprehensive documentation for deploying Stellar Asset Contracts (SAC) programmatically from within Soroban smart contracts. This guide fills a critical gap in the Stellar documentation, empowering developers to create and manage SACs dynamically through contract-based deployment.
📚 Documentation Added
Created a complete, production-ready guide covering the end-to-end workflow for deploying SACs within smart contracts, including:
SacDeployercontract with detailed code walkthrough🔍 Problem Statement
Developers working with Stellar Asset Contracts previously lacked clear, authoritative documentation on programmatic SAC deployment from within smart contracts. This created barriers to:
Impact: Without this documentation, developers had to:
✨ Solution
Authored a complete, technically accurate guide (
deploying-a-sac.mdx) that provides:Content Highlights
SacDeployer Contract Implementation
deploy_sacfunction and its parametersAsset Serialization Examples
Testing & Validation
Developer Experience Enhancements
🧪 Quality Assurance
Review Process:
Formatting Standards:
deploying-a-sac.mdx)yarn format:mdxfor consistency📈 Impact
This documentation addition delivers significant value to the Stellar developer ecosystem:
Direct Benefits:
Community Impact:
🔗 Related Resources
File Added:
docs/build/guides/conventions/deploying-a-sac.mdxWord Count: ~800 words of technical documentation
Code Examples: 3 complete, tested implementations