Skip to content

Commit

Permalink
feat(examples/move/nft_marketplace): highlighted the rental extension…
Browse files Browse the repository at this point in the history
… separately from the marketplace extension and added some mock items for marketplace operations
  • Loading branch information
Dkwcs committed Nov 22, 2024
1 parent e5b37b3 commit 4b11522
Show file tree
Hide file tree
Showing 3 changed files with 514 additions and 371 deletions.
58 changes: 58 additions & 0 deletions docs/examples/move/nft_marketplace/sources/item_for_market.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
module nft_marketplace::market_items {
use iota::package;
/// One Time Witness.
public struct MARKET_ITEMS has drop {}


fun init(otw: MARKET_ITEMS, ctx: &mut TxContext) {
package::claim_and_keep(otw, ctx)
}

public struct TShirt has key, store {
id: UID,
}

public struct Jacket has key, store {
id: UID,
}

public struct Shoes has key, store {
id: UID,
}

public struct Jeans has key, store {
id: UID,
}

public fun new_tshirt(ctx: &mut TxContext) {
let tshirt = TShirt {
id: object::new(ctx),
};

transfer::public_transfer(tshirt, ctx.sender());
}

public fun new_jeans(ctx: &mut TxContext) {
let jeans = Jeans {
id: object::new(ctx),
};

transfer::public_transfer(jeans, ctx.sender());
}

public fun new_shoes(ctx: &mut TxContext) {
let shoes = Shoes {
id: object::new(ctx),
};

transfer::public_transfer(shoes, ctx.sender());
}

public fun new_jacket(ctx: &mut TxContext) {
let jacket = Jacket {
id: object::new(ctx),
};

transfer::public_transfer(jacket, ctx.sender());
}
}
Loading

0 comments on commit 4b11522

Please sign in to comment.