Skip to content

Commit 7985e40

Browse files
refactor: remove Morph Ethereum and related tokens from the codebase for testing
CECHO-634
1 parent c08a68e commit 7985e40

12 files changed

Lines changed: 39 additions & 250 deletions

File tree

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
import { CoinFamily } from '@bitgo/statics';
22

33
/** L2 coin families that incur L1 data fees during recovery transactions */
4-
export const coinFamiliesWithL1Fees: ReadonlyArray<CoinFamily> = [
5-
CoinFamily.OPETH,
6-
CoinFamily.DOGEOS,
7-
CoinFamily.MORPHETH,
8-
];
4+
export const coinFamiliesWithL1Fees: ReadonlyArray<CoinFamily> = [CoinFamily.OPETH, CoinFamily.DOGEOS];

modules/bitgo/test/v2/unit/keychains.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ describe('V2 Keychains', function () {
109109
n.asset !== UnderlyingAsset.OKBXLAYER &&
110110
n.asset !== UnderlyingAsset.UNIETH &&
111111
n.asset !== UnderlyingAsset.MORPH &&
112-
n.asset !== UnderlyingAsset.MORPHETH &&
113112
n.asset !== UnderlyingAsset.DOGEOS &&
114113
n.asset !== UnderlyingAsset.MEGAETH &&
115114
n.asset !== UnderlyingAsset.ARCUSDC &&

modules/sdk-core/src/bitgo/environments.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,6 @@ const mainnetBase: EnvironmentTemplate = {
333333
morph: {
334334
baseUrl: 'https://explorer-api-hoodi.morphl2.io', // TODO: WIN-8134 add mainnet url when available
335335
},
336-
morpheth: {
337-
baseUrl: 'https://explorer.morph.network/',
338-
},
339336
dogeos: {
340337
baseUrl: 'https://blockscout.testnet.dogeos.com', //TODO: WIN-8082 => add mainnet url when available
341338
},
@@ -558,9 +555,6 @@ const testnetBase: EnvironmentTemplate = {
558555
morph: {
559556
baseUrl: 'https://explorer-api-hoodi.morphl2.io',
560557
},
561-
morpheth: {
562-
baseUrl: 'https://explorer-hoodi.morph.network/',
563-
},
564558
dogeos: {
565559
baseUrl: 'https://blockscout.testnet.dogeos.com',
566560
},

modules/statics/src/allCoinsAndTokens.ts

Lines changed: 0 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -3185,48 +3185,6 @@ export const allCoinsAndTokens = [
31853185
CoinFeature.SUPPORTS_ERC20,
31863186
]
31873187
),
3188-
3189-
account(
3190-
'51de29b1-dd97-4b05-9239-a177522b469f',
3191-
'morpheth',
3192-
'Morph Ethereum Mainnet',
3193-
Networks.main.morpheth,
3194-
18,
3195-
UnderlyingAsset.MORPHETH,
3196-
BaseUnit.ETH,
3197-
[
3198-
...EVM_FEATURES,
3199-
CoinFeature.SHARED_EVM_SIGNING,
3200-
CoinFeature.SHARED_EVM_SDK,
3201-
CoinFeature.EVM_COMPATIBLE_IMS,
3202-
CoinFeature.EVM_COMPATIBLE_UI,
3203-
CoinFeature.EVM_COMPATIBLE_WP,
3204-
CoinFeature.EVM_NON_BITGO_RECOVERY,
3205-
CoinFeature.EVM_UNSIGNED_SWEEP_RECOVERY,
3206-
CoinFeature.SUPPORTS_ERC20,
3207-
CoinFeature.ERC20_BULK_TRANSACTION,
3208-
]
3209-
),
3210-
account(
3211-
'f99419da-0ee8-46c3-af81-3bd43af29642',
3212-
'tmorpheth',
3213-
'Morph Ethereum Testnet',
3214-
Networks.test.morpheth,
3215-
18,
3216-
UnderlyingAsset.MORPHETH,
3217-
BaseUnit.ETH,
3218-
[
3219-
...EVM_FEATURES,
3220-
CoinFeature.SHARED_EVM_SIGNING,
3221-
CoinFeature.SHARED_EVM_SDK,
3222-
CoinFeature.EVM_COMPATIBLE_IMS,
3223-
CoinFeature.EVM_COMPATIBLE_UI,
3224-
CoinFeature.EVM_COMPATIBLE_WP,
3225-
CoinFeature.EVM_NON_BITGO_RECOVERY,
3226-
CoinFeature.EVM_UNSIGNED_SWEEP_RECOVERY,
3227-
CoinFeature.SUPPORTS_ERC20,
3228-
]
3229-
),
32303188
account(
32313189
'887eebff-5d50-47f7-aea5-905e25c2e846',
32323190
'tdogeos',
@@ -4569,64 +4527,6 @@ export const allCoinsAndTokens = [
45694527
Networks.test.morph
45704528
),
45714529

4572-
// MorphEth mainnet tokens
4573-
erc20Token(
4574-
'088dcce6-6259-4012-a1e2-857534ea88fc',
4575-
'morpheth:usdc',
4576-
'USD Coin',
4577-
6,
4578-
'0xe34c91815d7fc18a9e2148bcd4241d0a5848b693',
4579-
UnderlyingAsset['morpheth:usdc'],
4580-
Networks.main.morpheth
4581-
),
4582-
erc20Token(
4583-
'03257b8a-67cc-4a84-9226-b757852fff63',
4584-
'morpheth:usdt',
4585-
'Tether USD',
4586-
6,
4587-
'0xc7d67a9cbb121b3b0b9c053dd9f469523243379a',
4588-
UnderlyingAsset['morpheth:usdt'],
4589-
Networks.main.morpheth
4590-
),
4591-
erc20Token(
4592-
'f0dad043-371d-48a4-a3cb-d798b4fc0fee',
4593-
'morpheth:usd1',
4594-
'USD1',
4595-
18,
4596-
'0x111111d2bf19e43c34263401e0cad979ed1cdb61',
4597-
UnderlyingAsset['morpheth:usd1'],
4598-
Networks.main.morpheth
4599-
),
4600-
4601-
// MorphEth testnet tokens
4602-
erc20Token(
4603-
'3383765b-37f9-4609-baf3-37c42f0ffee7',
4604-
'tmorpheth:tmt',
4605-
'Test Mintable Token',
4606-
6,
4607-
'0x5257950b5277dac30536eae4742ffef4e5af5256',
4608-
UnderlyingAsset['tmorpheth:tmt'],
4609-
Networks.test.morpheth
4610-
),
4611-
erc20Token(
4612-
'15286c32-210b-402d-84a2-5e406e584981',
4613-
'tmorpheth:usd1',
4614-
'Test USD1 Token',
4615-
18,
4616-
'0x8bdaad0ebc24fb63af6c5f29e2a2898500c87886',
4617-
UnderlyingAsset['tmorpheth:usd1'],
4618-
Networks.test.morpheth
4619-
),
4620-
erc20Token(
4621-
'e6a1553d-0dd0-4f77-b6a8-5f265243c7d0',
4622-
'tmorpheth:stgusd1',
4623-
'Test USD1 Token',
4624-
18,
4625-
'0x055fd4bbad96a076c15187b60fe7ea07ea789b94',
4626-
UnderlyingAsset['tmorpheth:stgusd1'],
4627-
Networks.test.morpheth
4628-
),
4629-
46304530
// Plume testnet tokens
46314531
erc20Token(
46324532
'67a140e3-c73e-4984-af13-7b1555ee3ff3',

modules/statics/src/base.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ export enum CoinFamily {
142142
SOMI = 'somi', // Somnia Chain
143143
FLUENTETH = 'fluenteth',
144144
MORPH = 'morph',
145-
MORPHETH = 'morpheth',
146145
ARCUSDC = 'arcusdc', // ARC network
147146
TEMPO = 'tempo', // Tempo Network
148147
UNIETH = 'unieth', // Unichain
@@ -647,7 +646,6 @@ export enum UnderlyingAsset {
647646
MEGAETH = 'megaeth',
648647
MON = 'mon',
649648
MORPH = 'morph',
650-
MORPHETH = 'morpheth',
651649
NEAR = 'near',
652650
OAS = 'oas',
653651
OG = 'og',
@@ -2494,15 +2492,9 @@ export enum UnderlyingAsset {
24942492
'eth:yb' = 'eth:yb',
24952493
'eth:btr' = 'eth:btr',
24962494
'morph:usdc' = 'morph:usdc',
2497-
'morpheth:usdc' = 'morpheth:usdc',
24982495
'morph:usdt' = 'morph:usdt',
2499-
'morpheth:usdt' = 'morpheth:usdt',
25002496
'morph:usd1' = 'morph:usd1',
2501-
'morpheth:usd1' = 'morpheth:usd1',
25022497
'tmorph:tmt' = 'tmorph:tmt',
2503-
'tmorpheth:tmt' = 'tmorpheth:tmt',
2504-
'tmorpheth:usd1' = 'tmorpheth:usd1',
2505-
'tmorpheth:stgusd1' = 'tmorpheth:stgusd1',
25062498

25072499
'xlm:BST-GADDFE4R72YUP2AOEL67OHZN3GJQYPC3VE734N2XFMEGRR2L32CZ3XYZ' = 'xlm:BST-GADDFE4R72YUP2AOEL67OHZN3GJQYPC3VE734N2XFMEGRR2L32CZ3XYZ',
25082500
'xlm:VELO-GDM4RQUQQUVSKQA7S6EM7XBZP3FCGH4Q7CL6TABQ7B2BEJ5ERARM2M5M' = 'xlm:VELO-GDM4RQUQQUVSKQA7S6EM7XBZP3FCGH4Q7CL6TABQ7B2BEJ5ERARM2M5M',

modules/statics/src/coins.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { BaseCoin, CoinFeature, DynamicCoin } from './base';
3434
import { AmsNetworkConfigMap, AmsTokenConfig, TrimmedAmsTokenConfig } from './tokenConfig';
3535
import { CoinMap } from './map';
3636
import { BaseNetwork, getNetwork, getNetworksMap, NetworkType } from './networks';
37-
import { networkFeatureMapForTokens } from './networkFeatureMapForTokens';
37+
import { getNetworkTokenFeatures } from './networkFeatureMapForTokens';
3838
import { ofcErc20Coins, tOfcErc20Coins } from './coins/ofcErc20Coins';
3939
import { ofcCoins } from './coins/ofcCoins';
4040
import { allCoinsAndTokens } from './allCoinsAndTokens';
@@ -117,6 +117,19 @@ export function createToken(token: AmsTokenConfig): Readonly<BaseCoin> | undefin
117117
ton: jettonToken,
118118
};
119119

120+
const tokenNetwork = token.network instanceof BaseNetwork ? token.network : undefined;
121+
122+
// EVM-compatible chains are identified by chainId on their network object.
123+
if (
124+
tokenNetwork &&
125+
'chainId' in tokenNetwork &&
126+
typeof (tokenNetwork as { chainId?: unknown }).chainId === 'number'
127+
) {
128+
if (!erc20ChainToNameMap[token.family]) {
129+
erc20ChainToNameMap[token.family] = token.family;
130+
}
131+
}
132+
120133
// dynamically add erc20 token initializers for eth like chains to the initializer map
121134
Object.keys(erc20ChainToNameMap).forEach((key) => {
122135
initializerMap[key] = erc20Token;
@@ -519,9 +532,9 @@ export function createTokenMapUsingTrimmedConfigDetails(
519532
{ ...tokenConfig, features: tokenConfig.additionalFeatures ?? [], network },
520533
];
521534
}
522-
} else if (network && networkFeatureMapForTokens[network.family]) {
535+
} else if (network && getNetworkTokenFeatures(network.family as string)) {
523536
const features = new Set([
524-
...(networkFeatureMapForTokens[network.family] || []),
537+
...(getNetworkTokenFeatures(network.family as string) || []),
525538
...(tokenConfig.additionalFeatures || []),
526539
]);
527540
tokenConfig.excludedFeatures?.forEach((feature) => features.delete(feature));
@@ -549,9 +562,9 @@ export function createTokenUsingTrimmedConfigDetails(
549562
return undefined;
550563
}
551564

552-
if (network && networkFeatureMapForTokens[network.family]) {
565+
if (network && getNetworkTokenFeatures(network.family as string)) {
553566
const features = new Set([
554-
...(networkFeatureMapForTokens[network.family] || []),
567+
...(getNetworkTokenFeatures(network.family as string) || []),
555568
...(tokenConfig.additionalFeatures || []),
556569
]);
557570
tokenConfig.excludedFeatures?.forEach((feature) => features.delete(feature));

modules/statics/src/coins/ofcCoins.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -467,22 +467,6 @@ export const ofcCoins = [
467467
UnderlyingAsset.MORPH,
468468
CoinKind.CRYPTO
469469
),
470-
ofc(
471-
'cdf3487e-a365-4319-83ff-ff06f02810a6',
472-
'ofcmorpheth',
473-
'Morph Ethereum',
474-
18,
475-
UnderlyingAsset.MORPHETH,
476-
CoinKind.CRYPTO
477-
),
478-
tofc(
479-
'4113e0ae-41c5-4293-8b7a-5829cbc3ee92',
480-
'ofctmorpheth',
481-
'Morph Ethereum Testnet',
482-
18,
483-
UnderlyingAsset.MORPHETH,
484-
CoinKind.CRYPTO
485-
),
486470
ofc(
487471
'dc733b2f-92bf-49d3-9f5d-9774e1637f0f',
488472
'ofcokbxlayer',

modules/statics/src/coins/ofcErc20Coins.ts

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -6211,99 +6211,13 @@ export const tOfcErc20Coins = [
62116211
true,
62126212
'tmorph'
62136213
),
6214-
6215-
// MorphETH tokens
6216-
ofcerc20(
6217-
'9c28b89b-1069-4bad-bf7b-8ecea440cee2',
6218-
'ofcmorpheth:usdc',
6219-
'USD Coin',
6220-
6,
6221-
UnderlyingAsset['morpheth:usdc'],
6222-
undefined,
6223-
undefined,
6224-
'',
6225-
undefined,
6226-
undefined,
6227-
true,
6228-
'morpheth'
6229-
),
6230-
ofcerc20(
6231-
'07010f84-5bc7-4715-9d19-09d694f558fb',
6232-
'ofcmorpheth:usdt',
6233-
'Tether USD',
6234-
6,
6235-
UnderlyingAsset['morpheth:usdt'],
6236-
undefined,
6237-
undefined,
6238-
'',
6239-
undefined,
6240-
undefined,
6241-
true,
6242-
'morpheth'
6243-
),
6244-
ofcerc20(
6245-
'883727b5-49e3-4fb3-99f7-fefb803710e5',
6246-
'ofcmorpheth:usd1',
6247-
'USD1',
6248-
18,
6249-
UnderlyingAsset['morpheth:usd1'],
6250-
undefined,
6251-
undefined,
6252-
'',
6253-
undefined,
6254-
undefined,
6255-
true,
6256-
'morpheth'
6257-
),
6258-
tofcerc20(
6259-
'34e77cee-2885-4a77-911c-b5f2bdd28cd7',
6260-
'ofctmorpheth:tmt',
6261-
'Test Mintable Token',
6262-
6,
6263-
underlyingAssetForSymbol('tmorpheth:tmt'),
6264-
undefined,
6265-
undefined,
6266-
'',
6267-
undefined,
6268-
undefined,
6269-
true,
6270-
'tmorpheth'
6271-
),
62726214
ofcerc20(
62736215
'3ea8b443-c2a7-4a3c-8b58-1a8a36aa4da8',
62746216
'ofcseievm:wsei',
62756217
'Wrapped SEI',
62766218
18,
62776219
underlyingAssetForSymbol('seievm:wsei')
62786220
),
6279-
tofcerc20(
6280-
'8c64311b-e288-4dd4-8f9f-25dad3418837',
6281-
'ofctmorpheth:usd1',
6282-
'Test USD1 Token',
6283-
18,
6284-
underlyingAssetForSymbol('tmorpheth:usd1'),
6285-
undefined,
6286-
undefined,
6287-
'',
6288-
undefined,
6289-
undefined,
6290-
true,
6291-
'tmorpheth'
6292-
),
6293-
tofcerc20(
6294-
'15ca2074-d5bc-450c-886e-1338ffb114f8',
6295-
'ofctmorpheth:stgusd1',
6296-
'Test USD1 Token',
6297-
18,
6298-
underlyingAssetForSymbol('tmorpheth:stgusd1'),
6299-
undefined,
6300-
undefined,
6301-
'',
6302-
undefined,
6303-
undefined,
6304-
true,
6305-
'tmorpheth'
6306-
),
63076221
ofcerc20(
63086222
'f82110b2-22a1-4a27-b640-9a5c05f60957',
63096223
'ofceth:audx',

modules/statics/src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ export {
3737
CantonToken,
3838
} from './account';
3939
export { CoinMap } from './map';
40-
export { networkFeatureMapForTokens } from './networkFeatureMapForTokens';
40+
export {
41+
networkFeatureMapForTokens,
42+
registerNetworkTokenFeatures,
43+
getNetworkTokenFeatures,
44+
} from './networkFeatureMapForTokens';
4145
export {
4246
generateErc20Coin,
4347
generateTestErc20Coin,

modules/statics/src/networkFeatureMapForTokens.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,21 @@ import {
1313
TAO_TOKEN_FEATURES,
1414
} from './coinFeatures';
1515

16+
const dynamicNetworkTokenFeaturesMap = new Map<string, CoinFeature[]>();
17+
18+
/** Register default token features for a dynamically onboarded chain family. */
19+
export function registerNetworkTokenFeatures(family: string, features: CoinFeature[]): void {
20+
dynamicNetworkTokenFeaturesMap.set(family, features);
21+
}
22+
23+
/**
24+
* Look up token features for a family.
25+
* Checks static map first, then falls back to dynamic map.
26+
*/
27+
export function getNetworkTokenFeatures(family: string): CoinFeature[] | undefined {
28+
return networkFeatureMapForTokens[family as CoinFamily] ?? dynamicNetworkTokenFeaturesMap.get(family);
29+
}
30+
1631
export const networkFeatureMapForTokens: Partial<Record<CoinFamily, CoinFeature[]>> = {
1732
algo: AccountCoin.DEFAULT_FEATURES,
1833
apt: APT_FEATURES,

0 commit comments

Comments
 (0)