* Now compiling in a separate directory using truffle 5. * Ported to 0.5.1, now compiling using 0.5.1. * test now also compiles using the truffle 5 hack. * Downgraded to 0.5.0. * Sorted scripts. * Cleaned up the compile script a bit.
23 lines
678 B
Solidity
23 lines
678 B
Solidity
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.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 payable payee) public {
|
|
require(withdrawalAllowed(payee));
|
|
super.withdraw(payee);
|
|
}
|
|
}
|