From 1dffc11746b317769404970255d77d1f73edc718 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 10 Nov 2022 20:38:34 -0800 Subject: [PATCH 1/7] Update Examples, SDK and CLI v0.2.1 --- docs/examples/auth-advanced.mdx | 26 +++++++++++++------------- docs/examples/auth.mdx | 12 ++++++------ docs/examples/cross-contract-call.mdx | 10 +++++----- docs/examples/custom-types.mdx | 10 +++++----- docs/examples/deployer.mdx | 10 +++++----- docs/examples/errors.mdx | 14 +++++++------- docs/examples/events.mdx | 10 +++++----- docs/examples/hello-world.mdx | 10 +++++----- docs/examples/liquidity-pool.mdx | 6 +++--- docs/examples/logging.mdx | 10 +++++----- docs/examples/multisig-wallet.mdx | 4 ++-- docs/examples/single-offer-sale.mdx | 6 +++--- docs/examples/storing-data.mdx | 10 +++++----- docs/examples/timelock.mdx | 4 ++-- docs/getting-started/quick-start.mdx | 6 +++--- docs/getting-started/setup.mdx | 7 ++++--- docs/sdks/rust-auth.mdx | 8 ++++---- docs/sdks/rust.mdx | 4 ++-- docs/tutorials/create-a-project.mdx | 10 +++++----- 19 files changed, 89 insertions(+), 88 deletions(-) diff --git a/docs/examples/auth-advanced.mdx b/docs/examples/auth-advanced.mdx index 786f0b92..35f88448 100644 --- a/docs/examples/auth-advanced.mdx +++ b/docs/examples/auth-advanced.mdx @@ -7,7 +7,7 @@ The [advanced auth example] demonstrates how to write a contract that supports multiple forms of authentication using the [soroban-auth] crate. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.1.1 +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.2.1 The example supports authentication by: - Being the invoker, as a transaction source account or a contract. @@ -60,17 +60,17 @@ is appropriate for themselves. [soroban-auth]: ../SDKs/rust-auth [auth example]: auth.mdx -[advanced auth example]: https://github.com/stellar/soroban-examples/tree/v0.1.1/auth_advanced +[advanced auth example]: https://github.com/stellar/soroban-examples/tree/v0.2.1/auth_advanced ## Run the Example First go through the [Setup] process to get your development environment -configured, then clone the `v0.1.1` tag of `soroban-examples` repository: +configured, then clone the `v0.2.1` tag of `soroban-examples` repository: [Setup]: ../getting-started/setup.mdx ``` -git clone -b v0.1.1 https://github.com/stellar/soroban-examples +git clone -b v0.2.1 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -105,12 +105,12 @@ The example uses the Soroban auth SDK, and has the following dependencies in its ```toml title="authorization/src/Cargo.toml [dependencies] -soroban-sdk = "0.1.0" -soroban-auth = "0.1.0" +soroban-sdk = "0.2.1" +soroban-auth = "0.2.1" [dev_dependencies] -soroban-sdk = { version = "0.1.0", features = ["testutils"] } -soroban-auth = { version = "0.1.0", features = ["testutils"] } +soroban-sdk = { version = "0.2.1", features = ["testutils"] } +soroban-auth = { version = "0.2.1", features = ["testutils"] } ``` ## Code @@ -173,13 +173,13 @@ fn verify_and_consume_nonce(env: &Env, sig: &Signature, nonce: &BigInt) { match sig { Signature::Invoker => { if BigInt::zero(env) != nonce { - panic_error!(env, Error::IncorrectNonceForInvoker); + panic_with_error!(env, Error::IncorrectNonceForInvoker); } } Signature::Ed25519(_) | Signature::Account(_) => { let id = sig.identifier(env); if nonce != &get_nonce(env, &id) { - panic_error!(env, Error::IncorrectNonce); + panic_with_error!(env, Error::IncorrectNonce); } set_nonce(env, &id, nonce + 1); } @@ -200,7 +200,7 @@ fn set_nonce(env: &Env, id: &Identifier, nonce: BigInt) { } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v0.1.1/auth_advanced +Ref: https://github.com/stellar/soroban-examples/tree/v0.2.1/auth_advanced ## How it Works @@ -421,13 +421,13 @@ fn verify_and_consume_nonce(env: &Env, sig: &Signature, nonce: &BigInt) { match sig { Signature::Invoker => { if BigInt::zero(env) != nonce { - panic_error!(env, Error::IncorrectNonceForInvoker); + panic_with_error!(env, Error::IncorrectNonceForInvoker); } } Signature::Ed25519(_) | Signature::Account(_) => { let id = sig.identifier(env); if nonce != &get_nonce(env, &id) { - panic_error!(env, Error::IncorrectNonce); + panic_with_error!(env, Error::IncorrectNonce); } set_nonce(env, &id, nonce + 1); } diff --git a/docs/examples/auth.mdx b/docs/examples/auth.mdx index 8450e758..9ea0c11a 100644 --- a/docs/examples/auth.mdx +++ b/docs/examples/auth.mdx @@ -8,9 +8,9 @@ verify that a contract has been invoked by an account or contract. This example is an extension of the [storing data example]. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.1.1 +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.2.1 -[events example]: https://github.com/stellar/soroban-examples/tree/v0.1.1/events +[events example]: https://github.com/stellar/soroban-examples/tree/v0.2.1/events [storing data example]: storing-data.mdx The participant who invoked a contract is an `Address` containing one-of a: @@ -26,18 +26,18 @@ invocations, or ed25519 keys independent of accounts and contracts, see the [advanced auth example]. ::: -[auth example]: https://github.com/stellar/soroban-examples/tree/v0.1.1/auth +[auth example]: https://github.com/stellar/soroban-examples/tree/v0.2.1/auth [advanced auth example]: auth-advanced.mdx ## Run the Example First go through the [Setup] process to get your development environment -configured, then clone the `v0.1.1` tag of `soroban-examples` repository: +configured, then clone the `v0.2.1` tag of `soroban-examples` repository: [Setup]: ../getting-started/setup.mdx ``` -git clone -b v0.1.1 https://github.com/stellar/soroban-examples +git clone -b v0.2.1 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -95,7 +95,7 @@ impl IncrementContract { } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v0.1.1/auth +Ref: https://github.com/stellar/soroban-examples/tree/v0.2.1/auth ## How it Works diff --git a/docs/examples/cross-contract-call.mdx b/docs/examples/cross-contract-call.mdx index 2497a69d..44742726 100644 --- a/docs/examples/cross-contract-call.mdx +++ b/docs/examples/cross-contract-call.mdx @@ -7,7 +7,7 @@ The [cross contract call example] demonstrates how to call a contract from another contract. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.1.1 +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.2.1 :::info In this example there are two contracts that are compiled separately, deployed @@ -17,17 +17,17 @@ tooling is still building out the tools to support these workflows. Feedback appreciated [here](https://github.com/stellar/rs-soroban-sdk/issues/new/choose). ::: -[cross contract call example]: https://github.com/stellar/soroban-examples/tree/v0.1.1/cross_contract_calls +[cross contract call example]: https://github.com/stellar/soroban-examples/tree/v0.2.1/cross_contract_calls ## Run the Example First go through the [Setup] process to get your development environment -configured, then clone the `v0.1.1` tag of `soroban-examples` repository: +configured, then clone the `v0.2.1` tag of `soroban-examples` repository: [Setup]: ../getting-started/setup.mdx ``` -git clone -b v0.1.1 https://github.com/stellar/soroban-examples +git clone -b v0.2.1 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -76,7 +76,7 @@ impl ContractB { } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v0.1.1/cross_contract +Ref: https://github.com/stellar/soroban-examples/tree/v0.2.1/cross_contract ## How it Works diff --git a/docs/examples/custom-types.mdx b/docs/examples/custom-types.mdx index d24581e4..ab3f3b39 100644 --- a/docs/examples/custom-types.mdx +++ b/docs/examples/custom-types.mdx @@ -8,20 +8,20 @@ that can be stored on the ledger, or used as inputs and outputs to contract invocations. This example is an extension of the [storing data example]. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.1.1 +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.2.1 -[custom types example]: https://github.com/stellar/soroban-examples/tree/v0.1.1/custom_types +[custom types example]: https://github.com/stellar/soroban-examples/tree/v0.2.1/custom_types [storing data example]: storing-data.mdx ## Run the Example First go through the [Setup] process to get your development environment -configured, then clone the `v0.1.1` tag of `soroban-examples` repository: +configured, then clone the `v0.2.1` tag of `soroban-examples` repository: [Setup]: ../getting-started/setup.mdx ``` -git clone -b v0.1.1 https://github.com/stellar/soroban-examples +git clone -b v0.2.1 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -73,7 +73,7 @@ impl IncrementContract { } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v0.1.1/custom_types +Ref: https://github.com/stellar/soroban-examples/tree/v0.2.1/custom_types ## How it Works diff --git a/docs/examples/deployer.mdx b/docs/examples/deployer.mdx index 0c8aaa01..1bdaa973 100644 --- a/docs/examples/deployer.mdx +++ b/docs/examples/deployer.mdx @@ -6,24 +6,24 @@ title: Deployer The [deployer example] demonstrates how to deploy contracts using a contract. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.1.1 +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.2.1 :::info In this example there are two contracts that are compiled separately, and the tests deploy one with the other. ::: -[deployer example]: https://github.com/stellar/soroban-examples/tree/v0.1.1/deployer +[deployer example]: https://github.com/stellar/soroban-examples/tree/v0.2.1/deployer ## Run the Example First go through the [Setup] process to get your development environment -configured, then clone the `v0.1.1` tag of `soroban-examples` repository: +configured, then clone the `v0.2.1` tag of `soroban-examples` repository: [Setup]: ../getting-started/setup.mdx ``` -git clone -b v0.1.1 https://github.com/stellar/soroban-examples +git clone -b v0.2.1 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -65,7 +65,7 @@ impl Deployer { } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v0.1.1/deployer +Ref: https://github.com/stellar/soroban-examples/tree/v0.2.1/deployer ## How it Works diff --git a/docs/examples/errors.mdx b/docs/examples/errors.mdx index 078ee7d8..78682736 100644 --- a/docs/examples/errors.mdx +++ b/docs/examples/errors.mdx @@ -8,20 +8,20 @@ contract that invokers of the contract can understand and handle. This example is an extension of the [storing data example]. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.1.1 +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.2.1 -[errors example]: https://github.com/stellar/soroban-examples/tree/v0.1.1/errors +[errors example]: https://github.com/stellar/soroban-examples/tree/v0.2.1/errors [storing data example]: storing-data.mdx ## Run the Example First go through the [Setup] process to get your development environment -configured, then clone the `v0.1.1` tag of `soroban-examples` repository: +configured, then clone the `v0.2.1` tag of `soroban-examples` repository: [Setup]: ../getting-started/setup.mdx ``` -git clone -b v0.1.1 https://github.com/stellar/soroban-examples +git clone -b v0.2.1 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -96,7 +96,7 @@ impl IncrementContract { } } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v0.1.1/errors +Ref: https://github.com/stellar/soroban-examples/tree/v0.2.1/errors ## How it Works @@ -156,7 +156,7 @@ pub fn increment(env: Env) -> Result { Errors can also be panicked instead of being returned from the function. The increment function could also be written as follows with a `u32` return -value. The error can be passed to the environment using the `panic_error!` +value. The error can be passed to the environment using the `panic_with_error!` macro. ```rust @@ -167,7 +167,7 @@ pub fn increment(env: Env) -> u32 { count } else { // ... - panic_error!(&env, Error::LimitReached) + panic_with_error!(&env, Error::LimitReached) } } ``` diff --git a/docs/examples/events.mdx b/docs/examples/events.mdx index 9a101783..af9dd0a7 100644 --- a/docs/examples/events.mdx +++ b/docs/examples/events.mdx @@ -7,20 +7,20 @@ The [events example] demonstrates how to publish events from a contract. This example is an extension of the [storing data example]. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.1.1 +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.2.1 -[events example]: https://github.com/stellar/soroban-examples/tree/v0.1.1/events +[events example]: https://github.com/stellar/soroban-examples/tree/v0.2.1/events [storing data example]: storing-data.mdx ## Run the Example First go through the [Setup] process to get your development environment -configured, then clone the `v0.1.1` tag of `soroban-examples` repository: +configured, then clone the `v0.2.1` tag of `soroban-examples` repository: [Setup]: ../getting-started/setup.mdx ``` -git clone -b v0.1.1 https://github.com/stellar/soroban-examples +git clone -b v0.2.1 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -61,7 +61,7 @@ impl IncrementContract { } } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v0.1.1/events +Ref: https://github.com/stellar/soroban-examples/tree/v0.2.1/events ## How it Works diff --git a/docs/examples/hello-world.mdx b/docs/examples/hello-world.mdx index fce8c2c1..f609ee43 100644 --- a/docs/examples/hello-world.mdx +++ b/docs/examples/hello-world.mdx @@ -7,19 +7,19 @@ The [hello world example] demonstrates how to write a simple contract, with a single function that takes one input and returns it as an output. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.1.1 +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.2.1 -[hello world example]: https://github.com/stellar/soroban-examples/tree/v0.1.1/hello_world +[hello world example]: https://github.com/stellar/soroban-examples/tree/v0.2.1/hello_world ## Run the Example First go through the [Setup] process to get your development environment -configured, then clone the `v0.1.1` tag of `soroban-examples` repository: +configured, then clone the `v0.2.1` tag of `soroban-examples` repository: [Setup]: ../getting-started/setup.mdx ``` -git clone -b v0.1.1 https://github.com/stellar/soroban-examples +git clone -b v0.2.1 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -53,7 +53,7 @@ impl HelloContract { } } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v0.1.1/hello_world +Ref: https://github.com/stellar/soroban-examples/tree/v0.2.1/hello_world ## How it Works diff --git a/docs/examples/liquidity-pool.mdx b/docs/examples/liquidity-pool.mdx index 7958cc9a..12695f34 100644 --- a/docs/examples/liquidity-pool.mdx +++ b/docs/examples/liquidity-pool.mdx @@ -8,7 +8,7 @@ liquidity pool contract. The comments in the [source code] explain how the contr be used. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.1.1 +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.2.1 -[liquidity pool example]: https://github.com/stellar/soroban-examples/tree/v0.1.1/liquidity_pool -[source code]: https://github.com/stellar/soroban-examples/blob/v0.1.0/liquidity_pool/src/lib.rs#L143 +[liquidity pool example]: https://github.com/stellar/soroban-examples/tree/v0.2.1/liquidity_pool +[source code]: https://github.com/stellar/soroban-examples/blob/v0.2.1/liquidity_pool/src/lib.rs#L143 diff --git a/docs/examples/logging.mdx b/docs/examples/logging.mdx index cbdc3f48..c2f40d79 100644 --- a/docs/examples/logging.mdx +++ b/docs/examples/logging.mdx @@ -6,13 +6,13 @@ title: Logging The [logging example] demonstrates how to log for the purpose of debugging. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.1.1 +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.2.1 Logs in contracts are only visible in tests, or when executing contracts using [`soroban-cli`]. Logs are only compiled into the contract if the `debug-assertions` Rust compiler option is enabled. -[logging example]: https://github.com/stellar/soroban-examples/tree/v0.1.1/hello_world +[logging example]: https://github.com/stellar/soroban-examples/tree/v0.2.1/hello_world :::tip Logs are no a substitute for step-through debugging. Rust tests for Soroban can @@ -31,12 +31,12 @@ example] for how to produce structured events. ## Run the Example First go through the [Setup] process to get your development environment -configured, then clone the `v0.1.1` tag of `soroban-examples` repository: +configured, then clone the `v0.2.1` tag of `soroban-examples` repository: [Setup]: ../getting-started/setup.mdx ``` -git clone -b v0.1.1 https://github.com/stellar/soroban-examples +git clone -b v0.2.1 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -78,7 +78,7 @@ impl Contract { } } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v0.1.1/logging +Ref: https://github.com/stellar/soroban-examples/tree/v0.2.1/logging ## How it Works diff --git a/docs/examples/multisig-wallet.mdx b/docs/examples/multisig-wallet.mdx index 7f1baaaf..0d72656b 100644 --- a/docs/examples/multisig-wallet.mdx +++ b/docs/examples/multisig-wallet.mdx @@ -7,12 +7,12 @@ The [multisig wallet example] demonstrates a complex auth scheme with multiple signers that authorizes payments either immediately or in a delayed async fashion. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.1.1 +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.2.1 :::tip Stellar supports [multisig accounts] natively, and multisig accounts may be simpler to manage than a contract driven multisig wallet. ::: -[multisig wallet example]: https://github.com/stellar/soroban-examples/tree/v0.1.1/wallet +[multisig wallet example]: https://github.com/stellar/soroban-examples/tree/v0.2.1/wallet [multisig accounts]: https://developers.stellar.org/docs/encyclopedia/signatures-multisig diff --git a/docs/examples/single-offer-sale.mdx b/docs/examples/single-offer-sale.mdx index 1adaca37..769770b4 100644 --- a/docs/examples/single-offer-sale.mdx +++ b/docs/examples/single-offer-sale.mdx @@ -8,7 +8,7 @@ a seller to set up an offer to sell token A for token B. The comments in the [source code] explain how the contract should be used. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.1.1 +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.2.1 -[single offer sale example]: https://github.com/stellar/soroban-examples/tree/v0.1.1/single_offer -[source code]: https://github.com/stellar/soroban-examples/blob/v0.1.0/single_offer/src/lib.rs#L131 +[single offer sale example]: https://github.com/stellar/soroban-examples/tree/v0.2.1/single_offer +[source code]: https://github.com/stellar/soroban-examples/blob/v0.2.1/single_offer/src/lib.rs#L131 diff --git a/docs/examples/storing-data.mdx b/docs/examples/storing-data.mdx index e402a207..1fbb6762 100644 --- a/docs/examples/storing-data.mdx +++ b/docs/examples/storing-data.mdx @@ -8,19 +8,19 @@ data, with a single function that increments an internal counter and returns the value. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.1.1 +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.2.1 -[increment example]: https://github.com/stellar/soroban-examples/tree/v0.1.1/increment +[increment example]: https://github.com/stellar/soroban-examples/tree/v0.2.1/increment ## Run the Example First go through the [Setup] process to get your development environment -configured, then clone the `v0.1.1` tag of `soroban-examples` repository: +configured, then clone the `v0.2.1` tag of `soroban-examples` repository: [Setup]: ../getting-started/setup.mdx ``` -git clone -b v0.1.1 https://github.com/stellar/soroban-examples +git clone -b v0.2.1 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -64,7 +64,7 @@ impl IncrementContract { } } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v0.1.1/increment +Ref: https://github.com/stellar/soroban-examples/tree/v0.2.1/increment ## How it Works diff --git a/docs/examples/timelock.mdx b/docs/examples/timelock.mdx index 7ae2bf5c..16fef0c2 100644 --- a/docs/examples/timelock.mdx +++ b/docs/examples/timelock.mdx @@ -8,10 +8,10 @@ greatly simplified claimable balance similar to the [claimable balance] feature available on Stellar. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.1.1 +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v0.2.1 The contract accepts deposits of an amount of a token, and allows other accounts to claim it before or after a time point. -[timelock example]: https://github.com/stellar/soroban-examples/tree/v0.1.1/timelock +[timelock example]: https://github.com/stellar/soroban-examples/tree/v0.2.1/timelock [claimable balance]: https://developers.stellar.org/docs/glossary/claimable-balance diff --git a/docs/getting-started/quick-start.mdx b/docs/getting-started/quick-start.mdx index 6adda801..39d40172 100644 --- a/docs/getting-started/quick-start.mdx +++ b/docs/getting-started/quick-start.mdx @@ -21,7 +21,7 @@ Open the `Cargo.toml`, it should look something like this: ```toml title="Cargo.toml" [package] name = "first-project" -version = "0.1.0" +version = "0.2.1" edition = "2021" ``` @@ -42,10 +42,10 @@ crate-type = ["cdylib"] testutils = ["soroban-sdk/testutils"] [dependencies] -soroban-sdk = "0.1.0" +soroban-sdk = "0.2.1" [dev_dependencies] -soroban-sdk = { version = "0.1.0", features = ["testutils"] } +soroban-sdk = { version = "0.2.1", features = ["testutils"] } [profile.release] opt-level = "z" diff --git a/docs/getting-started/setup.mdx b/docs/getting-started/setup.mdx index dc6697f3..e8353dc3 100644 --- a/docs/getting-started/setup.mdx +++ b/docs/getting-started/setup.mdx @@ -54,7 +54,7 @@ contract will execute on network, however in a local sandbox. Install the Soroban CLI using `cargo install`. ```sh -cargo install --locked --version 0.1.2 soroban-cli +cargo install --locked --version 0.2.1 soroban-cli ``` :::info @@ -71,8 +71,8 @@ soroban ``` ``` -❯ soroban -h -soroban 0.1.2 +❯ soroban +soroban 0.2.1 https://soroban.stellar.org USAGE: @@ -84,6 +84,7 @@ OPTIONS: SUBCOMMANDS: invoke Invoke a contract function in a WASM file inspect Inspect a WASM file listing contract functions, meta, etc + optimize Optimize a WASM file read Print the current value of a contract-data ledger entry serve Run a local webserver for web app development and testing token Wrap, create, and manage token contracts diff --git a/docs/sdks/rust-auth.mdx b/docs/sdks/rust-auth.mdx index 9b2f79a5..4671ed12 100644 --- a/docs/sdks/rust-auth.mdx +++ b/docs/sdks/rust-auth.mdx @@ -59,10 +59,10 @@ Add the following sections to the `Cargo.toml` to import `soroban-auth`. testutils = ["soroban-auth/testutils"] [dependencies] -soroban-sdk = "0.1.0" -soroban-auth = "0.1.0" +soroban-sdk = "0.2.1" +soroban-auth = "0.2.1" [dev_dependencies] -soroban-sdk = { version = "0.1.0", features = ["testutils"] } -soroban-auth = { version = "0.1.0", features = ["testutils"] } +soroban-sdk = { version = "0.2.1", features = ["testutils"] } +soroban-auth = { version = "0.2.1", features = ["testutils"] } ``` diff --git a/docs/sdks/rust.mdx b/docs/sdks/rust.mdx index 1870fc96..d8bf0cd9 100644 --- a/docs/sdks/rust.mdx +++ b/docs/sdks/rust.mdx @@ -29,8 +29,8 @@ Add the following sections to the `Cargo.toml` to import the `soroban-sdk`. testutils = ["soroban-sdk/testutils"] [dependencies] -soroban-sdk = "0.1.0" +soroban-sdk = "0.2.1" [dev_dependencies] -soroban-sdk = { version = "0.1.0", features = ["testutils"] } +soroban-sdk = { version = "0.2.1", features = ["testutils"] } ``` diff --git a/docs/tutorials/create-a-project.mdx b/docs/tutorials/create-a-project.mdx index 052fce36..995e4bc2 100644 --- a/docs/tutorials/create-a-project.mdx +++ b/docs/tutorials/create-a-project.mdx @@ -19,7 +19,7 @@ Open the `Cargo.toml`, it should look something like this: ```toml title="Cargo.toml" [package] name = "project-name" -version = "0.1.0" +version = "0.2.1" edition = "2021" ``` @@ -44,10 +44,10 @@ The `soroban-sdk` is in early development. Report issues ```toml [dependencies] -soroban-sdk = "0.1.0" +soroban-sdk = "0.2.1" [dev_dependencies] -soroban-sdk = { version = "0.1.0", features = ["testutils"] } +soroban-sdk = { version = "0.2.1", features = ["testutils"] } [features] testutils = ["soroban-sdk/testutils"] @@ -117,10 +117,10 @@ crate-type = ["cdylib"] testutils = ["soroban-sdk/testutils"] [dependencies] -soroban-sdk = "0.1.0" +soroban-sdk = "0.2.1" [dev_dependencies] -soroban-sdk = { version = "0.1.0", features = ["testutils"] } +soroban-sdk = { version = "0.2.1", features = ["testutils"] } [profile.release] opt-level = "z" From c9928a22b41edc31617bfebe3e13ba1f56895870 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 10 Nov 2022 21:00:59 -0800 Subject: [PATCH 2/7] Pin docker image --- docs/tutorials/deploy-to-futurenet.mdx | 2 +- docs/tutorials/deploy-to-local-network.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/deploy-to-futurenet.mdx b/docs/tutorials/deploy-to-futurenet.mdx index 274d0a4d..ff4d4a79 100644 --- a/docs/tutorials/deploy-to-futurenet.mdx +++ b/docs/tutorials/deploy-to-futurenet.mdx @@ -22,7 +22,7 @@ docker run --rm -it \ --platform linux/amd64 \ -p 8000:8000 \ --name stellar \ - stellar/quickstart:soroban-dev \ + stellar/quickstart:soroban-dev@sha256:0993d3350148af6ffeab5dc8f0b835236b28dade6dcae77ff8a09317162f768d \ --futurenet \ --enable-soroban-rpc ``` diff --git a/docs/tutorials/deploy-to-local-network.mdx b/docs/tutorials/deploy-to-local-network.mdx index e64441a8..58e39b5f 100644 --- a/docs/tutorials/deploy-to-local-network.mdx +++ b/docs/tutorials/deploy-to-local-network.mdx @@ -29,7 +29,7 @@ docker run --rm -it \ --platform linux/amd64 \ -p 8000:8000 \ --name stellar \ - stellar/quickstart:soroban-dev \ + stellar/quickstart:soroban-dev@sha256:0993d3350148af6ffeab5dc8f0b835236b28dade6dcae77ff8a09317162f768d \ --standalone \ --enable-soroban-rpc ``` From a2c8c1e264e7ff8ad984ac214c536894fe725104 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 2 Dec 2022 12:44:41 -0800 Subject: [PATCH 3/7] Add release notes (#234) --- docs/index.mdx | 2 +- docs/releases.mdx | 156 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 docs/releases.mdx diff --git a/docs/index.mdx b/docs/index.mdx index 2c7b365f..8e331af5 100644 --- a/docs/index.mdx +++ b/docs/index.mdx @@ -11,7 +11,7 @@ Soroban is a pre-release. Breaking changes may occur. While it works well with Stellar, a blockchain that shares its values of scale and sensibility, it doesn't depend on or require Stellar at all, and can be used by any transaction processor, including other blockchains, L2s, and permissioned ledgers. -Currently, Soroban is a preview release that includes initial versions of the smart contracts environment, a Rust SDK, A CLI, and an RPC server. Developers can write and test contracts on their local machine or deploy them to a special test network dubbed FutureNet. +Currently, Soroban is a preview release that includes initial versions of the smart contracts environment, a Rust SDK, A CLI, and an RPC server. Developers can write and test contracts on their local machine or deploy them to a special test network dubbed Futurenet. ## What "preview release" means We’re releasing this very early version of Soroban because we believe it’s important to share the development process, and we want Stellar ecosystem developers and smart contract developers from other ecosystems to have a chance to experiment and provide feedback. diff --git a/docs/releases.mdx b/docs/releases.mdx new file mode 100644 index 00000000..bbdea132 --- /dev/null +++ b/docs/releases.mdx @@ -0,0 +1,156 @@ +--- +sidebar_position: 1 +title: Preview Releases +--- + +The following Soroban releases are preview releases. + +We’re releasing early versions of Soroban because we believe it’s important to +share the development process, and we want Stellar ecosystem developers and +smart contract developers from other ecosystems to have a chance to experiment +and provide feedback. + +:::caution +Preview releases are software releases that are also released to the [Futurenet] +test network. Software releases may occur between Futurenet releases. If you're +interacting with Futurenet the recommended software versions to use in +development are below. Releases to Futurenet may include network resets and +network passphrase changes. +::: + +[Futurenet]: networks/futurenet + +## Preview 5 (December 6th, 2022) + +### Software + +| Software | Version | +| -------- | ------- | +| XDR | https://github.com/stellar/stellar-xdr/tree/026c9cd074bdb28ddde8ee52f2a4502d9e518a09 | +| Soroban Environment | `v0.0.10` | +| Stellar Core | `stellar-core_19.5.1-1137.b3a6bc281.focal~soroban` | +| Soroban Rust SDK | `` | +| Soroban CLI | `` | +| Soroban RPC | `` | +| Stellar Horizon | `stellar-horizon:2.22.0~soroban-318` | +| Stellar Quickstart | `stellar/quickstart:soroban-dev@sha256:...` | +| Futurenet Network Passphrase | `Test SDF Future Network ; October 2022` | + +### Changelog + +#### XDR + +* ... + +#### Soroban Environment + +* ... + +See https://github.com/stellar/rs-soroban-env/releases v... for more details. + +#### Soroban Rust SDK + +* ... + +See https://github.com/stellar/rs-soroban-sdk/releases v... for more details. + +#### Soroban RPC + +* ... + +See https://github.com/stellar/soroban-tools/releases v... for more details. + +#### Soroban CLI + +* ... + +See https://github.com/stellar/soroban-tools/releases v... for more details. + +## Preview 4 (November 15th, 2022) + +### Software + +| Software | Version | +| -------- | ------- | +| XDR | https://github.com/stellar/stellar-xdr-next/tree/48d5e17ae63bba0aa9725cd9d18d7438f44c07b1 | +| Soroban Environment | `v0.0.9` | +| Stellar Core | `19.5.1-1111.eba1d3de9.focal~soroban` | +| Soroban Rust SDK | `v0.2.1` | +| Soroban CLI | `v0.2.1` | +| Soroban RPC | ??? | +| Stellar Horizon | `2.22.0~soroban-304` | +| Stellar Quickstart | `stellar/quickstart:soroban-dev@sha256:0993d3350148af6ffeab5dc8f0b835236b28dade6dcae77ff8a09317162f768d` | +| Futurenet Network Passphrase | `Test SDF Future Network ; October 2022` | + +### Changelog + +#### XDR + +* Trivial whitespace changes + +#### Soroban Environment + +* Vm tuning +* Add token events +* Catch panics from native contracts in try_call +* Improved built-in token error reporting +* Add missing conversion from Status->ScStatus for the ContractError variant +* Capture user panic-strings in native builds, avoid spurious NoContractRunning error +* Few small fixes to error debug events + +See https://github.com/stellar/rs-soroban-env/releases v0.0.7, v0.0.8, v0.0.9 for more details. + +#### Soroban Rust SDK + +* Add Logger::print in testutils +* Add conversion from Address to Identifier +* Remove deprecated functions +* Remove panic-catching and fix tests that use newly-working native try_call +* Reintroduce an optimized aborting unwrap +* Add assert_with_error! macro +* Rename panic_error! to panic_with_error! + +See https://github.com/stellar/rs-soroban-sdk/releases v0.2.0, v0.2.1 for more details. + +#### Soroban RPC + +* Initial Release + +#### Soroban CLI + +* Strings and symbols are rendered as text in JSON output +* Bytes are rendered as hex in JSON output +* Accounts in invocations are created in sandbox +* Add optimize sub-command that optimizes contracts +* Fix the bin name in the completion command +* Fix jsonrpc compliance issue + +See https://github.com/stellar/soroban-cli/releases v0.2.0, v0.2.1 for more details. + +## Preview 3 (October 11th, 2022) + +### Software + +| Software | Version | +| -------- | ------- | +| XDR | https://github.com/stellar/stellar-xdr-next/tree/161e2e5b64425a49f9ccfef7f732ae742ed5eec4 | +| Soroban Environment | `v0.0.6` | +| Stellar Core | `19.4.1-1097.4e813f20e.focal~soroban` | +| Soroban Rust SDK | `v0.1.1` | +| Soroban CLI | `v0.1.2` | +| Soroban RPC | ??? | +| Stellar Horizon | `2.22.0~soroban-304` | +| Stellar Quickstart | `stellar/quickstart:soroban-dev@sha256:e58d83f92a61f43406087f488dd1cba110a92646dca85f14b3a416163609e853` | +| Futurenet Network Passphrase | `Test SDF Future Network ; October 2022` | + +### Changelog + +See https://www.stellar.org/blog/soroban-a-new-smart-contract-standard. + +## Preview 2 (September 13th, 2022) + +See https://www.stellar.org/developers-blog/soroban-preview-release-2. + +## Preview 1 (August 1st, 2022) + +See https://www.stellar.org/blog/project-jump-cannon-soroban-preview-release. From 9704c8c10619fca96aad13abba762d1298f91488 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 2 Dec 2022 14:08:48 -0800 Subject: [PATCH 4/7] Rename and move releases page --- docs/releases.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/releases.mdx b/docs/releases.mdx index bbdea132..599a24b4 100644 --- a/docs/releases.mdx +++ b/docs/releases.mdx @@ -1,6 +1,6 @@ --- -sidebar_position: 1 -title: Preview Releases +sidebar_position: 7 +title: Releases --- The following Soroban releases are preview releases. From 2135f2c4bfcdb1cc139adc524a5e80d988e15680 Mon Sep 17 00:00:00 2001 From: Tyler van der Hoeven Date: Fri, 2 Dec 2022 17:33:33 -0500 Subject: [PATCH 5/7] reorder EVERYTHING --- docs/built-in-contracts/_category_.json | 2 +- docs/command-line-reference/_category_.json | 2 +- docs/common-interfaces/_category_.json | 2 +- docs/examples/_category_.json | 2 +- docs/faq.mdx | 2 +- docs/getting-started/_category_.json | 2 +- docs/host-functions-reference/_category_.json | 2 +- docs/intro/_category_.json | 2 +- docs/learn/_category_.json | 2 +- docs/migrating-from-evm/_category_.json | 2 +- docs/networks/_category_.json | 2 +- docs/releases.mdx | 2 +- docs/sdks/_category_.json | 2 +- docs/tutorials/_category_.json | 2 +- docs/under-the-hood/_category_.json | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/built-in-contracts/_category_.json b/docs/built-in-contracts/_category_.json index 237ecb3c..1d9bee99 100644 --- a/docs/built-in-contracts/_category_.json +++ b/docs/built-in-contracts/_category_.json @@ -1,5 +1,5 @@ { - "position": 6, + "position": 70, "label": "Built-in Contracts", "link": { "type": "generated-index" diff --git a/docs/command-line-reference/_category_.json b/docs/command-line-reference/_category_.json index f2ed2849..f133e26a 100644 --- a/docs/command-line-reference/_category_.json +++ b/docs/command-line-reference/_category_.json @@ -1,5 +1,5 @@ { - "position": 6, + "position": 0, "label": "Command-line Reference", "link": { "type": "generated-index" diff --git a/docs/common-interfaces/_category_.json b/docs/common-interfaces/_category_.json index e9f771e9..624b72f2 100644 --- a/docs/common-interfaces/_category_.json +++ b/docs/common-interfaces/_category_.json @@ -1,5 +1,5 @@ { - "position": 5, + "position": 60, "label": "Common Interfaces", "link": { "type": "generated-index" diff --git a/docs/examples/_category_.json b/docs/examples/_category_.json index ac641369..f2141bc8 100644 --- a/docs/examples/_category_.json +++ b/docs/examples/_category_.json @@ -1,5 +1,5 @@ { - "position": 3, + "position": 40, "label": "Examples", "link": { "type": "generated-index" diff --git a/docs/faq.mdx b/docs/faq.mdx index 50ed934b..34fca461 100644 --- a/docs/faq.mdx +++ b/docs/faq.mdx @@ -1,5 +1,5 @@ --- -sidebar_position: 9 +sidebar_position: 100 title: Soroban on Stellar FAQ --- diff --git a/docs/getting-started/_category_.json b/docs/getting-started/_category_.json index 97808849..6871e3ab 100644 --- a/docs/getting-started/_category_.json +++ b/docs/getting-started/_category_.json @@ -1,5 +1,5 @@ { - "position": 2, + "position": 10, "label": "Getting Started", "link": { "type": "generated-index" diff --git a/docs/host-functions-reference/_category_.json b/docs/host-functions-reference/_category_.json index c661f57d..dcd21d4f 100644 --- a/docs/host-functions-reference/_category_.json +++ b/docs/host-functions-reference/_category_.json @@ -1,5 +1,5 @@ { - "position": 5, + "position": 0, "label": "Host Functions Reference", "link": { "type": "generated-index" diff --git a/docs/intro/_category_.json b/docs/intro/_category_.json index 185ac8ba..88e3c9ae 100644 --- a/docs/intro/_category_.json +++ b/docs/intro/_category_.json @@ -1,5 +1,5 @@ { - "position": 1, + "position": 0, "label": "Intro", "link": { "type": "generated-index" diff --git a/docs/learn/_category_.json b/docs/learn/_category_.json index 30248eb3..cef97d07 100644 --- a/docs/learn/_category_.json +++ b/docs/learn/_category_.json @@ -1,5 +1,5 @@ { - "position": 8, + "position": 20, "label": "Learn", "link": { "type": "generated-index" diff --git a/docs/migrating-from-evm/_category_.json b/docs/migrating-from-evm/_category_.json index 0624889d..031b40cc 100644 --- a/docs/migrating-from-evm/_category_.json +++ b/docs/migrating-from-evm/_category_.json @@ -1,5 +1,5 @@ { - "position": 7, + "position": 0, "label": "Migrating from EVM", "link": { "type": "generated-index" diff --git a/docs/networks/_category_.json b/docs/networks/_category_.json index 9210514c..90d2495d 100644 --- a/docs/networks/_category_.json +++ b/docs/networks/_category_.json @@ -1,5 +1,5 @@ { - "position": 7, + "position": 80, "label": "Networks", "link": { "type": "generated-index" diff --git a/docs/releases.mdx b/docs/releases.mdx index 599a24b4..bb031187 100644 --- a/docs/releases.mdx +++ b/docs/releases.mdx @@ -1,5 +1,5 @@ --- -sidebar_position: 7 +sidebar_position: 90 title: Releases --- diff --git a/docs/sdks/_category_.json b/docs/sdks/_category_.json index 035242e0..c6416378 100644 --- a/docs/sdks/_category_.json +++ b/docs/sdks/_category_.json @@ -1,5 +1,5 @@ { - "position": 4, + "position": 50, "label": "SDKs", "link": { "type": "generated-index" diff --git a/docs/tutorials/_category_.json b/docs/tutorials/_category_.json index 8d772d39..74f2f140 100644 --- a/docs/tutorials/_category_.json +++ b/docs/tutorials/_category_.json @@ -1,5 +1,5 @@ { - "position": 2, + "position": 30, "label": "Tutorials", "link": { "type": "generated-index" diff --git a/docs/under-the-hood/_category_.json b/docs/under-the-hood/_category_.json index 92cfa622..320a4f38 100644 --- a/docs/under-the-hood/_category_.json +++ b/docs/under-the-hood/_category_.json @@ -1,5 +1,5 @@ { - "position": 6, + "position": 60, "label": "Under the Hood", "link": { "type": "generated-index" From 475f4b8859a50f890ff8bde0cbc9ad6543fbdd4c Mon Sep 17 00:00:00 2001 From: Tyler van der Hoeven Date: Fri, 2 Dec 2022 20:02:35 -0500 Subject: [PATCH 6/7] reorder Learn between Examples and SDKs --- docs/learn/_category_.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/learn/_category_.json b/docs/learn/_category_.json index cef97d07..8d367a71 100644 --- a/docs/learn/_category_.json +++ b/docs/learn/_category_.json @@ -1,5 +1,5 @@ { - "position": 20, + "position": 45, "label": "Learn", "link": { "type": "generated-index" From e556c09c7d2d68f5ce35387183529c908c1c16d2 Mon Sep 17 00:00:00 2001 From: Tyler van der Hoeven Date: Wed, 7 Dec 2022 11:11:23 -0500 Subject: [PATCH 7/7] update wallet position --- docs/wallets/_category_.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/wallets/_category_.json b/docs/wallets/_category_.json index 1ed0aed9..f1421508 100644 --- a/docs/wallets/_category_.json +++ b/docs/wallets/_category_.json @@ -1,5 +1,5 @@ { - "position": 8, + "position": 85, "label": "Wallets", "link": { "type": "generated-index"