Skip to content

Design and implement multi-chain MembershipNFT support (deferred area) #275

Description

@Lakes41

Difficulty: Expert
Type: feature

Background
The README explicitly lists "Multi-chain support (current: EVM only)" as a deferred area, and notes that after deploying MembershipNFT, operators set a single MEMBERSHIP_NFT_ADDRESS and CHAIN_ID in .env — implying the current architecture assumes one contract on one chain.

Problem
Communities that deploy MembershipNFT on more than one EVM chain (e.g., mainnet + an L2) have no way to represent that in the data model or access API, since membership resolution is implicitly single-chain.

Expected outcome
The data model and access API support multiple (chainId, contractAddress) pairs per community, with membership resolution correctly disambiguating a wallet's memberships across chains, and packages/contracts exposing per-chain ABI/address configuration instead of a single global address.

Suggested implementation

  • Extend the memberships/communities Prisma schema to key membership records by (chainId, contractAddress, tokenId) rather than assuming a single global contract.
  • Update packages/contracts to support a registry of { chainId, address, abi } entries per community instead of a single MEMBERSHIP_NFT_ADDRESS/CHAIN_ID pair.
  • Update the event-ingestion module (see the reorg-handling issue, if implemented, or the current test-simulated flow) to run per configured chain and correctly attribute events to the right (chainId, contractAddress).
  • Update /v1/memberships/:wallet and /v1/access/check to correctly aggregate or disambiguate memberships across chains for a single wallet.
  • Update .env.example, README, and docs/openapi.json to reflect the new multi-chain configuration model, including a migration guide from the current single-chain setup.

Acceptance criteria

  • A community can be backed by MembershipNFT deployments on more than one chain simultaneously
  • Membership resolution correctly attributes and aggregates per-chain state
  • Existing single-chain deployments continue to work via a documented migration path
  • README/.env.example/OpenAPI updated

Likely affected files/directories

  • packages/contracts/
  • apps/access-api/prisma/schema.prisma
  • apps/access-api/src/routes/
  • .env.example
  • README.md, docs/openapi.json

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

    Labels

    GrantFox OSSGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesOfficial Campaign | FWC26Official FWC26 campaign issue — eligible for campaign scoring and rewardsexpertExpert difficulty tasks requiring deep expertise and architectural decision-makingfeatureNew feature, enhancement, or functional addition

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions