ChainSafe / ChainSafe/open-creator-rails
Feature: Claim triggers upon subscription add/extend/renew
- Dominant language
- Solidity
- Stars
- 2
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
**What**
Set up claim triggers when a subscription is added, extended, or renewed. Provide a notification service for creators and registry owners to claim once a subscription duration has elapsed, rather than allowing claims to stack across multiple nonce entries.
**Why**
When subscriptions are renewed with different prices or registry fee shares, the nonce increments and claim loops must iterate over every historical subscription entry (`O(n)` in `_claimable`). Stacked, unclaimed periods compound this cost over time.
Proactive claim triggers at subscription lifecycle events would encourage timely claims and reduce the backlog of nonce entries that future claim transactions must loop through — avoiding stacked claims and keeping gas predictable.
**How**
- Emit structured events (or extend existing `SubscriptionAdded`, `SubscriptionExtended`, `SubscriptionRenewed` events) with enough data for off-chain indexers to schedule claim reminders.
- Design an off-chain notification service (webhook, indexer, or SDK helper) that alerts creators and registry owners when a subscription period has elapsed and is claimable.
- Define trigger semantics: when should a reminder fire (e.g. at `endTime`, at period boundaries within a multi-period subscription)?
- Consider optional on-chain hooks or a dedicated `notifyClaimable` view/helper to simplify indexer integration.
- Document recommended claim cadence for asset owners and registry operators.
- Evaluate integration with existing chunked-claim work (#113) as a fallback when reminders are missed.
**Acceptance Criteria**
- Subscription lifecycle events (or a new event) provide sufficient data for off-chain claim scheduling.
- A documented notification pattern exists for creators and registry owners to claim when a subscription duration elapses.
- Design rationale explains how timely claims reduce nonce loop size and gas cost.
- Trade-offs are documented (e.g. reliance on off-chain infra vs. on-chain enforcement).
Contributor guide
Research direction
Start by reviewing the subscription lifecycle events—SubscriptionAdded, SubscriptionExtended, and SubscriptionRenewed—and the _claimable loop to understand what indexers need for scheduling. Compare the design with the chunked-claim work in #113. Done means the event or helper design, notification pattern, claim cadence, gas rationale, and on-chain/off-chain trade-offs are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- solidity
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100