Post
Share your knowledge.
How to ensure a smart contract doesn't resend a capability?
I'm working on a smart contract and I want to ensure that it doesn't send a capability if the user already owns one. This is to avoid unwanted transactions. I am thinking about using an SDK to check all objects a user holds and perhaps using a sui::table::Table
to keep a list of minted capabilities. Is this the right approach, or is there a better way to confirm if an address holds a certain object on-chain?
- Move CLI
- Move
Answers
3A suggestion for your use case is to keep a list of addresses that have had a capability minted in a shared object. You can manage object size restrictions by using a sui::table::Table
, which allows you to maintain a list/map efficiently.
You can try using the SDK to check for all objects a user holds off-chain. This might help you validate ownership without impacting the on-chain contract flow.
You might not need an on-chain check for this use case. If you want users to prove they own an object, require them to input proof of ownership.
Do you know the answer?
Please log in and share it.
Move is an executable bytecode language used to implement custom transactions and smart contracts.

- ... SUIderiss+5
- ... SUIRamirez+5
- ... SUIElvin CLONE +5
- ... SUI
- ... SUI
- ... SUI
- ... SUIBritain+2