Implement Financial Penalties#396
Open
goodness-cpu wants to merge 3 commits into
Open
Conversation
…otocol#360) Closes ShadeProtocol#360 Adds a self-imposed penalty rate (organizer commits up to 50% of payout) combined with a 7-day backer-governance vote window on any malicious- campaign report. If backers vote the campaign malicious by strict majority, the slashed portion of any withdrawal is detained in an on- chain penalty pool and distributed pro-rata to backers via claim_penalty_refund. Unclaimed remainder becomes sweepable 6 months after resolution for treasury consolidation. New entry points: - set_penalty_bps: organizer-only, locked once the first pledge lands - report_malicious: backer-only with anti-griefing 1% stake floor - vote_on_malice: one weighted vote per backer over a 7-day window - resolve_malice_report: strict-majority approval of penalty - claim_penalty_refund: pro-rata refund, idempotent - sweep_unclaimed_penalty: anyone, after a 6-month grace window Modifies execute_campaign and release_milestone to invoke compute_and_lock_penalty and emit PenaltySlashedEvent when the malice proposal has been approved. Both pathways also block while the malice vote window is still open to prevent the organizer from front-running the penalty vote. Storage uses 17 new DataKey variants and 13 new error variants (28..40). Happy-path and negative tests cover locking, voting, pro-rata math, milestone slashing, execute-blocking, sweep gating.
feat(crowdfund): financial penalties for malicious campaigns
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.
closes #360
Description
Type of Change
Related Issues
Fixes #
Changes Made
Testing
Checklist
Screenshots (if applicable)
Additional Notes