FundMe
This is a Web 3 Basic Project Created using Foundry
Install / Use
/learn @BondeYash/FundMeREADME
FundMe Project ReadMe
Table of Contents
Overview
The FundMe project is a smart contract built on the Ethereum blockchain using the Solidity programming language. It allows users to fund the contract with Ether (ETH) based on the current ETH/USD price provided by the Chainlink Price Feed. The contract has an owner who can withdraw the funds once they have been accumulated. The contract ensures that each individual funding transaction meets a minimum funding threshold in USD.
Prerequisites
To interact with the FundMe contract, you will need the following:
- An Ethereum wallet (e.g., MetaMask) to send transactions and interact with the contract.
- Some Ether (ETH) to fund the contract.
- Access to an Ethereum development environment like Remix or Truffle, or an Ethereum wallet with built-in contract interaction capabilities.
Getting Started
Installation
- Clone the FundMe repository from GitHub Repository URL.
Deployment
-
Deploy the FundMe contract on an Ethereum development environment or the mainnet. You can use Remix or Truffle for development purposes.
-
When deploying the contract, pass the address of the Chainlink Price Feed contract as a parameter to the constructor. This Price Feed contract provides the current ETH/USD exchange rate.
-
After deploying the contract, the deploying account will become the contract's owner. Only the owner can withdraw the funds.
Functionality
Funding the Contract
To fund the contract with Ether, follow these steps:
-
Call the
fundfunction on the FundMe contract, and send Ether along with the transaction. -
The contract will use the Chainlink Price Feed to determine the current ETH/USD rate.
-
If the ETH amount sent with the transaction is equivalent to or greater than the specified minimum funding threshold in USD, the contract will register the funder's address and the funded amount.
Withdrawing Funds
Only the contract owner can withdraw the funds. To withdraw the accumulated funds, follow these steps:
-
Call the
withdrawfunction on the FundMe contract. -
The contract will distribute the accumulated funds back to each funder in proportion to their contributions.
-
After the withdrawal, the contract balance will be zero.
Testing
The FundMe contract has been tested to ensure its functionality. The test cases cover various scenarios, including funding the contract, ensuring the minimum funding threshold, and withdrawing the funds.
To run the tests:
-
Open an Ethereum development environment (e.g., Remix or Truffle).
-
Deploy the FundMe contract on the local development network.
-
Run the test scripts available in the "tests" folder.
Gas Efficiency
The FundMe contract has been designed with gas efficiency in mind. Efforts have been made to minimize gas costs for various operations.
License
This project is licensed under the MIT License. See the LICENSE file for more information.
Thank you for your interest in the FundMe project! If you encounter any issues or have any questions, please feel free to contact the project maintainers. Happy funding!
Related Skills
node-connect
348.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
348.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
348.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
