Skip to content

winnpxl/faucet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sepolia Faucet

A Web3 faucet application that lets users claim free Sepolia testnet ETH. Built with Solidity, Foundry, and React.

Live Contract

Features

  • Users can connect their wallet and claim 0.01 Sepolia ETH
  • 1 minute cooldown per wallet address
  • Owner controls: update drip amount, cooldown, and withdraw funds
  • Fully tested with 16 passing tests
  • Contract verified on Etherscan

Tech Stack

  • Smart Contract: Solidity 0.8.33
  • Development Framework: Foundry (forge, anvil, cast)
  • Frontend: React + TypeScript + Vite
  • Web3: wagmi v2 + viem + RainbowKit
  • Network: Ethereum Sepolia Testnet

Project Structure

faucet/
├── faucet-contract/
│   ├── src/
│   │   └── Faucet.sol        # Main contract
│   ├── test/
│   │   └── Faucet.t.sol      # 16 unit tests
│   └── script/
│       └── DeployFaucet.s.sol # Deployment script
└── faucet-frontend/
    └── src/
        ├── App.tsx            # Main UI
        ├── faucetConfig.ts    # Contract address + ABI
        └── main.tsx           # Wagmi + RainbowKit setup

Getting Started

Contract

cd faucet-contract
forge build
forge test

Frontend

cd faucet-frontend
npm install
npm run dev

Add a .env file in faucet-contract/ with:

SEPOLIA_RPC_URL=your_alchemy_sepolia_url
PRIVATE_KEY=0xyour_private_key
ETHERSCAN_API_KEY=your_etherscan_api_key

Contract Overview

function claim() external          // Claim 0.01 ETH (1 min cooldown)
function getBalance() external     // Check faucet balance
function getTimeUntilNextClaim()   // Check your cooldown
function setDripAmount()           // Owner: update drip amount
function setCooldown()             // Owner: update cooldown
function withdraw()                // Owner: withdraw all funds

About

A Solidity faucet contract deployed on Sepolia with a React/wagmi frontend. Built with Foundry.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors