Exploration of Sui Data Application Scenarios

Exploration of Sui Data Application Scenarios

Fatima Ali Hassan

Fatima Ali Hassan

Chainbase Intern

Introduction

Sui introduces a unique approach where all contracts, NFTs (Non-Fungible Tokens), and Coins can be perceived as Objects. This innovative storage structure operates on the basis of Objects, forming the foundation of Sui's functionalities. In this article, we will explore the three core aspects related to Objects in Sui: NFT Collections, Token Values, and Package Contracts. Discover how Sui's Object-based system revolutionizes the blockchain landscape.

NFT (Collection)

NFTs are unique digital assets that represent ownership of a specific item, artwork, or collectible on the blockchain. In Sui, NFTs are treated as Objects, and their control is governed by a specific contract package. To find the NFT control contract package, we need to identify the package responsible for the minting functionality of the NFTs.

How to Find the NFT Control Contract Package?

To locate the NFT control contract package, we first need to find the package ID (object ID) associated with the NFT. For example, let's say we want to find the bulk shark NFT package ID with the object ID

To locate the NFT control contract package, we first need to find the package ID (object ID) associated with the NFT. For example, let's say we want to find the bulk shark NFT package ID with the object ID

0xee496a0cc04d06a345982ba6697c90c619020de9e274408c7819f787ff66e1a1.

Querying All Move_Calls (Transactions) in the Package

Once we have the package ID, we can query all the move_calls (transactions) generated within that package:

select * from
sui.move_calls 
where move_package = '0xee496a0cc04d06a345982ba6697c90c619020de9e274408c7819f787ff66e1a1';

Finding All NFT Objects in the Package

Alternatively, we can find all the NFT objects within the package using the corresponding NFT object type:

select * from
sui.objects
where object_type = '0xee496a0cc04d06a345982ba6697c90c619020de9e274408c7819f787ff66e1a1::suifrens::SuiFren<0x8894fa02fc6f36cbc485ae9145d05f247a78e220814fb8419ab261bd81f08f32::bullshark::Bullshark>';

Package (Contract)

Top Contracts are determined by grouping packages based on the number of interactions they have.

How to Find Top Contracts?

To identify the top contracts, we group the packages by the number of move_calls (transactions) they generate. The following SQL query provides information on the top 100 contracts:

select 
count(1) as score, 
move_package 
from 
sui.move_calls 
group by move_package 
order by score desc 
limit 100;

FAQs

Q 1: What are Objects in Sui?

Objects in Sui refer to a unique approach where all contracts, NFTs, and Coins are considered as individual Objects. This Object-based storage structure forms the core of Sui's operations.

Q 2: How do I find the control contract package for NFTs?

To locate the control contract package for NFTs, you need to identify the specific NFT type, and the package ID can be found as the first hexadecimal prefix in the NFT type. For instance, if the NFT object's type is 0x5325…17a2, and it belongs to the type 0xee49…e1a1::suifrens::SuiFren<0x8894…8f32::bullshark::Bullshark>, then the collection's package ID would be 0xee49…e1a1.

Q 3: Can I query token balances for specific Coins in Sui?

Yes, you can query token balances for specific Coins in Sui. By grouping the same CoinType and Account Address, you can calculate the total balance for each toke

Q 4: What makes Sui's Object-based storage system unique?

Sui's Object-based storage system is unique as it treats all contracts, NFTs, and Coins as Objects. This innovative approach streamlines the storage structure and enhances overall blockchain functionalities.

Q 5: Are all NFTs stored as Objects in Sui?

Yes, all NFTs are stored as Objects in Sui. Each NFT has a specific object type, making it easy to identify and manage different NFT collections.

Conclusion

Sui's Object-based storage system redefines the way contracts, NFTs, and Coins are managed on the blockchain. By considering them as individual Objects, Sui offers a streamlined and efficient approach to handling digital assets. The concepts of NFT Collections, Token Values, and Package Contracts showcase the power and versatility of Sui's”

About Chainbase

Chainbase is an all-in-one data infrastructure for Web3 that allows you to index, transform, and use on-chain data at scale. By leveraging enriched on-chain data and streaming computing technologies across one data infrastructure, Chainbase automates the indexing and querying of blockchain data, enabling developers to accomplish more with less effort.

Want to learn more about Chainbase?

Visit our website chainbase.com Sign up for a free account, and Check out our documentation.

Website|Blog|Twitter|Discord|Link3