hello-soroban-kit

Crates.iohello-soroban-kit
lib.rshello-soroban-kit
version0.1.11
sourcesrc
created_at2023-12-19 05:39:03.799462
updated_at2024-02-28 17:44:46.276409
descriptionDemo soroban smart contract for soroban-kit.
homepage
repositoryhttps://github.com/fredericrezeau/soroban-kit
max_upload_size
id1073958
size47,241
Frederic 경진 Rezeau (FredericRezeau)

documentation

README

MIT License Twitter

hello-soroban-kit

Build Status Current Crates.io Version

This crate is part of soroban-kit: Github | crates.io.

hello-soroban-kit is a Soroban smart contract demo showcasing the use of all features in soroban-kit including state-machine, commitment-scheme, circuit-breaker, oracle and storage.

soroban-kit is designed for compactness, focusing on slim constructs. It is built on Rust's dependency-free core library and the soroban-sdk. All modules are feature-gated, offering you the flexibility to compile only the components essential for your project.

Take a look at Litemint Smart Contracts to see an integration of the library in real-world smart contracts.

Commands

  1. Building the Contract:

    soroban contract build
    
  2. Running Tests:

    cargo test -- --nocapture
    
  3. Deploying to Testnet:

    soroban contract deploy --wasm target/wasm32-unknown-unknown/release/hello_soroban_kit.wasm --rpc-url https://soroban-testnet.stellar.org:443 --network-passphrase "Test SDF Network ; September 2015" --source ACCOUNT
    
    output > CONTRACT_ID
    
  4. Invoking the contract:

    Just say hello with storage type-safety!

    soroban contract invoke --id CONTRACT_ID --source ACCOUNT --rpc-url https://soroban-testnet.stellar.org:443 --network-passphrase "Test SDF Network ; September 2015" -- hello --newcomer TESTER
    
    output > ["Hello","TESTER"]
    

    Play rock paper scissors!

    soroban contract invoke --id CONTRACT_ID --source ACCOUNT --rpc-url https://soroban-testnet.stellar.org:443 --network-passphrase "Test SDF Network ; September 2015" -- rock_paper_scissors
    
    output > "Success"
    

    Flip the switch on a circuit!

    soroban contract invoke --id CONTRACT_ID --source ACCOUNT --rpc-url https://soroban-testnet.stellar.org:443 --network-passphrase "Test SDF Network ; September 2015" -- circuit_breaker
    
    output > "Success"
    
  5. Check out lib.rs and test.rs for detailed integration examples.

Contributing

Contributions are welcome! If you have a suggestion that would make this better, please fork the repo and create a pull request.

License

soroban-kit is licensed under the MIT License. See LICENSE for more details.

Contact

For inquiries or collaborations:

Fred Kyung-jin Rezeau - @FredericRezeau

Commit count: 24

cargo fmt