This project implements a simple crowdfunding pool using the Solidity programming language. The contract allows users to contribute Ether to a pool, with the goal of reaching a specified amount within a certain timeframe. If the goal is reached, the owner can withdraw the collected funds. If the goal is not reached by the end of the timeframe, contributors can request a refund.
The Pool
contract is a simple crowdfunding contract where:
To work with this project, you will need:
Clone the repository:
git clone https://github.com/Cecile-Hirschauer/foundry-pool.git
cd foundry-pool
Install the necessary dependencies:
forge install
To run the tests for the Pool
contract, use the following command:
forge test
This will execute all test cases written for the contract. The test suite ensures that all functionalities of the contract are working as expected. The tests cover a variety of scenarios, including successful contributions, withdrawals, and refunds, as well as edge cases where the contract should revert.
After running the tests, you can check the code coverage by running:
forge coverage
To deploy the Pool contract, use the deployment script provided in the script directory. You can deploy the contract using the following command:
forge script script/Deploy.s.sol:MyScript --fork-url http://127.0.0.1:8545 --broadcast
The deployment transaction is saved in:
Note: The deployment was successful, but it's important to verify that the deployed contract is functioning as expected in your specific environment.
This project is licensed under the MIT License. See the LICENSE file for details.