This PR initiates the process of breaking down the monolithic StoryProtocolGateway contract into smaller, specialized contracts, each responsible for a specific interaction stream with the core protocol. We refer to these contracts as "workflows." This restructuring aims to manage the growing functionalities of SPG while adhering to the size limits for a single contract.
Additionally, this PR introduces a new GroupingWorkflows contract to support Group IPA features from protocol core (see PR#192). This contract allow the following operations in a single call:
Mint a token → Register as new IP → Attach PIL license terms → Add to Group IP.
Register an existing token as new IP → Attach PIL license terms → Add to Group IP.
Register a new Group IP → Add multiple existing IPs to the Group.
Key Changes
Introduced a BaseWorkflow contract to encapsulate shared variables, modifiers, and functions across different workflows.
Created internal library contracts for handling licensing, metadata, and permissions, which are shared between various workflows.
Refactored SPG to inherit from BaseWorkflow and utilize the new internal library contracts.
Added the GroupingWorkflows contract, inheriting from BaseWorkflow, to support Group IPA features.
Test Plan
New tests have been added to cover the Group IPA features. All new and existing tests pass locally.
Related Issues
This PR closes #35 and #42.
Note
The current deploy and upgrade script does not yet include deployment or upgrade logic for the GroupingWorkflows contract. This will be addressed in a future PR.
Description
This PR initiates the process of breaking down the monolithic
StoryProtocolGateway
contract into smaller, specialized contracts, each responsible for a specific interaction stream with the core protocol. We refer to these contracts as "workflows." This restructuring aims to manage the growing functionalities of SPG while adhering to the size limits for a single contract.Additionally, this PR introduces a new
GroupingWorkflows
contract to support Group IPA features from protocol core (see PR#192). This contract allow the following operations in a single call:Key Changes
BaseWorkflow
contract to encapsulate shared variables, modifiers, and functions across different workflows.BaseWorkflow
and utilize the new internal library contracts.GroupingWorkflows
contract, inheriting fromBaseWorkflow
, to support Group IPA features.Test Plan
New tests have been added to cover the Group IPA features. All new and existing tests pass locally.
Related Issues
This PR closes #35 and #42.
Note
The current deploy and upgrade script does not yet include deployment or upgrade logic for the
GroupingWorkflows
contract. This will be addressed in a future PR.