Frontend: FeeTransparency hardcodes 18 decimals; silent drift on non-18-decimal acceptedAsset #110
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#110
Loading…
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?
P3-low silent display gap:
frontend/src/components/FeeTransparency.tsxhardcodes18decimals when formatting both the per-txamountand per-sinksharesfrom indexer-recordedFeesDistributedevents. The contractFeeRouter.distributeFees(IERC20 token, uint256 amount)accepts any ERC20, so this assumption silently breaks if a TimeCurve deployment uses a non-18-decimal accepted asset (e.g. USDC at 6).Repro
FeeTransparency.tsxline 161:Line 209 (in
formatFeeSharesJsonForDisplay):Comment immediately above the helper acknowledges the assumption:
But the indexer row carries
row.token(the actual token address that was distributed), andIERC20Metadata.decimals()is the source of truth.Why this matters
Current CL8Y deployment uses an 18-decimal
acceptedAsset, so the display is correct today. But:FeeRouter.distributeFeesis token-agnostic at the contract level — operators can route any ERC20 through it.1.0 USDCas0.000001 USDCin the FeeTransparency panel — 12 orders of magnitude off.acceptedAssetfor the live YO deployment is configurable per-TimeCurve, so this is a multi-deployment concern.No crash, no on-chain incorrectness — just silent display drift on a trust-sensitive panel.
Suggested fix
Replace the hardcoded
18with auseReadContractslookup keyed on the uniquerow.tokenaddresses in the visible page:Then in render:
formatCompactFromRaw(rawToBigIntForFormat(row.amount), decimalsByToken.get(row.token) ?? 18).18 stays as the fallback to preserve current behavior on cold-load before the decimals read resolves.
Same change applies to
formatFeeSharesJsonForDisplay— needs the per-row token decimals threaded through.Severity
P3-low. Not user-facing today (CL8Y is 18 dp). Future-fragile defensive gap on a trust-sensitive panel. Per 4/29 standing rule on aggressive filing.
Acceptance
FeeTransparency.tsxusesIERC20Metadata.decimals()fromrow.tokenrather than hardcoded18for both amount and shares formatting.18only when the decimals read has not resolved yet.decimalsreads cached across the visible feed (deduped by token address).cc @PlasticDigits
While this can be a serious security issue, in our case it is not a problem as the cl8y deployment is 18 decimals as is DOUB. HOwever, it does need to be fixed before conversion into full launchpad. Does not block current launch so marking low priortiy
mentioned in issue #126
mentioned in issue #164
mentioned in merge request !379
mentioned in commit
efb6e0bce7