Skip to content

Repository files navigation

Contributors Forks Stargazers Issues MIT License


Payment Splitter

A better, more comprehensive version of Openzeppelin's payment splitter contract.
Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Roadmap
  4. Contributing
  5. License
  6. Contact

About The Project

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.

Built With

  • Solidity
  • Foundry
  • Soldeer

Getting Started

Prerequisites

Make sure you have git, make, rust, foundry, and soldeer installed and configured on your system.

Installation

Clone the repo,

git clone https://github.com/mgnfy-view/payment-splitter.git

cd into the repo, install the necessary dependencies, and build the project,

cd payment-splitter
make

Run tests by executing,

forge test

That's it, you are good to go now!

Roadmap

  • Smart contract development
  • Testing
  • Fuzz testing
  • Documentation

See the open issues for a full list of proposed features (and known issues).

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE.txt for more information.

Reach Out

Here's a gateway to all my socials, don't forget to hit me up!

Linktree

About

A better, more comprehensive version of Openzeppelin's payment splitter contract

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages