Skip to content
Discussion options

You must be logged in to vote

i wouldn't use an object for singletons that don't have an owner, for example a GlobalConfig struct

objects allow you to type check, store and pass global references through Object

objects also allow you manage lifetimes, you can delete/transfer/upgrade through refs

aptos also supports named objects, which have a deterministic mapping between some key (name) and object address

if you really don't need those features an id probably works too

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@RevanthGundala
Comment options

@MoonShiesty
Comment options

Answer selected by kshitijc1506
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants