<?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 Dahunsi Alimot Olajumoke on Medium]]></title>
        <description><![CDATA[Stories by Dahunsi Alimot Olajumoke on Medium]]></description>
        <link>https://medium.com/@dahunsiolajumoke18?source=rss-04388dce16ed------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*6zAnM3SEHqKLpoTq</url>
            <title>Stories by Dahunsi Alimot Olajumoke on Medium</title>
            <link>https://medium.com/@dahunsiolajumoke18?source=rss-04388dce16ed------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 07:15:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dahunsiolajumoke18/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[Introduction:]]></title>
            <link>https://medium.com/@dahunsiolajumoke18/introduction-680d7b9c5479?source=rss-04388dce16ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/680d7b9c5479</guid>
            <category><![CDATA[nouns-auction-house]]></category>
            <category><![CDATA[smart-contract-auditing]]></category>
            <category><![CDATA[auction-houses]]></category>
            <category><![CDATA[auction]]></category>
            <category><![CDATA[auctioning-contract]]></category>
            <dc:creator><![CDATA[Dahunsi Alimot Olajumoke]]></dc:creator>
            <pubDate>Thu, 16 Apr 2026 04:45:52 GMT</pubDate>
            <atom:updated>2026-04-16T04:45:52.812Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, I review an auction smart contract called <strong>“Nouns Auction House”</strong>. This contract facilitates the sales of <a href="https://docs.openzeppelin.com/contracts/3.x/erc721">ERC-721 NFTs</a>, where a token is auctioned for a fixed period and awarded to the highest bidder once the auction ends.</p><p>Feel free to <a href="http://github.com/nounsDAO/nouns-monorepo/blob/master/packages/nouns-contracts/contracts/NounsAuctionHouse.%20sol">refer to the code</a> as I talk about them below. Or if you’re not into code, that’s cool — you can skip to the final sections for a summary and key insights.. Without wasting time, let’s dive into the contract!</p><h3><strong>Overview:</strong></h3><p>This contract is an <a href="https://www.alchemy.com/docs/upgradeable-smart-contracts">upgradeable contract</a> designed to work with all <a href="https://www.openzeppelin.com/news/proxy-patterns">proxy patterns</a>. No constructor, instead, it uses function initialize() which uses <a href="https://rareskills.io/post/initializable-solidity"><strong>openzeppelin</strong> <strong>initializer</strong></a> which can only be called once just like a contract constructor and inherited some other openzepplin libraries which include; <a href="https://docs.openzeppelin.com/contracts/4.x/upgradeable"><strong>Openzepplin</strong> <strong>PausableUpgradeable</strong></a>, <a href="https://contracts.synapseprotocol.com/elin/contracts-upgradeable/utils/reentrancyguardupgradeable"><strong>ReentrancyGuardUpgradeable</strong></a>, <strong>OwnableUpgradeable</strong> and <strong>IERC20</strong> libraries which shows the contract is so heavy on security guarding against reentrancy by using <strong>nonreentrant</strong> <strong>modifier</strong>, the contract can be paused and unpaused in the case of emergency and there can be restriction on some functions with the use of <strong>whenPaused</strong> and <strong>whenNotPaused</strong> modifiers which means the contract has emergency control mechanism mitigating attack and enforcing access control to achieve a safe, and secure Auctioning contract. It Auctions NFTs from INounsToken contract, accepts bids in ETH, refunds previous bidders, settles auctions and sends funds to the owner.</p><h3><strong>Architecture &amp; Logic</strong></h3><p>The contract has different categories of functions- first, the functions that only the contract owner can call and the second category can be called by anyone that interact with the contract if no restriction like whenPaused and whenNotPaused .</p><h4><strong>Key Functions:</strong></h4><p>The Contract utilizes key functions named below:</p><p><strong>Functions That Can Only Be Called By The Smart Contract Creator</strong></p><p><strong>function initialize()</strong></p><p>This is a Solidity initialize function typically used in upgradeable contracts (instead of a constructor). Since upgradeable contracts (e.g., using proxy patterns) <strong>don’t use constructors</strong>, this function sets the initial state of the contract initializing the inherited contract</p><p><em>__Pausable_init()- enables pause/unpause functionality</em></p><p><em>__ReentrancyGuard_init()- protects against reentrancy attacks</em></p><p><em>__Ownable_init() — sets the deployer as the contract owner</em></p><p>These are <strong>OpenZeppelin upgradeable modules</strong>, and since constructors don’t run in upgradeable contract, they must be manually initialized in the contract.</p><p><em>_pause() </em>ensures no one can interact with the contract <strong>before it’s fully configured</strong></p><h4>Set core contract parameters</h4><pre>nouns = _nouns;<br>weth = _weth;<br>timeBuffer = _timeBuffer;<br>reservePrice = _reservePrice;<br>minBidIncrementPercentage = _minBidIncrementPercentage;<br>duration = _duration;</pre><p>The initializer modifier ensures that the function can only be called once</p><p><strong>function pause()</strong></p><p>This function temporarily stops certain action in the contract disabling critical function like settleAuction() and can only be called by the owner when the contract is unpaused. While no new auctions can be started when paused, anyone can settle an ongoing auction. It’s often used during emergencies (e.g., a bug, hack attempt, or vulnerability) and you can think of it like an emergency stop button and safety mechanism used to control the contract’s activity.</p><p><strong>function unpause()</strong></p><p>This<strong> function</strong> restores the contract back to normal operation after being paused enabling all previously restricted actions. These two functions (pause and unpause) can only be called by authorized user like contract owner and valid signers in a Multisig system and their functionality is part of a pattern called <strong>“circuit breaker”</strong> in smart contract development. If required, this function will start a new auction in the contract.</p><p><strong>function setTimeBuffer()</strong></p><p>This function set uint256 _timeBuffer as an argument assign it to the auction timeBuffer (A global variable which holds the minimum amount of time left in an auction after a new bid is created) and it is only callable by the owner due to the onlyOwner modifier.</p><pre>timeBuffer = _timeBuffer;</pre><p>This modifier helps prevent unauthorized access on the function. If the function runs successfully, it logs event on-chain;</p><pre>emit AuctionTimeBufferUpdated(_timeBuffer);</pre><p><strong>function setReservePrice()</strong></p><p>This function set the auction reserve price when the owner decides to update auction price , it accept uint256 value the owner is willing to set for a particular token going for auctioning and the function is only callable by the contract owner due to its onlyOwner modifier and emits an event named “AuctionReservePriceUpdated”</p><pre>reservePrice = _reservePrice;<br>emit AuctionReservePriceUpdated(_reservePrice);</pre><p><strong>function setMinBidIncrementPercentage()</strong></p><p>This function sets the auction minimum bid increment percentage which is the minimum percentage difference between the last bid amount and the current bid. It accepts uint8 value as argument and its assigned to a global variable named minBidIncrementPercentage.</p><pre>minBidIncrementPercentage = _minBidIncrementPercentage;</pre><p>It is restricted to only the contract owner due to the onlyOwner modifier and emits an event when the function runs successfully.</p><pre>emit AuctionMinBidIncrementPercentageUpdated(_minBidIncrementPercentage);</pre><h4><strong>Functions That Can Be Called By Anyone</strong></h4><p><strong>function settleCurrentAndCreateNewAuction()</strong></p><p>This function settles the current auction, mint a new Noun, and put it up for auction by calling the _settleAuction() and _createAuction() in it. settleCurrentAndCreateNewAuction can only be called when the contract is not paused and it has nonReentrant modifier which prevents it from reentrancy risk.</p><p><strong>function settleAuction()</strong></p><p>After the auction has completed and the highest bider as won, this function settle an auction, finalizing the bid and paying out to the owner. And in case where there are no bids, the Noun is burned.</p><p>The function Copies the current auction state from <strong>storage to memory </strong>in other to save gas when reading multiple times making _auction a snapshot of the auction at that moment.</p><p>The function has some sanity checks like checking if the auction start time is not equal to zero to ensure the auction was initialised using startTime != 0 , auction has not been settled to Prevents double execution (important for security) and if auction endtime has completed to ensure bidding period is over, if all checks pass, it proceeds to check if the auction bidder is not address zero and if the auction’ nouns has not been burned. If all edge cases pass, the function updates the <strong>storage variable</strong>, not the memory copy to prevent reentrancy using <strong>auction.settled = true </strong>before handling the NFT transfer by transferring NFT to the winning bidder or burn if address zero is detected as the winning bidder. After the function run successfully, it emits an event “AuctionSettled” which logs the event details (The NFT, final price, and winner) on-chain for Frontend apps and indexing.</p><p><strong>function createBid()</strong></p><p>This function create a bid for a Noun, with a given amount after checking the Noun’s status by passing</p><pre>_auction.nounId == nounId</pre><p>to check if the noun is really available for auction and to ensure bidder is bidding on the correct item,</p><pre>block.timestamp &lt; _auction.endTime</pre><p>to confirm that the auction has not expired,</p><pre>msg.value &gt;= reservePrice</pre><p>checks if the ETH value the bidder is sending is upto the nouns reserved price and</p><pre> msg.value &gt;= _auction.amount + ((_auction.amount * minBidIncrementPercentage) / 100)</pre><p>to check if the value the bidder is sending is higher than that of the last bidder by minBidIncrementPercentage. If all the checks pass, it assigns the caller as the lastBidder.</p><p>The function checks If someone already bid before to refund the last bidder using <strong>safe transfer function</strong> to avoid failure issues and the function’s nonReentrant modifier prevents it from reentrancy risk.</p><pre>if (lastBidder != address(0)) {<br>_safeTransferETHWithFallback(lastBidder, _auction.amount);<br>}.</pre><p>The function proceeds to updates contract storage with the new highest bid and the highest bidder. It checks if bid came near the end of auction and extend the auction if the bid was received within `timeBuffer` of the auction end time in:</p><pre>bool extended = _auction.endTime - block.timestamp &lt; timeBuffer;<br>if (extended) {<br>auction.endTime = _auction.endTime = block.timestamp + timeBuffer;<br>}</pre><p>Logs the createbid event in:</p><pre>emit AuctionBid(_auction.nounId, msg.sender, msg.value, extended);</pre><p><strong>function _createAuction()</strong></p><p>This is an internal function for creating new Auction provided no ongoing Auction in the contract, it mints new ERC721 NFT in a try and catch method, set the current block.timestamp as the auction start time and end time as the start time plus the auction duration.</p><pre> try nouns.mint() returns (uint256 nounId) {<br>            uint256 startTime = block.timestamp;<br>            uint256 endTime = startTime + duration;<br><br><br>        } <br></pre><p>It accepts argument like nounId,amount,startTime,endTime, bidder, settled .</p><pre>auction = Auction({<br>                nounId: nounId,<br>                amount: 0,<br>                startTime: startTime,<br>                endTime: endTime,<br>                bidder: payable(0),<br>                settled: false<br>            });</pre><p>If the auction is successfully created, it emits an AuctionCreated event which logs the event details (nounId, startTime, endTime) on-chain for frontend apps and indexing purpose.</p><pre>emit AuctionCreated(nounId, startTime, endTime);</pre><p>If the mint reverts, the minter will be updated without pausing the contract first. To remedy this, catch the function reverts and pauses this contract.</p><pre>catch Error(string memory) {<br>            _pause();<br>        }</pre><p><strong>function _safeTransferETHWithFallback()</strong></p><p>After the auction has completed and the highest bider as won, this function will be called inside settleAuction function to finalize the bid and paying out to the owner.</p><pre>if (!_safeTransferETH(to, amount)) {<br>            IWETH(weth).deposit{ value: amount }();<br>            IERC20(weth).transfer(to, amount);<br>        }</pre><p>This function serves as a fallback function for making payment in the Auction contract if the _safeTransferETH(o, amount) which uses low level call (instead of transfer) to avoid the 2300 gas limit issue fails. It checks if the _safeTransferETH() function at firstfails in paying the bidder by transferring ETH to the winning bidder and if the _safeTransferETH() function fails, wrap the ETH WETH (a Wrapped ETH) an ERC-20 token, which behaves like a normal token transfers WETH using ERC-20 transfer. So, what this function simply does is “If I can’t send ETH, I’ll send the equivalent value in WETH instead”.</p><p><strong>function _safeTransferETH(address to, uint256 value)</strong></p><p>This function uses a low level call to transfer ETH and return the success status. It only forwards 30,000 gas to the callee.</p><pre>function _safeTransferETH(address to, uint256 value) internal returns (bool) {<br>        (bool success, ) = to.call{ value: value, gas: 30_000 }(new bytes(0));<br>        return success;<br>    }</pre><h4><strong>Contract Flow:</strong></h4><p>Mint NFT → _createAuction()</p><p>Users bid → createBid()</p><p>Auction ends → _settleAuction()</p><p>Winner gets NFT, owner gets ETH</p><h3><strong>Security Findings</strong></h3><h4><strong>The good:</strong></h4><h4>1. Reentrancy protection</h4><p>nonReentrant modifiers used in createBid, settleAuction, and settleCurrentAndCreateNewAuction are very important well used to prevent reentrancy attacks on the contract because ETH is being transferred in those functions.</p><h4><strong>2.Pull-over-push refund pattern (with fallback)</strong></h4><p><strong>This ensures Attempts ETH transfer falls back to WETH if it fails. This avoids griefing via failing fallback functions</strong></p><h4><strong>3.Defensive minting</strong></h4><p>If mint fails, contract pauses, a very smart fail-safe design</p><h4><strong>The bad:</strong></h4><p><strong>1.Missing input validation in initialize</strong></p><p>This means even if wrong argument is passed or some inputs are left empty, the function still runs without validating the input values like passing address (0) and zero value for duration which will lead to instant expiry of the auction.</p><p><strong>2.Centralization risk</strong></p><p>setTimeBuffer, setReservePrice, setMinBidIncrementPercentage, pause, unpause restricted to onlyOwner means owner can decide to manipulate auctions while its going on, making the contract less decentralized this can be prevented by restricting updates during active auctions.</p><p><strong>3.No validation in setter functions</strong></p><pre>function setMinBidIncrementPercentage(uint8 _minBidIncrementPercentage)</pre><p>This means _minBidIncrementPercentage could set to 0 allowing equal bid or set to a very high percentage which might lead to impossible bidding</p><p><strong>4. The contract doesn’t check if a contract address owns the NFT before transferring.</strong></p><pre>nouns.transferFrom(address(this), _auction.bidder, _auction.nounId);</pre><p>The contract misses a check like:</p><pre>require(nouns.ownerOf(_auction.nounId) == address(this), &quot;Not owner&quot;);</pre><p><strong>Final Verdict</strong></p><p>This contract is well-structured and production-grade, with strong use of OpenZeppelin security patterns and thoughtful auction mechanics like anti-sniping and fallback transfers.</p><p>However, it assumes a trusted environment and lacks strict input validation and decentralization safeguards.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=680d7b9c5479" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The 50 EVM Opcodes Every Solidity Developer Should Actually Understand]]></title>
            <link>https://medium.com/@dahunsiolajumoke18/the-50-evm-opcodes-every-solidity-developer-should-actually-understand-1f4a9056e927?source=rss-04388dce16ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f4a9056e927</guid>
            <category><![CDATA[evm-opcodes]]></category>
            <category><![CDATA[solidity-compiling]]></category>
            <category><![CDATA[solidity-opcode]]></category>
            <category><![CDATA[bytecode]]></category>
            <category><![CDATA[opcodes]]></category>
            <dc:creator><![CDATA[Dahunsi Alimot Olajumoke]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 14:34:30 GMT</pubDate>
            <atom:updated>2026-03-31T14:34:30.508Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X3sW5qk0mofNjr5TvI-t3w.png" /></figure><p>Let me ask you something.</p><p>You’ve been writing Solidity for a while now. You know how mappings work, you’ve dealt with reentrancy, maybe you’ve even deployed a proxy contract or two. But when someone asks you <em>what actually happens</em> when your Solidity code runs on the EVM — like, really happens — can you answer that?</p><p>Most Solidity devs can’t. And honestly, that’s fine up to a point. Solidity abstracts a lot. But if you want to write gas-efficient contracts, debug weird edge cases, understand why your optimizer settings matter, or just genuinely understand the machine you’re programming — you need to know opcodes.</p><p>This isn’t going to be a dry reference page. We’re going to go deep, and by the end you’ll look at your Solidity code differently. Let’s get into it.</p><h3>What Is an Opcode, Actually?</h3><p>Before we list anything, let’s make sure we actually agree on what an opcode is. Because “it’s like machine code for the EVM” is technically correct but doesn’t really tell you much.</p><p>When you compile a Solidity contract, the compiler (solc) translates your high-level code into <strong>bytecode</strong> — a long string of hexadecimal numbers. That bytecode is what actually gets stored on the blockchain. The EVM doesn’t know what a mapping is. It doesn’t know what require is. It only knows bytecode.</p><p>Each byte (or sequence of bytes) in that bytecode corresponds to a specific instruction. Those instructions are opcodes.</p><p>For example, 0x01 means “add the top two values on the stack.” 0x55 means “write a value to storage.” 0x60 means “push the next byte onto the stack.” Every single thing your contract does — every addition, every storage read, every function call — is a sequence of these tiny instructions.</p><p>Here’s something that’ll make this concrete. Take this simple Solidity line:</p><pre>uint256 result = a + b;</pre><p>This compiles to something like:</p><pre>PUSH1 [slot of a]<br>SLOAD // read `a` from storage<br>PUSH1 [slot of b]<br>SLOAD // read `b` from storage<br>ADD // add them together<br>PUSH1 [slot of result]<br>SSTORE // write result to storage</pre><p>Seven opcodes for one line of Solidity. That’s the reality underneath your code.</p><h3>How the EVM Actually Runs Opcodes</h3><p>The EVM is a <strong>stack-based machine</strong>. Almost everything works through a stack — a last-in-first-out data structure where you push values on top and pop them off the top.</p><p>When the EVM executes your bytecode, it reads one opcode at a time. Each opcode either:</p><ul><li>Pushes something onto the stack</li><li>Pops values off the stack and does something with them</li><li>Reads from or writes to memory or storage</li><li>Changes where execution continues (jumps)</li><li>Does something about the outside world (calls, events)</li></ul><p>The stack can hold up to <strong>1024 items</strong>, each one being a 256-bit (32-byte) value. That’s the EVM’s native word size — everything is in 256-bit chunks.</p><p>Alongside the stack, the EVM has three places to store data:</p><p><strong>Stack</strong> — temporary, fast, limited to 1024 items, only the top 16 are directly accessible</p><p><strong>Memory</strong> — temporary scratch space, wiped after each call, cheap to use, expands as needed (but expansion costs gas)</p><p><strong>Storage</strong> — permanent, survives between transactions, tied to a specific contract, very expensive</p><p>Every opcode has a <strong>gas cost</strong> attached to it. The EVM tracks how much gas has been consumed as it executes. Run out of gas? Execution reverts — all state changes are rolled back, but the gas is still gone.</p><p>Now let’s meet the opcodes. Grouped by what they actually do, not just alphabetically.</p><h3>Group 1: Arithmetic — The Calculator</h3><p>These are the most intuitive opcodes. They pop values off the stack, do math, and push the result back.</p><p><strong>1. ADD — 0x01</strong> <em>Gas: 3</em></p><p>Pops two values, adds them, pushes the result.</p><pre>Stack before: [5, 3, …]<br>ADD<br>Stack after: [8, …]</pre><p>Every a + b in your Solidity compiles to this. Simple, cheap, 3 gas. Notice that addition in the EVM is <strong>unchecked by default at the opcode level</strong> — it wraps around on overflow. The overflow protection in Solidity 0.8+ is implemented by the compiler adding extra checks on top.</p><p><strong>2. SUB — 0x03</strong> <em>Gas: 3</em></p><p>Pops two values, subtracts the second from the first.</p><pre>Stack before: [10, 3, …]<br>SUB<br>Stack after: [7, …]</pre><p>Same story as ADD — 3 gas, wraps on underflow at the opcode level.</p><p><strong>3. MUL — 0x02</strong> <em>Gas: 5</em></p><p>Pops two values, multiplies them.</p><pre>Stack before: [4, 5, …]<br>MUL<br>Stack after: [20, …]</pre><p>Slightly more expensive than ADD/SUB. Not by much, but worth knowing in tight loops.</p><p><strong>4. DIV — 0x04</strong> <em>Gas: 5</em></p><p>Integer division — no decimals, everything is truncated down.</p><pre>Stack before: [10, 3, …]<br>DIV<br>Stack after: [3, …] // not 3.33</pre><p>Important edge case: dividing by zero in the EVM doesn’t revert. It just returns 0. The compiler adds a check for this when you use Solidity’s / operator, but at the opcode level, DIV(x, 0) = 0.</p><p><strong>5. MOD — 0x06</strong> <em>Gas: 5</em></p><p>Remainder after division.</p><pre>Stack before: [10, 3, …]<br>MOD<br>Stack after: [1, …] // 10 % 3 = 1</pre><p>You’ll see this in time-based logic — like block.timestamp % 86400 to get seconds within the current day. Also: MOD(x, 0) = 0 in the EVM, same as DIV.</p><p><strong>6. EXP — 0x0A</strong> <em>Gas: 10 + 50 per byte of exponent</em></p><p>Exponentiation. Raises a base to a power.</p><pre>Stack before: [2, 10, …]<br>EXP<br>Stack after: [1024, …] // 2¹⁰</pre><p>This one’s interesting on gas. The cost scales with the size of the exponent, not its value. A small exponent like 2**3 is cheap. But 2**256 is expensive. Every time you write 10**18 in Solidity (like when you’re handling token decimals), this opcode fires. This is why declaring uint256 constant DECIMALS = 10**18 is better than computing it every time — constants get baked in at compile time and skip the EXP opcode entirely.</p><p><strong>7. ADDMOD — 0x08</strong> <em>Gas: 8</em></p><p>Computes (a + b) % n in a single opcode, without the intermediate result overflowing. This is useful in cryptographic operations where you need modular arithmetic with very large numbers.</p><pre>// Equivalent to:<br>uint256 result = addmod(a, b, n);</pre><p><strong>8. MULMOD — 0x09</strong> <em>Gas: 8</em></p><p>Same idea — (a * b) % n without overflow in the intermediate step. Used in cryptographic primitives. You’ll see this in elliptic curve math.</p><p><strong>9. SDIV — 0x05</strong> <em>Gas: 5</em></p><p>Signed division. Regular DIV treats both numbers as unsigned (positive). SDIV interprets them as signed integers (two’s complement). The distinction matters when you’re working with int256 in Solidity.</p><p><strong>10. SMOD — 0x07</strong> <em>Gas: 5</em></p><p>Signed modulo. Same relationship to MOD as SDIV has to DIV. For int256 remainder operations.</p><h3>Group 2: Comparison — Making Decisions</h3><p>Every if, require, and ternary in your Solidity is ultimately one of these. They take two values and return either 1 (true) or 0 (false).</p><p><strong>11. LT — 0x10</strong> <em>Gas: 3</em></p><p>Less than. Is the first value smaller than the second?</p><pre>Stack before: [3, 5, …]<br>LT<br>Stack after: [1, …] // 3 &lt; 5 is true</pre><p><strong>12. GT — 0x11</strong> <em>Gas: 3</em></p><p>Greater than.</p><pre>Stack before: [7, 5, …]<br>GT<br>Stack after: [1, …] // 7 &gt; 5 is true</pre><p><strong>13. SLT — 0x12</strong> <em>Gas: 3</em></p><p>Signed less than. For int256 comparisons. LT and GT treat numbers as unsigned, which means negative numbers (which are large values in two’s complement) would compare incorrectly. SLT handles this correctly.</p><p><strong>14. SGT — 0x13</strong> <em>Gas: 3</em></p><p>Signed greater than. Same reasoning as SLT.</p><p><strong>15. EQ — 0x14</strong> <em>Gas: 3</em></p><p>Equality. Are these two values identical?</p><pre>Stack before: [5, 5, …]<br>EQ<br>Stack after: [1, …] // true<br>Stack before: [5, 6, …]<br>EQ<br>Stack after: [0, …] // false</pre><p>Every require(a == b), every == in a condition — this is it.</p><p><strong>16. ISZERO — 0x15</strong> <em>Gas: 3</em></p><p>Is this value zero? Pushes 1 if yes, 0 if no.</p><pre>Stack before: [0, …]</pre><p>ISZERO</p><pre>Stack after: [1, …] // yes, it&#39;s zero<br>Stack before: [5, …]</pre><p>ISZERO</p><pre>Stack after: [0, …] // no, it&#39;s not zero</pre><p>This opcode is used constantly. Your if (!condition) compiles to the condition being evaluated, then ISZERO to flip it. It’s also how Solidity implements require(condition) — the condition is evaluated, then ISZERO checks if it’s false, and if so, REVERT fires.</p><h3>Group 3: Bitwise Operations — Working at the Bit Level</h3><p>These operate on the actual binary representation of numbers. They sound intimidating but they come up more than you’d think — especially in gas optimization and packed storage.</p><p><strong>17. AND — 0x16</strong> <em>Gas: 3</em></p><p>Bitwise AND. Each bit in the result is 1 only if both corresponding input bits are 1.</p><pre>1010 (10)<br>AND<br>1100 (12)<br> - - <br>1000 (8)</pre><p>Used heavily for <strong>bit masking</strong> — isolating specific bits from a packed value. When Solidity reads a packed struct from storage, it uses AND to extract individual fields.</p><p><strong>18. OR — 0x17</strong> <em>Gas: 3</em></p><p>Bitwise OR. A bit is 1 if either input bit is 1.</p><pre>1010 (10)<br>OR<br>1100 (12)<br> - - <br>1110 (14)</pre><p>Used for <strong>setting bits</strong> — turning specific bits on in a value.</p><p><strong>19. XOR — 0x18</strong> <em>Gas: 3</em></p><p>Exclusive OR. A bit is 1 only if the input bits are different.</p><pre>1010 (10)<br>XOR<br>1100 (12)<br> - - <br>0110 (6)</pre><p>Used in checksums and some cryptographic primitives. Also a neat trick: a XOR a = 0 always — so XOR can check if two values are identical without using EQ.</p><p><strong>20. NOT — 0x19</strong> <em>Gas: 3</em></p><p>Flips every bit. 0 becomes 1, 1 becomes 0.</p><p>NOT 0000…0101 = 1111…1010</p><p>In the context of 256-bit numbers, NOT(0) gives you the maximum uint256 value (type(uint256).max in Solidity). This shows up in bitmask operations.</p><p><strong>21. SHL — 0x1B</strong> <em>Gas: 3</em></p><p>Shift left. Moves all bits left by a given number of positions, filling with zeros on the right.</p><pre>1 SHL 3 = 1000 (8)</pre><p>This is equivalent to multiplying by 2^n. Much cheaper than MUL for powers of 2. The compiler uses this automatically.</p><p><strong>22. SHR — 0x1C</strong> <em>Gas: 3</em></p><p>Shift right. Moves all bits right, filling with zeros on the left.</p><pre>8 SHR 3 = 0001 (1)</pre><p>Equivalent to dividing by 2^n. The compiler will generate SHR instead of DIV when dividing by powers of 2.</p><p><strong>23. BYTE — 0x1A</strong> <em>Gas: 3</em></p><p>Extracts a single byte from a 256-bit value. Takes an index (0–31) and the value, returns that byte.</p><pre>BYTE(0, 0xFF00…00) → 0xFF<br>BYTE(1, 0xFF00…00) → 0x00</pre><p>Used internally when Solidity needs to work with individual bytes in a bytes32 value.</p><h3>Group 4: Stack Management — Keeping Things Organised</h3><p>The stack is the EVM’s working memory. These opcodes manage what’s on it.</p><p><strong>24. PUSH1 through PUSH32–0x60 to 0x7F</strong> <em>Gas: 3</em></p><p>Pushes a value onto the top of the stack. The number after PUSH tells you how many bytes the value is.</p><pre>PUSH1 0x05 → pushes 5 onto the stack<br>PUSH20 0x… → pushes a 20-byte address<br>PUSH32 0x… → pushes a full 32-byte value (like a hash)</pre><p>These are some of the most common opcodes in any compiled contract. Every literal number, every address, every constant in your Solidity becomes a PUSH. That address(0) check? PUSH20 0x000…000.</p><p><strong>25. POP — 0x50</strong> <em>Gas: 2</em></p><p>Removes the top item from the stack and discards it. Doesn’t do anything with the value — just cleans it up.</p><p>This happens when a function returns a value you ignore, or when intermediate computation results need to be cleared.</p><p><strong>26. DUP1 through DUP16–0x80 to 0x8F</strong> <em>Gas: 3</em></p><p>Duplicates an item on the stack. DUP1 copies the top item. DUP2 copies the second item. And so on up to DUP16.</p><p>Why does this exist? Because most opcodes that use a stack value also consume it (remove it). If you need to use a value twice, you duplicate it first.</p><pre>Stack before DUP1: [5, 3, …]<br>DUP1<br>Stack after: [5, 5, 3, …] // top value duplicated</pre><p>This is why you can only access the top 16 stack items directly — DUP17 doesn’t exist.</p><p><strong>27. SWAP1 through SWAP16–0x90 to 0x9F</strong> <em>Gas: 3</em></p><p>Swaps the top stack item with another item below it. SWAP1 swaps positions 1 and 2. SWAP2 swaps positions 1 and 3. And so on.</p><p>This is how the compiler reorders operands when it needs them in a different order than they were placed on the stack.</p><h3>Group 5: Memory — The Whiteboard</h3><p>Memory is temporary space for the current execution context. It’s wiped after each call. Think of it as a big byte array that starts empty and grows as needed.</p><p><strong>28. MSTORE — 0x52</strong> <em>Gas: 3 + expansion cost</em></p><p>Writes 32 bytes to memory at a given offset.</p><p>MSTORE(offset, value)</p><p>Local variables, function arguments, return values — they all go through memory. When Solidity declares uint256 cached = myStorageVar, it reads from storage once (SLOAD) and writes to memory (MSTORE). Every subsequent use reads from memory (MLOAD) instead of storage — much cheaper.</p><p><strong>29. MLOAD — 0x51</strong> <em>Gas: 3 + expansion cost</em></p><p>Reads 32 bytes from memory at a given offset.</p><p>MLOAD(offset) → 32 bytes</p><p>This is how local variables get read. 3 gas versus 100–2100 gas for SLOAD — this is the difference that makes “cache your storage reads” such important advice.</p><p><strong>30. MSTORE8–0x53</strong> <em>Gas: 3</em></p><p>Writes a single byte to memory. Like MSTORE but only one byte. Used when working with individual bytes, like building up a bytes array manually.</p><p><strong>31. MSIZE — 0x59</strong> <em>Gas: 2</em></p><p>Returns the current size of active memory in bytes. Memory always expands in 32-byte chunks, so this is always a multiple of 32. Used in assembly when you need to know where free memory starts.</p><p><strong>32. MCOPY — 0x5E</strong> <em>Gas: 3 + 3 per word</em></p><p>Copies a region of memory to another location. Added in the Cancun upgrade. Before this existed, copying memory required a loop with MLOAD/MSTORE. Now it’s one opcode. Shows up when you slice or copy bytes in Solidity.</p><h3>Group 6: Storage — The Permanent Record</h3><p>Storage is the most expensive resource in the EVM. It’s a key-value store (both keys and values are 32 bytes) that persists between transactions. Every state variable in your contract lives here.</p><p><strong>33. SLOAD — 0x54</strong> <em>Gas: 2100 (cold) or 100 (warm)</em></p><p>Reads a value from a storage slot.</p><p>SLOAD(slot) → value</p><p><strong>Cold access</strong> means this is the first time this storage slot has been touched in the current transaction — costs 2100 gas. <strong>Warm access</strong> means it was already accessed earlier in the same transaction — costs only 100 gas.</p><p>This is why the “cache your storage variables” pattern exists:</p><pre>// ❌ Two cold SLOADs - potentially 4200 gas just for reads<br>function bad() external view returns (uint256) {<br>return myVar * myVar;<br>}<br>// ✅ One cold SLOAD, one cheap MLOAD<br>function good() external view returns (uint256) {<br>uint256 cached = myVar; // SLOAD once<br>return cached * cached; // MLOAD twice (3 gas each)<br>}</pre><p><strong>34. SSTORE — 0x55</strong> <em>Gas: 20000 / 2900 / 100 depending on scenario</em></p><p>Writes a value to a storage slot. The most expensive opcode you’ll regularly use.</p><p>SSTORE(slot, value)</p><p>The gas breakdown:</p><ul><li><strong>Writing to a zero slot (first write):</strong> 20,000 gas</li><li><strong>Updating a non-zero slot:</strong> 2,900 gas</li><li><strong>Writing zero to a non-zero slot (clearing):</strong> 2,900 gas but with a refund</li></ul><p>This is why initializing storage is so expensive, and why packing multiple values into a single storage slot (via uint128 pairs, packed structs, etc.) saves gas — you pay for fewer SSTOREs.</p><p><strong>35. TLOAD — 0x5C</strong> <em>Gas: 100</em></p><p>Transient storage load. Added in the Cancun upgrade (EIP-1153). Reads from <strong>transient storage</strong> — a new storage type that persists for the duration of a transaction but is wiped at the end.</p><p>Think of it as storage that’s cheaper than permanent storage but more durable than memory. Perfect for reentrancy locks.</p><pre>// Before EIP-1153: reentrancy guard costs 20000 gas (cold SSTORE)<br>// After: costs ~100 gas using transient storage</pre><p><strong>36. TSTORE — 0x5D</strong> <em>Gas: 100</em></p><p>Transient storage write. Sets a value in transient storage.</p><p>This pair (TLOAD/TSTORE) is one of the most impactful recent additions to the EVM. The nonReentrant modifier using transient storage is dramatically cheaper than the traditional version.</p><h3>Group 7: Control Flow — Where to Go Next</h3><p>The EVM executes bytecode linearly, one opcode at a time, incrementing a program counter. These opcodes break that linearity — they’re how loops, conditionals, and function dispatch work.</p><p><strong>37. JUMP — 0x56</strong> <em>Gas: 8</em></p><p>Unconditional jump. Sets the program counter to the specified destination.</p><p>JUMP(destination)</p><p>The destination must be a JUMPDEST opcode — you can’t jump to arbitrary positions. This is a safety measure to prevent jumping into the middle of data or multi-byte instructions.</p><p><strong>38. JUMPI — 0x57</strong> <em>Gas: 10</em></p><p>Conditional jump. Jumps to the destination only if the condition is non-zero.</p><p>JUMPI(destination, condition)</p><p>This is every if statement in Solidity. The compiled code evaluates the condition, puts the result on the stack, then does JUMPI to either jump (if true) or continue (if false).</p><p><strong>39. JUMPDEST — 0x5B</strong> <em>Gas: 1</em></p><p>Marks a valid jump destination. Only positions in the bytecode that have this opcode can be the target of JUMP or JUMPI. It’s a safety marker with almost no cost.</p><p><strong>40. PC — 0x58</strong> <em>Gas: 2</em></p><p>Returns the current value of the program counter — the position of this opcode in the bytecode. Rarely used directly in Solidity, but the EVM uses it internally to track execution.</p><p><strong>41. STOP — 0x00</strong> <em>Gas: 0</em></p><p>Halts execution successfully with no return data. Used when a function doesn’t return anything and executes cleanly.</p><p><strong>42. RETURN — 0xF3</strong> <em>Gas: 0 + memory expansion cost</em></p><p>Halts execution and returns data from a specific region of memory.</p><p>RETURN(offset, size)</p><p>Every Solidity function that returns a value uses this. The return values are ABI-encoded in memory first, then RETURN specifies where in memory they start and how long they are.</p><p><strong>43. REVERT — 0xFD</strong> <em>Gas: 0 + memory expansion cost</em></p><p>Halts execution, reverts all state changes, and optionally returns error data from memory.</p><p>REVERT(offset, size)</p><p>Every require(condition, “message”) and revert CustomError() compiles down to this. The error message or custom error data gets ABI-encoded in memory, and REVERT points to it. Gas used up to the revert point is still consumed — only state changes are rolled back.</p><h3>Group 8: Environmental Information — Knowing Your Context</h3><p>These opcodes let your contract ask questions about itself and the transaction it’s running in.</p><p><strong>44. ADDRESS — 0x30</strong> <em>Gas: 2</em></p><p>Pushes the address of the currently executing contract onto the stack.</p><pre>address(this) // compiles to ADDRESS</pre><p><strong>45. CALLER — 0x33</strong> <em>Gas: 2</em></p><p>Pushes the address of the immediate caller.</p><pre>msg.sender // compiles to CALLER</pre><p>Important distinction: in a direct user transaction, CALLER is the user’s EOA. If contract A calls contract B, inside B’s execution CALLER is contract A’s address — not the original user.</p><p><strong>46. CALLVALUE — 0x34</strong> <em>Gas: 2</em></p><p>Pushes the amount of ETH sent with the current call, in wei.</p><pre>msg.value // compiles to CALLVALUE</pre><p><strong>47. ORIGIN — 0x32</strong> <em>Gas: 2</em></p><p>Pushes the address of the original transaction sender — the EOA that initiated the entire call chain.</p><pre>tx.origin // compiles to ORIGIN</pre><p>Unlike CALLER, this never changes throughout a call chain. If a user calls contract A which calls contract B, inside B: CALLER is A but ORIGIN is always the user’s wallet. This is why using tx.origin for authentication is dangerous — any contract the user calls could act on their behalf.</p><p><strong>48. CHAINID — 0x46</strong> <em>Gas: 2</em></p><p>Pushes the chain ID of the current network.</p><pre>block.chainid // compiles to CHAINID</pre><p>Ethereum mainnet is 1, Lisk Sepolia is 4202. Used in EIP-712 signatures to prevent replay attacks across different networks — your signed message on Sepolia shouldn’t be valid on mainnet.</p><p><strong>49. TIMESTAMP — 0x42</strong> <em>Gas: 2</em></p><p>Pushes the timestamp of the current block in Unix seconds.</p><pre>block.timestamp // compiles to TIMESTAMP</pre><p>Everyone knows the warning: don’t use this for precise timing. Validators have a small window of flexibility (a few seconds) in what timestamp they report. For anything where someone could profit from manipulating it by a few seconds — like a lottery or auction cutoff — be careful.</p><p><strong>50. NUMBER — 0x43</strong> <em>Gas: 2</em></p><p>Pushes the current block number.</p><pre>block.number // compiles to NUMBER</pre><p>Block numbers are more predictable than timestamps for relative timing. If you know blocks come roughly every 12 seconds on Ethereum, block.number + 100 is about 20 minutes from now. More manipulation-resistant than TIMESTAMP for short time windows.</p><h3>How These Opcodes Work Together — A Real Example</h3><p>Let’s trace through what happens when you call a simple function. Take this:</p><pre>function transfer(address to, uint256 amount) external {<br>require(balances[msg.sender] &gt;= amount, &quot;insufficient&quot;);<br>balances[msg.sender] -= amount;<br>balances[to] += amount;<br>}</pre><p>Here’s roughly what the EVM executes:</p><pre>// Read msg.sender&#39;s balance<br>CALLER // push msg.sender onto stack<br>PUSH1 [balances slot] // push storage slot for balances mapping<br>SHA3 // hash them together to get the actual slot<br>SLOAD // read balance from storage (cold: 2100 gas)<br>// Compare with amount (from calldata)<br>CALLDATALOAD // read `amount` from function arguments<br>LT // is balance &lt; amount?<br>ISZERO // flip: is balance &gt;= amount?<br>PUSH [revert destination]<br>JUMPI // if false, jump to revert logic<br>// Subtract from sender<br>CALLER<br>PUSH1 [balances slot]<br>SHA3<br>DUP1 // duplicate the slot (we need it twice)<br>SLOAD // read current balance (now warm: 100 gas)<br>CALLDATALOAD // load amount<br>SUB // subtract<br>SWAP1 // reorder stack<br>SSTORE // write new balance (2900 gas - updating existing)<br>// Add to recipient<br>CALLDATALOAD // load `to` address<br>PUSH1 [balances slot]<br>SHA3 // compute slot for `to`&#39;s balance<br>DUP1<br>SLOAD // read `to`&#39;s balance<br>CALLDATALOAD // load amount<br>ADD // add<br>SWAP1<br>SSTORE // write new balance<br>STOP</pre><p>Every single line. Every argument read. Every storage interaction. All opcodes.</p><h3>What This Changes About How You Write Solidity</h3><p>Understanding opcodes isn’t just interesting trivia. It directly changes how you should write contracts.</p><p><strong>Read storage once, use memory for the rest:</strong></p><pre>// Every myVar reference is an SLOAD<br>function bad() external view returns (uint256) {<br>return myVar + myVar + myVar; // 3x SLOAD<br>}<br>// One SLOAD, two MLOADs<br>function good() external view returns (uint256) {<br>uint256 v = myVar; // 1x SLOAD<br>return v + v + v; // 2x MLOAD (3 gas each)<br>}</pre><p><strong>Use constants for fixed values:</strong></p><pre>// EXP fires every call<br>uint256 decimals = 10 ** 18;<br>// Baked in at compile time - no EXP opcode<br>uint256 constant DECIMALS = 10 ** 18;<br>Pack storage variables:<br>// Two separate slots - two SSTOREs<br>uint256 a; // slot 0<br>uint256 b; // slot 1<br>// Packed into one slot - one SSTORE<br>uint128 a; // slot 0 (first 16 bytes)<br>uint128 b; // slot 0 (second 16 bytes)<br>Use transient storage for reentrancy guards:<br>// Old pattern - 20,000 gas on first lock (cold SSTORE)<br>bool private _locked;<br>modifier nonReentrant() {<br>require(!_locked);<br>_locked = true;<br>_;<br>_locked = false;<br>}<br>// New pattern with transient storage - 100 gas<br>modifier nonReentrant() {<br>assembly {<br>if tload(0) { revert(0, 0) }<br>tstore(0, 1)<br>}<br>_;<br>assembly { tstore(0, 0) }<br>}</pre><h4>Where to Go From Here</h4><p>You’ve now got a solid mental model of how the EVM actually works. You know what happens between your Solidity and the blockchain. That’s not nothing — most devs write Solidity for years without really knowing this.</p><p>To keep going deeper:</p><ul><li><a href="https://evm.codes/"><strong>evm.codes</strong></a> — the best opcode reference. Every opcode, gas cost, and an interactive playground where you can step through EVM execution.</li><li><strong>Decompile your own contracts</strong> — run npx hardhat compile then inspect the bytecode in artifacts/. Tools like<a href="https://ethervm.io/decompile"> ethervm.io/decompile</a> can turn bytecode back into readable assembly.</li><li><strong>Read the Yellow Paper</strong> — dense, but it’s the formal specification. The<a href="https://github.com/chronaeon/beigepaper"> Beige Paper</a> is a more readable version.</li><li><strong>Play with Huff</strong> — a low-level language that compiles almost directly to opcodes. Writing even a simple contract in Huff will solidify everything from this article.</li><li><strong>Forge gas snapshots</strong> — run forge snapshot in a Foundry project to see exactly how many gas units each function uses, then optimize and watch the numbers drop.</li></ul><p>The EVM is actually a pretty elegant machine once you get to know it. And now you do.</p><h3>References</h3><ol><li><strong>evm.codes</strong> — Interactive EVM opcode reference with gas costs and a step-through playground.<a href="https://evm.codes/"> evm.codes</a></li><li><strong>EIP-1153: Transient Storage Opcodes</strong> — Specification for TLOAD and TSTORE.<a href="https://eips.ethereum.org/EIPS/eip-1153"> eips.ethereum.org/EIPS/eip-1153</a></li><li><strong>EIP-2929: Gas cost increases for state access opcodes</strong> — Why cold/warm SLOAD costs differ.<a href="https://eips.ethereum.org/EIPS/eip-2929"> eips.ethereum.org/EIPS/eip-2929</a></li><li><strong>EIP-3855: PUSH0 instruction</strong> — Added PUSH0 opcode in Shanghai upgrade.<a href="https://eips.ethereum.org/EIPS/eip-3855"> eips.ethereum.org/EIPS/eip-3855</a></li><li><strong>Ethereum docs — Understanding EVM</strong><a href="https://docs.ethereum.org/en/developers/docs/evm/"> docs.ethereum.org</a></li><li><strong>Solidity documentation — Yul/Assembly</strong> — How Solidity exposes opcodes through inline assembly.<a href="https://docs.soliditylang.org/en/latest/yul.html"> docs.soliditylang.org</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f4a9056e927" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[window.ethereum and the Standards That Built Web3.]]></title>
            <link>https://medium.com/@dahunsiolajumoke18/window-ethereum-and-the-standards-that-built-web3-b1fed5f2b529?source=rss-04388dce16ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/b1fed5f2b529</guid>
            <category><![CDATA[eip-6963]]></category>
            <category><![CDATA[standards-that-built-web3]]></category>
            <category><![CDATA[eip-1193]]></category>
            <category><![CDATA[x402]]></category>
            <category><![CDATA[eip-4337]]></category>
            <dc:creator><![CDATA[Dahunsi Alimot Olajumoke]]></dc:creator>
            <pubDate>Fri, 20 Mar 2026 08:19:24 GMT</pubDate>
            <atom:updated>2026-03-20T08:19:24.468Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="window.ethereum and the Standards That Built Web3." src="https://cdn-images-1.medium.com/max/1024/1*mLPg6ncPWkHcMQ0PYyn0qg.png" /></figure><h4>How EIP-1193, EIP-6963, EIP-4337, EIP-7702, and x402 all connect</h4><p>If you’ve ever clicked “Connect Wallet” on a website, you’ve already used window.ethereum — even if you didn’t know it. That one line of JavaScript is the entry point to everything in the Ethereum browser ecosystem: connecting wallets, sending transactions, signing messages, and increasingly, powering AI agents that pay for APIs without any human in the loop.</p><p>But window.ethereum doesn’t work in isolation. A stack of Ethereum Improvement Proposals (EIPs) defines how it behaves, what it can do, and where it’s going. This article walks through all of them — not as isolated specs, but as a connected story of how the web3 stack evolved and where it’s heading.</p><h3>1. What is window.ethereum?</h3><p>When you install MetaMask (or Coinbase <a href="https://masteringethereum.xyz/chapter_5.html">Wallet</a>, Rabby, or any other browser wallet), the extension quietly injects a <a href="https://www.geeksforgeeks.org/javascript/objects-in-javascript/">JavaScript object</a> into every page you visit. That object lives at window.ethereum — a global variable your web app can read and use.</p><p>Think of it as a bridge. On one side is your web app — plain <a href="https://www.geeksforgeeks.org/html/html-introduction/">HTML</a> and JavaScript. On the other side is the Ethereum network. window.ethereum connects them without your app ever needing to handle private keys, run a <a href="https://masteringethereum.xyz/chapter_3.html">node</a>, or deal with low-level blockchain internals.</p><p>A simple check to see if one is available:</p><pre>if (typeof window.ethereum !== &#39;undefined&#39;) {<br>console.log(&#39;A wallet is installed!&#39;);<br>} else {<br>console.log(&#39;No wallet found. Ask user to install one.&#39;);<br>}</pre><p>That’s literally all it takes to detect a wallet. Everything else — connecting accounts, sending transactions, signing data — flows through this single object. The question is: what rules govern how it works? That’s where the <a href="https://eips.ethereum.org/">EIPs</a> come in.</p><h3>2. EIP-1193 — the rulebook for window.ethereum</h3><p>Before EIP-1193, every wallet had its own <a href="https://www.geeksforgeeks.org/software-testing/what-is-an-api/">API</a>. MetaMask used one pattern, other wallets used different ones, and developers had to write messy compatibility code just to connect a wallet. <strong>EIP-1193</strong> fixed this by defining a single, clean interface that every provider must follow.</p><p>The core rule is simple: window.ethereum must expose a request() method that takes a <a href="https://www.geeksforgeeks.org/ethical-hacking/what-is-json-rpc-in-ethereum/">JSON-RPC</a> call and returns a Promise. That’s the whole foundation.</p><h3>Connecting a wallet</h3><pre>const accounts = await window.ethereum.request({<br>method: &#39;eth_requestAccounts&#39;<br>});<br>console.log(&#39;Connected:&#39;, accounts[0]);<br>// 0xYourWalletAddress</pre><p>Calling eth_requestAccounts triggers the wallet popup asking the user to approve the connection. Once approved, you get their address. Simple.</p><h3>Listening for changes</h3><p>EIP-1193 also defines events. When the user switches accounts or changes their network, your app can react immediately:</p><pre>window.ethereum.on(&#39;accountsChanged&#39;, (accounts) =&gt; {<br>if (accounts.length === 0) {<br>console.log(&#39;Wallet disconnected&#39;);<br>} else {<br>updateUI(accounts[0]);<br>}<br>});<br>window.ethereum.on(&#39;chainChanged&#39;, (chainId) =&gt; {<br>console.log(&#39;Network changed to:&#39;, chainId);<br>window.location.reload(); // common practice<br>});</pre><p><strong>In plain terms: </strong>EIP-1193 is the contract that makes window.ethereum predictable. Any wallet that follows it will work with any <a href="https://www.investopedia.com/terms/d/decentralized-applications-dapps.asp">dApp</a> that follows it — no compatibility shims needed.</p><h3>3. EIP-6963 — what happens when two wallets are installed?</h3><p>EIP-1193 standardised the interface, but it left one practical problem unsolved: what if a user has both MetaMask <em>and</em> Coinbase Wallet installed? Both extensions try to inject into window.ethereum, and they overwrite each other. The last one to load wins — which is random and unreliable.</p><p>EIP-6963 fixes this with a different approach. Instead of fighting over window.ethereum, each wallet broadcasts itself through a custom browser event:</p><pre>const wallets = [];<br>// Listen for wallet announcements<br>window.addEventListener(&#39;eip6963:announceProvider&#39;, (event) =&gt; {<br>wallets.push(event.detail);<br>console.log(&#39;Found wallet:&#39;, event.detail.info.name);<br>// e.g. &#39;MetaMask&#39;, &#39;Coinbase Wallet&#39;<br>});<br>// Ask all installed wallets to announce themselves<br>window.dispatchEvent(new Event(&#39;eip6963:requestProvider&#39;));</pre><p>Now your dApp receives all available wallets and can show the user a picker — a much better experience than silently picking one at random.</p><p><strong>How it relates to window.ethereum: </strong>EIP-6963 doesn’t replace window.ethereum — it adds a discovery layer on top of it. Once the user picks a wallet, you still use window.ethereum (or the chosen provider’s equivalent) to make calls.</p><h3>4. EIP-4337 — what if the wallet itself was a smart contract?</h3><p>The first three entries (window.ethereum, EIP-1193, and EIP-6963) are all about the browser-to-wallet interface. EIP-4337 goes deeper — it rethinks what a wallet fundamentally is.</p><h3>The old model: externally owned accounts (EOAs)</h3><p>A standard Ethereum wallet is what’s called an Externally Owned Account (EOA). It’s essentially a public/private key pair. It works, but it has hard limitations:</p><ul><li>Every transaction must be directly signed by the private key</li><li><a href="https://www.coinbase.com/learn/crypto-basics/what-are-gas-fees">Gas fees</a> must always be paid in ETH</li><li>No custom logic — no spending limits, no 2-of-3 multi-sig, no automatic approvals</li><li>Lose the key? The account is gone forever</li></ul><h3>EIP-4337: smart contract accounts</h3><p>EIP-4337 introduces <strong>Account Abstraction</strong> — the ability to use a smart contract as your wallet. Instead of a raw private key, your account is a contract with custom logic you define.</p><p>The mechanism works through a new object called a UserOperation — a bundle of intent that describes what you want to do:</p><pre>// A UserOperation (simplified) looks like this:<br>{<br>sender: &#39;0xYourSmartWalletAddress&#39;,<br>callData: &#39;0x…&#39;, // what you want to execute<br>paymasterAndData: &#39;0x…&#39;, // who pays the gas (optional)<br>signature: &#39;0x…&#39; // your authorisation<br>}</pre><p>UserOperations are collected by special actors called Bundlers, who package them into real transactions and submit them on-chain. The key innovation: your dApp doesn’t need to change. It still calls window.ethereum — the smart wallet’s provider handles the UserOperation layer transparently.</p><h3>What this unlocks</h3><ul><li>Gas sponsorship — a third party (called a <a href="https://www.alchemy.com/overviews/what-is-a-paymaster">Paymaster</a>) covers the gas so users pay nothing</li><li>Pay gas in ERC-20 tokens like USDC instead of ETH</li><li>Batch multiple actions into a single transaction</li><li>Session keys — grant a dApp limited, time-boxed permissions without a pop-up every time</li><li>Social recovery — recover your wallet using trusted contacts instead of a <a href="https://finst.com/en/learn/articles/what-is-a-seed-phrase">seed phrase</a></li></ul><p><strong>Real example: </strong>A gaming dApp sponsors gas for new players — they play for free, no ETH required. The dApp uses a Paymaster via EIP-4337, and the player’s wallet is a smart contract account. From the player’s perspective, they just clicked ‘Play’.</p><h3>5. EIP-7702 — upgrading your existing wallet, not replacing it</h3><p>EIP-4337 is powerful, but it has friction: to use a <a href="https://www.web3.university/tracks/create-a-smart-contract/what-are-smart-contracts">smart contract</a> wallet, you’d traditionally need to deploy a new contract, migrate your assets to a new address, and explain all this to your users. EIP-7702 solves that.</p><p>Introduced as part of Ethereum’s Pectra upgrade, EIP-7702 lets an ordinary <a href="https://www.coinfabrik.com/glossary/eoa-externally-owned-account/">EOA</a> wallet temporarily delegate its behaviour to a smart contract — without changing address.</p><h3>How it works</h3><p>With EIP-7702, a regular MetaMask wallet can sign a special transaction (type 0x04) that says: <em>“For this operation, behave like this smart contract.”</em> The delegation is transaction-scoped — it doesn’t permanently change the wallet.</p><pre>// EIP-7702 delegation (conceptual)<br>// The EOA signs an authorisation to delegate to a smart contract<br>{<br>type: &#39;0x04&#39;,<br>authorizationList: [{<br>address: &#39;0xSmartContractLogicAddress&#39;, // the contract to delegate to<br>nonce: 1,<br>chainId: 1,<br>// signed by the EOA&#39;s private key<br>}]<br>}</pre><h4>Why this matters</h4><p>The result is that an ordinary user’s existing wallet — same address, same assets — can suddenly do smart wallet things: batch transactions, pay gas in USDC, use session keys. No migration required.</p><p><strong>The difference from EIP-4337: </strong>EIP-4337 deploys a new smart contract account. EIP-7702 upgrades your existing EOA in place. They’re complementary — 7702 is often described as the on-ramp that lets existing users access 4337’s capabilities without friction.</p><h3>6. x402 — payments at the HTTP layer</h3><p>This is where things get genuinely exciting — and where the entire stack below it becomes critical infrastructure.</p><h3>The original HTTP 402</h3><p>When the web was being designed in the early 1990s, HTTP reserved a status code for payments: 402 Payment Required. It was intended to enable paid content on the internet. It was never implemented. Servers mostly used it as a placeholder. For thirty years, 402 sat unused, waiting.</p><h3>x402 brings it to life</h3><p>x402, launched by Coinbase in May 2025, finally implements 402. The protocol is elegantly simple:</p><ul><li>Your client (browser app, AI agent, script) makes a normal HTTP request to a resource</li><li>The server responds with 402 Payment Required plus details of what payment is needed</li><li>The client signs a payment authorisation using its wallet (following EIP-712)</li><li>The client resends the request with a X-PAYMENT header containing the signed payload</li><li>The server verifies the payment on-chain and returns the resource</li></ul><pre>// Simplified x402 client flow<br>let response = await fetch(&#39;https://api.example.com/data&#39;);<br>if (response.status === 402) {<br>const paymentDetails = await response.json();<br>// Sign the payment using the wallet<br>const payment = await signPayment(paymentDetails); // uses window.ethereum<br>// Retry with payment header<br>response = await fetch(&#39;https://api.example.com/data&#39;, {<br>headers: { &#39;X-PAYMENT&#39;: payment }<br>});<br>}<br>const data = await response.json();</pre><h3>Why x402 is a big deal</h3><p>x402 enables a new category of internet interactions. Specifically, it makes micropayments native to HTTP — no subscription, no login, no payment form. Just a signed header and a resource.</p><p>This is especially important for AI agents. An autonomous agent browsing the internet can now pay for API access, buy data, or unlock content — programmatically, without a human approving each transaction. The agent just needs a wallet.</p><p><strong>Connection to the full stack: </strong>x402 signs payments using EIP-712. In a browser, that signing goes through window.ethereum. For agents, it uses embedded or server-side wallets. EIP-4337 and EIP-7702 make those wallets programmable — agents can batch payments, have gas sponsored, or operate with session-scoped keys.</p><h3>7. How they all fit together</h3><p>Here’s the full picture as a layered stack — each standard builds on the one below it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UpWYBZhYXPhgYN83pDF-og.png" /></figure><p>Let’s trace a real interaction through the whole stack to make it concrete.</p><p><strong>Scenario: </strong>A user visits a DeFi app. They have MetaMask and Coinbase Wallet installed. They want to swap USDC for ETH, with gas paid in USDC. The dApp also fetches price data from a paid API using x402.</p><ul><li>EIP-6963 detects both wallets and shows a picker. The user chooses MetaMask.</li><li>EIP-1193 defines how the app calls eth_requestAccounts to connect and get the address.</li><li>EIP-7702 lets the MetaMask EOA temporarily behave as a smart contract for this transaction.</li><li>EIP-4337 allows the swap to be batched with a USDC approval in one click, with gas paid in USDC via a Paymaster.</li><li>x402 lets the app’s backend fetch live price data from a paid API by signing a micropayment — the cost is fractions of a cent, invisible to the user.</li></ul><p>The user sees one transaction, one click, no ETH for gas. Every layer of the stack did its job invisibly.</p><h3>8. Quick reference</h3><p>window.ethereum The JavaScript object injected by wallet extensions.The entry point for all browser-to-blockchain calls.</p><p>EIP-1193 Defines the window.ethereum interface: a request() method and an event emitter. The universal contract between wallets and dApps. EIP-6963 Fixes multi-wallet conflicts by letting wallets announce themselves via events instead of overwriting window.ethereum.</p><p>EIP-4337 Account Abstraction. Lets users have smart contract wallets with programmable logic: sponsored gas, batched transactions, session keys, social recovery.</p><p>EIP-7702 Gives existing EOA wallets smart contract capabilities without migration. Part of Ethereum’s Pectra upgrade.</p><p>x402 Implements HTTP 402 for crypto micropayments. Enables any HTTP client (browser, AI agent, script) to pay for resources with a signed header.</p><h3>Closing thought</h3><p>window.ethereum started as a narrow slot in the browser — a way to reach a wallet. What’s remarkable is how much of web3’s current momentum runs through that one object, or the standards layered around it.</p><p>EIP-1193 made it reliable. EIP-6963 made it work with multiple wallets. EIP-4337 and EIP-7702 made the wallets themselves programmable. And x402 is now using all of it as a payment rail for the open web — including autonomous AI agents that can pay for APIs the same way a browser loads an image.</p><p>The next time you click ‘Connect Wallet’, you’re touching the bottom of a stack that’s being actively built upward. It’s still early — but the foundation is solid.</p><h3>References</h3><ol><li><a href="https://eips.ethereum.org/EIPS/eip-1193">EIP-1193: Ethereum Provider JavaScript API</a></li><li><a href="https://eips.ethereum.org/EIPS/eip-6963">EIP-6963: Multi Injected Provider Discovery</a></li><li><a href="https://eips.ethereum.org/EIPS/eip-4337">EIP-4337: Account Abstraction via Entry Point Contract</a></li><li><a href="https://eips.ethereum.org/EIPS/eip-7702">EIP-7702: Set EOA account code</a></li><li><a href="https://x402.org/">x402 Protocol — Coinbase</a></li><li><a href="https://ethereum.org/en/history/">EIP-712: Typed structured data hashing and signing — Pectra Upgrade Overview (ethereum.org)</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1fed5f2b529" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering React Hooks: A Deep Dive into useState, useEffect, useMemo, useCallback, and useRef]]></title>
            <link>https://medium.com/@dahunsiolajumoke18/mastering-react-hooks-a-deep-dive-into-usestate-useeffect-usememo-usecallback-and-useref-3738030074d7?source=rss-04388dce16ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/3738030074d7</guid>
            <dc:creator><![CDATA[Dahunsi Alimot Olajumoke]]></dc:creator>
            <pubDate>Wed, 18 Mar 2026 08:28:25 GMT</pubDate>
            <atom:updated>2026-03-18T08:28:25.636Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nsVS2aldDB2uobmuv9ebTw.png" /></figure><p>Have you ever wondered how modern React applications manage state, handle side effects, and stay performant — all without relying on complex class components?</p><p>Welcome to this deep dive into React Hooks.</p><p>If you’ve been working with React for a while, you’ve likely come across hooks — or maybe you’ve used a few without fully understanding what’s happening under the hood. And if you’re just getting started, hooks might seem a bit confusing at first. That’s completely normal.</p><p>In this article, we’re going to break things down in a clear and practical way. Think of this as a guided tour where we move beyond just syntax and explore the <em>why</em> behind each hook. By the end, you won’t just know how to use them — you’ll understand when to use them and how they fit into real-world applications.</p><p>So whether you’re building your first React app or looking to level up your frontend skills, you’re in the right place. Let’s get into it.</p><h4><strong>Introduction to React hooks</strong></h4><p>React Hooks have revolutionized how developers build and reason about components, unleashing a new paradigm for state, side effects, and abstraction in functional programming. This article dissects Hooks from the inside out, revealing not only how to leverage their power for expressive, maintainable Uls but also how to sidestep subtle pitfalls. Whether you’re refactoring legacy code or building modern frontends from scratch, you’ll gain insights to confidently unlock the full potential of Hooks for scalable React applications.</p><p>The introduction of React Hooks marked a significant evolution in the React library, designed to address fundamental limitations inherent in class components and enhance functional component capabilities. Prior to Hooks, managing state and side effects was predominantly achieved through class-based components. Although classes offered a straightforward encapsulation model, several challenges emerged, particularly as applications scaled in complexity.</p><p>In this article we will explore 5 essential hooks, which include the useState, useEffect, useContext, useMemo and useRef, discussing their functions, importance and the logics.</p><h4><strong>useState</strong></h4><p>Managing state in React applications requires an understanding of both simple and complex paradigms for updating and maintaining consistency within user interfaces. The useState hooks serve as foundational tool for state management, tailored to different levels of state complexity and transition patterns. This section presents a detailed examination of these hook, it appropriate use cases, modeling of state transitions, and techniques to ensure state consistency in dynamic environments.</p><p>The usestate hook provides a straightforward interface for managing local state within functional components. It accepts an initial state value of any type and returns a tuple containing the current state and a setter function. This setter function allows replacement or updates of the state, enabling the simplest form of state mutation.</p><p>Example of useState managing a simple counter</p><blockquote>import React, [useState from ‘react’;</blockquote><blockquote>function Counter() (</blockquote><blockquote>const [count, setCount] = useState(0);</blockquote><blockquote>const increment ()&gt; setCount (count + 1);</blockquote><blockquote>return (</blockquote><blockquote>&lt;button onClick={increment]&gt;</blockquote><blockquote>Count: [count)</blockquote><blockquote>&lt;/button&gt;</blockquote><p>In this example, the state represents a single scalar value, and updates are simple, atomic replacements. Such straightforward scenarios-like toggling booleans, storing strings or numbers, or managing discrete primitive state-benefit from the directness and low cognitive overhead of useState.</p><p>As state shapes grow in complexity, such as objects or arrays with nested properties, managing multiple interdependent state variables with usestate can become error-prone. Multiple useState calls holding pieces of state may lead to scattered logic and code duplication, especially when the state transition depends on prior state.</p><h4><strong>useEffect</strong></h4><p>This is a hook primarily for synchronizing a component with an external system. It can be used for executing side effects, such as fetching data, subscribing to events, or interacting with the DOM.</p><h4>Syntax</h4><blockquote>useEffect(() =&gt; {</blockquote><blockquote>// side effect logic</blockquote><blockquote>return () =&gt; {</blockquote><blockquote>// cleanup (optional)</blockquote><blockquote>};</blockquote><blockquote>}, [dependencies]);</blockquote><blockquote><strong>Example</strong> :</blockquote><blockquote>import { useState, useEffect } from ‘react’;</blockquote><blockquote>function DataFetcher() {</blockquote><blockquote>const [data, setData] = useState(null);</blockquote><blockquote>useEffect(() =&gt; {</blockquote><blockquote>fetch(‘/api/data’)</blockquote><blockquote>.then((response) =&gt; response.json())</blockquote><blockquote>.then(setData);</blockquote><blockquote>}, []);</blockquote><blockquote>return &lt;div&gt;{data ? JSON.stringify(data) : ‘Loading…’}&lt;/div&gt;;</blockquote><blockquote>}</blockquote><h4><strong>useCallback</strong></h4><p>useCallback is a hook that returns a memoized version of the callback function, meaning it will only recreate the function if its dependencies change. This can help prevent performance issues caused by unnecessary function recreations and re-renders of child components that depend on these functions.</p><p><strong>Syntax ;</strong></p><blockquote><strong>const memoizedCallback = useCallback(</strong></blockquote><blockquote><strong>() =&gt; {</strong></blockquote><blockquote><strong>// Your logic here</strong></blockquote><blockquote><strong>},</strong></blockquote><blockquote><strong>[dependency1, dependency2] // Dependency array</strong></blockquote><blockquote><strong>)</strong></blockquote><p>When the values inside the dependency array remain unchanged between renders, React will return the same instance of the callback function. This is particularly useful when you pass callback functions down to child components.</p><p><strong>Some scenarios where useCallback is helpful:</strong></p><ul><li>If you’re passing functions to a component that uses React.memo to avoid unnecessary re-renders.</li><li>When you have expensive callback functions and you want to avoid recalculating them unless necessary.</li><li>Stabilizing function references: If you pass a function to useEffect as a dependency, useEffect will rerun every time that function is recreated. If the function doesn’t need to change on every render, you can stabilize it using useCallback to prevent unnecessary effect re-runs.</li><li>Avoiding infinite loops: Without useCallback, if you include a non-memoized function as a dependency in useEffect, the effect can run in an infinite loop because the function reference changes on every render.</li><li>Here, we have a parent component that passes a callback function to a child component. Without useCallback, the child component would re-render every time the parent re-renders, even if the function remains the same.</li></ul><blockquote>// Child component</blockquote><blockquote>const Child = React.memo(({ handleClick }) =&gt; {</blockquote><blockquote>console.log(“Child component rendered”);</blockquote><blockquote>return &lt;button onClick={handleClick}&gt;Click me!&lt;/button&gt;;</blockquote><blockquote>});</blockquote><blockquote>// Parent component</blockquote><blockquote>const Parent = () =&gt; {</blockquote><blockquote>const [count, setCount] = useState(0);</blockquote><blockquote>// Without useCallback, this function would be recreated on every render</blockquote><blockquote>const handleClick = useCallback(() =&gt; {</blockquote><blockquote>alert(“Button clicked!”);</blockquote><blockquote>}, []);</blockquote><blockquote>return (</blockquote><blockquote>&lt;div&gt;</blockquote><blockquote>&lt;p&gt;Count: {count}&lt;/p&gt;</blockquote><blockquote>&lt;button onClick={() =&gt; setCount(count + 1)}&gt;Increment Count&lt;/button&gt;</blockquote><blockquote>&lt;Child handleClick={handleClick} /&gt;</blockquote><blockquote>&lt;/div&gt;</blockquote><blockquote>);</blockquote><blockquote>};</blockquote><p>Explanation:</p><ul><li>We use React.memo to wrap the Child component. This prevents the child from re-rendering unless its props change.</li><li>The handleClick function is memoized using useCallback, meaning it won’t change between renders unless the dependencies in its array change.</li><li>As a result, clicking the “Increment Count” button in the Parent component doesn’t cause the Child to re-render, because the reference to handleClick remains the same.</li></ul><h4><strong>useRef</strong></h4><p>The useRef Hook serves two main purposes: storing mutable values that do not cause a re-render when updated and storing references to DOM elements. Let’s explore how it works in more detail.</p><p>When a component renders in <a href="https://kinsta.com/topic/react/">React</a>, its state and other variables are typically reset. However, there are cases where you need to retain certain values even when the component re-renders. This is where the useRef Hook comes into play. It allows you to create a reference to a value that will persist between renders, ensuring that the value remains intact even if other parts of the component change.</p><p>Additionally, the useRef Hook is instrumental in working with DOM elements. In React, accessing and modifying DOM elements directly can be challenging, especially without the useRef Hook. With useRef, you can obtain a reference to a specific DOM element and perform operations on it. This eliminates the need for external <a href="https://kinsta.com/blog/react-components-library/">libraries</a> or convoluted workarounds.</p><p>With the introduction of the useRef Hook in React, the process of working with DOM elements within components has become significantly streamlined. The useRef Hook provides a straightforward way to create a reference to a DOM element, making it easily accessible and manipulable within the component’s context.</p><blockquote>import { useRef } from ‘react’;</blockquote><blockquote>const FocusComponent = () =&gt; {</blockquote><blockquote>const inputRef = useRef(null);</blockquote><blockquote>const handleFocus = () =&gt; { // accessing the input element</blockquote><blockquote>let inputElement = inputRef.current; // modify the DOM element</blockquote><blockquote>inputElement.focus();</blockquote><blockquote>};</blockquote><blockquote>return ( &lt;div&gt; &lt;input type=”text” ref={inputRef} /&gt;</blockquote><blockquote>&lt;button onClick={handleFocus}&gt;import React from ‘react’;<br>const ListComponent = ({ items }) =&gt; {<br>const processedItems = processItems(items); // Expensive computation<br>return (<br>&lt;ul&gt;<br>{processedItems.map(item =&gt; (<br>&lt;li key={item.id}&gt;{item.name}&lt;/li&gt;<br>))}<br>&lt;/ul&gt;<br>);<br>};<br>const processItems = (items) =&gt; {<br>// Expensive computation<br>// Imagine some heavy processing here<br>return items.map(item =&gt; ({ id: item.id, name: item.name.toUpperCase() }));<br>};<br>export default ListComponent;</blockquote><blockquote>Focus Input</blockquote><blockquote>&lt;/button&gt; &lt;/div&gt; );</blockquote><blockquote>}</blockquote><p>In this example, the useRef Hook is used to create a reference inputRef that points to the input element. When the “Focus Input” button is clicked, the handleFocus function utilizes inputRef.current.focus() to set the focus on the input element directly. This demonstrates how the useRef Hook simplifies the process of working with DOM elements in React.</p><h4><strong>useMemo</strong></h4><p>useMemo is a performance optimization hook. It memoizes the result of a computation — meaning it caches the return value of a function and only recalculates it when one of its dependencies changes. Without useMemo, every single render runs every expression in your component body from scratch. For cheap operations this is fine. For expensive calculations — filtering huge datasets, running complex algorithms, or processing large arrays — you want to cache the result.</p><p><a href="https://rossbulat.medium.com/how-to-memoize-in-react-3d20cbcd2b6e">Memoization</a> is a computer science concept that aims to accelerate the performance of your application. Used on complexed functions where the result is cached to avoid repeating excessive calls to that complexed function. Below I will be demonstrating it’s usage in a simple understandable way.</p><p>In simple terms, useMemo is like having a smart assistant who remembers the answers to math problems, so you don’t have to solve them again and again.</p><p>To understand how useMemo works, let’s consider a scenario where you have a component that renders a list of items, and you need to perform some heavy computation to derive the list.</p><p>Without memoization, this heavy computation would be executed on every render, even if the inputs remain unchanged.</p><p>Here’s a basic example without useMemo:</p><blockquote>import React from ‘react’;</blockquote><blockquote>const ListComponent = ({ items }) =&gt; {</blockquote><blockquote>const processedItems = processItems(items); // Expensive computation</blockquote><blockquote>return (</blockquote><blockquote>&lt;ul&gt;</blockquote><blockquote>{processedItems.map(item =&gt; (</blockquote><blockquote>&lt;li key={item.id}&gt;{item.name}&lt;/li&gt;</blockquote><blockquote>))}</blockquote><blockquote>&lt;/ul&gt;</blockquote><blockquote>);</blockquote><blockquote>};</blockquote><blockquote>const processItems = (items) =&gt; {</blockquote><blockquote>// Expensive computation</blockquote><blockquote>// Imagine some heavy processing here</blockquote><blockquote>return items.map(item =&gt; ({ id: item.id, name: item.name.toUpperCase() }));</blockquote><blockquote>};</blockquote><blockquote>export default ListComponent;</blockquote><p>By wrapping the processItems call inside useMemo, React will only recompute the memoized value when the items prop changes. This optimization can significantly improve the performance of your application, especially when dealing with large datasets or complex computations.</p><p><strong>Conclusion</strong></p><p>React Hooks address core limitations of class components by offering a straightforward, expressive interface to manage state and side effects in functional components. They resolve the fragmentation of lifecycle logic, lower syntactic overhead, and revolutionize code reuse patterns by embracing composability at the language level. The resulting model enhances code clarity, maintainability, and developer experience, aligning React development with contemporary functional programming principles while maintaining compatibility and interoperability within complex application ecosystems.</p><p>React Hooks aren’t just API sugar on top of class components — they’re a completely different mental model for how components work. The key is understanding the why behind each hook, not just the syntax.</p><p>useState is about reactivity. useEffect is about synchronization with the outside world. useMemo and useCallback are about preserving identity and avoiding wasted work. And useRef is your escape hatch into the mutable, imperative world that lives just beneath React’s declarative surface. As you build more React applications, you’ll develop an intuition for which hook belongs where. Until then, lean on these principles:</p><p>• If it drives the UI → useState</p><p>• If it talks to the outside world → useEffect</p><p>• If it’s an expensive derived value → useMemo</p><p>• If it’s a function passed to a memoized child → useCallback</p><p>• If you need it to persist without causing re-renders → useRef</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3738030074d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Solidity Inheritance: A Guide to Smart Contract Architecture]]></title>
            <link>https://medium.com/@dahunsiolajumoke18/mastering-solidity-inheritance-a-guide-to-smart-contract-architecture-fac083842dfc?source=rss-04388dce16ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/fac083842dfc</guid>
            <dc:creator><![CDATA[Dahunsi Alimot Olajumoke]]></dc:creator>
            <pubDate>Sat, 14 Feb 2026 20:56:14 GMT</pubDate>
            <atom:updated>2026-02-14T20:56:14.890Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Inheritance is a core concept in object-oriented programming (OOP) that allows a contract to reuse, extend, or modify the functionality of another contract. Solidity, being an object-oriented language tailored for smart contracts, supports inheritance as a fundamental feature. Proper use of inheritance improves <strong>code reuse</strong>, <strong>modularity</strong>, <strong>readability</strong>, and <strong>security</strong> — all of which are critical in blockchain development where contracts are immutable once deployed.</p><p>This article explains how inheritance works in Solidity, why it is important in smart contract architecture, how it is implemented, and the common challenges and best practices developers should be aware of.</p><p><strong>Inheritance in Solidity</strong> allows a child contract to acquire the properties of a parent contract, including functions, state variables, modifiers, and events. In Solidity, a contract can inherit from one or more parent contracts, enabling developers to reuse and extend existing logic rather than rewriting code. Inherited members may be used directly as they are, overridden to provide custom behavior, or extended to build upon the parent’s implementation. Unlike many traditional programming languages, Solidity supports multiple inheritance, making it possible to compose complex smart contract systems from smaller, reusable components.</p><h3>Why Inheritance Is Important in Smart Contract Architecture</h3><p>Inheritance plays a critical role in how smart contracts are designed and structured in Solidity. Because smart contracts are immutable once deployed and often handle valuable assets, their architecture must be clean, reusable, and secure. Inheritance helps developers achieve these goals in several important ways.</p><h3>1. Code Reusability</h3><p>In smart contract development, many features are repeatedly needed across different contracts. Examples include access control (such as restricting certain functions to an owner), pausing contract operations, or managing administrative roles. Without inheritance, developers would have to rewrite the same logic in every contract, which is inefficient and error-prone.</p><p>By placing common logic in a base contract and allowing other contracts to inherit from it, the same tested code can be reused across multiple contracts. This reduces code duplication, saves development time, and ensures consistent behavior throughout the system.</p><h3>2. Modularity</h3><p>Inheritance encourages a modular approach to smart contract design. Instead of building one large contract that handles many responsibilities, functionality can be broken down into smaller, focused base contracts. Each base contract is responsible for a single concern, such as ownership management or emergency controls.</p><p>This modular structure makes contracts easier to read and understand, both for developers and auditors. It also simplifies upgrades during development, since individual modules can be improved or replaced without affecting unrelated parts of the system.</p><h3>3. Security</h3><p>Security is especially important in blockchain systems because deployed contracts cannot be easily fixed once live. Inheritance helps improve security by allowing developers to reuse well-tested and audited base contracts rather than writing new logic from scratch.</p><p>When trusted base contracts are reused across projects, the likelihood of introducing new bugs or vulnerabilities is significantly reduced. This approach aligns with industry best practices, where commonly used patterns are reviewed, tested, and relied upon instead of reinvented.</p><h3>4. Maintainability</h3><p>Inheritance improves maintainability by centralizing shared logic in base contracts. During development, if a change is required — such as improving an access control rule or fixing a bug — it can be made in one place rather than across multiple contracts.</p><p>This reduces the risk of inconsistencies and forgotten updates, leading to cleaner code and fewer errors. A well-designed inheritance structure also makes future enhancements easier to implement, as new functionality can be added by extending existing contracts instead of modifying deployed ones.</p><h3>Basic Inheritance Syntax in Solidity</h3><blockquote>contract Parent {</blockquote><blockquote>uint public value;</blockquote><blockquote>function setValue(uint _value) public {</blockquote><blockquote>value = _value;</blockquote><blockquote>}</blockquote><blockquote>}</blockquote><blockquote>contract Child is Parent {</blockquote><blockquote>function getValue() public view returns (uint) {</blockquote><blockquote>return value;</blockquote><blockquote>}</blockquote><blockquote>}</blockquote><h3>Explanation</h3><blockquote>Child inherits from Parent using the is keyword</blockquote><blockquote>Child automatically has access to value and setValue()</blockquote><blockquote>No redeclaration is required</blockquote><h4><strong>The Fundamentals of Inheritance: The ‘is’ Keyword</strong></h4><p>At its simplest, inheritance in Solidity is implemented using the <strong>is</strong> keyword. A derived contract can access all non-private members of its parent, including state variables, functions, and modifiers .</p><p><strong>Consider this basic example:</strong></p><p>// SPDX-License-Identifier: MIT</p><p>pragma solidity ^0.8.28;</p><p>contract Ownable {</p><p>address public owner;</p><p>constructor() {</p><p>owner = msg.sender;</p><p>}</p><p>modifier onlyOwner() {</p><p>require(msg.sender == owner, “Not the owner”);</p><p>_;</p><p>}</p><p>}</p><p>contract MyWallet is Ownable {</p><p>uint256 public balance;</p><p>function withdraw(uint256 _amount) public onlyOwner {</p><p>require(balance &gt;= _amount, “Insufficient funds”);</p><p>balance -= _amount;</p><p>payable(owner).transfer(_amount);</p><p>}</p><p>function deposit() public payable {</p><p>balance += msg.value;</p><p>}</p><p>}</p><p>In this example, MyWallet inherits the owner state variable and the onlyOwner modifier from Ownable . The withdraw function uses the inherited onlyOwner modifier to ensure that only the contract owner — set during the parent’s constructor execution — can call it. This illustrates the most common and practical use of inheritance: reusing battle-tested logic like access control.</p><h4><strong>Advanced Inheritance: Function Overriding and virtual/override</strong></h4><p>While simply inheriting functionality is useful, the true power of inheritance lies in the ability to customize or extend the behavior of inherited functions. Solidity facilitates this through the virtual and override keywords . virtual: A function in a parent contract must be marked as virtual to allow a child contract to change its behavior. override: A function in a child contract that intends to change the behavior of a virtual function from its parent must use the override keyword.</p><p><strong>Here is a practical use case: a base Employee contract and a derived CEO contract:</strong></p><blockquote>// SPDX-License-Identifier: MIT</blockquote><blockquote>pragma solidity ^0.8.28;</blockquote><blockquote>contract Employee {</blockquote><blockquote>uint256 public salary;</blockquote><blockquote>function setSalary() public virtual {</blockquote><blockquote>salary = 100000;</blockquote><blockquote>}</blockquote><blockquote>}</blockquote><blockquote>contract CEO is Employee {</blockquote><blockquote>uint256 public bonus;</blockquote><blockquote>// Overriding the parent’s setSalary function</blockquote><blockquote>function setSalary() public override {</blockquote><blockquote>// Use ‘super’ to call the parent’s implementation and then extend it</blockquote><blockquote>super.setSalary();</blockquote><blockquote>bonus = 25000; // CEO gets a bonus on top of the base salary</blockquote><blockquote>}</blockquote><blockquote>}</blockquote><p>Here, the CEO contract overrides the setSalary function. By using super.setSalary(), it reuses the logic from Employee and then extends it by adding a bonus . This pattern of extending, rather than replacing, functionality is crucial for building complex systems on a solid, reliable foundation.</p><p><strong>Navigating Complexity: Multiple Inheritance and the C3 Linearization</strong></p><p>Solidity supports multiple inheritance, meaning a contract can inherit from several parent contracts . This is powerful but introduces complexity, particularly the “Diamond Problem,” where a contract inherits from two parents that both define the same function. Solidity resolves this using C3 Linearization, which forces a specific order of inheritance to create a unambiguous order for looking up functions and state variables. The rule is simple: list parent contracts in order from the “most base-like” to the “most derived” . The search for a function or property follows a reversed depth-first order, giving priority to contracts listed on the right.</p><p><strong>Consider this example of a governance token that is also pausable:</strong></p><p>// SPDX-License-Identifier: MIT</p><p>pragma solidity ^0.8.28;</p><p>abstract contract Ownable { /* … */ }</p><p>abstract contract Pausable { /* … */ }</p><p>abstract contract ERC20 { /* … */ }</p><p>// The order of inheritance matters.</p><p>// We want our contract to behave like an ERC20 that is Ownable and Pausable.</p><p>contract MyGovernanceToken is ERC20, Ownable, Pausable {</p><p>// … contract implementation …</p><p>}</p><p><strong>Best Practices for Secure and Maintainable Inheritance</strong></p><p>To leverage inheritance effectively and avoid vulnerabilities, developers should follow these best practices:</p><p><strong>1. Favor Composition over Deep Inheritance Trees</strong></p><p>While multiple inheritance is supported, overly complex hierarchies can become difficult to audit and maintain. Deep inheritance trees can obscure the flow of logic, making it hard to determine which implementation of a function is actually being called. For complex functionalities, consider using libraries or composing smaller, focused contracts.</p><p><strong>2. Use Standard, Audited Libraries like OpenZeppelin</strong></p><p>One of the greatest strengths of the Solidity ecosystem is OpenZeppelin, a library of secure, community-vetted smart contract building blocks [citation:7]. Instead of writing your own access control or token logic, inherit from OpenZeppelin’s contracts (e.g., `Ownable`, `ERC20`, `Pausable`). This significantly reduces the risk of introducing common vulnerabilities.</p><p><strong>3. Be Explicit with Overrides</strong></p><p>When overriding functions, always use the `override` keyword. If inheriting from multiple contracts with the same function, you must explicitly specify all parent contracts in the `override` specifier, like `override(ContractA, ContractB)` [citation:6]. This makes your intention clear to the compiler, auditors, and other developers.</p><p><strong>4. Understand Inheritance Order for Constructors</strong></p><p>If your parent contracts have constructors with parameters, you need to provide arguments for them when creating the child contract. Solidity offers two ways to do this, either directly in the inheritance list or within the child’s constructor:</p><blockquote>```solidity</blockquote><blockquote>contract Base {</blockquote><blockquote>uint256 public x;</blockquote><blockquote>constructor(uint256 _x) {</blockquote><blockquote>x = _x;</blockquote><blockquote>}</blockquote><blockquote>}</blockquote><blockquote>// Method 1: Pass arguments directly in the inheritance list</blockquote><blockquote>contract Child1 is Base(5) { }</blockquote><blockquote>// Method 2: Use a modifier-style call in the child’s constructor</blockquote><blockquote>contract Child2 is Base {</blockquote><blockquote>constructor(uint256 _y) Base(_y * 2) { }</blockquote><blockquote>}</blockquote><blockquote>```</blockquote><p><strong>5. Mind the Inheritance Order to Prevent Shadowing</strong></p><p>Incorrect inheritance order can lead to unintentional variable shadowing or unexpected function calls. Always list base contracts in a logical order and rely on the compiler’s C3 linearization to ensure the intended behavior.</p><h3>Conclusion</h3><p>Inheritance is a fundamental feature of Solidity that,ll enables developers to build upon existing code, creating sophisticated and secure decentralized applications. From simple access control with Ownable to complex governance tokens with multiple parents, understanding how to use the is keyword, virtual and override functions, and manage multiple inheritance is essential for any serious blockchain developer .</p><p>By adhering to best practices — such as using audited libraries like OpenZeppelin, keeping hierarchies simple, and being explicit with overrides — you can harness the full power of inheritance to write clean, modular, and, most importantly, secure smart contracts . As you design your next dApp, think of inheritance not just as a code-reuse tool, but as a way to build a robust and logical architecture for the immutable world of the blockchain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fac083842dfc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Standardizing Safety: How EIP-8042 Solves the Ethereum Storage Dilemma]]></title>
            <link>https://medium.com/@dahunsiolajumoke18/standardizing-safety-how-eip-8042-solves-the-ethereum-storage-dilemma-d85e9636982a?source=rss-04388dce16ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/d85e9636982a</guid>
            <dc:creator><![CDATA[Dahunsi Alimot Olajumoke]]></dc:creator>
            <pubDate>Fri, 06 Feb 2026 02:02:32 GMT</pubDate>
            <atom:updated>2026-02-06T10:23:35.410Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Standardizing Safety: How EIP-8042 Solves the Ethereum Storage Dilemma</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Geix0hkO7CdPCXwjsT-TjQ.jpeg" /></figure><p><strong>What exactly is ERC-8042?</strong></p><p><a href="https://eips.ethereum.org/EIPS/eip-8042">EIP-8042</a> is a standard that formalizes how smart contracts should organize their internal data to prevent “Storage Collisions.” It is a lightweight, human-readable alternative to the more complex <a href="https://eips.ethereum.org/EIPS/eip-7201">EIP-7201</a> (Namespaced Storage).</p><p><a href="https://eips.ethereum.org/EIPS/eip-8042"><strong>EIP-8042</strong></a> formalizes a streamlined approach to <a href="https://docs.soliditylang.org/en/latest/introduction-to-smart-contracts.html">smart contract </a>memory by mandating that identifiers contain only <a href="https://www.ascii-code.com/characters/printable-characters"><strong>printable ASCII characters</strong>,</a> a constraint best enforced by using <a href="https://www.tutorialspoint.com/solidity/solidity_strings.htm"><strong>Solidity’s string literals</strong></a>. By recommending the use of <strong>human-readable, meaningful strings</strong> — rather than abstract numbers — the standard ensures that storage locations are both descriptive and self-documenting. Technically, EIP-8042 simplifies the developer experience by generating storage locations through a direct and transparent formula: a simple <a href="https://www.cyfrin.io/glossary/hashing-with-keccak256-solidity-code-example"><strong>keccak256 hash of the string literal</strong></a>. This combination of strict character constraints and direct computation makes the standard highly accessible for developers and easily interpretable by external auditing tools.</p><h4>The Evolution of EIP-8042</h4><ul><li><strong>2020: The “Diamond” Origin</strong> Solidity introduced the ability to point structs to custom storage slots. This birthed <a href="http://medium.com/r?url=https%3A%2F%2Fdev.to%2Fmudgen%2Fhow-diamond-storage-works-90e"><strong>Diamond Storage</strong></a>, allowing developers to bypass sequential slots and use hashed identifiers instead. This made complex, modular contracts much safer.</li><li><strong>2023: </strong><a href="https://eips.ethereum.org/EIPS/eip-7201"><strong>The Standard Conflict</strong> <strong>ERC-7201</strong></a> was introduced to standardize namespaced storage. However, its complex hashing formula was incompatible with the thousands of “Diamond” projects already in production.</li><li><strong>2025–2026: EIP-8042 Finalized</strong> <strong>EIP-8042</strong> was proposed to solve this friction. It officially standardizes the original, simpler “Diamond Storage” pattern, making it a peer to ERC-7201 rather than a competitor.</li></ul><h4>The Core Mechanism of EIP-8042</h4><p>Though originally created for proxy contracts, diamond storage can be used to organize storage and data access within <em>any</em> smart contract.</p><p><a href="https://dev.to/mudgen/how-diamond-storage-works-90e">Diamond storage </a>defines the location of structs in contract storage using the keccak256 hash of human-readable identifiers.</p><p><a href="https://eips.ethereum.org/EIPS/eip-8042">ERC-8042</a> standardizes this simple and production-proven approach, offering a lightweight alternative to <a href="https://eips.ethereum.org/EIPS/eip-7201">ERC-7201 </a>for new and existing projects.</p><p>In traditional Solidity, variables are stored in sequential slots (Slot 0, Slot 1, etc.). This is dangerous for upgradable contracts because adding a new variable can “shift” the old ones, leading to data corruption.</p><p>EIP-8042 solves this using Hashed Identifiers:</p><ol><li>The developer picks a unique, meaningful ASCII string (e.g., “com.myproject.token.storage”).</li><li>The contract calculates the storage location by taking the Keccak-256 hash of that string.</li><li>This hash acts as a pointer to a massive, random-looking slot in Ethereum’s storage, far away from the “dangerous” sequential slots.</li></ol><h4>The Standard’s “Golden Rules”</h4><p>To be compliant with EIP-8042, a contract must follow these specific requirements:</p><ul><li><strong>ASCII Only:</strong> The identifier must only use printable ASCII characters (0x20 to 0x7E). No emojis, no hex escapes, and no invisible characters. This ensures the identifier is human-readable and predictable.</li><li><strong>The NatSpec Tag:</strong> Developers must mark their storage structs with a specific documentation tag: /// @custom:storage-location erc8042:&lt;your.identifier&gt; This is crucial because it tells block explorers (like Etherscan) and security tools exactly where to look for your data.</li><li><strong>No Unicode Literals:</strong> Using unicode”…” is strictly forbidden to prevent subtle bugs where two different-looking identifiers result in the same hash.</li></ul><h4>Why EIP-8042 is the 2026 Standard</h4><p>Developers choose EIP-8042 for three key reasons:</p><ol><li><strong>Simplicity:</strong> Uses a direct keccak256 hash of a human-readable string.</li><li><strong>Safety:</strong> Mandates strict <strong>ASCII-only</strong> identifiers to prevent hidden character bugs.</li><li><strong>Tooling:</strong> Standardizes the @custom:storage-location erc8042 tag, allowing block explorers and auditors to automatically map contract data.</li></ol><blockquote><strong>Bottom Line:</strong> ERC-8042 validates the past and secures the future. It ensures that as our smart contracts get bigger, our data remains organized and collision-free.</blockquote><h4>CHALLENGES OF ERC 8042</h4><p>While <strong>ERC-8042</strong> is a significant upgrade for security and organization in 2026, it isn’t a “magic bullet.” Implementing it requires a specific level of developer discipline and comes with its own set of technical hurdles.</p><p>Here are the primary challenges developers and protocols face when adopting ERC-8042:</p><h4>1. Gas Overhead for Initialization</h4><p>Accessing a hashed storage slot is slightly more expensive in terms of gas than accessing traditional sequential slots.</p><ul><li><strong>The Reason:</strong> To access the data, the contract must perform a keccak256 hash and an assembly sstore/sload operation every time it interacts with that storage &quot;drawer.&quot;</li><li><strong>The Impact:</strong> While negligible for a single transaction, high-frequency DeFi protocols may see a slight increase in gas costs compared to highly optimized, non-upgradable contracts.</li></ul><h4>2. Increased Code Complexity</h4><p>ERC-8042 moves away from Solidity’s default behavior.</p><ul><li><strong>Manual Management:</strong> Developers can no longer simply declare uint256 public balance; at the top of their contract. They must wrap variables in a struct, create a library to manage the storage pointer, and use inline assembly to access it.</li><li><strong>Higher Barrier to Entry:</strong> Junior developers may find the “Library + Assembly” pattern harder to read and maintain than standard variable declarations.</li></ul><h4>3. The “Silent” Identifier Risk</h4><p>Because ERC-8042 relies on string literals, a simple typo can be catastrophic.</p><ul><li><strong>Example:</strong> If one part of your system looks for &quot;com.protocol.vault&quot; and another part accidentally looks for &quot;com.proctocol.vault&quot; (spot the typo), the code will deploy perfectly but will be looking at two completely different, empty storage slots.</li><li><strong>Challenge:</strong> Unlike traditional Solidity, where the compiler catches variable name errors, a typo in an ERC-8042 string literal won’t be flagged as an error during compilation.</li></ul><h4>4. Migration Complexity for Legacy Projects</h4><p>If a project was built <em>before</em> 2026 using standard sequential storage, moving to ERC-8042 is difficult.</p><ul><li><strong>State Migration:</strong> You cannot simply “change” the code; you have to physically move the data from Slot 0 to the new Hashed Slot. This requires complex migration scripts and carries the risk of losing or corrupting user data during the transition.</li></ul><h4>Conclusion: Building a Stable Foundation for the Future</h4><p>As Ethereum matures in 2026, the shift from “experimental” to “standardized” architecture has never been more critical. We’ve moved past the era of trial-and-error storage; today, security is defined by predictability.</p><p>ERC-8042 is more than just a technical update — it is a commitment to a safer, more transparent “World Computer.” By standardizing Diamond Storage, this EIP provides three essential pillars for the modern developer:</p><ul><li>Legacy Protection: It honors the early pioneers of the Diamond Standard by validating their architecture.</li><li>Future-Proofing: It gives new projects a collision-proof blueprint that scales with complexity.</li><li>Global Visibility: It empowers the tools we use every day to finally “see” and verify the data that powers our decentralized world.</li></ul><blockquote>Whether you are a veteran developer or a curious novice, understanding these standards is how we bridge the gap between “code that works” and “code that lasts.” The EIP process reminds us that Ethereum isn’t just a collection of software; it’s a living, breathing consensus — one proposal at a time.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d85e9636982a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Inside the World Computer: A Deep Dive into Ethereum’s Core Mechanics]]></title>
            <link>https://medium.com/@dahunsiolajumoke18/inside-the-world-computer-a-deep-dive-into-ethereums-core-mechanics-c2d648c7def8?source=rss-04388dce16ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2d648c7def8</guid>
            <dc:creator><![CDATA[Dahunsi Alimot Olajumoke]]></dc:creator>
            <pubDate>Thu, 05 Feb 2026 05:35:42 GMT</pubDate>
            <atom:updated>2026-02-05T11:03:11.744Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Inside the World Computer: A Deep Dive into Ethereum’s Core Mechanics</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*cz3QySwL07RxN8Wg2wtvrA.jpeg" /></figure><p><strong>Have you ever wondered what the Ethereum blockchain is all about, or are you still a novice about it just like I was a few weeks ago?</strong> I used to think Ethereum was just another cryptocurrency, but I quickly discovered it’s actually a massive “World Computer.” It’s a decentralized engine running apps and contracts that no single person or government can turn off.</p><p>In this article, I’m going to break down the “engine room” of Ethereum in the simplest way possible. We’ll look at the <strong>EVM</strong> (the brain), <strong>Accounts</strong> (the players), <strong>Transactions</strong> (the actions), <strong>Gas</strong> (the fuel), and <strong>Blocks</strong> (the history). By the end of this post, you won’t just know <em>what</em> Ethereum is — you’ll understand exactly <em>how</em> it works.</p><p>Let’s dive in.</p><p><strong>Introduction to Ethereum</strong></p><p>The Ethereum blockchain is a fascinating platform that uses innovative smart contract capability to empower decentralized applications in almost all major business sectors. Pioneered by Vitalik Buterin and several cofounders, Ethereum has gone through the milestones of initial launch, stable coins, ICO (Initial Coin Offering), DeFi (Decentralized Finance), DAO (Decentralized Autonomous Organization), NFT (nonfungible tokens), and L2 (Layer 2) for scalability. The Ethereum blockchain and infrastructure are transitioning to POS (proof of stake) with sharding and are on the way to impose big impacts on CBDC (Central Bank Digital Currency) and enterprise blockchains with promising potential.</p><h4>The EVM: The Brain of the Network</h4><figure><img alt="The EVM" src="https://cdn-images-1.medium.com/max/1024/1*zGPIWn5LPdGDffAL-fDgKw.png" /></figure><p>Ethereum, or ‘the world computer’ as it is often called by the supporting community, is a deterministic but practically unbounded state machine, consisting of a global singleton state and a <a href="https://en.wikipedia.org/wiki/Virtual_machine">virtual machine</a> that applies changes to that state.</p><p>The EVM isn’t a physical machine you can touch. It is a single, massive computer that exists simultaneously on thousands of computers (<a href="https://masteringethereum.xyz/chapter_3.html">nodes</a>) across the globe. When you deploy a smart contract, you aren’t uploading it to a server in Silicon Valley; you are uploading it to the EVM.</p><p>Because every node runs the EVM, they all see the same code and reach the same conclusion. This ensures that the “state” of the network — who owns what and what the code says — is identical for everyone, everywhere.</p><h4><strong>How the EVM Works :The “Bookmark” System</strong></h4><p>Inside the EVM, code is processed in small, simple steps called Opcodes. Think of a smart contract as a recipe:</p><ul><li>Step 1: Check the sender’s balance.</li><li>Step 2: Add 10 tokens to the recipient.</li><li>Step 3: Subtract 10 tokens from the sender.</li></ul><p>The EVM uses a <a href="https://www.geeksforgeeks.org/operating-systems/what-is-program-counter/">Program Counter (PC)</a> —essentially a digital bookmark — to keep track of which step it is currently executing. It moves through the instructions one by one until the task is finished or it runs out of “fuel” (Gas).</p><p>One of the most important “human” features of the EVM is that it is sandboxed. This means the code running inside the EVM has no access to the rest of the computer it’s sitting on. And, The EVM is <strong>deterministic</strong>, meaning that if you give it the same input, it will <em>always</em> produce the exact same output. This is why you can trust it. There are no “glitches” or “opinions” — there is only the math of the code.</p><blockquote><strong>The Analogy:</strong> Imagine a giant, invisible calculator in the sky. Anyone can pay a small fee to press the buttons. Once the buttons are pressed, the result is broadcast to the whole world, and no one — not even a government or a hacker — can erase the answer. <strong>That is the EVM.</strong></blockquote><h4><strong>Accounts: Who is Participating?</strong></h4><p>An Ethereum account is an entity with an ether (ETH) balance that can send transactions on the chain. These <a href="https://ethereum.org/en/developers/docs/accounts/#top/">accounts</a> are either user-controlled (human) or deployed as smart contracts (code-dependent). Transactions, which change the state of the <a href="https://ethereum.org/en/developers/docs/evm/#top/">Ethereum Virtual Machine</a> (EVM), need to be broadcast to the network. Any node can broadcast a request for a transaction to be executed on the EVM. After this happens, a block producer will execute the transaction and propagate the resulting state change to the rest of the Ethereum network. Transactions require a <a href="https://info.etherscan.com/what-is-gas-fee/">fee</a> and must be mined to become valid.</p><p><strong>Two different types of Ethereum accounts exist.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-GPq7yL7OhRVw-WI5rHzdA.png" /><figcaption><em>Diagram adapted from </em><a href="https://takenobu-hs.github.io/downloads/ethereum_evm_illustrated.pdf"><em>Ethereum EVM illustrated</em></a></figcaption></figure><p>The first is called an externally owned account (EOA). The second is called a contract account. <a href="https://ethereum.org/en/developers/docs/accounts/#externally-owned-accounts-and-key-pairs/">Externally owned accounts</a> are controlled by anyone with the private keys. Contract accounts are smart contracts deployed to the network and controlled by code. Both types are identified by an Ethereum address. In terms of capabilities, the two account types can:</p><p>1. Receive, hold, and send ETH and tokens</p><p>2. Interact with smart contracts on the chain</p><p><strong>What are the differences between the account types?</strong></p><p>(1) Externally owned accounts (EOA):<br>· Creating an EOA costs nothing<br>· An EOA can initiate transactions<br>· Transactions between externally-owned accounts can only be ETH transfers</p><p>(2) Contract accounts (smart contracts):<br>· Creating a contract has a cost because you are using network storage<br>· A contract account can only send transactions in response to receiving a transaction<br>· Transactions from an external account to a contract account can trigger code, which can execute many different actions — such as transferring tokens or even creating a new contract</p><h4><strong>Transactions: The Message System</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vLXkhuIoRJHm3CF_ZHifmA.png" /></figure><p>An Ethereum transaction refers to an action initiated by an <a href="https://www.alchemy.com/docs/ethereum-accounts">EOA (externally-owned account)</a>, in other words an account managed by a human, not a contract.</p><p>For example, if Bob sends Alice 1 ETH, Bob’s account must be debited and Alice’s must be deducted. This state-changing action takes place within a transaction.</p><h3>Stack of Transactions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*k2EdJGNIu1EV7vY92G9zPA.png" /></figure><h4>The Anatomy of a Transaction</h4><p>Every transaction is a “digital envelope” containing specific pieces of information. If any of these are missing or wrong, the EVM will reject it.</p><ul><li><strong>From:</strong> The address of the person (or contract) sending the request.</li><li><strong>To:</strong> The recipient. This can be a friend’s wallet or a smart contract (like a DEX or a game).</li><li><strong>Value:</strong> The amount of ETH being sent (measured in <em>Wei</em> — the smallest unit of ETH).</li><li><strong>Data (Payload):</strong> This is the most powerful part. If you’re swapping tokens or minting an NFT, the “Data” field contains the specific instructions for the smart contract.</li><li><strong>Nonce:</strong> A counter that prevents “replay attacks.” If you send two transactions, the first is #1 and the second is #2. The network won’t process #2 until #1 is finished.</li><li><strong>Signature:</strong> Your digital “stamp of approval,” created using your private key.</li></ul><h4><strong>GAS</strong></h4><p>In the Ethereum ecosystem, <a href="https://www.investopedia.com/terms/g/gas-ethereum.asp#toc-what-is-gas-ethereum"><strong>Gas</strong> </a>is the unit of measurement for the computational effort required to execute specific operations on the network. Since every transaction — from a simple send to a complex smart contract — requires resources from the network’s validators, Gas is the way we “meter” and pay for that work.</p><blockquote>Gas fees on the Ethereum blockchain are essential for conducting transactions and executing contracts. Priced in gwei, smaller fractions of Ethereum’s cryptocurrency, ETH, these fees compensate validators for the resources expended during transaction processing. The price of gas fluctuates based on supply, demand, and network capacity, making it a competitive and dynamic component of Ethereum’s operation.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gaQyxs83hF9C6abo2OwPnw.png" /><figcaption><em>Diagram adapted from </em><a href="https://takenobu-hs.github.io/downloads/ethereum_evm_illustrated.pdf"><em>Ethereum EVM illustrated</em></a></figcaption></figure><h3>Why does Gas exist?</h3><p>If Ethereum were free, anyone could write a piece of code that runs forever (an “infinite loop”), which would jam the “World Computer” and crash the entire network.</p><ul><li><strong>Spam Prevention:</strong> By making every action cost something, it becomes too expensive for hackers to spam the network.</li><li><strong>Efficiency:</strong> It encourages developers to write clean, efficient code. The “messier” the code, the more Gas it consumes, and the more the developer (or user) has to pay.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qTc7sik-QSYmr8E6M_ptaA.png" /><figcaption><em>Diagram adapted from </em><a href="https://takenobu-hs.github.io/downloads/ethereum_evm_illustrated.pdf"><em>Ethereum EVM illustrated</em></a></figcaption></figure><h4>BLOCKS</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*Mi_CyBxo8g6ANQ6faHa-VA.png" /><figcaption>Each Block Contains The Address of The Previous Block</figcaption></figure><p>To ensure that all participants on the Ethereum network maintain a synchronized state and agree on the precise history of transactions, we batch transactions into blocks. This means dozens (or hundreds) of transactions are committed, agreed on, and synchronized all at once.</p><p>To preserve the transaction history, blocks are strictly ordered (every new block created contains a reference to its parent block), and transactions within blocks are strictly ordered as well. Except in rare cases, at any given time, all participants on the network are in agreement on the exact number and history of blocks, and are working to batch the current live transaction requests into the next block.</p><p>Once a block is put together by a randomly selected validator on the network, it is propagated to the rest of the network; all nodes add this block to the end of their blockchain, and a new validator is selected to create the next block. The exact block-assembly process and commitment/consensus process is currently specified by Ethereum’s “<a href="https://ethereum.org/developers/docs/consensus-mechanisms/pos/">proof-of-stake</a>” protocol.</p><h4>The Conclusion: Connecting the Dots</h4><p>Understanding Ethereum can feel like trying to learn a new language, but once you see how these pieces fit together, the “World Computer” finally makes sense. We’ve seen how <strong>Accounts</strong> initiate the action, how <strong>Transactions</strong> carry the data, and how <strong>Gas</strong> keeps the network secure from spam. At the center of it all is the <strong>EVM</strong>, the tireless brain processing every line of code before it is carved permanently into a <strong>Block</strong>.</p><p>Ethereum is much more than just a platform for digital currency; it is a foundation for a new, decentralized internet. Whether you are looking to build the next big app or simply want to navigate the space safely, understanding these core pillars is your first step toward mastery.</p><p>A few weeks ago, I was just as lost as anyone. Today, I see the blueprint of a digital revolution. How about you?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2d648c7def8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ethereum’s Evolution: How Major Upgrades Are Shaping the Future of the Network.]]></title>
            <link>https://medium.com/@dahunsiolajumoke18/ethereums-evolution-how-major-upgrades-are-shaping-the-future-of-the-network-fb8e3a112926?source=rss-04388dce16ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb8e3a112926</guid>
            <dc:creator><![CDATA[Dahunsi Alimot Olajumoke]]></dc:creator>
            <pubDate>Wed, 04 Feb 2026 11:46:00 GMT</pubDate>
            <atom:updated>2026-02-04T11:56:43.896Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Ethereum’s Evolution: How Major Upgrades Are Shaping the Future of the Network.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*6TS_AckyAW55_joavnw0qA.png" /></figure><p><strong>Introduction</strong></p><p>Since Ethereum was launched in 2015, it has grown into one of the most impactful blockchain platforms in the world, powering the rapid expansion of decentralized applications. As more users joined the network and new challenges emerged, Ethereum needed regular improvements to keep up with demand. This led to a series of major upgrades designed to improve performance, security, and scalability. Beyond the technical changes, these upgrades reflect the combined efforts of the global Ethereum community to continuously move the network forward.</p><p>In this article, we explore why Ethereum undergoes upgrades, how they are named, how often they occur, and how they have evolved over time, while highlighting key upgrades that have shaped Ethereum in recent years.</p><h3>Why Does Ethereum Need Upgrades?</h3><p>As blockchain technology continues to evolve and its use cases become more advanced, Ethereum requires regular upgrades to address challenges across multiple areas:</p><ul><li>Scalability: As more users and applications join the Ethereum network, transaction demands increase. Upgrades aim to enhance the network’s capacity to process large volumes of transactions effectively.</li><li>Security: With the growing number of network threats, upgrades are critical to strengthening Ethereum’s defenses against potential attacks.</li><li>Efficiency: Improvements help reduce transaction costs (gas fees) and increase transaction speed, making the platform more user-friendly and attractive for both developers and users.</li></ul><p>During each phase, Ethereum laid the foundations of its mission to becoming a decentralized, global financial operating system.</p><p><strong>1.ICO Boom: Ethereum Becomes the Launchpad (2017)</strong></p><p>Ethereum’s first encounter with scale came in 2017, and it came fast. The ERC-20 standard turned Ethereum into the world’s easiest token launchpad-allowing startups to raise capital directly from the crowd through Initial Coin Offerings (ICOs). Nine out of the ten largest projects that year chose Ethereum, collectively raising $603M, primarily in ETH.</p><p>More than just a fundraising frenzy, the ICO boom was Ethereum’s first crypto product-market fit moment. Even failed ICOs revealed user preferences, tooling gaps, and latent demand. The frenzy seeded the platforms, frameworks, and developer muscle that would later give rise to more durable categories-like DeFi, NFTs, and tokenized assets.</p><p>In hindsight, the ICO cycle was a pivotal calibration event. It showed Ethereum could host global capital formation at scale, and established it as the de facto sandbox for crypto innovation.</p><p><strong>2. DeFi Renaissance: A Parallel Finance System (2020)</strong></p><p>After a bruising bear market from 2018–2020, Ethereum didn’t just recover-it matured. DeFi Summer marked the protocol’s second discovery of product-market fit. But unlike ICOs, where the focus was speculation, DeFi was different; The focus was real utility. Protocols like Uniswap, Aave, Compound, and Curve redefined capital markets from the ground up, enabling users to swap, lend, borrow, and earn yield-all without an intermediary.</p><p>The impact was immediate: DeFi overtook ERC-20s as the dominant transaction category on-chain. Token-denominated TVL, active addresses, DEX volumes, and gas spent turned Ethereum into a real-time dashboard of decentralized finance.</p><p><strong>3. The Flippening That Wasn’t (2021–2025)</strong></p><p>In 2021, Ethereum nearly flipped Bitcoin. The ETH/BTC ratio surged from ~5% to 83% in six months, marking the high point of a narrative cycle that cast Ethereum as the successor to Bitcoin-leading in users, fees, and developer activity. For a moment, it felt inevitable: Ethereum would overtake it in functionality and value.</p><p>The Flippening benchmarked Ethereum against Bitcoin. But the comparison was flawed.</p><p><strong>4.The Burn Upgrade: A New Economic Engine (2021)</strong></p><p>One challenge Ethereum faced as an investment was “why does it have value?” The protocol addressed this head-on in an upgrade called the London Hard Fork, or EIP-1559. EIP-1559 aligned network activity and protocol value via the introduction of base fee burns. A base fee, denominated in ETH, is the minimum fee part of every transaction made by a user. These get burned and taken out of circulating supply forever. ETH supply, therefore, became dynamically tied to usage-turning transaction demand into a disinflationary, and at times, deflationary force. The protocol was no longer just rewarding validators through inflating the circulating supply; it was in effect generating buyback pressure of its own token through burn mechanics.</p><p>The results were immediate and structural:</p><ul><li>Annual ETH inflation rate dropped to -0.34% since the upgrade.</li><li>Post-Merge issuance moderated to +0.12% annualised, from 4% in its Proof of Work days.</li></ul><p><strong>5. The Merge: Economic Security Reimagined (2022)</strong></p><p>Ethereum’s switch from Proof of Work to Proof of Stake was seven years in the making; it was even discussed and developed prior to Ethereum’s launch due to environmental concerns with Proof of Work.</p><p>Changing the consensus protocol of a blockchain is hard. It is akin to swapping out the engine of an airplane in midflight. The process formally began in October 2020 with the deployment of the staking deposit contract and culminated on September 15, 2022, when the experimental staking chain (called the “Beacon Chain”) merged with Ethereum’s execution layer. From that moment, Ethereum retired its miners and fully embraced staking as its transaction processing and security mechanism.</p><p><strong>6. L2 Era Begins: The Rollup Pivot (2021–2023)</strong></p><p>Ethereum’s rollup-centric roadmap delivered scale. It prevented Ethereum from losing ground entirely to newer chains like Solana and Hyperliquid. It kept users in the ecosystem-even if not directly on the mainnet.</p><p>Coinbase’s L2, Base, launched in 2023, which validated Vitalik’s “Endgame” post. It quickly became the most active and largest rollup by TVL, trading volume, fees, and daily users. It also brought institutional credibility to Ethereum’s L2 roadmap by putting a Nasdaq-listed name on-chain.</p><p>The transition to Layer-2s fragmented the ecosystem across liquidity pools, tech stacks, and user experiences. Too many rollups, too little cohesion. Capital rotated out of Layer-1, R&amp;D efforts splintered, and UX friction increased.</p><p><strong>7. Fusaka &amp; Glamsterdam (2025–2026)</strong></p><p>In this Fusaka &amp; Glamsterdam era, the technology is becoming invisible. You don’t “use a rollup”; you just use an app, and it happens to be fast and cheap. It’s becoming professional. It’s no longer just for “crypto people.” With the 2024/2025 ETF approvals and these upgrades, Ethereum is now the “back-end” for global finance.</p><p>In short: If the Rollup Pivot was the Blueprint, Fusaka and Glamsterdam are the Pavement and the Lights. The road is finally open.</p><h3>Conclusion</h3><p>Through continuous upgrades, Ethereum solidifies its leading position in the blockchain space, creating a more efficient, secure, and sustainable network environment for users and developers worldwide. These upgrades not only address current technological bottlenecks but also lay a solid foundation for future innovation. For market participants, understanding the background and significance of these upgrades provides a more comprehensive view of Ethereum’s operational mechanism and growth potential.</p><p>As Ethereum continues to move toward scalability and user experience optimization, we have every reason to look forward to future upgrades that will bring even more possibilities to the ecosystem, ensuring Ethereum maintains its momentum and core value in the blockchain world.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb8e3a112926" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>