Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce RoyaltyWorkflows for IP Revenue Claiming #74

Merged
merged 5 commits into from
Sep 23, 2024

Conversation

sebsadface
Copy link
Member

Description

This PR introduces the RoyaltyWorkflows contract, which allows IP royalty token holders to claim revenue across multiple revenue tokens and snapshots in a single function call.

Key Functions and Use Cases:

  • transferToVaultAndSnapshotAndClaimByTokenBatch:

    • What it does: Transfers royalties from descendant IPs to the ancestor IP’s royalty vault, takes a snapshot, and claims all available revenue for the IP in the latest snapshot.
    • Use Case: For IP royalty token holders who want to claim both their direct revenue and royalties from descendant IPs.
  • transferToVaultAndSnapshotAndClaimBySnapshotBatch:

    • What it does: Same as transferToVaultAndSnapshotAndClaimByTokenBatch, but also claims revenue from specific snapshots.
    • Use Case: For IP royalty token holders who want to claim both direct revenue and descendant royalties from the latest snapshot and previously taken snapshots.
  • snapshotAndClaimByTokenBatch:

    • What it does: Takes a snapshot of the IP’s royalty vault and claims all available revenue in each revenue token for the IP.
    • Use Case: For IP royalty token holders who want to claim the current revenue in their IP’s royalty vault (which may or may not include descendant royalties).
  • snapshotAndClaimBySnapshotBatch:

    • What it does: Same as snapshotAndClaimByTokenBatch, but also includes claims from specific snapshots.
    • Use Case: For IP royalty token holders who want to claim the current revenue in their IP’s royalty vault from the latest snapshot and previously taken snapshots.

Additional Changes:

  • Added deployment and upgrade scripts for RoyaltyWorkflows.
  • Updated Users.t.sol and MockERC20.sol to support royalty workflow testing.

Test Plan

Added test cases for each new function. Tests simulate a IP graph structure with different policies, licenses, and revenue tokens to test function behaviors. For details, see test/workflows/RoyaltyWorkflows.t.sol.
All new and existing tests pass locally.

Related Issue

Closes #34

@sebsadface sebsadface marked this pull request as ready for review September 22, 2024 03:11
Copy link
Collaborator

@kingster-will kingster-will left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@sebsadface sebsadface merged commit 0e3bfea into storyprotocol:main Sep 23, 2024
3 checks passed
@sebsadface sebsadface deleted the royalty-features branch October 16, 2024 04:25
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.

Add Royalty Features to SPG
2 participants