How to limit the transfer of owned objects in Sui move?

199 views Asked by At

How to limit/restrict/prevent the transfers of owned objects in Sui move? I want to block a user from sending an object in his/her wallet to make the object soulbound like some of the SuiFrens. I've have had a look at the sui::transfer module code and the docs but did not find how to do this.

1

There are 1 answers

0
Georges-Charles Brain On

If an object T does not have the store ability, it cannot be transferred except by code inside the module that declares T. A useful pattern is to declare a "custom transfer" function, wrapping sui::transfer::transfer and imposing the restrictions inside the function. Here is an example: examples.sui.io/basics/custom-transfer

Credit to Sam Blackshear for answering the question on Telegram