Skip to content

Commit

Permalink
Upgrade tests (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-CZ committed Sep 16, 2024
1 parent 241f434 commit f7431a1
Show file tree
Hide file tree
Showing 2 changed files with 420 additions and 559 deletions.
4 changes: 2 additions & 2 deletions contracts/sfc/SFCBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ contract SFCBase is SFCState {
return 0;
}
uint256 totalReward = epochDuration * _baseRewardPerSecond;
return totalReward * baseRewardWeight /totalBaseRewardWeight;
return totalReward * baseRewardWeight / totalBaseRewardWeight;
}

function _mintNativeToken(uint256 amount) internal {
Expand All @@ -68,7 +68,7 @@ contract SFCBase is SFCState {
if (lockupDuration != 0) {
uint256 maxLockupExtraRatio = Decimal.unit() - unlockedRewardRatio;
uint256 lockupExtraRatio = maxLockupExtraRatio * lockupDuration / c.maxLockupDuration();
uint256 totalScaledReward = fullReward * unlockedRewardRatio + lockupExtraRatio / Decimal.unit();
uint256 totalScaledReward = fullReward * (unlockedRewardRatio + lockupExtraRatio) / Decimal.unit();
reward.lockupBaseReward = fullReward * unlockedRewardRatio / Decimal.unit();
reward.lockupExtraReward = totalScaledReward - reward.lockupBaseReward;
} else {
Expand Down
Loading

0 comments on commit f7431a1

Please sign in to comment.