Skip to content

Commit 4969a52

Browse files
committed
rm default_impl macro
1 parent c5caca7 commit 4969a52

8 files changed

Lines changed: 13 additions & 135 deletions

File tree

content/stellar-contracts/helpers/default-impl-macro.mdx

Lines changed: 0 additions & 95 deletions
This file was deleted.

content/stellar-contracts/tokens/fungible/fungible.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Here’s what a basic fungible token contract might look like:
3434
use soroban_sdk::{contract, contractimpl, Address, Env, String};
3535
use stellar_tokens::fungible::{burnable::FungibleBurnable, Base, ContractOverrides, FungibleToken};
3636
use stellar_access::ownable::{self as ownable, Ownable};
37-
use stellar_macros::{default_impl, only_owner};
37+
use stellar_macros::only_owner;
3838

3939
#[contract]
4040
pub struct GameCurrency;
@@ -61,14 +61,12 @@ impl GameCurrency {
6161
}
6262
}
6363

64-
#[default_impl]
65-
#[contractimpl]
64+
#[contractimpl(contracttrait)]
6665
impl FungibleToken for GameCurrency {
6766
type ContractType = Base;
6867
}
6968

70-
#[default_impl]
71-
#[contractimpl]
69+
#[contractimpl(contracttrait)]
7270
impl FungibleBurnable for GameCurrency {}
7371
```
7472

content/stellar-contracts/tokens/non-fungible/nft-consecutive.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ implement access control to restrict who can mint.
1717

1818
```rust
1919
use soroban_sdk::{contract, contractimpl, Address, Env, String};
20-
use stellar_macros::default_impl;
2120
use stellar_tokens::non_fungible::{
2221
consecutive::{Consecutive, NonFungibleConsecutive},
2322
Base, ContractOverrides, NonFungibleToken,
@@ -47,8 +46,7 @@ impl GameItem {
4746
}
4847
}
4948

50-
#[default_impl]
51-
#[contractimpl]
49+
#[contractimpl(contracttrait)]
5250
impl NonFungibleToken for GameItem {
5351
type ContractType = Consecutive;
5452
}

content/stellar-contracts/tokens/non-fungible/nft-enumerable.mdx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ can call `award_item` and we might want to implement access control to restrict
1616

1717
```rust
1818
use soroban_sdk::{contract, contractimpl, Address, Env, String};
19-
use stellar_macros::default_impl;
2019
use stellar_tokens::non_fungible::{
2120
enumerable::{Enumerable, NonFungibleEnumerable},
2221
Base, ContractOverrides, NonFungibleToken,
@@ -46,18 +45,16 @@ impl GameItem {
4645
}
4746
}
4847

49-
#[default_impl]
50-
#[contractimpl]
48+
#[contractimpl(contracttrait)]
5149
impl NonFungibleToken for GameItem {
5250
type ContractType = Enumerable;
5351
}
5452

55-
#[default_impl]
56-
#[contractimpl]
53+
#[contractimpl(contracttrait)]
5754
impl NonFungibleEnumerable for GameItem {}
5855
```
5956

60-
The extension exposes additionally the following entry-point functions, automatically implemented by `#[default_impl]`:
57+
The extension exposes additionally the following entry-point functions:
6158

6259
```rust
6360
fn total_supply(e: &Env) -> u32;

content/stellar-contracts/tokens/non-fungible/non-fungible.mdx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ Here’s what a contract for tokenized items might look like:
3636

3737
```rust
3838
use soroban_sdk::{contract, contractimpl, Address, Env, String};
39-
use stellar_macros::default_impl;
4039
use stellar_tokens::non_fungible::{
4140
burnable::NonFungibleBurnable,
4241
Base, ContractOverrides, NonFungibleToken,
@@ -62,14 +61,12 @@ impl GameItem {
6261
}
6362
}
6463

65-
#[default_impl]
66-
#[contractimpl]
64+
#[contractimpl(contracttrait)]
6765
impl NonFungibleToken for GameItem {
6866
type ContractType = Base;
6967
}
7068

71-
#[default_impl]
72-
#[contractimpl]
69+
#[contractimpl(contracttrait)]
7370
impl NonFungibleBurnable for GameItem {}
7471
```
7572

content/stellar-contracts/tokens/rwa/rwa.mdx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ Here's what a basic RWA token contract might look like (only the base token cont
107107
```rust
108108
use soroban_sdk::{contract, contractimpl, symbol_short, Address, Env, String};
109109
use stellar_access::access_control::{self as access_control, AccessControl};
110-
use stellar_macros::default_impl;
111110
use stellar_tokens::{
112111
fungible::{Base, FungibleToken},
113112
rwa::{RWAToken, RWA},
@@ -150,20 +149,17 @@ impl RealEstateToken {
150149
}
151150

152151
// Implement the FungibleToken trait with RWA contract type
153-
#[default_impl]
154-
#[contractimpl]
152+
#[contractimpl(contracttrait)]
155153
impl FungibleToken for RealEstateToken {
156154
type ContractType = RWA;
157155
}
158156

159157
// Implement the RWAToken trait for regulatory features
160-
#[default_impl]
161-
#[contractimpl]
158+
#[contractimpl(contracttrait)]
162159
impl RWAToken for RealEstateToken {}
163160

164161
// Implement AccessControl for role-based permissions
165-
#[default_impl]
166-
#[contractimpl]
162+
#[contractimpl(contracttrait)]
167163
impl AccessControl for RealEstateToken {}
168164
```
169165

content/stellar-contracts/tokens/vault/vault.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ To create a vault contract, implement both the `FungibleToken` and `FungibleVaul
167167

168168
```rust
169169
use soroban_sdk::{contract, contractimpl, Address, Env, String};
170-
use stellar_macros::default_impl;
171170
use stellar_tokens::{
172171
fungible::{Base, FungibleToken},
173172
vault::{FungibleVault, Vault},
@@ -196,8 +195,7 @@ impl VaultContract {
196195
}
197196
}
198197

199-
#[default_impl]
200-
#[contractimpl]
198+
#[contractimpl(contracttrait)]
201199
impl FungibleToken for VaultContract {
202200
type ContractType = Vault;
203201

src/navigation/stellar.json

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,6 @@
140140
}
141141
]
142142
},
143-
{
144-
"type": "folder",
145-
"name": "Helpers",
146-
"children": [
147-
{
148-
"type": "page",
149-
"name": "Default Implementation Macro",
150-
"url": "/stellar-contracts/helpers/default-impl-macro"
151-
}
152-
]
153-
},
154143
{
155144
"type": "page",
156145
"name": "Fee Abstraction",

0 commit comments

Comments
 (0)