41 releases (27 stable)

new 22.0.0-rc.3.2 Nov 14, 2024
22.0.0-rc.3 Oct 24, 2024
21.7.7 Nov 11, 2024
21.4.0 Jul 26, 2024
0.0.3 Jul 30, 2022

#165 in Magic Beans

Download history 3770/week @ 2024-07-27 2996/week @ 2024-08-03 1647/week @ 2024-08-10 2833/week @ 2024-08-17 3265/week @ 2024-08-24 1837/week @ 2024-08-31 2436/week @ 2024-09-07 1901/week @ 2024-09-14 2956/week @ 2024-09-21 2638/week @ 2024-09-28 2383/week @ 2024-10-05 2178/week @ 2024-10-12 1642/week @ 2024-10-19 2707/week @ 2024-10-26 3689/week @ 2024-11-02 4024/week @ 2024-11-09

12,292 downloads per month
Used in 56 crates (46 directly)

Apache-2.0

530KB
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
~315K SLoC