Skip to content

feat(contracts): implement content license registry module (#397) - #408

Closed
nuvoraxis wants to merge 1 commit into
MindFlowInteractive:mainfrom
nuvoraxis:feat/397-content-license-registry
Closed

nuvoraxis wants to merge 1 commit into
MindFlowInteractive:mainfrom
nuvoraxis:feat/397-content-license-registry

Conversation

@nuvoraxis

Copy link
Copy Markdown
Contributor

Summary of Changes

This pull request implements the Content License Registry module for the Quest Contract ecosystem as requested in #397.

Key Features & Architecture

  • Location: contracts/content_license
  • License Model: Supports FreeToPlay, PaidPerPlay (with customizable per-play token fee), and RemixAllowed.
  • Creator Access Control: Only the registered creator of a puzzle can publish new terms or update versions. Initial publication anchors the creator address to the puzzle.
  • Strict Immutability: Terms are stored under (Symbol("TERMS"), puzzle_id, version). Published versions cannot be altered or overwritten in place; updating terms increments the version number.
  • Version Query API: Exposes get_current_terms(puzzle_id) for active rules, and get_terms_by_version(puzzle_id, version) for full historical auditability.
  • Audit Events: Emits standard Soroban events on every term publication: topic: (license, puzzle_id), data: (creator, new_version).
  • Admin Governance: Allows transferring the admin role via two-way authorized transfer_admin.
  • Unit Test Suite: Thorough test coverage in contracts/content_license/src/test.rs covering initial publication, version increments, immutability of historical versions, unauthorized update rejection, non-existent puzzle handling, and admin transfers.
  • Documentation: Complete README.md detailing data models, storage schema, error codes, and integration examples.

Verification

  • cargo check --package content_license passed with 0 errors.
  • Added to root Cargo.toml workspace members.

Closes #397

…nteractive#397)

- Add reusable Soroban smart contract in contracts/content_license
- Implement LicenseType enum supporting FreeToPlay, PaidPerPlay, and RemixAllowed
- Implement LicenseTerms struct tracking creator, puzzle ID, version, fees, and URI
- Implement creator-only register_terms function enforcing immutable historical versions
- Store terms persistently by (puzzle_id, version) to prevent in-place edits
- Expose read functions for get_current_terms and get_terms_by_version
- Emit Soroban events on term publication: (license, puzzle_id) -> (creator, version)
- Support secure admin transfer via transfer_admin
- Add comprehensive unit test suite in src/test.rs
- Add detailed README.md documentation and workspace entry in Cargo.toml

Closes MindFlowInteractive#397
@Mkalbani Mkalbani closed this Nov 21, 2026
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.

Content License Registry

2 participants