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

The value of calculateWithdrawableAmount is invalid. #467

Open
1 of 3 tasks
Akira-Taniguchi opened this issue Jun 29, 2020 · 1 comment
Open
1 of 3 tasks

The value of calculateWithdrawableAmount is invalid. #467

Akira-Taniguchi opened this issue Jun 29, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Akira-Taniguchi
Copy link
Member

Akira-Taniguchi commented Jun 29, 2020

Problem subject

  • Contracts
  • Tests
  • Other

Description

WithdrawStorage.getLastCum If ulativeGlobalHoldersPrice is 0 and If the another Property already has a large amount of staking, Withdraw.ca lculateWithdrawableAmount will be displayed more often if the Property already has a lot of staking.
The correct answer is WithdrawStorage.getLastCum If ulativeGlobalHoldersPrice is 0, the first staked You need to keep track of the value of Policy.rewards.
It will cost you even more money for gas, but when you lockup.lockup WithdrawStorage.setLastCum You might want to call ulativeGlobalHoldersPrice

Expected behavior/contents

WithdrawStorage.getLastCumulativeGlobalHoldersPrice is 0 and property already has a large amount of staking, Withdraw.calculateWithdrawableAmount returns the correct value.

Actual behavior/contents

WithdrawStorage.getLastCumulativeGlobalHoldersPrice is 0 and property already has a large amount of staking, Withdraw.calculateWithdrawableAmount returns the correct value.

@Akira-Taniguchi Akira-Taniguchi added the bug Something isn't working label Jun 29, 2020
@aggre
Copy link
Member

aggre commented Jun 29, 2020

I noticed that Withdraw.calculateWithdrawableAmount is not necessarily an unfair value.
The basis for that value is Lockup.getCumulativeLockedUp vs. Lockup.getCumulativeLockedUpAll ratio; That ratio is the same as the percentage of total rewards to which the Property is entitled. The holder(owner) has all of its rights until the Property balance changes. There is no question as I that.

Now, is it wrong to set the LastCumulativeGlobalReward for the user who locked up first? I haven't organized my thoughts yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants