Commit b33260ac by Schneider Jakob Committed by Facundo Spagnuolo

Remove assert and send in favor of transfer for PullPayment.sol (#823)

* Removed assert from send() and changed to transfer()

* Slightly adapted docs
parent 3fb8ecad
...@@ -7,7 +7,7 @@ import "../math/SafeMath.sol"; ...@@ -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 { ...@@ -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 { ...@@ -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);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment