feat(Karma): add minimum karma tier requirement for slashing#178
Open
0x-r4bbit wants to merge 1 commit into
Open
feat(Karma): add minimum karma tier requirement for slashing#1780x-r4bbit wants to merge 1 commit into
0x-r4bbit wants to merge 1 commit into
Conversation
Introduce a configurable tier gate on Karma.slash() so that only slashers holding a sufficient karma tier can execute a slash. - Add IKarmaTiers interface and wire karmaTiers + slashTierRequirement state variables into Karma (packed into one storage slot; gap reduced from 30 to 29) - Add setKarmaTiers() and setSlashTierRequirement() admin setters with corresponding events - Add internal _checkSlashTierRequirement() — skipped when karmaTiers is address(0); applies uniformly to all callers including admins - Add slash(account, rewardRecipient, slasher) overload for intermediary contracts (e.g. RLN) that act on behalf of a human initiator; the original two-argument signature is unchanged - Update RLN.slashReveal() to use the new overload, passing msg.sender so the tier check runs against the human who committed the slash - Add tests covering tier enforcement, admin parity, zero-address bypass, and event emission - Wire karma.setKarmaTiers() into DeployProtocol and add a deployment test asserting the link is established - Update docs (karma.md, admin-guide.md, rln.md)
gravityblast
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a configurable tier gate on Karma.slash() so that only slashers holding a sufficient karma tier can execute a slash.