-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add create_token method in token.move #8825
Changes from 5 commits
e1e7d59
231d10c
610cda6
74fd59c
2608a7d
f753fc9
d2b89cd
a89a3d1
92cd3fe
075e642
b45d7ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,6 +106,22 @@ module aptos_token_objects::token { | |
}; | ||
} | ||
|
||
/// Creates a new token object with a unique address and returns the ConstructorRef | ||
/// for additional specialization. | ||
public fun create_token( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mark create_from_account as deprecated There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: How about just name this "create" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
creator: &signer, | ||
collection_name: String, | ||
description: String, | ||
name: String, | ||
royalty: Option<Royalty>, | ||
uri: String, | ||
): ConstructorRef { | ||
let creator_address = signer::address_of(creator); | ||
let constructor_ref = object::create_object(creator_address); | ||
create_common(&constructor_ref, creator_address, collection_name, description, name, royalty, uri); | ||
constructor_ref | ||
} | ||
|
||
/// Creates a new token object from a token name and returns the ConstructorRef for | ||
/// additional specialization. | ||
public fun create_named_token( | ||
|
@@ -124,6 +140,7 @@ module aptos_token_objects::token { | |
constructor_ref | ||
} | ||
|
||
#[deprecated] | ||
/// Creates a new token object from an account GUID and returns the ConstructorRef for | ||
/// additional specialization. | ||
public fun create_from_account( | ||
|
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.
This needs to be behind the same feature flag as create_guid otherwise this would always fail before the flag is enabled
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.
If auids are enabled, I am now calling
create
method. If auids are disabled, I am callingcreate_from_account
method. Is that okay?