Skip to content

Architecture] Implement Multi-Collection Creator Revenue Split Protocol Contract Extension #24

Description

@Darkvader-ship-it

Estimated Effort: 4 weeks / 7 days

Impacted Subsystems / Files:

  • contracts/phase-protocol/src/lib.rs
  • app/api/market/[id]/offers/[offer_id]/route.ts

Context & Problem Statement:
Currently, settle() in contracts/phase-protocol/src/lib.rs executes a fixed 95% creator / 5% protocol treasury split. Complex creator entities, co-artists, and DAOs cannot split settlement proceeds automatically on-chain, requiring insecure manual redistribution off-chain.

Technical Requirements & Scope:

  1. Add CollectionShares struct to contract storage mapping payee addresses to basis points (total 10,000 BP).
  2. Update create_collection to accept optional Vec<(Address, u32)> share definitions.
  3. Refactor settle() to iterate over payee shares and transfer exact stroop amounts atomically.
  4. Ensure treasury 5% fee split occurs prior to creator share distribution.

Multi-File Change Surface:
Requires breaking contract signature changes in contracts/phase-protocol/src/lib.rs, updating buildCreateCollectionTransaction and buildSettleTransaction in frontend UI, and updating API routes.

Acceptance Criteria:

  • On-chain settlement distributes funds atomically to up to 10 co-creator addresses.
  • Transaction fails gracefully if total payee basis points do not sum to 9,500 BP.
  • Emits collection_shares_settled event with array of payouts.

Suggested Approach / Investigation Steps:

  1. Define CollectionShares contract type and storage DataKey.
  2. Update settle() Rust function with split loop and arithmetic overflow checks.
  3. Modify UI collection creation modal in components/dashboard/ to configure splits.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions