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

Claimed tokens overflow fix 2 #3

Closed
wants to merge 11 commits into from

Conversation

lightstreams
Copy link

This overflow bug causes hatches tokens to be locked and unable to be claimed.

Rollback to this commit to make the bug happen:
7114bd3

Runn test 04_claim_tokens_overflow.js

The problem is that during CommonsToken._curvedBurn() the unlockedInternal variable needs to be limited to a max of initialRaise. Otherwise, this causes unlockedInternal to just keep increasing whenever tokens are burned. Then in CommonsToken.claimTokens() the incorrect calculation of the variable toUnlock occurs and the function fails when too many tokens are attempted to be transferred to the hatcher.

…low bug to occur. The result of this bug is that any hatcher's tokens that are locked will remain locked and cannot be claimed.

The problem is during CommonsToken._curvedBurn() the unlockedInternal variable is not limited to a max of initialRaise. This causes the incorrect calculation of the variable toUnlock in CommonsToken.claimTokens() to be incorrect and the function fails.
contracts/bondingcurve/CommonsToken.sol Outdated Show resolved Hide resolved
@mikesmo mikesmo closed this Jan 8, 2020
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.

3 participants