Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 0 additions & 95 deletions content/stellar-contracts/helpers/default-impl-macro.mdx

This file was deleted.

8 changes: 3 additions & 5 deletions content/stellar-contracts/tokens/fungible/fungible.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Here’s what a basic fungible token contract might look like:
use soroban_sdk::{contract, contractimpl, Address, Env, String};
use stellar_tokens::fungible::{burnable::FungibleBurnable, Base, ContractOverrides, FungibleToken};
use stellar_access::ownable::{self as ownable, Ownable};
use stellar_macros::{default_impl, only_owner};
use stellar_macros::only_owner;

#[contract]
pub struct GameCurrency;
Expand All @@ -61,14 +61,12 @@ impl GameCurrency {
}
}

#[default_impl]
#[contractimpl]
#[contractimpl(contracttrait)]
impl FungibleToken for GameCurrency {
type ContractType = Base;
}

#[default_impl]
#[contractimpl]
#[contractimpl(contracttrait)]
impl FungibleBurnable for GameCurrency {}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ implement access control to restrict who can mint.

```rust
use soroban_sdk::{contract, contractimpl, Address, Env, String};
use stellar_macros::default_impl;
use stellar_tokens::non_fungible::{
consecutive::{Consecutive, NonFungibleConsecutive},
Base, ContractOverrides, NonFungibleToken,
Expand Down Expand Up @@ -47,8 +46,7 @@ impl GameItem {
}
}

#[default_impl]
#[contractimpl]
#[contractimpl(contracttrait)]
impl NonFungibleToken for GameItem {
type ContractType = Consecutive;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ can call `award_item` and we might want to implement access control to restrict

```rust
use soroban_sdk::{contract, contractimpl, Address, Env, String};
use stellar_macros::default_impl;
use stellar_tokens::non_fungible::{
enumerable::{Enumerable, NonFungibleEnumerable},
Base, ContractOverrides, NonFungibleToken,
Expand Down Expand Up @@ -46,18 +45,16 @@ impl GameItem {
}
}

#[default_impl]
#[contractimpl]
#[contractimpl(contracttrait)]
impl NonFungibleToken for GameItem {
type ContractType = Enumerable;
}

#[default_impl]
#[contractimpl]
#[contractimpl(contracttrait)]
impl NonFungibleEnumerable for GameItem {}
```

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

```rust
fn total_supply(e: &Env) -> u32;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Here’s what a contract for tokenized items might look like:

```rust
use soroban_sdk::{contract, contractimpl, Address, Env, String};
use stellar_macros::default_impl;
use stellar_tokens::non_fungible::{
burnable::NonFungibleBurnable,
Base, ContractOverrides, NonFungibleToken,
Expand All @@ -62,14 +61,12 @@ impl GameItem {
}
}

#[default_impl]
#[contractimpl]
#[contractimpl(contracttrait)]
impl NonFungibleToken for GameItem {
type ContractType = Base;
}

#[default_impl]
#[contractimpl]
#[contractimpl(contracttrait)]
impl NonFungibleBurnable for GameItem {}
```

Expand Down
10 changes: 3 additions & 7 deletions content/stellar-contracts/tokens/rwa/rwa.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ Here's what a basic RWA token contract might look like (only the base token cont
```rust
use soroban_sdk::{contract, contractimpl, symbol_short, Address, Env, String};
use stellar_access::access_control::{self as access_control, AccessControl};
use stellar_macros::default_impl;
use stellar_tokens::{
fungible::{Base, FungibleToken},
rwa::{RWAToken, RWA},
Expand Down Expand Up @@ -150,20 +149,17 @@ impl RealEstateToken {
}

// Implement the FungibleToken trait with RWA contract type
#[default_impl]
#[contractimpl]
#[contractimpl(contracttrait)]
impl FungibleToken for RealEstateToken {
type ContractType = RWA;
}

// Implement the RWAToken trait for regulatory features
#[default_impl]
#[contractimpl]
#[contractimpl(contracttrait)]
impl RWAToken for RealEstateToken {}

// Implement AccessControl for role-based permissions
#[default_impl]
#[contractimpl]
#[contractimpl(contracttrait)]
impl AccessControl for RealEstateToken {}
```

Expand Down
4 changes: 1 addition & 3 deletions content/stellar-contracts/tokens/vault/vault.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ To create a vault contract, implement both the `FungibleToken` and `FungibleVaul

```rust
use soroban_sdk::{contract, contractimpl, Address, Env, String};
use stellar_macros::default_impl;
use stellar_tokens::{
fungible::{Base, FungibleToken},
vault::{FungibleVault, Vault},
Expand Down Expand Up @@ -196,8 +195,7 @@ impl VaultContract {
}
}

#[default_impl]
#[contractimpl]
#[contractimpl(contracttrait)]
impl FungibleToken for VaultContract {
type ContractType = Vault;

Expand Down
11 changes: 0 additions & 11 deletions src/navigation/stellar.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,6 @@
}
]
},
{
"type": "folder",
"name": "Helpers",
"children": [
{
"type": "page",
"name": "Default Implementation Macro",
"url": "/stellar-contracts/helpers/default-impl-macro"
}
]
},
{
"type": "page",
"name": "Fee Abstraction",
Expand Down