* Added basic Escrow * PullPayment now uses an Escrow, removing all trust from the contract * Abstracted the Escrow tests to a behaviour * Added ConditionalEscrow * Added RefundableEscrow. * RefundableCrowdsale now uses a RefundEscrow, removed RefundVault. * Renaming after code review. * Added log test helper. * Now allowing empty deposits and withdrawals. * Style fixes. * Minor review comments. * Add Deposited and Withdrawn events, removed Refunded * The base Escrow is now Ownable, users of it (owners) must provide methods to access it.
23 lines
579 B
Solidity
23 lines
579 B
Solidity
pragma solidity ^0.4.23;
|
|
|
|
import "./Escrow.sol";
|
|
|
|
|
|
/**
|
|
* @title ConditionalEscrow
|
|
* @dev Base abstract escrow to only allow withdrawal if a condition is met.
|
|
*/
|
|
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);
|
|
}
|
|
}
|