Skip to content

Implement Financial Penalties#396

Open
goodness-cpu wants to merge 3 commits into
ShadeProtocol:mainfrom
goodness-cpu:revert-1-implement-financial-penalties
Open

Implement Financial Penalties#396
goodness-cpu wants to merge 3 commits into
ShadeProtocol:mainfrom
goodness-cpu:revert-1-implement-financial-penalties

Conversation

@goodness-cpu

Copy link
Copy Markdown

closes #360

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Test improvements
  • Other (please describe):

Related Issues

Fixes #

Changes Made

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • All existing tests pass locally
  • I have tested this manually

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Additional Notes

…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
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.

Implement Financial Penalties for Malicious Campaigns

1 participant