Skip to content

SC-015: Implement verifier slashing engine - #342

Merged
dDevAhmed merged 4 commits into
DigiNodes:mainfrom
Adedoyinjr:feature/sc-015-verifier-slashing
Jul 29, 2026
Merged

SC-015: Implement verifier slashing engine#342
dDevAhmed merged 4 commits into
DigiNodes:mainfrom
Adedoyinjr:feature/sc-015-verifier-slashing

Conversation

@Adedoyinjr

@Adedoyinjr Adedoyinjr commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements SC-015 by upgrading the verifier slashing engine with deterministic claim-aware penalties, Treasury settlement, duplicate prevention, reputation notifications, immutable audit records, and fuzz/invariant coverage.

Changes

  • Added claim-aware slashVerifier(...)
  • Added duplicate offence prevention using:
    • claim ID
    • verifier address
    • reason hash
  • Added immutable slash records containing:
    • verifier
    • claim ID
    • slash amount
    • slash percentage
    • reason
    • reason hash
    • settlement epoch
    • offence ID
    • executor
    • timestamp
  • Added partial and full slashing support
  • Added configurable settlement epoch duration
  • Added optional reputation penalty receiver integration
  • Added direct Treasury settlement from Staking.forceSlash
  • Added SafeERC20 transfers
  • Preserved legacy slash() and batchSlash() behavior
  • Added SC-015 unit, integration, fuzz, invariant, and gas tests
  • Added gas benchmark documentation

Validation

  • npm run compile passes
  • Focused test result: 32 passing
  • Existing slashing tests: 21 passing
  • New SC-015 integration tests: 7 passing
  • Fuzz and invariant tests: 4 passing

Gas Benchmarks

  • Partial slash, 25%: 410,025 gas
  • Full slash, 100%: 400,389 gas

Invariant

Initial Locked Stake
=
Remaining Locked Stake
+
Total Slashed

Treasury balance increases by exactly the confiscated collateral amount.

Closes #295

@Adedoyinjr

Copy link
Copy Markdown
Contributor Author

Hi maintainers, SC-015 is ready for review. The required Fuzz Tests, Invariant Tests, Lint, and Test workflows are currently awaiting maintainer approval because this PR comes from a fork. Please approve the workflows when convenient. Thank you.

@dDevAhmed

Copy link
Copy Markdown
Contributor

resolve conflicts @Adedoyinjr

@Adedoyinjr
Adedoyinjr force-pushed the feature/sc-015-verifier-slashing branch 2 times, most recently from e75228e to 46ba69a Compare July 29, 2026 16:14
@Adedoyinjr

Copy link
Copy Markdown
Contributor Author

Hi @dDevAhmed, the merge conflicts have been resolved and the branch is now mergeable.

The latest CI run installs dependencies and passes lint successfully. The remaining checks fail during compilation on an existing main-branch syntax error in contracts/TruthBounty.sol:273, where the constructor is missing its closing brace before _resolverRole().

The separate Foundry workflows also encounter existing invalid/missing import paths in the repository test suite. These failures occur before the SC-015 tests execute and are unrelated to the changes in this PR.

Could you please confirm whether you would prefer the baseline CI issues to be fixed separately, or whether I should include those unrelated corrections in this PR?

@dDevAhmed
dDevAhmed merged commit c0c8d21 into DigiNodes:main Jul 29, 2026
4 of 8 checks passed
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.

SC-015 — Implement Verifier Slashing Engine

2 participants