Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove "wrap" verbiage for using Stellar assets in smart contracts #302

Merged
merged 4 commits into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Accounts on the Stellar network can be used to track, hold, and transfer any typ

Assets on Stellar have two identifying characteristics: the asset code and the issuer. Since more than one organization can issue a credit representing the same asset, asset codes often overlap (for example, multiple companies offer a USD token on Stellar). Assets are uniquely identified by the combination of their asset code and issuer.

You can also create smart contract tokens using the [Token Interface](https://soroban.stellar.org/docs/reference/interfaces/token-interface) but it is possible, and even recommended in most cases, to [wrap a Stellar asset](#wrapping-stellar-assets) using the Stellar Asset Contract for use in smart contracts.

## Asset components

### Asset code
Expand All @@ -27,9 +25,11 @@ There is no dedicated operation to create an asset on Stellar. Instead, assets a

The public key of the issuing account is linked on the ledger to the asset. Responsibility for and control over an asset resides with the issuing account. Since settings are stored at the account level on the ledger, the issuing account is where you use set_options operations to link to meta-information about an asset and set authorization flags.

## Wrapping Stellar assets
## Using Stellar assets in smart contracts

Assets issued on the Stellar network are accessible to smart contracts. Every Stellar asset has reserved a Stellar Asset Contract that can be deployed by anyone who wants to be able to interact with the asset from a contract.

Assets issued on the Stellar network can be used in smart contracts with the Stellar Asset Contract (SAC), which is an implementation of [CAP-46-6: Smart Contract Standardized Asset](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0046-06.md). The SAC allows users to use their Stellar account and trustline balances in Soroban and is a primary intersection where smart contracts interact with the rest of the Stellar network.
The Soroban CLI can deploy a Stellar Asset Contract for a Stellar asset. Deploying the Stellar Asset Contract for a Stellar asset enables that asset for use with smart contracts.

Learn more in the [SAC section in the Soroban docs](https://soroban.stellar.org/docs/advanced-tutorials/stellar-asset-contract).

Expand Down Expand Up @@ -92,3 +92,7 @@ In Horizon and client-side libraries such as js-stellar-sdk, the integer encoded
## Deleting or burning assets

To delete, or "burn", an asset, you must send it back to the account that issued it.

## Custom token contracts

Custom token contracts can be deployed on Stellar by deploying a contract that implements the [Token Interface](https://soroban.stellar.org/docs/reference/interfaces/token-interface), which is the same interface implemented by the [Stellar Asset Contract (SAC)](https://soroban.stellar.org/docs/tokens/stellar-asset-contract) for Stellar assets.
Loading