<?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 Obinna Franklin Duru on Medium]]></title>
        <description><![CDATA[Stories by Obinna Franklin Duru on Medium]]></description>
        <link>https://medium.com/@duruobinnafranklin?source=rss-9b8c3188024e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*jWVkjzrWGUy5jZl3</url>
            <title>Stories by Obinna Franklin Duru on Medium</title>
            <link>https://medium.com/@duruobinnafranklin?source=rss-9b8c3188024e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 21:13:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@duruobinnafranklin/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[Understanding Gas on the Blockchain: A Practical Guide Using Real Transactions]]></title>
            <link>https://medium.com/@duruobinnafranklin/understanding-gas-on-the-blockchain-a-practical-guide-using-real-transactions-9f908baeb385?source=rss-9b8c3188024e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f908baeb385</guid>
            <category><![CDATA[monad-blockchain]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Obinna Franklin Duru]]></dc:creator>
            <pubDate>Mon, 26 Oct 2026 13:57:04 GMT</pubDate>
            <atom:updated>2026-10-26T14:03:45.946Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*63G-zR9hnmRdIqroJudotw.jpeg" /></figure><p>When I first encountered the concept of gas in blockchain, I understood on the surface that it measured computational work. However, I did not fully understand what that meant in practice, how gas is actually calculated under the hood, why transactions need gas limits, or how all of those numbers come together to form a transaction fee.</p><p>Reading high-level definitions is one thing, but opening a block explorer and staring at a raw transaction receipt is another. Where does a specific number like 49,785 or 152,492 gas come from? Why does a transaction that transfers 0 ETH or 0 MON still cost money? And what actually happens to the gas you don&#39;t use?</p><p>For me, the best way to truly grasp a technical concept — to the point where you can confidently explain it to someone else — is to connect the abstract math to a physical, real-world analogy and then test it against real data.</p><p>In this article, we are going to break down how gas works from the ground up. We will build a simple physical mental model, look at how the Ethereum Virtual Machine (EVM) counts work, and then inspect <strong>two real blockchain transactions</strong>: one where I interacted directly with a smart contract on <strong>Monad Testnet</strong>, and a second transaction hash I pulled from the <strong>Ethereum Sepolia Testnet</strong> explorer to see how the two networks compare.</p><h3>Separating the Five Core Concepts</h3><p>When people talk about “gas,” they often lump several different things into one blurry idea of “the fee I pay.” To make transaction receipts easy to read, we first need to separate five distinct concepts:</p><ol><li><strong>Gas:</strong> The unit used to measure the computational work required to process a transaction.</li><li><strong>Gas Limit:</strong> The maximum amount of gas a transaction is allowed to consume.</li><li><strong>Gas Used:</strong> The amount of gas the transaction actually consumed during execution.</li><li><strong>Gas Price:</strong> The monetary rate (in cryptocurrency) paid per single unit of gas.</li><li><strong>Transaction Fee (Gas Fee):</strong> The final amount of cryptocurrency paid for processing the transaction, calculated according to the network’s rules.</li></ol><p>These concepts are closely related, but they do not mean the same thing.</p><p><strong>A Relatable Analogy: The Delivery Truck</strong><br>Think of executing a blockchain transaction like hiring a delivery truck to drive across town and flip a switch at a warehouse:</p><ul><li><strong>Gas (The Work)</strong>: Driving 15 kilometers up a steep hill physically requires <strong>10 liters of fuel</strong>. Notice that “liters” measures physical effort, not money. Whether fuel is cheap or expensive today, the engine still burns 10 liters to climb that hill.</li><li><strong>Gas Limit (Your Fuel Cap)</strong>: Before the driver leaves, you hand them a fuel card authorized for a maximum of <strong>12 liters</strong>. You are saying: <em>“This trip should take 10 liters, so I am allowing up to 12 liters as a safety buffer. If the road is blocked and you burn all 12 liters before getting there, stop driving immediately.”</em></li><li><strong>Gas Used (Actual Consumption)</strong>: The driver completes the trip and the engine actually burns <strong>10 liters</strong>.</li><li><strong>Gas Price (Price per Liter)</strong>: At the pump today, fuel costs <strong>$2 per liter</strong>. Tomorrow, during heavy traffic demand, it might cost <strong>$4 per liter</strong>. The distance and effort didn’t change, only the price per unit of fuel.</li><li><strong>Transaction Fee (The Total Bill)</strong>: The final payment calculated from the fuel and the price per liter.</li></ul><p>With that picture in mind, let’s briefly look at how the blockchain measures those “liters of fuel” under the hood.</p><h3>Under the Hood: How Does the Blockchain Count Gas?</h3><p>When you submit a transaction on an EVM-compatible blockchain, the network doesn’t guess how hard your transaction worked. Instead, every tiny instruction the computer executes — called an <strong>opcode</strong> — has a fixed cost measured in gas:</p><ul><li><strong>The Base Cover Charge (</strong><strong>21,000 Intrinsic Gas)</strong>: Before the blockchain even opens a smart contract, every standard transaction costs a flat minimum of <strong>21,000 gas</strong>. This covers the basic work of verifying your cryptographic signature, checking your account nonce, and updating your account balance.</li><li><strong>Basic Math &amp; Memory</strong>: Inside a smart contract, simple operations like adding two numbers together (ADD) cost just <strong>3 gas</strong>.</li><li><strong>Reading &amp; Writing Permanent Storage</strong>: Updating the blockchain’s permanent database is the heaviest work a transaction can do, because every node on the network has to store that state change. Reading a variable from permanent storage for the first time in a transaction (SLOAD) costs <strong>2,100 gas</strong>. Writing a brand-new non-zero value into an empty storage slot (SSTORE from 0 to 1) costs <strong>20,000 gas</strong>, while updating an already non-zero slot (SSTORE from 1 to 2) costs <strong>2,900 gas</strong>.</li></ul><p>As your transaction runs, an internal meter starts at 21,000 and adds up the exact cost of every instruction executed along the way.</p><p>Now let’s see how this looks on two real transaction receipts.</p><h3>Case Study One: Calling increment() on Monad Testnet</h3><p>For our first case study, I interacted directly with a smart contract deployed on Monad Testnet by calling its increment() function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s-3tx1-SoxHnyuF9LqlCzg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-XIfPbF81Jafbpaw6PAoPw.png" /></figure><p>Here are the exact details from the transaction receipt:</p><p>FieldValueNetworkMonad TestnetFunction Calledincrement()Transaction StatusSuccessTransaction Value0 MONGas Limit49,785Gas Used (as reported)49,785Gas Usage100%Gas Price102.82 GweiTransaction Fee0.0051188937 MON</p><p><strong>Why Did a </strong><strong>0 MON Transaction Still Incur a Fee?</strong></p><p>Notice that the <strong>Transaction value</strong> is 0 MON. My transaction didn&#39;t send any MON tokens to another person or contract, yet it still charged a fee of 0.0051188937 MON. Why?</p><p>In our delivery truck analogy, <strong>Transaction value</strong> is the cash you put inside an envelope to send to someone across town. Even if you send the driver with $0 in the envelope just to flip a switch at the warehouse, the truck still has to burn fuel to drive there and flip the switch.</p><p>Look at the Solidity contract behind increment():</p><pre>// SPDX-License-Identifier: MIT<br>pragma solidity 0.8.30;<br><br>contract Counter {<br>    uint256 public count;<br><br>    function increment() external {<br>        count = count + 1;<br>    }<br>}</pre><p>This contract stores a number called count on the blockchain. Whenever someone calls increment(), the contract increases count by one (changing it from 0 to 1, or 1 to 2). Even though the code looks tiny, the blockchain still has to process the transaction, run the contract&#39;s instructions, read the current value of count, and write the updated number into permanent storage.</p><p>The transaction fee pays for that computational processing and state update, not for transferring currency.</p><p><strong>How Was the Fee Calculated — And Why Was Gas Usage 100%?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-XIfPbF81Jafbpaw6PAoPw.png" /></figure><p>On this receipt, the <strong>Gas limit</strong> was 49,785, and the <strong>Gas used</strong>, as reported was also <strong>49,785</strong>:</p><pre>Gas Usage Percentage = (49,785 ÷ 49,785) × 100 = 100%</pre><p>And if we multiply the Gas limit (49,785) by the Gas price (102.82 Gwei):</p><pre>49,785 x 102.82 Gwei = 5,118,893.7 Gwei</pre><p>Using the conversion of $10⁹ Gwei per 1 MON:</p><pre>Transaction Fee = 5,118,893.7 ÷ 10⁹ = 0.0051188937 MON</pre><p>This matches the displayed transaction fee down to the last digit.</p><p>But this raises an important question: <strong>Why does Monad calculate the fee using the </strong><strong>Gas Limit, and why did the receipt report 100% gas usage?</strong></p><p>Unlike Ethereum, which charges you based on the gas your transaction actually used after running, <strong>Monad charges based on the </strong><strong>Gas Limit you declare upfront</strong> (and sets gasUsed equal to gasLimit on the top-level receipt).</p><p>To understand why, compare <strong>a supermarket checkout (Ethereum)</strong> with <strong>booking cargo on an airplane (Monad)</strong>:</p><ul><li><strong>Ethereum (Supermarket Checkout)</strong>: When an Ethereum validator builds a block, it runs each user’s transaction on the spot before picking the next one. Because it runs the code immediately, it sees the exact Gas Used right away and knows exactly how much space is left in the block for the next person.</li><li><strong>Monad (Booking Cargo on a Flight)</strong>: To process thousands of transactions per second, Monad uses asynchronous execution: validators pack transactions into a block and lock in the order before running the smart contract code. Because the network hasn’t run your code yet when packing the block, it doesn’t know what your actual Gas Used will be--it only sees the Gas Limit you asked to reserve!</li></ul><p>If Monad let users reserve massive amounts of block space using a huge Gas Limit and then only charged them for a tiny Gas Usedafterward, someone could reserve an entire block, crowd out everyone else on the network, and pay almost nothing. Just like reserving 10 seats on a bus or cargo flight where other passengers have to be turned away at the gate, on Monad you pay for the exact capacity you reserve upfront (Gas Limit).</p><h3>Case Study Two: Inspecting a Transaction on Ethereum Sepolia Testnet</h3><p>To see how standard Ethereum fee accounting differs, I went to the <strong>Ethereum Sepolia Testnet</strong> block explorer and pulled up a random transaction hash to inspect its receipt. In this transaction, the sender called the close() function on a smart contract.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pIb0qsO205oCnXwX49uEqw.png" /></figure><p>Here are the transaction details:</p><p>FieldValueNetworkEthereum Sepolia TestnetFunction Calledclose()Transaction StatusSuccessTransaction Value0 ETHGas Limit156,059Gas Used152,492Gas Usage97.71%Effective Gas Price (as reported)0.000153611 GweiTransaction Fee0.000000023424448612 ETH</p><p><strong>Gas Limit vs. Gas Used (And What Happens to Unused Gas)</strong></p><p>Just like the Monad transaction, this transaction sent 0 ETH in value while paying a fee to execute smart contract logic. However, look at the difference between the limit and the actual consumption.</p><ul><li>Gas limit: 156,059</li><li>Gas used: 152,49</li></ul><pre>156,059 - 152,492 = 3,567 unused gas</pre><pre>Percentage Consumed = (152,492 ÷ 156,059) × 100 ≈ 97.71%</pre><p>Here, the transaction consumed 97.71% of its limit and left 3,567 gas (2.29%) untouched.</p><p><strong>What happens to that </strong><strong>3,567 unused gas on Ethereum?</strong></p><p>When a transaction begins on Ethereum, the protocol temporarily locks enough ETH from the sender’s balance to cover the entire 156,059 Gas Limit (just like a fuel pump pre-authorizing your card before you pump). As the code executes, the meter ticks up to 152,492. The moment execution finishes, the leftover 3,567 gas is <strong>immediately refunded</strong> back to the sender&#39;s wallet inside the exact same transaction, and that unused capacity is freed up for other transactions in the block.</p><p><strong>How the Sepolia Transaction Fee Was Calculated</strong></p><p>Because Ethereum refunds unused gas, the final fee is calculated strictly on <strong>Gas used</strong>:</p><pre>Transaction fee = Gas used x Effective gas price</pre><p>Multiplying the 152,492 gas actually consumed by the 0.000153611 Gwei effective gas price:</p><pre>152,492 x 0.000153611 Gwei = 23.424448612 Gwei</pre><p>Since 1 ETH = 10⁹ Gwei:</p><pre>Fee = 23.424448612 ÷ 10⁹ = 0.000000023424448612 ETH</pre><p>Notice that the unused 3,567 gas was never charged to the sender.</p><h3>How Do You Know What Gas Limit to Set?</h3><p>Looking at numbers like 49,785 on Monad and 156,059 on Sepolia, a natural question comes up: <strong>How does anyone know how much gas a contract will need before sending the transaction?</strong></p><p>You don’t have to calculate opcodes manually. In practice, gas limits are estimated automatically:</p><ol><li><strong>Wallet &amp; RPC Simulation (</strong><strong>eth_estimateGas)</strong>: Before you click &quot;Confirm&quot; in your wallet, the wallet silently calls a method on an RPC node called eth_estimateGas. The node runs a <strong>free practice simulation (dry run)</strong> of your transaction against the current state of the blockchain in its local memory, counts the exact gas used, and reports that number back. Your wallet then adds a small safety buffer (often 10% to 20%) in case the blockchain state changes slightly before your transaction lands in a block.</li><li><strong>Developer Tooling (Foundry)</strong>: When writing smart contracts in Foundry, running forge test --gas-report or cast estimate simulates your function calls and prints out the exact gas numbers before you ever deploy to a live network.</li></ol><blockquote><em>Practical takeaway: Because Monad charges you for your declared </em><em>Gas Limit, you should rely on </em><em>eth_estimateGas with a modest buffer rather than manually typing in an artificially huge gas limit!</em></blockquote><h3>Understanding Gas Price and Gwei</h3><p>Now that we’ve covered Gas Limit and Gas Used, let&#39;s look at <strong>Gas Price</strong> and <strong>Gwei</strong></p><p>While gas measures the computational effort (liters of fuel), <strong>gas price</strong> is the monetary cost per single unit of gas (price per liter). Because a single unit of gas costs a tiny fraction of 1 ETH or 1 MON, we express gas prices in <strong>Gwei</strong> (short for <em>Giga-wei</em>) so we don&#39;t have to read strings of nine zeros:</p><pre>1 ETH (or MON) = 10⁹ Gwei = 1,000,000,000 Gwei</pre><pre>1 Gwei = 0.000000001 ETH</pre><p>When someone says <em>“Gas price is 20 Gwei,”</em> they don’t mean the whole transaction costs 20 Gwei. They mean <strong>each single unit of gas costs 20 billionths of an ETH</strong>.</p><p>Suppose a transaction consumes 50,000 gas:</p><ul><li>At <strong>10 Gwei</strong> per gas: <strong>50,000 x 10 Gwei = 500,000 Gwei</strong> (<strong>0.0005 ETH</strong>).</li><li>At <strong>20 Gwei</strong> per gas: <strong>50,000 x 20 Gwei = 1,000,000 Gwei</strong> (0.001 ETH).</li></ul><p>Notice that the computational work (50,000 gas) stayed completely identical--the fee doubled purely because network demand pushed the price per unit of gas twice as high.</p><h3>Decoding EIP-1559: Base Fee, Priority Fee, and Max Fee</h3><p>Both the Monad and Sepolia receipts identify the transaction type as <strong>EIP-1559 (Type 2)</strong>. Under EIP-1559, the gas price is broken down into specific components. Let’s look at the fee breakdown from the Sepolia receipt:</p><p>Fee FieldValueNetworkEthereum Sepolia TestnetBase Fee0.000000015 GweiMax Priority Fee0.000153596 GweiMax Fee0.000153614 GweiEffective Gas Price0.000153611 Gwei</p><p>Here is how these four numbers fit together:</p><ol><li><strong>Base fee (</strong><strong>0.000000015 Gwei)</strong>: The mandatory minimum rate per unit of gas for that block, determined automatically by the network based on how full previous blocks were. On Ethereum, the base fee is <strong>burned</strong> (destroyed) rather than paid to the block proposer.</li><li><strong>Max priority fee (</strong><strong>0.000153596 Gwei)</strong>: The maximum tip per unit of gas the sender offers directly to the block proposer (validator) to incentivize them to include the transaction.</li><li><strong>Max fee (</strong><strong>0.000153614 Gwei)</strong>: The absolute ceiling per unit of gas the sender is willing to pay in total (Base fee + Priority fee) in case the base fee jumps while the transaction is waiting.</li><li><strong>Effective gas price (</strong><strong>0.000153611 Gwei)</strong>: The actual rate per unit of gas charged when the block was produced:</li></ol><pre>Effective gas price = Base fee + Effective priority fee</pre><pre>0.000000015 Gwei + 0.000153596 Gwei = 0.000153611 Gwei</pre><p>Because 0.000153611 Gwei was safely below the sender&#39;s Max fee cap of 0.000153614 Gwei, the transaction paid the exact sum of the base fee and priority tip.</p><h3>Why Do Transactions Need a Gas Limit? (And Why Gas Costs Change)</h3><p><strong>Preventing Runaway Code</strong></p><p>Why does every blockchain transaction require a Gas Limit in the first place? Consider a contract function with a massive loop:</p><pre>function expensiveOperation() external {<br>    uint256 total;    <br>    <br>    for (uint256 i = 0; i &lt; 1_000_000; i++) {<br>        total += i;<br>    }<br>}</pre><p>If a transaction could execute without an upper bound — or accidentally hit an infinite loop — every node on the network would get stuck executing that loop forever, halting the blockchain.</p><p>The <strong>Gas Limit</strong> acts as a circuit breaker. If a transaction burns through all of its allotted gas before finishing, it stops with an <strong>Out of Gas</strong> error. When that happens, all state changes are reverted as if the transaction never happened, <strong>but the sender still pays for the gas consumed</strong> because the network already spent real computational work running the code up to that point.</p><blockquote><em>Keep in mind: having plenty of gas does not guarantee a transaction will succeed. If a contract fails an internal </em><em>require check or permission rule, the transaction will still revert even with gas left over.</em></blockquote><p><strong>Why Two Calls to the Same Function Can Use Different Gas</strong></p><p>It is also easy to assume that calling the same function with the same inputs will always consume the exact same amount of gas. In practice, gas usage depends on the exact state of the contract at the moment of execution.</p><p>For example, in our Counter contract, the very first call to increment() updates count from 0 to 1. Allocating a brand-new storage slot from zero to a non-zero number costs <strong>20,000 gas</strong>. The next call updates count from 1 to 2--and overwriting an already non-zero storage slot costs <strong>2,900 gas</strong>. Even though both users called increment(), the first call performed heavier database work under the network&#39;s rules.</p><h3>Comparing the Two Receipts: Are Fees on Monad Expensive?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-XIfPbF81Jafbpaw6PAoPw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pIb0qsO205oCnXwX49uEqw.png" /></figure><p>Let’s put our Monad Testnet interaction and the Sepolia Testnet receipt side by side</p><p>ConceptMonad Testnet: increment()Sepolia Testnet: close()Gas Limit49,785156,059Gas Used49,785152,492Gas Usage100%97.71%Effective Gas Price (as reported)102.82 Gwei0.000153611 GweiTransaction Fee0.0051188937 MON0.000000023424448612 ETHFee CalculationGas Used x Gas PriceGas Used x Effective Gas Price</p><p>When you look at this table, you might notice that 102.82 Gwei (0.0051 MON) looks numerically much larger than 0.000153611 Gwei (0.0000000234 ETH). Does that mean gas fees on Monad are expensive?</p><p>Not at all. In real-world dollar terms, Monad is designed so transactions cost a fraction of a cent. Those raw numbers cannot be compared directly for two reasons:</p><ol><li><strong>Different Native Tokens (</strong><strong>MON-Gwei vs. </strong><strong>ETH-Gwei)</strong>: 1 Gwei on Ethereum is one-billionth of 1 ETH (an asset priced in thousands of dollars), whereas 1 Gwei on Monad is one-billionth of 1 MON. Comparing 0.005 MON to 0.00000002 ETH is like comparing 50 Naira (or 5 Japanese Yen) to 0.03 US Dollars--a bigger number in one currency doesn&#39;t mean a higher cost!</li><li><strong>Monad’s </strong><strong>100 Gwei Minimum Base Fee Floor</strong>: To prevent spam when blocks aren&#39;t full, Monad enforces a minimum base fee of 100 MON-gwei (which is why our transaction was 102.82 Gwei: 100 Gwei base fee + 2.82 Gwei priority tip). Sepolia Testnet has no 100 Gwei floor, so its testnet base fee had drifted down to nearly zero (0.000000015 Gwei).</li></ol><h3>Common Misunderstandings About Gas (Quick Checklist)</h3><ul><li><strong>Gas and cryptocurrency are the same thing</strong>. They are not. Gas is a measurement of computational work; ETH and MON are the native assets used to pay for that work.</li><li><strong>The gas limit is the exact amount of gas a transaction will use</strong>. Not necessarily. The gas limit is the maximum allowance; actual execution often consumes less.</li><li><strong>A transaction with </strong><strong>0 value is free</strong>. Incorrect. Both of our transactions had a value of 0, and both required fees to pay for smart contract execution.</li><li><strong>A higher gas limit always means a higher fee</strong>. It depends on the network’s architecture! On Ethereum, you are only billed for Gas Used, and unused gas is refunded. On Monad, because blocks are packed asynchronously before execution, you are billed for the entire Gas Limit you reserve.</li><li><strong>Enough gas guarantees a transaction will succeed</strong>. Incorrect. Even with plenty of gas, a transaction will revert if it hits a failed contract condition or permission check.</li></ul><h3>How to Explain Gas to Someone Else</h3><p>If someone asks you, <em>“What is gas on the blockchain, and how do fees work?”</em>, here is how you can break it down cleanly</p><blockquote><em>Gas is the unit that measures how much computational work a transaction requires — just like liters of fuel needed for a delivery truck to complete a trip.</em></blockquote><p>Every transaction sets a <strong>Gas Limit</strong> (calculated automatically by your wallet simulating the transaction), which acts as a maximum fuel cap so a bad loop can’t run forever. As the transaction runs, it tallies up the <strong>Gas Used</strong> based on the exact instructions executed.</p><p>To find the <strong>Transaction Fee</strong>, you multiply the gas quantity by the Gas Price (measured in <strong>Gwei</strong>). On Ethereum, you only pay for the fuel your code actually burned (Gas Used), and any unused gas is refunded immediately. On high-speed asynchronous networks like Monad, where block space is reserved before running the code, you pay for the entire fuel limit you reserved upfront (Gas Limit).</p><p>Once you separate the unit of work, the maximum allowance, the actual consumption, and the price per unit, any transaction receipt on any EVM block explorer becomes intuitive to read.</p><h3>Let’s Figure Out the Rest Together</h3><p>Writing this guide started with a simple realization: it is completely normal to use blockchains, deploy contracts, and still feel a bit fuzzy on what every single line of a transaction receipt is actually telling you. Moving from memorizing definitions to tracing the exact numbers is how the mental model finally clicks.</p><p>Now I’d love to hear from you: <strong>What part of Gas still feels unclear, confusing, or tricky to explain?</strong></p><ul><li>Is there a field on a block explorer receipt that you’ve always wondered about?</li><li>Have you ever run into an unexpected Out of Gas error or a strange gas estimation spike while testing a contract?</li><li>Or do you have a favorite real-world analogy of your own for explaining gas, Gwei, or EIP-1559 to someone new?</li></ul><p>Drop your questions, edge cases, or thoughts in the comments below — no question is too basic or too far down the rabbit hole. Let’s unpack them together.</p><p><a href="https://www.binnadev.com/"><strong>BinnaDevLab</strong></a><br><em>Reasoning Precedes Coding.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f908baeb385" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What the DAO Hack, Parity Freeze and Ronin Exploit Teach Us About Immutability]]></title>
            <link>https://medium.com/@duruobinnafranklin/what-the-dao-hack-parity-freeze-and-ronin-exploit-teach-us-about-immutability-00e94b88acff?source=rss-9b8c3188024e------2</link>
            <guid isPermaLink="false">https://medium.com/p/00e94b88acff</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Obinna Franklin Duru]]></dc:creator>
            <pubDate>Mon, 12 Oct 2026 08:11:30 GMT</pubDate>
            <atom:updated>2026-10-12T08:11:30.837Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qUienEpL-WZsChGYjgGeug.png" /></figure><p>In 2016, an attacker discovered a bug in a smart contract called the DAO.</p><p>He didn’t need to compromise Ethereum. He didn’t need a zero-day exploit. He found one bad assumption in the withdrawal logic, wrote a contract that exploited it recursively, and drained $60 million. Every node on the Ethereum network confirmed every transaction. The blockchain did its job perfectly.</p><p>That’s the thing about immutable code. It can’t lie. But it also means it can’t be fixed.</p><p>I’ve been sitting with this idea since I hosted Session 3 of BinnaDevLab Cohort 1. I invited Uchenna Ofoma, a software engineer of 3+ years currently focused on the distributed systems that underpin blockchain technology, to walk us through the full engineering reality of deploying code you can never take back. What followed was one of the most honest breakdowns of Web3 security I’ve heard.</p><p>If you’d rather watch than read, here’s the full 42-minute session:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FUWpmbW5uU0w%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DUWpmbW5uU0w&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FUWpmbW5uU0w%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7acf9da41dc9134418d802bab423e4c4/href">https://medium.com/media/7acf9da41dc9134418d802bab423e4c4/href</a></iframe><h3>What “Deploying” Actually Means</h3><p>I opened the session by framing the core question: what does it actually mean that a smart contract is immutable?</p><p>Most developers have an intuition for deployment — you push code, it runs on a server, the server can be updated or rolled back. Uchenna immediately challenged that mental model.</p><p>When you deploy a smart contract, your code gets compiled to EVM bytecode — an intermediate representation designed specifically to run on the <a href="https://ethereum.org/developers/docs/evm">Ethereum Virtual Machine</a>. From that moment, your code gets a permanent address. Every node on the network holds a copy and can execute it. Nobody owns the server. There is no centralized server.</p><p>As Uchenna put it: “Once you deploy your smart contract, just take it that it’s online forever or until the blockchain inevitably goes down someday, somehow.”</p><p>The reason for this is deterministic execution. The EVM guarantees that given the same inputs, every node produces the same output. This is what makes decentralization possible: no one node needs to be trusted, because they all agree on the math. But it also means your bug is their bug permanently.</p><h3>Two Kinds of Trust</h3><p>Before Uchenna walked us through what goes wrong, he established something I thought was fundamental and it connects directly back to what we covered in Session 1.</p><blockquote><em>“If the owner can go to edit the rules, you’re back to trusting a company, which is what we’re trying to avoid.”</em></blockquote><p>The whole promise of a smart contract is that you’re replacing trust in a person with trust in code. Anyone can audit it. Anyone can verify it. It runs without asking permission. But the moment you give an admin the ability to change the code, you’ve reintroduced a human and with it, all of human failure.</p><p>That’s the foundation:</p><blockquote><em>“A contract you can edit is not an agreement — it’s a promise.”</em></blockquote><p>When Uchenna said that, I wrote it down immediately. It cuts straight to why any of this matters.</p><h3>When Forever Goes Wrong</h3><p>This is the section of the session I wasn’t fully prepared for. I knew Uchenna was going to cover the major hacks. I didn’t expect the specific engineering detail he brought to each one.</p><p><strong>The DAO $60 million Hack</strong></p><p>The DAO was a decentralised fund on Ethereum. Members could pool ETH and vote on how to allocate it. A smart contract managed all the funds.</p><p>There was a bug, a re-entrancy bug. Uchenna explained it in a way that made it immediately understandable:</p><p>The contract let you withdraw your balance. But before it updated your balance, it made an external call to send you the ETH. An attacker wrote a contract that, the moment it received ETH from the withdrawal, immediately called the withdrawal function again before the balance had been marked as zero. Then again. And again.</p><p>He kept entering the vault before it could record that he’d left.</p><p>By the end, he had drained approximately $60 million. The code didn’t fail. No exception was thrown. The EVM executed every call exactly as instructed.</p><p>The fix for this pattern is called <strong>Checks-Effects-Interactions</strong>: update all your state variables before you make any external calls. Mark the balance as zero first. Then send the money. If someone tries to re-enter, they find an empty account.</p><p>The aftermath is one of the most significant moments in blockchain history. The Ethereum community forked the chain — creating a copy up to just before the hack — so that affected users could get their money back. The old chain, where the attacker kept his funds, became what we now know as <a href="https://en.wikipedia.org/wiki/Ethereum_Classic">Ethereum Classic</a>. The blockchain literally split in two over one bug.</p><p><strong>The Parity Wallet Freeze — $280 million</strong></p><p>In 2017, Parity Technologies built a popular multi-signature wallet. Multiple signatures were required to move funds, no one person could act alone.</p><p>The problem was architectural. Their wallets shared a single library contract. That library had an unguarded initialization function, no access control, no guard on who could call it.</p><p>A user exploring the code called it. Then, exploring further, called the function to delete the library.</p><p>$280 million was locked. Not stolen. Just permanently inaccessible, because the code that would authorise withdrawals no longer existed.</p><p>The fix is access control: every state-changing function needs to verify who is calling it before allowing the action to proceed.</p><p><strong>The Ronin Sidechain Exploit — $625 million</strong></p><p>Ronin was the sidechain powering Axie Infinity. To validate transactions, it used nine validator keys. A majority, five of nine was required to approve any action.</p><p>Attackers compromised five of them.</p><p>Uchenna’s analogy during the session stuck with me: “Half of nine is 4.5. They’ve compromised five. Five is more than 4.5.”</p><p>With majority control, the attackers could authorize anything. $625 million left. The code worked exactly as designed. It was just the wrong people holding the keys.</p><h3>How Engineers Live With It</h3><p>After walking through what failed, Uchenna shifted to what engineers do in response. The honest answer is that <strong>there are no perfect solutions, only trade-offs.</strong></p><ul><li><strong>Proxy Contracts:</strong> You can deploy a “proxy” that users interact with, which delegates logic to an implementation contract behind the scenes. When you need to patch a bug, you deploy a new implementation and point the proxy at it. The address never changes. The logic does.</li><li><strong>Time Locks:</strong> Any upgrade or large fund movement gets queued with a delay like 72 hours. This gives the community time to notice if something suspicious is being pushed.</li><li><strong>Multi-sig wallets:</strong> No single person can push the button. A 3-of-5 multi-sig requires three separate private keys to sign any transaction.</li><li><strong>Third-party audits and bug bounties:</strong> Independent firms review your code. Or you open a bounty for anyone to report a vulnerability, get paid. The goal is to maximize the number of friendly eyes before deployment, because after deployment, every eye is potentially hostile.</li></ul><h3>Every Escape Hatch Is Also an Attack Hatch</h3><p>This was the moment of the session that landed hardest.</p><p>Every mechanism you build to survive a bug is also a mechanism an attacker can use against you.</p><p>Proxy contracts? An attacker who controls the admin key can push a malicious implementation.</p><p>Time locks? The attacker now has 72 hours to prepare not just a few seconds.</p><p>Uchenna’s framing:</p><blockquote><em>“An immutable bug is honest. An upgradeable protocol is a promise with a delay.”</em></blockquote><p>An immutable contract is what it is. Its failure mode is fixed and visible. An upgradeable contract introduces ongoing risk: the humans holding the upgrade keys, forever. If those humans are ever compromised or ever act against users’ interests, the upgrade path becomes the exploit.</p><p>The engineer’s job, as Uchenna put it, is to decide which failure they can live with.</p><h3>DYOR Is Not Just a Meme</h3><p>I closed the session with something I feel strongly about, and I want to say it directly here too.</p><p>DYOR (Do Your Own Research), gets thrown around in crypto circles as a joke or a liability disclaimer. But after what Uchenna walked us through, it’s the only honest answer to the immutability problem.</p><p>If you’re building: audit your code, run open-source tools against it, get third-party reviews, and be honest about what your protocol assumes. Know what your upgrade path actually exposes.</p><p>If you’re using: don’t trust a protocol because the team told you to. Find the audit report. Look at who holds the keys. Understand whether the thing you’re interacting with is truly immutable or whether there’s an admin somewhere with a button.</p><p>The code can’t lie. But you need to be able to read it.</p><p>We’re running Cohort 1 of BinnaDevLab: a structured developer program built on reasoning from first principles. Session 3 was the theory. Session 4 is the practical: actually writing smart contracts and experiencing immutability firsthand.</p><p>Missed Session 1 on trust and decentralization? Watch it here.</p><p><a href="https://youtu.be/MTpR9-JL1ig">https://youtu.be/MTpR9-JL1ig</a></p><p>Follow along on <a href="https://www.youtube.com/@BinnaDevLab">YouTube</a> or join the community at <a href="https://discord.gg/KFxVtAQpA">binnadev.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=00e94b88acff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blockchain Isn’t About Crypto. It’s About a Trust Problem You Didn’t Know You Had.]]></title>
            <link>https://medium.com/@duruobinnafranklin/blockchain-isnt-about-crypto-it-s-about-a-trust-problem-you-didn-t-know-you-had-c83bcb94f3b0?source=rss-9b8c3188024e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c83bcb94f3b0</guid>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[explainer]]></category>
            <dc:creator><![CDATA[Obinna Franklin Duru]]></dc:creator>
            <pubDate>Wed, 07 Oct 2026 10:50:34 GMT</pubDate>
            <atom:updated>2026-10-07T10:50:34.441Z</atom:updated>
            <content:encoded><![CDATA[<p>Before we started the first session of BinnaDevLab Cohorts, I knew one thing with certainty:</p><p>If we opened with the word “blockchain,” we’d lose half of the room.</p><p>Not because the topic is hard. Because the word carries baggage. Crypto speculation. NFT mania. Headlines about scams and volatility. By the time most developers hear “blockchain,” they’ve already formed an opinion and it’s usually dismissive.</p><p>So we didn’t start there.</p><p>We started with a question.</p><p><strong>“Think of an app you used this morning. Name it.”</strong></p><p>That was the warm-up exercise Uchenna Ofoma, our facilitator for Session 1 put to the cohort.</p><p>The answers came quickly.</p><p><em>Opay. WhatsApp. Gmail. Facebook. Sporty.</em></p><p>Uchenna nodded at each one. Then he asked the follow-up question. The one that changed everything:</p><p><strong>“Who were you actually trusting?”</strong></p><p>The room went quiet.</p><p>Not the app. Not the company. When you send ₦5,000 on Opay, you’re trusting:</p><ul><li>Opay’s servers to record the transaction accurately</li><li>The commercial bank Opay connects to</li><li>NIBSS to clear the interbank transfer</li><li>The KYC provider that verified both account holders</li><li>The CBN regulatory framework sitting beneath all of it</li></ul><p>You weren’t trusting one party. You were trusting a <strong>chain</strong> and you had zero visibility into any link of it.</p><p>That’s not a crypto problem. That’s not a web3 problem. That’s a software engineering problem that exists in every application you’ve ever built or used.</p><p>And that is the real reason blockchain was invented.</p><h3>Why We Built BinnaDevLab Around This</h3><p>When I started BinnaDevLab Cohorts, the goal was simple but specific: train developers to reason at a global level not just to write code, but to understand why systems are designed the way they are.</p><p>The industry is full of bootcamps that teach you to ship fast. We wanted to build something different. A program built on the principle that <strong>reasoning comes before coding</strong>. That understanding the problem deeply is the actual skill, the code is just the output.</p><p>Blockchain was the perfect first topic. Not because it’s trendy. Because it sits at the intersection of distributed systems, game theory, cryptography, and trust and most introductions to it skip all of that in favour of price charts.</p><p>We wanted to go the other way.</p><h3>What Actually Happens When Trust Breaks</h3><p>🎬 <strong>Prefer to watch?</strong> The full 64-minute session is on YouTube<br><a href="https://youtu.be/MTpR9-JL1ig">Blockchain Fundamentals Explained | BinnaDevLab Cohort 1, Session 1</a></p><p>Uchenna spent the core of Session 1 on a deceptively simple question: where does the trust network fail?</p><p>The answer: <strong>single points of failure.</strong></p><p>Every link in that chain we described: Opay, the bank, NIBSS, the KYC provider is a centralised entity. That means:</p><ul><li>One server goes down -&gt; transactions fail</li><li>One database is compromised -&gt; your data is leaked</li><li>One regulatory decision -&gt; your account is frozen without warning</li><li>One bad actor inside the organisation -&gt; the records are altered</li></ul><p>You have no way to verify what’s happening. You’re trusting the institution to be honest, competent, and well-intentioned. Usually they are. But the system requires you to trust them, you have no alternative.</p><p>Blockchain’s argument is not that institutions are corrupt. It’s that you shouldn’t have to assume they’re honest. The system should be designed so that anyone can verify the truth not just the people running the servers.</p><p>In practice, that means:</p><ul><li>Instead of rules locked on a private server -&gt; rules deployed as code, in public</li><li>Instead of promises -&gt; anyone can read the code and check exactly what it does</li><li>Instead of one keeper -&gt; everyone keeps a copy, and no single party can rewrite history</li></ul><p>That’s not magic. That’s engineering. And it comes with real costs.</p><p><strong>The Honest Trade-offs (Most Courses Skip This Part)</strong></p><p>One of the things I’m proudest of in how Uchenna ran Session 1 is that he didn’t sell blockchain. He explained it including the parts that hurt.</p><p>Distributed verification is slower than a centralised server. Always. If you need instant transaction finality, a blockchain is the wrong tool.</p><p>It’s more expensive to run. Every node in the network has to process every transaction. That cost is real and it compounds at scale.</p><p><strong>Finality works differently</strong>. On your bank app, if you send money to the wrong person, you call customer service. On a public blockchain, the transaction is final. There is no customer service. The code runs.</p><p>And perhaps the sharpest point: <strong>blockchain doesn’t remove trust</strong>. It relocates it. You stop trusting institutions and start trusting code, mathematics, and the incentive structures of a decentralised network. That’s a different kind of trust, more auditable, more transparent, but trust nonetheless.</p><p>Understanding those trade-offs is what separates engineers who can reason about distributed systems from developers who just know how to call a Web3 library.</p><p><strong>Watch the Full Session</strong></p><p>Everything I’ve described above is the skeleton of a 64-minute live session with audience interaction, Q&amp;A, and a cohort working through these ideas in real time.</p><p>Uchenna also covered:</p><ul><li>A brief history of blockchain (Bitcoin 2008 -&gt; Ethereum 2015 -&gt; today)</li><li>Public vs. private blockchains and why each exists</li><li>What Ethereum and the EVM actually are</li><li>What people are building on Ethereum right now</li><li>Consensus mechanisms: Proof-of-Work, Proof-of-Stake, Proof-of-History</li><li>A live Q&amp;A: does blockchain make systems trustless, or does it just shift the trust?</li></ul><p>If this article gave you the argument, the video gives you the full picture including the moments where the cohort pushed back and Uchenna had to defend his reasoning in real time.</p><p>That’s the kind of session we wanted to build. Not a lecture. A thinking session.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FMTpR9-JL1ig%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DMTpR9-JL1ig&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FMTpR9-JL1ig%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/041391380f477abb5f56c96dd517e7e6/href">https://medium.com/media/041391380f477abb5f56c96dd517e7e6/href</a></iframe><p><a href="https://youtu.be/MTpR9-JL1ig">Watch here 👉 Blockchain Fundamentals Explained | BinnaDevLab Cohort 1, Session 1</a></p><h3>What’s Next</h3><p>Session 2 is hands-on. Obinna takes the cohort from theory into code writing and deploying a smart contract in Solidity, live.</p><p>If Session 1 answers why blockchain exists, Session 2 answers how you build on it.</p><p>Follow BinnaDevLab to catch it when it drops.</p><h3>About BinnaDevLab</h3><p>BinnaDevLab is a developer training community built around one idea: reason before you code.</p><p>We run structured cohorts for developers who want to build with depth not just ship fast.</p><p>🌐 <a href="https://www.binnadev.com/cohorts">binnadev.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c83bcb94f3b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Internet Hasn’t Changed]]></title>
            <link>https://medium.com/@duruobinnafranklin/the-internet-hasnt-changed-58b2b55e4213?source=rss-9b8c3188024e------2</link>
            <guid isPermaLink="false">https://medium.com/p/58b2b55e4213</guid>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Obinna Franklin Duru]]></dc:creator>
            <pubDate>Mon, 07 Sep 2026 12:26:00 GMT</pubDate>
            <atom:updated>2026-09-07T12:26:00.780Z</atom:updated>
            <content:encoded><![CDATA[<p>Before we argue about the future of the web, we need to understand what it has always been: one continuous system of innovation built on the exact same foundation.</p><p>Let’s start with the Web3 ecosystem.</p><p>When people talk about Web3, the conversation usually gets tangled up in tokens, hype, and technical buzzwords. But at <a href="https://binnadev.com/"><strong>BinnaDevLab</strong></a>, when we talk about the Web3 ecosystem, we are not talking about a completely different technology. We are referring to the internet as a whole, viewed from Version 3.</p><p>Because the truth is, the internet hasn’t fundamentally changed.</p><p>The internet has always been a means of connection. The core idea is simply to bring people together, share resources, and bridge communication. If you Google the word “Internet,” you’ll get a definition something like this: <em>a global system of connected computer networks that people use to share information and communicate worldwide.</em></p><p>Over the years, we have experienced completely different ways of doing this. We went from writing letters and painting on walls, to static web pages, social media apps, and streaming reels. It feels like a different world, but it is just a system of innovation built on the exact same block.</p><p><strong>The Water Analogy</strong></p><p>Think about drinking water for a second.</p><p>In ancient times, people used their hands, clay pots, or carved artifacts to draw water. Today? We use modern dispensers, insulated smart cups, and bottled cans. The method changed entirely, but the fundamental action remained exactly the same: we are still drinking water.</p><p>The point of innovation is not to change the fundamental purpose. It is to improve the vessel that delivers it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*y-FeMIs1qAhGq__t.png" /></figure><p>Bring this to the internet. When you strip away the buzzwords, the internet is simply our vessel for communication. The changes that happen over time are just iterations. We attach numbers to them, but if you look closely, they all mean the same thing.</p><h3>Season 1: The “Read-Only” Web</h3><p>When you see the word “Web1,” what is the first thing that comes to your mind?</p><p>We all know the “web” is the internet. But when we attach a “1” to it, it triggers curiosity. Why call it 1?</p><p>It’s just like a television series. You have Season 1, Season 2, and Season 3. The numbers are simply there to show progression. Innovation is a progression; it has different iterations, and we need to keep track of it. Web1 just means the first version of the show.</p><p>So, what did Season 1 of the internet look like? Take a pause and think about it for a minute.</p><p>Web1 was the “read-only” web.</p><p>Companies published, and you consumed. You could visit a website and read what was there, but you couldn’t easily comment, post, or interact. The information was mostly static text and typed documents.</p><p>But at the time, it solved a massive problem: it removed physical barriers to information. The core promise was, <em>“Anyone with a browser can access information from anywhere.”</em></p><p>We haven’t stopped chasing that goal. We just wanted a level up.</p><h3>Human Ambition and Season 2</h3><p>Humans are never satisfied.</p><p>Men sat and thought: “If birds can fly, shouldn’t we build a vehicle to do that?” “If fish can swim, shouldn’t we build a vehicle to do that too?”</p><p>That exact mindset pushed the internet from Season 1 to Season 2. Web1 gave us the protocols and the connection, but human ambition always wants to go further. We wanted to move from just “publish and read” to “interact, share, and build together.”</p><p>This birthed Web2: the “read-and-write” web.</p><p>Web2 didn’t change the fundamental internet. It just brought our pictures, our videos, and our voices into the mix. But this caused a massive cultural shift. Why? Because suddenly, you weren’t just consuming the information anymore. You became the information that other people consume.</p><p>The internet became highly interactive and social. But making ourselves the product came with a hidden cost we didn’t fully understand at the time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Fvk994QCaB1Kyy3R.png" /></figure><h3>The Hidden Cost and the Web3 Fix</h3><p>Web2 is amazing, but it is dominated by a few giant platforms. They store your data. They decide what gets shown or removed. They monetize your activity, keeping the profits while you create the value.</p><p>That is why people started pushing for Web3. We saw central gatekeepers raising issues of censorship. We saw privacy slipping away. People wanted more say over their digital identity.</p><p>For some reason, people try to detach Web3 from the internet, as if it’s some completely alien technology. It’s not. It is simply the next season of the exact same show, designed to fix a glaring structural problem.</p><p>Web3 uses new tech enablers like blockchain, decentralized storage, and peer-to-peer protocols, to introduce the “read-write-own” web.</p><p>Here is the progression:</p><ul><li><strong>Web 1.0 (Read-only):</strong> Companies publish, you consume.</li><li><strong>Web 2.0 (Read-write):</strong> You interact, but platforms own the space and the data.</li><li><strong>Web 3.0 (Read-write-own):</strong> You interact, but you own your data, your identity, and the value you create without a central intermediary.</li></ul><p>Instead of data living on a few company servers, it’s distributed. It’s not a buzzword. It’s a structural fix.</p><h3>You Are An Internet Builder</h3><p>I need to clear up a major misconception: Web3 is not at war with Web2 or Web1.</p><p>Do not see this as a competition. Web1 hasn’t even faded away; every time you read a static webpage, you are using the fundamental internet. Web3 was birthed from the others. They all share the exact same DNA.</p><p>If Web3 promises to remove centralized gatekeepers, it means eventually, someone will find the gaps in Web3 and introduce the next innovation. Maybe Web4. You will find a pattern that they are just continuously filling the gaps the previous version left behind. It is one whole, continuous system.</p><p>This means if you can build in Web1, you can build in Web2, Web3, and whatever comes next.</p><p>There are endless possibilities. You don’t have to box yourself in as just a “Web2 developer” or a “Web3 developer.”</p><p>You are an internet builder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*UGiQSy4fqltIm9er.png" /></figure><h3>The Engineering Method</h3><p>Because the web shares the same DNA, you need to have a foundational knowledge of versions 1 and 2 to actually grasp what we are building in version 3. You can’t build the future if you don’t understand the past.</p><p>At <a href="https://www.binnadev.com/"><strong>BinnaDevLab</strong></a>, we see the endless possibilities of these new iterations. We train developers to understand this entire ecosystem strictly from an engineering method.</p><p>The internet is here to stay. It may have different versions, but do not confuse it. It is still the same internet. We are still connecting. We are still sharing resources. We are still processing data. We are just using better vessels.</p><p>The Internet is Here. Come to <a href="https://www.binnadev.com/"><strong>BinnaDevLab</strong></a> and learn how to grow this knowledge.</p><p>Before you go, I have a quick task for you: Google what “engineering method” is, and drop your findings in the comments below. Let’s discuss it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58b2b55e4213" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ERC20 Edge Cases Every Smart Contract Engineer Should Know]]></title>
            <link>https://medium.com/@duruobinnafranklin/erc20-edge-cases-every-smart-contract-engineer-should-know-b6b0f57c1ae4?source=rss-9b8c3188024e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6b0f57c1ae4</guid>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[smart-contract-auditing]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <dc:creator><![CDATA[Obinna Franklin Duru]]></dc:creator>
            <pubDate>Mon, 22 Jun 2026 13:08:01 GMT</pubDate>
            <atom:updated>2026-06-22T13:08:01.716Z</atom:updated>
            <content:encoded><![CDATA[<p>Your protocol launches. Everything passes the test suite with 100% coverage. Your audits are clean.</p><p>Then, an unexpected token enters your liquidity pool. The accounting drifts by a fraction of a percent. Within hours, the discrepancy compounds. Users attempt to withdraw, and the transactions revert. The vault is permanently bricked, and funds are stuck.</p><p><strong>What went wrong?</strong></p><p>Most ERC20 exploits are not actually bugs in the protocol’s core logic. They happen because protocol engineers assume every token behaves exactly like a vanilla OpenZeppelin implementation.</p><p>The ERC20 standard is an interface, not a guarantee. It defines function signatures (transfer, approve, balanceOf), but it dictates absolutely nothing about the internal execution logic behind those signatures.</p><p>If your protocol integrates arbitrary tokens, your threat model immediately includes the behavior of those tokens. A single flawed assumption about how a token transfers, reverts, or accounts for balances can lead to systemic insolvency.</p><p>Let’s look under the hood of the most common ERC20 edge cases that break production systems, and how to engineer defensive architectures to mitigate them.</p><p><strong>The Four Assumptions That Break Integrations</strong></p><p>Before we look at specific edge cases, it helps to build a mental model of why these failures happen. Almost every ERC20 integration bug stems from one of four flawed assumptions:</p><ol><li><strong>Amount Assumptions:</strong> Believing the amount you request to transfer is the exact amount that will arrive.</li><li><strong>Execution Assumptions:</strong> Assuming token transfers are passive state updates, rather than active execution environments.</li><li><strong>Permission Assumptions:</strong> Believing that having a sufficient balance and allowance guarantees a transfer will succeed.</li><li><strong>Accounting Assumptions:</strong> Hardcoding precision logic or assuming token behavior is immutable.</li></ol><p>Let’s break down how these assumptions fail in production.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Ps3KePYONAvW_Jy6.png" /></figure><p><strong>Edge Case #1: Fee-on-Transfer &amp; Rebasing Tokens</strong></p><p><strong>The assumption</strong><br>If I call token.transferFrom(alice, vault, 100), the vault&#39;s balance increases by exactly 100.</p><p><strong>What actually happens</strong><br>Tokens can deduct a tax on transfer (e.g., a 5% protocol fee) or continuously alter user balances algorithmically (rebasing).</p><p><strong>Example failure</strong><br>A user deposits 100 fee-on-transfer tokens. The token takes a 5% fee.</p><pre>User calls deposit(100)<br>👇<br>Token executes transfer, deducts 5% tax<br>👇<br>Vault receives 95 tokens</pre><pre>❌ Vault internally mints 100 shares based on &#39;amount&#39; parameter<br>✅ Vault should mint 95 shares based on actual received funds</pre><p>Because the vault blindly minted 100 shares, the user can immediately withdraw 100 tokens, successfully stealing 5 tokens from previous depositors. The accounting drifts, and the last users to withdraw will be left with nothing.</p><p><strong>Mitigation</strong><br>Never trust the amount parameter for internal accounting. Always measure the actual balance delta before and after the transfer.</p><pre>uint256 balanceBefore = token.balanceOf(address(this));<br>token.safeTransferFrom(msg.sender, address(this), amount);<br>uint256 balanceReceived = token.balanceOf(address(this)) - balanceBefore;<br><br>// Use balanceReceived for all subsequent logic, never &#39;amount&#39;<br>_mintShares(msg.sender, balanceReceived);</pre><p><strong>Takeaway:</strong> Balance-delta accounting fixes this assumption. Unfortunately, the next edge case breaks protocols even when the balances match perfectly.</p><p><strong>Edge Case #2: Tokens with Callbacks (ERC-777 &amp; Transfer Hooks)</strong></p><p><strong>The assumption</strong><br>Calling transfer only updates storage balances and returns execution flow directly back to my contract.</p><p><strong>What actually happens</strong><br>Standards like ERC-777, or custom tokens with transfer hooks, actively hand execution control back to the sender or receiver via external calls during the transfer process.</p><p><strong>Example failure</strong><br>Your protocol updates the user’s internal debt balance after pushing tokens to them.</p><pre>User calls withdraw()<br>👇<br>Protocol calls token.transfer(user)<br>👇<br>Token calls back to User&#39;s smart contract<br>👇<br>User&#39;s contract calls withdraw() AGAIN (before protocol debt is updated)</pre><p>This is a classic reentrancy attack, facilitated entirely by the token’s internal hook.</p><p><strong>Why This Surprises Engineers:</strong> We naturally view tokens as passive data ledgers. Callbacks turn tokens into active, hostile execution environments.</p><p><strong>Mitigation</strong><br>Follow the Checks-Effects-Interactions (CEI) pattern religiously. Update all internal state before interacting with external tokens. Additionally, apply OpenZeppelin’s ReentrancyGuard (nonReentrant modifier) to any function interacting with external tokens.</p><p><strong>Takeaway:</strong> Reentrancy guards handle unexpected execution paths. But what happens when a token quietly fails without telling you?</p><p><strong>Edge Case #3: Returning </strong><strong>false vs. Reverting</strong></p><p><strong>The assumption</strong><br>If a token transfer fails, the transaction will revert.</p><p><strong>What actually happens</strong><br>Some older tokens (like ZRX) do not revert on failure. Instead, they gracefully return a false boolean.</p><p><strong>Example failure</strong><br>Your protocol calls token.transfer(user, amount)and doesn&#39;t check the return value. The transfer fails (returns false), but your code continues executing. The protocol marks the user&#39;s debt as paid, even though no tokens actually moved.</p><p><strong>Mitigation</strong><br>Never use bare transfer or transferFrom calls. Wrap them in logic that asserts the boolean return value is true.</p><p><strong>OpenZeppelin / best practice</strong><br>Always use OpenZeppelin’s SafeERC20 library (safeTransfer, safeTransferFrom). It normalizes behavior by forcing a silent false failure to revert.</p><p><strong>Takeaway:</strong> SafeERC20 forces silent failures to revert. But occasionally, you actually want certain transfers to bypass reverts.</p><p><strong>Edge Case #4: Zero Address &amp; Zero Amount Reverts</strong></p><p><strong>The assumption</strong><br>Transferring an amount of 0 is a harmless No-Op (no operation) that costs a little gas but executes successfully.</p><p><strong>What actually happens</strong><br>Different token implementations handle zeros differently. Some explicitly revert if the transferred amount is 0, or if the target is the zero address.</p><p><strong>Imagine this scenario:</strong><br>Your protocol distributes daily yields in a batch loop to 100 users. One user earned 0 yield today. The loop attempts to transfer(user, 0). The token reverts, crashing the entire transaction and preventing the other 99 users from receiving their yields.</p><p><strong>Mitigation</strong><br>Standardize behavior by wrapping transfers in a simple defensive check to bypass zero-amount logic.</p><pre>if (amount &gt; 0) {<br>    token.safeTransfer(user, amount);<br>}</pre><p><strong>Takeaway:</strong> Standardizing behavior protects your loops. But what if the token completely breaks the standard interface?</p><p><strong>Edge Case #5: Missing Return Values (The USDT Problem)</strong></p><p><strong>The assumption</strong><br>All ERC20 tokens return a boolean, as dictated by the standard interface.</p><p><strong>Production Reality:</strong> Tether (USDT) on Ethereum Mainnet is non-standard. Its transfer, transferFrom, and approve functions do not return a boolean; they return void.</p><p><strong>Example failure</strong><br>If your contract compiles against the standard IERC20 interface, the EVM expects boolean return data to decode.</p><pre>Standard: function transfer(...) returns (bool)<br>USDT:     function transfer(...) [returns void]<br>EVM:      &quot;Wait, where is the boolean to decode? Revert.&quot;</pre><p>Your protocol completely fails to integrate with the largest stablecoin on the market.</p><p><strong>Mitigation</strong><br>OpenZeppelin’s SafeERC20 handles this under the hood. By using safeTransfer, you safely abstract away the missing return value issue at the assembly level.</p><p>Takeaway: SafeERC20 handles legacy interfaces. But interface compatibility won’t save you from centralized control.</p><p><strong>Edge Case #6: Blacklisted Addresses</strong></p><p><strong>The assumption</strong><br>If an address has a sufficient balance and allowance, a transfer will always succeed.</p><p><strong>What actually happens</strong><br>Fiat-backed stablecoins like USDC and USDT maintain centralized blacklists. If an address is blacklisted, all transfers involving that address will revert.</p><p><strong>Example failure</strong><br>Your protocol liquidates undercollateralized debt. To close a position, it must send leftover USDC collateral to the user. The user gets blacklisted by Circle. The liquidation transaction reverts when attempting to send the leftover funds, preventing the protocol from clearing bad debt. The systemic risk cascades, threatening protocol solvency.</p><p><strong>Design Rule: Pull-over-Push</strong><br>Decouple protocol logic from token transfers. Instead of pushing funds to a user during a critical state change, record their balance internally and force them to pull (claim) it in a separate transaction.</p><p><strong>Takeaway:</strong> Decoupling logic prevents centralized blacklists from freezing your protocol. Speaking of centralized quirks, let’s look at approvals.</p><p><strong>Edge Case #7: Non-Zero Approval Restrictions</strong></p><p><strong>The assumption</strong><br>You can update an allowance from any number to any other number using approve(spender, newAmount).</p><p><strong>What actually happens</strong><br>To prevent approval front-running (where an attacker exploits an old allowance while a new one is pending), tokens like USDT require that allowances be reset to 0 before being updated to a new non-zero value.</p><p><strong>Example failure</strong><br>A router contract tries to update its USDT approval to a DEX from 50 to 100. It calls approve(dex, 100). Because the current allowance is 50 (non-zero), USDT reverts the transaction.</p><p><strong>Mitigation</strong><br>You must approve 0 before approving the target amount. In OpenZeppelin v5+, safeApprove was removed. Use forceApprove(), which natively handles the 0 reset under the hood.</p><p><strong>Takeaway:</strong> Approval races are tricky, but at least the token is always the token… right?</p><p><strong>Edge Case #8: Multiple Addresses for the Same Token</strong></p><p><strong>Mental Model:</strong> Think of an ERC20 token as a ledger. Usually, there is one door to access that ledger. But sometimes, developers build multiple doors (proxies, wrappers, aliases) that lead to the exact same ledger.</p><p><strong>What actually happens</strong><br>Some tokens (like older TrueUSD implementations) use multiple entry point addresses that point to the same underlying state.</p><p><strong>Example failure</strong><br>A lending protocol relies on the token’s contract address as a unique identifier for price feeds. An attacker uses a wrapper contract that proxies to the same underlying token. The protocol reads the proxy as an unverified token, misprices the collateral, and allows the attacker to borrow against manipulated values.</p><p><strong>Mitigation</strong><br>Identify tokens strictly by exact, whitelisted addresses. Never rely blindly on msg.sender to dynamically determine asset identity.</p><p><strong>Takeaway:</strong> Identity is fluid. And worse, token logic is mutable.</p><p><strong>Edge Case #9: Upgradeable Tokens</strong></p><p><strong>The assumption</strong><br>The token behavior I test today will be the token behavior in production tomorrow.</p><p><strong>What actually happens</strong><br>Tokens like USDC are upgradeable behind a proxy. The controlling entity can push an upgrade at any time, adding transfer fees, callbacks, or entirely new operational restrictions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Zqh5RdBEAwNp4_ul.png" /></figure><p><strong>Example failure</strong><br>You build a protocol assuming USDC has no fee-on-transfer. Circle upgrades USDC to enforce a 1 basis point transaction fee. Your static accounting breaks, and protocol funds become permanently locked because the math no longer balances.</p><p><strong>Mitigation</strong><br>Code defensively. Use balance-delta accounting (Edge Case #1) even if the token currently doesn’t require it. Build pause functionality into your own protocol so you can halt operations if an upgrade breaks your integration.</p><p><strong>Takeaway:</strong> You can’t control token upgrades, but you can control how you calculate value. Which brings us to spot balances.</p><p><strong>Edge Case #10: Flash-Mintable Tokens</strong></p><p><strong>The assumption</strong><br>Massive token balances represent real, scarce capital.</p><p><strong>What actually happens</strong><br>Some tokens, like DAI, natively support flash-minting. A user can instantly mint millions of tokens in a single transaction, provided they are burned (with a fee) by the end of execution.</p><p><strong>Example failure</strong><br>Your protocol calculates governance voting power based on spot balances within a liquidity pool. An attacker flash-mints 100 million DAI, executes a massive governance manipulation, and repays the DAI in the same block.</p><p><strong>Mitigation</strong><br>Never rely on spot balances for price discovery or voting power. Use Time-Weighted Average Price (TWAP) oracles and historical checkpoints.</p><p><strong>Takeaway:</strong> Spot balances lie. And sometimes, tokens lie about how much they transferred, too.</p><p><strong>Edge Case #11: Transferring Less Than Requested</strong></p><p><strong>The assumption</strong><br>If I request to transfer type(uint256).max, the token will either transfer that exact enormous amount or revert.</p><p><strong>What actually happens</strong><br>Some obscure tokens treat an amount parameter of type(uint256).max as a custom flag meaning &quot;transfer all of the user&#39;s available balance.&quot;</p><p><strong>Example failure</strong><br>A protocol requests a uint256.max sweep. The token successfully transfers the user&#39;s actual balance of 50 tokens. The protocol incorrectly records that type(uint256).max tokens were received, creating massive artificial inflation.</p><p><strong>Mitigation</strong><br>Once again, balance-delta accounting saves the day. Never assume the requested amount is the executed amount.</p><p><strong>Edge Case #12: High-Decimal Tokens</strong></p><p><strong>The assumption</strong><br>Tokens either have 18 decimals (like ETH) or 6 decimals (like USDC).</p><p><strong>What actually happens</strong><br>Tokens like YAMv2 use 24 decimals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*K8PAnRTTZyMRhJS2.png" /></figure><p><strong>Example failure</strong><br>Your protocol multiplies a token balance by a high-precision constant before dividing it. Because the token already has 24 decimals, the multiplication exceeds type(uint256).max and triggers an unexpected math overflow, bricking the transaction.</p><p><strong>Mitigation</strong><br>Always dynamically read the decimals() function and normalize balances to a standard precision internally before performing complex math.</p><p><strong>Bonus Edge Cases</strong></p><p><strong>Edge Case #13. Pausable Tokens:</strong><br>Tokens can be globally paused by their admins. Ensure your system degrades gracefully and uses Pull-over-Push accounting so a globally paused token doesn’t brick your entire transaction loop.</p><p><strong>Edge Case #14. Large Approval/Transfer Reverts:</strong><br>Tokens like UNI and COMP use uint96 for their internal accounting limits. Attempting to approve or transfer uint256.max will unexpectedly revert. Always approve exact required amounts.</p><p><strong>Defensive ERC20 Integration Checklist</strong></p><p>Before deploying any contract that touches external ERC20 tokens, verify your architecture against these rules:</p><ul><li><strong>Are you using SafeERC20?</strong> Never use bare .transfer() or .transferFrom().</li><li><strong>Are you measuring balance deltas?</strong> Never assume amount sent == amount received.</li><li><strong>Are you safe from reentrancy?</strong> Assume every token transfer is an external callback.</li><li><strong>Are you using Pull-over-Push?</strong> Ensure a failing transfer only affects the specific user, not the broader system loop.</li><li><strong>Have you normalized decimals?</strong> Do not assume 6 or 18 decimals.</li><li><strong>Do you rely on spot balances?</strong> Ensure oracles and voting mechanisms cannot be manipulated via flash-mints.</li></ul><p><strong>Closing Thoughts</strong></p><p>Smart contract engineering is deeply unforgiving because you are not just building software; you are building immutable financial infrastructure.</p><p>When you integrate an external token, you do not just integrate an asset. You inherit its execution models, its upgrade paths, its governance assumptions, and its operational constraints. If the token’s logic changes, or if it behaves in a way you didn’t model for, your protocol pays the price.</p><p>Treat every external token as fundamentally hostile. Rely on pure math, stateful invariants, and defensive accounting.</p><p>Reliable systems emerge from reducing assumptions. Let’s build something we can trust.</p><p><em>What edge cases have caused problems in your own deployments? Let’s chat about it in the comments below. Follow for more deep dives into smart contract architecture and onchain security.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6b0f57c1ae4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Smart Contracts Demand Better Infrastructure: Building on contract.dev]]></title>
            <link>https://medium.com/@duruobinnafranklin/smart-contracts-demand-better-infrastructure-building-on-contract-dev-06c75f1c7e49?source=rss-9b8c3188024e------2</link>
            <guid isPermaLink="false">https://medium.com/p/06c75f1c7e49</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[evm]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Obinna Franklin Duru]]></dc:creator>
            <pubDate>Sat, 23 May 2026 07:22:03 GMT</pubDate>
            <atom:updated>2026-05-23T07:22:03.374Z</atom:updated>
            <content:encoded><![CDATA[<p>When you first start writing smart contracts on the EVM chains, your journey usually begins in Remix. It is a powerful, open-source web and desktop application for writing, compiling, testing, and deploying code, making it a fantastic tool for quick iterations and local simulations. But eventually, you outgrow it. Even with its robust features, a localized environment does not perfectly replicate how your contract will interact with live mainnet state.</p><p>To truly test a protocol, you move to a public testnet. This is where the engineering friction begins.</p><p>You suddenly need to set up an Alchemy or Infura account just to get an RPC URL. Then comes the faucet fatigue. You scour Discord or click traffic lights on web pages just to beg for a fraction of Sepolia ETH. Many faucets now require a minimum mainnet balance to prevent spam. This is a massive roadblock if you are following basic security practices.</p><p>To protect your real-world funds, you should never paste your primary wallet’s private key into a local .env file where an accidental GitHub push or a malicious package could expose it. Instead, you use fresh, $0-balance &quot;dummy&quot; accounts. But when a faucet requires a mainnet balance, it breaks this safety measure, forcing you to either risk your real wallet or fund a dummy account with real money just to get testnet tokens. Others force you to connect your personal social media and tweet just to get a single drop.</p><p>If you are designing a system that requires multiple actors like a Client, a Provider, and an Arbiter in an Escrow, this friction multiplies. You either have to repeat this frustrating process for three separate wallets, or manually transfer tokens between them. And ironically, those manual transfers still cost you the precious testnet gas you just spent time trying to collect.</p><p>The testing infrastructure quickly becomes more exhausting than writing the actual architecture.</p><p>Recently, I began exploring ways to reduce this environmental friction and found a highly practical workflow using <a href="https://contract.dev/">contract.dev</a>. It provides the visual simplicity of a tool like Remix, but on a globally accessible, private EVM testnets that replay mainnet state and come with built-in tools for testing, analysing, and simulating smart contracts before launch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ixM1rAvVKB-3b3IRcm0Vig.png" /><figcaption>Contract.dev Dashboard</figcaption></figure><p>Here is a look at how I approach testing a 3-actor Escrow system visually, eliminating local node overhead and faucet fatigue so I can focus purely on protocol behavior.</p><p><strong>The Architecture: A Trust-Minimized Escrow</strong></p><p>To demonstrate this workflow, I built TrustEscrow.sol. The architecture is designed to be reusable and relies on strict access control across three distinct roles:</p><ul><li><strong>Client:</strong> Funds the escrow.</li><li><strong>Provider:</strong> Executes the work and receives the funds.</li><li><strong>Arbiter:</strong> A neutral third party that resolves disputes.</li></ul><p>Because the state transitions depend entirely on who is calling the function, verifying role transitions is critical. I explicitly designed this contract with a resetEscrow function to allow continuous lifecycle testing without needing to redeploy the contract. Here is the core state machine governing the escrow:</p><pre>enum Stage {<br>    AwaitingFunding, // 0 - deployed or reset, waiting for client<br>    Funded,          // 1 - ETH held; work in progress<br>    Completed,       // 2 - client released funds; ready for reset<br>    Disputed,        // 3 - either party raised a dispute; arbiter needed<br>    Resolved         // 4 - arbiter settled dispute; ready for reset<br>}<br>Stage public stage;</pre><p><em>(Note: Making the state explicitly public is a deliberate choice here, it allows visual dashboards to read and display the exact stage of the protocol later in the workflow).</em></p><p>Normally, verifying these transitions requires writing extensive .t.sol files with heavy vm.prank() overhead. Here is how we can verify them visually on a live network instead.</p><p><strong>Step 1: The Instant Environment (No Alchemy, No Faucets)</strong></p><p>The immediate relief of this workflow is the infrastructure. By creating a project on <a href="https://contract.dev/">contract.dev</a>, I was instantly handed a live <a href="https://docs.contract.dev/stagenets"><strong>Stagenet RPC URL</strong></a>. No third-party node providers required.</p><p>To test this escrow, I needed three distinct, funded wallets. Instead of configuring these locally or begging a public faucet, I used the platform’s <a href="https://docs.contract.dev/tools/wallet-generator"><strong>Wallet Generator</strong></a> to spin up accounts for the Client, the Provider, and the Arbiter.</p><p>Using the built-in Stagenet Faucet, I funded the Client’s wallet with 100 ETH instantly. This is a live RPC that anyone in the world can interact with. You get the freedom of a public testnet without the artificial scarcity of testnet tokens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-ZYgXOtLdQHGfw8siKHnNw.png" /><figcaption>The Wallet Generator showing the 3 distinct addresses and the Client’s 100 ETH balance</figcaption></figure><p><strong>Step 2: CI/CD Sync and Deployment</strong></p><p>Unlike local nodes, the platform doesn’t just guess your contract’s ABI. By linking my GitHub repository, the platform’s CI/CD pipeline automatically synced and compiled my Foundry project.</p><p>To deploy, I didn’t have to learn a new framework. I simply opened my terminal and ran my standard Foundry deployment script (forge script), pointing it to the new Stagenet RPC and my newly funded wallet private key.</p><p>The moment the transaction confirmed on the network, the platform detected the deployed contract and automatically generated a Workspace: a dedicated visual dashboard perfectly mapped to my Solidity code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hySJjMDvfUJNm9AFQkWOZg.png" /><figcaption>The CI/CD dashboard or the Workspace activating after running the forge script</figcaption></figure><p><em>(Crucial note for advanced developers: Unlike a local simulation, this Stagenet utilizes </em><strong><em>Mainnet Replay</em></strong><em>. It actively mirrors live mainnet state. If your contract interacts with live Uniswap liquidity or Chainlink oracles, you can test against those live states immediately without writing complex fork scripts).</em></p><p><strong>Step 3: Verifying State Transitions</strong></p><p>When testing architecture, immediate feedback is invaluable. Using the <a href="https://docs.contract.dev/rpc-routes/impersonation"><strong>Account Impersonation</strong></a> feature directly from the dashboard UI, I impersonated the Client and executed the fundEscrow() transaction with 1 ETH.</p><p>The Workspace updated in real-time to reflect the new reality. Instead of relying on terminal queries or cast call commands, the dashboard visually confirmed that the contract balance was strictly locked at 1 ETH, and the stage variable had transitioned correctly from AwaitingFunding to Funded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zcRxhqH7A7o_jzmhvxfUKw.png" /><figcaption>The Workspace dashboard showing the 1 ETH balance and the state variable changed to Funded-1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ntExXZKzaDNSls4Dum9R8w.png" /><figcaption>The Workspace dashboard showing the 1 ETH balance and the state variable changed to Funded-2</figcaption></figure><p>Continuing the simulation, I impersonated the Provider to raise a dispute, and finally the Arbiter to resolve it. The entire lifecycle of a complex 3-actor protocol was verified in seconds.</p><p><strong>Step 4: Automating the Ecosystem (AI User Activity)</strong></p><p>Manually clicking through a happy path is great for an initial sanity check. But what if you want to simulate a living, breathing protocol under continuous load? Normally, this requires writing complex Hardhat scripts or custom bots to continuously fire transactions and redeploy contracts.</p><p>This is where my workflow completely changed.</p><p>The platform includes an <a href="https://docs.contract.dev/tools/activity-scheduler"><strong>Activity Scheduler</strong></a> powered by AI. Instead of writing mock scripts, the AI reads your contract’s source code, ABI, and storage layout, and designs realistic user personas for your specific protocol.</p><p>Because I built TrustEscrow to be reusable via the resetEscrow function, the AI was able to create infinite, continuous testing loops. With one click, it generated new dummy wallets, funded them, and scheduled recurring transaction workflows. In my Workspace, it automatically created two distinct, recurring timelines:</p><ol><li><strong>The Happy Path:</strong> It scheduled the Client to fundEscrow, releaseFunds, and resetEscrow every 20 blocks.</li><li><strong>The Dispute Path:</strong> It scheduled a complex continuous workflow of fundEscrow -&gt; raiseDispute -&gt; resolveDispute -&gt; resetEscrow every 30 blocks.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hSud0zxlBJq7bE0qUmpuGg.png" /><figcaption>The AI Activity Scheduler showing the Happy Path and Dispute Path running on autopilot</figcaption></figure><p>I didn’t have to write a single line of testing script. I was able to sit back and watch the Stagenet process concurrent, multi-actor state transitions continuously.</p><p><strong>Bridging the Frontend Gap</strong></p><p>Beyond testing smart contract logic, this approach solves a very real integration problem.</p><p>When you build in Remix or on a local Anvil node, handing the protocol off to a frontend developer usually requires them to recreate your local environment just to build the UI.</p><p>Because a <strong>Stagenet</strong> is a persistent, globally accessible network, you can simply share the RPC URL with your frontend team. You hand them a live, fully-funded sandbox where the AI Activity Simulator is already generating realistic background traffic. They can begin building the interface immediately against predictable, living data.</p><p><strong>Final Thoughts</strong></p><p>Smart contracts handle real value, so engineering them requires a deep focus on security, invariants, and mathematical correctness. Testing infrastructure should support that focus, not distract from it.</p><p>While robust local environments are great for early iterations, serious architecture requires a production-like setting. Visual testing on a Stagenet makes it easier to observe protocol behavior, simulate concurrent user activity, and collaborate with your team without getting bogged down in RPC setups and faucet fatigue.</p><p>If you are tired of fighting local nodes to test multi-wallet architecture, I highly recommend integrating a visual Stagenet into your workflow.</p><p>You can view the full TrustEscrow architecture on my GitHub here: <a href="https://github.com/obinnafranklinduru/trust-escrow">github.com/obinnafranklinduru/trust-escrow</a></p><p><strong>📚 Glossary of Terms (For the Curious)</strong></p><ul><li><strong>EVM (Ethereum Virtual Machine):</strong> The underlying engine that processes and executes smart contracts on Ethereum and other compatible blockchains. <em>Web2 Analogy: Think of it like the global operating system or server environment (like Node.js or AWS) that runs your code.</em></li><li><strong>RPC URL:</strong> The digital bridge that allows your interface to communicate with the blockchain. <em>Web2 Analogy: Just like an API endpoint connects a frontend web app to a backend database.</em></li><li><strong>Faucet:</strong> A developer service that provides free test tokens. <em>Web2 Analogy: Like getting free “sandbox credits” in Stripe to test payments without using real credit cards.</em></li><li><strong>Mainnet vs Testnet:</strong> Mainnet is the live network with real financial value. A testnet is a public sandbox with zero-value tokens. <em>Web2 Analogy: Mainnet is your live “Production” environment. A testnet is your “Staging” environment.</em></li><li><strong>Stagenet:</strong> A private testing environment that actively mirrors the live mainnet state. <em>Web2 Analogy: A high-fidelity staging server that has been perfectly synced with a live copy of your production database.</em></li><li><strong>Private Key:</strong> The secret cryptographic password that grants total control over a wallet and its funds. <em>Web2 Analogy: The root password to your bank account.</em></li><li><strong>.env File:</strong> A hidden local file used to store sensitive information securely. <em>Web2 Analogy: It serves the exact same purpose in Web2—keeping API keys and passwords out of public GitHub repositories.</em></li><li><strong>ABI (Application Binary Interface):</strong> A file that acts as a translation manual telling a frontend exactly how to interact with a compiled smart contract. <em>Web2 Analogy: Like an OpenAPI/Swagger document that defines the endpoints and expected payloads for a REST API.</em></li><li><strong>State Machine:</strong> An architectural pattern where a contract can only exist in one specific stage at a time (e.g., AwaitingFunding or Completed). <em>Web2 Analogy: Like an e-commerce order that must strictly move from ‘Pending’ -&gt; ‘Shipped’ -&gt; ‘Delivered’ without skipping steps.</em></li><li><strong>Foundry:</strong> A fast, specialized command-line toolkit used for compiling, testing, and deploying smart contracts. <em>Web2 Analogy: A mix between a build tool (like Webpack) and a testing framework (like Jest).</em></li><li><strong>vm.prank():</strong> A specific testing command used to impersonate a different user to verify access controls. <em>Web2 Analogy: Like a &quot;Login as User&quot; feature in an admin dashboard to test what a specific customer sees.</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=06c75f1c7e49" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>