49 releases (stable)

new 22.0.7 Feb 13, 2025
22.0.4 Dec 20, 2024
22.0.0-rc.3.2 Nov 14, 2024
21.7.7 Nov 11, 2024
0.0.3 Jul 30, 2022

#141 in Magic Beans

Download history 2662/week @ 2024-10-29 3730/week @ 2024-11-05 4452/week @ 2024-11-12 2346/week @ 2024-11-19 2653/week @ 2024-11-26 4146/week @ 2024-12-03 5031/week @ 2024-12-10 4011/week @ 2024-12-17 720/week @ 2024-12-24 1274/week @ 2024-12-31 2538/week @ 2025-01-07 3610/week @ 2025-01-14 3876/week @ 2025-01-21 2723/week @ 2025-01-28 3274/week @ 2025-02-04 3434/week @ 2025-02-11

13,780 downloads per month
Used in 67 crates (56 directly)

Apache-2.0

535KB
10K SLoC

Soroban SDK supports writing smart contracts for the Wasm-powered Soroban smart contract runtime, deployed on Stellar.

Docs

See developers.stellar.org for documentation about building smart contracts for Stellar.

Migrating Major Versions

See [_migrating] for a summary of how to migrate from one major version to another.

Examples

use soroban_sdk::{contract, contractimpl, vec, symbol_short, BytesN, Env, Symbol, Vec};

#[contract]
pub struct Contract;

#[contractimpl]
impl Contract {
    pub fn hello(env: Env, to: Symbol) -> Vec<Symbol> {
        vec![&env, symbol_short!("Hello"), to]
    }
}

#[test]
fn test() {
# }
# #[cfg(feature = "testutils")]
# fn main() {
    let env = Env::default();
    let contract_id = env.register(Contract, ());
    let client = ContractClient::new(&env, &contract_id);

    let words = client.hello(&symbol_short!("Dev"));

    assert_eq!(words, vec![&env, symbol_short!("Hello"), symbol_short!("Dev"),]);
}
# #[cfg(not(feature = "testutils"))]
# fn main() { }

More examples are available at:

Dependencies

~11–15MB
~324K SLoC