A better, more comprehensive version of Openzeppelin's payment splitter contract.
Report Bug
·
Request Feature
Table of Contents
This payment splitter is an improvement over OpenZeppelin's implementation, which was deprecated starting from v5.0.0. It provides additional capabilities to manage payees (adding, removing, or modifying their shares at any time) and includes other features such as tracking supported tokens for payments and freezing/unfreezing payment functionality.
The payment splitter borrows the concept of accumulatedRewardPerToken (used as accumulatedPaymentPerShare in this context) from Sushiswap's MasterChef staking algorithm. The payment pool for a token is treated as a staking pool that receives payments as rewards over time. Adding payees to supported payment pools is equivalent to staking in those pools with associated shares. Adding, removing, or modifying a payee's share triggers payment distribution for that payee and updates the global accumulatedPaymentPerShare.
However, this increased control comes with more complex configuration requirements. Each token to be supported for payments must be manually whitelisted. Additionally, payees must be managed separately for each supported token.
- Solidity
- Foundry
- Soldeer
Make sure you have git, make, rust, foundry, and soldeer installed and configured on your system.
Clone the repo,
git clone https://github.com/mgnfy-view/payment-splitter.gitcd into the repo, install the necessary dependencies, and build the project,
cd payment-splitter
makeRun tests by executing,
forge testThat's it, you are good to go now!
- Smart contract development
- Testing
- Fuzz testing
- Documentation
See the open issues for a full list of proposed features (and known issues).
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 MIT License. See LICENSE.txt for more information.
Here's a gateway to all my socials, don't forget to hit me up!