<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ajaye Favour</title>
    <description>The latest articles on DEV Community by Ajaye Favour (@tehilafavourite).</description>
    <link>https://dev.to/tehilafavourite</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1106242%2F12733bfa-3c73-40a8-97b4-7846564468c0.jpeg</url>
      <title>DEV Community: Ajaye Favour</title>
      <link>https://dev.to/tehilafavourite</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tehilafavourite"/>
    <language>en</language>
    <item>
      <title>Rust Learning Log: Glob Imports, Library Crates, Multiple Binaries</title>
      <dc:creator>Ajaye Favour</dc:creator>
      <pubDate>Tue, 03 Mar 2026 10:49:56 +0000</pubDate>
      <link>https://dev.to/tehilafavourite/rust-learning-log-glob-imports-library-crates-multiple-binaries-2mbl</link>
      <guid>https://dev.to/tehilafavourite/rust-learning-log-glob-imports-library-crates-multiple-binaries-2mbl</guid>
      <description>&lt;p&gt;Today I learned about the glob operator, creating a library crate, and multiple binary crates&lt;/p&gt;

&lt;p&gt;The Glob Operator:&lt;/p&gt;

&lt;p&gt;The glob operator (*) lets you import everything from a module at once.&lt;/p&gt;

&lt;p&gt;At first, it felt strong. Almost too powerful.&lt;/p&gt;

&lt;p&gt;Up until now, Rust has been teaching me to be explicit, to name exactly what I'm bringing into scope. The glob operator relaxes that slightly.&lt;/p&gt;

&lt;p&gt;That contrast made me think. Rust gives you convenience, but it also gives you responsibility.&lt;/p&gt;

&lt;p&gt;Even as a learner, I can see how using a glob import might make code shorter but potentially less clear. It made me more aware of how imports shape readability.&lt;/p&gt;

&lt;p&gt;Creating a Library Crate:&lt;br&gt;
Learning how to create a library crate changed how I view Rust projects.&lt;br&gt;
Before this, everything I built felt like "a program." Now I see that Rust encourages you to build reusable logic, code meant to be consumed by other parts of the project or even other projects.&lt;/p&gt;

&lt;p&gt;A library crate feels like saying: this code is meant to be depended on.&lt;/p&gt;

&lt;p&gt;That shift in perspective, from writing code for execution to writing code for reuse, feels like a major step in maturity.&lt;/p&gt;

&lt;p&gt;Multiple Binary Crates:&lt;br&gt;
This one surprised me. A single project can have multiple binary crates, meaning multiple entry points.&lt;/p&gt;

&lt;p&gt;That made me realize Rust doesn't assume your project is a single purpose tool. You can structure a project to serve different commands, roles, or execution flows while sharing the same core logic.&lt;/p&gt;

&lt;p&gt;It made everything I've learned about modules and visibility suddenly make more sense. Structure supports scale.&lt;/p&gt;

&lt;p&gt;Some languages can have multiple main packages in a project, but they need to be in separate directories. Rust's approach with multiple binaries in the same workspace feels similar but more integrated.&lt;/p&gt;

&lt;p&gt;At this point, I'm starting to see Rust in layers.&lt;/p&gt;

&lt;p&gt;Ownership taught me about memory discipline. Enums taught me about modeling uncertainty. Modules taught me about structure. Visibility taught me about boundaries.&lt;/p&gt;

&lt;p&gt;Crates and binaries are teaching me about architecture.&lt;/p&gt;

&lt;p&gt;Rust doesn't just teach me how to code. It teaches me how to design systems.&lt;/p&gt;

&lt;p&gt;I'm still learning and still early, I will get a clearer picture soon.&lt;/p&gt;

&lt;p&gt;When you're building projects, do you start thinking about reusability and architecture upfront, or do you refactor toward it once things get complex?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
// Using the glob operator (imports everything)
use std::collections::*;

fn example_glob() {
    let mut map = HashMap::new();
    map.insert("key", "value");
}

// Library crate structure
// src/lib.rs
pub fn greet(name: &amp;amp;str) -&amp;gt; String {
    format!("Hello, {}", name)
}

pub fn farewell(name: &amp;amp;str) -&amp;gt; String {
    format!("Goodbye, {}", name)
}

// Binary crate that uses the library
// src/main.rs
use my_library::greet;

fn main() {
    println!("{}", greet("Rust"));
}

// Additional binary crate
// src/bin/other_tool.rs
fn main() {
    println!("This is a separate binary in the same project");
}

// Documentation comment with examples
/// Adds two numbers together.
/// 
/// # Examples
/// 
/// ```


/// let sum = my_library::add(2, 3);
/// assert_eq!(sum, 5);
///

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;pub fn add(a: i32, b: i32) -&amp;gt; i32 {&lt;br&gt;
    a + b&lt;br&gt;
}&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


#Rust #RustLang #LearningRust #Programming #SoftwareEngineering #SoftwareArchitecture #CodeOrganization #LibraryDesign #Documentation #Blockchain #Solidity #SystemsDesign #CleanCode 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>beginners</category>
      <category>devjournal</category>
      <category>learning</category>
      <category>rust</category>
    </item>
    <item>
      <title>Preventing Denial of Service Attacks in Smart Contracts: Implementing the Withdrawal Pattern</title>
      <dc:creator>Ajaye Favour</dc:creator>
      <pubDate>Tue, 25 Mar 2025 08:47:17 +0000</pubDate>
      <link>https://dev.to/tehilafavourite/preventing-denial-of-service-attacks-in-smart-contracts-implementing-the-withdrawal-pattern-2hjk</link>
      <guid>https://dev.to/tehilafavourite/preventing-denial-of-service-attacks-in-smart-contracts-implementing-the-withdrawal-pattern-2hjk</guid>
      <description>&lt;h2&gt;
  
  
  The Pull-Based Withdrawal Pattern: A Defense Against Smart Contract DoS Attacks
&lt;/h2&gt;

&lt;p&gt;There is a hidden danger that can shut down a smart contract.&lt;/p&gt;

&lt;p&gt;Picture yourself trying to withdraw money from your bank, but nothing happens every time you press the button. The bank isn’t out of money—it just refuses to process your transaction. Now imagine this happening to &lt;strong&gt;thousands of people at the same time.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is what a &lt;strong&gt;denial-of-service (DoS)&lt;/strong&gt; attack looks like in the blockchain world. Instead of hacking the system, attackers &lt;strong&gt;exploit weaknesses in the code to block&lt;/strong&gt; others from using a smart contract. The contract is still there, but it’s as good as useless for many users.&lt;/p&gt;

&lt;p&gt;In simple terms, a DoS attack is like &lt;strong&gt;blocking the only exit in a building—people&lt;/strong&gt; are stuck inside, even though the door is right there.&lt;/p&gt;

&lt;p&gt;These attacks can freeze funds, disrupt entire projects, and cause massive losses.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Can Withdrawals Be Blocked in Smart Contracts?
&lt;/h2&gt;

&lt;p&gt;Today, we will discuss how users can get stuck in smart contracts and the hidden danger of withdrawals.&lt;/p&gt;

&lt;p&gt;If you find yourself in a situation where the vending machine that gives out snacks was jammed by someone intentionally and the machine can no longer give anyone a snack, what would you do? That’s exactly what happens with withdrawal functions in smart contracts—they can be jammed or blocked, stopping people from getting their money.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why are withdrawal functions vulnerable?&lt;/strong&gt;&lt;br&gt;
Withdrawal functions in smart contracts are particularly vulnerable because they handle money being sent out of the contract.&lt;/p&gt;

&lt;p&gt;When a withdrawal happens, the contract needs to send funds to someone’s address. This means:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The contract must interact with external addresses (EOAs or other contracts)&lt;/li&gt;
&lt;li&gt;The contract has to transfer actual value (cryptocurrency)&lt;/li&gt;
&lt;li&gt;The receiving address might do unexpected things when it gets money
Now, one broken withdrawal can block everyone. Some contracts process all withdrawals in a single transaction. If one person’s withdrawal fails, the entire transaction reverts, blocking everyone else. Attackers exploit this by deliberately making their withdrawal fail, locking up funds for everyone.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There could also be gas limit problems. If a contract tries to send money to multiple people in a single transaction, the gas cost can become too high.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Problem with Push-Based Payments
&lt;/h2&gt;

&lt;p&gt;Some smart contracts implement a “push” payment model where the contract directly sends funds to recipients. While this approach seems straightforward, it introduces a critical vulnerability: the contract’s ability to function becomes dependent on the recipient’s ability to receive funds.&lt;/p&gt;

&lt;p&gt;Let’s examine a real-world vulnerability found in the &lt;a href="https://solodit.cyfrin.io/issues/m-06-denial-of-service-contract-owner-could-block-users-from-withdrawing-their-strike-code4rena-putty-putty-contest-git?source=post_page-----bde2eb557231---------------------------------------" rel="noopener noreferrer"&gt;Putty Finance protocol&lt;/a&gt; and explain how the “withdrawal pattern” can prevent such issues.&lt;/p&gt;

&lt;p&gt;In Putty Finance’s case, when users withdrew their funds, the contract first attempted to send a fee to the contract owner before sending the remaining funds to the user:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// send the fee to the admin/DAO if fee is greater than 0%
uint256 feeAmount = 0;
if (fee &amp;gt; 0) {
    feeAmount = (order.strike * fee) / 1000;
    ERC20(order.baseAsset).safeTransfer(owner(), feeAmount);
}

ERC20(order.baseAsset).safeTransfer(msg.sender, order.strike - feeAmount);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This design created two potential DoS scenarios:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Zero Address Problem:&lt;/strong&gt; If the contract owner is set to the zero address (0x0), many ERC20 tokens will revert the transfer, causing the entire withdrawal function to fail. This will permanently lock users’ funds in the contract.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Malicious Token Hooks:&lt;/strong&gt; ERC777 tokens or similar standards that implement receiver hooks could be used by a malicious contract owner to implement logic that rejects incoming transfers, making it impossible for users to withdraw their funds.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s see what the address zero and the ERC777 are.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;zero address&lt;/strong&gt; (0x0000000000000000000000000000000000000000) is a special Ethereum address that no one controls. It is commonly used as a placeholder to indicate an uninitialized or non-existent address in smart contracts. Developers use it for various purposes, such as checking if an ownership variable has been set, burning tokens by sending them to an inaccessible location, or preventing accidental transfers. Since no private key exists for the zero address, any funds or tokens sent to it are permanently lost.&lt;/p&gt;

&lt;p&gt;ERC777 is an advanced Ethereum token standard that improves upon ERC20 by introducing a built-in hook mechanism that enables smart contracts and external accounts to react when they receive tokens. It maintains backward compatibility with ERC20, meaning it can work with existing ERC20 applications. A key feature is the tokensReceived hook, which allows recipients (especially smart contracts) to execute custom logic upon receiving tokens, enabling automation and security enhancements. ERC777 also supports operator functionality, allowing approved addresses to send tokens on behalf of others, improving usability for wallets and DeFi applications.&lt;/p&gt;

&lt;p&gt;Token hooks are callback functions that execute automatically when tokens are transferred. The most notable example is the ERC777 token standard, which introduced hooks as an improvement over the basic ERC20 standard.&lt;/p&gt;

&lt;p&gt;When an ERC777 token is transferred, it calls the tokensReceived hook on the recipient's address if the recipient is a contract. This happens before the transfer completes, allowing the recipient to react to incoming tokens.&lt;/p&gt;

&lt;p&gt;From the code above, if the baseAsset is an ERC777 token and the owner() is a contract, the owner could implement a malicious tokensReceived hook that deliberately reverts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Malicious owner contract

