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

124 add functions in the contracts that allow minstake and mindelegation to be changeable by the governor #11

Conversation

SamBorisov
Copy link
Contributor

  1. Add an external function in RewardPool changeMinDelegation, that is callable only by the default_admin_role (governance)
  2. A private function that handles the logic for changing minDelegation and is used on initializing
  3. Add new custom error - InvalidMinDelegation
  4. Add an external function in RewardPool changeMinStake, that is callable only by the owner (governance)
  5. A private function that handles the logic for changing minStake and is used on initializing
  6. Apply needed updates on Interfaces
  7. Add tests to see if functions work
  8. Fix RewardPool initializing with system address, not governance on tests. Apply needed changes so it all works well.

@SamBorisov SamBorisov requested a review from R-Santev April 30, 2024 10:27
contracts/RewardPool/modules/DelegationRewards.sol Outdated Show resolved Hide resolved
contracts/RewardPool/modules/DelegationRewards.sol Outdated Show resolved Hide resolved
contracts/common/Errors.sol Outdated Show resolved Hide resolved
test/ValidatorSet/Delegation.test.ts Outdated Show resolved Hide resolved
@SamBorisov SamBorisov requested a review from R-Santev May 7, 2024 14:53
@@ -8,5 +8,5 @@ error InvalidSignature(address signer);
error ZeroAddress();
error SendFailed();
error InvalidCommission(uint256 commission);
error InvalidMinStake(uint256 minStake);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is used for common errors that are resued in more than one module. Declare module specific errors in the module itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved errors for minStake/minDelegetion and commission

@SamBorisov SamBorisov requested a review from R-Santev May 8, 2024 12:26
@SamBorisov SamBorisov requested a review from R-Santev May 9, 2024 12:53
@R-Santev R-Santev self-requested a review May 10, 2024 07:49
@SamBorisov SamBorisov force-pushed the 124-add-functions-in-the-contracts-that-allow-minstake-and-mindelegation-to-be-changeable-by-the-governor branch from 4af14fb to 068e07b Compare May 10, 2024 08:20
@SamBorisov SamBorisov merged commit 5420121 into main May 10, 2024
0 of 7 checks passed
@SamBorisov SamBorisov deleted the 124-add-functions-in-the-contracts-that-allow-minstake-and-mindelegation-to-be-changeable-by-the-governor branch May 10, 2024 08:33
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.

2 participants