Skip to content

Unify claim status, share fee payment helper, consolidate slug/storage docs - #426

Merged
Naomi-Gift merged 1 commit into
HubDApp:mainfrom
king-aj-the-first:refactor/claims-fees-docs
Jul 27, 2026
Merged

Unify claim status, share fee payment helper, consolidate slug/storage docs#426
Naomi-Gift merged 1 commit into
HubDApp:mainfrom
king-aj-the-first:refactor/claims-fees-docs

Conversation

@king-aj-the-first

Copy link
Copy Markdown
Contributor

closes #337
closes #340
closes #374
closes #382

Summary

Cleanup pass addressing duplicated claim/fee logic and stale docs:

  • Claims: Collapse ClaimStatus / ContractClaimStatus into one shared ClaimStatus, add ClaimKind, and route both ownership and contract-address approve/reject paths through apply_claim_decision + transition_to_approved / transition_to_rejected.
  • Fees: Extract FeeManager::execute_fee_payment and have pay_fee / pay_registration_fee call it with their storage keys, amounts, and event metadata.
  • Slug docs: Merge PROJECT_SLUG_IMPLEMENTATION.md + SLUG_PR_SUMMARY.md into docs/PROJECT_SLUG.md; delete the duplicates.
  • Storage docs: Reconcile STORAGE_INDEXES.md with live StorageKey / ExtensionKey usage and explicitly exclude dead scaffolding (DataKey, FeeRefundRecord, FeeConfigHistory*, unused NextProjectId / ProjectLaunchTimestamp).

Changes

Task 1 — Unified claim workflow

  • Removed ContractClaimStatus; ContractClaimRequest.status now uses ClaimStatus.
  • Added ClaimKind::{Ownership, ContractAddress}.
  • Added shared transitions on ClaimStatus and ProjectRegistry::apply_claim_decision.
  • Updated approve_claim_request / reject_claim_request and approve_contract_claim / reject_contract_claim to use the shared path.
  • Updated contract-claim tests to assert ClaimStatus.

Task 2 — Shared fee payment helper

  • New private execute_fee_payment(env, payer, amount, token, paid_flag_key, details_key, event_project_id, operation).
  • pay_fee keeps owner-auth, then delegates.
  • pay_registration_fee keeps self-auth, then delegates.

Task 3 — Slug docs

  • Added docs/PROJECT_SLUG.md (merged canonical doc).
  • Removed PROJECT_SLUG_IMPLEMENTATION.md and SLUG_PR_SUMMARY.md.

Task 4 — Storage index docs

  • Prefixed documented indexes with live enum paths (StorageKey::… / ExtensionKey::…).
  • Added other live Vec-backed indexes used in code.
  • Added Dead scaffolding table so indexers do not treat unused keys/types as on-chain.

Test plan

  • cargo test claim (ownership claims)
  • cargo test issues_242_252_256 (contract-address claims)
  • cargo test fee-related tests (pay_fee / registration fee)
  • Confirm docs/PROJECT_SLUG.md is the only slug feature doc
  • Spot-check STORAGE_INDEXES.md dead-scaffolding list against storage_keys.rs / types.rs

@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@king-aj-the-first Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment