-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NFT Standard] #963
[NFT Standard] #963
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user how to hold or transfer NFT?
Yes, I haven't added the transfer yet Here I still have some questions about Object When transferring Object, must it be limited to the current Module? If this function is not turned on, whether the NFT is an Object means the unique ObjectID |
|
||
public fun assert_collection_exist_of_id(collectionID: ObjectID, ctx: & Context){ | ||
assert!( context::exist_object(ctx, collectionID), ErrorCollectionNotExist); | ||
context::borrow_object<Collection>(ctx,collectionID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused borrow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused borrow
Because it is necessary to determine that the Object corresponding to the Object ID is the current type
This should be refactored after the subsequent Object module upgrade.
|
||
public fun assert_mutator_exist_of_id(objectId: ObjectID, ctx: &Context) { | ||
assert!(context::exist_object(ctx, objectId), ErrorMutatorNotExist); | ||
context::borrow_object<MutatorRef>(ctx, objectId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused borrow
Will this version of nft consider implementing Royalty? |
remove_extend_internal(mutator, ctx) | ||
} | ||
|
||
public fun contains_display(mutator: &ObjectRef<MutatorRef>, ctx: &mut Context): bool{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all functions need to pass in ObjectRef. For example, the contains
function can pass in ObjectRef?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all functions need to pass in ObjectRef. For example, the
contains
function can pass in ObjectRef?
This has been changed to struct because there are still some problems with the current use of Object
@@ -142,6 +143,12 @@ module moveos_std::context { | |||
obj_ref | |||
} | |||
|
|||
#[private_generics(T)] | |||
public fun new_single_object<T: key>(self: &mut Context, value: T): ObjectRef<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new_singleton_object
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new_singleton_object
?
Fixed
@@ -142,6 +143,12 @@ module moveos_std::context { | |||
obj_ref | |||
} | |||
|
|||
#[private_generics(T)] | |||
public fun new_singleton_object<T: key>(self: &mut Context, value: T): ObjectRef<T> { | |||
let object_id = object::singleton_object_id<T>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is a singleton object, do we need to check whether the object exists?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is a singleton object, do we need to check whether the object exists?
Because the ObjectID will be the same, new should not appear the second one, and better error information can be added.
simple_map::borrow(&display_ref.sample_map, key) | ||
} | ||
|
||
public fun borrow_mut<T>(self: &mut ObjectRef<Display<T>>, key: &String): &mut String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Directly provide an update method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Directly provide an update method?
In fact, whether the ObjectRef can be obtained is controlled by the Module creator, so there will be no problem
examples/nft/Move.toml
Outdated
rooch_framework = "0x3" | ||
|
||
[dev-addresses] | ||
creator = "0x42" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example project supports two named_address: rooch_examples & $project_dir.
So the creator needs to change to nft
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary