Skip to content

Commit 66a3832

Browse files
authoredAug 21, 2024
Bump sdk and use register_stellar_asset_contract_v2 (stellar#934)
* Update docs for register_stellar_asset_contract_v2 * Update sdk to 21.6.0
1 parent b4988c8 commit 66a3832

27 files changed

+109
-104
lines changed
 

‎docs/build/guides/conventions/deploy-contract.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This guide walks through the process of deploying a smart contract from installe
3030

3131
### Setup environment
3232

33-
The [deployer example](https://github.com/stellar/soroban-examples/tree/v21.4.1/deployer) demonstrates how to deploy contracts using a contract.
33+
The [deployer example](https://github.com/stellar/soroban-examples/tree/v21.6.0/deployer) demonstrates how to deploy contracts using a contract.
3434

3535
1. Clone the Soroban Examples Repository:
3636

‎docs/build/guides/conventions/upgrading-contracts.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ The [upgradeable contract example] demonstrates how to upgrade a Wasm contract.
3232

3333
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp]
3434

35-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
36-
[upgradeable contract example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/upgradeable_contract
35+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
36+
[upgradeable contract example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/upgradeable_contract
3737
[Rust programming language]: https://www.rust-lang.org/
3838

3939
### Code

‎docs/build/guides/conventions/wasm-metadata.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ pub trait LiquidityPoolTrait {...
2929
```
3030

3131
[`contractmeta!`]: https://docs.rs/soroban-sdk/20.0.2/soroban_sdk/macro.contractmeta.html
32-
[liquidity pool example]: https://github.com/stellar/soroban-examples/blob/v21.4.1/liquidity_pool/src/lib.rs#L152-L155
32+
[liquidity pool example]: https://github.com/stellar/soroban-examples/blob/v21.6.0/liquidity_pool/src/lib.rs#L152-L155

‎docs/build/guides/tokens/stellar-asset-contract.mdx

+7-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ client.mint(...);
5757

5858
## Testing
5959

60-
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):
60+
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):
6161

6262
```rust
6363
#![cfg(test)]
@@ -74,7 +74,8 @@ fn test() {
7474
let issuer = Address::generate(&e);
7575
let distributor = Address::generate(&e);
7676

77-
let token_address = e.register_stellar_asset_contract(issuer.clone());
77+
let sac = e.register_stellar_asset_contract_v2(issuer.clone());
78+
let token_address = sac.address();
7879

7980
// client for SEP-41 functions
8081
let token = TokenClient::new(&e, &token_address);
@@ -89,6 +90,10 @@ fn test() {
8990
token_sac.mint(&distributor, &genesis_amount);
9091

9192
assert_eq!(token.balance(&distributor), genesis_amount);
93+
94+
// Make issuer AuthRequired and AuthRevocable
95+
sac.issuer().set_flag(IssuerFlags::RevocableFlag);
96+
sac.issuer().set_flag(IssuerFlags::RequiredFlag);
9297
}
9398
```
9499

‎docs/build/smart-contracts/example-contracts/TEMPLATE.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ Place each link definition at the bottom of the section it first is used in.
1919

2020
:::
2121

22-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
23-
[example demonstrates]: https://github.com/stellar/soroban-examples/tree/v21.4.1/hello_world
22+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
23+
[example demonstrates]: https://github.com/stellar/soroban-examples/tree/v21.6.0/hello_world
2424
[other example]: ../getting-started/setup.mdx
2525

2626
## Run the Example
2727

28-
First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository:
28+
First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository:
2929

3030
```sh
31-
git clone -b v21.4.1 https://github.com/stellar/soroban-examples
31+
git clone -b v21.6.0 https://github.com/stellar/soroban-examples
3232
```
3333

3434
Or, skip the development environment setup and open this example in [Gitpod][oigp].
@@ -67,7 +67,7 @@ impl HelloContract {
6767
mod test;
6868
```
6969

70-
Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/hello_world
70+
Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/hello_world
7171

7272
## How it Works
7373

‎docs/build/smart-contracts/example-contracts/alloc.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ The [allocator example] demonstrates how to utilize the allocator feature when w
2323

2424
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp]
2525

26-
[allocator example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/alloc
27-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
26+
[allocator example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/alloc
27+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
2828

2929
The `soroban-sdk` crate provides a lightweight bump-pointer allocator which can be used to emulate heap memory allocation in a Wasm smart contract.
3030

3131
## Run the Example
3232

33-
First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository:
33+
First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository:
3434

3535
[setup]: ../getting-started/setup.mdx
3636

3737
```
38-
git clone -b v21.4.1 https://github.com/stellar/soroban-examples
38+
git clone -b v21.6.0 https://github.com/stellar/soroban-examples
3939
```
4040

4141
Or, skip the development environment setup and open this example in [Gitpod][oigp].
@@ -94,7 +94,7 @@ impl AllocContract {
9494
}
9595
```
9696

97-
Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/alloc
97+
Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/alloc
9898

9999
## How it Works
100100

‎docs/build/smart-contracts/example-contracts/atomic-multi-swap.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ Follow the comments in the code for more information.
2525

2626
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp]
2727

28-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
28+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
2929
[atomic swap]: atomic-swap.mdx
30-
[atomic swap batching example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/atomic_multiswap
30+
[atomic swap batching example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/atomic_multiswap

‎docs/build/smart-contracts/example-contracts/atomic-swap.mdx

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ This is example demonstrates advanced usage of Soroban auth framework and assume
2323

2424
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp]
2525

26-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
27-
[atomic swap example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/atomic_swap
26+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
27+
[atomic swap example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/atomic_swap
2828

2929
## Run the Example
3030

31-
First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository:
31+
First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository:
3232

3333
[setup]: ../getting-started/setup.mdx
3434

3535
```
36-
git clone -b v21.4.1 https://github.com/stellar/soroban-examples
36+
git clone -b v21.6.0 https://github.com/stellar/soroban-examples
3737
```
3838

3939
Or, skip the development environment setup and open this example in [Gitpod][oigp].
@@ -123,7 +123,7 @@ fn move_token(
123123
}
124124
```
125125

126-
Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/atomic_swap
126+
Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/atomic_swap
127127

128128
## How it Works
129129

@@ -186,7 +186,7 @@ The swap itself is implemented via two token moves: from `a` to `b` and from `b`
186186

187187
Open the [`atomic_swap/src/test.rs`] file to follow along.
188188

189-
[`atomic_swap/src/test.rs`]: https://github.com/stellar/soroban-examples/tree/v21.4.1/atomic_swap/src/test.rs
189+
[`atomic_swap/src/test.rs`]: https://github.com/stellar/soroban-examples/tree/v21.6.0/atomic_swap/src/test.rs
190190

191191
Refer to another examples for the general information on the test setup.
192192

‎docs/build/smart-contracts/example-contracts/auth.mdx

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ This example is an extension of the [storing data example].
2727

2828
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp]
2929

30-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
30+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
3131
[storing data example]: ../getting-started/storing-data.mdx
32-
[auth example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/auth
32+
[auth example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/auth
3333

3434
## Run the Example
3535

36-
First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository:
36+
First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository:
3737

3838
[setup]: ../getting-started/setup.mdx
3939

4040
```
41-
git clone -b v21.4.1 https://github.com/stellar/soroban-examples
41+
git clone -b v21.6.0 https://github.com/stellar/soroban-examples
4242
```
4343

4444
Or, skip the development environment setup and open this example in [Gitpod][oigp].
@@ -110,7 +110,7 @@ impl IncrementContract {
110110
}
111111
```
112112

113-
Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/auth
113+
Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/auth
114114

115115
## How it Works
116116

@@ -166,7 +166,7 @@ user.require_auth_for_args((value,).into_val(&env));
166166

167167
Open the [`auth/src/test.rs`] file to follow along.
168168

169-
[`auth/src/test.rs`]: https://github.com/stellar/soroban-examples/tree/v21.4.1/auth/src/test.rs
169+
[`auth/src/test.rs`]: https://github.com/stellar/soroban-examples/tree/v21.6.0/auth/src/test.rs
170170

171171
```rust title="auth/src/test.rs"
172172
fn test() {

‎docs/build/smart-contracts/example-contracts/cross-contract-call.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ In this example there are two contracts that are compiled separately, deployed s
3131

3232
:::
3333

34-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
35-
[cross contract call example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/cross_contract
34+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
35+
[cross contract call example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/cross_contract
3636

3737
## Run the Example
3838

39-
First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository:
39+
First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository:
4040

4141
[setup]: ../getting-started/setup.mdx
4242

4343
```
44-
git clone -b v21.4.1 https://github.com/stellar/soroban-examples
44+
git clone -b v21.6.0 https://github.com/stellar/soroban-examples
4545
```
4646

4747
Or, skip the development environment setup and open this example in [Gitpod][oigp].
@@ -93,7 +93,7 @@ impl ContractB {
9393
}
9494
```
9595

96-
Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/cross_contract
96+
Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/cross_contract
9797

9898
## How it Works
9999

‎docs/build/smart-contracts/example-contracts/custom-account.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ While custom accounts are supported by the Stellar protocol and Soroban SDK, the
3838

3939
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp]
4040

41-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
42-
[custom account example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/account
41+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
42+
[custom account example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/account
4343

4444
## Run the Example
4545

46-
First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository:
46+
First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository:
4747

4848
[setup]: ../getting-started/setup.mdx
4949

5050
```
51-
git clone -b v21.4.1 https://github.com/stellar/soroban-examples
51+
git clone -b v21.6.0 https://github.com/stellar/soroban-examples
5252
```
5353

5454
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
278278

279279
Open the [`account/src/test.rs`] file to follow along.
280280

281-
[`account/src/test.rs`]: https://github.com/stellar/soroban-examples/tree/v21.4.1/account/src/test.rs
281+
[`account/src/test.rs`]: https://github.com/stellar/soroban-examples/tree/v21.6.0/account/src/test.rs
282282

283283
Refer to another examples for the general information on the test setup.
284284

‎docs/build/smart-contracts/example-contracts/custom-types.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ The [custom types example] demonstrates how to define your own data structures t
2525

2626
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp]
2727

28-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
29-
[custom types example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/custom_types
28+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
29+
[custom types example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/custom_types
3030
[storing data example]: ../getting-started/storing-data.mdx
3131

3232
## Run the Example
3333

34-
First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository:
34+
First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository:
3535

3636
[setup]: ../getting-started/setup.mdx
3737

3838
```
39-
git clone -b v21.4.1 https://github.com/stellar/soroban-examples
39+
git clone -b v21.6.0 https://github.com/stellar/soroban-examples
4040
```
4141

4242
Or, skip the development environment setup and open this example in [Gitpod][oigp].
@@ -97,7 +97,7 @@ impl IncrementContract {
9797
}
9898
```
9999

100-
Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/custom_types
100+
Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/custom_types
101101

102102
## How it Works
103103

‎docs/build/smart-contracts/example-contracts/deployer.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ In this example there are two contracts that are compiled separately, and the te
3535

3636
:::
3737

38-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
39-
[deployer example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/deployer
38+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
39+
[deployer example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/deployer
4040

4141
## Run the Example
4242

43-
First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository:
43+
First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository:
4444

4545
[setup]: ../getting-started/setup.mdx
4646

4747
```
48-
git clone -b v21.4.1 https://github.com/stellar/soroban-examples
48+
git clone -b v21.6.0 https://github.com/stellar/soroban-examples
4949
```
5050

5151
Or, skip the development environment setup and open this example in [Gitpod][oigp].
@@ -108,7 +108,7 @@ impl Deployer {
108108
}
109109
```
110110

111-
Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/deployer
111+
Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/deployer
112112

113113
## How it Works
114114

‎docs/build/smart-contracts/example-contracts/errors.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ The [errors example] demonstrates how to define and generate errors in a contrac
2525

2626
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp]
2727

28-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
29-
[errors example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/errors
28+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
29+
[errors example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/errors
3030
[storing data example]: ../getting-started/storing-data.mdx
3131

3232
## Run the Example
3333

34-
First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository:
34+
First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository:
3535

3636
[setup]: ../getting-started/setup.mdx
3737

3838
```
39-
git clone -b v21.4.1 https://github.com/stellar/soroban-examples
39+
git clone -b v21.6.0 https://github.com/stellar/soroban-examples
4040
```
4141

4242
Or, skip the development environment setup and open this example in [Gitpod][oigp].
@@ -120,7 +120,7 @@ impl IncrementContract {
120120
}
121121
```
122122

123-
Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/errors
123+
Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/errors
124124

125125
## How it Works
126126

‎docs/build/smart-contracts/example-contracts/events.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ The [events example] demonstrates how to publish events from a contract. This ex
2222

2323
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp]
2424

25-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
26-
[events example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/events
25+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
26+
[events example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/events
2727
[storing data example]: ../getting-started/storing-data.mdx
2828

2929
## Run the Example
3030

31-
First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository:
31+
First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository:
3232

3333
[setup]: ../getting-started/setup.mdx
3434

3535
```
36-
git clone -b v21.4.1 https://github.com/stellar/soroban-examples
36+
git clone -b v21.6.0 https://github.com/stellar/soroban-examples
3737
```
3838

3939
Or, skip the development environment setup and open this example in [Gitpod][oigp].
@@ -87,7 +87,7 @@ impl IncrementContract {
8787
}
8888
```
8989

90-
Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/events
90+
Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/events
9191

9292
## How it Works
9393

‎docs/build/smart-contracts/example-contracts/fuzzing.mdx

+11-11
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@ The [fuzzing example] demonstrates how to fuzz test Soroban contracts with [`car
2323

2424
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp]
2525

26-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
27-
[fuzzing example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/fuzzing
26+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
27+
[fuzzing example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/fuzzing
2828
[`cargo-fuzz`]: https://docs.rs/cargo-fuzz
2929
[`arbitrary`]: https://docs.rs/arbitrary
3030
[`proptest`]: https://docs.rs/proptest
3131
[`proptest-arbitrary-interop`]: https://docs.rs/proptest-arbitrary-interop
32-
[timelock example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/timelock
32+
[timelock example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/timelock
3333

3434
## Run the Example
3535

36-
First go through the [setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository:
36+
First go through the [setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository:
3737

3838
[setup]: ../getting-started/setup.mdx
3939

4040
```sh
41-
git clone -b v21.4.1 https://github.com/stellar/soroban-examples
41+
git clone -b v21.6.0 https://github.com/stellar/soroban-examples
4242
```
4343

4444
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
112112

113113
The example used for this tutorial is based on the [`timelock`] example program, with some changes to demonstrate fuzzing.
114114

115-
[`timelock`]: https://github.com/stellar/soroban-examples/tree/v21.4.1/timelock
115+
[`timelock`]: https://github.com/stellar/soroban-examples/tree/v21.6.0/timelock
116116

117117
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.
118118

@@ -182,8 +182,8 @@ Our `soroban-examples/fuzzing` directory looks like
182182

183183
There are special considerations to note in the configuration of both the [contract's manifest] and the [fuzzing crate's manifest].
184184

185-
[contract's manifest]: https://github.com/stellar/soroban-examples/tree/v21.4.1/fuzzing/Cargo.toml
186-
[fuzzing crate's manifest]: https://github.com/stellar/soroban-examples/tree/v21.4.1/fuzzing/fuzz/Cargo.toml
185+
[contract's manifest]: https://github.com/stellar/soroban-examples/tree/v21.6.0/fuzzing/Cargo.toml
186+
[fuzzing crate's manifest]: https://github.com/stellar/soroban-examples/tree/v21.6.0/fuzzing/fuzz/Cargo.toml
187187

188188
Within the contract's manifest one must specificy the crate type as both "cdylib" and "rlib":
189189

@@ -243,7 +243,7 @@ features = ["testutils"]
243243

244244
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.
245245

246-
[`fuzz_target_1.rs`]: https://github.com/stellar/soroban-examples/tree/v21.4.1/fuzzing/fuzz/fuzz_targets/fuzz_target_1.rs
246+
[`fuzz_target_1.rs`]: https://github.com/stellar/soroban-examples/tree/v21.6.0/fuzzing/fuzz/fuzz_targets/fuzz_target_1.rs
247247

248248
Again, you can run this fuzzer from the `soroban-examples/fuzzing` directory with the following command:
249249

@@ -662,7 +662,7 @@ All user-defined contract types, those with the [`contracttype`] attribute, auto
662662

663663
The [`fuzz_target_2.rs`] example, demonstrates the use of `SorobanArbitrary`, the advancement of time, and more advanced fuzzing techniques.
664664

665-
[`fuzz_target_2.rs`]: https://github.com/stellar/soroban-examples/tree/v21.4.1/fuzzing/fuzz/fuzz_targets/fuzz_target_2.rs
665+
[`fuzz_target_2.rs`]: https://github.com/stellar/soroban-examples/tree/v21.6.0/fuzzing/fuzz/fuzz_targets/fuzz_target_2.rs
666666

667667
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.
668668

@@ -795,4 +795,4 @@ The great benefit of property tests though is that they can be included in stand
795795

796796
The [`proptest.rs`] file is a translation of `fuzz_target_1.rs` to a property test.
797797

798-
[`proptest.rs`]: https://github.com/stellar/soroban-examples/tree/v21.4.1/fuzzing/src/proptest.rs
798+
[`proptest.rs`]: https://github.com/stellar/soroban-examples/tree/v21.6.0/fuzzing/src/proptest.rs

‎docs/build/smart-contracts/example-contracts/liquidity-pool.mdx

+9-9
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ The Stellar network already has liquidity pool functionality built right in to t
3535

3636
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp]
3737

38-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
39-
[liquidity pool example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/liquidity_pool
40-
[source code]: https://github.com/stellar/soroban-examples/blob/v21.4.1/liquidity_pool/src/lib.rs#L143
38+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
39+
[liquidity pool example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/liquidity_pool
40+
[source code]: https://github.com/stellar/soroban-examples/blob/v21.6.0/liquidity_pool/src/lib.rs#L143
4141

4242
## Run the Example
4343

44-
First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository:
44+
First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository:
4545

4646
```sh
47-
git clone -b v21.4.1 https://github.com/stellar/soroban-examples
47+
git clone -b v21.6.0 https://github.com/stellar/soroban-examples
4848
```
4949

5050
Or, skip the development environment setup and open this example in [Gitpod][oigp].
@@ -467,7 +467,7 @@ pub fn create_contract(
467467
</TabItem>
468468
</Tabs>
469469

470-
Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/liquidity_pool
470+
Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/liquidity_pool
471471

472472
## How it Works
473473

@@ -676,7 +676,7 @@ use soroban_sdk::{
676676
};
677677

678678
fn create_token_contract<'a>(e: &Env, admin: &Address) -> token::Client<'a> {
679-
token::Client::new(e, &e.register_stellar_asset_contract(admin.clone()))
679+
token::Client::new(e, &e._register_stellar_asset_contract_v2(admin.clone()).address())
680680
}
681681

682682
fn create_liqpool_contract<'a>(
@@ -829,7 +829,7 @@ fn test() {
829829
}
830830
```
831831

832-
[`liquidity_pool/src/test.rs`]: https://github.com/stellar/soroban-examples/blob/v21.4.1/liquidity_pool/src/test.rs
832+
[`liquidity_pool/src/test.rs`]: https://github.com/stellar/soroban-examples/blob/v21.6.0/liquidity_pool/src/test.rs
833833

834834
In any test the first thing that is always required is an `Env`, which is the Soroban environment that the contract will run in.
835835

@@ -847,7 +847,7 @@ We have abstracted into a few functions the tasks of creating token contracts, d
847847

848848
```rust title=liquidity_pool/src/test.rs
849849
fn create_token_contract<'a>(e: &Env, admin: &Address) -> token::Client<'a> {
850-
token::Client::new(e, &e.register_stellar_asset_contract(admin.clone()))
850+
token::Client::new(e, &e.register_stellar_asset_contract_v2(admin.clone()).address())
851851
}
852852

853853
fn create_liqpool_contract<'a>(

‎docs/build/smart-contracts/example-contracts/logging.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ The [logging example] demonstrates how to log for the purpose of debugging.
2424

2525
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.
2626

27-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
28-
[logging example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/hello_world
27+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
28+
[logging example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/hello_world
2929

3030
:::tip
3131

@@ -44,12 +44,12 @@ Logs are not accessible by dapps and other applications. See the [events example
4444

4545
## Run the Example
4646

47-
First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository:
47+
First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository:
4848

4949
[setup]: ../getting-started/setup.mdx
5050

5151
```
52-
git clone -b v21.4.1 https://github.com/stellar/soroban-examples
52+
git clone -b v21.6.0 https://github.com/stellar/soroban-examples
5353
```
5454

5555
Or, skip the development environment setup and open this example in [Gitpod][oigp].
@@ -92,7 +92,7 @@ impl Contract {
9292
}
9393
```
9494

95-
Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/logging
95+
Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/logging
9696

9797
## How it Works
9898

‎docs/build/smart-contracts/example-contracts/mint-lock.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ The admin of the token contracts used must be the mint-lock contract.
2323

2424
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp]
2525

26-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
27-
[mint-lock example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/mint-lock
26+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
27+
[mint-lock example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/mint-lock

‎docs/build/smart-contracts/example-contracts/single-offer-sale.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ The [single offer sale example] demonstrates how to write a contract that allows
2323

2424
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp]
2525

26-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
27-
[single offer sale example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/single_offer
28-
[source code]: https://github.com/stellar/soroban-examples/blob/v21.4.1/single_offer/src/lib.rs
26+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
27+
[single offer sale example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/single_offer
28+
[source code]: https://github.com/stellar/soroban-examples/blob/v21.6.0/single_offer/src/lib.rs

‎docs/build/smart-contracts/example-contracts/timelock.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ The [timelock example] demonstrates how to write a timelock and implements a gre
2525

2626
The contract accepts deposits of an amount of a token, and allows other users to claim it before or after a time point.
2727

28-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
29-
[timelock example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/timelock
28+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
29+
[timelock example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/timelock
3030
[claimable balance]: ../../../learn/encyclopedia/transactions-specialized/claimable-balances.mdx

‎docs/build/smart-contracts/example-contracts/tokens.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ The [token example] demonstrates how to write a token contract that implements t
2525

2626
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp]
2727

28-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
29-
[token example]: https://github.com/stellar/soroban-examples/tree/v21.4.1/token
28+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
29+
[token example]: https://github.com/stellar/soroban-examples/tree/v21.6.0/token
3030
[token interface]: ../../../tokens/token-interface.mdx
3131

3232
## Run the Example
3333

34-
First go through the [Setup] process to get your development environment configured, then clone the `v21.4.1` tag of `soroban-examples` repository:
34+
First go through the [Setup] process to get your development environment configured, then clone the `v21.6.0` tag of `soroban-examples` repository:
3535

3636
```sh
37-
git clone -b v21.4.1 https://github.com/stellar/soroban-examples
37+
git clone -b v21.6.0 https://github.com/stellar/soroban-examples
3838
```
3939

4040
Or, skip the development environment setup and open this example in [Gitpod][oigp].
@@ -525,7 +525,7 @@ pub enum DataKey {
525525
</TabItem>
526526
</Tabs>
527527

528-
Ref: https://github.com/stellar/soroban-examples/tree/v21.4.1/token
528+
Ref: https://github.com/stellar/soroban-examples/tree/v21.6.0/token
529529

530530
## How it Works
531531

‎docs/build/smart-contracts/getting-started/storing-data.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import TabItem from "@theme/TabItem";
2121

2222
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.
2323

24-
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).
24+
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).
2525

2626
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).
2727

‎docs/data/rpc/admin-guide.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ docker.io/stellar/system-test:soroban-preview11 \
565565
--TargetNetworkPassphrase "Test SDF Network ; September 2015" \
566566
--TargetNetworkTestAccountSecret <your test account StrKey encoded key here > \
567567
--TargetNetworkTestAccountPublic <your test account StrKey encoded pubkey here> \
568-
--SorobanExamplesGitHash v21.4.1
568+
--SorobanExamplesGitHash v21.6.0
569569
```
570570

571571
Make sure you configure the system test correctly:

‎docs/learn/migrate/evm/introduction-to-solidity-and-rust.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Or if you want to jump right in, you can open up our examples in a ready to go d
3030

3131
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp]
3232

33-
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.4.1
33+
[oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v21.6.0
3434

3535
# Summary
3636

‎docs/learn/migrate/evm/smart-contract-deployment.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,10 @@ If you haven't already setup up the dev environment for Soroban, you can get sta
189189

190190
This project requires using the `soroban_token_contract.wasm` file which you will need to import manually.
191191

192-
First, you will need to clone the `v21.4.1` tag of `soroban-examples` repository:
192+
First, you will need to clone the `v21.6.0` tag of `soroban-examples` repository:
193193

194194
```bash
195-
git clone -b v21.4.1 https://github.com/stellar/soroban-examples
195+
git clone -b v21.6.0 https://github.com/stellar/soroban-examples
196196
```
197197

198198
Then, navigate to the `soroban-examples/token` directory
@@ -485,7 +485,7 @@ use soroban_sdk::{
485485
};
486486

487487
fn create_token_contract<'a>(e: &Env, admin: &Address) -> token::Client<'a> {
488-
token::Client::new(e, &e.register_stellar_asset_contract(admin.clone()))
488+
token::Client::new(e, &e.register_stellar_asset_contract_v2(admin.clone()).address())
489489
}
490490

491491
fn create_vault_contract<'a>(

‎src/pages/docs/learn/interactive/dapps/challenges/challenge-1-payment.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ yarn
6161

6262
## Checkpoint 2: 🎬 Deploy Smart Contracts
6363

64-
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.
64+
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.
6565

6666
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.
6767

0 commit comments

Comments
 (0)
Please sign in to comment.