Caution
This is experimental and should not be used for anything other than toy experiments.
A Zig SDK for writing Soroban smart contracts on the Stellar network.
- Zig 0.15+
- Stellar CLI (for deploying and invoking contracts)
Build the SDK library and examples:
zig build examples
Run tests:
zig build test
| Example | Description |
|---|---|
| hello | Hello world contract |
| increment | Counter stored in contract data |
| token | SEP-41 fungible token |
Add the SDK as a dependency in your build.zig.zon, then import it in your contract:
const sdk = @import("soroban-sdk");
const MyContract = struct {
pub fn hello(to: sdk.Symbol) sdk.VecObject {
// ...
}
};
comptime {
_ = sdk.contract.exportContract(MyContract);
}