Skip to content

Commit 22ee2de

Browse files
committed
withdraw what you can
1 parent 01cc936 commit 22ee2de

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

SampleOffer.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ contract SampleOffer {
9595
if (msg.sender != contractor)
9696
throw;
9797
uint amount = (now - dateOfSignature + 1 days) / (1 days) * dailyWithdrawLimit - paidOut;
98+
if (amount > this.balance) {
99+
amount = this.balance;
100+
}
98101
if (contractor.send(amount))
99102
paidOut += amount;
100103
}

0 commit comments

Comments
 (0)