Merge tag 'v2.2.0' of github.com:OpenZeppelin/openzeppelin-solidity

v2.2.0
This commit is contained in:
Francisco Giordano
2019-05-28 17:40:27 -03:00
162 changed files with 3035 additions and 2330 deletions

View File

@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;
import "./Escrow.sol";
@ -13,10 +13,10 @@ contract ConditionalEscrow is Initializable, 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.
*/
* @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 {

View File

@ -1,20 +1,20 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;
import "../../math/SafeMath.sol";
import "../../ownership/Secondary.sol";
/**
* @title Escrow
* @dev Base escrow contract, holds funds designated for a payee until they
* withdraw them.
* @dev Intended usage: This contract (and derived escrow contracts) should be a
* standalone contract, that only interacts with the contract that instantiated
* it. That way, it is guaranteed that all Ether will be handled according to
* the Escrow rules, and there is no need to check for payable functions or
* transfers in the inheritance tree. The contract that uses the escrow as its
* payment method should be its primary, and provide public methods redirecting
* to the escrow's deposit and withdraw.
*/
* @title Escrow
* @dev Base escrow contract, holds funds designated for a payee until they
* withdraw them.
* @dev Intended usage: This contract (and derived escrow contracts) should be a
* standalone contract, that only interacts with the contract that instantiated
* it. That way, it is guaranteed that all Ether will be handled according to
* the Escrow rules, and there is no need to check for payable functions or
* transfers in the inheritance tree. The contract that uses the escrow as its
* payment method should be its primary, and provide public methods redirecting
* to the escrow's deposit and withdraw.
*/
contract Escrow is Initializable, Secondary {
using SafeMath for uint256;
@ -32,9 +32,9 @@ contract Escrow is Initializable, Secondary {
}
/**
* @dev Stores the sent amount as credit to be withdrawn.
* @param payee The destination address of the funds.
*/
* @dev Stores the sent amount as credit to be withdrawn.
* @param payee The destination address of the funds.
*/
function deposit(address payee) public onlyPrimary payable {
uint256 amount = msg.value;
_deposits[payee] = _deposits[payee].add(amount);
@ -43,9 +43,9 @@ contract Escrow is Initializable, Secondary {
}
/**
* @dev Withdraw accumulated balance for a payee.
* @param payee The address whose funds will be withdrawn and transferred to.
*/
* @dev Withdraw accumulated balance for a payee.
* @param payee The address whose funds will be withdrawn and transferred to.
*/
function withdraw(address payable payee) public onlyPrimary {
uint256 payment = _deposits[payee];

View File

@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity ^0.5.2;
import "zos-lib/contracts/Initializable.sol";
@ -87,7 +87,7 @@ contract RefundEscrow is Initializable, ConditionalEscrow {
}
/**
* @dev Returns whether refundees can withdraw their deposits (be refunded). The overriden function receives a
* @dev Returns whether refundees can withdraw their deposits (be refunded). The overridden function receives a
* 'payee' argument, but we ignore it here since the condition is global, not per-payee.
*/
function withdrawalAllowed(address) public view returns (bool) {