Remove assert and send in favor of transfer for PullPayment.sol (#823)
* Removed assert from send() and changed to transfer() * Slightly adapted docs
This commit is contained in:
committed by
Facundo Spagnuolo
parent
3fb8ecad76
commit
b33260ac44
@ -7,7 +7,7 @@ import "../math/SafeMath.sol";
|
|||||||
/**
|
/**
|
||||||
* @title PullPayment
|
* @title PullPayment
|
||||||
* @dev Base contract supporting async send for pull payments. Inherit from this
|
* @dev Base contract supporting async send for pull payments. Inherit from this
|
||||||
* contract and use asyncSend instead of send.
|
* contract and use asyncSend instead of send or transfer.
|
||||||
*/
|
*/
|
||||||
contract PullPayment {
|
contract PullPayment {
|
||||||
using SafeMath for uint256;
|
using SafeMath for uint256;
|
||||||
@ -16,7 +16,7 @@ contract PullPayment {
|
|||||||
uint256 public totalPayments;
|
uint256 public totalPayments;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev withdraw accumulated balance, called by payee.
|
* @dev Withdraw accumulated balance, called by payee.
|
||||||
*/
|
*/
|
||||||
function withdrawPayments() public {
|
function withdrawPayments() public {
|
||||||
address payee = msg.sender;
|
address payee = msg.sender;
|
||||||
@ -28,7 +28,7 @@ contract PullPayment {
|
|||||||
totalPayments = totalPayments.sub(payment);
|
totalPayments = totalPayments.sub(payment);
|
||||||
payments[payee] = 0;
|
payments[payee] = 0;
|
||||||
|
|
||||||
assert(payee.send(payment));
|
payee.transfer(payment);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user