<?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 moaludin on Medium]]></title>
        <description><![CDATA[Stories by moaludin on Medium]]></description>
        <link>https://medium.com/@moaludin?source=rss-4c732bdd401d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9xJSXIhcZeQVA_dowwHgVQ.jpeg</url>
            <title>Stories by moaludin on Medium</title>
            <link>https://medium.com/@moaludin?source=rss-4c732bdd401d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 22:35:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@moaludin/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[Why I don’t feel safe with my own self — mekCurhat]]></title>
            <link>https://medium.com/@moaludin/why-i-dont-feel-safe-with-my-own-self-mekcurhat-17cf36abccc8?source=rss-4c732bdd401d------2</link>
            <guid isPermaLink="false">https://medium.com/p/17cf36abccc8</guid>
            <dc:creator><![CDATA[moaludin]]></dc:creator>
            <pubDate>Tue, 08 Sep 2026 15:58:28 GMT</pubDate>
            <atom:updated>2026-09-08T15:58:28.575Z</atom:updated>
            <content:encoded><![CDATA[<p>I always found that i dont have enough.. not good-looking enough, not smart enough, not consistent enough, not rich enough, not success enough and lots of other not enough. I always compare myself to others, always feels and thinks others is better than me.. In anything. F*ck!!</p><p>The most insecurities coming from my communication, relationship, self love. idk what im taling about, but thats what i feel. I just always see others, always investing too much time and energy to others, eventhough others not behave good enough to me, am I trying too hard to pleasing people?</p><p>Why??</p><p>I think I do… but why??</p><p>I get lost in the dark, lost in the storm of mind. Got too much information, that not processed properly. Try to learn too much thing. Good at none. I also keep blaming my own self for everything bad happen in my and others live. keep negative talk to my own self. I know it’s not good for long run, and i don’t know when it all start, but it’s just.. happen.</p><p>How to process all of this thing, like.. bruh.. It hurts.</p><p>I think i need to dissappear.. I need some peace in my mind, talking to lots of people in real life. not virtually. working out, do lots of stuff. and not thinking for other people. Detoxing myself from the internet, social media specifically or any other virtual entertainment, just back to the nature. exploring places and things, connected with new people and the one that i’ve known before. reading books, looking at the pictures, album, playing game with children in the neighboorhood. being kind. positive thinking to everything, go back to god, not try to controlling all of the things in the world, and always being in a good mood.</p><p>“Controlling Everything” is always become my worst enemy, it’s keep appear. why?? why?? why??</p><p>I know that I cant control everything, but still I can’t let go of it. It’s harder than it looks. I think the root is the fear of not being accepted.</p><p>Being true to ourself is scary..</p><p>Sorry for the unstructured story, i just want to dump all of my feels and thought in it.. It’s okey, little by little. you don’t need to rush.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17cf36abccc8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Digital Vending Machine: Coding Our Token Sale Contract | TCT Part 3]]></title>
            <link>https://blog.blockmagnates.com/the-digital-vending-machine-coding-our-token-sale-contract-tct-part-3-64abe371fc7e?source=rss-4c732bdd401d------2</link>
            <guid isPermaLink="false">https://medium.com/p/64abe371fc7e</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[moaludin]]></dc:creator>
            <pubDate>Mon, 01 Sep 2025 15:31:43 GMT</pubDate>
            <atom:updated>2025-09-02T09:03:20.132Z</atom:updated>
            <content:encoded><![CDATA[<p>Congratulations!! You’ve successfully written, compiled, and deployed your very own ERC-20 token. Our token is born and living on a test network — but right now, it’s just sitting alone in your wallet. So, what’s next? How do we make it available to the world?</p><p>The answer is a <strong>Token Sale smart contract</strong>. Think of it as a vending machine, a vending machine that sell your token ($TCT). You send in your Ether (like putting in a dollar), and the token sale contract automatically dispenses the correct amount of TCT tokens to your wallet. It’s an automated, secure, and transparent way to distribute our new digital asset.</p><p>In this final installment, we’ll build and deploy this smart vending machine for TCT. By the end, you’ll be able to send test ETH to your new contract and see TCT tokens magically appear in your wallet — ready to be used in our future blockchain coffee shop!</p><h3>The Token Sale Contract: Key Features &amp; Design</h3><p>To get started, you’ll need the address of your deployed TCT token from part 2 (you can redeploy it together with me, in the end of this article). We’ll be using the same tools: Remix IDE, Solidity, and OpenZeppelin.</p><p>Before writing the code, we need to understand the thing that we want to build, the key feature and design. Our Token Sale contract will be simple and powerful. It needs to do three key things:</p><ol><li>Know which token to sell.</li><li>Set the price (the ‘rate’ of exchange).</li><li>Handle the transaction: accept Ether and automatically send the right amount of TCT to the buyer.”</li></ol><h3>Crafting Our Token Sale Contract (Code Walkthrough):</h3><p>Without further ado, let’s start building our vending machine!! In the same directory let’s create a new file named “TokenSale.sol”. All of the work will be written in this TokenSale.sol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*k5nsK5Jk8fAogtxF2n3l4w.png" /></figure><p><strong>Code Block 1: Imports &amp; State Variables:</strong></p><p>Import necessary contracts (IERC20.sol, Ownable.sol). There are two contracts we need to import, IERC20.sol and Ownable.sol. In IERC20.sol we import an interface of the ERC20 Token. An interface is a blueprint or a set of rules. It defines <em>what</em> functions must exist in a contract, including their names, parameters, and return types, but it <strong>does not contain any code (implementation)</strong> inside those functions. The “I” in IERC20 stands for Interface. Its sole purpose is to tell other contracts what to expect from an ERC-20 token contract.</p><p>Then Ownable.sol contains a modifier onlyOwner that can be used to give restrict permissions in certain functionality. This modifier will ensure that only the owner of the contract that can execute the function called.</p><pre>// SPDX-License-Identifier: MIT<br>pragma solidity ^0.8.20;<br><br>import {IERC20} from &quot;@openzeppelin/contracts/token/ERC20/IERC20.sol&quot;;<br>import {Ownable} from &quot;@openzeppelin/contracts/access/Ownable.sol&quot;;<br><br>interface ICoffeeToken is IERC20{<br>    function mint(address to, uint256 amount) external;<br>}</pre><p>Because IERC20 only defines the core, mandatory function of ERC20 standard: totalSupply(), balanceOf(), transfer(), allowance(), approve(), and transferFrom(), so we need to adds our custom mint() function.</p><p>Next, we’ll declare our state variables and events. Our contract will have two key state variables, coffeeToken and priceInWei. coffeeToken will have a datatype of ICoffeeToken, which is the interface we made before. Then the priceInWei will store the price of the token in Wei.</p><pre>contract CoffeeTokenSale is Ownable {<br>    ICoffeeToken public coffeeToken;<br>    uint256 public priceInWei;<br><br>    event purchasedToken(address buyerAddress, uint256 amountETH, uint256 amountToken);<br>    event newTokenPrice(address changer, uint256 newPrice);</pre><p>There are also two events, purchasedToken and newTokenPrice, that will be used to write a log in the transaction history. purchasedToken() will be emitted when the buyToken() function is called. It will contain three pieces of information: the buyer’s address, the amount of ETH sent, and the number of tokens minted. newTokenPrice() will be emitted when the setPriceInWei() function is called. It will contain two pieces of information: the address of the changer and the new price of the token.</p><p><strong>Code Block 2: The Constructor:</strong></p><pre>constructor(address _coffeeTokenAddress, uint256 _priceInWei) <br>    Ownable(msg.sender)<br>    {<br>        require(_coffeeTokenAddress != address(0), &quot;Token address must be valid, You input address 0x0&quot;);<br>        require(_priceInWei &gt; 0, &quot;Price must be greater than 0&quot;);<br>        coffeeToken = ICoffeeToken(_coffeeTokenAddress);<br>        priceInWei = _priceInWei;<br>    }</pre><p>The constructor is a special function that runs only once when our smart contract is first deployed. It’s like the initial setup wizard for our token vending machine.</p><p>In our code, the constructor takes two arguments: _coffeeTokenAddress (the address of our TCT contract we deployed in Part 2) and _priceInWei (the price of the token in Wei). We also call Ownable(msg.sender) to set the contract&#39;s owner to the address that deploys it.</p><p>Because a constructor is essentially a function, we can add rules to it. Here, we use require statements to validate our inputs: we ensure that the token address is not a zero address (address(0)) and that the token price is greater than zero. After that, we set our two state variables, coffeeToken and priceInWei, to the values passed into the constructor.</p><p><strong>Code Block 3: The </strong><strong>buyTokens Function (The Core Logic):</strong></p><p>This is the most crucial part of our contract, the buyTokens() function. This is where we handle all buy transactions for our token. First, this function will receive the ETH sent to the contract, calculate the number of tokens to transfer, and then call the transfer() function on our TCT contract to send the appropriate amount to the sender.</p><pre>function buyToken() public payable {<br>        require(msg.value &gt; 0, &quot;Not enough ETH&quot;);<br>        uint256 tokenToTransfer = msg.value / priceInWei;<br><br>        require(tokenToTransfer &gt; 0, &quot;Not enough ETH to buy any token&quot;);<br>        require(tokenToTransfer &lt;= coffeeToken.balanceOf(address(this)), &quot;Not enough tokens available in this contract&quot;);<br>        coffeeToken.transfer(msg.sender, tokenToTransfer);<br><br>        emit purchasedToken(msg.sender, msg.value, tokenToTransfer);<br>    }</pre><p>To give a function the ability to receive ETH, we must add the <strong>payable</strong> modifier in its definition. The first thing we do inside the function is check if msg.value (the amount of ETH sent in Wei) is greater than zero. If not, it will revert with an error message.</p><p>Next, we calculate the number of tokens to transfer. We store this in a local variable called tokenToTransfer, which is simply msg.value divided by our pre-set token price (priceInWei). We then use a require statement to ensure the calculated amount is greater than zero before proceeding.</p><p>Finally, we call the transfer() function on our TCT contract to create the new tokens and send them to the sender&#39;s address (msg.sender). This is possible because, if you remember from our constructor, we set the coffeeToken variable to the address of our TCT contract, so our buyToken() function knows exactly which contract to call.</p><pre>coffeeToken = ICoffeeToken(_coffeeTokenAddress);</pre><p><strong>Code Block 4: The </strong><strong>setPriceInWei Function:</strong></p><p>This function allows the owner of the token sale to set a new price for the token. While giving a single person this much power isn’t ideal for a truly decentralized project (it’s often handled by community voting in more advanced systems), we’ll build it this way to learn about the crucial <strong>onlyOwner</strong> modifier.</p><pre>function setPriceInWei(uint256 _newPriceInWei) public onlyOwner { <br>        require(_newPriceInWei &gt; 0, &quot;New price must be greater than zero&quot;);<br>        priceInWei = _newPriceInWei;<br><br>        emit newTokenPrice(owner(), _newPriceInWei);<br>    } </pre><p>First, we define the function to take one argument, _newPriceInWei. The function can be seen publicly (public), but thanks to the onlyOwner modifier, it can only be called by the contract’s owner.</p><p>Inside the function, we use a require statement to make sure the new price is greater than zero. Then, we update the priceInWei state variable with the new value. Finally, we <strong>emit an event</strong> to create a public log of this action, which helps with transparency and documentation on the blockchain.</p><p><strong>Code Block 5: The </strong><strong>withdraw Function:</strong></p><pre>function withdrawETH() public onlyOwner {<br>        payable(owner()).transfer(address(this).balance); <br>    }</pre><p>This is the last function in our contract. With this function owner will have the ability to collect ETH that the contract have. You might be thinking: “Wait, isn’t it dangerous to let the owner take all the ETH?” That’s a great question, and the answer lies in the contract’s purpose.</p><p>In our case, the Token Sale contract is a fundraising vehicle, so the withdrawETH() function is not only expected but also absolutely necessary. It allows the owner to safely collect the funds raised from selling the tokens. The onlyOwner modifier ensures that only the authorized person can call this function, making it a secure mechanism for our project.</p><blockquote>A quick note on security: If you were to see a withdrawAll() function in a contract that is not a token sale (like a lending protocol or a decentralized exchange), that would be a major red flag for a potential rug pull. Always check a contract&#39;s code to understand its purpose and the permissions its functions grant to the owner.</blockquote><pre>payable(owner()).transfer(address(this).balance);</pre><p>The line payable(owner()).transfer(address(this).balance); is a crucial part of this function. Let&#39;s break it down:</p><ul><li>address(this).balance: This gets the total balance of ETH currently held by the smart contract.</li><li>payable(owner()): This converts the owner&#39;s address into a payable type, which is required to send ETH to it.</li><li>.transfer(): This is the actual function that sends the ETH.</li></ul><p>Together, the line transfers all the ETH held by the contract to the owner’s address.</p><h3>Deployment &amp; Interaction in Remix:</h3><p>Next is the deployment. In this step we will deploy two contracts, the TurrasCoffeeToken.sol and TokenSale.sol. So first open the TurrasCoffeeToken.sol, go to Deploy &amp; run transactions scroll down until you found the constructor that look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*Z3OZfXw-OLGLhYyfg7qxiA.png" /></figure><p>You can set the initialSupply and capSupply as you wish, like in this example we set the initial to 1000 and max/cap to 2000. Then click transact.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*z_K44O7KV1cx1cGPIqUuLQ.png" /></figure><p>Great, the next step is deploying our tokensale contract. First copy the address of the deployed contract, scroll down and find the TURRASCOFFEETOKEN in deployed contracts section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*cXwc2lCY0eFYUW_MrfEw3Q.png" /></figure><p>Then, do the same to TokenSale.sol. Open and fill the argument in the constructor. In this example we set the price to 0.001 ether that equals to 1000000000000000 in wei. You can use an online tool to help you with the conversion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*FLgciWPUxle5C8q7_IMZTQ.png" /></figure><p>Now lets try to buy a token. First enter 1000000000000000 in the value, then click the buyToken.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*9pMdi_RKW3uNVNcQndEWyQ.png" /></figure><p>It will give you an error, that says that the contract doesn’t have enough tokens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ObOgRAQ82hD3yp2_b4MGcQ.png" /></figure><p>To solve this, we need to transfer some tokens from TCT contract to tokensale contract. Make sure use the address that deployed the TCT contract.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*YHhmOIBAZtJvXhyROjXxlQ.png" /></figure><p>Lets try buy the token again. You’ll see checklist if the transaction successful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gmfkNaFMDRR2BEgtdLxX4g.png" /></figure><p>Try to buy from another address with 0.01 ETH value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*toIUpdahzJkZ-hf386eNxA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*5xJ0fVwUsgtmp-7vbjfEkA.png" /></figure><p>Let’s try to withdraw all of the ETH raised in the contract to the owner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*Lx1PhimIhYSLYlQAQ0cCQg.png" /></figure><p>Before:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*EL6pg6vnpKquVdgJBtVJ3w.png" /></figure><p>After:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*0voWjUjlTckZIx6t-RjTew.png" /></figure><p>As you can see, the owner address get all of the ETH in the contract.</p><blockquote>Notes: Actually there is two method to aproach the buyToken() functionality, the first one is like what we use, we call transfer() function, this is the recomended aproach, because it will only give the tokensale contract the ability to buy/sell their own token. The contract will buy certain amount of token from TCT contract, then they sell it through their own contract, with the maximal amount the token they own or already bought. The other method is using mint() every buy transaction. This logic will give the tokensale contract the ability to mint() or creating new token every buy transaction. This aproach can have major security risk, like Over-Privileging the Contract and Vector for a Rug Pull.</blockquote><h3>Conclusion</h3><p>You did it! You’ve gone from a theoretical understanding of ERC-20 to a fully functional digital economy. Your Turra’s Coffee Token is not only alive on the blockchain but is now a tradable asset that people can purchase with ETH.</p><p>From here, we could build a website to interact with our token sale, create a full decentralized application (dApp) around TCT, or even implement more advanced features like token vesting, price tiers, or airdrops. The foundation is now yours to build upon!</p><p>Thank you very much, for reading an article this long. I would really apreciate it if you can share your thought in the comment section. Also it would be great if we can work together to develop this or another project. Please contact me :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64abe371fc7e" width="1" height="1" alt=""><hr><p><a href="https://blog.blockmagnates.com/the-digital-vending-machine-coding-our-token-sale-contract-tct-part-3-64abe371fc7e">The Digital Vending Machine: Coding Our Token Sale Contract | TCT Part 3</a> was originally published in <a href="https://blog.blockmagnates.com/">Block Magnates</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Brewing Our Own Digital Assets: Coding Turra’s Coffee Token (TCT) with OpenZeppelin | TCT Part 2]]></title>
            <link>https://blog.blockmagnates.com/brewing-our-own-digital-assets-coding-turras-coffee-token-tct-with-openzeppelin-part-2-55590552691d?source=rss-4c732bdd401d------2</link>
            <guid isPermaLink="false">https://medium.com/p/55590552691d</guid>
            <category><![CDATA[blockchain-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum-blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[moaludin]]></dc:creator>
            <pubDate>Wed, 06 Aug 2025 04:12:48 GMT</pubDate>
            <atom:updated>2025-09-01T15:33:40.181Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello again, and welcome back to the Turra’s Coffee Token series! In <a href="https://medium.com/block-magnates/brewing-up-blockchain-the-erc-20-secret-for-your-own-digital-coffee-tokens-part-1-c03ac33c86e5">Part 1</a>, we brewed up a conceptual understanding of ERC-20 tokens, explored their game-changing impact, and introduced our very own project: Turra’s Coffee Token (TCT).</p><p>Now, it’s time to turn that vision into a tangible digital asset. You’ll be surprised how straightforward it is to create your own ERC-20 token, especially with the help of powerful tools. By the end of this article, you’ll have compiled and deployed your own TCT to a test network — all without any complex local setup!</p><p>For this hands-on coding adventure, we’ll be relying on two fantastic tools designed to simplify your journey:</p><ul><li><strong>Remix IDE:</strong> This is our browser-based development environment for Solidity smart contracts. It’s incredibly user-friendly, meaning you don’t need to download or install anything locally to follow along — just a web browser and an internet connection.</li><li><strong>OpenZeppelin Contracts:</strong> This is a library filled with battle-tested, secure, and pre-audited code for common blockchain standards like ERC-20 (and ERC-721, etc.). It helps us build robust tokens quickly and safely, without having to write every fundamental piece of code from scratch.</li></ul><h3>2. Why OpenZeppelin?</h3><p>If you remember, there are six essential functions an ERC-20 token MUST have (totalSupply, transfer, balanceOf, approve, allowance, and transferFrom). Writing each function manually is obviously exhausting work; you will need to write and test it. Not only time-consuming but also incredibly prone to errors and security vulnerabilities.</p><p>That’s where <strong>OpenZeppelin</strong> comes! OpenZeppelin provides a library of secure, battle-tested, and community-audited smart contracts that expertly implement many standards, including ERC-20. With this library, you don’t need to worry about coding those fundamental, standard functions ourselves. You can focus on your specific application.</p><h3>3. Setting Up Our Project in Remix IDE</h3><p>As promised, we’re keeping things simple and browser-based for this coding session. Let’s get our workspace ready in <strong>Remix IDE</strong>:</p><ol><li><strong>Open Remix IDE:</strong></li></ol><ul><li>First things first, open your web browser and navigate to the <strong>Remix IDE</strong> website: <a href="https://remix.ethereum.org/">https://remix.ethereum.org</a></li></ul><p><em>(Self-Correction Tip: If Remix asks you to choose a workspace, just select a default one or create a new empty one to keep things clean. You might also see some default files already open; you can close them if they clutter your view.)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AJQSDZKO956uF4peNmKcpg.png" /></figure><p><strong>2. Create Our Smart Contract File:</strong></p><ul><li>In the ‘File Explorer’ panel on the left sidebar (it looks like a folder icon 📁), click on the ‘Create new file’ icon (it’s typically a plus sign + or a paper icon with a plus on it).</li><li>Name your new Solidity file TurrasCoffeeToken.sol and press Enter. This is where our token&#39;s code will live!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*1FsS80Cw7UxIkSTCIyX_IA.png" /></figure><p><strong>3. No Installation Needed for OpenZeppelin! (Remix Magic )</strong></p><ul><li>This is where Remix really shines! Unlike local development environments where you’d typically run npm install @openzeppelin/contracts, <strong>Remix automatically handles the imports for standard libraries like OpenZeppelin.</strong></li><li>Once you type import &quot;@openzeppelin/contracts/...&quot;; into your Solidity file, Remix&#39;s compiler intelligently fetches and makes those contracts available. No extra plugin activation or installation steps needed for OpenZeppelin contracts themselves!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_vvNmhSEn9H2u9PU9C2ELA.png" /></figure><p>With our file created and Remix ready to handle our OpenZeppelin imports, we’re all set to dive into the exciting part: writing the actual code for Turra’s Coffee Token!</p><h3>4. Crafting Our Turra’s Coffee Token (TCT) Smart Contract (Code Walkthrough):</h3><p>Without further ado, let’s dive into the code.</p><h4>Block 1: The Basic Structure and Imports</h4><p>The first thing we need to write is the License Identifier and solidity version.</p><pre>// SPDX-License-Identifier: MIT<br>pragma solidity ^0.8.27;</pre><p>the // SPDX-License-Identifier is a comment that tells anyone looking at your code what rules they need to follow if they want to use or build upon it. There is some license out there, such as MIT, GPL-3.0-only and UNLICENSED. The MIT license will allow anyone to use, modify, and redistribute it as long as they keep include the original license, this license is often used open-source project.</p><p>If your project is for internal use and you don’t intend it to be used by others you can use UNLICENSED, it’s basically a closed project.</p><p>Then the pragma solidity ^0.8.27; line tells the Remix compiler which version of Solidity to use. The ^ symbol means ‘compatible with this version and any newer minor versions, but not major breaking changes.’</p><p>Before We continue I want to set some ability that our token have:</p><ul><li>It will have name and symbol</li><li>Certain function will only able to call by certain account with a certain role, such as minter, burner, etc.</li><li>Our token will have maximum token distributed (cap), it will make the token have a value and avoid the possibility of abuse.</li><li>Our token is burnable, means token can be destroyed by the owner.</li></ul><p>So for doing it, first we need to import some of the utility that have built by openzeppelin. We’re essentially telling our contract to ‘borrow’ pre-written, highly secure code for the core ERC-20 functionalities, plus features for access control (who can do what), a token cap (maximum supply) and burnable ability (token’s owner can destroy their token).</p><pre>import {ERC20} from &quot;@openzeppelin/contracts/token/ERC20/ERC20.sol&quot;;<br>import {AccessControl} from &quot;@openzeppelin/contracts/access/AccessControl.sol&quot;;<br>import {ERC20Capped} from &quot;@openzeppelin/contracts/token/ERC20/extensions/ERC20Capped.sol&quot;;<br>import {ERC20Burnable} from &quot;@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol&quot;;</pre><p>As you can see, to import module from openzeppelin you can simply call import &quot;&lt;contract_needed&quot;,like I’ve said before we will need to import four contract. The ERC20.sol as a core token, AccessControl.sol for managing role, ERC20Capped.sol to set maximum token supply, and ERC20Burnable.sol to give ability to burn the token.</p><p>Solidity allows us to import specific contracts from a library by using curly brackets {}. This is a best practice because it helps keep our code clean and prevents potential naming conflicts. For example, {ERC20} tells the compiler to only grab the ERC20 contract from the ERC20.sol file.</p><blockquote>You can also use OpenZeppelin Wizard to easily create a foundation code, use it in: <a href="https://wizard.openzeppelin.com/">https://wizard.openzeppelin.com/</a></blockquote><p>After that, the next step is start making contract. Contract is just like a class in OOP. In contract you can have state and functions.</p><pre>contract TurrasCoffeeToken is ERC20, AccessControl, ERC20Capped, ERC20Burnable {<br>    bytes32 public constant MINTER_ROLE = keccak256(&quot;MINTER_ROLE&quot;);<br>    bytes32 public constant BURNER_ROLE = keccak256(&quot;BURNER_ROLE&quot;);<br><br>    constructor(uint256 initialSupply, uint256 capSupply)<br>        ERC20(&quot;TurrasCoffeeToken&quot;, &quot;TCT&quot;)<br>        AccessControl()<br>        ERC20Capped(capSupply * 10 ** decimals())<br>    {<br>        _mint(msg.sender, initialSupply * 10 ** decimals());<br>        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);<br>        _grantRole(MINTER_ROLE, msg.sender);<br>        _grantRole(BURNER_ROLE, msg.sender);<br>    }<br><br>    function _update(<br>        address from,<br>        address to,<br>        uint256 value<br>    ) internal virtual override(ERC20, ERC20Capped) {<br>        super._update(from, to, value);<br>    }<br><br>    function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) {<br>        _mint(to, amount);<br>    }<br><br>    receive() external payable {}<br>}</pre><p>To use the library we’ve import, we need to inherit it in our token contract. Look at the first line contract TurrasCoffeeToken is ERC20, AccessControl, ERC20Capped, ERC20Burnable : Theis is way to &quot;inheriting&quot; or &quot;gaining superpowers from&quot;. TCT now <em>is</em> an ERC-20 token, <em>has</em> access control, <em>has</em> a max cap, and burnable.</p><h4>Block 2: Constructor &amp; Initial Minting</h4><p>After defining new contract, we need to add some role and define some initial condition of our token, like the name &amp; symbol, max supply and the role.</p><pre>contract TurrasCoffeeToken is ERC20, AccessControl, ERC20Capped, ERC20Burnable {<br>    bytes32 public constant MINTER_ROLE = keccak256(&quot;MINTER_ROLE&quot;);<br>    bytes32 public constant BURNER_ROLE = keccak256(&quot;BURNER_ROLE&quot;);<br><br>    constructor(uint256 initialSupply, uint256 capSupply)<br>        ERC20(&quot;TurrasCoffeeToken&quot;, &quot;TCT&quot;)<br>        AccessControl()<br>        ERC20Capped(capSupply)<br>    {<br>        _mint(msg.sender, initialSupply);<br>        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);<br>        _grantRole(MINTER_ROLE, msg.sender);<br>        _grantRole(BURNER_ROLE, msg.sender);<br>    }</pre><p>Here is the explanation of that code:</p><ul><li>bytes32 public constant MINTER_ROLE = keccak256{“MINTER_ROLE”) : is the code that define the role identifier. bytes32 is solidity data types used to store 32-bytes sequences of data, perfect for storing cryptographic hash.</li><li>public is visibility modifier. solidity have four visibility modifier, public, private, internal, and external. public modifier give the ability to the variable to be seen and used in anywhere, inside and outside of the contract.</li><li>constant is keyword that tells the compiler that the value will never change after deployed.</li><li>MINTER_ROLE is the name of the variable.</li><li>keccak256 is a cryptographic hash function native to Solidity. It takes a string of data (in this case, &quot;MINTER_ROLE&quot;) and produces a unique, fixed-size bytes32 hash.The key property of keccak256 is that it&#39;s a one-way function. It&#39;s easy to generate the hash from the string, but practically impossible to go backward from the hash to the original string. Actually we can even use string as a identifier, but it’s not storage and gas efficient.</li><li>constructor(...) ERC20(...) ERC20Capped(...): The constructor is a special function that runs only once when our smart contract is first deployed. This is where we set its initial conditions. Note that uint256 values for token amounts always need to account for decimals. If we want to mint 1,000 Turra&#39;s Coffee Tokens, we need to add 18 zeros after it (1,000 * 10¹⁸). This is a very important concept! So, when we call this constructor, we&#39;ll input our desired amounts as initialSupply * 10 ** decimals() and capSupply * 10 ** decimals() to ensure we get the right number of tokens.</li><li>ERC20(&quot;Turra’s Coffee Token&quot;, &quot;TCT&quot;) ERC20Capped(capSupply * 10 ** decimals()) This part initializes the parent contracts (ERC20 and ERC20Capped) by passing them our token’s name, symbol, and the maximum cap we want to set.</li><li>_grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(MINTER_ROLE, msg.sender); These lines assign roles. The DEFAULT_ADMIN_ROLE gives full administrative control. We also grant the MINTER_ROLE, which will allow us to mint new tokens later. msg.sender refers to the address that deployed this contract (likely your address).</li><li>_mint(msg.sender, initialSupply); This is the crucial line that ‘brews’ our very first batch of TCTs! The _mint function (provided by OpenZeppelin) creates the initialSupply of tokens and sends them to the msg.sender (your address). This immediately sets our totalSupply and updates your balanceOf as discussed in Part 1!</li></ul><pre>function _update(<br>        address from,<br>        address to,<br>        uint256 value<br>    ) internal virtual override(ERC20, ERC20Capped) {<br>        super._update(from, to, value);<br>    }</pre><p>You’ll notice this _update function. This is necessary because both the ERC20 and ERC20Capped contracts (which we are inheriting from) have their own versions of this same function. To prevent an error, we have to tell our contract which one to use. This code essentially says: &#39;I&#39;m overriding this function, so please use the version from ERC20Capped, and then use the super keyword to also call the original logic from ERC20.&#39; This ensures both the core ERC-20 logic and our token&#39;s cap are properly enforced.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*o3ggtgLDnpKE4BlLwUAL4Q.png" /><figcaption>what will happen if you dont add _update() function</figcaption></figure><h4>Block 3: The Custom Mint Function</h4><p>Then the custom mint() function is used to make the minter to have the ability to create more tokens (up to the cap).</p><pre>function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) {<br>        _mint(to, amount);<br>    }<br><br>    receive() external payable {}</pre><p>The function need two argument, to and amount; this function can be call by anyone, but only success if the caller have the MINTER_ROLE, cause we use onlyRole(MINTER_ROLE). this function will operate _mint(), the token minted will transfer to the address of the first argument (to), with the amount of amount. Remember, this new minting will always respect the cap we set for the total supply of our Turra&#39;s Coffee Tokens!</p><p>The receive() external payable {} function is a special function that allows our smart contract to accept Ether (ETH) sent to it. While our TCT is not directly built to handle ETH, including this function is a common best practice in many token contracts. It will become even more relevant in Part 3 when we build our Token Sale contract, which <em>will</em> need to accept ETH in exchange for tokens!</p><h3>5. Compiling Our Contract in Remix:</h3><p>After the code is done, its time to compile our contract. Remix actually will auto compile your contract, but nothing wrong to know how to do it manually. Click on the ‘Solidity Compiler’ icon (looks like a Solidity logo) in the left sidebar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*QjXv-5tHuhZzPj6bMLEcyQ.png" /></figure><p>Make sure the compiler version matches your pragma solidity (e.g., 0.8.27). Remix usually autoselects the best one.</p><p><strong><em>A Quick Note on the Compiler:</em></strong><em> You’ll notice that even though we set </em><em>pragma solidity ^0.8.27, Remix might recommend a slightly newer version like </em><em>0.8.30. This is because the </em><em>^ symbol we used means our code is compatible with any minor updates to the version, so Remix is smart enough to pick the latest compatible one for you. This is a feature, not an error!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*zIMUagv5UY5cIXtTMAVjbQ.png" /></figure><p>Click the ‘Compile TurrasCoffeeToken.sol’ button. If everything looks good, you’ll see a green checkmark — success!”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/86/1*vDyR7TnPuz4X59xzKx7ZFg.png" /></figure><p><strong>Your Turn!</strong></p><blockquote><em>Try experimenting with the compiler version. What happens if you try to compile with a version that isn’t compatible with your code? You’ll see a clear error message from Remix, which is an important part of the development process!</em></blockquote><h3>6. Deploying Our Turra’s Coffee Token to a Test Network in Remix:</h3><p>Next, click on the ‘Deploy &amp; Run Transactions’ icon (looks like an Ethereum logo with an arrow) in the left sidebar.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*L2VhS6ALp1TZ982z0a8Biw.png" /></figure><p>Under ‘Environment,’ select one of the ‘Remix VM’. With this option you will deploy your contract in the Remix VM, its a virtual environtment that simulate the mainnet without need any setting, its a great option for development step. Or if you want to deploy in a specific testnet you can select ‘Injected Provider — MetaMask’. This connects Remix to your MetaMask wallet, which should be set to a test network like Sepolia (make sure you have some test ETH from a faucet!).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*T0ZwumHokpJ3lCLSQbApqg.png" /></figure><p>After selecting the environtment, next ensure ‘TurrasCoffeeToken’ is selected in the ‘Contract’ dropdown.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*SHT3dl4Fle7TmjeC6xqv0g.png" /></figure><p>Before deploying, we need to tell our contract how many tokens to mint initially and what its maximum supply (cap) should be. In the ‘Deploy’ section, next to the ‘Deploy’ button, you’ll see input fields for initialSupply and cap.</p><p><em>Example:</em> “Let’s use 1000000000000000000000000 (1 million with 18 decimals) for initialSupply and 2000000000000000000000000 (2 million with 18 decimals) for cap. Remember, Solidity often uses a fixed decimal system (like 18 decimal places for ETH), so we add all those zeros!&quot; (You can adjust these numbers to your preference).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*OhPPY1V02kvfacafvQCs9Q.png" /></figure><p>Click the orange ‘transact’ button. Once the transaction is confirmed, you’ll see your deployed contract listed under ‘Deployed Contracts’ below. Copy its address!”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*Yk9g-8Low8KlxA_XswjOOQ.png" /></figure><p>Now, let’s play with our TCT! Expand your deployed contract. You’ll see all those ERC-20 functions we talked about in Part 1 (like totalSupply, balanceOf, transfer) – these are automatically inherited from OpenZeppelin!&quot;</p><p><em>Action:</em> “Try calling totalSupply() and balanceOf with your own address. You should see your initial supply! You can even try a transfer to another address.&quot;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*nS6jfLgRwJ7WX3HDRRvkqw.png" /><figcaption>initial supply and max supply</figcaption></figure><h3>7. Conclusion</h3><p>Congratulations, digital brewer! You’ve just taken a massive leap: writing, compiling, and deploying your very own ERC-20 Turra’s Coffee Token to the blockchain! You’ve witnessed firsthand how OpenZeppelin dramatically simplifies implementing secure, standardized token functionality, allowing us to focus on our token’s unique purpose.</p><p>But what’s a token if it’s sitting all alone in your wallet? In our final installment, <strong>Part 3</strong>, we’ll build a <strong>Token Sale smart contract</strong> that allows eager coffee lovers (and anyone else!) to purchase TCTs with Ether. Get ready to launch your digital coffee economy and make your token available to the world!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55590552691d" width="1" height="1" alt=""><hr><p><a href="https://blog.blockmagnates.com/brewing-our-own-digital-assets-coding-turras-coffee-token-tct-with-openzeppelin-part-2-55590552691d">Brewing Our Own Digital Assets: Coding Turra’s Coffee Token (TCT) with OpenZeppelin | TCT Part 2</a> was originally published in <a href="https://blog.blockmagnates.com/">Block Magnates</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Brewing Up Blockchain: The ERC-20 Secret for Your Own Digital Coffee Tokens | TCT Part 1]]></title>
            <link>https://blog.blockmagnates.com/brewing-up-blockchain-the-erc-20-secret-for-your-own-digital-coffee-tokens-part-1-c03ac33c86e5?source=rss-4c732bdd401d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c03ac33c86e5</guid>
            <category><![CDATA[ethereum-blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[erc20]]></category>
            <category><![CDATA[blockchain-development]]></category>
            <dc:creator><![CDATA[moaludin]]></dc:creator>
            <pubDate>Fri, 01 Aug 2025 13:53:12 GMT</pubDate>
            <atom:updated>2025-09-01T15:34:18.982Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NuY55MQQwHszeAXG92-EpQ.jpeg" /></figure><p>Ever wondered how your favorite coffee shop could reward its most loyal customers beyond a punch card? Or how a community could truly own a piece of their beloved local spot, digitally? In the exciting world of blockchain, these aren’t just hypotheticals — they’re possibilities powered by a humble yet revolutionary concept: the <strong>ERC-20 token standard.</strong></p><p>You’ve probably heard about Bitcoin and Ethereum, but what about the thousands of other digital assets buzzing around? Chances are, many of them are built on this powerful standard. Today, we’re going to demystify ERC-20, showing you why it’s the blueprint for digital value, all while imagining how we can ‘brew’ up a blockchain future for our very own <strong>“Turra’s Coffee Token” (TCT)!</strong></p><p>This is Part 1 of our three-part adventure. Here, we’ll explore what ERC-20 is and why it’s a game-changer. In Part 2, we’ll roll up our sleeves and write the code to create TCT. And in Part 3, we’ll even set up a clever way to sell your tokens to eager coffee lovers!”</p><h3>What Exactly is an ERC-20 Token?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N4Xyvmrm-6uMzJcKkU7BMw.png" /></figure><p>Do you ever play online games that need a lot of communication and strategies? Do you ever play it on a server that has a lot of players from different countries? How is your comms? What language are you guys using?</p><p>I personally love playing Valorant, and because I am playing in the Singapore server, there are a lot of players from different countries, of course with different languages. It is nearly impossible to communicate effectively if we all use our own country’s language. But because there’s English as an international language, which has become a standard for our communication, it makes it possible to communicate and strategize better.</p><p>That’s exactly what an ERC-20 token is like! <strong>ERC-20 is a standard, or a set of fundamental rules, that ensures all tokens built on the Ethereum blockchain behave and ‘talk’ in a predictable and consistent manner.</strong></p><p>Why does this matter so much?</p><p>Previously, the blockchain was a bit like a digital Tower of Babel. There were hundreds of tokens, each with its own unique smart contract and conditions. Developers of wallets and other applications had to write completely custom code from scratch just to support a single currency. This made the development of new cryptocurrencies and the wider blockchain ecosystem incredibly difficult and slow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*u2IZXNGtU9zgefGtyf8nJQ.jpeg" /></figure><p>The ERC-20 standard changed everything. It defines a set of clear rules and functions that every token <em>must</em> follow to be accepted and able to interact seamlessly with other tokens on the network. Think of it as providing a universal remote control for all Ethereum-based tokens! This standard makes the development of the blockchain ecosystem much, much easier. It allows any ERC-20 token to ‘talk’ to wallets, exchanges, and decentralized applications (dApps) without needing a separate translator for each one.</p><h4>The Core Rules: What Every ERC-20 Token MUST Do</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JyCKJqEVY3uqbsUpB_G2qw.png" /></figure><p>To be clear, these aren’t just vague suggestions. The ERC-20 standard outlines six <strong>mandatory functions</strong> that every compliant token’s smart contract must implement. These are the core actions or “buttons” that define how your digital coffee token will operate. While we’ll dive into the actual code in Part 2, here’s a sneak peek at what these essential functions allow your token to do:</p><ol><li><strong>totalSupply</strong>: This function simply tells you the <strong>total number of tokens</strong> that have been &#39;minted&#39; or created.</li><li><strong>balanceOf(address account)</strong>: This function reveals address/account <strong>token balance</strong>. It&#39;s like checking your coffee loyalty card points, but for tokens on the blockchain!</li><li><strong>transfer(address recipient, uint256 amount)</strong>: It allows you to <strong>send a specific amount of tokens</strong> from your own wallet to another person&#39;s wallet. Buying a TCT-powered latte? This is the function working behind the scenes.</li><li><strong>approve(address spender, uint256 amount)</strong>: It lets you <strong>grant permission</strong> to another entity (like a decentralized exchange or a payment processing smart contract) to spend a <em>specific amount</em> of your tokens on your behalf. You&#39;re giving them authorization, not actually sending the tokens yet!</li><li><strong>allowance(address owner, address spender)</strong>: After you&#39;ve used approve, this function lets anyone (or any contract) <strong>check how much an </strong><strong>owner has allowed a </strong><strong>spender to take</strong>.</li><li><strong>transferFrom(address sender, address recipient, uint256 amount)</strong>: This is the action that occurs <em>after</em> approve. It allows the spender (who was previously approved) to <strong>move tokens from the </strong><strong>sender&#39;s wallet to a </strong><strong>recipient&#39;s wallet</strong>. This is how many complex interactions in DeFi (Decentralized Finance) happen, enabling automated trading or secure payments without you manually sending every token.</li></ol><p>These six functions are the bedrock of ERC-20. They are the universal grammar that allows all tokens on Ethereum to play nicely together, enabling the incredible ecosystem we see today — and soon, our very own Turra’s Coffee Tokens!</p><h3>Why ERC-20 Matters: Beyond Just Digital Coins</h3><p>We’ve seen that ERC-20 is the universal language for tokens on Ethereum, defining how they speak and behave. But what makes this ‘standardized’ language so powerful, shaping entire new industries? Let’s dive into the superpowers ERC-20 grants to tokens and why it has made such a monumental impact:</p><p>1. Interoperability</p><p>Because all ERC20 tokens follow the same rule, they seamlessly work with any compatible wallet, exchange, or decentralized application (dApp). It makes the integration of the token easier. Token<strong>s</strong> can be used in any dApp without requiring custom code for each new token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dAiTFg5PeioMYCEBZwMb7w.png" /></figure><p>Imagine if every coffee machine needed a different type of coffee bean. Chaos! ERC-20 ensures that your Turra’s Coffee Tokens will ‘plug-and-play’ with almost any standard crypto wallet, allowing you to easily store, send, or even trade them. It’s the ultimate digital compatibility. This seamless ‘plug-and-play’ means your Turra’s Coffee Tokens can easily move between your personal crypto wallet, a decentralized exchange to trade them, or even a future blockchain-powered coffee ordering app — all without any headaches.</p><p>2. Rapid Innovations &amp; Development</p><p>Because of this standard, developers don’t need to build the foundation from scratch. They can use existing, secure, and battle-tested libraries (like OpenZeppelin, which we’ll use in Part 2). This dramatically speeds up development and reduces security risks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*ecC6XPtso1rpTZqkv7s-eQ.jpeg" /></figure><p>Before ERC-20, building a new token was like designing a new coffee maker just for a specific type of coffee bean. Now, with a standard template, developers can focus on the <em>unique flavor</em> and <em>purpose</em> of their token, rather than the basic ‘brew’ mechanism. This fuels incredible innovation across the blockchain space.</p><p>3. Enhanced Trust and Transparency</p><p>One of ERC-20’s most profound impacts lies in establishing a new level of trust and clarity. Imagine if every action related to your coffee loyalty program was out in the open, verifiable by anyone, and enforced by unchangeable rules — that’s the power ERC-20 tokens inherit from the blockchain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*5sAev-QU1CkVGsvCr7WX9Q.jpeg" /></figure><ul><li>The Public, Permanent Record: Every single Turra’s Coffee Token transaction, from its initial ‘minting’ (creation) to every transfer between wallets, is permanently recorded on the Ethereum blockchain. It’s like having a digital receipt for every TCT movement, visible to the entire world via tools like Etherscan. No hidden transactions, no secret stashes — just pure, verifiable transparency.</li><li>Code is Law (Smart Contract Automation): Remember, ERC-20 tokens are powered by smart contracts. This means the rules for how your TCTs behave — like how transfer works or how balanceOf is calculated – are literally programmed into immutable code. You&#39;re not trusting a company&#39;s promises; you&#39;re trusting mathematics and code that execute automatically and impartially, free from human error or bias.</li><li>Decentralized Control (No Single Authority):<strong> </strong>Your TCTs aren’t controlled by a single server or company. They live on the decentralized Ethereum network, making them incredibly resistant to censorship or unexpected shutdowns. This means the coffee shop itself can’t arbitrarily freeze your tokens or change the loyalty rules on a whim. The trust is in the robust network, not in a single entity.</li></ul><p>Now that we understand the fundamental advantages ERC-20 brings, let’s explore some of the real-world scenarios where these versatile tokens are making a huge impact — and how they could even revolutionize your daily coffee habit!</p><ol><li>Loyalty and Reward Programs</li></ol><p>Imagine earning tokens for every latte you bought. These aren’t just points, they’re a digital assets you could trade with friends or anyone actually, use for exclusive VIP experience (like special flavor), or even saved up to get a lifetime supply of your favorite blend. The possibilities are truly endless compared to rigid, closed loyalty systems.</p><p>2. Decentralized Governance and Voting</p><p>What if the holders can actually involved in making business decision, like voting for new menu items, whether the shop sources beans from a new farm, or even design decisions for a new location. This makes the business truly community-driven, empowering token holders with a direct say in its future and aligning benefits with the community’s collective interests.</p><p>3. Fundraising and Crowdfunding</p><p>Project can raise capital by selling tokens. Like when Turra’s Coffee want to open a new branch, instead of traditional loans, they could sell a new batch of TCTs to their most loyal customers and fans. These early supporters get a direct stake and benefit if the business thrives. This has revolutionized how startups and even established projects can raise funds</p><p>4. Representing Real-World Asset (Tokenization)</p><p>ERC-20 tokens can even represent ownership of physical assets like real estate, art, or gold, making them easier to buy, sell, and even own fractionally. Imagine a separate token representing a share in the coffee shop’s building, or a token that signifies ownership of a rare, limited-edition bag of premium coffee beans. ERC-20 makes it easy to tokenize almost anything, opening up new markets and forms of ownership that were previously inaccessible to most.</p><p>5. Backbone of Decentralized Finance (DeFi)</p><p>From borrowing money using your tokens as collateral, to earning interest by lending them out, ERC-20 tokens are the workhorses of the rapidly expanding DeFi world, creating entirely new financial systems that are open and accessible to anyone, anywhere.</p><p>As you can see, ERC-20 tokens are far more than just ‘digital coins’ or loyalty points. They are incredibly versatile, programmable building blocks that are enabling a new era of digital ownership, community participation, and financial innovation. From your daily latte to global financial markets, their impact is just beginning to unfold!</p><p>Now that we’ve explored the immense ‘why’ behind ERC-20, are you ready to see how easy it is to bring these powerful tokens to life? In the next part of our series, we’ll open up our coding tools and literally <strong>mint our first batch of Turra’s Coffee Tokens!</strong> Get ready — the future of coffee (and blockchain) awaits!</p><h4>Introducing Our Project: Turra’s Coffee Token (TCT)</h4><p>Not only will we learn about the theory of ERC-20, but in this series, we will actually make our very own ERC-20 token called Turra’s Coffee Token (TCT)!</p><p>This isn’t just a generic token; it’s a simple, practical example designed to introduce you to the fundamental functions of ERC-20. Imagine using it for loyalty rewards, exclusive perks, or even to give your voice a say in our fictional coffee shop’s future. We’ll be using the powerful and secure <strong>OpenZeppelin</strong> library to help us build this token with ease.</p><p>Ready to brew your own digital assets? In <strong>Part 2</strong>, we’ll dive straight into the code to bring TCT to life!</p><h4>Conclusion / Teaser for Part 2</h4><p>So, there you have it! In this first part of our adventure, we’ve gone from the bustling, multilingual comms of a Valorant server to the foundational magic of the ERC-20 token standard. You now understand what this universal language is, how its core functions operate, and why it’s a game-changer for everything from revolutionizing loyalty programs to powering decentralized finance.</p><p>We’ve also laid the groundwork for our exciting project, <strong>Turra’s Coffee Token (TCT)</strong>, glimpsing how this simple digital asset can unlock new levels of customer engagement and community participation in our fictional coffee shop.</p><p>Now that you’re equipped with a solid understanding of ERC-20’s theory and its immense real-world potential, are you ready to bring your own digital assets to life?</p><p>In Part 2 of this series, the real fun begins! We’ll roll up our sleeves and dive straight into the code. Using the powerful and secure OpenZeppelin library, you’ll learn step-by-step how to write the smart contract for Turra’s Coffee Token, deploy it to a test network, and even mint your very first batch of TCTs!</p><p>Don’t miss it — the future of brewing digital value awaits!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c03ac33c86e5" width="1" height="1" alt=""><hr><p><a href="https://blog.blockmagnates.com/brewing-up-blockchain-the-erc-20-secret-for-your-own-digital-coffee-tokens-part-1-c03ac33c86e5">Brewing Up Blockchain: The ERC-20 Secret for Your Own Digital Coffee Tokens | TCT Part 1</a> was originally published in <a href="https://blog.blockmagnates.com/">Block Magnates</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Ethereum? | my Learning Notes]]></title>
            <link>https://blog.blockmagnates.com/what-is-ethereum-my-learning-notes-7a32d50f014f?source=rss-4c732bdd401d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a32d50f014f</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[turing-complete]]></category>
            <dc:creator><![CDATA[moaludin]]></dc:creator>
            <pubDate>Tue, 24 Jun 2025 06:13:42 GMT</pubDate>
            <atom:updated>2025-06-29T11:40:13.393Z</atom:updated>
            <content:encoded><![CDATA[<p>Today, as I continue my journey to become a blockchain developer, I learned about Ethereum. Some of you may be familiar with the term, while others might recognize Ethereum as one of the key players in the cryptocurrency world, much like I do. But is it just a coin, as we’ve seen before? How can something that lacks intrinsic value hold such a high price? I believe Ethereum offers something much bigger and more valuable than just a currency. So today, I will take a deep dive into this technology.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nArmv409XiM3kkgdY9nWUA.jpeg" /></figure><p>In this article we’ll try to get the answer some of the question i have in mind about Ethereum, here’s some of them:</p><ul><li>What is ethereum? the formal definition and the definition that i will understand.</li><li>what is the use of Ethereum, beside for the cryptocurrency?</li><li>who is this technology made for? how to utilize it? how to maximize the potential it have?</li><li>when we should use this technology? the case that suit to use this tech, the field, etc. the prospect in the future?</li><li>where we can find the use of this tech?</li><li>why this is metter? why we overhype about this tech? is it really worth it?</li><li>How the tech works? how can we build decentralized supercomputer using ETH?</li></ul><p>Ethereum is a decentralized, open-source blockchain platform that enable the creation of smart contracts and decentralized applications (dApps). It’s often described as a “<strong>world computer</strong>” or a <strong>platform for building and running applications without central authority.</strong> The native cryptocurrency of the Ethereum network is Ether (ETH).</p><h3><strong>Ethereum vs Bitcoin</strong></h3><p>Bitcoin lunchend in 2009 as the world’s first cryptocurrency, with the single goal of creating a decentralized universal currency. Currency that not require any intermediary financial institutions, but still ensure safe and valid transactions. This idea is possible, thanks to the revolutionary technology called “<strong>blockchain</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*avTufA1SFMLYirJRDBTf9g.jpeg" /></figure><p>Blockchain is a digital ledger that continously recording and verifying records. It’s used to track and verify Bitcoin transactions. Because whoever can run nodes to contribute in recording and verifying transactions in Bitcoin network, it’s almost impossible to manipulate the transaction. <em>notes: each records from each nodes will be compared to each other, an if the records not same with the other the records from the manipulated one will be changed to the majority records that own by the public network, it’s called consensus.</em></p><p>Similar to Bitcoin, Ethereum is a distributed public blockchain network. While both Ethereum and Bitcoin are cryptocurrencies that can be traded among users, there are many substantial differences between the two.</p><p>For example, Bitcoin use blockchain to track ownership of the digital currency, making it an extremely effective peer to peer electronic cash system. Ethereum, on the other hand, <strong>focuses on running the programming code of an application</strong>. Application developers largely use it to pay for services and transaction fees on the Ethereum network.</p><p>Both Bitcoin and Ethereum are “decentralized,” meaning they have no central control or issuing authority. Respective miners run each network by validating transactions to earn either bitcoin (for Bitcoin) or ether (for Ethereum).</p><h3><strong>What is Ethereum?</strong></h3><p>Like I said before, Ethereum is a blockchain-based decentralized platform that enables developers to build and run decentralized applications (dApps).</p><ul><li>Remember, blockchain is a database with no central server that keeps track of every transaction and exchange. The vast majority of cryptocurrencies and decentralized projects run on some application of blockchain.</li></ul><p>Ethereum’s appeal is that it’s built in a way that enables developers to create smart contracts. <strong>Smart contracts</strong> are scripts that automatically execute tasks when certain conditions are met. For example, a smart contract could technically say, “pay Jane $10 if she submits a 1000 word article on goats by September 15, 2018,” and it would pay Jane once the conditions are met.</p><p>A smart contract is a self-executing program that automates the actions required in a blockchain transaction. Once completed, the transactions are trackable and irreversible. Smart contracts permit trusted transactions and agreements to be carried out among disparate, anonymous parties without the need for a central authority, legal system, or external enforcement mechanism.</p><p>Smart contracts work by following simple “if/when…then…” statements that are written into code on a blockchain. A network of computers executes the actions when predetermined conditions are met and verified.</p><p>These actions might include releasing funds to the appropriate parties, registering a vehicle, sending notifications or issuing a ticket. The blockchain is then updated when the transaction is completed. That means the transaction cannot be changed, and only parties who have been granted permission can see the results.</p><p>Within a smart contract, there can be as many stipulations as needed to satisfy the participants that the task will be completed satisfactorily. To establish the terms, participants must determine how transactions and their data are represented on the blockchain, agree on the “if/when…then…” rules that govern those transactions, explore all possible exceptions and define a framework for resolving disputes.</p><p>Then, the smart contract can be programmed by a developer–although increasingly, organizations that use blockchain for business provide templates, web interfaces and other online tools to simplify structuring smart contracts.</p><p>These smart contracts are executed by the Turing-complete Ethereum Virtual Machine (EVM), run by an international public network of nodes.</p><p>Turing completeness is a concept from computer science that describes a system’s ability to perform any computation that can be expressed algorithmically, given enough time and resources. In the context of Ethereum, a Turing-complete system means that its programming language, Solidity, can execute any computational task or algorithm. This capability allows developers to create complex smart contracts and decentralized applications (dApps) with a wide range of functionalities. Essentially, Ethereum’s Turing-completeness provides flexibility and power, enabling a diverse array of innovations on its blockchain.</p><p>The cryptocurrency of the Ethereum network is called <strong>ether</strong>. Ether serves two different functions:</p><ol><li><strong>Compensate the mining full nodes that power its network. </strong>This keeps things running smoothly at an administrative level.</li><li><strong>Pay people under smart contract conditions.</strong> This is what motivates users to work on the Ethereum platform.</li></ol><p>Actually the thing that I write in this article on originally from my thought, I just actually just copy-paste a lot of thing in this article from Alex Moskov.</p><p><a href="https://coincentral.com/what-is-ethereum-the-ultimate-beginners-guide/">What is Ethereum? | The Ultimate Beginners&#39; Guide - CoinCentral</a></p><p>Besides that I also search for another reference to get more detailed definition.</p><ul><li><a href="https://www.geeksforgeeks.org/ethical-hacking/what-is-meant-by-turing-complete-in-ethereum/">What is Turing-Completeness in Ethereum? - GeeksforGeeks</a></li><li><a href="https://medium.com/@estheraladioche569/ethereum-and-turing-completeness-4d5043230a1f">Ethereum and Turing Completeness</a></li><li><a href="https://www.investopedia.com/terms/s/smart-contracts.asp">What Are Smart Contracts on the Blockchain and How Do They Work?</a></li><li><a href="https://www.ibm.com/think/topics/smart-contracts">What Are Smart Contracts on Blockchain? | IBM</a></li><li><a href="https://www.geeksforgeeks.org/ethical-hacking/what-is-ethereum-virtual-machine-and-how-it-works/">What is Ethereum Virtual Machine and How it Works? - GeeksforGeeks</a></li><li><a href="https://ethereum.org/en/developers/docs/evm/">Ethereum Virtual Machine (EVM)</a></li></ul><p>I’ll just make this article as a note for my learning process.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a32d50f014f" width="1" height="1" alt=""><hr><p><a href="https://blog.blockmagnates.com/what-is-ethereum-my-learning-notes-7a32d50f014f">What is Ethereum? | my Learning Notes</a> was originally published in <a href="https://blog.blockmagnates.com/">Block Magnates</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The actual first step | the Footsteps]]></title>
            <link>https://medium.com/@moaludin/the-actual-first-step-the-footsteps-b6c060c76735?source=rss-4c732bdd401d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6c060c76735</guid>
            <category><![CDATA[journaling]]></category>
            <category><![CDATA[storyofmylife]]></category>
            <dc:creator><![CDATA[moaludin]]></dc:creator>
            <pubDate>Sun, 22 Jun 2025 16:04:15 GMT</pubDate>
            <atom:updated>2025-06-22T16:06:08.222Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HL7Mpbs4rjPjoCARXfp_jw.jpeg" /></figure><p>Hi there, this is my actual first step to start everything. Not much to say in this post, but i just want to mark my first day writing something. My plan is to write two series, the first one is called “the Footsteps” it’s the series to tell the story of that day, the topic is everything I can think of, it can randomly about the presentation i do in class, or just tell about the non-productive activity I do that day, like scrolling, sleeping, etc. And for the other one, is called &lt;i don’t decide it yet, “the Journey”?&gt;. Wait a minute… what if the first one is called “the Day” and the other one is “the Footsteps”? nahh.. i think it’s a bad idea. i think the second will be called “the Journey” for now, because in this series i will talk about something that need more effort, something more technical, like some coding stuff, or anything that need extra efforts.</p><p>Before i close this article i will tell my day.</p><p>I think it’s a non-productive day, like in the morning i don’t do any exercise, in that moment i really feel motivated to continue my learn about blockchain, but in that moment i just watch one video related to it, then not continue it. But, i do continue it in the evening, right now. I even read an article about the topic i learned, it’s called <a href="https://coincentral.com/what-is-ethereum-the-ultimate-beginners-guide/">What is Ethereum? by Alex Moskov</a>. Remember the other series I want to write? the Journey? I start write it, the topic is same with the theory i learned from the video and the article, in that article I want to make a notes for my self and test my understanding about the topic, but it turns out to be copy-paste article i’ve read, I’m scared to being wrong and want to look good, eventhough i actually don’t. It’s not publish yet, cause i know i need to do it my self, and actually learnt.</p><p>That’s for today, thank youu for reading it..</p><p>Babyee.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6c060c76735" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>