diff --git a/docs/build/guides/conventions/deploy-contract.mdx b/docs/build/guides/conventions/deploy-contract.mdx index 9371ae1cf..1881143b0 100644 --- a/docs/build/guides/conventions/deploy-contract.mdx +++ b/docs/build/guides/conventions/deploy-contract.mdx @@ -30,7 +30,7 @@ This guide walks through the process of deploying a smart contract from installe ### Setup environment -The [deployer example](https://github.com/stellar/soroban-examples/tree/v21.4.1/deployer) demonstrates how to deploy contracts using a contract. +The [deployer example](https://github.com/stellar/soroban-examples/tree/v21.6.0/deployer) demonstrates how to deploy contracts using a contract. 1. Clone the Soroban Examples Repository: diff --git a/docs/build/guides/conventions/upgrading-contracts.mdx b/docs/build/guides/conventions/upgrading-contracts.mdx index d9369c8c5..baa8a770e 100644 --- a/docs/build/guides/conventions/upgrading-contracts.mdx +++ b/docs/build/guides/conventions/upgrading-contracts.mdx @@ -32,8 +32,8 @@ The [upgradeable contract example] demonstrates how to upgrade a Wasm contract. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 -[upgradeable contract example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/upgradeable_contract +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 +[upgradeable contract example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/upgradeable_contract [Rust programming language]: https://www.rust-lang.org/ ### Code diff --git a/docs/build/guides/conventions/wasm-metadata.mdx b/docs/build/guides/conventions/wasm-metadata.mdx index e2a23fc38..191dbb803 100644 --- a/docs/build/guides/conventions/wasm-metadata.mdx +++ b/docs/build/guides/conventions/wasm-metadata.mdx @@ -29,4 +29,4 @@ pub trait LiquidityPoolTrait {... ``` [`contractmeta!`]: https://docs.rs/soroban-sdk/20.0.2/soroban_sdk/macro.contractmeta.html -[liquidity pool example]: https://github.com/stellar/soroban-examples/blob/v21.4.1/liquidity_pool/src/lib.rs#L152-L155 +[liquidity pool example]: https://github.com/stellar/soroban-examples/blob/v21.6.0/liquidity_pool/src/lib.rs#L152-L155 diff --git a/docs/build/guides/tokens/stellar-asset-contract.mdx b/docs/build/guides/tokens/stellar-asset-contract.mdx index cad4cea73..9007f6c7b 100644 --- a/docs/build/guides/tokens/stellar-asset-contract.mdx +++ b/docs/build/guides/tokens/stellar-asset-contract.mdx @@ -57,7 +57,7 @@ client.mint(...); ## Testing -Soroban Rust SDK provides an easy way to instantiate a Stellar Asset Contract tokens using `register_stellar_asset_contract`. This function can be seen as the deployment of a generic token. In the following example, we are following the best practices outlined in the [Issuing and Distribution Accounts section](../../../tokens/control-asset-access.mdx#issuing-and-distribution-accounts): +Soroban Rust SDK provides an easy way to instantiate a Stellar Asset Contract tokens using `register_stellar_asset_contract_v2`. This function can be seen as the deployment of a generic token. It also allows you to manipulate flags on the issuer account like `AUTH_REVOCABLE` and `AUTH_REQUIRED`. In the following example, we are following the best practices outlined in the [Issuing and Distribution Accounts section](../../../tokens/control-asset-access.mdx#issuing-and-distribution-accounts): ```rust #![cfg(test)] @@ -74,7 +74,8 @@ fn test() { let issuer = Address::generate(&e); let distributor = Address::generate(&e); - let token_address = e.register_stellar_asset_contract(issuer.clone()); + let sac = e.register_stellar_asset_contract_v2(issuer.clone()); + let token_address = sac.address(); // client for SEP-41 functions let token = TokenClient::new(&e, &token_address); @@ -89,6 +90,10 @@ fn test() { token_sac.mint(&distributor, &genesis_amount); assert_eq!(token.balance(&distributor), genesis_amount); + + // Make issuer AuthRequired and AuthRevocable + sac.issuer().set_flag(IssuerFlags::RevocableFlag); + sac.issuer().set_flag(IssuerFlags::RequiredFlag); } ``` diff --git a/docs/build/smart-contracts/example-contracts/TEMPLATE.mdx b/docs/build/smart-contracts/example-contracts/TEMPLATE.mdx index 0eb1084b8..55cda0312 100644 --- a/docs/build/smart-contracts/example-contracts/TEMPLATE.mdx +++ b/docs/build/smart-contracts/example-contracts/TEMPLATE.mdx @@ -19,16 +19,16 @@ Place each link definition at the bottom of the section it first is used in. ::: -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 -[example demonstrates]: https://github.com/stellar/soroban-examples/tree/v21.4.1/hello_world +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 +[example demonstrates]: https://github.com/stellar/soroban-examples/tree/v21.6.0/hello_world [other example]: ../getting-started/setup.mdx ## Run the Example -First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository: +First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository: ```sh -git clone -b v21.4.1 https://github.com/stellar/soroban-examples +git clone -b v21.6.0 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -67,7 +67,7 @@ impl HelloContract { mod test; ``` -Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/hello_world +Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/hello_world ## How it Works diff --git a/docs/build/smart-contracts/example-contracts/alloc.mdx b/docs/build/smart-contracts/example-contracts/alloc.mdx index dd41f45ec..3784a237e 100644 --- a/docs/build/smart-contracts/example-contracts/alloc.mdx +++ b/docs/build/smart-contracts/example-contracts/alloc.mdx @@ -23,19 +23,19 @@ The [allocator example] demonstrates how to utilize the allocator feature when w [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[allocator example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/alloc -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 +[allocator example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/alloc +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 The `soroban-sdk` crate provides a lightweight bump-pointer allocator which can be used to emulate heap memory allocation in a Wasm smart contract. ## Run the Example -First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository: +First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository: [setup]: ../getting-started/setup.mdx ``` -git clone -b v21.4.1 https://github.com/stellar/soroban-examples +git clone -b v21.6.0 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -94,7 +94,7 @@ impl AllocContract { } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/alloc +Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/alloc ## How it Works diff --git a/docs/build/smart-contracts/example-contracts/atomic-multi-swap.mdx b/docs/build/smart-contracts/example-contracts/atomic-multi-swap.mdx index 0efdfe4e2..5729487a3 100644 --- a/docs/build/smart-contracts/example-contracts/atomic-multi-swap.mdx +++ b/docs/build/smart-contracts/example-contracts/atomic-multi-swap.mdx @@ -25,6 +25,6 @@ Follow the comments in the code for more information. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 [atomic swap]: atomic-swap.mdx -[atomic swap batching example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/atomic_multiswap +[atomic swap batching example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/atomic_multiswap diff --git a/docs/build/smart-contracts/example-contracts/atomic-swap.mdx b/docs/build/smart-contracts/example-contracts/atomic-swap.mdx index ed1c365f2..78adef05a 100644 --- a/docs/build/smart-contracts/example-contracts/atomic-swap.mdx +++ b/docs/build/smart-contracts/example-contracts/atomic-swap.mdx @@ -23,17 +23,17 @@ This is example demonstrates advanced usage of Soroban auth framework and assume [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 -[atomic swap example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/atomic_swap +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 +[atomic swap example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/atomic_swap ## Run the Example -First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository: +First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository: [setup]: ../getting-started/setup.mdx ``` -git clone -b v21.4.1 https://github.com/stellar/soroban-examples +git clone -b v21.6.0 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -123,7 +123,7 @@ fn move_token( } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/atomic_swap +Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/atomic_swap ## How it Works @@ -186,7 +186,7 @@ The swap itself is implemented via two token moves: from `a` to `b` and from `b` Open the [`atomic_swap/src/test.rs`] file to follow along. -[`atomic_swap/src/test.rs`]: https://github.com/stellar/soroban-examples/tree/v21.4.1/atomic_swap/src/test.rs +[`atomic_swap/src/test.rs`]: https://github.com/stellar/soroban-examples/tree/v21.6.0/atomic_swap/src/test.rs Refer to another examples for the general information on the test setup. diff --git a/docs/build/smart-contracts/example-contracts/auth.mdx b/docs/build/smart-contracts/example-contracts/auth.mdx index 01e5174c7..4042b5e7a 100644 --- a/docs/build/smart-contracts/example-contracts/auth.mdx +++ b/docs/build/smart-contracts/example-contracts/auth.mdx @@ -27,18 +27,18 @@ 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/v21.4.1 +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 [storing data example]: ../getting-started/storing-data.mdx -[auth example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/auth +[auth example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/auth ## Run the Example -First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository: +First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository: [setup]: ../getting-started/setup.mdx ``` -git clone -b v21.4.1 https://github.com/stellar/soroban-examples +git clone -b v21.6.0 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -110,7 +110,7 @@ impl IncrementContract { } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/auth +Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/auth ## How it Works @@ -166,7 +166,7 @@ user.require_auth_for_args((value,).into_val(&env)); Open the [`auth/src/test.rs`] file to follow along. -[`auth/src/test.rs`]: https://github.com/stellar/soroban-examples/tree/v21.4.1/auth/src/test.rs +[`auth/src/test.rs`]: https://github.com/stellar/soroban-examples/tree/v21.6.0/auth/src/test.rs ```rust title="auth/src/test.rs" fn test() { diff --git a/docs/build/smart-contracts/example-contracts/cross-contract-call.mdx b/docs/build/smart-contracts/example-contracts/cross-contract-call.mdx index b2c7a6a9d..81f274274 100644 --- a/docs/build/smart-contracts/example-contracts/cross-contract-call.mdx +++ b/docs/build/smart-contracts/example-contracts/cross-contract-call.mdx @@ -31,17 +31,17 @@ In this example there are two contracts that are compiled separately, deployed s ::: -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 -[cross contract call example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/cross_contract +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 +[cross contract call example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/cross_contract ## Run the Example -First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository: +First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository: [setup]: ../getting-started/setup.mdx ``` -git clone -b v21.4.1 https://github.com/stellar/soroban-examples +git clone -b v21.6.0 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -93,7 +93,7 @@ impl ContractB { } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/cross_contract +Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/cross_contract ## How it Works diff --git a/docs/build/smart-contracts/example-contracts/custom-account.mdx b/docs/build/smart-contracts/example-contracts/custom-account.mdx index 992cf9beb..a4aa2b7e5 100644 --- a/docs/build/smart-contracts/example-contracts/custom-account.mdx +++ b/docs/build/smart-contracts/example-contracts/custom-account.mdx @@ -38,17 +38,17 @@ While custom accounts are supported by the Stellar protocol and Soroban SDK, the [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 -[custom account example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/account +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 +[custom account example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/account ## Run the Example -First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository: +First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository: [setup]: ../getting-started/setup.mdx ``` -git clone -b v21.4.1 https://github.com/stellar/soroban-examples +git clone -b v21.6.0 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -278,7 +278,7 @@ Then we check for the standard token function names and verify that for these fu Open the [`account/src/test.rs`] file to follow along. -[`account/src/test.rs`]: https://github.com/stellar/soroban-examples/tree/v21.4.1/account/src/test.rs +[`account/src/test.rs`]: https://github.com/stellar/soroban-examples/tree/v21.6.0/account/src/test.rs Refer to another examples for the general information on the test setup. diff --git a/docs/build/smart-contracts/example-contracts/custom-types.mdx b/docs/build/smart-contracts/example-contracts/custom-types.mdx index 021ee319a..aa485af99 100644 --- a/docs/build/smart-contracts/example-contracts/custom-types.mdx +++ b/docs/build/smart-contracts/example-contracts/custom-types.mdx @@ -25,18 +25,18 @@ The [custom types example] demonstrates how to define your own data structures t [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 -[custom types example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/custom_types +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 +[custom types example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/custom_types [storing data example]: ../getting-started/storing-data.mdx ## Run the Example -First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository: +First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository: [setup]: ../getting-started/setup.mdx ``` -git clone -b v21.4.1 https://github.com/stellar/soroban-examples +git clone -b v21.6.0 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -97,7 +97,7 @@ impl IncrementContract { } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/custom_types +Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/custom_types ## How it Works diff --git a/docs/build/smart-contracts/example-contracts/deployer.mdx b/docs/build/smart-contracts/example-contracts/deployer.mdx index 8f62d5fe9..3044067da 100644 --- a/docs/build/smart-contracts/example-contracts/deployer.mdx +++ b/docs/build/smart-contracts/example-contracts/deployer.mdx @@ -35,17 +35,17 @@ In this example there are two contracts that are compiled separately, and the te ::: -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 -[deployer example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/deployer +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 +[deployer example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/deployer ## Run the Example -First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository: +First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository: [setup]: ../getting-started/setup.mdx ``` -git clone -b v21.4.1 https://github.com/stellar/soroban-examples +git clone -b v21.6.0 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -108,7 +108,7 @@ impl Deployer { } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/deployer +Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/deployer ## How it Works diff --git a/docs/build/smart-contracts/example-contracts/errors.mdx b/docs/build/smart-contracts/example-contracts/errors.mdx index 2b29d047f..234a34c44 100644 --- a/docs/build/smart-contracts/example-contracts/errors.mdx +++ b/docs/build/smart-contracts/example-contracts/errors.mdx @@ -25,18 +25,18 @@ The [errors example] demonstrates how to define and generate errors in a contrac [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 -[errors example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/errors +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 +[errors example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/errors [storing data example]: ../getting-started/storing-data.mdx ## Run the Example -First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository: +First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository: [setup]: ../getting-started/setup.mdx ``` -git clone -b v21.4.1 https://github.com/stellar/soroban-examples +git clone -b v21.6.0 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -120,7 +120,7 @@ impl IncrementContract { } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/errors +Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/errors ## How it Works diff --git a/docs/build/smart-contracts/example-contracts/events.mdx b/docs/build/smart-contracts/example-contracts/events.mdx index 2ed9d3e15..66467052c 100644 --- a/docs/build/smart-contracts/example-contracts/events.mdx +++ b/docs/build/smart-contracts/example-contracts/events.mdx @@ -22,18 +22,18 @@ The [events example] demonstrates how to publish events from a contract. This ex [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 -[events example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/events +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 +[events example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/events [storing data example]: ../getting-started/storing-data.mdx ## Run the Example -First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository: +First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository: [setup]: ../getting-started/setup.mdx ``` -git clone -b v21.4.1 https://github.com/stellar/soroban-examples +git clone -b v21.6.0 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -87,7 +87,7 @@ impl IncrementContract { } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/events +Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/events ## How it Works diff --git a/docs/build/smart-contracts/example-contracts/fuzzing.mdx b/docs/build/smart-contracts/example-contracts/fuzzing.mdx index 7ea33f920..f927325c4 100644 --- a/docs/build/smart-contracts/example-contracts/fuzzing.mdx +++ b/docs/build/smart-contracts/example-contracts/fuzzing.mdx @@ -23,22 +23,22 @@ The [fuzzing example] demonstrates how to fuzz test Soroban contracts with [`car [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 -[fuzzing example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/fuzzing +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 +[fuzzing example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/fuzzing [`cargo-fuzz`]: https://docs.rs/cargo-fuzz [`arbitrary`]: https://docs.rs/arbitrary [`proptest`]: https://docs.rs/proptest [`proptest-arbitrary-interop`]: https://docs.rs/proptest-arbitrary-interop -[timelock example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/timelock +[timelock example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/timelock ## Run the Example -First go through the [setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository: +First go through the [setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository: [setup]: ../getting-started/setup.mdx ```sh -git clone -b v21.4.1 https://github.com/stellar/soroban-examples +git clone -b v21.6.0 https://github.com/stellar/soroban-examples ``` You will also need the `cargo-fuzz` tool, and to run `cargo-fuzz` you will need a nightly Rust toolchain: @@ -112,7 +112,7 @@ In Rust, multiple fuzzers are maintained by the [`rust-fuzz`] GitHub organizatio The example used for this tutorial is based on the [`timelock`] example program, with some changes to demonstrate fuzzing. -[`timelock`]: https://github.com/stellar/soroban-examples/tree/v21.4.1/timelock +[`timelock`]: https://github.com/stellar/soroban-examples/tree/v21.6.0/timelock The contract, `ClaimableBalanceContract`, allows one party to deposit an arbitrary quantity of a token to the contract, specifying additionally: the `claimants`, addresses that may withdraw from the contract; and the `time_bound`, a specification of when those claimants may withdraw from the account. @@ -182,8 +182,8 @@ Our `soroban-examples/fuzzing` directory looks like There are special considerations to note in the configuration of both the [contract's manifest] and the [fuzzing crate's manifest]. -[contract's manifest]: https://github.com/stellar/soroban-examples/tree/v21.4.1/fuzzing/Cargo.toml -[fuzzing crate's manifest]: https://github.com/stellar/soroban-examples/tree/v21.4.1/fuzzing/fuzz/Cargo.toml +[contract's manifest]: https://github.com/stellar/soroban-examples/tree/v21.6.0/fuzzing/Cargo.toml +[fuzzing crate's manifest]: https://github.com/stellar/soroban-examples/tree/v21.6.0/fuzzing/fuzz/Cargo.toml Within the contract's manifest one must specificy the crate type as both "cdylib" and "rlib": @@ -243,7 +243,7 @@ features = ["testutils"] First let's look at [`fuzz_target_1.rs`]. This fuzz test does two things: it first deposits an arbitrary amount, then it claims an arbitrary amount. -[`fuzz_target_1.rs`]: https://github.com/stellar/soroban-examples/tree/v21.4.1/fuzzing/fuzz/fuzz_targets/fuzz_target_1.rs +[`fuzz_target_1.rs`]: https://github.com/stellar/soroban-examples/tree/v21.6.0/fuzzing/fuzz/fuzz_targets/fuzz_target_1.rs Again, you can run this fuzzer from the `soroban-examples/fuzzing` directory with the following command: @@ -662,7 +662,7 @@ All user-defined contract types, those with the [`contracttype`] attribute, auto The [`fuzz_target_2.rs`] example, demonstrates the use of `SorobanArbitrary`, the advancement of time, and more advanced fuzzing techniques. -[`fuzz_target_2.rs`]: https://github.com/stellar/soroban-examples/tree/v21.4.1/fuzzing/fuzz/fuzz_targets/fuzz_target_2.rs +[`fuzz_target_2.rs`]: https://github.com/stellar/soroban-examples/tree/v21.6.0/fuzzing/fuzz/fuzz_targets/fuzz_target_2.rs This fuzz test takes a much more complex input, where some of the values are user-defined types exported from the contract under test. This test is structured as a simple interpreter, where the fuzzing harness provides arbitrarily-generated "steps", where each step is either a `deposit` command or a `claim` command. The test then treats each of these steps as a separate transaction: it maintains a snapshot of the blockchain state, and for each step creates a fresh environment in which to execute the contract call, simulating the advancement of time between each step. As in the previous example, assertions are made after each step. @@ -795,4 +795,4 @@ The great benefit of property tests though is that they can be included in stand The [`proptest.rs`] file is a translation of `fuzz_target_1.rs` to a property test. -[`proptest.rs`]: https://github.com/stellar/soroban-examples/tree/v21.4.1/fuzzing/src/proptest.rs +[`proptest.rs`]: https://github.com/stellar/soroban-examples/tree/v21.6.0/fuzzing/src/proptest.rs diff --git a/docs/build/smart-contracts/example-contracts/liquidity-pool.mdx b/docs/build/smart-contracts/example-contracts/liquidity-pool.mdx index 144b8b3ea..0671ac727 100644 --- a/docs/build/smart-contracts/example-contracts/liquidity-pool.mdx +++ b/docs/build/smart-contracts/example-contracts/liquidity-pool.mdx @@ -35,16 +35,16 @@ The Stellar network already has liquidity pool functionality built right in to t [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 -[liquidity pool example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/liquidity_pool -[source code]: https://github.com/stellar/soroban-examples/blob/v21.4.1/liquidity_pool/src/lib.rs#L143 +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 +[liquidity pool example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/liquidity_pool +[source code]: https://github.com/stellar/soroban-examples/blob/v21.6.0/liquidity_pool/src/lib.rs#L143 ## Run the Example -First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository: +First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository: ```sh -git clone -b v21.4.1 https://github.com/stellar/soroban-examples +git clone -b v21.6.0 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -467,7 +467,7 @@ pub fn create_contract( -Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/liquidity_pool +Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/liquidity_pool ## How it Works @@ -676,7 +676,7 @@ use soroban_sdk::{ }; fn create_token_contract<'a>(e: &Env, admin: &Address) -> token::Client<'a> { - token::Client::new(e, &e.register_stellar_asset_contract(admin.clone())) + token::Client::new(e, &e._register_stellar_asset_contract_v2(admin.clone()).address()) } fn create_liqpool_contract<'a>( @@ -829,7 +829,7 @@ fn test() { } ``` -[`liquidity_pool/src/test.rs`]: https://github.com/stellar/soroban-examples/blob/v21.4.1/liquidity_pool/src/test.rs +[`liquidity_pool/src/test.rs`]: https://github.com/stellar/soroban-examples/blob/v21.6.0/liquidity_pool/src/test.rs In any test the first thing that is always required is an `Env`, which is the Soroban environment that the contract will run in. @@ -847,7 +847,7 @@ We have abstracted into a few functions the tasks of creating token contracts, d ```rust title=liquidity_pool/src/test.rs fn create_token_contract<'a>(e: &Env, admin: &Address) -> token::Client<'a> { - token::Client::new(e, &e.register_stellar_asset_contract(admin.clone())) + token::Client::new(e, &e.register_stellar_asset_contract_v2(admin.clone()).address()) } fn create_liqpool_contract<'a>( diff --git a/docs/build/smart-contracts/example-contracts/logging.mdx b/docs/build/smart-contracts/example-contracts/logging.mdx index 71fe34524..adec66c2e 100644 --- a/docs/build/smart-contracts/example-contracts/logging.mdx +++ b/docs/build/smart-contracts/example-contracts/logging.mdx @@ -24,8 +24,8 @@ The [logging example] demonstrates how to log for the purpose of debugging. Logs in contracts are only visible in tests, or when executing contracts using [`stellar-cli`]. Logs are only compiled into the contract if the `debug-assertions` Rust compiler option is enabled. -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 -[logging example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/hello_world +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 +[logging example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/hello_world :::tip @@ -44,12 +44,12 @@ Logs are not accessible by dapps and other applications. See the [events example ## Run the Example -First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository: +First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository: [setup]: ../getting-started/setup.mdx ``` -git clone -b v21.4.1 https://github.com/stellar/soroban-examples +git clone -b v21.6.0 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -92,7 +92,7 @@ impl Contract { } ``` -Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/logging +Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/logging ## How it Works diff --git a/docs/build/smart-contracts/example-contracts/mint-lock.mdx b/docs/build/smart-contracts/example-contracts/mint-lock.mdx index 15b76af6f..486404cc6 100644 --- a/docs/build/smart-contracts/example-contracts/mint-lock.mdx +++ b/docs/build/smart-contracts/example-contracts/mint-lock.mdx @@ -23,5 +23,5 @@ The admin of the token contracts used must be the mint-lock contract. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 -[mint-lock example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/mint-lock +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 +[mint-lock example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/mint-lock diff --git a/docs/build/smart-contracts/example-contracts/single-offer-sale.mdx b/docs/build/smart-contracts/example-contracts/single-offer-sale.mdx index c9b53e44b..efa015208 100644 --- a/docs/build/smart-contracts/example-contracts/single-offer-sale.mdx +++ b/docs/build/smart-contracts/example-contracts/single-offer-sale.mdx @@ -23,6 +23,6 @@ The [single offer sale example] demonstrates how to write a contract that allows [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 -[single offer sale example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/single_offer -[source code]: https://github.com/stellar/soroban-examples/blob/v21.4.1/single_offer/src/lib.rs +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 +[single offer sale example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/single_offer +[source code]: https://github.com/stellar/soroban-examples/blob/v21.6.0/single_offer/src/lib.rs diff --git a/docs/build/smart-contracts/example-contracts/timelock.mdx b/docs/build/smart-contracts/example-contracts/timelock.mdx index 88a25a16e..bb5417748 100644 --- a/docs/build/smart-contracts/example-contracts/timelock.mdx +++ b/docs/build/smart-contracts/example-contracts/timelock.mdx @@ -25,6 +25,6 @@ The [timelock example] demonstrates how to write a timelock and implements a gre The contract accepts deposits of an amount of a token, and allows other users to claim it before or after a time point. -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 -[timelock example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/timelock +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 +[timelock example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/timelock [claimable balance]: ../../../learn/encyclopedia/transactions-specialized/claimable-balances.mdx diff --git a/docs/build/smart-contracts/example-contracts/tokens.mdx b/docs/build/smart-contracts/example-contracts/tokens.mdx index 28a0cb449..7eb1b8c61 100644 --- a/docs/build/smart-contracts/example-contracts/tokens.mdx +++ b/docs/build/smart-contracts/example-contracts/tokens.mdx @@ -25,16 +25,16 @@ The [token example] demonstrates how to write a token contract that implements t [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 -[token example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/token +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 +[token example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/token [token interface]: ../../../tokens/token-interface.mdx ## Run the Example -First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository: +First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository: ```sh -git clone -b v21.4.1 https://github.com/stellar/soroban-examples +git clone -b v21.6.0 https://github.com/stellar/soroban-examples ``` Or, skip the development environment setup and open this example in [Gitpod][oigp]. @@ -525,7 +525,7 @@ pub enum DataKey { -Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/token +Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/token ## How it Works diff --git a/docs/build/smart-contracts/getting-started/storing-data.mdx b/docs/build/smart-contracts/getting-started/storing-data.mdx index 00a308f45..fac668fbf 100644 --- a/docs/build/smart-contracts/getting-started/storing-data.mdx +++ b/docs/build/smart-contracts/getting-started/storing-data.mdx @@ -21,7 +21,7 @@ import TabItem from "@theme/TabItem"; Now that we've built a basic Hello World example contract, we'll write a simple contract that stores and retrieves data. This will help you see the basics of Soroban's storage system. -This is going to follow along with the [increment example](https://github.com/stellar/soroban-examples/tree/v21.4.1/increment), which has a single function that increments an internal counter and returns the value. If you want to see a working example, [try it in GitPod](https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1). +This is going to follow along with the [increment example](https://github.com/stellar/soroban-examples/tree/v21.6.0/increment), which has a single function that increments an internal counter and returns the value. If you want to see a working example, [try it in GitPod](https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0). This tutorial assumes that you've already completed the previous steps in Getting Started: [Setup](./setup.mdx), [Hello World](./hello-world.mdx), and [Deploy to Testnet](./deploy-to-testnet.mdx). diff --git a/docs/data/rpc/admin-guide.mdx b/docs/data/rpc/admin-guide.mdx index 8beda8a72..8f2e1c5a4 100644 --- a/docs/data/rpc/admin-guide.mdx +++ b/docs/data/rpc/admin-guide.mdx @@ -565,7 +565,7 @@ docker.io/stellar/system-test:soroban-preview11 \ --TargetNetworkPassphrase "Test SDF Network ; September 2015" \ --TargetNetworkTestAccountSecret \ --TargetNetworkTestAccountPublic \ ---SorobanExamplesGitHash v21.4.1 +--SorobanExamplesGitHash v21.6.0 ``` Make sure you configure the system test correctly: diff --git a/docs/learn/migrate/evm/introduction-to-solidity-and-rust.mdx b/docs/learn/migrate/evm/introduction-to-solidity-and-rust.mdx index ad462de7c..02b108c0c 100644 --- a/docs/learn/migrate/evm/introduction-to-solidity-and-rust.mdx +++ b/docs/learn/migrate/evm/introduction-to-solidity-and-rust.mdx @@ -30,7 +30,7 @@ Or if you want to jump right in, you can open up our examples in a ready to go d [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] -[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1 +[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0 # Summary diff --git a/docs/learn/migrate/evm/smart-contract-deployment.mdx b/docs/learn/migrate/evm/smart-contract-deployment.mdx index 9ee596304..eb9abf136 100644 --- a/docs/learn/migrate/evm/smart-contract-deployment.mdx +++ b/docs/learn/migrate/evm/smart-contract-deployment.mdx @@ -189,10 +189,10 @@ If you haven't already setup up the dev environment for Soroban, you can get sta This project requires using the `soroban_token_contract.wasm` file which you will need to import manually. -First, you will need to clone the `v21.4.1` tag of `soroban-examples` repository: +First, you will need to clone the `v21.6.0` tag of `soroban-examples` repository: ```bash -git clone -b v21.4.1 https://github.com/stellar/soroban-examples +git clone -b v21.6.0 https://github.com/stellar/soroban-examples ``` Then, navigate to the `soroban-examples/token` directory @@ -485,7 +485,7 @@ use soroban_sdk::{ }; fn create_token_contract<'a>(e: &Env, admin: &Address) -> token::Client<'a> { - token::Client::new(e, &e.register_stellar_asset_contract(admin.clone())) + token::Client::new(e, &e.register_stellar_asset_contract_v2(admin.clone()).address()) } fn create_vault_contract<'a>( diff --git a/src/pages/docs/learn/interactive/dapps/challenges/challenge-1-payment.mdx b/src/pages/docs/learn/interactive/dapps/challenges/challenge-1-payment.mdx index 43cb75716..6b4a574a9 100644 --- a/src/pages/docs/learn/interactive/dapps/challenges/challenge-1-payment.mdx +++ b/src/pages/docs/learn/interactive/dapps/challenges/challenge-1-payment.mdx @@ -61,7 +61,7 @@ yarn ## Checkpoint 2: 🎬 Deploy Smart Contracts -For this step you will need to clone and deploy the Soroban token smart contract from the [Soroban Examples repository](https://github.com/stellar/soroban-examples/tree/v21.4.1/token). This Soroban token smart contract, broken into several smaller modules (as is the custom for complex smart contracts like this one), enables you to create and manage tokens on Soroban. +For this step you will need to clone and deploy the Soroban token smart contract from the [Soroban Examples repository](https://github.com/stellar/soroban-examples/tree/v21.6.0/token). This Soroban token smart contract, broken into several smaller modules (as is the custom for complex smart contracts like this one), enables you to create and manage tokens on Soroban. The Soroban token is a custom token that will be used to facilitate payments in the Payment Dapp. Tokens are essentially programmable assets on a blockchain, and smart contracts provide the automation and rules for these tokens. They allow for predefined conditions and actions related to the tokens, such as issuance, transfer, and more complex functions, ensuring the execution of these operations without the need for intermediaries. In the case of this Payment Dapp, you will use the Soroban token to initialize and mint "Demo Token" assets, or DT, that you can then use to make payments via the Payment Dapp.