Skip to content

feat: add on-chain risk flags for programs and escrows#651

Merged
Jagadeeshftw merged 8 commits intoJagadeeshftw:masterfrom
daveades:feat/onchain-risk-flags
Feb 26, 2026
Merged

feat: add on-chain risk flags for programs and escrows#651
Jagadeeshftw merged 8 commits intoJagadeeshftw:masterfrom
daveades:feat/onchain-risk-flags

Conversation

@daveades
Copy link
Contributor

What

  • Introduces on-chain, admin-controlled risk flags for both program escrows and bounty escrows.
  • Adds a small bitmask enum (high risk, under review, restricted, deprecated) and audit events.
  • Exposes new admin APIs to set/clear flags and keeps flags visible in program/escrow metadata.
  • Adds tests for set/clear/visibility and documents semantics in contracts/RISK_FLAGS.md.

Why

  • Risk assessments often live off-chain; on-chain flags provide portable signals for UIs and analytics.
  • Admin-controlled + event-emitted changes make updates auditable and indexable.

Implementation Details

  • Program escrow: risk_flags added to ProgramData, plus set_program_risk_flags / clear_program_risk_flags and
    ProgramRiskFlagsUpdated event.
  • Bounty escrow: risk_flags added to EscrowMetadata, plus set_escrow_risk_flags / clear_escrow_risk_flags and
    RiskFlagsUpdated event.
  • SDK: ProgramData now includes risk_flags in contracts/sdk/src/program-escrow-client.ts.
  • Documentation: contracts/RISK_FLAGS.md.

Tests

  • contracts/bounty_escrow/contracts/escrow/src/test_risk_flags.rs
  • contracts/program-escrow/src/test_risk_flags.rs

Notes

  • Flags are advisory signals; intended for UI/analytics prioritization, not enforcement.

Closes #613

@vercel
Copy link

vercel bot commented Feb 25, 2026

@daveades is attempting to deploy a commit to the Jagadeesh B's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Jagadeeshftw
Copy link
Owner

please resolve the conflicts

1 similar comment
@Jagadeeshftw
Copy link
Owner

please resolve the conflicts

@Jagadeeshftw Jagadeeshftw merged commit 1a329ac into Jagadeeshftw:master Feb 26, 2026
1 of 4 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.

Add On-Chain Risk Flags for Programs and Escrows

2 participants