Skip to content

Implement subscription contract for recurring creator key access - #1131

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
funds0033-cmyk:feat/subscription-contract
Oct 29, 2026
Merged

Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
funds0033-cmyk:feat/subscription-contract

Conversation

@funds0033-cmyk

Copy link
Copy Markdown
Contributor

-## Summary
Implemented a Soroban smart contract for recurring subscription payments to access creator-gated content, featuring automatic expiration calculation, seamless renewal extensions, and on-chain event emissions[cite: 15].


What Was Implemented

  1. Core Contract Methods (accesslayer-contracts):

    • subscribe(key_id, duration_days): Locks the subscription fee and sets the expiry timestamp based on the requested duration[cite: 15].
    • renew_subscription(key_id): Extends the subscription expiry relative to the existing expiry timestamp[cite: 15].
    • get_subscription(wallet, key_id): View function returning the active status flag, expiry timestamp, and calculated days_remaining[cite: 15].
    • check_subscription(wallet, key_id): On-chain access control check queried by gated content contracts to verify valid subscriber status[cite: 15].
  2. Event Emission:

    • Emits SubscriptionCreated and SubscriptionExpired events containing wallet, key ID, and timestamp metadata[cite: 15].

Acceptance Criteria Verification

  • subscribe sets correct expiry timestamp for duration[cite: 15]
  • renew_subscription extends expiry correctly from current expiry[cite: 15]
  • check_subscription returns false after expiry timestamp[cite: 15]
  • get_subscription returns accurate days_remaining at any point[cite: 15]
  • Both events emitted with correct wallet, key, and timestamp data[cite: 15]

Closes #1074

@drips-wave

drips-wave Bot commented Oct 19, 2026

Copy link
Copy Markdown

@funds0033-cmyk 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

@Chucks1093

Copy link
Copy Markdown
Member

⚠️ Merge Conflict Detected

This PR currently has a merge conflict and cannot be merged until it is resolved.

Please rebase or merge the latest changes from the base branch into your branch and push again.

1 similar comment
@Chucks1093

Copy link
Copy Markdown
Member

⚠️ Merge Conflict Detected

This PR currently has a merge conflict and cannot be merged until it is resolved.

Please rebase or merge the latest changes from the base branch into your branch and push again.

@funds0033-cmyk
funds0033-cmyk force-pushed the feat/subscription-contract branch 6 times, most recently from 367853b to ffc7943 Compare October 28, 2026 09:45
Implemented a Soroban smart contract for recurring subscription payments to access creator-gated content, featuring automatic expiration calculation, seamless renewal extensions, and on-chain event emissions.

Core Contract Methods:
- subscribe(key_id, duration_days): Locks the subscription fee and sets the expiry timestamp based on the requested duration
- renew_subscription(key_id): Extends the subscription expiry relative to the existing expiry timestamp
- get_subscription(wallet, key_id): View function returning the active status flag, expiry timestamp, and calculated days_remaining
- check_subscription(wallet, key_id): On-chain access control check queried by gated content contracts to verify valid subscriber status

Event Emission:
- Emits SubscriptionCreated and SubscriptionRenewed events containing wallet, key ID, and timestamp metadata

Acceptance Criteria Verification:
- subscribe sets correct expiry timestamp for duration
- renew_subscription extends expiry correctly from current expiry
- check_subscription returns false after expiry timestamp
- get_subscription returns accurate days_remaining at any point
- Both events emitted with correct wallet, key, and timestamp data

Addresses issue accesslayerorg#1074

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@funds0033-cmyk
funds0033-cmyk force-pushed the feat/subscription-contract branch from ffc7943 to a6ba621 Compare October 28, 2026 09:50
@Chucks1093

Copy link
Copy Markdown
Member

✅ PR Ready for Review

Due to a recent malware incident affecting our repositories, all PRs are required to pass automated security checks before being reviewed for merging.

This PR has passed all automated checks:

  • ✅ Security scan — no malicious code detected
  • ✅ No merge conflicts
  • ✅ CI checks passed

Next step: Please share this PR link in our Telegram group so a maintainer can review and merge it: https://t.me/c/accesslayerorg/8514

@Chucks1093
Chucks1093 merged commit b603255 into accesslayerorg:main Oct 29, 2026
1 check 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.

Build subscription contract for recurring creator key access payments

2 participants