-
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
[fungible_assets] fix bugs, add tests, rename and change object api #7608
Conversation
e86dbf6
to
c9b05f1
Compare
aptos-move/move-examples/fungible_asset/sources/managed_fungible_asset.move
Outdated
Show resolved
Hide resolved
|
||
#[resource_group_member(group = aptos_framework::object::ObjectGroup)] | ||
/// Resource stored on the fungible asset metadata object to allow creating primary stores for it. | ||
struct DeriveRefPod has key { |
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.
Why is DeriveRefPod a better name?
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.
Because it can be used for other purpose. If you agree that function is friend function, I agree to change it back to the original name. Otherwise, it is just a holder of derived ref.
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.
@gregnazario Any naming suggestion here? :P
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.
I mean I would make it PrimaryWalletCapability, though I think we overloaded that word now...
PrimaryWalletDeriveRef
Tells you what it is, and what it's used for. Do you suspect it'll be used for anything else in the future? Then
FungibleAssetDeriveRef
c9b05f1
to
889dd58
Compare
889dd58
to
c767194
Compare
@@ -471,6 +472,14 @@ module aptos_framework::object { | |||
} | |||
|
|||
/// Accessors |
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 should be a // and not a ///
|
||
#[resource_group_member(group = aptos_framework::object::ObjectGroup)] | ||
/// Resource stored on the fungible asset metadata object to allow creating primary stores for it. | ||
struct DeriveRefPod has key { |
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.
I mean I would make it PrimaryWalletCapability, though I think we overloaded that word now...
PrimaryWalletDeriveRef
Tells you what it is, and what it's used for. Do you suspect it'll be used for anything else in the future? Then
FungibleAssetDeriveRef
@movekevin Can you take another look of |
d7b03b5
to
15d8c88
Compare
15d8c88
to
7ad8958
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
/// Maximum possible coin supply. | ||
const MAX_U128: u128 = 340282366920938463463374607431768211455; | ||
|
||
struct Supply has store { |
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.
object::object_from_constructor_ref<FungibleStore>(constructor_ref) | ||
} | ||
|
||
public fun remove_store(delete_ref: &DeleteRef) acquires FungibleStore, FungibleAssetEvents { |
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.
Why do we want this?
const MAX_U128: u128 = 340282366920938463463374607431768211455; | ||
|
||
struct Supply has store { | ||
current: OptionalAggregator, |
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.
Do we need a function to "activate" aggregator for this or can we add later?
const ASSET_SYMBOL: vector<u8> = b"APT"; | ||
|
||
/// Initialize metadata object and store the refs. | ||
fun init_module(admin: &signer) { |
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.
Why have two separate modules and not just one? In many cases people just deploy once and expect the fungible asset to be created
/// The address of the base metadata object. | ||
metadata: Object<Metadata>, | ||
/// The balance of the fungible metadata. | ||
balance: u64, | ||
/// Fungible Assets transferring is a common operation, this allows for freezing/unfreezing accounts. | ||
allow_ungated_transfer: bool, | ||
allow_ungated_balance_transfer: 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.
allow_owner_balance_transfer?
// Constants | ||
// | ||
|
||
const MAX_NAME_LENGTH: u64 = 32; |
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.
How did you come up with these numbers?
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
Description
Test Plan
ut