fix(frontend): resolve fee-token decimals dynamically in FeeTransparency (GitLab #110) #379
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega!379
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/glab-110-fee-transparency-decimals"
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?
closes #110.
what changed
frontend/src/components/FeeTransparency.tsx— replace hardcoded18dp on both the per-txamountrender and the per-sinksharesformatting with auseReadContractslookup keyed on the uniquerow.tokenaddresses in the visiblefeesDistributedfeed.feeTokenAddrsmemo deduplicates token addresses from the current feed pageuseReadContractscallserc20Abi.decimals()for each unique address; gated onfeeTokenAddrs.length > 0feeTokenDecimalsByAddrmap exposesaddress → decimalsformatCompactFromRaw(rawToBigIntForFormat(row.amount), feeTokenDecimalsByAddr.get(row.token) ?? 18)formatFeeSharesJsonForDisplaysignature gains adecimals: numberparameter; caller passesfeeTokenDecimalsByAddr.get(row.token) ?? 1818stays as the fallback for cold-load before the decimals reads resolve — preserves current display on the live CL8Y deployment which is 18-dp anyway. uses the existingerc20Abi(already exposesdecimals() view returns (uint8)) — no new ABI added.why
FeeRouter.distributeFees(IERC20 token, uint256 amount)is token-agnostic at the contract level — operators can route any ERC20 through it. before this MR, a future TimeCurve instance with a non-18-dp accepted asset (USDC at 6, etc.) would silently render1.0 USDCas0.000001 USDC— 12 orders of magnitude off. no crash, no onchain incorrectness, just silent display drift on a trust-sensitive panel. the existingacceptedAssetfor the live YO deployment is configurable per-TimeCurve, so this is a multi-deployment concern even though today it does not bite.per @PlasticDigits in #110: low priority for the current launch (CL8Y is 18-dp), but flagged as needing fix before launchpad conversion. landing it now while the change is small.
verification
npm run typecheckclean.npm test -- --run— 50 files / 295 passed (no regressions, baseline unchanged).npm run lint— 0 errors. one pre-existing fast-refresh warning inIndexerConnectivityContext.tsxuntouched.display behavior
feeTokenAddrsso the read batch stays bounded by unique tokens not row countcc @PlasticDigits
mentioned in commit
efb6e0bce7mentioned in commit
d6bf0f9b9d