diff --git a/contracts/payment/PullPayment.sol b/contracts/payment/PullPayment.sol index 7a5ce3f48..3e03f24b8 100644 --- a/contracts/payment/PullPayment.sol +++ b/contracts/payment/PullPayment.sol @@ -1,17 +1,20 @@ pragma solidity ^0.4.8; +import '../SafeMath.sol' + + /* * PullPayment * Base contract supporting async send for pull payments. * Inherit from this contract and use asyncSend instead of send. */ -contract PullPayment { +contract PullPayment is SafeMath { mapping(address => uint) public payments; // store sent amount as credit to be pulled, called by payer function asyncSend(address dest, uint amount) internal { - payments[dest] += amount; + payments[dest] = safeAdd(payments[dest], amount); } // withdraw accumulated balance, called by payee