Deploy TCL8Y 18-decimal CL8Y proxy for LocalTerra fee-discount QA (#383) #912

Merged
PlasticDigits merged 1 commit from fix/issue-383-tcl8y-localnet into main 2026-06-15 14:51:56 +00:00
PlasticDigits commented 2026-06-15 14:45:00 +00:00 (Migrated from gitlab.com)

Summary

LocalTerra deploy pointed VITE_CL8Y_TOKEN_ADDRESS at EMBER (6 decimals). Fee-discount tier minimums use 18-decimal min_cl8y_balance values, so tier registration always failed with "Insufficient CL8Y balance" despite wallets holding large EMBER balances (#383).

This MR deploys a dedicated TCL8Y CW20 (18 decimals, symbol TCL8Y) for fee-discount cl8y_token and VITE_CL8Y_TOKEN_ADDRESS. EMBER and other pair tokens remain 6-decimal trading assets only. scripts/e2e-provision-dev-wallet.sh mints TCL8Y separately (it is not in factory pairs). Docs/skills cross-link invariant I11 in docs/reference/fee-discount-tiers.md.

Acceptance checklist

Criterion Verification Result
Deploy TCL8Y with 18 decimals on LocalTerra make reset && make start && make wait-healthy && make deploy-local → deploy summary shows TCL8Y (CL8Y): address; token_info decimals=18 PASS
VITE_CL8Y_TOKEN_ADDRESS points to TCL8Y (not EMBER) grep VITE_CL8Y frontend-dapp/.env.local ≠ first factory token (EMBER) PASS
Fee-discount cl8y_token wired to TCL8Y make verify-issue-383 step [3] PASS
Sufficient TCL8Y supply for tier testing make verify-issue-383 step [1] (supply ≥ 7.5e21) PASS
FT-3: tier-1 self-registration succeeds make verify-issue-383 step [4] PASS
FT-4: deregister succeeds make verify-issue-383 step [5] PASS
E2E dev wallet TCL8Y provisioning bash scripts/e2e-provision-dev-wallet.sh (mints TCL8Y when below E2E_DEV_MIN_CL8Y_U128) PASS
Tier doc drift guard make check-fee-discount-tier-docs PASS
Manual /tiers + Keplr or Simulated Wallet Connect funded wallet → Register tier 1 → status updates; Deregister reverts SKIP (automated on-chain proof above; UI uses same contract + env)

Third-party verification

make reset && make start && make wait-healthy
make build-optimized && make deploy-local
make verify-issue-383
bash scripts/e2e-provision-dev-wallet.sh
make check-fee-discount-tier-docs

Optional UI check after make dev:

  1. Open http://127.0.0.1:5173/tiers with Simulated Wallet or Keplr (test1 mnemonic in frontend-dapp/.env.development).
  2. Confirm tier-1 Register succeeds and Your Status shows Tier 1.
  3. Deregister and confirm status returns to not registered.

Related: skills/AGENTS_FEE_DISCOUNT_TIERS.md, scripts/qa/README.md § TCL8Y.

## Summary LocalTerra deploy pointed `VITE_CL8Y_TOKEN_ADDRESS` at **EMBER** (6 decimals). Fee-discount tier minimums use 18-decimal `min_cl8y_balance` values, so tier registration always failed with "Insufficient CL8Y balance" despite wallets holding large EMBER balances ([#383](https://gitlab.com/PlasticDigits/cl8y-dex-terraclassic/-/issues/383)). This MR deploys a dedicated **TCL8Y** CW20 (18 decimals, symbol `TCL8Y`) for fee-discount `cl8y_token` and `VITE_CL8Y_TOKEN_ADDRESS`. EMBER and other pair tokens remain 6-decimal trading assets only. `scripts/e2e-provision-dev-wallet.sh` mints TCL8Y separately (it is not in factory pairs). Docs/skills cross-link invariant **I11** in [`docs/reference/fee-discount-tiers.md`](docs/reference/fee-discount-tiers.md). ## Acceptance checklist | Criterion | Verification | Result | |-----------|--------------|--------| | Deploy TCL8Y with 18 decimals on LocalTerra | `make reset && make start && make wait-healthy && make deploy-local` → deploy summary shows `TCL8Y (CL8Y):` address; `token_info` decimals=18 | **PASS** | | `VITE_CL8Y_TOKEN_ADDRESS` points to TCL8Y (not EMBER) | `grep VITE_CL8Y frontend-dapp/.env.local` ≠ first factory token (EMBER) | **PASS** | | Fee-discount `cl8y_token` wired to TCL8Y | `make verify-issue-383` step [3] | **PASS** | | Sufficient TCL8Y supply for tier testing | `make verify-issue-383` step [1] (supply ≥ 7.5e21) | **PASS** | | FT-3: tier-1 self-registration succeeds | `make verify-issue-383` step [4] | **PASS** | | FT-4: deregister succeeds | `make verify-issue-383` step [5] | **PASS** | | E2E dev wallet TCL8Y provisioning | `bash scripts/e2e-provision-dev-wallet.sh` (mints TCL8Y when below `E2E_DEV_MIN_CL8Y_U128`) | **PASS** | | Tier doc drift guard | `make check-fee-discount-tier-docs` | **PASS** | | Manual `/tiers` + Keplr or Simulated Wallet | Connect funded wallet → Register tier 1 → status updates; Deregister reverts | **SKIP** (automated on-chain proof above; UI uses same contract + env) | ## Third-party verification ```bash make reset && make start && make wait-healthy make build-optimized && make deploy-local make verify-issue-383 bash scripts/e2e-provision-dev-wallet.sh make check-fee-discount-tier-docs ``` Optional UI check after `make dev`: 1. Open `http://127.0.0.1:5173/tiers` with Simulated Wallet or Keplr (`test1` mnemonic in `frontend-dapp/.env.development`). 2. Confirm tier-1 **Register** succeeds and **Your Status** shows Tier 1. 3. **Deregister** and confirm status returns to not registered. Related: [`skills/AGENTS_FEE_DISCOUNT_TIERS.md`](skills/AGENTS_FEE_DISCOUNT_TIERS.md), [`scripts/qa/README.md`](scripts/qa/README.md) § TCL8Y.
PlasticDigits commented 2026-06-15 14:47:34 +00:00 (Migrated from gitlab.com)

Security review — MR !912

Commit reviewed: e9eb7df2e051ee804a746f597e59969a59751ca4
Scope: LocalTerra deploy/QA only — scripts/deploy-dex-local.sh (TCL8Y 18-dec CW20 proxy), scripts/qa/verify-issue-383.sh, scripts/e2e-provision-dev-wallet.sh TCL8Y mint path, docs/skills/Makefile target. No CosmWasm, indexer API, or frontend application code changes.

Outcome: FINDINGS: 0 medium+

Summary: This MR corrects a LocalTerra decimal mismatch (fee-discount min_cl8y_balance assumes 18 decimals; EMBER is 6) by deploying dedicated TCL8Y and wiring cl8y_token / VITE_CL8Y_TOKEN_ADDRESS to it. Review traced attacker-controlled inputs in the diff:

Surface Attacker input Sink Verdict
verify-issue-383.sh TEST_ADDRESS env (optional override) printf JSON for LCD/terrad queries & mint Local-only QA script; same pattern as pre-existing verify-issue-238.sh; no production path
verify-issue-383.sh indexer/.env / .env.local addresses lcd_smart_query_raw, terrad_tx wasm execute Values written by deploy-dex-local.sh; dev-machine trust boundary unchanged
deploy-dex-local.sh Hardcoded TEST_ADDRESS (test1) TCL8Y minter/admin Expected LocalTerra dev keyring; unlimited QA-token mint is intentional
e2e-provision-dev-wallet.sh VITE_CL8Y_TOKEN_ADDRESS from .env.local CW20 mint execute Pre-existing .env.local sourcing pattern; quoted args; LocalTerra E2E only

No injection, authz bypass, secret leakage, SSRF/XSS, or permission-boundary regressions introduced on this diff. TCL8Y is not added to trading pairs; EMBER liquidity semantics unchanged. Mainnet/testnet deploy paths untouched.

Inline threads: none (no medium+ findings).

Label: block:security not applied.

## Security review — MR !912 **Commit reviewed:** `e9eb7df2e051ee804a746f597e59969a59751ca4` **Scope:** LocalTerra deploy/QA only — `scripts/deploy-dex-local.sh` (TCL8Y 18-dec CW20 proxy), `scripts/qa/verify-issue-383.sh`, `scripts/e2e-provision-dev-wallet.sh` TCL8Y mint path, docs/skills/Makefile target. No CosmWasm, indexer API, or frontend application code changes. **Outcome:** `FINDINGS: 0` medium+ **Summary:** This MR corrects a LocalTerra decimal mismatch (fee-discount `min_cl8y_balance` assumes 18 decimals; EMBER is 6) by deploying dedicated TCL8Y and wiring `cl8y_token` / `VITE_CL8Y_TOKEN_ADDRESS` to it. Review traced attacker-controlled inputs in the diff: | Surface | Attacker input | Sink | Verdict | |---------|----------------|------|---------| | `verify-issue-383.sh` | `TEST_ADDRESS` env (optional override) | `printf` JSON for LCD/terrad queries & mint | Local-only QA script; same pattern as pre-existing `verify-issue-238.sh`; no production path | | `verify-issue-383.sh` | `indexer/.env` / `.env.local` addresses | `lcd_smart_query_raw`, `terrad_tx wasm execute` | Values written by `deploy-dex-local.sh`; dev-machine trust boundary unchanged | | `deploy-dex-local.sh` | Hardcoded `TEST_ADDRESS` (test1) | TCL8Y minter/admin | Expected LocalTerra dev keyring; unlimited QA-token mint is intentional | | `e2e-provision-dev-wallet.sh` | `VITE_CL8Y_TOKEN_ADDRESS` from `.env.local` | CW20 `mint` execute | Pre-existing `.env.local` sourcing pattern; quoted args; LocalTerra E2E only | No injection, authz bypass, secret leakage, SSRF/XSS, or permission-boundary regressions introduced on this diff. TCL8Y is not added to trading pairs; EMBER liquidity semantics unchanged. Mainnet/testnet deploy paths untouched. **Inline threads:** none (no medium+ findings). **Label:** `block:security` not applied.
PlasticDigits (Migrated from gitlab.com) merged commit aaa610e7ef into main 2026-06-15 14:51:57 +00:00
PlasticDigits commented 2026-06-15 14:52:00 +00:00 (Migrated from gitlab.com)

mentioned in commit aaa610e7ef

mentioned in commit aaa610e7ef96773d0fffd956de6a260107abdfbb
Sign in to join this conversation.
No reviewers
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/cl8y-dex-terraclassic!912
No description provided.