🧪
The Soroban's Token Playground
  • README
  • Index
    • 1: Introduction & Motivation.
    • 2 : Basic Concepts
    • 3 : Environment preparation
    • 4 : Issue and Mint Asset in Stellar.
    • 5: Get info about a token in Classic.
    • 6 : Wrap a token from Stellar Classic to Soroban.
    • 7 : Mint from a wrapped token in Soroban.
    • 8 : Use the native Stellar Lumens (XLM) the classic way.
    • 9 : Read the native token (XLM) using soroban-cli.
    • 10 : Write the native token (XLM) using soroban-cli.
    • 11 : Use the native token (XLM) inside a smart contract.
    • 12 : Identify a Stellar Classic Asset using stellar-sdk.
    • 13 : Wrap an asset using stellar-sdk.
Powered by GitBook
On this page
  • 1. Stellar Assets
  • 1.1 Identification of Stellar Assets
  • 1.2 Creation of Stellar Assets
  • 2. Soroban
  • 3. Tokens
  • 3.1 The Stellar Asset Contract (SAC)
  • 3.2 Issuing a SAC
  • Next
Edit on GitHub
  1. Index

2 : Basic Concepts

Previous1: Introduction & Motivation.Next3 : Environment preparation

Last updated 1 year ago

  • Check this guide in

  • Edit this guide in it's repo:

  • Contribute to this guide in the of the repo

1. Stellar Assets

As mentioned on the , the Stellar Blockchain provides a built in functionality to create and transfer any type of asset. By built-in we mean a core on-chain function that does not uses any smart contract.

1.1 Identification of Stellar Assets

Stellar Asssets are identified by the combination of the asset code and the issuer public key (the addres that creates the asset). Althought asset codes can be reused, the combination with issuer indentify the asset unique.

  • asset code: there are three type of asset codes: alphanumeric 4, alphanumeric 12 and liquidity pool shares

  • issuer: Stellar address that issue the asset

An Stellar Asset identification can be as follows:

ASSET_CODE:ISSUER_PUBLIC_KEY

Here is an example:

 AstroDollar:GAM5XOXRUWPMKENBGOEAKMLRQ4ENHLHDSU2L2J7TVJ34ZI7S6PHMYIGI

1.2 Creation of Stellar Assets

The creation of an Stellar Asset is very easy: The issuer needs to transfer the asset to a destination address. This transfer is performed by a transaction that includes a payment operation. However, let's don't forget, that before receiving the asset, the destination address is required to submit a change trust operation in order to accept to an specific asset not created yet.

2. Soroban

Soroban is the Stellar's smart contract platform, curently under development and in preview releases.

Soroban smart contracts are small pieces of software written in the Rust language and compiled to wasm code. Wasm smart contract code has to be submitted to stellar blockchain in a transaction so that later it can be invoked and run in a short-live virtual machine ("VM") thanks to a new transaction.

3. Tokens

3.1 The Stellar Asset Contract (SAC)

Stellar recommend issuing tokens as Stellar Assets, and then wraping into a SAC token to take advantge of the interoperatiblity with the existing ecosystem.

Next some resources about how uses tokens:

3.2 Issuing a SAC

Any individual has the capability to deploy instances of a Stellar Asset Contract. Nevertheless, despite the automated initiation of the Stellar Asset Contracts during deployment, it is the Asset Issuer who retains administrative permissions subsequent to the contract's deployment.

Next

In the next two chapters we will prepare our enviroment in order to issue (classic) Stellar Assets and mint them as Stellar Asset Contracts in Soroban. Remain alert!


Read more about trustlines in the

Following this steps, the asset will be minted / created, incrementins this way the total supply. If the issuer do not wants to mint any more, it needs to lock the issuing account. Learn more about asset supply in the

Tokens in Soroban can be issued as Stellar Assets or as custom Soroban Tokens (only soroban). Custom Soroban tokens can follow any type of logic, (as a non ERC-20 token). But the most interesting tokens are those that implement the which is similar to the widely used EVM's ERC-20 token standard.

Soroban contains the so called "Stellar Asset Contract" (SAC), which is a token contract that implements the , Using a SAC contract allows users to use their (classic) Stellar account and trustline balances in Soroban.

In order to get SAC deployed we will use a function included in the command line to wrap a stellar asset in a contract

This Playgound has been developed by in collaboration with from

https://token-playground.gitbook.io/
https://github.com/esteblock/token-playground/
./docs folder
introduction chapter
Stellar's Trustlines section
Stellar's "Limiting the Supply of an Asset" section
token interface
token interface
Token interface
Token example
Stellar Asset Contract (SAC)
soroban tools
@esteblock
@marcos74
@Dogstarcoin