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

Review the operations with hatching price #18

Open
EnchanterIO opened this issue Nov 21, 2019 · 3 comments
Open

Review the operations with hatching price #18

EnchanterIO opened this issue Nov 21, 2019 · 3 comments

Comments

@EnchanterIO
Copy link

EnchanterIO commented Nov 21, 2019

It seems like the operations with attribute p0 are not congruent/correct.

From the first short review: sometimes to calculate the unlocked tokens the contract multiplies with p0 and sometimes divides.

Example:

fundsAllocated() {
    unlockedInternal += _externalAllocated / p0;
claimTokens() {
    uint256 previouslyUnlockedInternal = (paidExternal / p0)
hatchContribute() {
    initialContributions[msg.sender].lockedInternal += contributed * p0;

I think it works only by accident given the p0 is 1 by default. Would be great to review the math here.

@EnchanterIO
Copy link
Author

@Eknir
Copy link
Contributor

Eknir commented Jan 20, 2020

What has lightstreams-network#9 to do with this issue?

@Eknir
Copy link
Contributor

Eknir commented Jan 20, 2020

42a601b
Fix

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

No branches or pull requests

2 participants