Repository navigation
feat(contracts): implement content license registry with purchase and revocation (#397, #398) - #414
Closed
nuvoraxis wants to merge 1 commit into
Conversation
… revocation (MindFlowInteractive#397, MindFlowInteractive#398) - Add modular Soroban smart contract in contracts/content_license - Implement versioned immutable license terms registry with creator authentication - Support configurable license terms: FreeToPlay, PaidPerPlay, and RemixAllowed - Support token fee specification, validity duration, revocation policy, and refund rules - Implement purchase_license: pays creator stated fee and creates immutable license grant bound to terms version bought - Implement revoke_license: creator-only revocation strictly enforcing terms policy (disallowing if terms prohibit) - Implement automatic fee refund to player on revocation when terms require - Implement license validity view is_license_active checking revocation and expiration - Add unit test suite in src/test.rs covering terms immutability, purchase with payment, revocation policy, refunds, and expiration - Add README.md documentation and workspace entry in Cargo.toml Closes MindFlowInteractive#397 Closes MindFlowInteractive#398
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
This Pull Request provides a comprehensive, production-grade Soroban smart contract for Puzzle Content Licensing across Stages 1 and 2, fulfilling all acceptance criteria for both #397 and #398:
Versioned License Terms Registry (Stage 1 - Content License Registry #397):
LicenseTermsstructure supportingFreeToPlay,PaidPerPlay, andRemixAllowed.get_current_termsandget_terms_by_version.License Purchase with Creator Fee Routing (Stage 2 - Content License Purchase and Revocation #398):
purchase_license: allows players to purchase licenses under current puzzle terms.soroban_sdk::token::Client.LicenseGrantbound strictly to the specific terms version bought.Policy-Based Revocation with Automated Refunds (Stage 2 - Content License Purchase and Revocation #398):
revoke_license: creator can revoke an active license grant only if the terms under which it was purchased allow revocation (RevocationNotAllowederror otherwise).AlreadyRevokederror).is_license_activevalidates non-revoked and non-expired state.Testing & Tooling:
src/test.rspassing with 100% success (covering immutability, versioning, purchases with payment, policy-enforced revocation, refunds, and expiration).Cargo.toml.contracts/content_license/README.md.Closes #397
Closes #398