Files
openzeppelin-contracts/contracts/payment/escrow/ConditionalEscrow.sol
Elena Gesheva 04fc35707d Migrate contracts to Solidity 0.7 (#2319)
* Update contract pragmas to solidity 0.7

* Remove internal declaration on constructors

* Reference SafeMath explicitely

* Remove public constructor declaration from abstract contracts

* Remove public constructor declaration from non-abstract contracts
2020-07-29 18:11:32 -03:00

25 lines
802 B
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.7.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.
*/
abstract 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 virtual returns (bool);
function withdraw(address payable payee) public virtual override {
require(withdrawalAllowed(payee), "ConditionalEscrow: payee is not allowed to withdraw");
super.withdraw(payee);
}
}