Skip to content

feat: Implement On-chain Verification Submission Engine - #351

Open
akinboyewaSamson wants to merge 1 commit into
DigiNodes:mainfrom
akinboyewaSamson:feature/verification-submission-engine
Open

feat: Implement On-chain Verification Submission Engine#351
akinboyewaSamson wants to merge 1 commit into
DigiNodes:mainfrom
akinboyewaSamson:feature/verification-submission-engine

Conversation

@akinboyewaSamson

Copy link
Copy Markdown

closes #284

Title

feat: Implement On-chain Verification Submission Engine

Overview

This PR introduces the Verification Submission Engine for TruthBounty V2, migrating the core verification handling fully on-chain as per the protocol specification. This ensures every verification becomes an immutable, independently auditable protocol record.

Key Features & Changes

  • IVerificationSubmission Interface: Defines the canonical Verification data model, VerificationVerdict enum, and protocol events (VerificationSubmitted).
  • VerificationSubmission Engine:
    • Validates claim eligibility via integration with IClaimRegistry (ensuring claim exists, is UnderVerification, and within the deadline).
    • Securely locks verifier stakes using native ERC-20 safeTransferFrom semantics (satisfying the "no immediate transfers to winners/losers" requirement).
    • Implements strict anti-duplication measures (mapping(uint256 => mapping(address => bool))) to prevent duplicate verifications from the same wallet.
    • Exposes optimized getter functions (getClaimVerifications, getVerifierStake) for downstream Aggregation and Settlement modules.
  • Unit Tests & Gas Benchmarks: Added comprehensive Hardhat TypeScript tests (VerificationSubmission.test.ts) validating success conditions, failures, reentrancy guards, and gas profiles (approx. 272k gas for first submission, 238k for subsequent).

Related Issues

  • Resolves: SC-004 (Verification Submission Engine)
  • Depends On: SC-001 (On-Chain Claim Registry)

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-004 — Implement Verification Submission Engine

2 participants