@@ -31,7 +31,7 @@ public fun create_arena(hero: Hero, ctx: &mut TxContext) {
3131 // - Use object::new(ctx) for unique ID
3232 // - Set warrior field to the hero parameter
3333 // - Set owner to ctx.sender()
34- // - Emit ArenaCreated event with arena ID and timestamp (Don't forget to use ctx.epoch_timestamp_ms())
34+ // - Emit ArenaCreated event with arena ID and timestamp (Don't forget to use ctx.epoch_timestamp_ms(), object::id(&arena) )
3535 // - Use transfer::share_object() to make it publicly accessible
3636}
3737```
@@ -46,7 +46,8 @@ public fun battle(hero: Hero, arena: Arena, ctx: &mut TxContext) {
4646 // - Compare hero.hero_power() with warrior.hero_power()
4747 // - If hero wins: both heroes go to ctx.sender()
4848 // - If warrior wins: both heroes go to battle place owner
49- // - Emit BattlePlaceCompleted event with winner/loser IDs (Don't forget to use object::to_inner(winner.id) or object::to_inner(loser.id) )
49+ // - Emit BattlePlaceCompleted event with winner/loser IDs (Don't forget to use object::id(&warrior) or object::id(&hero)).
50+ // - Note: You have to emit this inside of the if else statements
5051 // - Don't forget to delete the battle place ID at the end
5152}
5253```
@@ -90,7 +91,7 @@ public fun buy_hero(list_hero: ListHero, coin: Coin<SUI>, ctx: &mut TxContext) {
9091 // - Use assert! to verify coin value equals listing price (coin::value(&coin) == price) else abort with `EInvalidPayment`
9192 // - Transfer coin to seller (use transfer::public_transfer() function)
9293 // - Transfer hero NFT to buyer (ctx.sender())
93- // - Emit HeroBought event with transaction details (Don't forget to use object::to_inner( id) )
94+ // - Emit HeroBought event with transaction details (Don't forget to use object::uid_to_inner(& id) )
9495 // - Delete the listing ID (object::delete(id))
9596}
9697```
@@ -101,7 +102,7 @@ public fun buy_hero(list_hero: ListHero, coin: Coin<SUI>, ctx: &mut TxContext) {
101102public fun delist(_: &AdminCap, list_hero: ListHero) {
102103 // TODO: Implement admin delist functionality
103104 // Hints:
104- // - Destructure list_hero (ignore price with "_price ")
105+ // - Destructure list_hero (ignore price with "price: _ ")
105106 // - Transfer NFT back to original seller
106107 // - Delete the listing ID
107108 // - The AdminCap parameter ensures only admin can call this
0 commit comments