You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/stellar-contracts/access/ownable.mdx
+45-1Lines changed: 45 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,51 @@ Until the transfer is accepted, the original owner retains full control and can
25
25
26
26
The Ownable module allows the owner to permanently renounce ownership of the contract. This is a one-way operation that cannot be undone. After ownership is renounced, all functions marked with `#[only_owner]` become permanently inaccessible.
27
27
28
-
This feature is useful for contracts that need to become fully decentralized after an initial setup phase.
28
+
This feature is useful for contracts that need to become fully decentralized after an initial setup phase, or to make a contract **immutable and non-upgradeable** by removing administrative control entirely.
29
+
30
+
#### Example: Making a Contract Immutable
31
+
32
+
A common use case is renouncing ownership after initial setup to ensure the contract becomes immutable and cannot be upgraded:
Copy file name to clipboardExpand all lines: content/stellar-contracts/tokens/fungible/fungible.mdx
+22-5Lines changed: 22 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,9 +103,26 @@ The `FungibleBlockList` trait extends the `FungibleToken` trait to provide a blo
103
103
can be managed by an authorized account. This extension ensures that blocked accounts cannot transfer/receive
104
104
tokens, or approve token transfers.
105
105
106
-
## Utility Modules
106
+
## Stellar Asset Contract (SAC)
107
107
108
-
The package includes utility modules to help with common token implementation patterns:
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.
124
+
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:
@@ -132,6 +149,6 @@ To comply with the SEP-41 specification, a contract must implement both the `Fun
132
149
133
150
## TTL Management
134
151
135
-
The library handles the TTL (Time-To-Live) of only `temporary` and `persistent` storage entries declared
136
-
by the library. The `instance` TTL management is left to the implementor due to flexibility. The library
137
-
exposes default values for extending the TTL: `INSTANCE_TTL_THRESHOLD`and `INSTANCE_EXTEND_AMOUNT`.
152
+
The library handles the TTL (Time-To-Live) of only `temporary` and `persistent` storage entries declared by the library. The `instance` TTL management is left to the implementor due to flexibility. The library exposes default values for extending the TTL: `INSTANCE_TTL_THRESHOLD` and `INSTANCE_EXTEND_AMOUNT`.
153
+
154
+
For a comprehensive understanding of Soroban's three storage types (`temporary`, `persistent`, and `instance`) and their archival behavior, see the [State Archival documentation](https://developers.stellar.org/docs/learn/fundamentals/contract-development/storage/state-archival#contract-data-type-descriptions).
0 commit comments