OpenProj

Notes:

Notes:


Steps:

1


import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Context.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Address.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/utils/SafeERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol";

6


contract PaymentSplitter is Context, Ownable {

5


function _addPayees(address[] memory payees, uint256[] memory shares_) public onlyOwner  {
            require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch");
            require(payees.length > 0, "PaymentSplitter: no payees");

            for (uint256 i = 0; i < payees.length; i++) {
                _addPayee(payees[i], shares_[i]);
            }
        }

2


3


event PayeesCleared();

4


 function _clearPayees() public onlyOwner {
        for (uint256 i = 0; i < _payees.length; i++) {
            address thing = _payees[i];
            delete _shares[thing];
            delete _released[thing];
        }
       
        delete _payees;
        delete _totalShares;
        delete _totalReleased;
        emit PayeesCleared();
    }

7


13


34


// SPDX-License-Identifier: MIT

14


15


16


17


18


19 20


21


22


23


24


25


33

26


/generate_payees_and_shares

one

29


30


31


32

Congratulations! You’ve created your paymentSplitter smart contract on polygon.