# ** Introducing the World Computer** ## **Ethereum Is More Than Cryptocurrency** Had a dive into the Ethereum Basics module of the Ethereum handbook today and I discovered that Ethereum is a **decentralized world computer** powered by the Ethereum Virtual Machine (EVM). This global computer runs smart contracts—self-executing programs that live on the blockchain. Ether, the cryptocurrency, serves as "gas" to pay for running these smart contracts. Each node in the Ethereum network runs a copy of the EVM, validating contract execution while the blockchain records the world computer’s state. ## **Understanding Ethereum Accounts** I also learned about the two types of accounts in Ethereum: 1. **Externally Owned Accounts (EOAs):** These are controlled by private keys, like the one created using MetaMask. EOAs are used to hold Ether and initiate transactions. 2. **Contract Accounts:** These accounts don’t have private keys and can’t initiate transactions. Instead, they are governed by the logic written in their smart contract code. Contracts can react to incoming transactions and even call other contracts to create complex systems. This separation of EOAs and contract accounts is crucial in enabling decentralized applications (DApps) that can automate processes, enforce rules, and share state across the blockchain. --- ## **Building a Test Ether Faucet** To solidify my understanding, I wrote a simple smart contract: a **test Ether faucet**. This contract allows users to withdraw small amounts of Ether for testing purposes. Here’s the code I used: ```solidity // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract TestFaucet { address public owner; constructor() { owner = msg.sender; } // Function to deposit Ether into the faucet receive() external payable {} // Function to withdraw Ether (max 0.1 ETH per request) function withdraw(uint _amount) public { require(_amount <= 0.1 ether, "Request exceeds faucet limit"); require(address(this).balance >= _amount, "Faucet is empty"); payable(msg.sender).transfer(_amount); } // Function to destroy the contract and send remaining funds to the owner function destroyFaucet() public { require(msg.sender == owner, "Only the owner can destroy the faucet"); selfdestruct(payable(owner)); } } ``` ### **What My Faucet Contract Does:** 1. **Depositing Ether:** Anyone can send Ether to the faucet using the `receive()` function. 2. **Withdrawing Ether:** Users can withdraw up to 0.1 ETH per request. The contract ensures withdrawals don’t exceed its balance. 3. **Destroying the Contract:** As the owner, I can destroy the faucet and retrieve the remaining funds, a useful feature for temporary test setups.