No description
  • Rust 41.5%
  • TypeScript 28.9%
  • Shell 14.5%
  • Python 10.9%
  • JavaScript 3%
  • Other 1.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Plastic Digits aaefb687f8
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Merge pull request 'Pin patched NGINX for the November advisories' (#1588) from security/nginx-20261119 into main
Reviewed-on: ⁨#1588⁩
2026-11-20 02:54:41 +00:00
.cursor Merge origin/main into issue/1255 2026-09-21 14:31:35 +09:00
.githooks Merge origin/main into issue/1279-luncdash-ops-verify 2026-09-21 14:25:32 +09:00
.github fix(indexer): isolate database roles and QA mutations 2026-10-06 13:55:14 +09:00
.gitlab/issue_templates feat(security): add user security contact and escalation path (#392) 2026-06-19 01:40:02 +00:00
.tmp-brand-concepts chore(design): add approved brand concept pack 2026-07-13 22:24:27 +09:00
audits Preserve security audits and record merge sanity [skip ci] 2026-10-05 10:25:05 +09:00
cw20-codeid-audits fix(swap): fund token taxes from gross route budgets 2026-10-04 19:12:43 +09:00
deployments feat(quotes): accessible 30-minute signing window and protected wrapper rollout 2026-10-17 15:10:44 +09:00
docker Pin the November security release of NGINX 2026-11-19 18:16:15 -08:00
docs Handle drill shutdown without signal-handler locks 2026-10-25 19:47:20 +09:00
frontend-dapp fix(swap): carry receive amount on direction switch and compact status 2026-10-19 15:13:43 +09:00
gaps docs: align swap_events dedup key with (tx_hash, pair_id, swap_index) (#287) 2026-06-05 09:46:33 +00:00
incidents docs: publish incident report with operational details excluded [skip ci] 2026-10-18 17:15:04 +09:00
indexer fix: align trading risk review and compact mobile Swap 2026-10-19 13:17:40 +09:00
monitoring/dex Handle drill shutdown without signal-handler locks 2026-10-25 19:47:20 +09:00
packages/localnet-trading-swarm fix(swarm): synchronize cosmes lockfile and NodeNext test import 2026-10-04 10:08:32 +09:00
scripts docs(qa): record deployed swap direction and status verification 2026-10-19 15:18:33 +09:00
skills fix(swap): carry receive amount on direction switch and compact status 2026-10-19 15:13:43 +09:00
smartcontracts fix: harden launcher and repair trading evidence 2026-10-18 13:38:44 +09:00
tokenlist feat: list Kenalinu (KENA) in tokenlist and dApp registry 2026-09-27 19:12:42 +09:00
.dockerignore ci: enforce functional checks and isolate build inputs 2026-10-05 18:09:40 +09:00
.env.example fix(indexer): isolate database roles and QA mutations 2026-10-06 13:55:14 +09:00
.gitignore Combine functional CI with bounded discovery and security fixes [skip ci] 2026-10-06 11:18:48 +09:00
.gitlab-ci.yml Merge Rust 1.99 build image update 2026-10-18 12:34:46 +09:00
.gitleaks.toml Recognize reviewed public bridge literals in secret scanning 2026-10-16 12:55:32 +09:00
.nvmrc Initial commit 2026-03-09 14:34:35 +09:00
.woodpecker.yaml Merge Woodpecker Git plugin update 2026-10-18 12:34:46 +09:00
AGENTS.md fix: align trading risk review and compact mobile Swap 2026-10-19 13:17:40 +09:00
docker-compose.postgres-host.yml fix(indexer): isolate database roles and QA mutations 2026-10-06 13:55:14 +09:00
docker-compose.qa-shared-host.yml Add QA server workflow: start-qa, stop-qa, status, tunnel help 2026-03-31 18:38:17 +09:00
docker-compose.yml fix(indexer): isolate database roles and QA mutations 2026-10-06 13:55:14 +09:00
gch-agent-idle-wrap.py chore: add agent idle watchdog for GCH runner hang 2026-06-11 23:17:24 +09:00
gch-cloud-init-runner.sh chore: add agent idle watchdog for GCH runner hang 2026-06-11 23:17:24 +09:00
gch-cloud-init.sh chore: fix Cursor CLI path to ~/.local/bin in GCH scripts 2026-06-11 15:52:39 +09:00
gch-cloud-setup.sh chore: add agent idle watchdog for GCH runner hang 2026-06-11 23:17:24 +09:00
gch-golden-image-finalize.md chore: add GCH golden-image finalize agent prompt 2026-06-11 16:16:00 +09:00
leverage.md docs: research leveraged swaps and retain deployment evidence 2026-10-13 17:50:36 +09:00
LICENSE Add license, readme 2026-03-09 14:01:45 +09:00
Makefile feat: provision scoped DEX Prometheus monitoring and alert verification 2026-10-18 19:31:20 +09:00
NATIVE_TOKEN_WRAPPING.md fix(swap): gate USTC wrap gas on LUNC and keep the 2.71M envelope 2026-09-21 13:49:21 +09:00
QA_PASS_2026-03-13.md fix(frontend): default slippage protection to 5% (#497) 2026-07-25 13:21:28 +09:00
QA_PASS_2026-06-25.md Align design tokens across Tailwind, trade-bootstrap, and QA docs (#416). 2026-06-25 20:48:08 +00:00
QA_TEMPLATE.md docs: assign leftover device QA via cl8y-pm inbox 2026-09-21 16:19:58 +09:00
README.md fix(indexer): isolate database roles and QA mutations 2026-10-06 13:55:14 +09:00
render.yaml Fix production CSP fallback hosts and Render header intersection. 2026-06-14 05:45:11 +00:00
renovate.json Keep schema dependencies compatible with CosmWasm 1.5 [skip ci] 2026-10-15 14:40:42 +09:00
SECURITY.md Add SEC-G05 incident communications templates (#438) 2026-06-30 02:22:31 +00:00

CL8Y DEX - Terra Classic

A decentralized exchange (DEX) built on Terra Classic, featuring an AMM (Automated Market Maker) with customizable fee hooks, CW20 token support, multi-hop routing, and tiered fee discounts for CL8Y token holders.

Quick Start

# Start LocalTerra
make start

# Build optimized smart contracts
make build-optimized

# Deploy contracts to LocalTerra (uploads, instantiates, creates test pair)
make deploy-local

# Start frontend dev server
make dev

Project Structure

cl8y-dex-terraclassic/
├── smartcontracts/          # CosmWasm smart contracts (Rust)
│   ├── contracts/
│   │   ├── factory/         # Factory - creates and manages trading pairs
│   │   ├── pair/            # Pair - AMM pool for two tokens
│   │   ├── router/          # Router - multi-hop swap routing
│   │   ├── fee-discount/    # Fee Discount - tiered swap fee discounts for CL8Y holders
│   │   └── hooks/           # Fee hooks (burn, tax, LP burn)
│   ├── packages/
│   │   └── dex-common/      # Shared types and messages
│   ├── scripts/
│   │   ├── optimize.sh      # Build optimized wasm via Docker
│   │   └── deploy.sh        # Deployment instructions for testnet/mainnet
│   └── artifacts/           # Optimized wasm output (generated)
├── frontend-dapp/           # React frontend (Vite + TypeScript)
│   ├── src/
│   │   ├── components/      # UI components
│   │   ├── pages/           # Swap, Pool, CreatePair, Tiers pages
│   │   ├── services/        # Terra Classic wallet & contract services
│   │   └── utils/           # Constants and helpers
│   └── patches/             # Cosmes library patches
├── scripts/                 # Deployment scripts
│   ├── deploy-dex-local.sh  # Full local deployment
│   ├── deploy-dex-testnet.sh
│   └── deploy-dex-mainnet.sh
├── docker-compose.yml       # LocalTerra infrastructure
├── Makefile                 # Build, test, deploy commands
└── docs/                    # Documentation

Available Commands

Command Description
make start Start LocalTerra via Docker
make stop Stop LocalTerra
make reset Stop LocalTerra and delete all data
make logs-terra Follow LocalTerra logs
make build-optimized Build optimized wasm contracts
make deploy-local Deploy all contracts to LocalTerra
make deploy-testnet Print testnet deployment instructions
make deploy-mainnet Print mainnet deployment instructions
make deploy-mainnet-soft-launch Soft-launch deploy (non-economic CW20, cl8ydeploy) — runbook
make test-mainnet-soft-launch-defaults Soft-launch defaults + dry-run regression
make dev Start frontend dev server
make test Run all tests (contracts + frontend)
make lint Run all linters

Networks

Network Chain ID LCD
Local localterra http://localhost:1317
Testnet rebel-2 https://terra-classic-lcd.publicnode.com
Mainnet columbus-5 https://terra-classic-lcd.publicnode.com

How we test

This repo is on GitLab and does not run GitHub Actions or GitLab CI. Checks run on your machine or QA host via make and scripts/. The YAML under .github/workflows/ is a reference checklist only (job names map to Make targets). See docs/testing.md § CI and .github/workflows/README.md. Agent playbooks: skills/AGENTS_E2E_STRICT_CHAIN.md, skills/AGENTS_LOCAL_POSTGRES_DEV.md.

Documentation

Project docs (architecture, integrators, runbooks, testing) are indexed in docs/README.md. For local, testnet, and mainnet chain IDs, LCD defaults, and indexer expectations (RUN_MODE, LCD_URLS, etc.), see the environment matrix.

Security reports: see SECURITY.md for how to report suspicious trades, UI issues, or vulnerabilities (email, GitLab template, response window).

Development

Git

The default branch is main (the only long-lived integration branch). Merge requests should target main.

Prerequisites

  • Docker
  • Rust with wasm32-unknown-unknown target
  • nvm + Node 24 (nvm install / nvm use — see .nvmrc). Makefile and scripts/with-node.sh activate it automatically for local automation.

Smart Contracts

make test-contracts    # Run contract unit tests
make lint-contracts    # Check formatting and clippy
make build-optimized   # Build production wasm

Indexer (Rust)

The indexer has library tests (cargo test --lib, no Postgres) and integration tests (cargo test --tests) that require PostgreSQL and migrations. See Testing — Indexer (Rust) and Worktree isolation and test parallelism. Use separate runtime/migrator/QA credentials and fresh databases per integration process; #1396 instructions and verification cover setup, rollback and explicit skips.

Frontend

From repo root (Node via nvm, see .nvmrc):

bash scripts/with-node.sh --cwd frontend-dapp -- npm ci
make dev                 # dev server
make test-frontend       # unit tests
make lint-frontend

Or activate nvm once: nvm use, then cd frontend-dapp and run npm scripts as usual.