Foundry Fund Me is a smart contract project that allows users to fund a contract based on the ETH/USD price. This README provides essential information about setting up, testing, and deploying the project.
- Funding Contract: Users can fund the contract with ETH.
- Price Conversion: Uses Chainlink oracles to convert ETH to USD.
- Withdrawals: Only the contract owner can withdraw funds.
- Integration Tests: Comprehensive tests for functionalities.
To get started, clone the repository and install the necessary dependencies:
git clone <repository-url>
cd <repository-directory>
forge install
This project uses several submodules:
forge-std
: Standard library for Foundry.chainlink-brownie-contracts
: Chainlink contracts for price feeds.foundry-devops
: Tools for deploying contracts.
To build the project, run:
forge build
Ensure your code is properly formatted:
forge fmt
Run unit and integration tests using:
forge test -vvv
To check test coverage, use:
forge coverage
To deploy on a local network, use:
forge script script/DeployFundMe.s.sol:DeployFundMe --rpc-url http://localhost:8545 --private-key <your-private-key> --broadcast
For deployment to Sepolia:
forge script script/DeployFundMe.s.sol:DeployFundMe --network sepolia --rpc-url <sepolia-rpc-url> --account <your-account> --broadcast --verify --etherscan-api-key <your-api-key>
The project includes various scripts for interactions:
- Funding:
script/Interactions.s.sol
allows funding the contract. - Withdrawals: The same script can be used to withdraw funds from the contract.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/AmazingFeature
). - Commit your changes (
git commit -m 'Add some AmazingFeature'
). - Push to the branch (
git push origin feature/AmazingFeature
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.