From 0f2d32470d2f1892d49bd025d54495cd6f1e0f5f Mon Sep 17 00:00:00 2001 From: Quentin Gaultier Date: Mon, 24 Apr 2017 10:47:08 +0200 Subject: [PATCH] fix contract 5 --- 5_fix_CountContribution.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/5_fix_CountContribution.sol b/5_fix_CountContribution.sol index 9c9c583..d7cea1f 100644 --- a/5_fix_CountContribution.sol +++ b/5_fix_CountContribution.sol @@ -22,6 +22,8 @@ contract CountContribution{ * @param _amount The amount of the contribution. */ function recordContribution(address _user, uint _amount) { + require(contribution[_user] + _amount >= contribution[_user]); + require(totalContributions + _amount >= totalContributions); contribution[_user]+=_amount; totalContributions+=_amount; }