Skip to content

RFC: Remove TCO2/Toucan Bridge Integration from Marketplace #2799

@glandua

Description

@glandua

Summary

This RFC proposes the complete removal of Toucan Carbon Token (TCO2) integration and Bridge functionality from app.regen.network. The integration spans frontend UI components, backend ledger modules, external API dependencies, and on-chain credit class data (C03).


1. Current State Analysis

1.1 On-Chain Assets (C03 Credit Class)

  • Credit Class ID: C03
  • Admin: regen1dlszg2sst9r69my4f84l3mj66zxcf3umcgujys30t84srg95dgvs8rn9rj
  • Type: Carbon (C)
  • Description: TCO2: Toucan Carbon Tokens Credit Class
  • Active Batches: 16+ on mainnet (all with open: true)

1.2 Frontend Components Affected

Core Bridge Feature

web-marketplace/src/features/ecocredit/BridgeFlow/
├── BridgeFlow.tsx
├── BridgeFlow.constants.ts
└── hooks/useCreditBridgeSubmit.tsx

Components

web-marketplace/src/components/organisms/BridgeModal/
web-marketplace/src/components/organisms/BridgedEcocreditsTable/
web-components/src/components/icons/ToucanIcon.tsx
web-components/src/components/modal/BridgeModal.tsx
web-components/src/components/form/BridgeForm.tsx

Dashboard/Routes

web-marketplace/src/pages/Dashboard/MyBridge/
web-marketplace/src/pages/Dashboard/hooks/useBridgeAvailabilty.tsx
web-marketplace/src/clients/regen/Regen.Routes.tsx

Type Definitions

web-marketplace/src/lib/db/types/json-ld/C03-toucan-batch.ts
web-marketplace/src/lib/db/types/json-ld/toucan-project-metadata.ts

1.3 Environment Variables

NEXT_PUBLIC_BRIDGE_API_URI=https://toucan-bridge-staging.herokuapp.com
NEXT_PUBLIC_TOUCAN_LINK=https://test.app.toucan.earth/?chainId=137
NEXT_PUBLIC_BRIDGE_CREDIT_CLASS_ID=C03
NEXT_PUBLIC_BRIDGE=  # Feature flag

2. Proposed Removal Scope

Phase 1: UI Removal (Frontend-Only)

Files to DELETE (~22 files):

  • web-marketplace/src/features/ecocredit/BridgeFlow/ (entire directory)
  • web-marketplace/src/components/organisms/BridgeModal/ (entire directory)
  • web-marketplace/src/components/organisms/BridgedEcocreditsTable/ (entire directory)
  • web-components/src/components/icons/ToucanIcon.tsx
  • web-components/src/components/modal/BridgeModal.tsx
  • web-components/src/components/form/BridgeForm.tsx
  • web-marketplace/src/pages/Dashboard/MyBridge/ (entire directory)
  • web-marketplace/src/pages/Dashboard/hooks/useBridgeAvailabilty.tsx
  • web-marketplace/src/lib/db/types/json-ld/C03-toucan-batch.ts
  • web-marketplace/src/lib/db/types/json-ld/toucan-project-metadata.ts
  • web-marketplace/public/png/toucan-basket.png

Files to MODIFY (~11 files):

  • web-marketplace/src/clients/regen/Regen.Routes.tsx
  • web-marketplace/src/lib/tracker/types.ts
  • web-marketplace/src/lib/db/types/json-ld/credit-batch-intersection-ld.ts
  • web-marketplace/src/lib/db/types/json-ld/index.ts
  • web-components/src/components/icons/icons.stories.tsx
  • web-components/src/components/modal/modal.stories.tsx
  • web-marketplace/src/lib/i18n/locales/en.po
  • web-marketplace/src/lib/i18n/locales/es.po
  • .env.example

Phase 2: Ledger Module Deprecation (Optional)

  • Requires governance proposal to remove "polygon" from AllowedBridgeChainTable
  • Would be tracked in separate issue in regen-network/regen-ledger

Phase 3: C03 Credit Class Handling

Recommendation: Hide from new listings, maintain read-only view for existing credits


3. Timeline Estimate

Phase Duration
Phase 1: UI Removal 8-12 days
Phase 2: Ledger (optional) 19-34 days
Phase 3: C03 Filtering 2-4 days

UI-only removal total: ~8-12 days


4. Risks & Mitigations

Risk Mitigation
C03 credit holders lose access Maintain read-only view
In-progress bridges fail Monitor pending bridges before cutoff
External integrations break Communicate deprecation timeline
Regression in purchase flow Comprehensive E2E testing

5. Rollback Plan

  1. Immediate: Set NEXT_PUBLIC_BRIDGE=false to disable UI
  2. Git revert for frontend changes
  3. Ledger changes require governance to re-enable

6. Recommended Approach

  1. Immediate: Set NEXT_PUBLIC_BRIDGE=false to disable bridge UI
  2. Week 1: Execute Phase 1 (UI removal)
  3. Week 2: Execute Phase 3 (C03 filtering)
  4. Month 2+: Evaluate need for Phase 2 (ledger deprecation)

7. Related Resources


Tasks Breakdown

  • Set NEXT_PUBLIC_BRIDGE=false in production
  • Delete BridgeFlow feature directory
  • Delete BridgeModal component directory
  • Delete BridgedEcocreditsTable directory
  • Delete ToucanIcon and shared bridge components
  • Delete MyBridge dashboard pages
  • Update Regen.Routes.tsx (remove bridge routes)
  • Remove bridge tracking types from tracker
  • Update JSON-LD type definitions
  • Remove bridge env variables from .env.example
  • Update Storybook stories
  • Add C03 filter to credit class queries
  • Update i18n locales
  • Update/remove related tests
  • QA testing on staging
  • Production deployment

Generated via Regen KOI MCP + Regen Ledger MCP

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