<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by HolaSui on Medium]]></title>
        <description><![CDATA[Stories by HolaSui on Medium]]></description>
        <link>https://medium.com/@holasui?source=rss-4ad42b999426------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-CBDpKw_LYlKh54JDogoVg.png</url>
            <title>Stories by HolaSui on Medium</title>
            <link>https://medium.com/@holasui?source=rss-4ad42b999426------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 17:40:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@holasui/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[HolaDAO —  the first DAO constructor is live!]]></title>
            <link>https://holasui.medium.com/holadao-the-first-dao-constructor-is-live-3ed8334b4229?source=rss-4ad42b999426------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ed8334b4229</guid>
            <category><![CDATA[sui]]></category>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[token]]></category>
            <category><![CDATA[dao]]></category>
            <category><![CDATA[subdao]]></category>
            <dc:creator><![CDATA[HolaSui]]></dc:creator>
            <pubDate>Fri, 14 Jul 2023 01:30:06 GMT</pubDate>
            <atom:updated>2023-07-14T02:15:20.014Z</atom:updated>
            <content:encoded><![CDATA[<h3>HolaDAO — the first DAO constructor on Sui is live!</h3><p>Following the Sui X Kucoin Hackathon, we’re excited to announce the <a href="https://dashboard.holasui.app/dao">DAO constructor(HolaDAO)</a> for NFTs and Tokens on the Sui Blockchain. <strong>This introduces a unique DAO system unlike any other in the blockchain space. We’re using on-chain NFT attributes on Sui to create a SubDAO, a smaller DAO within the main DAO.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G_qiNwXGwxPljvY7pTcwOA.png" /><figcaption>SubDAOs</figcaption></figure><h3>What is SubDAO?</h3><p>A SubDAO is a miniature version of the main DAO, established around distinct items or attributes inherent in the main DAO. For example, you can form a SubDAO focused on specific traits such as hats, glasses, or even the country of origin (as is the case with Capy). This SubDAO will maintain all the operational features of the larger DAO but will be specifically catered to these unique traits. At present, SubDAO capabilities are only accessible for CapyDAO. If you wish to incorporate your NFT collection into a SubDAO, we welcome you to direct message us on Twitter or Discord. <strong>Before this development, people could only form groups and chat on Discord without any on-chain activities. We have now addressed this limitation.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*3MSi7YC6OqgmJZp7EJdPPg.png" /><figcaption><strong>MonkeDAO(The best Solana DAO) screenshot</strong></figcaption></figure><p>Creating a SubDAO for your Capy based on attributes is straightforward and can be done in less than 3 minutes. Simply select the trait associated with your Capy’s origin, and if you have it, create the DAO. <strong>Now, it’s possible to establish proposals, conduct voting, and manage treasuries exclusively for these specific NFT Attributes.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G0_h1rVynJjmusutz3rjyg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*viqoBWpHSKsrmkgydN2PlA.png" /><figcaption>Example of Romania Capy Sub-DAO</figcaption></figure><p>Additional features of HolaDAO include:</p><ul><li>Easy DAO creation without coding 🌊</li><li>Proposal initiation 🗳️</li><li>Proposal delay and exciting proposal thresholds ⏰</li><li>Fund via the treasury 🧳</li><li>Transaction execution assurance via the proposal system 🔐</li><li>All the above-mentioned are included for SubDAOs as well</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KsbxW8xlCyKL-5XSzqnDfQ.png" /></figure><p>Interestingly, you <strong>can create your own DAO not just for NFTs but also for Tokens🚀</strong> as everything on Sui is NFTs. We’ve established a test DAO for Sui tokens, so token holders, don’t forget to try creating some proposals and voting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xYF_DQO4DRrNqvxowE5yiA.png" /><figcaption>Main Screen</figcaption></figure><p>Lastly, we’ve made our GitHub code for our website and DAO smart contract public. We believe this will support the Sui community’s growth and help to avoid our past mistakes.</p><p><strong>Website: </strong><a href="https://dashboard.holasui.app/dao">https://dashboard.holasui.app/dao</a><strong> </strong><br><strong>GitHub Website: </strong><a href="https://github.com/LoyaltyGM/holasui-website/tree/DAO-Hackaton-Sui">https://github.com/LoyaltyGM/holasui-website/tree/DAO-Hackaton-Sui</a><strong> </strong><br><strong>GitHub Smart-Contract: </strong><a href="https://github.com/LoyaltyGM/holasui-contract/tree/holasui-v1-add-dao">https://github.com/LoyaltyGM/holasui-contract/tree/holasui-v1-add-dao</a><br><strong>Twitter: </strong><a href="https://twitter.com/Hola_Sui">https://twitter.com/Hola_Sui</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ed8334b4229" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Mystery Box NFT on Sui Blockchain Using Move, ChatGPT, and DALLE-2]]></title>
            <link>https://holasui.medium.com/creating-a-mystery-box-nft-on-sui-blockchain-using-move-chatgpt-and-dalle-2-7bdccac8568?source=rss-4ad42b999426------2</link>
            <guid isPermaLink="false">https://medium.com/p/7bdccac8568</guid>
            <category><![CDATA[sui-blockchain]]></category>
            <category><![CDATA[dalle-2]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[move]]></category>
            <category><![CDATA[sui]]></category>
            <dc:creator><![CDATA[HolaSui]]></dc:creator>
            <pubDate>Fri, 16 Dec 2022 12:24:39 GMT</pubDate>
            <atom:updated>2022-12-16T12:24:39.186Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L36YQfKiDPUdichuRGE_LQ.png" /></figure><p>Mystery boxes are a popular mechanic in many video games that offer players the chance to receive a random selection of virtual items. These items can range from cosmetic upgrades to powerful weapons and abilities that can give players an advantage in the game.</p><p>This tutorial will cover the process of creating a mystery box non-fungible token (NFT) on the Sui Blockchain using the Move programming language. The NFT will feature three rarity levels: Gold, Silver, and Bronze. We will delve into the steps involved in creating and implementing this contract.</p><p><strong><em>Disclaimer:</em><br></strong>🌞 <em>LoyaltyGM</em> 🌞 — NFT-based loyalty reward platform allows companies to create proof-of-loyalty NFTs and connect smart contracts to track on-chain and social media activities.<br><em>Source Code: </em><a href="https://github.com/LoyaltyGM/sui-lootbox"><em>https://github.com/LoyaltyGM/sui-lootbox</em></a><em><br>Twitter: </em><a href="https://twitter.com/Loyalty_GM"><em>https://twitter.com/Loyalty_GM</em></a><em><br>Website: </em><a href="https://app.loyaltygm.com/lootbox"><em>https://app.loyaltygm.com/lootbox</em></a></p><h3>Step 1: Setting Up the Move Development Environment</h3><p>In this tutorial, we will not be covering every step of the installation process in detail, as it is recommended to refer to the <a href="https://docs.sui.io/devnet/learn">Sui documentation</a> for complete instructions.</p><p>However, here is a quick summary of the setting up the Move development environment:<br>1. Install the <a href="https://docs.sui.io/devnet/build/install#install-sui-binaries">Sui Binaries CLI</a> in order to build and compile your code.<br>2. Install the Visual Studio Code plugin for <a href="https://marketplace.visualstudio.com/items?itemName=damirka.move-syntax">Move syntax highlighting</a>, <a href="https://marketplace.visualstudio.com/items?itemName=move.move-analyzer">code analysis</a>, and <a href="https://marketplace.visualstudio.com/items?itemName=bungcip.better-toml">toml file support</a>.</p><p>It is important to set up a <a href="https://github.com/LoyaltyGM/sui-lootbox/blob/main/Move.toml">Move.toml</a> file in your project directory to configure your project’s dependencies and build settings. One way to do this is by cloning the <a href="https://github.com/MystenLabs/sui"><em>Sui repository</em></a> and using it as a path of dependencies to faster building:</p><pre>[package]<br>name = &quot;LootBox&quot;<br>version = &quot;0.0.1&quot;<br><br>[dependencies]<br>Sui = { local = &quot;../../sui/crates/sui-framework&quot; }<br><br>[addresses]<br>lootbox = &quot;0x0&quot;</pre><p>Also, we will be using the random library from <a href="https://github.com/Origin-Byte/movemate">Origin Byte</a> in our smart contract. In order to use this library, we will need to include it as a dependency in our project:</p><pre>[dependencies.Movemate]<br>git = &quot;https://github.com/LoyaltyGM/movemate.git&quot;<br>subdir = &quot;sui&quot;<br># devnet-0.18.0<br>rev = &quot;a9b1ff5919cb5e9f6e44fd663cb84db344c171eb&quot;</pre><p>Now that we have set up our development environment and identified the necessary dependencies.</p><h3>Step 2: Building Smart-Contract — Mystery Box</h3><p>In this step, we will be defining three main structures: <strong>Collection, Mystery Box, and Loot</strong>, which will be used to represent the different elements of our smart contract.</p><p><strong>Collection</strong> structure represents the set of mystery boxes collection that will be created. It will be initialized only once when the contract is deployed. It includes a <a href="https://docs.sui.io/devnet/build/programming-with-objects/ch5-dynamic-fields">dynamic field</a>(<em>_box_counter_per_account</em>) that stores the number of boxes that have been minted for each user. The table uses the user’s address as the key and the number of boxes minted as the value. We create this separately and do not include it in the BoxCollection structure because we want don’t do an overload of structure.</p><pre><br>struct BoxCollection has key {<br>    id: UID,  // collection id<br>    creator: address, // who deploy collection<br>    box_max_supply: u64, <br>    box_url: Url,  // IPFS image for mystery box<br>    box_price: u64, // (optional) price<br>    rarity_types: vector&lt;String&gt;, // vector of string with types(Gold, Silver, Bronze)<br>    rarity_weights: vector&lt;u64&gt;, // vector of uint with weight(0.05, 0.25, 0.7)<br>    <br>    // changable<br>    _box_minted: u64, <br>    _box_opened: u64,<br>    <br>    // --dynamic fiels--<br>    //_box_counter_per_acount: vec_map&lt;address, u64&gt;, // to count account and ref in Table<br>}</pre><p>We will be creating a private function for defining the types and weights of our mystery boxes. This function will allow us to specify Vector the values for each type of box, such as the rarity level and the corresponding weight:</p><pre>fun rarity_type(): vector&lt;String&gt; {<br>   let rarity_types = vector::empty&lt;String&gt;();<br>    vector::push_back(&amp;mut rarity_types, string::utf8(b&quot;Bronze&quot;));<br>    vector::push_back(&amp;mut rarity_types, string::utf8(b&quot;Silver&quot;));<br>    vector::push_back(&amp;mut rarity_types, string::utf8(b&quot;Gold&quot;));<br>    rarity_types <br>}<br><br>fun rarity_weight(): vector&lt;u64&gt; {<br>    let rarity_weights = vector::empty&lt;u64&gt;();<br>    vector::push_back(&amp;mut rarity_weights, 70);<br>    vector::push_back(&amp;mut rarity_weights, 25);<br>    vector::push_back(&amp;mut rarity_weights, 5);<br>    rarity_weights<br>}</pre><p>As we mentioned before, we will be initializing the Collection structure and creating an empty table for storing data related to each user’s address. This table will be used to track the number of boxes minted for each user:</p><pre>use sui::dynamic_object_field as dof;<br>use sui::table::{Self};<br><br>// For dynamic field table key, <br>// with this variable we can borrow values from table<br>const COUNTER_KEY: vector&lt;u8&gt; = b&quot;_box_counter_per_acount&quot;;<br><br>fun init(ctx: &amp;mut TxContext) {<br>    let rarity_types = rarity_type();<br>    let rarity_weights = rarity_weight();<br>    <br>    let collection = BoxCollection {<br>        id: object::new(ctx),<br>        creator: tx_context::sender(ctx),<br>        box_max_supply: 1000,<br>        box_url: url::new_unsafe_from_bytes(BOX_URL),<br>        box_price: 10_000_000, // 0.01<br>        rarity_types: rarity_types,<br>        rarity_weights: rarity_weights,<br>        _box_minted: 0,<br>        _box_opened: 0,<br>    };<br>    // create dynamic field table with empty table<br>    dof::add(&amp;mut collection.id, COUNTER_KEY, table::new&lt;address, u64&gt;(ctx));<br>    transfer::share_object(collection);<br>}</pre><p>Now that the Collection structure is set up, we need to create the actual <strong>Mystery Boxes(LootBox) structure</strong> and implement functions for managing them. To do this, we will create a separate file called <em>store.move(</em><a href="https://github.com/LoyaltyGM/sui-lootbox/blob/main/sources/store.move"><em>GitHub</em></a><em>),</em> where we will write functions for interacting with the table that stores data for each user’s address. These functions will include checks for whether an entry already exists in the table and methods for adding and updating data in the table. When the<em> buy_box</em> function is called, a new mystery box (LootBox) will be created, and the table will be updated to reflect the new box:</p><pre>/// Unopened box(Mythery box) before open<br>struct LootBox has key, store {<br>    id: UID,<br>    name: String,<br>    description: String,<br>    url: Url,<br>}<br><br>public entry fun buy_box( <br>    collection: &amp;mut BoxCollection,<br>    ctx: &amp;mut TxContext<br> ) {<br><br>    let n = collection._box_minted + 1;<br>    let sender = tx_context::sender(ctx);<br>    /// get table <br>    let table = dof::borrow_mut(&amp;mut collection.id, COUNTER_KEY);<br>    assert!(n &lt; collection.box_max_supply, EMaxSupplyReaced);<br>    let isUserExist = store::user_exists(table, sender);<br>    // check to how many times user minted<br>    if(isUserExist) {<br>        assert!(store::get_minted_counter(table, sender) &lt; MAX_MINTED_PER_ADDRESS, EMaxMintedPerAddress);<br>    };<br>    <br>    let box = LootBox {<br>        id: object::new(ctx),<br>        name: string::utf8(b&quot;Mystery Box&quot;),<br>        description: string::utf8(b&quot;Unopened box&quot;),<br>        url: url::new_unsafe_from_bytes(BOX_URL),<br>    };<br><br>    /// event <br>    emit(BuyBoxEvent {<br>        box_id: object::id(&amp;box),<br>        buyer: sender,<br>    });<br><br><br>    collection._box_minted = n;<br>    // update minted counter in Table<br>    if(isUserExist) {<br>        store::update_minted_counter(table, sender);<br>    } else {<br>        store::add_new_data(table, ctx);<br>    };<br>    // don&#39;t forget to send object to user<br>    transfer::transfer(box, sender);<br>        <br>  }</pre><p>The final step in our Move code involves creating the <strong>Loot structure</strong>, which represents the contents of a mystery box when it is opened. Before we can open a box, we need to define this structure and specify the different types of loot that can be obtained:</p><pre>struct Loot has key, store {<br>    id: UID,<br>    name: String,<br>    description: String,<br>    rarity: String,<br>    score: u64,<br>    url: Url<br>}</pre><p>In order to determine the rarity of the loot that is obtained when a mystery box is opened, we will be using a pseudorandom function from the <a href="https://github.com/Origin-Byte/movemate"><em>Origin Byte repository</em></a>. It is worth noting that when oracles and more reliable sources of randomness, such as <a href="https://docs.chain.link/vrf/v2/introduction/">Chainlink VRF</a>, become available, they should be used instead. The function calculates a rarity score for the loot and uses it to determine which rarity level (Bronze, Silver, or Gold) the loot belongs to.</p><pre>use movemate::pseudorandom::{Self};<br><br>const LOW_RANGE: u64 = 1;<br>const HIGH_RANGE: u64 = 100;<br><br>fun get_loot_score(ctx: &amp;mut TxContext): u64 {<br>    pseudorandom::rand_u64_range_with_ctx(LOW_RANGE, HIGH_RANGE + 1, ctx)<br>}<br><br>fun get_loot_rarity(score: u64, collection: &amp;mut BoxCollection): String {<br>    let types = collection.rarity_types;<br>    let weights = collection.rarity_weights;<br>    <br>    let result_rarity = *vector::borrow(&amp;types, 0);<br>    <br>    let r = score + HIGH_RANGE;<br>    let length = vector::length(&amp;weights);<br>    let i = 0;<br>    loop {<br>        if (i &gt;= length) break;<br>        r = r - *vector::borrow(&amp;weights, i);<br>        if (r &lt;= HIGH_RANGE) {<br>            result_rarity = *vector::borrow(&amp;types, i);<br>            break<br>        };<br>        i = i + 1;<br>    };<br>    <br>    result_rarity<br>}</pre><p>To finish up, we just need to fill up the Loot structure, increment the opened boxes variable, and delete the MysteryBox(LootBox) structure:</p><pre>public entry fun open_box(collection: &amp;mut BoxCollection, box: LootBox, ctx: &amp;mut TxContext) {<br>    let sender = tx_context::sender(ctx);<br>    let LootBox{ id, name: _, description: _, url: _ } = box;<br>    <br>    let score = get_loot_score(ctx);<br>    let rarity = get_loot_rarity(score, collection);<br>    let loot = Loot {<br>        id: object::new(ctx),<br>        name: string::utf8(b&quot;LOOT&quot;),<br>        description: string::utf8(b&quot;LoyaltyGM Loot Prize&quot;),<br>        rarity: rarity,<br>        score: score,<br>        url: get_loot_rarity_url(https://medium.com/rarity),<br>    }<br>    // Event for open box<br>    emit(OpenBoxEvent {<br>        box_id: object::uid_to_inner(&amp;id),<br>        loot_id: object::id(&amp;loot),<br>        opener: sender<br>    });<br><br>    collection._box_opened = collection._box_opened + 1;<br>    // !DELETE LootBox <br>    object::delete(id);<br>    transfer::transfer(loot, sender)<br> }</pre><p>We have completed the work on the smart contract.🎉🥳 Don’t forget to test or review it. After that, you can deploy it on Sui Devnet and try it out. But before you do, we forgot to create images for the loot and boxes.</p><h3>Step 3 —Generate images with DALLE-2 and ChatGPT</h3><p>As you may already be aware, <a href="https://openai.com/">DALLE-2 and ChatGPT</a> are popular ML models. Today, we won’t be discussing them, but let’s ask ChatGPT for ideas for the boxes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NeQj13CW_uAHF7C_4550pw.png" /></figure><p>Okay, let’s write this text in DALLE-2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wkH2rYgmkJdQwMWXKNSoEg.png" /></figure><p>Hmmm, that doesn’t look too bad. Let’s create another one</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hV2mQkhN6xKyxcwCjWv_Hw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DqVVhLN4-6NaEH9-Py44GA.png" /></figure><p>A small tip for anyone using DALLE or MidJourney: at the end of the text, include the tag ‘digital art’ to make the image more realistic and high quality.</p><p>As you can see, we have spent a lot of time creating cyberpunk boxes for minting</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SATz4pxymNt4HDXF-cnGUw.png" /></figure><p>and for the question mark</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HpxJOVPCZGoICpeJxSTZKA.png" /></figure><p>and for loot:)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aGdyGzniEQTCIAR7E3mWUQ.png" /></figure><p>Finally, we selected 5 pictures and uploaded them to IPFS. After that, we did a little bit of web programming and deployed smart-contract on sui. <br>LFG! Congratulations! 🚀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*29lotFompak_Nx3xp6j5xQ.png" /></figure><p><strong>Don’t forget to try: </strong><a href="https://app.loyaltygm.com/lootbox"><strong>app.loyaltygm.com/lootbox</strong></a><strong> <br>and claps 👏 if you like it.</strong></p><p><strong>About us:</strong><br>🌞 LoyaltyGM 🌞 — NFT-based loyalty reward platform allows companies to create proof-of-loyalty NFTs and connect smart contracts to track on-chain and social media activities. Companies can create an upgradeable NFT, set up a points system, and a level system to incentivize and reward loyal customers.</p><p><strong>Contact us:<br></strong>Twitter: <a href="https://twitter.com/Loyalty_GM">https://twitter.com/Loyalty_GM</a><br>Email: info@loyaltygm.com<br>Telegram: <a href="https://t.me/vakurin">https://t.me/vakurin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7bdccac8568" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>