Skip to content

Commit d00bac0

Browse files
committed
re-order SAC
1 parent 2946559 commit d00bac0

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

content/stellar-contracts/tokens/fungible/fungible.mdx

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,6 @@ The module provides several implementation options to suit different use cases:
2222

2323
These implementations share core functionality and a common interface, exposing identical contract functions as entry-points. However, the extensions provide specialized behavior by overriding certain functions to implement their specific requirements.
2424

25-
## SAC
26-
27-
The Stellar Asset Contract (SAC) is a special built-in implementation of [CAP-46-6 Smart Contract Standardized Asset](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0046-06.md) and [SEP-41 Token Interface](https://developers.stellar.org/docs/tokens/token-interface). The SAC acts as a bridge between traditional Stellar assets and Soroban smart contracts.
28-
29-
SAC is NOT a library or custom contract; it's a built-in protocol feature that automatically wraps existing Stellar assets (like USDC, XLM, or any issued asset) so they can be used in smart contracts. Think of it as the "smart contract version" of any Stellar asset.
30-
31-
Key points to know:
32-
- Every Stellar asset gets its own SAC instance with a deterministic contract address
33-
- No bridging or wrapping tokens needed - it's the same asset, just accessible via smart contracts
34-
- Anyone can deploy a SAC for any asset (the original issuer doesn't need to be involved)
35-
- SAC implements the same SEP-41 interface as OpenZeppelin fungible tokens, ensuring compatibility
36-
- When you transfer between Stellar accounts and contracts, the balances are stored differently but represent the same underlying asset
37-
38-
When to use SAC vs OpenZeppelin tokens:
39-
- Use SAC: When you want to interact with existing Stellar assets (USDC, XLM, etc.) in your smart contracts
40-
- Use OpenZeppelin: When creating new custom tokens with specialized logic, access controls, or unique tokenomics
41-
42-
For example, if you want to build a DeFi protocol that uses USDC, you'd deploy the SAC for USDC rather than creating a new token. Users can then interact with the same USDC they hold in their Stellar wallets directly through your smart contract.
43-
4425
## Usage
4526

4627
We’ll create a simple token for a game’s in-game currency. Players can earn tokens by completing tasks,
@@ -122,9 +103,26 @@ The `FungibleBlockList` trait extends the `FungibleToken` trait to provide a blo
122103
can be managed by an authorized account. This extension ensures that blocked accounts cannot transfer/receive
123104
tokens, or approve token transfers.
124105

125-
## Utility Modules
106+
## Stellar Asset Contract (SAC)
107+
108+
The Stellar Asset Contract (SAC) is a special built-in implementation of [CAP-46-6 Smart Contract Standardized Asset](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0046-06.md) and [SEP-41 Token Interface](https://developers.stellar.org/docs/tokens/token-interface). The SAC acts as a bridge between traditional Stellar assets and Soroban smart contracts.
109+
110+
SAC automatically wraps existing Stellar assets (like USDC, XLM, or any issued asset) so they can be used in smart contracts. Think of it as the "smart contract version" of any Stellar asset.
111+
112+
Key points to know:
113+
- Every Stellar asset gets its own SAC instance with a deterministic contract address
114+
- No bridging or wrapping tokens needed - it's the same asset, just accessible via smart contracts
115+
- Anyone can deploy a SAC for any asset (the original issuer doesn't need to be involved)
116+
- When you transfer between Stellar accounts and contracts, the balances are stored differently but represent the same underlying asset
117+
- SAC implements the same SEP-41 interface as OpenZeppelin fungible tokens
118+
119+
When to use SAC vs OpenZeppelin tokens:
120+
- Use SAC: When you want to interact with existing Stellar assets (USDC, XLM, etc.) in your smart contracts
121+
- Use OpenZeppelin: When creating new custom tokens with specialized logic, access controls, or unique tokenomics
122+
123+
For example, if you want to build a DeFi protocol that uses USDC, you'd deploy the SAC for USDC rather than creating a new token. Users can then interact with the same USDC they hold in their Stellar wallets directly through your smart contract.
126124

127-
The package includes utility modules to help with common token implementation patterns:
125+
Every SAC has an admin interface for privileged operations like minting or clawback. The OpenZeppelin fungible token module provides utilities that enable you to set a separate contract as the admin for these operations:
128126

129127
### - SAC Admin Generic
130128
[Source Code](https://github.com/OpenZeppelin/stellar-contracts/tree/main/packages/tokens/src/fungible/utils/sac_admin_generic)

0 commit comments

Comments
 (0)