The value of calculateWithdrawableAmount is invalid.
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.
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.