Description
Flag records and flag counts are keyed only by target_id, while giveaways and help requests have separate counters in the same numeric range. This allows flagging or suspension behavior to collide across content types that share the same ID.
User Story
As a Protocol User,
I want to flag the exact content item I intended,
so that moderation actions do not accidentally affect a giveaway and help request that happen to share the same numeric ID.
Requirements and Context
- Files / refs:
contracts/geev-core/src/governance.rs, contracts/geev-core/src/types.rs, contracts/geev-core/src/test.rs
- Replace
FlagRecord(u64, Address) and FlagCount(u64) with content-type-aware keys
- Update
flag_content, get_flag_count, has_flagged, and auto_suspend to resolve the correct content type explicitly
- Add regression tests covering same-ID giveaway and help-request coexistence
Suggested Implementation
1. Add a content type enum for Giveaway vs HelpRequest
2. Use (content_type, target_id, user) and (content_type, target_id) in governance storage
3. Require callers to specify content type when flagging and querying
4. Add regression tests proving same numeric IDs no longer collide
Acceptance Criteria
Submission Guidelines
- Branch:
fix/governance-flag-namespacing
- Depends on: None
- PR:
fix(governance): namespace flags by content type to prevent id collisions
Description
Flag records and flag counts are keyed only by
target_id, while giveaways and help requests have separate counters in the same numeric range. This allows flagging or suspension behavior to collide across content types that share the same ID.User Story
As a Protocol User,
I want to flag the exact content item I intended,
so that moderation actions do not accidentally affect a giveaway and help request that happen to share the same numeric ID.
Requirements and Context
contracts/geev-core/src/governance.rs,contracts/geev-core/src/types.rs,contracts/geev-core/src/test.rsFlagRecord(u64, Address)andFlagCount(u64)with content-type-aware keysflag_content,get_flag_count,has_flagged, andauto_suspendto resolve the correct content type explicitlySuggested Implementation
Acceptance Criteria
Submission Guidelines
fix/governance-flag-namespacingfix(governance): namespace flags by content type to prevent id collisions