The [events example] demonstrates how to publish events from a contract. This
📄️ Custom Types
The [custom types example] demonstrates how to define your own data structures that can be stored on the ledger, or used as inputs and outputs to contract invocations. This example is an extension of the [storing data example].
The [errors example] demonstrates how to define and generate errors in a
The [logging example] demonstrates how to log for the purpose of debugging.
The [auth example] demonstrates how to implement authentication and
📄️ Cross Contract Calls
The [cross contract call example] demonstrates how to call a contract from
The [deployer example] demonstrates how to deploy contracts using a contract.
The [allocator example] demonstrates how to utilize the allocator feature when writing a contract.
📄️ Atomic Swap
The [atomic swap example] swaps two tokens between two authorized parties
📄️ Batched Atomic Swaps
The [atomic swap batching example] swaps a pair of tokens between the two groups
The [timelock example] demonstrates how to write a timelock and implements a
📄️ Single Offer Sale
The [single offer sale example] demonstrates how to write a contract that allows
📄️ Liquidity Pool
The [liquidity pool example] demonstrates how to write a constant product liquidity pool contract. The comments in the [source code] explain how the contract should be used.
📄️ Stellar Asset Contract
The Stellar Asset Contract is an implementation of [CAP-46-6 Smart Contract
📄️ Custom Account
The [custom account example] demonstrates how to implement a simple account
📄️ Invoking and Creating Contracts with Stellar Transactions
Stellar supports invoking and deploying contracts with a new Operation named InvokeHostFunctionOp. The [soroban-cli] abstracts these details away from the user, but SDKs do not yet and if you're building a dapp you'll probably find yourself building the XDR transaction to submit to the network.
📄️ Migrating Auth to SDK 0.6.0
This is a guide about migrating authorization code in contracts written before
📄️ Build Your Own SDK
Soroban currently has one SDK for writing contracts in Rust, which can be found here.