Skip to content

feat: Add DAO-compatible SlashingModule with trust decay#6

Open
dominusaxis wants to merge 1 commit intoNobayprotocol:mainfrom
dominusaxis:feat/slashing-module
Open

feat: Add DAO-compatible SlashingModule with trust decay#6
dominusaxis wants to merge 1 commit intoNobayprotocol:mainfrom
dominusaxis:feat/slashing-module

Conversation

@dominusaxis
Copy link

Summary

Implements the SlashingModule as requested in #1.

Features

Slash by DAO Vote:

  • proposeSlash(target, amount, reason) — any staker can propose
  • voteSlash(proposalId, support) — stakers vote for/against
  • executeSlash(proposalId) — executes after quorum reached + majority
  • Configurable quorum (default: 3 votes)

Slash by Dispute Outcome:

  • slashByDispute(target, amount, reason) — owner/DAO direct slash
  • Integrates with Escrow dispute resolution

Trust Decay:

  • calculateDecay(target) — computes decay based on time since staking
  • applyDecay(target) — applies decay (callable by anyone)
  • Configurable decay rate (default: 0.5%/day in basis points)

Integration with StakingModule:

  • Reads stake data via IStakingModule interface
  • effectiveStake(target) — returns stake minus total slashed
  • Emits Slashed(address, amount, reason) as specified

Contract: 232 lines

  • OpenZeppelin Ownable for DAO admin
  • Full proposal lifecycle: propose → vote → execute/cancel
  • Slash history tracking per address
  • View functions for proposals and effective stakes

Closes #1

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 DAO-compatible Slashing Module

1 participant