Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix contract 5 #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

gaultierq
Copy link

No description provided.

@@ -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);
Copy link

@n1c01a5 n1c01a5 Apr 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't sure the second check is necessary. If the first test is okay, the input amount is a valid number.
Your overflow check is good idea but I think there is an another issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants