ERC20 Faucet

View on GitHub

Overview

This project implements a simple ERC20 token and a faucet smart contract that allows users to claim tokens periodically with a cooldown and a maximum number of claims. Built using Foundry and OpenZeppelin as part of a Solidity learning and development workflow. An ERC20 token implementation built on top of OpenZeppelin.

Deployment script: script/DeployTHXToken.s.sol

Deployed Contracts — Arbitrum Sepolia Testnet

ContractAddress
TokenFaucet0x88E6277b1CfA68D47EB09d08F232d42A98A30942

🔗 View on Arbiscan Sepolia

claim() Execution Flow

Execution Flow

  1. Check block.timestamp - _lastClaim ≥ cooldown
  2. Check balanceOf(this) ≥ _dripAmount
  3. Check _timesClaimed[sender] < 20
  4. _token.transfer(msg.sender, _dripAmount)
  5. Update _lastClaim + _timesClaimed++
  6. Emit tokensClaimed event