The Four Abilities
copy
Type can be copied by value
drop
Type can be safely discarded
store
Type can be stored inside structs
key
Type can be a top-level object
Copy Ability
Types withcopy can be duplicated:
Drop Ability
Types withdrop can be ignored or discarded:
Store Ability
Types withstore can be:
- Stored in other structs
- Transferred with
public_transfer - Stored in global storage
Key Ability
Types withkey can be top-level Sui objects:
Types with
key must have id: UID as their first field.Common Combinations
- key + store
- key only
- copy + drop + store
- drop only
Ability Constraints in Generics
Phantom Type Parameters
Best Practices
Use minimal abilities
Use minimal abilities
Only grant abilities that are necessary:
Assets shouldn't have copy
Assets shouldn't have copy
Related Topics
Move Overview
Learn Move basics
Objects
Understand Sui objects
Ownership
Object ownership rules