Skip to content

fix(#420 review): validate TokenTierConfig integer strings + document stablecoin addresses#422

Merged
jhfnetboy merged 1 commit into
masterfrom
fix/tier-config-validation
Jul 2, 2026
Merged

fix(#420 review): validate TokenTierConfig integer strings + document stablecoin addresses#422
jhfnetboy merged 1 commit into
masterfrom
fix/tier-config-validation

Conversation

@jhfnetboy

Copy link
Copy Markdown
Member

Addresses the two #420 review follow-ups:

  • [M] TokenTierConfigDto@Matches(/^\d+$/) on tier1Limit/tier2Limit/dailyLimit so a non-numeric value is rejected at validation (400) instead of throwing in the service's BigInt(...) → an opaque 500. Verified: base-unit integers pass; abc/1.5/empty/negatives reject.
  • [L] tier-profiles.ts — documents that USDC/USDT are the canonical @aastar/sdk token-registry Sepolia addresses (verified against the SDK bundle — single, consistent entry each — and the tokens/sale-client resolution; getTokenContracts() errors for Sepolia, so they're pinned with a re-align note).

tsc + lint green (backend + frontend); backend build verified.

… stablecoin addrs

[M] TokenTierConfigDto: @matches(/^\d+$/) on tier1Limit/tier2Limit/dailyLimit so a
non-numeric value is rejected at validation (400) instead of throwing in the service's
BigInt(...) → an opaque 500. (Verified: base-unit integers pass; 'abc'/'1.5'/''/negatives reject.)

[L] tier-profiles.ts: document that USDC/USDT are the canonical @aastar/sdk token-registry
Sepolia addresses (verified against the SDK bundle — single consistent entry each — and the
tokens/sale-client resolution); getTokenContracts() errors for Sepolia so they're pinned here.

tsc + lint green (backend + frontend).
@jhfnetboy jhfnetboy requested a review from fanhousanbu as a code owner July 2, 2026 15:28
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@clestons clestons left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: #422 — fix(#420 review): TokenTierConfig 整数校验 + 地址文档

精确修复 #420 review 的 [M] 和 [L]。

[M] 已修复 — @Matches(/^\d+$/) 覆盖全部场景

UINT_STRING = /^\d+$/ 复用于三个字段,拦截所有 BigInt() 危险输入:

输入 结果
"200000000" ✓ 通过
"0" ✓ 通过(tier 可为 0)
"abc" / "1.5" / "" / "-1" / "1e6" ✗ 400

[L] 已修复 — USDC/USDT Sepolia 地址来源记录

明确说明地址来自 @aastar/sdk token-registry(SDK bundle 单一一致条目),getTokenContracts() 目前对 Sepolia 报错所以本地固定,并注明随 SDK 变更需重新对齐 ✓

APPROVE

@jhfnetboy jhfnetboy merged commit 7f89e90 into master Jul 2, 2026
14 checks passed
@jhfnetboy jhfnetboy deleted the fix/tier-config-validation branch July 2, 2026 15:38
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants