This app is a demo app for ERC20 Payment Splitter. The code for the contracts can be found here. The contracts have been deployed to Ropsten. Please, open an issue here if you find any problem or have a suggestion.
There is already a Payment Splitter for ETH on OpenZeppelin. There are many people who have implemented an ERC20 payment splitter to split a payment among shareholders in the form of an ERC20 token by modifying OpenZeppelin's payment splitter for ETH. An example is AirSwap.
So, how this ERC20 payment splitter is different. Most of the ERC20 payment splitter implementations (at least those I encountered) split the payments among a given list of accounts in proportion to their fixed shares.
This ERC20 payment splitter uses two ERC20 tokens. One token is the Payment Token which is used for receiving and splitting payments. The other is the Shares Token. Shares token (ERC20Shares) is also an ERC20 token with some extended functionality. It snapshots its holders' balances and the total supply of the token when they change. The ERC20 Payment Splitter uses these balance snapshots and the total supply snapshots as the shares held by addresses and the total shares respectively at different points of time. Whenever a payment is received, each user gets a part of the payment in proportion to her/his balance of Shares Token at that point in time. However, the user doesn't receive the payment automatically. The user can get all the accumulated pending payments anytime.
- There is no need to add or remove shareholders.
- The shareholders can exchange their shares at a DEX.
- The same token can be used for both shareholding in a payment splitter and governance on a DAO.
- The sender of the payment has to first allow the splitter to get the Payment Token from his/her address, and then, call the receivePayment function on the splitter.
- The shareholders have to manually withdraw their payments.