Moved Escrows into an escrow subdirectory, improved docs. (#1430)
* Moved Escrows into an escrow subdirectory, improved docs.
* Fixed escrow mock.
* Fixed some more imports.
(cherry picked from commit f3df2dab3d)
This commit is contained in:
committed by
Leo Arias
parent
88f48be287
commit
c5a8680a9c
22
contracts/payment/escrow/ConditionalEscrow.sol
Normal file
22
contracts/payment/escrow/ConditionalEscrow.sol
Normal file
@ -0,0 +1,22 @@
|
||||
pragma solidity ^0.4.24;
|
||||
|
||||
import "./Escrow.sol";
|
||||
|
||||
/**
|
||||
* @title ConditionalEscrow
|
||||
* @dev Base abstract escrow to only allow withdrawal if a condition is met.
|
||||
* @dev Intended usage: See Escrow.sol. 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 payee) public {
|
||||
require(withdrawalAllowed(payee));
|
||||
super.withdraw(payee);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user