Investigate: LocalTerra CL8Y proxy token (EMBER) has 6 decimals; fee-discount contract expects 18-decimal amounts ; blocks FT-3 and FT-4 local QA coverage #383
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#383
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?
Summary
On LocalTerra,
VITE_CL8Y_TOKEN_ADDRESSis pointed at the EMBER test token (terra1wl59k23zngj34l7d42y9yltask7rjlnxgccawc7ltrknp6n52fps4umj85), which has 6 decimals and a total supply of2,000,000,000,000raw units (2,000,000 EMBER). The fee-discount contract enforces minimum CL8Y balances using 18-decimal amounts -- Tier 1 requires1,000,000,000,000,000,000raw units (1 CL8Y at 18 decimals).The wallet under test held
700,780,084,946raw EMBER units (700,780 EMBER at 6 decimals), which exceeds the display threshold but is 10^6 times less than what the contract requires for Tier 1 registration. Registration attempts for all tiers fail with:The EMBER total supply (2 × 10^12) cannot be minted up to the required 18-decimal amount (10^18). The mismatch cannot be worked around without redeploying the CL8Y test token.
What this blocked
Reproduction steps
/tierswith a funded Keplr walletExpected behavior
The LocalTerra CL8Y proxy token should have 18 decimals and sufficient supply to allow tier registration testing across all tiers (minimum supply needed: 7,500 × 10^18 for Tier 9 coverage).
Required developer action
VITE_CL8Y_TOKEN_ADDRESSinfrontend-dapp/.envto the new contract addressEnvironment
/tiersterra1wl59k23zngj34l7d42y9yltask7rjlnxgccawc7ltrknp6n52fps4umj85(EMBER, 6 decimals, total supply 2,000,000,000,000)terra1tctn9s9hjrfy9ng5h5pdkxefehwaes7h244rvr2kz4qflptfs6psyyxcpgSeverity: Low -- production CL8Y token is expected to have 18 decimals; this is a local environment misconfiguration only.
Affected checklist items: FT-3, FT-4
cc: @PlasticDigits
Correct, we should add a seperate TCL8Y to replace EMBER for this purpose.
mentioned in merge request !912
mentioned in commit
aaa610e7efmentioned in issue #291
Verification complete — GitLab #383
Verified on
main@aaa610e7(merge offix/issue-383-tcl8y-localnet) after fresh LocalTerra deploy (./scripts/setup-cloud-agent-localterra.sh --fresh --skip-build).Results
TCL8Y, supply ≥ tier-9 minimum (7.5×10²¹)make verify-issue-383—token_info:decimals=18,symbol=TCL8Y,total_supply=10000000000000000000000000VITE_CL8Y_TOKEN_ADDRESS≠ 6-decimal EMBERmake verify-issue-383— env TCL8Yterra19jq6…vs EMBERterra1wl59…cl8y_tokenmatchesVITE_CL8Y_TOKEN_ADDRESSmake verify-issue-383— on-chain config matches envmake verify-issue-383— register tx succeeded,registered=true tier_id=1make verify-issue-383— deregister tx succeeded,registered=falsemake check-fee-discount-tier-docs— 11 tiers aligned/tiersUI register (Simulated Wallet)e2e/fee-tier-tx.spec.ts— tier register completes (Deregister/Active visible)Acceptance criteria from issue
scripts/deploy-dex-local.shPhase 2d)VITE_CL8Y_TOKEN_ADDRESSpoints at TCL8Y — PASS (frontend-dapp/.env.local)e2e-provision-dev-wallet.sh)No repo changes required; fix already on
main. Closing as verified.Verification:
make verify-issue-383passes 6/6 on the CLI. TCL8Y is deployed atterra19jq6mj84cnt9p7sagjxqf8hxtczwc8wlpuwe4sh62w45aheseues8d5g8g(18 decimals, supply 10^25). On-chain registration and deregistration succeed via CLI.However, the
/tiersUI register button fails with:Root cause(code verified):
getGasLimitForTx()infrontend-dapp/src/services/terraclassic/terraGas.tshas no case forregisterorderegisterexecute messages. Both fall through toBASE_GAS_LIMIT = 200_000. The CLI auto-estimate returns ~265,770 (1.3x adjusted), meaning the actual gas consumed is ~204,438 -- just above the 200,000 fallback. The deregister message (~160,932 gas) may succeed intermittently but has no dedicated constant.Required additional fix: Add
registerandderegistercases togetGasLimitForTx()with a gas constant of at least 250,000 (suggest 300,000 with buffer). Until this is resolved, FT-3/ FT-4 browser verification remains blocked even with TCL8Y correctly deployed.cc: @PlasticDigits
mentioned in issue #384
mentioned in issue #337
mentioned in issue #476
mentioned in issue #682
mentioned in issue #683