feat(statics): derive EVM token features from ERC20 support for AMS o… - #9643
Draft
prithvishet2503 wants to merge 5 commits into
Draft
feat(statics): derive EVM token features from ERC20 support for AMS o…#9643prithvishet2503 wants to merge 5 commits into
prithvishet2503 wants to merge 5 commits into
Conversation
…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
Contributor
Contributor
|
|
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…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