Can I create a non transferrable object?

Can I create a non-transferrable object so that once an object has an owner such that maybe it’s value can be changed but its owner can never be changed?

1 Like

Hi tahlil,

Definitely, by not including the store ability in your struct, it becomes non-transferrable via standard means like sui::transfer::public_transfer<T: key + store> , which expects both key and store abilities for your T object. This design effectively keeps the object within the module it’s defined in, preventing external transfers.

However, you can still facilitate transfers through a custom function inside your smart contract that leverages sui::transfer::transfer<T: key> , allowing for controlled transfer scenarios. This approach ensures your object remains non-transferrable to the public while providing flexibility under certain condition that you define.

2 Likes