Skip to content

feat(statics): derive EVM token features from ERC20 support for AMS o… - #9643

Draft
prithvishet2503 wants to merge 5 commits into
masterfrom
cshld-1601-evm-token-features
Draft

feat(statics): derive EVM token features from ERC20 support for AMS o…#9643
prithvishet2503 wants to merge 5 commits into
masterfrom
cshld-1601-evm-token-features

Conversation

@prithvishet2503

Copy link
Copy Markdown
Contributor

…nboarding

networkFeatureMapForTokens.ts required every EVM chain family to be hand-added before AMS could onboard ERC20 tokens for it, silently skipping any unlisted family (e.g. baseeth). getNetworkFeatures() now falls back to a shared EVM_TOKEN_FEATURES set for any family whose base coin has CoinFeature.SUPPORTS_ERC20, registered from coins.ts via a callback to avoid a circular import with allCoinsAndTokens.ts.

TICKET: CSHLD-1601

…nboarding

networkFeatureMapForTokens.ts required every EVM chain family to be
hand-added before AMS could onboard ERC20 tokens for it, silently
skipping any unlisted family (e.g. baseeth). getNetworkFeatures() now
falls back to a shared EVM_TOKEN_FEATURES set for any family whose
base coin has CoinFeature.SUPPORTS_ERC20, registered from coins.ts via
a callback to avoid a circular import with allCoinsAndTokens.ts.

TICKET: CSHLD-1601
@linear-code

linear-code Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

CSHLD-1601

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ Unit tests are failing on Node 26.x (Current release line, non-blocking). This is not an LTS version yet, so it does not block merge, but it signals an incompatibility to fix before Node 26.x becomes LTS.

View run

…ad of a predicate fallback

Replace the isErc20SupportedFamily predicate/checker in getNetworkFeatures()
with registerErc20Families(), which mutates networkFeatureMapForTokens in
place for any ERC20-supporting family not already listed. Simpler lookup,
same circular-import-safe registration pattern from coins.ts.

TICKET: CSHLD-1601
…e backfill

registerErc20Families() previously assigned the same EVM_TOKEN_FEATURES
bundle (which includes CoinFeature.EIP1559) to every ERC20-supporting
family, regardless of whether that chain actually supports EIP1559
(e.g. xdc does not). Now coins.ts derives EIP1559 support per family
from the base coin's own features, and registerErc20Families picks
between EVM_TOKEN_FEATURES and the new EVM_TOKEN_FEATURES_NON_EIP1559
accordingly.

TICKET: CSHLD-1601
…RC20, add drift guard

TokenNetwork hand-listed ~19 "plain EVM" families (polygon, baseeth, og,
flow, xdc, ...) with an identical { tokens: EthLikeTokenConfig[] } shape,
so any new EVM family (e.g. zksyncera, mantle, gasevm) failed to type-check
even though getFormattedTokensByNetwork already populates a bucket for it
at runtime via getEthLikeTokens's SUPPORTS_ERC20-based scan. Replaced the
hand-listed EVM entries with a Partial<Record<..., EvmTokenBucket>> overlay
covering every CoinFamily not otherwise explicitly shaped (NFTs,
confidential tokens, MPT tokens, non-EVM configs).

Also added a drift-guard test asserting every mainnet SUPPORTS_ERC20
family gets a bucket in getFormattedTokens's output, mirroring the
existing getNetworkFeatures drift guard.

TICKET: CSHLD-1601
…families

Verifies createTokenUsingTrimmedConfigDetails correctly composes
EVM_TOKEN_FEATURES/EVM_TOKEN_FEATURES_NON_EIP1559 with AMS
additionalFeatures/excludedFeatures for baseeth and prividiumeth,
the two fallback families exercising each branch of the EIP1559 split.

TICKET: CSHLD-1601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant