ConditionalEscrow.sol 574 B

12345678910111213141516171819202122
  1. pragma solidity ^0.4.24;
  2. import "./Escrow.sol";
  3. /**
  4. * @title ConditionalEscrow
  5. * @dev Base abstract escrow to only allow withdrawal if a condition is met.
  6. */
  7. contract ConditionalEscrow is Escrow {
  8. /**
  9. * @dev Returns whether an address is allowed to withdraw their funds. To be
  10. * implemented by derived contracts.
  11. * @param payee The destination address of the funds.
  12. */
  13. function withdrawalAllowed(address payee) public view returns (bool);
  14. function withdraw(address payee) public {
  15. require(withdrawalAllowed(payee));
  16. super.withdraw(payee);
  17. }
  18. }