Skip to content

Add credential count cap per subject to prevent storage abuse #56

Description

@michaelvic123

Description

A single subject can accumulate unlimited credentials, causing unbounded storage growth. Add a configurable cap on credentials per subject.

Tasks

  • Add max_credentials_per_subject: u32 to contract config (set on initialize, default 100)
  • Check cap in issue_credential before creating new credential
  • Panic with clear message if cap exceeded
  • Add admin function update_credential_cap(env, admin, new_cap)
  • Add tests: issue up to cap, exceed cap panics, admin updates cap

Acceptance Criteria

  • Cap enforced on issuance
  • Admin can update cap
  • Tests pass

Complexity: Medium (150 pts)

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions