From 9bc8694e37b69023a82a3353fb6b65c4bedae589 Mon Sep 17 00:00:00 2001 From: Gavin <495054021@qq.com> Date: Thu, 20 Jun 2024 22:36:57 +0800 Subject: [PATCH] Update storage-functions.md (#72) fix the object define of `Gift` --- book/src/storage/storage-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/src/storage/storage-functions.md b/book/src/storage/storage-functions.md index d97b5fe..62f2f0a 100644 --- a/book/src/storage/storage-functions.md +++ b/book/src/storage/storage-functions.md @@ -115,7 +115,7 @@ public struct Gift has key { id: UID } public fun mint_and_transfer( _: &AdminCap, recipient: address, ctx: &mut TxContext ) { - let gift = object::new(ctx); + let gift = Gift { id: object::new(ctx) }; transfer::transfer(gift, recipient); } ```