protocol icon indicating copy to clipboard operation
protocol copied to clipboard

The value of calculateWithdrawableAmount is invalid.

Open Akira-Taniguchi opened this issue 5 years ago • 1 comments

Problem subject

  • [x] 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 avatar Jun 29 '20 13:06 Akira-Taniguchi

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.

aggre avatar Jun 29 '20 16:06 aggre