You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You communicated that rewards are locked for either 6 months or until 80% of the network is staked. The bonded ratio starts at 80% and should decrease by 1% each week (so after e.g. 8 weeks it should be at ~72%).
Current Implementation
This function should return values from 80 down to 0. What it actually does is returning values from 100 down to 0.
function bondedTargetRewardUnlock() public view returns (uint256) {
uint256 passedTime = block.timestamp.sub(unbondingStartDate());
uint256 passedPercents = PERCENT_UNIT.mul(passedTime).div(unbondingPeriod()); // total duration from 0% to 100% is unbondingPeriod
if (passedPercents > PERCENT_UNIT) {
return 0;
}
return PERCENT_UNIT - passedPercents;
}
New implementation
So I'd suggest the following changes:
function bondedTargetStart() public pure returns (uint256) {
return 80;
}
// ...
function bondedTargetRewardUnlock() public view returns (uint256) {
uint256 passedTime = block.timestamp.sub(unbondingStartDate());
uint256 passedPercents = PERCENT_UNIT.mul(passedTime).div(unbondingPeriod());
if (passedPercents > bondedTargetStart()) {
// Limit passed percents to bondedTargetStart() as this is the maximum value
passedPercents = bondedTargetStart();
}
return bondedTargetStart() - passedPercents;
}
The text was updated successfully, but these errors were encountered:
ghost
changed the title
bondedTargetRewardUnlock starts at 100% instead of 80%
Rewards are not unlocked as communicated
Jan 27, 2020
ghost
changed the title
Rewards are not unlocked as communicated
"bondedTargetRewardUnlock" function returns wrong values in the wrong range
Jan 27, 2020
ghost
changed the title
"bondedTargetRewardUnlock" function returns wrong values in the wrong range
Function "bondedTargetRewardUnlock" returns wrong values in the wrong range
Jan 27, 2020
What's the issue?
You communicated that rewards are locked for either 6 months or until 80% of the network is staked. The bonded ratio starts at 80% and should decrease by 1% each week (so after e.g. 8 weeks it should be at ~72%).
Current Implementation
This function should return values from 80 down to 0. What it actually does is returning values from 100 down to 0.
New implementation
So I'd suggest the following changes:
The text was updated successfully, but these errors were encountered: