Skip to content

Global states in Aptos smart contracts #429

Discussion options

You must be logged in to vote

aptos has objects, which are the common pattern for storing state which is not attached to an account

aptos has "named objects" with deterministic mapping to address which can be used as global singletons, "normal objects" have a random address and can be used to create any number of objects

the module is responsible for managing access control to state stored in objects

you store references to objects with Object<MyType>

there's some example of how to use objects here: https://aptos.dev/en/build/smart-contracts/objects

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kshitjee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants