feat(create-token): identity validation (decimals 6–18, alphanumeric name/symbol) and connected-wallet treasury/manager #604
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic#604
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent / related
Create Token dApp #593 · on-chain template #592 · store/list #601 · sibling SKU-init + percent taxes (follow-up, same epic). Design-only in-place migrate #603 — do not ship a
/token/migrateimporter in this ticket.The live retail wizard is
/token/create. There is no/token/migrateroute. Identity rules here apply to launcher instantiate; if #603 later allows migrate-adopt, reuse the same decimals / name / symbol checks (do not rewriteTOKEN_INFOon adopt).Current codebase
Retail create lives on
CreateTokenPage.tsx(/token/create). Manager console isManageTokenPage.tsx.0 ≤ n ≤ 18(decimalsOk). Default"6". No min-6. No inline error.instantiate:if msg.decimals > MAX_DECIMALS(18) →DecimalsCap. 0–5 is allowed.cw20_baseinstantiate. No community-tax charset check.^[A-Za-z0-9]{1,12}$, then.toUpperCase(). 1–2 char symbols pass the UI.cw20-base(typically 3–12 alphanumeric). Short / punctuated names can fail only after broadcast.terra1…(treasury). Submit usesmanager.trim() || addressandtreasury.trim() || managerAddr— silent fallback, no helper text. Disconnect → “Connect wallet to create”; fields still look blank.Factory pair bootstrap already rejects asset CW20s with
decimals > 18(#124,MAX_PAIR_ASSET_DECIMALS_BOOTSTRAP). Sub-6 community tokens are still instantiable and then confuse human-scale Swap / Trade / tape math.Launcher
CreateTokenMsgforwardsname/symbol/decimalsunchanged. Columbus-5 listed token wasm is 11611; instantiate checks only apply to new instantiates from whichevertoken_code_idthe launcher points at.Why this is needed
Retail creators copy tickers from other chains (9 / 18 dp, emoji names,
TOKEN-V2). The dApp currently allows 0 decimals and non-alphanumeric names, and only caps decimals at 18 on-chain. CLI / LCD users can bypass the UI entirely.Treasury and manager defaulting “in submit math” but not in the inputs is a footgun: users think the fields are required-empty, or they paste a wrong address without seeing whether it is their wallet. Helper copy must say connected wallet vs not connected wallet.
Constraints / guardrails
nameandsymbolare^[A-Za-z0-9]+$only (no spaces, hyphen, unicode, punctuation). Symbol still uppercased on submit. Preserve name case.cw20-baseso the UI cannot look valid then revert: name 3–50, symbol 3–12. Reject 1–2 char symbols in the UI and in community-taxinstantiate(do not wait for cw20-base).6 ≤ decimals ≤ 18. Default 6. Reject5,19,6.5, empty,NaN. New contract error should name the range (not only max).community-tax-token::instantiatemust reject out-of-range decimals and bad name/symbol beforecw20_base::instantiate. Launcher may fail-fast with the same checks; token instantiate revert already rolls back the UST1 forward.UpdateConfig { token_code_id }→ #589 REPORT GO → factoryAddWhitelistedCodeId. Keep 11611 listed for existing pairs (F6). Do not whitelist launcher / AutoLP code ids (O601-2).connected walletifvalue === connected address(bech32-normalized); elsenot connected wallet. Disconnect → helpernot connected wallet; submit still gated (C593). User may still set a different validterra1…(not forced to self)./token/migratepage in this issue. Reuse validators if #603 later adds a form.isValidTerraBech32Addresson addresses.Relevant files
frontend-dapp/src/pages/CreateTokenPage.tsxfrontend-dapp/src/pages/CreateTokenPage.test.tsxfrontend-dapp/src/utils/communityTaxSku.tssmartcontracts/contracts/community-tax-token/src/msg.rsMAX_DECIMALS; addMIN_DECIMALS = 6smartcontracts/contracts/community-tax-token/src/contract.rsinstantiatesmartcontracts/contracts/community-tax-token/src/error.rsDecimalsCapsmartcontracts/contracts/community-tax-token/src/multitest.rssmartcontracts/contracts/community-token-launcher/src/contract.rsdocs/frontend.md§ Create Tokendocs/contracts-terraclassic.md§ Community tax CW20skills/AGENTS_FRONTEND_CREATE_TOKEN.md·skills/AGENTS_COMMUNITY_TAX_CW20.mdRecommended direction
buildCreateTokenHook/buildFreeCreateTokenMsg) so paid and free create cannot encode illegal metadata.MIN_DECIMALS = 6,MAX_DECIMALS = 18;validate_identity(name, symbol, decimals)before cw20-base init. Errors: decimals range,InvalidName,InvalidSymbol.address. Helper line under each input (data-testidfor tests).Acceptance criteria
0,5,19).A-Za-z0-9within length bounds (name 3–50, symbol 3–12).make verify-issue-593stays green; newmake verify-issue-<iid>added.token_code_idrotates (no silent mainnet store in this ticket unless ops is in-scope).Test plan (all paths)
6,180,5,19,6.5,"",-1instantiaterevertDemo, symbolDEMOMy Token,Demo!,🚀, empty,ab(len 2)DE-MO,demo_1,D,TOOLONGSYMBOLXdemoDEMOterra1…decimals: 0or name"x y"against new wasmAttack / abuse test plan
create_tokenJSON withdecimals: 0or2(UI bypass)[A-Za-z0-9])>50) / symbol (>12)decimals: 255(u8max)>18)innerHTML?manager=/?treasury=query--adminnot CMMAddWhitelistedCodeId— document; do not skip GOVerification criteria
data-testid).docs/frontend.md/docs/contracts-terraclassic.mdmatch.git commit --no-verify. No 8654 whitelist. No/token/migrateimporter.marked as related to #592
marked as related to #593
marked as related to #601
marked as related to #603
marked as related to #605
Sibling implementation (SKU init + percent tax UX, not bps): #605
mentioned in issue #605
mentioned in merge request !1121
mentioned in issue #608
mentioned in commit
fe47dd8c60mentioned in merge request !1122
Implemented in !1122 (
issue/604-605-create-token-identity-sku).Acceptance
A-Za-z0-9(name 3–50, symbol 3–12)connected walletnot connected wallet; that address is what instantiate usesnot connected wallet; no create CTAC604-1–C604-3).make verify-issue-593green;make verify-issue-604addedVerification
data-testid)docs/frontend.md/docs/contracts-terraclassic.mdmatchgit commit --no-verify. No 8654 whitelist. No/token/migrateimporterNot in this ticket (as specified)
token_code_idrotates after #589 GO +AddWhitelistedCodeIdmentioned in commit
715d9555bdmentioned in commit
33e4153f87mentioned in issue #611
marked as related to #611
Merge !1122 — in-repo #604 acceptance passed (
make verify-issue-604/make verify-issue-593green). Combined with #605 on the same MR.Non-blocking: Create exempt-list UI validates bech32 only; protocol addresses still fail at instantiate (
ProtocolExemptNotAllowed). Connect-after-typed-address (P10) is covered at util level, not a page integration test.On-chain enforcement is not live until launcher
token_code_idrotates. Tracked in #611 (store → #589 GO → whitelist; keep 11611 listed).mentioned in issue #612
mentioned in issue #603
mentioned in issue #626
mentioned in issue #669
marked as related to #669