A crowdfunded raise contract that incentivizes deposits by minting SocialCredits to participants.
Report Bug
·
Request Feature
Table of Contents
RaisePool is a contract that facilitates collecting deposits for a fundraising effort. The contract will allow refunds if the soft target is not reached by the deadline. If the soft target is reached at any point, refunds are disabled and the recipient can withdraw. Once a withdrawal is processed, the contract locks and prevents any future attempted deposits. Deposits cannot exceed the hard cap at all, and if the final depositor exceeds it, they will have the overage refunded to them during bid processing.
RaisePool was designed using Foundry, so I recommend familiarizing yourself with that if required.
- Foundry
curl -L https://foundry.paradigm.xyz | bash foundryup
- Set up your RaisePool project using Foundry
forge init ProjectName
- Install RaisePool
forge install zodomo/RaisePool --no-commit
- Import RaisePool
Add the following above the beginning of your project's primary contractimport "../lib/RaisePool/src/RaisePool.sol";
- Inherit the module
Add the following to the contract declarationcontract ProjectName is RaisePool {}
- Populate constructor arguments
Add the following parameters and declaration to your constructorconstructor( address _owner, address _incentiveToken, uint40 _deadline, uint96 _softTarget, uint96 _hardTarget ) RaisePool(_owner, _incentiveToken, _deadline, _softTarget, _hardTarget) {}
The contract is automatically configured upon deployment. All state transitions happen automatically. Once soft target is reached, withdrawals automatically enable and refunds disable. Once withdraw()
is called, the contract locks permanently.
Call raise()
to contribute to the fundraising effort. The receive()
function also calls raise()
, so participants are able to send ETH directly to the RaisePool contract address and have their raise processed properly.
Raise participants can call refund()
after the deadline has been reached but only if the soft target also hasn't been reached.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your 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
Distributed under the AGPL-3 License. See LICENSE.txt
for more information.
Zodomo - @0xZodomo - [email protected] - Zodomo.eth
Project Link: https://github.com/Zodomo/RaisePool