Shared Object Deletion Now Available On Sui
Ephemeral Shared Objects allow better expressibility and cost reduction on Sui.
Ephemeral Shared Objects, a new feature on Sui, give developers the ability to delete shared objects. This new feature increases the toolset available to developers and the ways they can interact with shared objects, offering improved cost efficiency and expressivity in object management.
Enabling the temporary creation and subsequent deletion of shared objects, once their purpose is served, can streamline interactions with shared objects. This feature eliminates the need for flags or other logic to indicate the status of shared objects, allows for simpler logic and enhanced clarity in smart contracts, and reclaiming object storage fees once the shared objects are deleted.
To summarize some of the benefits of Ephemeral Shared Objects:
- Full lifecycle management: Deletion of shared objects completes the object lifecycle on Sui for shared objects, allowing for creation, usage, and deletion.
- Recovery of object storage fees and cost reduction: By enabling the deletion of shared objects, developers can reduce the costs associated with maintaining unnecessary data on the blockchain by recovering storage fees for shared objects that are no longer in use.
- Enhanced expressivity and clarity of logic: Developers can now work with shared objects without needing to encode post-usage logic to prevent interaction with the shared object after it is no longer needed: Once a shared object’s usefulness has concluded it can simply be deleted.
Developers eager to leverage this new feature can find an example of Ephemeral Shared Objects in the most recent E2E app guide on shared escrow — in this case to reclaim the shared escrow object after the escrow has concluded.
Happy building!