storyprotocol / protocol-periphery-v1

Periphery contract for story protocol, mainnet repo
MIT License
28 stars 20 forks source link

Introduce Workflows and Group IPA Features #43

Closed sebsadface closed 2 months ago

sebsadface commented 2 months ago

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:

  1. Mint a token → Register as new IP → Attach PIL license terms → Add to Group IP.
  2. Register an existing token as new IP → Attach PIL license terms → Add to Group IP.
  3. Register a new Group IP → Add multiple existing IPs to the Group.

Key Changes

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.