UI: validate bech32 checksum on /create token addresses (#382) #911
No reviewers
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!911
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/382-create-pair-bech32-checksum"
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?
Summary
Fixes #382: on
/create, structurally validterra1…addresses with a corrupted bech32 checksum no longer reach the chain. Client-side validation blocks submit and shows retail inline copy instead of the rawaddr_validate/decoding bech32 failedcontract error.terraAddressValidation.tswithgetTerraAddressInputError/isValidTerraBech32Address(format + checksum via@cosmjs/encoding).CreatePairPage.tsxto disable Create Pair and show the issue-specified checksum message before submission.tryHumanizeTerraTxMessagemaps any slipped-through bech32 checksum errors to the same retail copy./trade/:pairAddrstill uses format-onlyisValidTerraAddress(no checksum on URL segments).Acceptance checklist
cd frontend-dapp && npm run test:unit -- src/pages/CreatePairPage.test.tsxcd frontend-dapp && npm run test:unit -- src/utils/__tests__/terraAddressValidation.test.tsCreatePairPage.test.tsx(button disabled assertion)cd frontend-dapp && npm run test:unit -- src/utils/__tests__/humanizeUserFacingError.test.ts(bech32 checksum case)cd frontend-dapp && npm run test:unit -- src/utils/__tests__/tradePairRoute.test.tsdocs/frontend.md§ Create pair — token address validation;skills/AGENTS_FRONTEND_USER_ERRORS.md/createwith LocalTerra + walletThird-party verification
cd frontend-dapp && npm run test:unit -- src/utils/__tests__/terraAddressValidation.test.ts src/pages/CreatePairPage.test.tsx src/utils/__tests__/humanizeUserFacingError.test.tsmake setup-cloud-localterraor existing LocalTerra),make dev, open/create./trade/terra1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxstill shows Pair not found (format-only gate unchanged).Security review
Commit reviewed:
3f9bc007e493837178f6485d4f50388219fb6619Scope: Client-side bech32 checksum validation on
/createtoken contract inputs (terraAddressValidation.ts,CreatePairPage.tsx), tx-error humanization (humanizeTerraTxError.ts), and related unit tests/docs.Outcome:
FINDINGS: 0— no medium+ severity issues on this diff.Review notes
getTerraAddressInputError(format regex +@cosmjs/encodingfromBech32+terraHRP check) before submit is enabled and again in the mutation guard. Invalid checksum addresses cannot reachcreatePairvia the UI path; on-chainaddr_validateremains the authoritative boundary.TxResultAlertcontinues to route errors throughhumanizeUserFacingError.useCodeIdCheckstill queries LCD onterra1prefix only (pre-existing); new validation tightens submit, not widens server-side reach.isValidTerraAddresscharset ([a-z0-9]) blocks URL metacharacters in path segments.invalid checksum): site-wide misclassification risk is limited to confusing copy, not fund loss or privilege escalation.@cosmjs/encodingfrom the lockfile; no new package version introduced.Inline threads: none (zero findings).
Security review: no medium+ findings on this diff.
mentioned in commit
bde8e3807e