49 releases (stable)

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

#17 in #stellar

Download history 4185/week @ 2024-12-01 4588/week @ 2024-12-08 4915/week @ 2024-12-15 960/week @ 2024-12-22 748/week @ 2024-12-29 2507/week @ 2025-01-05 3132/week @ 2025-01-12 4217/week @ 2025-01-19 2828/week @ 2025-01-26 3074/week @ 2025-02-02 3575/week @ 2025-02-09 3182/week @ 2025-02-16 3303/week @ 2025-02-23 2962/week @ 2025-03-02 4591/week @ 2025-03-09 4303/week @ 2025-03-16

15,578 downloads per month
Used in 68 crates (57 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–16MB
~326K SLoC