Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’Έ FundMe Smart Contract

A decentralized crowdfunding smart contract built with Solidity. It allows users to fund the contract with ETH, and the contract owner can withdraw the total funds. Uses Chainlink Price Feeds to enforce a minimum funding amount in USD.


πŸ” Overview

  • Enforces a minimum funding amount of 5 USD (converted from ETH using Chainlink)
  • Tracks how much each address has funded
  • Only the owner can withdraw funds
  • Handles plain ETH transfers using receive() and fallback()

🧱 Contract Details

βœ… Requirements

  • Users must fund at least $5 worth of ETH
  • Funds are tracked per address
  • Only contract owner can withdraw funds
  • Safe withdrawal using:
    • transfer
    • send
    • call

πŸ§ͺ Functions

πŸ“₯ fund() payable

Allows anyone to send ETH to the contract if the amount (in USD) is β‰₯ $5.

πŸ“Š getConversionRate(uint256 ethAmount)

Returns the amount of ETH in USD using Chainlink oracle.

πŸ“ˆ getLatestPrice()

Fetches the latest ETH/USD price from Chainlink.

πŸ“¦ getVersion()

Returns the version of the Chainlink price feed.

πŸ’Έ withDraw()

Can only be called by the owner. Resets balances and sends ETH to the owner's address using:

  • .transfer
  • .send
  • .call

🧲 receive() and fallback()

Automatically call fund() if ETH is sent directly without data.


πŸ”— Chainlink ETH/USD Price Feed

  • Used for conversion between ETH and USD.
  • Address (Sepolia):
    0x694AA1769357215DE4FAC081bf1f309aDC325306

πŸ› οΈ Technologies

  • Solidity ^0.8.18
  • Chainlink Oracles
  • Ethereum Sepolia/Testnet

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages