Move.

Post

Share your knowledge.

Tawhid.
Mar 26, 2025
Expert Q&A

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
0
3
Share
Comments
.

Answers

3
dudley_smith.
Mar 27 2025, 07:47

A 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.

2
Best Answer
Comments
.
cod.
cod95
Mar 27 2025, 02:05

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.

2
Comments
.
Grizzly.
Mar 27 2025, 05:53

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.

1
Comments
.

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.

148Posts231Answers
Sui.X.Peera.

Earn Your Share of 1000 Sui

Gain Reputation Points & Get Rewards for Helping the Sui Community Grow.

Reward CampaignJune
We use cookies to ensure you get the best experience on our website.
More info