SplitPullPayment.sol 891 B

12345678910111213141516171819202122232425262728
  1. pragma solidity ^0.4.15;
  2. import './PullPayment.sol';
  3. import './SplitPayment.sol';
  4. /**
  5. * @title SplitPullPayment
  6. * @dev Contract supporting the distribution of funds combined with withdrawals through PullPayment.
  7. */
  8. contract SplitPullPayment is SplitPayment, PullPayment {
  9. /**
  10. * @dev Return the total amount of funds available for distribution.
  11. * @dev Override from SplitPayment to take into account credited funds for pull payments.
  12. */
  13. function toDistribute() internal returns (uint256) {
  14. return this.balance.sub(totalPayments);
  15. }
  16. /**
  17. * @dev Perform the payment to a payee.
  18. * @dev Override from SplitPayment to do an asyncSend for later withdrawal.
  19. * @param _payee The address of the payee to be paid.
  20. * @param _amount The amount for the payment.
  21. */
  22. function pay(address _payee, uint256 _amount) internal {
  23. asyncSend(_payee, _amount);
  24. }
  25. }