* Error handling in ERC20 and ERC721 * Added message string for require. * Fixed solhint errors. * Updated PR as per issue #1709 * changes as per #1709 and openzeppelin forum. * Changes in require statement * Changes in require statement * build pipeline fix * Changes as per @nventuro's comment. * Update revert reason strings. * Fianal update of revert reason strings. * WIP: Updating reason strings in test cases * WIP: Added changes to ERC20 and ERC721 * Fixes linting errors in *.tes.js files * Achieved 100% code coverage * Updated the test cases with shouldFail.reverting.withMessage() * Fix package-lock. * address review comments * fix linter issues * fix remaining revert reasons
23 lines
737 B
Solidity
23 lines
737 B
Solidity
pragma solidity ^0.5.7;
|
|
|
|
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), "ConditionalEscrow: payee is not allowed to withdraw");
|
|
super.withdraw(payee);
|
|
}
|
|
}
|