Fantom-foundation / fantom-sfc

The SFC (Special Fee Contract) maintains a list of validation stakers and delegators and distributes the rewards.
17 stars 11 forks source link

Rewards are not unlocked as communicated #11

Open ghost opened 4 years ago

ghost commented 4 years ago

What's the issue?

Rewards should be unlocked when the target bondedRatio is reached OR 6 months has passed.

Current Implementation

This function checks if the cap date has reached, if yes it checks if 6 months has passed from the last time the capReachedDate has been updated (which can also be updated if the current bonded ratio falls below the target bonded ratio and gets back up again. So this means rewards are not unlock after 6 months from mainnet start, but 6 months after the last capReachedDate update.

function rewardsAllowed() public view returns (bool) {
  if (capReachedDate == 0) {
    return false;
  }

  return block.timestamp >= unbondingUnlockPeriod() + capReachedDate;
}

New implementation

So I'd suggest the following changes:

function rewardsAllowed() public view returns (bool) {
  if (capReachedDate != 0) {
    return true;
  }

  return block.timestamp >= unbondingStartDate() + unbondingUnlockPeriod();
}

This, in combination with the issue described in https://github.com/Fantom-foundation/fantom-sfc/issues/10 will lead to a reward unlock that is far off of what was communicated to the community.

ghost commented 4 years ago

@MKong should we implement the new logic (issue #10 too)? Don't know which set of requirements was miscommunicated in the first place

ghost commented 4 years ago

@MKong what do you think about gradual unlocking of rewards? E.g. rewards gradually get unlocked starting from 4 months (% of unlocked rewards is linearly proportional to time passed since 4 months), and all rewards are unlocked after either 6 months or staked >= target?

ghost commented 4 years ago

@devintegral3 Do you mean the rewards are locked for 4 months (after mainnet launch), then they are linearly unlocked for a period over 2 months? So all rewards are unlocked after 6 months or staked >= target?

What do you think about keeping the reward lock for 6 months (as communicated atm) and then linearly unlock those rewards (of the first 6 months) over a period of X months. All newly generated rewards (that are generated after the unlock) will be available right away, without lockup or linearly unlock.

ghost commented 4 years ago

Do you mean the rewards are locked for 4 months (after mainnet launch), then they are linearly unlocked for a period over 2 months? So all rewards are unlocked after 6 months or staked >= target?

Yes

@MKong mentioned that we should implement the logic which was communicated to community