contract MaliciousOwner {
    function tokensReceived(
        address operator,
        address from,
        address to,
        uint256 amount,
        bytes calldata userData,
        bytes calldata operatorData
    ) external {
        // Deliberately revert when receiving tokens
        revert("Denied");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since the owner fee transfer happens before the user receives their funds, this malicious reversion blocks ALL user withdrawals, effectively holding user funds hostage.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Withdrawal Pattern Solution
&lt;/h2&gt;

&lt;p&gt;The “withdrawal pattern” is a best practice in smart contract design that separates the tracking of balances from the actual transfer of funds. It eliminates this vulnerability by separating the accounting from the transfer.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Instead of immediately transferring funds to recipients, the contract tracks owed balances internally&lt;/li&gt;
&lt;li&gt;Recipients must explicitly call a separate function to withdraw their funds&lt;/li&gt;
&lt;li&gt;Each recipient’s withdrawal is isolated from others, preventing chain-wide DoS attacks&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Implementation for Putty Finance
&lt;/h2&gt;

&lt;p&gt;The recommended solution completely separates the fee collection from the user’s withdrawal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mapping(address =&amp;gt; uint256) public ownerFees;

function withdraw(Order memory order) public {
    // ... existing code ...

    // transfer strike to owner if put is expired or call is exercised
    if ((order.isCall &amp;amp;&amp;amp; isExercised) || (!order.isCall &amp;amp;&amp;amp; !isExercised)) {
        // Calculate fee but don't transfer it yet
        uint256 feeAmount = 0;
        if (fee &amp;gt; 0) {
            feeAmount = (order.strike * fee) / 1000;
            ownerFees[order.baseAsset] += feeAmount;
        }

        // Transfer user's portion immediately
        ERC20(order.baseAsset).safeTransfer(msg.sender, order.strike - feeAmount);
        return;
    }
    // ... rest of function ...
}

// Separate function for owner to collect fees
function withdrawFee(address baseAsset) public onlyOwner {
    uint256 _feeAmount = ownerFees[baseAsset];
    ownerFees[baseAsset] = 0;
    ERC20(baseAsset).safeTransfer(owner(), _feeAmount);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this design, users can still successfully withdraw their funds even if the owner’s fee withdrawal fails for any reason.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of the Withdrawal Pattern
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Isolation of Risks: Each party’s withdrawal is independent, preventing one failure from affecting others&lt;/li&gt;
&lt;li&gt;Reduced Attack Surface: Eliminates vulnerabilities related to recipient behaviour&lt;/li&gt;
&lt;li&gt;Better Gas Efficiency: Allows recipients to choose when to withdraw, potentially saving on gas costs&lt;/li&gt;
&lt;li&gt;Clearer Accounting: This makes it easier to track who is owed what&lt;/li&gt;
&lt;li&gt;Enhanced User Trust: Users know they can always withdraw their funds regardless of protocol owner actions&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Implementing the Withdrawal Pattern in Your Contracts
&lt;/h2&gt;

&lt;p&gt;To implement the withdrawal pattern in your own smart contracts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a mapping to track balances owed to each address&lt;/li&gt;
&lt;li&gt;When a payment would normally be made, update the balance in the mapping instead&lt;/li&gt;
&lt;li&gt;Implement a separate withdrawal function that users call to claim their funds&lt;/li&gt;
&lt;li&gt;Always follow the “checks-effects-interactions” pattern when implementing withdrawals to prevent reentrancy attacks&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnb1uliu81vpmjbu4mydz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnb1uliu81vpmjbu4mydz.png" alt="Image description" width="734" height="833"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The withdrawal pattern is a fundamental security best practice for smart contract developers. By separating balance tracking from fund transfers, it prevents numerous DoS attack vectors and ensures that users maintain control over their assets.&lt;/p&gt;

&lt;p&gt;As demonstrated in the Putty Finance example, even well-intentioned contract designs can contain vulnerabilities when they directly transfer funds to recipients during multi-step operations. By adopting the withdrawal pattern, you can build more resilient protocols that inspire user confidence and protect against potential DoS attacks.&lt;/p&gt;

&lt;p&gt;Remember: design patterns matter in blockchain security. The withdrawal pattern isn’t just a coding preference—it’s an essential security measure for any contract that handles value transfers.&lt;/p&gt;

&lt;p&gt;Always stay safe out there. It does not matter if you are a developer or a user. You should always ask yourself this question: Is the withdrawal pattern followed to prevent denial of service?&lt;/p&gt;

&lt;p&gt;I hope you enjoyed this article. I will see you in the next one.&lt;/p&gt;

</description>
      <category>smartcontractsecurity</category>
      <category>denialofservice</category>
      <category>samrtcontractaudit</category>
      <category>withdrawalpattern</category>
    </item>
    <item>
      <title>Understanding Ethereum’s Data Structure: A Simple Guide</title>
      <dc:creator>Ajaye Favour</dc:creator>
      <pubDate>Wed, 29 Nov 2023 13:33:09 +0000</pubDate>
      <link>https://dev.to/tehilafavourite/understanding-ethereums-data-structure-a-simple-guide-2pc3</link>
      <guid>https://dev.to/tehilafavourite/understanding-ethereums-data-structure-a-simple-guide-2pc3</guid>
      <description>&lt;p&gt;Have you ever wondered what Merkle Patricia Trie was? I know you've also thought about it at some point. I found a way to simplify it for you, breaking it down to what I call "its simplest form."&lt;br&gt;
I'm really happy to share this because I know it will help a whole lot.&lt;br&gt;
Now, let's dive into this amazing article on Merkle Patricia Tries.&lt;/p&gt;

&lt;p&gt;Note: Try to picture this whole scenario.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I9t5yNJJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/49pjwdv7h1oovf7yd4m9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I9t5yNJJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/49pjwdv7h1oovf7yd4m9.jpg" alt="Image description" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Consider Ethereum as a massive digital notebook where all transactions are recorded. This notebook is not governed by a single entity, as it is decentralized. Now, each page in this notebook is a “block,” and it has a list of transactions. When a page is filled, we seal it with a special code called a “hash.” This hash is like a unique fingerprint for that page, and it also contains the fingerprint of the previous page. So, all the pages are connected in a chain, and if you try to change something on an old page, it messes up the fingerprints, and everyone can see it. This makes it really hard to cheat or tamper with the transactions.&lt;br&gt;
Ethereum uses a special system called the “Merkle Patricia Trie.” Pronounced “try,” it’s basically a structured way of arranging and protecting all the important details.&lt;/p&gt;

&lt;p&gt;How does this work? We will see that in a bit.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Family Tree Analogy
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ce3qShxu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j3m3gbc1oevgi6tkyvs1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ce3qShxu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j3m3gbc1oevgi6tkyvs1.jpg" alt="Image description" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Think of the Merkle Patricia Trie as a tree—a family tree. At the top of this tree is the main root, like the last name of a big family. This root represents all the information stored in Ethereum. Each branch of the tree leads to more branches or leaves, much like the different branches of a family tree leading to various relatives.&lt;/p&gt;

&lt;p&gt;But Ethereum’s tree deals with information, not names and relationships. In this family tree, any item of data—transaction or account balance, for example—is comparable to one individual. Every piece of data has a unique identity, just as every individual has distinctive qualities.&lt;/p&gt;

&lt;p&gt;To make things even more efficient, Ethereum uses a special type of code called hexadecimal. It’s like a mix of numbers and letters that helps organize and quickly find information within this tree-like structure. This code acts as the address of a particular piece of information.&lt;/p&gt;

&lt;p&gt;Now, to keep everything secure, each piece of information in this tree has a unique code called a “hash.” This hash acts as a fingerprint—no two pieces of information have the same fingerprint. If anything changes in the information, even a tiny bit, its fingerprint (hash) changes too. This way, Ethereum can easily spot if anything has been tampered with or updated.&lt;br&gt;
One cool thing about this tree structure is that it’s super smart about updates. Let’s say something changes—maybe a new transaction happens or an account balance is updated. Instead of reorganizing the entire tree, the system only updates the specific part related to that change. This keeps things speedy and efficient.&lt;/p&gt;

&lt;p&gt;Basically, the main hash at the top of the tree acts like a seal on a precious box. If anything within that box changes, even slightly, the seal changes too. This alerts the system that something has been modified or added, ensuring the integrity and security of all the information stored in Ethereum.&lt;/p&gt;

&lt;p&gt;I’m sure you made that big family picture, and you can see it right now. So, let’s introduce three essential branches in this family information tree: the “World State,” the “Transaction,” and the “Transaction Receipt.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;World state:&lt;/strong&gt; This is like a family album capturing the current financial state of everyone in Ethereum. Think of it as a snapshot of all account balances and contract storage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Transaction:&lt;/strong&gt; This is similar to a diary entry, documenting the who, what, and when of a transaction. This contains details of a particular action, like sending cryptocurrency from one account to another, smart contract execution, decentralized application (DApp) interactions, and token swaps on decentralized exchanges. Each Ethereum transaction consists of several components. A few are Nonce, Gas Price, Gas Limit, to (recipient), value, data, V, R, S (Digital signature), etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Transaction Receipt:&lt;/strong&gt; The “Transaction Receipt” is like a confirmation slip for a transaction. It verifies that a transaction has been successfully completed, detailing any changes in the world. Transaction receipts consist of post-transaction state, total gas used, logs created through execution of the transaction, etc.&lt;/p&gt;

&lt;p&gt;It is necessary to comprehend Ethereum’s data structure in order to navigate the blockchain ecosystem. It influences everything, from transactions to smart contracts, and serves as the foundation for information organization and security. This information is essential for effectively interacting with Ethereum, guaranteeing informed choices and the integrity of interactions in this decentralized environment, regardless of whether you’re a developer, user, or enthusiast.&lt;/p&gt;

&lt;p&gt;I really enjoyed writing this. I hope you enjoy reading it too.&lt;br&gt;
Don’t forget to share your thoughts on this.&lt;br&gt;
Don’t forget to follow me for more “simplest form” explanations on Ethereum, blockchain, and Web 3.&lt;/p&gt;

&lt;p&gt;See you next time!&lt;/p&gt;

</description>
      <category>merklepatriciatries</category>
      <category>ethereum</category>
      <category>blockchain</category>
      <category>merkle</category>
    </item>
    <item>
      <title>Solidity Inheritance</title>
      <dc:creator>Ajaye Favour</dc:creator>
      <pubDate>Sat, 24 Jun 2023 09:38:01 +0000</pubDate>
      <link>https://dev.to/tehilafavourite/solidity-inheritance-48p7</link>
      <guid>https://dev.to/tehilafavourite/solidity-inheritance-48p7</guid>
      <description>&lt;p&gt;**&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tngGt7ZW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/utjwo2yc3ommih0wd2n0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tngGt7ZW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/utjwo2yc3ommih0wd2n0.png" alt="Image description" width="800" height="624"&gt;&lt;/a&gt;**&lt;br&gt;
Consider constructing a home with a different rooms and features. Each area has a distinct role and use, but they all work together to form a whole and useful living space.&lt;/p&gt;

&lt;p&gt;Solidity inheritance works similarly. Inheritance allows you to create smart contracts that inherit properties and functionality from other contracts, just like rooms in a house inherit certain characteristics from the overall house design.&lt;/p&gt;

&lt;p&gt;Let's say you have a base contract called House. This House contract defines some fundamental features that every house should have, such as a foundation, walls, and a roof. It serves as the blueprint for all the houses you will build.&lt;/p&gt;

&lt;p&gt;Now, you want to create a specialized contract called SmartHouse that inherits from the House contract. The SmartHouse contract adds additional features like automated lighting, smart locks, and energy monitoring.&lt;/p&gt;

&lt;p&gt;By using inheritance, you can easily create the SmartHouse contract by extending the House contract. It's like adding extra rooms and advanced technologies to your existing house design.&lt;/p&gt;

&lt;p&gt;Solidity supports inheritance, which allows you to create new contracts based on existing ones. Inheritance is a way to reuse code and avoid duplicating functionality across multiple contracts.&lt;/p&gt;

&lt;p&gt;To inherit from a parent contract, you can use the "is" keyword followed by the name of the parent contract.&lt;/p&gt;

&lt;h1&gt;
  
  
  solidity #smartcontracts #blockchain #solidityinheritance
&lt;/h1&gt;

</description>
    </item>
  </channel>
</rss>
