<?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 Fikri R. on Medium]]></title>
        <description><![CDATA[Stories by Fikri R. on Medium]]></description>
        <link>https://medium.com/@frdblock?source=rss-de889a04aa64------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9STS0ydQeTkJbCy-BmWdTA.jpeg</url>
            <title>Stories by Fikri R. on Medium</title>
            <link>https://medium.com/@frdblock?source=rss-de889a04aa64------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 23 May 2026 23:11:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@frdblock/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[Tutorial singkat membuat token di Solana]]></title>
            <link>https://frdblock.medium.com/tutorial-singkat-membuat-token-di-solana-818c6d83d989?source=rss-de889a04aa64------2</link>
            <guid isPermaLink="false">https://medium.com/p/818c6d83d989</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[solanas]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Fikri R.]]></dc:creator>
            <pubDate>Tue, 18 Feb 2025 12:45:50 GMT</pubDate>
            <atom:updated>2025-02-18T12:45:50.226Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*bvthOIKRgm9kTN_vKGozJg.png" /></figure><h3>Pendahuluan</h3><p>Solana merupakan salah satu blockchain yang populer untuk pembuatan aset digital, termasuk token. Dengan menggunakan <strong>Solana CLI</strong> dan <strong>Token Extensions Program</strong>, kita dapat membuat token dengan lebih mudah karena metadata seperti nama, simbol, dan gambar dapat disimpan langsung di akun mint token. Panduan ini akan menjelaskan langkah demi langkah cara membuat token di Solana menggunakan metode terbaru yang lebih efisien.</p><h3>1. Mengapa Menggunakan Token Extensions?</h3><p>Dulu, metadata token di Solana harus disimpan dalam akun terpisah, yang membuat proses lebih rumit. Dengan Token Extensions, metadata dapat langsung disimpan dalam akun mint token, sehingga lebih sederhana dan kompatibel dengan berbagai dompet serta platform eksplorasi Solana.</p><p>Program lama: <strong>TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA</strong> (memerlukan akun metadata terpisah).<br>Program baru (Token Extensions): <strong>TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb</strong> (metadata langsung di akun mint).</p><h3>2. Persiapan: Instalasi dan Konfigurasi Solana CLI</h3><h4>a. Menginstal Solana CLI</h4><p>Unduh dan instal Solana CLI sesuai dengan panduan resmi Solana.</p><h4>b. Membuat Folder dan Konfigurasi Kunci</h4><p>Buka terminal dan buat folder untuk proyek token:</p><pre>mkdir new-token &amp;&amp; cd new-token</pre><p>Buat keypair untuk otoritas mint token:</p><pre>solana-keygen grind --starts-with bos:1</pre><p>Konfigurasi Solana CLI untuk menggunakan keypair yang baru dibuat:</p><pre>solana config set --keypair bosy1VC2BH2gh5fdXA3oKn53EuATLwapLWC4VR2sGHJ.json<br>solana config set --url devnet</pre><h3>3. Mendapatkan SOL untuk Biaya Transaksi</h3><p>Untuk menjalankan transaksi di Solana, kita membutuhkan SOL. Jika bekerja di <strong>Devnet</strong>, kita bisa mendapatkan SOL gratis dari <strong>Solana Faucet</strong>:</p><pre>solana airdrop 1</pre><p>Jika di <strong>Mainnet</strong>, kita harus membeli SOL melalui exchange atau swap.</p><h3>4. Membuat Alamat Mint Token</h3><p>Buat keypair untuk akun mint token:</p><pre>solana-keygen grind --starts-with mnt:1</pre><p>Alamat ini akan digunakan sebagai akun utama token mint.</p><h3>5. Membuat Akun Mint Token</h3><p>Tentukan jumlah desimal token (default: 9). Gunakan perintah berikut untuk membuat token mint dengan metadata:</p><pre>spl-token create-token --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb --enable-metadata mntTymSqMU4e1NEDdxJ9XoPN4MitCgQ7xxGW6AuRAWQ.json</pre><blockquote><strong><em>Catatan:</em></strong><em> Setelah token mint dibuat, kita tidak dapat menambahkan ekstensi tambahan.</em></blockquote><h3>6. Menambahkan Metadata Token</h3><h4>a. Mengunggah Gambar Token</h4><p>Unggah gambar ke penyimpanan online seperti <strong>IPFS, Arweave, atau AWS S3</strong>.</p><h4>b. Membuat dan Mengunggah Metadata JSON</h4><p>Buat file metadata.json dengan format berikut:</p><pre>{<br>  &quot;name&quot;: &quot;Example Token&quot;,<br>  &quot;symbol&quot;: &quot;EXMPL&quot;,<br>  &quot;description&quot;: &quot;Example token from Solana Making a Token guide.&quot;,<br>  &quot;image&quot;: &quot;https://link-ke-gambar.png&quot;<br>}</pre><p>Unggah file JSON ini ke penyimpanan online.</p><h4>c. Menghubungkan Metadata ke Token</h4><pre>spl-token initialize-metadata mntTymSqMU4e1NEDdxJ9XoPN4MitCgQ7xxGW6AuRAWQ &quot;Example Token&quot; &quot;EXMPL&quot; https://link-ke-metadata.json</pre><p>Setelah ini, metadata token akan tampil di Solana Explorer.</p><h3>7. Mencetak dan Mengirim Token</h3><h4>a. Membuat Akun untuk Menyimpan Token</h4><pre>spl-token create-account mntTymSqMU4e1NEDdxJ9XoPN4MitCgQ7xxGW6AuRAWQ</pre><h4>b. Mencetak Token</h4><p>Cetak 100 token ke akun yang baru dibuat:</p><pre>spl-token mint mntTymSqMU4e1NEDdxJ9XoPN4MitCgQ7xxGW6AuRAWQ 100</pre><h4>c. Mengirim Token ke Dompet Lain</h4><pre>spl-token transfer mntTymSqMU4e1NEDdxJ9XoPN4MitCgQ7xxGW6AuRAWQ 10 (alamat dompet) --fund-recipient</pre><blockquote><strong><em>— fund-recipient</em></strong><em> digunakan untuk membayar biaya pembuatan akun token penerima.</em></blockquote><h3>8. Menonaktifkan Otorisasi untuk Keamanan</h3><p>Setelah distribusi token selesai, kita bisa menonaktifkan beberapa fitur otorisasi agar token lebih aman.</p><h4>a. Menonaktifkan Minting Token (Agar Pasokan Tetap)</h4><pre>spl-token authorize {token_address} mint --disable</pre><p>Setelah menjalankan perintah ini, tidak ada yang bisa mencetak token baru, termasuk pemilik mint.</p><h4>b. Menonaktifkan Pembekuan Token</h4><pre>spl-token authorize {token_address} freeze --disable</pre><p>Dengan ini, tidak ada akun yang bisa membekukan atau mencairkan saldo token, membuatnya lebih transparan.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=818c6d83d989" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Download ebook Solidity gratis]]></title>
            <link>https://frdblock.medium.com/download-ebook-solidity-gratis-b77f3c749fad?source=rss-de889a04aa64------2</link>
            <guid isPermaLink="false">https://medium.com/p/b77f3c749fad</guid>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ebook-publishing]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Fikri R.]]></dc:creator>
            <pubDate>Sun, 03 Nov 2024 08:24:49 GMT</pubDate>
            <atom:updated>2024-11-03T08:24:49.270Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*_7CF4R9lJ7LJ-O3s.png" /></figure><p>Setelah berbulan-bulan menyusun materi, akhirnya saya dapat membagikan ebook yang dirancang khusus untuk membantu teman-teman yang tertarik menjadi web3 developer atau solidity engineer. Ebook ini lebih dari sekadar tutorial; ini adalah panduan komprehensif dari dasar hingga tingkat lanjut, ditulis dengan gaya ringkas yang merangkum berbagai dokumentasi menjadi satu sumber yang mudah dipahami.</p><p><strong>Apa yang Akan Kamu Pelajari di Ebook Ini?</strong></p><p><strong>1. Dasar-Dasar Blockchain, Ethereum, &amp; Solidity:</strong><br> Pelajari fondasi utama dari teknologi blockchain, pengenalan terhadap Ethereum, dan bagaimana Solidity digunakan untuk mengembangkan smart contract.</p><p><strong>2. Konsep Dasar Pemrograman di Solidity:</strong><br> Buku ini membahas setup environment yang dibutuhkan, tipe data, fungsi, dan berbagai konsep dasar yang akan membantu kamu membangun pemahaman teknis yang solid.</p><p><strong>3. Materi Lanjutan:</strong><br> Setelah menguasai dasar-dasar, kamu akan dibimbing untuk mendalami topik lanjut seperti event, error handling, debugging, dan keamanan dalam smart contract — hal-hal yang wajib dipahami seorang Solidity engineer.</p><p><strong>4. Pola Desain (Design Patterns):</strong><br> Dalam pengembangan smart contract yang efisien, pola desain seperti ownership, factory, dan proxy sangat diperlukan. Ebook ini akan membantu kamu memahami cara menggunakan pola-pola ini dalam proyek kamu.</p><p><strong>5. Bonus Repositori Kode Smart Contract:</strong><br> Sebagai tambahan, ebook ini juga menyertakan akses ke repositori kode smart contract sebagai referensi langsung yang bisa dipelajari dan diadaptasi ke dalam proyek kamu.</p><p><strong>Unduh Ebook “Mastering Solidity” 100% Gratis!</strong></p><p>Ebook ini tersedia secara gratis untuk kamu yang serius ingin menjadi seorang Solidity engineer atau web3 developer. Jangan lewatkan kesempatan untuk memiliki ebook ini secara cuma-cuma! Kamu dapat mengunduhnya melalui tautan berikut: <a href="https://skydope.gumroad.com/l/mastering-solidity-ebook-ID">https://skydope.gumroad.com/l/mastering-solidity-ebook-ID</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b77f3c749fad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exclusive Free eBook: Mastering Solidity and Ethereum Development]]></title>
            <link>https://medium.com/coinmonks/exclusive-free-ebook-master-solidity-and-ethereum-development-d75a005c0787?source=rss-de889a04aa64------2</link>
            <guid isPermaLink="false">https://medium.com/p/d75a005c0787</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ebook-publishing]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Fikri R.]]></dc:creator>
            <pubDate>Fri, 21 Jun 2024 13:31:04 GMT</pubDate>
            <atom:updated>2024-06-25T03:35:22.414Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*S24rtE0lYVfhmnbAsurznA.png" /></figure><p>Are you ready to dive into the world of blockchain development and master the art of writing smart contracts with Solidity? I’m thrilled to offer the first 50 readers an exclusive opportunity to download my newly released eBook for free.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GOXMCpxmoRkXgrXrJvcSVA.png" /><figcaption>Table of Contents</figcaption></figure><h3>Why This eBook?</h3><p><strong>“Mastering Solidity: Comprehensive Guide to Solidity Development”</strong> is not just a book; it’s a complete resource designed to take you from a novice to a proficient Solidity developer. Drawing on my extensive experience in blockchain development, this eBook covers everything you need to know, from the basics of Solidity to advanced techniques in writing smart contracts. Here’s what you can expect inside:</p><ul><li><strong>Introduction to Blockchain Technology</strong>: I provide a thorough introduction to blockchain, highlighting its transformative impact across industries.</li><li><strong>Solidity Fundamentals</strong>: Learn the syntax, structure, and core concepts of the Solidity programming language.</li><li><strong>Smart Contract Development</strong>: Follow my guidance on creating, testing, and deploying smart contracts on the Ethereum network.</li><li><strong>Advanced Solidity Concepts</strong>: Explore inheritance, libraries, and design patterns that are crucial for writing secure and efficient smart contracts.</li><li><strong>Real-World Examples</strong>: I share practical examples and case studies from my experience to demonstrate the application of Solidity in real-world scenarios.</li><li><strong>Best Practices and Security</strong>: Discover my top tips and techniques for writing secure, scalable, and maintainable code.</li><li><strong>Comprehensive Reference Material</strong>: Access a wealth of resources and references to deepen your understanding and stay updated with the latest in Solidity development.</li></ul><p>Whether you’re just starting or looking to enhance your existing skills, this eBook is your ultimate companion in the world of blockchain development.</p><h3>Who Should Read This eBook?</h3><p>This eBook is perfect for:</p><ul><li><strong>Beginner Developers</strong>: Those new to blockchain and Solidity who want a clear, structured introduction.</li><li><strong>Intermediate Developers</strong>: Developers with some experience looking to deepen their knowledge and tackle more complex projects.</li><li><strong>Experienced Developers</strong>: Seasoned developers seeking to stay current with the latest best practices and trends in Solidity development.</li><li><strong>Tech Enthusiasts and Students</strong>: Individuals with an interest in blockchain technology who want to expand their understanding and skill set.</li></ul><h3>Exclusive Offer</h3><p>For a limited time, I’m offering this invaluable resource for free to the first 50 readers. Don’t miss out on this opportunity to elevate your blockchain development skills. By downloading my eBook, you will:</p><ul><li><strong>Gain Early Access</strong>: Be among the first to explore this comprehensive guide and enhance your development skills.</li><li><strong>Get Future Updates</strong>: Receive notifications about updates and additional resources related to Solidity and blockchain development.</li></ul><h3>How to Claim Your Free Copy</h3><p>To claim your free copy of <strong>“Mastering Solidity: Comprehensive Guide to Solidity Development”</strong>, simply click the download link below. Hurry, as this offer is only available to the first 50 readers!</p><p><a href="https://store.skydope.xyz/l/mastering-solidity-ebook">https://superxdev.gumroad.com/l/mastering-solidity-ebook</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d75a005c0787" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/exclusive-free-ebook-master-solidity-and-ethereum-development-d75a005c0787">Exclusive Free eBook: Mastering Solidity and Ethereum Development</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advanced Solidity: Event Logging and Error Handling]]></title>
            <link>https://medium.com/coinmonks/advanced-solidity-event-logging-and-error-handling-7262d341982a?source=rss-de889a04aa64------2</link>
            <guid isPermaLink="false">https://medium.com/p/7262d341982a</guid>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[web3]]></category>
            <dc:creator><![CDATA[Fikri R.]]></dc:creator>
            <pubDate>Wed, 29 May 2024 07:44:58 GMT</pubDate>
            <atom:updated>2024-05-29T09:56:28.854Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SRd6d7wctoz2oB78bvz9ug.png" /></figure><p>Solidity, the primary language for writing smart contracts on Ethereum, has unique features to handle logging and error management. Understanding these mechanisms is essential for developing robust and maintainable decentralized applications (dApps). This article delves into the intricacies of event logging and error handling in Solidity, providing a comprehensive guide for both beginners and experienced developers.</p><h3>Introduction to Event Logging</h3><h3>What are Events?</h3><p>In Solidity, events are a convenient way to log data on the Ethereum blockchain. They facilitate communication between smart contracts and their external users, enabling the creation of logs that can be easily accessed and monitored.</p><p>Events are typically emitted by smart contracts to signal that something significant has occurred. Once emitted, events are stored in the transaction logs of the blockchain, making them accessible for future reference.</p><h3>Use Cases of Events</h3><p>Events have several practical applications in smart contract development, including:</p><ul><li><strong>Transaction Notifications</strong>: Informing external applications when a particular action has taken place within the smart contract.</li><li><strong>State Changes</strong>: Logging changes in the state of the contract for auditing and debugging purposes.</li><li><strong>Data Storage</strong>: Storing historical data in an efficient manner that is cheaper than using contract storage.</li></ul><h3>Defining and Emitting Events</h3><h3>Syntax and Examples</h3><p>Defining an event in Solidity is straightforward. The syntax involves the event keyword followed by the event name and parameters.</p><pre>// SPDX-License-Identifier: MIT<br>pragma solidity ^0.8.0;<br><br>contract EventExample {<br>    // Define an event<br>    event DataStored(uint256 indexed id, string data);<br>    // Emit the event<br>    function storeData(uint256 id, string memory data) public {<br>        emit DataStored(id, data);<br>    }<br>}</pre><p>In this example, we define an event DataStored with two parameters: id and data. The event is emitted inside the storeData function, logging the values passed to it.</p><h3>Indexed Parameters</h3><p>Indexed parameters allow for efficient filtering of event logs. By marking a parameter with the indexed keyword, you can create up to three indexed parameters per event, enabling faster and more targeted searches.</p><pre>// SPDX-License-Identifier: MIT<br>pragma solidity ^0.8.0;<br><br>contract IndexedEventExample {<br>    // Define an event with indexed parameters<br>    event DataStored(uint256 indexed id, address indexed sender, string data);<br>    // Emit the event<br>    function storeData(uint256 id, string memory data) public {<br>        emit DataStored(id, msg.sender, data);<br>    }<br>}</pre><p>In this example, both id and sender are indexed, allowing for efficient querying based on these parameters.</p><h3>Subscribing and Listening to Events</h3><h3>Using Web3.js</h3><p>To listen for events emitted by a smart contract, you can use Web3.js, a popular JavaScript library for interacting with the Ethereum blockchain.</p><p>First, you need to set up a Web3 instance and connect to an Ethereum node.</p><pre>const Web3 = require(&#39;web3&#39;);<br>const web3 = new Web3(&#39;https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID&#39;));<br><br>// ABI of the contract<br>const abi = [/* Contract ABI here */];<br>// Address of the deployed contract<br>const address = &#39;0xYourContractAddress&#39;;<br>// Create contract instance<br>const contract = new web3.eth.Contract(abi, address</pre><p>Then, you can subscribe to the event using the events property of the contract instance.</p><pre>contract.events.DataStored({<br>    filter: {sender: &#39;0xSpecificAddress&#39;}, // Optional filter<br>    fromBlock: 0 // Start from block 0<br>}, (error, event) =&gt; {<br>    if (error) {<br>        console.error(error);<br>    } else {<br>        console.log(event.returnValues);<br>    }<br>});</pre><p>This code listens for the DataStored event, optionally filtering by the sender address and starting from block 0.</p><h3>Real-World Examples</h3><p>Let’s consider a more practical example: a simple voting contract.</p><pre>// SPDX-License-Identifier: MIT<br>pragma solidity ^0.8.0;<br><br>contract Voting {<br>    // Define events<br>    event VoteCasted(address indexed voter, uint256 proposalId);<br>    event ProposalAdded(uint256 indexed proposalId, string proposal);<br>    struct Proposal {<br>        string description;<br>        uint256 voteCount;<br>    }<br><br>    Proposal[] public proposals;<br>    // Add a new proposal<br>    function addProposal(string memory description) public {<br>        proposals.push(Proposal(description, 0));<br>        emit ProposalAdded(proposals.length - 1, description);<br>    }<br><br>    // Cast a vote<br>    function vote(uint256 proposalId) public {<br>        proposals[proposalId].voteCount++;<br>        emit VoteCasted(msg.sender, proposalId);<br>    }<br>}</pre><p>In this example, we define two events, VoteCasted and ProposalAdded, to log voting activities and the addition of new proposals. These events can be listened to in a dApp to update the UI in real-time whenever a vote is cast or a new proposal is added.</p><h3>Introduction to Error Handling</h3><h3>Importance of Error Handling</h3><p>Error handling is crucial in smart contract development to ensure the integrity and reliability of the contract. Effective error handling helps prevent unexpected behaviors, secure funds, and provide meaningful feedback to users and developers.</p><h3>Common Error Types</h3><p>In Solidity, errors can be broadly categorized into:</p><ul><li><strong>Assertion Failures</strong>: Using assert to enforce invariants and check internal errors.</li><li><strong>Requirement Failures</strong>: Using require to validate inputs and conditions.</li><li><strong>Reversions</strong>: Using revert to handle errors explicitly and revert the state.</li></ul><h3>Assert, Require, and Revert</h3><h3>Differences and Use Cases</h3><h4>Assert</h4><p>assert is used to check for conditions that should never be false. It is typically used to enforce invariants within the code. If an assert statement fails, it indicates a bug in the contract.</p><pre>function safeMath(uint256 a, uint256 b) public pure returns (uint256) {<br>    uint256 result = a + b;<br>    assert(result &gt;= a);<br>    return result;<br>}</pre><p>In this example, assert ensures that the addition operation does not overflow.</p><h4>Require</h4><p>require is used to validate inputs and conditions before executing the rest of the function. It is commonly used for input validation and to check conditions that should be true before proceeding.</p><pre>function transfer(address recipient, uint256 amount) public {<br>    require(balance[msg.sender] &gt;= amount, &quot;Insufficient balance&quot;);<br>    balance[msg.sender] -= amount;<br>    balance[recipient] += amount;<br>}</pre><p>Here, require checks if the sender has sufficient balance before proceeding with the transfer.</p><h4>Revert</h4><p>revert is used to handle errors explicitly and revert the state changes. It can be used with or without an error message.</p><pre>function withdraw(uint256 amount) public {<br>    if (balance[msg.sender] &lt; amount) {<br>        revert(&quot;Insufficient balance&quot;);<br>    }<br>    balance[msg.sender] -= amount;<br>    payable(msg.sender).transfer(amount);<br>}</pre><p>In this example, revert is used to handle the case where the balance is insufficient, providing an explicit error message.</p><h3>Custom Errors</h3><p>Solidity 0.8.4 introduced custom errors, which are more gas-efficient than revert strings. Custom errors allow developers to define and use specific error types within their contracts.</p><h3>Example</h3><pre>// SPDX-License-Identifier: MIT<br>pragma solidity ^0.8.0;<br><br>contract CustomErrorExample {<br>    error InsufficientBalance(uint256 available, uint256 required);<br>    mapping(address =&gt; uint256) balance;<br>    function withdraw(uint256 amount) public {<br>        uint256 available = balance[msg.sender];<br>        if (available &lt; amount) {<br>            revert InsufficientBalance(available, amount);<br>        }<br>        balance[msg.sender] -= amount;<br>        payable(msg.sender).transfer(amount);<br>    }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7262d341982a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/advanced-solidity-event-logging-and-error-handling-7262d341982a">Advanced Solidity: Event Logging and Error Handling</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are Oracle and Off-chain Data in Solidity]]></title>
            <link>https://frdblock.medium.com/what-are-oracle-and-off-chain-data-in-solidity-0e0f7cc5a1c1?source=rss-de889a04aa64------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e0f7cc5a1c1</guid>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Fikri R.]]></dc:creator>
            <pubDate>Thu, 23 May 2024 09:11:16 GMT</pubDate>
            <atom:updated>2024-05-23T09:16:05.062Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4i5ZcKcV5GI5TaxCjIZ15w.png" /></figure><h3>Introduction</h3><p>Ethereum, one of the most prominent blockchains, enables the development of decentralized applications (dApps) through its smart contract language, Solidity. While Solidity excels in handling on-chain data, integrating off-chain data (information that resides outside the blockchain) is crucial for many practical applications. This is where oracles come into play. Oracles bridge the gap between off-chain data and blockchain smart contracts, enabling the blockchain to interact with real-world information.</p><p>This article explores the concept of oracles, their importance, and the methods of integrating off-chain data into Solidity smart contracts, providing a detailed technical overview for developers and blockchain enthusiasts.</p><h3>Understanding Oracles</h3><h3>What are Oracles?</h3><p>Oracles are third-party services that provide smart contracts with external data. They act as intermediaries, fetching data from the real world and supplying it to the blockchain, which is inherently isolated from the external environment. This data can include anything from financial market prices, weather conditions, sports results, to IoT sensor information.</p><h3>Types of Oracles</h3><ol><li><strong>Inbound Oracles</strong>: Provide data from external sources to the blockchain.</li><li><strong>Outbound Oracles</strong>: Send data from the blockchain to external systems.</li><li><strong>Software Oracles</strong>: Retrieve data from online sources such as APIs, websites, and databases.</li><li><strong>Hardware Oracles</strong>: Gather data from the physical world using IoT devices.</li><li><strong>Consensus-based Oracles</strong>: Aggregate data from multiple sources and use consensus mechanisms to determine the most accurate data.</li></ol><h3>Importance of Oracles</h3><p>Oracles are crucial because they expand the capabilities of smart contracts, enabling them to respond to real-world events. Without oracles, the utility of smart contracts would be limited to on-chain activities, severely restricting their potential applications.</p><h3>Integrating Off-chain Data in Solidity</h3><p>Integrating off-chain data involves several steps and considerations. Here, we delve into the technicalities of using oracles with Solidity, focusing on Chainlink, the most widely used oracle network.</p><h3>Chainlink: The Leading Oracle Network</h3><p>Chainlink is a decentralized oracle network that provides reliable tamper-proof inputs and outputs for complex smart contracts. It enables smart contracts to securely interact with external data sources and APIs.</p><h3>Setting Up Chainlink Oracles in Solidity</h3><h4>Prerequisites</h4><p>Before we dive into the code, ensure you have the following:</p><ol><li><strong>Node.js</strong>: For installing development tools.</li><li><strong>Truffle or Hardhat</strong>: Ethereum development environments.</li><li><strong>Metamask</strong>: Ethereum wallet for managing accounts and interacting with the blockchain.</li><li><strong>Link Tokens</strong>: Required for paying the oracles.</li></ol><h4>Step-by-Step Integration</h4><ol><li><strong>Install Dependencies</strong>:</li></ol><p>Begin by installing the necessary dependencies.</p><pre>npm install @chainlink/contracts truffle-hdwallet-provider</pre><p><strong>2. Set Up the Solidity Smart Contract</strong>:</p><p>Create a new Solidity file (e.g., DataConsumerV3.sol) and import the Chainlink contracts.</p><pre>// SPDX-License-Identifier: MIT<br>pragma solidity ^0.8.7;<br><br>import {AggregatorV3Interface} from &quot;@chainlink/contracts@1.1.0/src/v0.8/shared/interfaces/AggregatorV3Interface.sol&quot;;<br><br>/**<br> * THIS IS AN EXAMPLE CONTRACT THAT USES HARDCODED<br> * VALUES FOR CLARITY.<br> * THIS IS AN EXAMPLE CONTRACT THAT USES UN-AUDITED CODE.<br> * DO NOT USE THIS CODE IN PRODUCTION.<br> */<br><br>/**<br> * If you are reading data feeds on L2 networks, you must<br> * check the latest answer from the L2 Sequencer Uptime<br> * Feed to ensure that the data is accurate in the event<br> * of an L2 sequencer outage. See the<br> * https://docs.chain.link/data-feeds/l2-sequencer-feeds<br> * page for details.<br> */<br><br>contract DataConsumerV3 {<br>    AggregatorV3Interface internal dataFeed;<br><br>    /**<br>     * Network: Sepolia<br>     * Aggregator: BTC/USD<br>     * Address: 0x1b44F3514812d835EB1BDB0acB33d3fA3351Ee43<br>     */<br>    constructor() {<br>        dataFeed = AggregatorV3Interface(<br>            0x1b44F3514812d835EB1BDB0acB33d3fA3351Ee43<br>        );<br>    }<br><br>    /**<br>     * Returns the latest answer.<br>     */<br>    function getLatestPrice() public view returns (int) {<br>        // prettier-ignore<br>        (<br>            /* uint80 roundID */,<br>            int answer,<br>            /*uint startedAt*/,<br>            /*uint timeStamp*/,<br>            /*uint80 answeredInRound*/<br>        ) = dataFeed.latestRoundData();<br>        return answer;<br>    }<br>}</pre><p>In this contract:</p><ul><li>We import the necessary Chainlink interfaces.</li><li>We define a constructor that initializes the priceFeed with the address of the Chainlink Price Feed contract.</li></ul><p><strong>3. Deploy the Contract</strong>:<br>Configure Truffle or Hardhat to deploy the contract to a testnet like Kovan or Rinkeby. Here’s an example of a Truffle migration script:</p><pre>const DataConsumerV3 = artifacts.require(&quot;DataConsumerV3&quot;);<br><br>module.exports = function (deployer) {<br>    deployer.deploy(DataConsumerV3);<br>};</pre><p><strong>4. Interact with the Deployed Contract</strong>:<br>Once deployed, you can interact with the contract to fetch the latest price.</p><pre>const PriceConsumerV3 = artifacts.require(&quot;PriceConsumerV3&quot;);<br><br>module.exports = async function(callback) {<br>    const priceConsumer = await PriceConsumerV3.deployed();<br>    const latestPrice = await priceConsumer.getLatestPrice();<br>    console.log(`The latest price BTC/USD is ${latestPrice.toString()}`);<br>    callback();<br>};</pre><h3>Security Considerations</h3><h3>Data Authenticity and Integrity</h3><p>Ensure that the data source is trustworthy and that the data remains untampered. Using decentralized oracles like Chainlink can mitigate risks by aggregating data from multiple sources.</p><h3>Oracle Manipulation</h3><p>Since oracles act as intermediaries, they can be targeted for manipulation. It’s essential to use secure and reliable oracle networks. Chainlink’s decentralized nature helps in reducing this risk.</p><h3>Handling Failures</h3><p>Implement fallback mechanisms to handle oracle failures or data unavailability. Smart contracts should be designed to handle unexpected scenarios gracefully.</p><h3>Future Trends and Developments</h3><h3>Decentralized Oracle Networks (DONs)</h3><p>Decentralized Oracle Networks, like Chainlink, are becoming more sophisticated, providing higher levels of security and reliability. Future developments may include more robust consensus mechanisms and integration with a broader range of data sources.</p><h3>Cross-Chain Oracles</h3><p>As blockchain interoperability grows, cross-chain oracles will become vital. These oracles can fetch and relay data across different blockchain networks, enhancing the functionality and reach of smart contracts.</p><h3>Privacy-preserving Oracles</h3><p>With increasing concerns about data privacy, oracles that can handle confidential information without compromising security are in demand. Techniques like zero-knowledge proofs could be integrated into oracle systems to achieve this.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0e0f7cc5a1c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Security Best Practices in Solidity]]></title>
            <link>https://medium.com/coinmonks/security-best-practices-in-solidity-c4ca28aee7b6?source=rss-de889a04aa64------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4ca28aee7b6</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Fikri R.]]></dc:creator>
            <pubDate>Sun, 19 May 2024 07:13:18 GMT</pubDate>
            <atom:updated>2024-05-23T10:06:12.172Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PnEW_cWW7s9ntXWrEeZpYA.png" /></figure><p>Security is a paramount concern in smart contract development due to the irreversible nature of blockchain transactions. Vulnerabilities in smart contracts can lead to significant financial losses and damage to reputations. In this chapter, we will explore essential security best practices for writing secure Solidity contracts, covering common vulnerabilities and strategies to mitigate them.</p><h3>Common Vulnerabilities</h3><p>Several common vulnerabilities have historically plagued smart contracts. Understanding these issues is the first step towards writing secure code.</p><h3>1. Reentrancy</h3><p>Reentrancy attacks occur when a contract makes an external call to another untrusted contract before updating its state. This allows the untrusted contract to call back into the original contract, potentially leading to unexpected behavior or draining of funds.</p><p><strong>Example:</strong></p><pre>// Vulnerable contract<br>contract VulnerableBank {<br>    mapping(address =&gt; uint) public balances;<br><br>    function deposit() public payable {<br>        balances[msg.sender] += msg.value;<br>    }<br>    function withdraw(uint amount) public {<br>        require(balances[msg.sender] &gt;= amount, &quot;Insufficient balance&quot;);<br>        (bool success,) = msg.sender.call{value: amount}(&quot;&quot;);<br>        require(success, &quot;Transfer failed&quot;);<br>        balances[msg.sender] -= amount;<br>    }<br>}</pre><h3>Mitigation</h3><ul><li>Use the <strong>Checks-Effects-Interactions</strong> pattern.</li><li>Employ a <strong>reentrancy guard</strong>.</li></ul><p><strong>Example:</strong></p><pre>// Safe contract using Checks-Effects-Interactions pattern and reentrancy guard<br>contract SafeBank {<br>    mapping(address =&gt; uint) public balances;<br>    bool private locked;<br><br>    modifier noReentrancy() {<br>        require(!locked, &quot;No reentrancy&quot;);<br>        locked = true;<br>        _;<br>        locked = false;<br>    }<br>    function deposit() public payable {<br>        balances[msg.sender] += msg.value;<br>    }<br>    function withdraw(uint amount) public noReentrancy {<br>        require(balances[msg.sender] &gt;= amount, &quot;Insufficient balance&quot;);<br>        balances[msg.sender] -= amount;<br>        (bool success,) = msg.sender.call{value: amount}(&quot;&quot;);<br>        require(success, &quot;Transfer failed&quot;);<br>    }<br>}</pre><h3>2. Integer Overflow and Underflow</h3><p>Integer overflows and underflows occur when an arithmetic operation exceeds the maximum or minimum value a variable can hold. This can lead to unintended behavior.</p><p><strong>Example:</strong></p><pre>// Vulnerable contract<br>contract Overflow {<br>    uint8 public value;<br><br>    function increment(uint8 _amount) public {<br>        value += _amount;<br>    }<br>}</pre><h3>Mitigation</h3><ul><li>Use the <strong>SafeMath</strong> library (in older versions of Solidity).</li><li>Utilize built-in overflow checks (Solidity 0.8.0 and later).</li></ul><p><strong>Example:</strong></p><pre>// Safe contract using built-in overflow checks<br>contract SafeMath {<br>    uint8 public value;<br><br>    function increment(uint8 _amount) public {<br>        value += _amount; // This will automatically revert on overflow in Solidity 0.8.0+<br>    }<br>}</pre><h3>3. Access Control</h3><p>Improper access control can allow unauthorized users to perform critical operations on a contract.</p><p><strong>Example:</strong></p><pre>// Vulnerable contract<br>contract AdminOnly {<br>    address public owner;<br><br>    constructor() {<br>        owner = msg.sender;<br>    }<br>    function changeOwner(address newOwner) public {<br>        owner = newOwner;<br>    }<br>}</pre><h3>Mitigation</h3><ul><li>Implement proper access control using modifiers.</li><li>Use libraries such as <strong>OpenZeppelin’s Ownable</strong>.</li></ul><p><strong>Example:</strong></p><pre>// Safe contract using OpenZeppelin&#39;s Ownable<br>import &quot;@openzeppelin/contracts/access/Ownable.sol&quot;;<br><br>contract AdminOnly is Ownable {<br>    function changeOwner(address newOwner) public onlyOwner {<br>        transferOwnership(newOwner);<br>    }<br>}</pre><h3>4. Denial of Service (DoS)</h3><p>DoS attacks can prevent users from interacting with a contract by exploiting gas limits or other vulnerabilities.</p><p><strong>Example:</strong></p><pre>// Vulnerable contract<br>contract Auction {<br>    address public highestBidder;<br>    uint public highestBid;<br><br>    function bid() public payable {<br>        require(msg.value &gt; highestBid, &quot;Bid too low&quot;);<br>        if (highestBidder != address(0)) {<br>            (bool success,) = highestBidder.call{value: highestBid}(&quot;&quot;);<br>            require(success, &quot;Refund failed&quot;);<br>        }<br>        highestBidder = msg.sender;<br>        highestBid = msg.value;<br>    }<br>}</pre><h3>Mitigation</h3><ul><li>Avoid using call for sending funds.</li><li>Use <strong>pull over push</strong> pattern for withdrawals.</li></ul><p><strong>Example:</strong></p><pre>// Safe contract using pull over push pattern<br>contract Auction {<br>    address public highestBidder;<br>    uint public highestBid;<br>    mapping(address =&gt; uint) public refunds;<br><br>    function bid() public payable {<br>        require(msg.value &gt; highestBid, &quot;Bid too low&quot;);<br>        if (highestBidder != address(0)) {<br>            refunds[highestBidder] += highestBid;<br>        }<br>        highestBidder = msg.sender;<br>        highestBid = msg.value;<br>    }<br>    function withdrawRefund() public {<br>        uint refund = refunds[msg.sender];<br>        refunds[msg.sender] = 0;<br>        (bool success,) = msg.sender.call{value: refund}(&quot;&quot;);<br>        require(success, &quot;Refund failed&quot;);<br>    }<br>}</pre><h3>5. Front-Running</h3><p>Front-running occurs when a malicious actor intercepts and exploits a pending transaction before it is mined.</p><h3>Mitigation</h3><ul><li>Use commit-reveal schemes.</li><li>Implement <strong>gas price limits</strong>.</li></ul><p><strong>Example:</strong></p><pre>// Simple commit-reveal scheme<br>contract SecureAuction {<br>    struct Bid {<br>        bytes32 blindedBid;<br>        uint deposit;<br>    }<br><br>    address public highestBidder;<br>    uint public highestBid;<br>    mapping(address =&gt; Bid) public bids;<br>    function placeBlindedBid(bytes32 _blindedBid) public payable {<br>        bids[msg.sender] = Bid({<br>            blindedBid: _blindedBid,<br>            deposit: msg.value<br>        });<br>    }<br>    function revealBid(uint _value, bytes32 _secret) public {<br>        Bid storage bidToCheck = bids[msg.sender];<br>        require(bidToCheck.blindedBid == keccak256(abi.encodePacked(_value, _secret)), &quot;Invalid bid reveal&quot;);<br>        require(bidToCheck.deposit &gt;= _value, &quot;Insufficient deposit&quot;);<br>        if (_value &gt; highestBid) {<br>            highestBid = _value;<br>            highestBidder = msg.sender;<br>        }<br>        bidToCheck.deposit = 0; // Reset deposit after reveal<br>    }<br>}</pre><h3>General Security Best Practices</h3><h3>1. Use Libraries and Standards</h3><p>Use well-audited libraries such as <strong>OpenZeppelin</strong> for common functionalities like access control, token standards, and more.</p><h3>2. Avoid Floating Pragma</h3><p>Lock the Solidity version in your contracts to avoid incompatibility issues and unexpected behavior due to compiler updates.</p><p><strong>Example:</strong></p><pre>// Good practice<br>pragma solidity ^0.8.0;</pre><h3>3. Conduct Security Audits</h3><p>Regularly audit your smart contracts with professional security firms to identify and fix vulnerabilities.</p><h3>4. Write Tests</h3><p>Write comprehensive unit tests to cover various scenarios and edge cases. Use testing frameworks like <strong>Truffle</strong> or <strong>Hardhat</strong>.</p><h3>5. Follow Best Practices for Contract Design</h3><ul><li>Implement the <strong>Checks-Effects-Interactions</strong> pattern to minimize reentrancy risks.</li><li>Use the <strong>pull over push</strong> pattern for handling funds.</li></ul><h3>6. Use Multisig Wallets</h3><p>For contracts handling significant funds, use multisig wallets to increase security for fund management.</p><p><strong>Example:</strong></p><pre>// Simple multisig wallet using OpenZeppelin<br>import &quot;@openzeppelin/contracts/access/AccessControl.sol&quot;;<br><br>contract MultisigWallet is AccessControl {<br>    bytes32 public constant SIGNER_ROLE = keccak256(&quot;SIGNER_ROLE&quot;);<br>    uint256 public approvalsNeeded;<br>    mapping(bytes32 =&gt; uint256) public approvals;<br>    constructor(uint256 _approvalsNeeded) {<br>        approvalsNeeded = _approvalsNeeded;<br>        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);<br>    }<br>    function submitTransaction(address to, uint256 value) public onlyRole(SIGNER_ROLE) {<br>        bytes32 txHash = keccak256(abi.encodePacked(to, value));<br>        approvals[txHash]++;<br>        if (approvals[txHash] &gt;= approvalsNeeded) {<br>            (bool success,) = to.call{value: value}(&quot;&quot;);<br>            require(success, &quot;Transaction failed&quot;);<br>        }<br>    }<br>    function addSigner(address account) public onlyRole(DEFAULT_ADMIN_ROLE) {<br>        grantRole(SIGNER_ROLE, account);<br>    }<br>    function removeSigner(address account) public onlyRole(DEFAULT_ADMIN_ROLE) {<br>        revokeRole(SIGNER_ROLE, account);<br>    }<br>}</pre><h3>7. Implement Circuit Breakers</h3><p>Use circuit breakers to halt contract operations in case of emergencies.</p><p><strong>Example:</strong></p><pre>// Circuit breaker pattern<br>contract EmergencyStop {<br>    bool private stopped = false;<br>    address private owner;<br><br>    modifier stopInEmergency() {<br>        require(!stopped, &quot;Stopped in emergency&quot;);<br>        _;<br>    }<br>    modifier onlyOwner() {<br>        require(msg.sender == owner, &quot;Not the owner&quot;);<br>        _;<br>    }<br>    constructor() {<br>        owner = msg.sender;<br>    }<br>    function toggleContractActive() public onlyOwner {<br>        stopped = !stopped;<br>    }<br>    function deposit() public payable stopInEmergency {<br>        // deposit logic<br>    }<br>    function withdraw(uint amount) public stopInEmergency {<br>        // withdraw logic<br>    }<br>}</pre><h3>8. Be Cautious with External Calls</h3><p>Minimize and carefully handle external calls to prevent unexpected behaviors and vulnerabilities.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4ca28aee7b6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/security-best-practices-in-solidity-c4ca28aee7b6">Security Best Practices in Solidity</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Set Up Your Development Environment for Solidity]]></title>
            <link>https://coinsbench.com/how-to-set-up-your-development-environment-for-solidity-440c13e034cd?source=rss-de889a04aa64------2</link>
            <guid isPermaLink="false">https://medium.com/p/440c13e034cd</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Fikri R.]]></dc:creator>
            <pubDate>Fri, 17 May 2024 05:54:44 GMT</pubDate>
            <atom:updated>2024-05-21T12:08:47.753Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OIh2EUTZLNZY8AvMt-j1Ew.png" /></figure><p>Setting up your development environment for Solidity is the first crucial step to diving into the world of Ethereum smart contract development. In this guide, we’ll walk you through the essential tools and configurations you need to get started, ensuring a smooth and efficient workflow.</p><h3>Step 1: Install Node.js and npm</h3><p>Node.js is a JavaScript runtime that is required for most blockchain development tools. npm is the package manager for Node.js, and you’ll use it to install various development tools.</p><p>1. Download Node.js: Visit the <a href="https://nodejs.org/">https://nodejs.org/</a> and download the LTS (Long Term Support) version for your operating system.</p><p>2. Install Node.js: Follow the installation instructions for your OS.</p><p>3. Verify Installation:</p><pre>node -v<br><br>npm -v</pre><h3>Step 2: Install Truffle</h3><p>Truffle is a popular development framework for Ethereum that provides a suite of tools for smart contract development.</p><p>1. Install Truffle:</p><pre>npm install -g truffle</pre><p>2. Verify Installation:</p><pre>truffle version</pre><h3>Step 3: Install Ganache</h3><p>Ganache is a personal blockchain for Ethereum development that you can use to deploy contracts, develop applications, and run tests.</p><p>1. Download Ganache: Visit the ttps://trufflesuite.com/ganache/ and download the version suitable for your OS.</p><p>2. Install Ganache: Follow the installation instructions for your OS.</p><p>3. Launch Ganache: Open Ganache to start your local blockchain.</p><h3>Step 4: Install a Code Editor</h3><p>Visual Studio Code (VS Code) is a popular choice for Solidity development due to its extensive range of extensions and ease of use.</p><p>1. Download VS Code: Visit the <a href="https://code.visualstudio.com/">https://code.visualstudio.com/</a> and download the version for your OS.</p><p>2. Install VS Code: Follow the installation instructions for your OS.</p><p>3. Install Solidity Extension:</p><ul><li>Open VS Code.</li><li>Go to the Extensions view by clicking the Extensions icon in the Activity Bar on the side of the window or by pressing Ctrl+Shift+X.</li><li>Search for “Solidity” and install the Solidity extension by Juan Blanco.</li></ul><h3>Step 5: Initialize a Truffle Project</h3><p>1. Create a New Directory for Your Project:</p><pre>mkdir MySolidityProject<br>cd MySolidityProject</pre><p>2. Initialize a Truffle Project:</p><pre>truffle init</pre><p>This command sets up a basic Truffle project structure with the necessary directories and configuration files.</p><h3>Step 6: Connect Truffle to Ganache</h3><p>1. Configure Truffle to Use Ganache:</p><ul><li>Open the `truffle-config.js` file in your project directory.</li><li>Add the following network configuration:</li></ul><pre>module.exports = {<br>  networks: {<br>    development: {<br>      host: &quot;127.0.0.1&quot;, // Localhost (default: none)<br>      port: 7545, // Standard Ethereum port (default: none)<br>      network_id: &quot;*&quot;, // Any network (default: none)<br>    },<br>  },<br>  // Other configurations…<br>};</pre><h3>Step 7: Write a Simple Smart Contract</h3><p>1. Create a Solidity File:</p><ul><li>In the `contracts` directory of your project, create a new file named `SimpleStorage.sol`.</li><li>Add the following code to `SimpleStorage.sol`:</li></ul><pre>pragma solidity ^0.8.0;<br><br>contract SimpleStorage {<br>  uint256 public storedData;<br><br>  function set(uint256 x) public {<br>    storedData = x;<br>  }<br><br>  function get() public view returns (uint256) {<br>    return storedData;<br>  }<br>}</pre><h3>Step 8: Compile and Deploy the Smart Contract</h3><p>1. Compile the Contract:</p><pre>truffle compile</pre><p>2. Deploy the Contract:</p><ul><li>Create a new migration script in the migrations directory. Name it 2_deploy_contracts.js.</li><li>Add the following code:</li></ul><pre>const SimpleStorage = artifacts.require(&quot;SimpleStorage&quot;);<br><br>module.exports = function (deployer) {<br>  deployer.deploy(SimpleStorage);<br>};</pre><p>- Run the migration:</p><pre>truffle migrate</pre><h3>Step 9: Interact with the Deployed Contract</h3><p>1. Open the Truffle Console:</p><pre>truffle console</pre><p>2. Interact with the Contract:</p><pre>let instance = await SimpleStorage.deployed();<br>await instance.set(42);<br><br>let value = await instance.get();<br>console.log(value.toString()); // Should print &#39;42&#39;</pre><p>Congratulations! You have successfully set up your Solidity development environment, written a simple smart contract, and interacted with it using Truffle and Ganache.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=440c13e034cd" width="1" height="1" alt=""><hr><p><a href="https://coinsbench.com/how-to-set-up-your-development-environment-for-solidity-440c13e034cd">How to Set Up Your Development Environment for Solidity</a> was originally published in <a href="https://coinsbench.com">CoinsBench</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The basic of Solidity: Write your own Smart Contract]]></title>
            <link>https://frdblock.medium.com/the-basic-of-solidity-write-your-own-smart-contract-e5d10cb930e6?source=rss-de889a04aa64------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5d10cb930e6</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Fikri R.]]></dc:creator>
            <pubDate>Fri, 17 May 2024 04:29:49 GMT</pubDate>
            <atom:updated>2024-05-17T05:33:14.298Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E-0kVGveCnemJoqfk1egDw.png" /></figure><p>Solidity is a statically-typed programming language specifically designed for writing smart contracts that run on the Ethereum Virtual Machine (EVM). As the backbone of Ethereum, it enables developers to create decentralized applications (dApps) that harness the power of blockchain technology. In this post, we’ll delve into the core aspects of Solidity, including its use cases, contract structure, and key programming concepts.</p><h4>What is Solidity?</h4><p>Solidity is an object-oriented programming language influenced by C++, Python, and JavaScript, tailored for developing smart contracts on the Ethereum blockchain. Smart contracts are self-executing contracts with the terms directly written into code, facilitating, verifying, or enforcing the performance of a contract.</p><h4>Use Cases of Solidity</h4><p>1. <strong>Decentralized Finance (DeFi)</strong>: Creating protocols for lending, borrowing, and trading without intermediaries.<br>2. <strong>Non-Fungible Tokens (NFTs)</strong>: Developing unique digital assets for art, gaming, and collectibles.<br>3. <strong>Decentralized Autonomous Organizations (DAOs)</strong>: Automating organizational governance and decision-making.<br>4. <strong>Supply Chain Management</strong>: Enhancing transparency and traceability in logistics.</p><h4>Contract Structure</h4><p>A basic Solidity contract consists of the following parts:</p><pre><br>pragma solidity ^0.8.0;<br><br>contract MyContract {<br>  // State variables<br>  uint public myNumber;<br><br>  // Constructor<br>  constructor(uint _initialNumber) {<br>    myNumber = _initialNumber;<br>  }<br><br>  // Functions<br>  function setNumber(uint _newNumber) public {<br>    myNumber = _newNumber;<br>  }<br><br>  function getNumber() public view returns (uint) {<br>    return myNumber;<br>  }<br>}</pre><p><strong>Key Components:</strong></p><ul><li><strong>Pragma</strong>: Specifies the version of Solidity.</li><li><strong>Contract</strong>: Defines the contract name and encapsulates state variables and functions.</li></ul><h4>Variables and Types</h4><p>Solidity supports various data types:</p><ul><li>Boolean: bool</li><li>Integer: int and uint</li><li>Address: address</li><li>String: string</li><li>Bytes: bytes</li><li>Fixed-size Arrays: uint[10]</li><li>Dynamic Arrays: uint[]</li></ul><h4>Functions</h4><p>Functions define the behavior of the contract. They can be public, private, internal, or external, dictating their accessibility.</p><pre>function exampleFunction() public pure returns (string memory) {<br>  return &quot;Hello, World!&quot;;<br>}</pre><h4>Function Visibility</h4><ul><li><strong>Public</strong>: Accessible by anyone.</li><li><strong>Private</strong>: Only accessible within the contract.</li><li><strong>Internal</strong>: Accessible within the contract and derived contracts.</li><li><strong>External</strong>: Can only be called from outside the contract.</li></ul><h4>Modifiers</h4><p>Modifiers alter the behavior of functions. Commonly used for access control.</p><pre>modifier onlyOwner() {<br>  require(msg.sender == owner, &quot;Not the contract owner&quot;);<br>  _;<br>}<br>function restrictedFunction() public onlyOwner {<br>  // Function logic<br>}</pre><h4>Operators</h4><p>Solidity includes various operators for arithmetic, comparison, and logical operations.</p><ul><li><strong>Arithmetic</strong>: +, -, *, /</li><li><strong>Comparison</strong>: ==, !=, ≥, ≤, &gt;, &lt;</li><li><strong>Logical</strong>: &amp;&amp;, ||, !</li></ul><h4>Conditionals</h4><p>Control flow uses if-else statements.</p><pre>function checkNumber(uint _number) public pure returns (string memory) {<br>  if (_number &gt; 10) {<br>    return &quot;Greater than 10&quot;;<br>  } else {<br>    return &quot;10 or less&quot;;<br>  }<br>}</pre><h4>Arrays</h4><p>Arrays can be fixed or dynamic.</p><pre>uint[] public dynamicArray;<br>uint[5] public fixedArray;</pre><h4>Structs</h4><p>Structs allow grouping related data.</p><pre>struct Person {<br>  string name;<br>  uint age;<br>}<br><br>Person public person = Person(&quot;Alice&quot;, 30);</pre><h4>Events</h4><p>Events facilitate logging and are useful for off-chain interaction.</p><pre>event NumberChanged(uint oldNumber, uint newNumber);<br><br>function setNumber(uint _newNumber) public {<br>  emit NumberChanged(myNumber, _newNumber);<br>  myNumber = _newNumber;<br>}</pre><h4>Error Handling</h4><p>Solidity provides require, assert, and revert for error handling.</p><pre>function withdraw(uint _amount) public {<br>  require(_amount &lt;= balance, &quot;Insufficient balance&quot;);<br>  balance -= _amount;<br>}</pre><h4>Inheritance</h4><p>Solidity supports inheritance, allowing contracts to inherit properties and functions from other contracts.</p><pre>contract Parent {<br>  uint public parentNumber;<br>  function setParentNumber(uint _number) public {<br>    parentNumber = _number;<br>  }<br>}<br><br>contract Child is Parent {<br>  function getParentNumber() public view returns (uint) {<br>    return parentNumber;<br>  }<br>}</pre><p>That’s it! now you can write solidity code for more confidently</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5d10cb930e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Belajar Django Framework (pengenalan)]]></title>
            <link>https://frdblock.medium.com/belajar-django-framework-pengenalan-d542d31a8719?source=rss-de889a04aa64------2</link>
            <guid isPermaLink="false">https://medium.com/p/d542d31a8719</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[pemrograman]]></category>
            <dc:creator><![CDATA[Fikri R.]]></dc:creator>
            <pubDate>Tue, 19 Jan 2021 02:56:23 GMT</pubDate>
            <atom:updated>2021-01-19T02:56:23.064Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*39FIR5B0yZPYD9Ok.jpg" /></figure><p>Belajar Django Framework (pengenalan) — <a href="https://www.djangoproject.com/">Django </a>adalah sebuah web framework yang di tulis dalam bahasa python yang digunakan untuk membantu pembangunan aplikasi web yang berkualitas. Django menyediakan berbagai kemudahan yang mana mengurangi banyak pekerjaan yang biasa dilakukan dalam pengembangan web.</p><p>Tutorial ini dibuat untuk developer maupun pemula yang ingin mempelajari bagaimana cara membangun sebuah website yang berkualitas dengan menggunakan Django dengan berbagai fitur dan kemudahan yang di tawarkannya.</p><p>Sebelum melanjutkan, pastikan kamu telah memahami dasar bahasa pemrograman python berbasis objek (OOP): control structures, data structures, variables, classes, objects, dll.</p><h3>Mengenal django</h3><p>Django adalah sebuah <em>high-level Python web framework</em> yang membuat pengembangan jadi lebih cepat dan terstruktur.</p><h3>Sejarah dari django</h3><ul><li><strong>2003</strong> − Dimulai oleh Adrian Holovaty dan Simon Willison sebagai project internal di Lawrence Journal-World newspaper.</li><li><strong>2005</strong> − Dirilis pada Juli 2005 dan dinamakan Django, sama dengan gitaris jazz Django Reinhardt.</li><li><strong>2005</strong> − Cukup tangguh untuk menangani website dengan traffic yang tinggi</li><li><strong>Saat ini </strong>− Sekarang django adalah project open source dengan kontributor dari seluruh dunia.</li></ul><h3>Filosofi desain</h3><p>Django hadir dengan filosofi desain berikut:</p><ul><li><strong>Loosely Coupled</strong> − Django bertujuan membuat setiap elemennya dapat berdiri sendiri</li><li><strong>Less Coding</strong> − Mengurangi kode sehingga proses pengembangan menjadi cepat</li><li><strong>Don’t Repeat Yourself (DRY)</strong> − Semuanya dibuat dalam sekali dan tidak mengulanginya secara terus menerus</li><li><strong>Fast Development</strong> − Filosofi Django adalah melakukan semua yang dapat dilakukan dengan memfasilitasi pengembangan yang sangat cepat.</li><li><strong>Clean Design</strong> − Secara ketat mempertahankan desain yang <em>clean</em> di seluruh kodenya dan membuatnya mudah untuk mengikuti <em>best practice</em></li></ul><h3>Kelebihan</h3><p>Berikut adalah beberapa keuntungan menggunakan Django</p><ul><li><strong>Object-Relational Mapping (ORM) Support</strong> − Django menyediakan <em>perantara</em> antara model data dan <em>database engine</em>, serta mendukung banyak sistem database termasuk MySql, Oracle, Postgres, dll. Django juga mendukung database NoSQL melalui <em>Django-nonrel</em>. Untuk sekarang, satu-satunya database NoSQL yang didukung adalah MogoDB dan google app engine</li><li><strong>Multilingual Support</strong> − Django mendukung website dengan multibahasa melalui sistem internasionalisasi yang ada. Jadi kamu bisa mengembangkan situs web yang akan mendukung banyak bahasa.</li><li><strong>Framework Support</strong> − Django memiliki dukungan bawaan untuk Ajax, RSS, Caching dan berbagai framework lainnya.</li><li><strong>Administration GUI</strong> − Django menyediakan antarmuka pengguna siap pakai yang bagus untuk aktivitas admin.</li><li><strong>Development Environment</strong> − Django hadir dengan server web yang ringan untuk memfasilitasi development dan pengujian aplikasi.</li></ul><h3>Metode MVC — MVT</h3><p>Seperti yang telah diketahui, django adalah web framework Python. Dan seperti kebanyakan framework modern lainnya, django mendukung metode MVC. Pertama mari kita lihat apa itu metode Model-View-Controller (MVC), kemudian kita akan lihat django untuk metode Model-View-Template (MVT).</p><p>Ketika berbicara tentang aplikasi yang menyediakan UI (web atau desktop), biasanya kita berbicara tentang arsitektur MVC. Dan seperti namanya, metode MVC didasarkan pada tiga komponen: Model, View, dan Controller</p><p>Yang disebut dengan <strong>Model </strong>bagian yang berurusan dengan database. <strong>View</strong> adalah bagian antarmuka atau bagian depan aplikasi, segala sesuatu yang diproses dalam sistem akan ditampilkan pada view, sedangkan <strong>Controller </strong>adalah bagian yang menangani atau mengenengahi antar model dan view, jadi controller lah yang berperan sebagai pengendali dari sebuah sistem.</p><h3>MVT pada Django</h3><p>Model-View-Template (MVT) sedikit berbeda dari MVC. Perbedaan utama antara dua metode adalah bahwa Django sendiri menangani bagian Controller (Code yang mengontrol interaksi antara Model dan View) langsung dengan template. Templatenya sendiri adalah file HTML yang digabungkan dengan Django Template Language (DTL).</p><p>Diagram berikut mengilustrasikan bagaimana masing-masing komponen metode MVT berinteraksi satu sama lain untuk melayani permintaan user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*AZV_Z4PPevUMCb2E.jpg" /></figure><p>Programmer membuat Model, View dan template kemudian URL akan dipetakkan dan Django melakukan tugasnya untuk menyajikannya kepada user.</p><p>Nah itulah pengenalan untuk sekarang, diartikel berikutnya kita akan memasukki bagian coding untuk mempelajari Django lebih dalam lagi. Di akhir pembelajaran kita akan membuat sebuah project sederhana dari nol menggunakan Django. Pastikan kalian tetap mengikuti artikel ini jika kalian tertarik untuk mempelajari Django dalam pengembangan web. Sekian dulu saya ucapkan terima kasih dan sampai jumpa.</p><p>Sumber: <a href="https://technozee.my.id/belajar-django-framework-pengenalan/">https://technozee.my.id/belajar-django-framework-pengenalan/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d542d31a8719" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Langkah mendeploy laravel ke Heroku]]></title>
            <link>https://frdblock.medium.com/5-langkah-mendeploy-laravel-ke-heroku-54deb3c16a71?source=rss-de889a04aa64------2</link>
            <guid isPermaLink="false">https://medium.com/p/54deb3c16a71</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[heroku]]></category>
            <dc:creator><![CDATA[Fikri R.]]></dc:creator>
            <pubDate>Sun, 17 Jan 2021 10:18:11 GMT</pubDate>
            <atom:updated>2021-01-17T10:18:11.931Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zOPPzyCWfVjX_2BeKWOGEA.png" /></figure><p>5 Langkah mendeploy laravel ke Heroku — Pada saat kamu mengerjakan project Laravel tentunya di tahap akhir kamu ingin membuat project web tersebut dapat diakses dari internet, tapi sebelum itu mungkin kamu ingin memastikan apakah semua fungsi web yang kamu buat tersebut dapat berjalan dengan normal sesuai yang di inginkan.</p><p>Oleh karena itu, untuk melakukan pengujian tersebut kamu tidak perlu langsung mengupload project ke server <em>production</em>. Daripada itu, cukup gunakan semacam layanan hosting/cloud yang gratis seperti <strong>Heroku</strong></p><p>Heroku adalah platform cloud. Artinya, kamu tidak perlu khawatir tentang infrastruktur, kamu hanya fokus pada aplikasi kamu.</p><p>beberapa fitur Heroku:</p><ul><li>Deployment Instan dengan Git push — build aplikasi kamu dilakukan oleh Heroku menggunakan skrip build</li><li>Banyak sumber daya Add-on (aplikasi, database, dll.)</li><li>Proses penskalaan — penskalaan independen untuk setiap komponen aplikasi kamu tanpa memengaruhi fungsionalitas dan performa</li><li>Isolasi — setiap proses (alias dyno) sepenuhnya terisolasi satu sama lain</li><li>Logging dan Visibilitas Penuh — akses mudah ke semua output logging dari setiap komponen aplikasi kamu dan setiap proses (dyno)</li></ul><p>Heroku menyediakan tutorial yang ditulis dengan sangat baik yang memungkinkan kamu memulai dalam beberapa menit. Juga mereka menyediakan 750 jam komputasi pertama secara gratis yang berarti kamu dapat memiliki satu proses (alias Dyno) tanpa biaya. Juga kinerjanya sangat bagus misalnya aplikasi web sederhana yang ditulis dalam node.js dapat menangani sekitar 60–70 permintaan per detik</p><p><strong>Baca juga: </strong><a href="https://technozee.my.id/7-daftar-layanan-hosting-gratis-terbaik-2021/"><strong>7 Daftar layanan hosting gratis terbaik 2021 (recommended)</strong></a></p><p>Table of Contents</p><ul><li><a href="https://technozee.my.id/5-langkah-mendeploy-laravel-ke-heroku/#Berikut_5_Langkah_mendeploy_laravel_ke_Heroku">Berikut 5 Langkah mendeploy laravel ke Heroku</a></li><li><a href="https://technozee.my.id/5-langkah-mendeploy-laravel-ke-heroku/#1_Siapkan_project_laravel_atau_buat_baru">1. Siapkan project laravel atau buat baru</a></li><li><a href="https://technozee.my.id/5-langkah-mendeploy-laravel-ke-heroku/#2_Siapkan_Heroku_CLI">2. Siapkan Heroku CLI</a></li><li><a href="https://technozee.my.id/5-langkah-mendeploy-laravel-ke-heroku/#3_Buat_file_Procfile_dan_push_project_ke_Heroku">3. Buat file Procfile dan push project ke Heroku</a></li><li><a href="https://technozee.my.id/5-langkah-mendeploy-laravel-ke-heroku/#4_Menambahkan_konfigurasi_pada_file_env">4. Menambahkan konfigurasi pada file .env</a></li><li><a href="https://technozee.my.id/5-langkah-mendeploy-laravel-ke-heroku/#5_Konfigurasi_Database">5. Konfigurasi Database</a></li></ul><h3>Berikut 5 Langkah mendeploy laravel ke Heroku</h3><h3>1. Siapkan project laravel atau buat baru</h3><p>Langkah pertama, kamu perlu menyiapkan project Laravel yang akan di deploy atau kamu bisa buat baru dengan mengetikan perintah berikut di terminal/cmd</p><pre>composer create-project — prefer-dist laravel/laravel newProject</pre><p>Setelah siap, masuk ke directory laravel kamu</p><h3>2. Siapkan Heroku CLI</h3><p>Pastikan sudah ada Heroku CLI pada komputer kamu, jika berlum terinstall silahkan buka link dibawah</p><p><a href="https://devcenter.heroku.com/articles/heroku-cli#download-and-install">https://devcenter.heroku.com/articles/heroku-cli#download-and-install</a></p><p>Download dan install Heroku Installer berdasarkan OS komputermu</p><p>Setelah Heroku berhasil terinstall, kembali ke terminal/cmd dan coba login dengan akun Heroku milikmu</p><pre>heroku login</pre><p>Akan muncul tampilan halaman login di browser dan jangan lupa klik tombol loginnya</p><p>Jika berhasil akan muncul tulisan seperti ini:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*RGCmJqOh3RgdxKvH.png" /></figure><p>Apabila gagal bisa login dengan perintah berikut, masukkan email &amp; password seperti login pada umumnya</p><pre>heroku login -i</pre><h3>3. Buat file Procfile dan push project ke Heroku</h3><p>Pada tahap ini, kamu perlu membuat Procfile (file konfigurasi heroku) di dalam folder utama project Laravel, masukkan kode berikut</p><pre>web: vendor/bin/heroku-php-apache2 public/</pre><p>Setelah itu <strong>save </strong>lalu kembali ke terminal/cmd dan ketikkan</p><pre>git init</pre><p>Untuk melakukan git initiation, lalu ketik perintah berikut untuk membuat app pada heroku kamu</p><pre>heroku create</pre><p>Kamu akan mendapatkan nama aplikasi dan nama repository seperti berikut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*50M2F5I7IBCbC3oz.png" /></figure><p>Setelah itu, lakukan commit dan push project ke Heroku dengan perintah</p><pre>git add .<br>git commit -m “Initial Commit”<br>git push heroku master</pre><p>Sekarang project Laravel kamu telah berhasil di-deploy, kamu bisa melihatnya di dahsboard heroku</p><p>Kamu bisa buka web yang telah di deplo tadi, tetapi pasti akan muncul pesan error 500, itu karena kita belum mengatur konfigurasi pada file .env</p><h3>4. Menambahkan konfigurasi pada file .env</h3><p>Pada tahap ini kita akan menambahkan beberapa pengaturan web didalam Heroku, klik menu <strong>Settings </strong>didalam app pada dashboard Heroku</p><p>Kemudian klik <strong>Reveal Config Vars</strong></p><p>Tambahkan beberapa konfigurasi dari file .env pada project Laravel</p><pre>APP_NAME=Shortlink<br>APP_ENV=production<br>APP_KEY=base64:hNKt9MqPA1/C2G1Ar4oCAIqF7y95oWDmJcjmtGQns3k=<br>APP_URL=http://arcane-thicket-31872.herokuapp.com<br>CACHE_DRIVER=cookie<br>SESSION_DRIVER=cookie</pre><p>Maka hasilnya akan seperti ini</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P0Xi5QR-00I5TYvU.png" /></figure><p>Sekarang jika kita membuka aplikasinya dengan mengklik <strong>Open app, </strong>sudah tidak akan ada error lagi</p><p><strong>Baca juga</strong>: <a href="https://technozee.my.id/5-tips-belajar-pemrograman-untuk-pemula/">5 Tips belajar pemrograman untuk pemula</a></p><h3>5. Konfigurasi Database</h3><p>Langkah terahkhir yang harus dilakukan adalah menyetting database, jadi kita bisa melakukan migrasi pada Heroku. Untuk menggunakan MySql pada Heroku akan dikenakan biaya oleh karena itu, kita akan menggunakan database PostgreSQL karena gratis.</p><p>Pertama, klik menu <strong>Resources </strong>kemudian di bagian <strong>Add-ons</strong> klik <strong>Find more add-ons</strong>, kamu akan diarahkan ke halaman Add-ons</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D6NslUIVB0AD99Ix.png" /></figure><p>Pilih <strong>Heroku Postgres</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PjU6k-FH9m0nHk1Q.png" /></figure><p>Setelah itu, kita akan diarahkan ke halaman baru dan klik tombol <strong>Install Heroku Postgres</strong> pada sisi kanan</p><p>Setalah menglik tombol install kita akan di suruh memilih plan, tidak perlu di ganti apa2 langsung klik <strong>Provision add-on</strong></p><p>Setelah selesai, kita bisa melihat Heroku Postgres ada di menu Resources pada dashboard</p><p>Kembali ke terminal/cmd dan ketikkan</p><pre>heroku run php artisan migrate</pre><p>Untuk menjalankan migrasi database pada aplikasi Laravel seperti biasa melalui Heroku</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*NHP-yiqi_9kvxfrp.png" /></figure><p>Selesai! sekarang aplikasi Laravel kamu sudah siap berjalan dan diakses oleh siapa saja</p><p>Semoga postingan ini bermanfaat, saya ucapkan terima kasih dan sampai jumpa</p><p>Sumber: <a href="https://technozee.my.id/5-langkah-mendeploy-laravel-ke-heroku/">https://technozee.my.id/5-langkah-mendeploy-laravel-ke-heroku/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54deb3c16a71" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>