Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .cursor/rules/general.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This project is Tangle dApp - a monorepo containing multiple dApp projects that
- `components/`: "Dumb", mostly re-usable components that are specific to Tangle dApp. Usually if a component is re-usable and generic enough to be used in other dApps, it should be placed within either `libs/tangle-shared-ui` or `libs/ui-components/`.
- `containers/`: "Smart" React components with business logic that fetch, calculate or otherwise interact with stuff that isn't passed directly as props. These smart components usually reuse components from `components/` folder, and even other containers too.
- `hooks/`: React hooks containing core infrastructure logic & functionality.
- `data/`: React hooks containing data fetching logic, generally organized by their corresponding areas (such as restaking, liquid staking, etc.).
- `data/`: React hooks containing data fetching logic, generally organized by their corresponding areas (such as staking, liquid staking, etc.).
- `pages/`: Contains pages of the dApps, which are used by `react-router-dom`.
- `abi/`: Contains EVM ABI definitions as a JS object, which is used when utilizing Viem to call Substrate precompiles. This is useful for when EVM accounts interact with our dApp and call extrinsics.

Expand All @@ -65,4 +65,4 @@ Tangle dApp is the main product and focus of the monorepo. Here's the tech stack

# Library: `libs/tangle-shared-ui`

Contains shared logic, hooks, and utility functions between multiple Tangle dApps, such as `tangle-cloud` & `tangle-dapp`. This differs from `ui-components` in that `ui-components` is more geared towards general & re-usable components, not necesarily tied to any context, whereas `libs/tangle-shared-ui` is specific to Tangle-related logic.
Contains shared logic, hooks, and utility functions between multiple Tangle dApps, such as `tangle-cloud` & `tangle-dapp`. This differs from `ui-components` in that `ui-components` is more geared towards general & re-usable components, not necesarily tied to any context, whereas `libs/tangle-shared-ui` is specific to Tangle-related logic.
25 changes: 25 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,28 @@ export NX_ADD_PLUGINS=false
export ESLINT_USE_FLAT_CONFIG=false

export VITE_GRAPHQL_ENDPOINT='https://mainnet-gql.tangle.tools/graphql'

# Credits claim data (off-chain proofs)
export VITE_CREDITS_TREE_URL='/data/credits-tree.json'
export VITE_CREDITS_TREE_URL_84532=''
export VITE_CREDITS_TREE_URL_8453=''

# Credits contract address overrides (optional)
# You can set a chain-specific address, e.g. VITE_CREDITS_ADDRESS_84532 for Base Sepolia.
export VITE_CREDITS_ADDRESS=''
export VITE_CREDITS_ADDRESS_84532=''
export VITE_CREDITS_ADDRESS_8453=''

# Migration claim (optional for general staking; required to validate /claim/migration end-to-end)
# Contract address (if unset or zero-address, migration claim flow is treated as unconfigured)
export VITE_TANGLE_MIGRATION_ADDRESS=''
# Proof data location (local or hosted JSON)
export VITE_MIGRATION_PROOFS_URL='/data/migration-proofs.json'
# RPC endpoint used by migration claim reads
export VITE_MIGRATION_RPC_URL=''
# Optional claim relayer endpoint (if unset, wallet-signing mode is used)
export VITE_CLAIM_RELAYER_URL=''
# Optional SP1 prover API (for off-chain proof generation)
export VITE_SP1_PROVER_API_URL=''
# Optional dev override for local proof mocking
export VITE_MOCK_PROOF=false
2 changes: 1 addition & 1 deletion .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ You can contact Tangle Network via Email: drew@tangle.tools

This Code of Conduct is distributed under a [Creative Commons Attribution-ShareAlike license](https://creativecommons.org/licenses/by-sa/4.0/).

Portions of text derived from the the [Parity Code of Conduct](https://github.com/openethereum/parity-ethereum/blob/v2.7.2-stable/.github/CODE_OF_CONDUCT.md), and [Django Code of Conduct](https://www.djangoproject.com/conduct/) and the [Geek Feminism Anti-Harassment Policy](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy).
Portions of text derived from the the [Parity Code of Conduct](https://github.com/openethereum/parity-ethereum/blob/v2.7.2-stable/.github/CODE_OF_CONDUCT.md), and [Django Code of Conduct](https://www.djangoproject.com/conduct/) and the Geek Feminism Anti-Harassment Policy.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-storybook-docs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'Publish Storybook Docs 📚'

on:
# TODO: Enable this when Storybook build is fixed
# NOTE: Enable this when Storybook build is fixed
# push:
# branches:
# - develop
Expand Down
20 changes: 19 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,29 @@ tmp
vite.config.*.timestamp*

# Generated graphql files
libs/tangle-shared-ui/src/graphql/
libs/tangle-shared-ui/src/graphql/*
!libs/tangle-shared-ui/src/graphql/graphql.ts
!libs/tangle-shared-ui/src/graphql/index.ts

vitest.config.*.timestamp*

# React Scan reports
reports/
agent-results/
.agent-wallet-profile/
.cursor/rules/nx-rules.mdc
.github/instructions/nx.instructions.md

# Contracts - Foundry build artifacts
contracts/**/cache/
contracts/**/out/
contracts/**/broadcast/

# Contracts - Rust/SP1 build artifacts
contracts/**/target/

# Contracts - Generated migration data (large files)
**/migration-proofs.json
contracts/**/evm-claims.json

docs/cloud-qa
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18
18.18
4 changes: 2 additions & 2 deletions .windsurf/rules/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This project is Tangle dApp - a monorepo containing multiple dApp projects that
- `components/`: "Dumb", mostly re-usable components that are specific to Tangle dApp. Usually if a component is re-usable and generic enough to be used in other dApps, it should be placed within either `libs/tangle-shared-ui` or `libs/ui-components/`.
- `containers/`: "Smart" React components with business logic that fetch, calculate or otherwise interact with stuff that isn't passed directly as props. These smart components usually reuse components from `components/` folder, and even other containers too.
- `hooks/`: React hooks containing core infrastructure logic & functionality.
- `data/`: React hooks containing data fetching logic, generally organized by their corresponding areas (such as restaking, liquid staking, etc.).
- `data/`: React hooks containing data fetching logic, generally organized by their corresponding areas (such as staking, liquid staking, etc.).
- `pages/`: Contains pages of the dApps, which are used by `react-router-dom`.
- `abi/`: Contains EVM ABI definitions as a JS object, which is used when utilizing Viem to call Substrate precompiles. This is useful for when EVM accounts interact with our dApp and call extrinsics.

Expand All @@ -65,4 +65,4 @@ Tangle dApp is the main product and focus of the monorepo. Here's the tech stack

# Library: `libs/tangle-shared-ui`

Contains shared logic, hooks, and utility functions between multiple Tangle dApps, such as `tangle-cloud` & `tangle-dapp`. This differs from `ui-components` in that `ui-components` is more geared towards general & re-usable components, not necesarily tied to any context, whereas `libs/tangle-shared-ui` is specific to Tangle-related logic.
Contains shared logic, hooks, and utility functions between multiple Tangle dApps, such as `tangle-cloud` & `tangle-dapp`. This differs from `ui-components` in that `ui-components` is more geared towards general & re-usable components, not necesarily tied to any context, whereas `libs/tangle-shared-ui` is specific to Tangle-related logic.
33 changes: 33 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Tangle dApp monorepo (Nx + Yarn)

## Quick commands
- Install: `yarn install` (Node `>=18.18.x`, Yarn `4.x`)
- Run dApp: `yarn nx serve tangle-dapp` (default `http://localhost:4200`)
- Lint/test/build: `yarn lint`, `yarn test`, `yarn build`

## Env
- Start from `.env.example` (Vite vars are `VITE_*`)
- Set `VITE_GRAPHQL_ENDPOINT` to your Envio/Hasura GraphQL (local indexer or mainnet)
- Optional: `VITE_WALLETCONNECT_PROJECT_ID` for WalletConnect
- Migration claim flow (`/claim/migration`) requires:
- `VITE_MIGRATION_PROOFS_URL` (proof data JSON)
- `VITE_MIGRATION_RPC_URL` (RPC for migration reads)
- Optional `VITE_TANGLE_MIGRATION_ADDRESS` override (must be non-zero)
- Optional `VITE_CLAIM_RELAYER_URL` (otherwise wallet mode is used)
- Optional `VITE_SP1_PROVER_API_URL` and `VITE_MOCK_PROOF` for proof generation/testing

## Local protocol repo
- `../tnt-core/` (sibling repo): protocol + claims migration contracts, gas relayer, indexer, etc.
- When running locally, ensure:
- the chain you connect the UI to matches your `tnt-core` deployments
- `VITE_GRAPHQL_ENDPOINT` points at the indexer for that chain

## Key code locations
- App: `apps/tangle-dapp/` (Vite + React Router)
- Staking (EVM v2):
- GraphQL hooks: `libs/tangle-shared-ui/src/data/graphql/`
- Tx hooks: `libs/tangle-shared-ui/src/data/tx/`
- Write executor: `libs/tangle-shared-ui/src/hooks/useContractWrite.ts`
- Seed scripts (Substrate dev):
- `yarn script:setupServices` (create blueprints)
- `yarn script:setupStaking` (LST/vault/operator staking fixtures)
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ yarn generate:release # Review version bumps and changelog
- `components/`: Reusable "dumb" components specific to the app
- `containers/`: "Smart" components with business logic
- `hooks/`: React hooks for infrastructure logic
- `data/`: Data fetching hooks organized by domain (restaking, liquid staking, etc.)
- `data/`: Data fetching hooks organized by domain (staking, liquid staking, etc.)
- `pages/`: Route pages for react-router-dom
- `abi/`: EVM ABI definitions for Substrate precompiles

Expand Down
70 changes: 70 additions & 0 deletions DEDUP_REPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Deduplication Report - PR #3090 Phase 2

## Summary
Removed **~580 lines** of duplicate code from tangle-dapp and tangle-cloud that already exist in tangle-shared-ui.

## Completed Deduplication

### 1. ErrorMessage.tsx (90 lines removed)
**Files Deleted:**
- `apps/tangle-cloud/src/components/ErrorMessage.tsx` ✅
- `apps/tangle-dapp/src/components/ErrorMessage.tsx` ✅

**Imports Updated:** 20 files now import from `@tangle-network/tangle-shared-ui/components/ErrorMessage`

### 2. InputWrapper.tsx (166 lines removed)
**Files Deleted:**
- `apps/tangle-dapp/src/components/InputWrapper.tsx` ✅

**Imports Updated:** AmountInput, TextInput, PercentageInput, AddressInput

### 3. InputAction.tsx (41 lines removed)
**Files Deleted:**
- `apps/tangle-dapp/src/components/InputAction.tsx` ✅

### 4. useInputAmount.ts (192 lines removed)
**Files Deleted:**
- `apps/tangle-dapp/src/hooks/useInputAmount.ts` ✅

**Imports Updated:** AmountInput.tsx

### 5. parseChainUnits.ts (64 lines removed)
**Files Deleted:**
- `apps/tangle-dapp/src/utils/parseChainUnits.ts` ✅

### 6. cleanNumericInputString.ts (19 lines removed)
**Files Deleted:**
- `apps/tangle-dapp/src/utils/cleanNumericInputString.ts` ✅

**Imports Updated:** useCustomInputValue.ts

### 7. ErrorsContext/ directory (55 lines removed)
**Files Deleted:**
- `apps/tangle-dapp/src/context/ErrorsContext/ErrorsContext.ts` ✅
- `apps/tangle-dapp/src/context/ErrorsContext/useErrorCountContext.ts` ✅
- `apps/tangle-dapp/src/context/ErrorsContext/index.ts` ✅

## Build Status
- ✅ tangle-cloud: Builds successfully
- ⚠️ tangle-dapp: Has pre-existing build errors unrelated to this PR (graphql export issue)

## Files Not Deduplicated (Intentionally Different)

### AmountInput.tsx
- tangle-dapp version is almost identical but kept for now
- Only difference is import paths (uses full package path vs relative)
- Could be unified in future PR

### OperatorsTable.tsx
- Different implementations serving different purposes
- tangle-dapp version wraps the shared-ui version
- Intentionally different

## Total Line Reduction
| Category | Lines Removed |
|----------|---------------|
| Components | 297 |
| Hooks | 192 |
| Utils | 83 |
| Context | 55 |
| **Total** | **~580 lines** |
35 changes: 35 additions & 0 deletions LAUNCH_BACKLOG_CLOSEOUT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Launch Backlog Closeout (Docs Scope)

Date: 2026-03-03
Scope owner: `docs/` flow validation artifacts + top-level backlog docs in this repo

## Decision Rules
- `fixed-now`: Documentation/process gap closed in this pass.
- `deferred-external`: Real work remains, but completion depends on external repo/infrastructure/runtime actors.
- `removed-non-actionable`: Not a launch action item for this repo/scope.

## TODO Triage Register

| backlog_id | source | item | triage | owner | dependency | disposition |
|---|---|---|---|---|---|---|
| TODO-001 | `docs/flow-validation-report.md`, `docs/staking-flow-audit-checklist.md` | No explicit launch gate board with owner + gate criteria + verification command + status | fixed-now | Docs owner | None | Added `docs/launch-readiness-board.md` + `docs/launch-readiness-board.csv`; linked from all flow artifacts. |
| TODO-002 | `docs/flow-validation-report.md`, `docs/staking-flow-audit-checklist.md` | Migration claim flow still partial for launch confidence | fixed-now | dapp-frontend + migration | Manual runtime sign-off on live wallet/relayer paths | Hardened migration claim flow in dapp (fail-closed config + relayer receipt confirmation + surfaced eligibility errors); gate moved to `ready-manual-signoff`. |
| TODO-003 | `docs/flow-validation-report.md`, `docs/staking-flow-audit-checklist.md` | Native staking pod lifecycle launch certification | removed-non-actionable | Product/Protocol | Launch scope decision | Kept documented as out-of-launch scope; no release gate in dapp launch. |
| TODO-004 | `docs/flow-validation-report.md`, `docs/staking-flow-audit-checklist.md` | Native staking contract/user-flow certification | removed-non-actionable | Product/Protocol | Launch scope decision | Explicitly excluded from launch certification as a non-launch scope item. |
| TODO-005 | `docs/flow-validation-report.md`, `docs/staking-flow-audit-checklist.md` | Missing dedicated browser wallet E2E harness | deferred-external | QA/DevEx | Browser wallet automation harness + stable CI runner wallets | Launch board marks wallet-critical flows as manual-signoff required. |
| TODO-006 | `docs/flow-validation-report.md` | Automated tests too narrow for 300-story catalog confidence | deferred-external | QA + App teams | Deterministic end-to-end suite design and infra budget | Left as risk; not closed by doc-only pass. |
| TODO-007 | `docs/flow-validation-report.md`, `docs/user-stories-validation-catalog.md` | Legacy `[MANUAL_REQUIRED]` tag metric is misleading/under-counted | fixed-now | Docs owner | None | Deprecated this metric as launch gate input; canonical gate source is launch board + `implementation_status`. |
| TODO-008 | `MIGRATION_CLAIM_PLAN.md` | Historical implementation plan appears actionable in this repo | removed-non-actionable | Migration (tnt-core) | Work migrated to `../tnt-core/packages/migration-claim` | Marked archived context only; not tracked as dapp backlog action. |

## Unresolved Blockers After Closeout
- Wallet-critical flows remain `implemented+manual-required` until deterministic browser wallet E2E harness exists.
- Native staking lifecycle remains intentionally out of launch scope (not a launch blocker, but not complete).

## Governance Decision Inputs (Current)
- Go/no-go authority should use `docs/launch-readiness-board.csv` as the gate source, with this file as backlog disposition context.
- A strict launch go decision requires: no `blocked-partial` gates, plus manual sign-off evidence for all `ready-manual-signoff` gates.
- If launching with manual-signoff gates, record explicit risk acceptance for TODO-005 and TODO-006.
- `removed-non-actionable` items (TODO-003, TODO-004, TODO-008) require explicit product scope approval so they are not reintroduced as hidden blockers.

## Launch Answer (Strict)
- Are all user flows complete for launch-certifiable automation? **No.**
Loading
Loading