Skip to content

Commit

Permalink
Merge ba4248a into d5f06ab
Browse files Browse the repository at this point in the history
  • Loading branch information
pmosse committed May 29, 2018
2 parents d5f06ab + ba4248a commit 59ff60d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions contracts/payment/PullPayment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ contract PullPayment {
address payee = msg.sender;
uint256 payment = payments[payee];

require(payment != 0);
require(address(this).balance >= payment);
require(payment != 0, "No pending payments were found");
require(address(this).balance >= payment, "Not enough funds to do the payment");

totalPayments = totalPayments.sub(payment);
payments[payee] = 0;
Expand Down
14 changes: 7 additions & 7 deletions contracts/payment/SplitPayment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract SplitPayment {
* @dev Constructor
*/
constructor(address[] _payees, uint256[] _shares) public payable {
require(_payees.length == _shares.length);
require(_payees.length == _shares.length, "Amount of payees and shares do not match");

for (uint256 i = 0; i < _payees.length; i++) {
addPayee(_payees[i], _shares[i]);
Expand All @@ -40,7 +40,7 @@ contract SplitPayment {
function claim() public {
address payee = msg.sender;

require(shares[payee] > 0);
require(shares[payee] > 0, "No share was found");

uint256 totalReceived = address(this).balance.add(totalReleased);
uint256 payment = totalReceived.mul(
Expand All @@ -49,8 +49,8 @@ contract SplitPayment {
released[payee]
);

require(payment != 0);
require(address(this).balance >= payment);
require(payment != 0, "The share for the payee is zero");
require(address(this).balance >= payment, "Not enough funds to do the payment");

released[payee] = released[payee].add(payment);
totalReleased = totalReleased.add(payment);
Expand All @@ -64,9 +64,9 @@ contract SplitPayment {
* @param _shares The number of shares owned by the payee.
*/
function addPayee(address _payee, uint256 _shares) internal {
require(_payee != address(0));
require(_shares > 0);
require(shares[_payee] == 0);
require(_payee != address(0), "Invalid payee address");
require(_shares > 0, "Shares must be positive");
require(shares[_payee] == 0, "Payee already added");

payees.push(_payee);
shares[_payee] = _shares;
Expand Down

0 comments on commit 59ff60d

Please sign in to comment.