-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(examples/move/nft_marketplace): highlighted the rental extension…
… separately from the marketplace extension and added some mock items for marketplace operations
- Loading branch information
Showing
3 changed files
with
514 additions
and
371 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
docs/examples/move/nft_marketplace/sources/item_for_market.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
} |
Oops, something went wrong.