The FundMe project is a decentralized funding contract built on the Ethereum blockchain. It allows users to fund the contract with ETH and enables the owner to withdraw the funds. The project utilizes Chainlink's price feeds to ensure that the funding amounts meet a minimum threshold in USD.
- Users can fund the contract with ETH.
- The contract checks the current ETH/USD price using Chainlink oracles.
- Only the contract owner can withdraw the funds.
- Supports multiple funders and keeps track of their contributions.
- Solidity
- Ethereum
- Chainlink
- Forge (for testing and deployment)
To get started with the FundMe project, follow these steps:
-
Clone the repository:
git clone https://github.com/cgrade/fundme.git cd fundme
-
Install dependencies: Make sure you have Foundry installed. If not, you can install it using:
curl -L https://foundry.paradigm.xyz | bash foundryup
-
Install required libraries:
forge install
To deploy the FundMe contract, run the following command:
forge script script/DeployFundMe.s.sol --broadcast
This will deploy the FundMe contract to the active network specified in the HelperConfig
script.
To run the tests for the FundMe contract, use the following command:
forge test
This will execute all the tests defined in the test/FundMeTest.t.sol
file.
script/DeployFundMe.s.sol
: Script for deploying the FundMe contract.src/FundMe.sol
: Main contract that handles funding and withdrawals.script/HelperConfig.s.sol
: Provides network-specific configurations for deployment.test/FundMeTest.t.sol
: Contains tests for the FundMe contract.test/mocks/MockV3Aggregator.t.sol
: Mock contract for testing price feeds.
Contributions are welcome! If you have suggestions for improvements or new features, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.