You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
735 B
22 lines
735 B
pragma solidity ^0.5.0;
|
|
|
|
import "./Escrow.sol";
|
|
|
|
/**
|
|
* @title ConditionalEscrow
|
|
* @dev Base abstract escrow to only allow withdrawal if a condition is met.
|
|
* @dev Intended usage: See {Escrow}. Same usage guidelines apply here.
|
|
*/
|
|
contract ConditionalEscrow is Escrow {
|
|
/**
|
|
* @dev Returns whether an address is allowed to withdraw their funds. To be
|
|
* implemented by derived contracts.
|
|
* @param payee The destination address of the funds.
|
|
*/
|
|
function withdrawalAllowed(address payee) public view returns (bool);
|
|
|
|
function withdraw(address payable payee) public {
|
|
require(withdrawalAllowed(payee), "ConditionalEscrow: payee is not allowed to withdraw");
|
|
super.withdraw(payee);
|
|
}
|
|
}
|
|
|