Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement reward cap and commission cap #402

Merged
merged 7 commits into from
Apr 26, 2024
Merged

implement reward cap and commission cap #402

merged 7 commits into from
Apr 26, 2024

Conversation

ianhe8x
Copy link
Contributor

@ianhe8x ianhe8x commented Apr 21, 2024

Changes - RewardsDistributor

Storage

  • add maxCommissionFactor
  • add maxRewardFactor

Event

  • add event ReturnRewards(address indexed runner, uint256 token, uint256 commission)

Function

  • function setMaxCommissionFactor(uint256 _maxCommissionFactor) external onlyOwner
  • function setMaxRewardFactor(uint256 _maxRewardFactor) external onlyOwner

Logic

  • total reward can not greater than maxRewardFactor * totalStake
  • commission can not greater than maxCommissionFactor * selfStake
  • exceeded rewards is returned to treasury

@ianhe8x ianhe8x requested review from mzxyz and nz-neooo April 21, 2024 22:21
@ianhe8x ianhe8x marked this pull request as ready for review April 22, 2024 23:36
@ianhe8x ianhe8x merged commit 0b3217f into develop Apr 26, 2024
2 checks passed
@ianhe8x ianhe8x deleted the capped-rewards branch April 26, 2024 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant