This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Leigh McCulloch <[email protected]> Co-authored-by: Elliot Voris <[email protected]>
- Loading branch information
1 parent
b37c4db
commit e82542e
Showing
6 changed files
with
98 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
title: Deploy the Stellar Asset Contract for a Stellar Asset | ||
hide_table_of_contents: true | ||
--- | ||
|
||
The Soroban CLI can deploy a [Stellar Asset Contract] for a Stellar asset so that any Soroban contract can interact with the asset. | ||
|
||
Every Stellar asset has reserved a contract that anyone can deploy. Once deployed any contract can interact with that asset by holding a balance of the asset, receiving the asset, or sending the asset. | ||
|
||
Deploying the Stellar Asset Contract for a Stellar asset enables that asset for use on Soroban. | ||
|
||
The Stellar Asset Contract can be deployed for any possible Stellar asset, either assets already in use on Stellar or assets that have never seen any activity. This means that the issuer doesn't need to have been created, and no one needs to be yet holding the asset on Stellar. | ||
|
||
To perform the deploy, use the following command: | ||
|
||
```bash | ||
soroban contract asset deploy \ | ||
--source S... \ | ||
--network testnet \ | ||
--asset USDC:GCYEIQEWOCTTSA72VPZ6LYIZIK4W4KNGJR72UADIXUXG45VDFRVCQTYE | ||
``` | ||
|
||
The `asset` argument corresponds to the symbol and it's issuer address, which is how assets are identified on Stellar. | ||
|
||
The same can be done for the native [Lumens] asset: | ||
|
||
```bash | ||
soroban contract asset deploy \ | ||
--source S... \ | ||
--network testnet \ | ||
--asset native | ||
``` | ||
|
||
:::note | ||
|
||
Deploying the native asset will fail on testnet or mainnet as | ||
a Stellar Asset Contract already exists. | ||
|
||
::: | ||
|
||
For any asset, the contract address can be fetched with: | ||
|
||
```bash | ||
soroban contract id asset \ | ||
--source S... \ | ||
--network testnet \ | ||
--asset native | ||
``` | ||
|
||
[Stellar Asset Contract]: ../../tokens/stellar-asset-contract.mdx | ||
[Lumens]: https://developers.stellar.org/docs/fundamentals-and-concepts/lumens | ||
[SEP-41]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0041.md | ||
[`soroban_sdk::token`]: https://docs.rs/soroban-sdk/latest/soroban_sdk/token/ | ||
[`token::TokenClient`]: https://docs.rs/soroban-sdk/latest/soroban_sdk/token/struct.TokenClient.html | ||
[`token::StellarAssetClient`]: https://docs.rs/soroban-sdk/latest/soroban_sdk/token/struct.StellarAssetClient.html |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters