feat(voting): gate dApp behind cl8y-ecosystem-legal clickwrap (Terra + EVM) #5

Closed
opened 2026-08-25 06:07:53 +00:00 by PlasticDigits · 16 comments
PlasticDigits commented 2026-08-25 06:07:53 +00:00 (Migrated from gitlab.com)

Summary

The voting dApp must be blocked behind cl8y-ecosystem-legal clickwrap. Connected wallets that have not accepted the latest terms for the voting property must not reach register / propose / vote actions.

Use @plasticdigits/cl8y-clickwrap (TermsGate / createClient). Do not reimplement terms verify in this repo.

This constraint was added when voting left cl8y-dex-terraclassic (2026-08-25). It is required for #3, not optional polish.

Skill: skills/AGENTS_LEGAL_CLICKWRAP.md

Constraints / guardrails

  1. SDK only for terms. Full navigation to the hosted portal — no iframe Accept.
  2. Dedicated property. Do not reuse dex.cl8y.com or cl8y.com. Proposed hostname: vote.cl8y.com (confirm with ops before admin register). Env: VITE_LEGAL_PROPERTY.
  3. Two networks. Terra connect → TerraClassic / TERRA_CLASSIC. EVM connect → EVM. Match the connected account.
  4. Fail closed after connect if Legal status is unknown/error. Browse while disconnected may stay open.
  5. Sanitize redirect_uri; portal allowlist is authoritative.
  6. Production CSP connect-src includes Legal API + terms origin. No blanket https:.
  7. No Legal ADMIN_TOKEN in the voting frontend.
  8. VITE_PLAYWRIGHT_E2E=true may skip the gate in Playwright webServer only. Production unset.
  9. Legal sign URLs are terms only — not voting ADR-36 / EIP-191 auth.
  1. Register the voting property on the Legal admin API (interactive token; Legal checkout).
  2. Add the voting origin to Legal API CORS_ORIGINS.
  3. Add the voting origin to portal VITE_REDIRECT_URI_ALLOWLIST.

Mirror DEX skills/AGENTS_FRONTEND_CLICKWRAP.md (C1–C10) for the new hostname.

Acceptance criteria

  • Connected Terra and EVM wallets are gated until signed_latest for the voting property + matching network.
  • Unsigned / error status does not render propose or vote CTAs.
  • Property, CORS, and redirect allowlist documented; Coolify/env examples include Legal URLs.
  • Playwright hatch documented and off in production.
  • Unit tests for property / network / redirect sanitize (DEX legalClickwrap.ts is the pattern).

Bundle

Issue Role
#1 Ledger
#2 operator-voting
#3 dApp UX (this gate wraps #3)
#4 BSC / EVM electorate
This Legal clickwrap
Wallet issue DEX Terra + Bridge EVM connectors
## Summary The voting dApp must be **blocked behind [cl8y-ecosystem-legal](https://gitlab.com/PlasticDigits/cl8y-ecosystem-legal)** clickwrap. Connected wallets that have not accepted the latest terms for the **voting property** must not reach register / propose / vote actions. Use `@plasticdigits/cl8y-clickwrap` (`TermsGate` / `createClient`). Do **not** reimplement terms verify in this repo. This constraint was added when voting left `cl8y-dex-terraclassic` (2026-08-25). It is required for `#3`, not optional polish. **Skill:** [`skills/AGENTS_LEGAL_CLICKWRAP.md`](https://gitlab.com/PlasticDigits/voting/-/blob/main/skills/AGENTS_LEGAL_CLICKWRAP.md) ## Constraints / guardrails 1. **SDK only** for terms. Full navigation to the hosted portal — no iframe Accept. 2. **Dedicated property.** Do not reuse `dex.cl8y.com` or `cl8y.com`. Proposed hostname: `vote.cl8y.com` (confirm with ops before admin register). Env: `VITE_LEGAL_PROPERTY`. 3. **Two networks.** Terra connect → `TerraClassic` / `TERRA_CLASSIC`. EVM connect → `EVM`. Match the connected account. 4. **Fail closed** after connect if Legal status is unknown/error. Browse while disconnected may stay open. 5. Sanitize `redirect_uri`; portal allowlist is authoritative. 6. Production CSP `connect-src` includes Legal API + terms origin. No blanket `https:`. 7. No Legal `ADMIN_TOKEN` in the voting frontend. 8. `VITE_PLAYWRIGHT_E2E=true` may skip the gate in Playwright `webServer` only. Production unset. 9. Legal sign URLs are **terms only** — not voting ADR-36 / EIP-191 auth. ## Ops (Legal repo) 1. Register the voting property on the Legal admin API (interactive token; Legal checkout). 2. Add the voting origin to Legal API `CORS_ORIGINS`. 3. Add the voting origin to portal `VITE_REDIRECT_URI_ALLOWLIST`. Mirror DEX `skills/AGENTS_FRONTEND_CLICKWRAP.md` (C1–C10) for the new hostname. ## Acceptance criteria - [ ] Connected Terra and EVM wallets are gated until `signed_latest` for the voting property + matching network. - [ ] Unsigned / error status does not render propose or vote CTAs. - [ ] Property, CORS, and redirect allowlist documented; Coolify/env examples include Legal URLs. - [ ] Playwright hatch documented and off in production. - [ ] Unit tests for property / network / redirect sanitize (DEX `legalClickwrap.ts` is the pattern). ## Bundle | Issue | Role | |-------|------| | #1 | Ledger | | #2 | `operator-voting` | | #3 | dApp UX (this gate wraps `#3`) | | #4 | BSC / EVM electorate | | **This** | Legal clickwrap | | Wallet issue | DEX Terra + Bridge EVM connectors |
PlasticDigits commented 2026-08-25 06:08:30 +00:00 (Migrated from gitlab.com)

mentioned in issue #1

mentioned in issue #1
PlasticDigits commented 2026-08-25 06:08:41 +00:00 (Migrated from gitlab.com)

mentioned in issue #2

mentioned in issue #2
PlasticDigits commented 2026-08-25 06:08:42 +00:00 (Migrated from gitlab.com)

mentioned in issue #3

mentioned in issue #3
PlasticDigits commented 2026-08-25 06:08:44 +00:00 (Migrated from gitlab.com)

mentioned in issue #4

mentioned in issue #4
PlasticDigits commented 2026-08-25 06:08:48 +00:00 (Migrated from gitlab.com)

Created at repo split (2026-08-25). Required for #3.

Issue Role
#1 Ledger
#2 operator-voting
#3 dApp (this gate wraps it)
#4 BSC / EVM
#5 (this) Legal clickwrap
#6 Wallets
## Bundle links Created at repo split (2026-08-25). Required for **#3**. | Issue | Role | |-------|------| | #1 | Ledger | | #2 | `operator-voting` | | #3 | dApp (this gate wraps it) | | #4 | BSC / EVM | | **#5** (this) | Legal clickwrap | | #6 | Wallets |
PlasticDigits commented 2026-08-25 06:08:49 +00:00 (Migrated from gitlab.com)

mentioned in issue #6

mentioned in issue #6
PlasticDigits commented 2026-08-25 06:09:13 +00:00 (Migrated from gitlab.com)

mentioned in commit 8d11152cfe

mentioned in commit 8d11152cfe841216c2aaa11931d8019030a502ee
PlasticDigits commented 2026-08-25 06:41:45 +00:00 (Migrated from gitlab.com)

mentioned in commit b32b56660d

mentioned in commit b32b56660d0df7b94c606187dda3a6130462c572
PlasticDigits commented 2026-08-25 06:41:53 +00:00 (Migrated from gitlab.com)

mentioned in merge request !18

mentioned in merge request !18
PlasticDigits commented 2026-08-25 06:42:02 +00:00 (Migrated from gitlab.com)

Implemented on feat/voting-bundle. MR: https://gitlab.com/PlasticDigits/voting/-/merge_requests/1
In-tree: ledger/ (CW20 + BEP-20), operator-voting/, frontend/ (/vote + Legal + ported wallets).
Docs: docs/LEDGER_INVARIANTS.md, docs/OPERATOR_VOTING.md, docs/FRONTEND.md.

Implemented on feat/voting-bundle. MR: https://gitlab.com/PlasticDigits/voting/-/merge_requests/1 In-tree: ledger/ (CW20 + BEP-20), operator-voting/, frontend/ (/vote + Legal + ported wallets). Docs: docs/LEDGER_INVARIANTS.md, docs/OPERATOR_VOTING.md, docs/FRONTEND.md.
PlasticDigits commented 2026-08-25 06:47:01 +00:00 (Migrated from gitlab.com)

mentioned in commit 8fe45a1974

mentioned in commit 8fe45a197400462abfc1724385113ea8276a028a
PlasticDigits commented 2026-08-25 06:47:48 +00:00 (Migrated from gitlab.com)

mentioned in issue #7

mentioned in issue #7
PlasticDigits commented 2026-08-25 06:48:23 +00:00 (Migrated from gitlab.com)

Merge verify (!18 → main). In-tree Legal gate is on main: @plasticdigits/cl8y-clickwrap, property vote.cl8y.com, TerraClassic + EVM, fail-closed, Playwright hatch off unless webServer.

Still open (ops — #7):

  • Confirm hostname, then register the Legal property.
  • Legal API CORS_ORIGINS and portal VITE_REDIRECT_URI_ALLOWLIST for the voting origin.
  • No live verify that production builds leave VITE_PLAYWRIGHT_E2E unset.

Closing this issue for the in-tree work. Remaining ops stay on #7.

**Merge verify (!18 → main).** In-tree Legal gate is on main: `@plasticdigits/cl8y-clickwrap`, property `vote.cl8y.com`, TerraClassic + EVM, fail-closed, Playwright hatch off unless `webServer`. Still open (ops — #7): - Confirm hostname, then register the Legal property. - Legal API `CORS_ORIGINS` and portal `VITE_REDIRECT_URI_ALLOWLIST` for the voting origin. - No live verify that production builds leave `VITE_PLAYWRIGHT_E2E` unset. Closing this issue for the in-tree work. Remaining ops stay on #7.
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-08-25 06:48:29 +00:00
PlasticDigits commented 2026-08-29 14:15:29 +00:00 (Migrated from gitlab.com)

mentioned in issue #8

mentioned in issue #8
PlasticDigits commented 2026-08-29 14:43:47 +00:00 (Migrated from gitlab.com)

mentioned in merge request !19

mentioned in merge request !19
PlasticDigits commented 2026-08-30 15:47:45 +00:00 (Migrated from gitlab.com)

mentioned in issue #16

mentioned in issue #16
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/voting#5
No description provided.