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";
contract PaymentSplitter is Context, Ownable {
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]);
}
}
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();
}
// SPDX-License-Identifier: MIT
/generate_payees_and_shares