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

should earnings_per_share be calculated in every claim? #1

Closed
qqonline opened this issue Aug 7, 2020 · 1 comment
Closed

should earnings_per_share be calculated in every claim? #1

qqonline opened this issue Aug 7, 2020 · 1 comment

Comments

@qqonline
Copy link

qqonline commented Aug 7, 2020

consider these call series, when earnings_per_share is zero and total_staked all zero:

1, deposit 100 unitOfToken;
2, make_proft with 100 unitOfProfit;

now, earnings_per_share should be 1;

3, deposit 1 unitOfToken more, total_staked be 101;
4, claim: payout will be 101 unitOfProfit?

related code:

amount.mul(magnitude).div(global_[0].total_stake)

@qqonline
Copy link
Author

qqonline commented Aug 7, 2020

            global_[0].earnings_per_share.mul(amount).sub(1).div(magnitude).add(1)

after the explain of the team, I noticed this line.

the entrie logic is correct.

issue closed.

@qqonline qqonline closed this as completed Aug 7, 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

No branches or pull requests

1 participant