Skip to content

Commit 47bb213

Browse files
authored
Merge pull request #6491 from BitGo/COIN-4856
feat: Gate certain high risk tokens from Singapore custody
2 parents 6d7d766 + 7a41003 commit 47bb213

File tree

5 files changed

+28
-62
lines changed

5 files changed

+28
-62
lines changed

modules/statics/src/coinFeatures.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ export const SOL_TOKEN_FEATURES = [
248248
CoinFeature.TSS_COLD,
249249
CoinFeature.BULK_TRANSACTION,
250250
];
251+
export const SOL_TOKEN_FEATURES_EXCLUDE_SINGAPORE = SOL_TOKEN_FEATURES.filter(
252+
(feature) => feature !== CoinFeature.CUSTODY_BITGO_SINGAPORE
253+
);
251254
export const SOL_OFC_TOKEN_FEATURES = [...ACCOUNT_COIN_DEFAULT_FEATURES, CoinFeature.TSS, CoinFeature.TSS_COLD];
252255
export const APT_OFC_TOKEN_FEATURES = [...ACCOUNT_COIN_DEFAULT_FEATURES, CoinFeature.TSS, CoinFeature.TSS_COLD];
253256
export const BSC_TOKEN_FEATURES = [...ACCOUNT_COIN_DEFAULT_FEATURES, CoinFeature.BULK_TRANSACTION];

modules/statics/src/coins/avaxTokens.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ export const avaxTokens = [
6464
'Colony Avalanche Index',
6565
18,
6666
'0x48f88a3fe843ccb0b5003e70b4192c1d7448bef0',
67-
UnderlyingAsset['avaxc:cai']
67+
UnderlyingAsset['avaxc:cai'],
68+
AccountCoin.DEFAULT_FEATURES_EXCLUDE_SINGAPORE
6869
),
6970
avaxErc20(
7071
'55d38f23-ed66-43b8-838c-e9df316c0140',

modules/statics/src/coins/erc20Coins.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,8 @@ export const erc20Coins = [
769769
'BCAP',
770770
0,
771771
'0x1f41e42d0a9e3c0dd3ba15b527342783b43200a9',
772-
UnderlyingAsset.BCAP
772+
UnderlyingAsset.BCAP,
773+
AccountCoin.DEFAULT_FEATURES_EXCLUDE_SINGAPORE
773774
),
774775
erc20(
775776
'8f3ba79b-4cf6-417f-a5bc-84c613a3c08e',
@@ -959,7 +960,8 @@ export const erc20Coins = [
959960
'Bankera',
960961
8,
961962
'0xc80c5e40220172b36adee2c951f26f2a577810c5',
962-
UnderlyingAsset.BNK
963+
UnderlyingAsset.BNK,
964+
AccountCoin.DEFAULT_FEATURES_EXCLUDE_SINGAPORE
963965
),
964966
erc20(
965967
'fd39c546-52c8-4668-b30d-3397681ff9d3',
@@ -1262,7 +1264,8 @@ export const erc20Coins = [
12621264
'Cyber Credit Token',
12631265
0,
12641266
'0x8469e5158fb3c043cf88ce769c94e4b9fc8d79b5',
1265-
UnderlyingAsset.CCT
1267+
UnderlyingAsset.CCT,
1268+
AccountCoin.DEFAULT_FEATURES_EXCLUDE_SINGAPORE
12661269
),
12671270
erc20(
12681271
'3f222275-9456-4eff-840d-4fe873676619',
@@ -6261,7 +6264,8 @@ export const erc20Coins = [
62616264
'Vinx Coin',
62626265
18,
62636266
'0x14f0a12a43c36c49d4b403dd6e1a9b8222be456c',
6264-
UnderlyingAsset.VXC
6267+
UnderlyingAsset.VXC,
6268+
AccountCoin.DEFAULT_FEATURES_EXCLUDE_SINGAPORE
62656269
),
62666270
erc20(
62676271
'7733a50f-b06b-4ea2-94bb-d5a6c2999dc2',
@@ -6605,7 +6609,8 @@ export const erc20Coins = [
66056609
'Rialto',
66066610
9,
66076611
'0xb24754be79281553dc1adc160ddf5cd9b74361a4',
6608-
UnderlyingAsset.XRL
6612+
UnderlyingAsset.XRL,
6613+
AccountCoin.DEFAULT_FEATURES_EXCLUDE_SINGAPORE
66096614
),
66106615
erc20(
66116616
'0ef88852-b8d7-4260-818d-e626c913e56f',
@@ -10694,7 +10699,8 @@ export const erc20Coins = [
1069410699
'UBS uMINT',
1069510700
0,
1069610701
'0x3797c46db697c24a983222c335f17ba28e8c5b69',
10697-
UnderlyingAsset['eth:umint']
10702+
UnderlyingAsset['eth:umint'],
10703+
AccountCoin.DEFAULT_FEATURES_EXCLUDE_SINGAPORE
1069810704
),
1069910705
erc20(
1070010706
'627ba0d4-29e6-48ec-b72b-e1124fcc5079',

modules/statics/src/coins/solTokens.ts

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ProgramID, solToken, tsolToken } from '../account';
22
import { CoinFeature, UnderlyingAsset } from '../base';
33
import {
44
SOL_TOKEN_FEATURES,
5+
SOL_TOKEN_FEATURES_EXCLUDE_SINGAPORE,
56
SOL_TOKEN_FEATURES_WITH_FRANKFURT,
67
SOL_TOKEN_FEATURES_WITH_FRANKFURT_GERMANY,
78
} from '../coinFeatures';
@@ -2529,12 +2530,7 @@ export const solTokens = [
25292530
'USTRYnGgcHAhdWsanv8BG6vHGd4p7UGgoB9NRd8ei7j',
25302531
'USTRYnGgcHAhdWsanv8BG6vHGd4p7UGgoB9NRd8ei7j',
25312532
UnderlyingAsset['sol:ustry'],
2532-
[
2533-
...SOL_TOKEN_FEATURES,
2534-
CoinFeature.CUSTODY_BITGO_FRANKFURT,
2535-
CoinFeature.CUSTODY_BITGO_GERMANY,
2536-
CoinFeature.CUSTODY_BITGO_SINGAPORE,
2537-
],
2533+
[...SOL_TOKEN_FEATURES_EXCLUDE_SINGAPORE, CoinFeature.CUSTODY_BITGO_GERMANY],
25382534
ProgramID.Token2022ProgramId
25392535
),
25402536
solToken(
@@ -2545,12 +2541,7 @@ export const solTokens = [
25452541
'EuroszHk1AL7fHBBsxgeGHsamUqwBpb26oEyt9BcfZ6G',
25462542
'EuroszHk1AL7fHBBsxgeGHsamUqwBpb26oEyt9BcfZ6G',
25472543
UnderlyingAsset['sol:eurob'],
2548-
[
2549-
...SOL_TOKEN_FEATURES,
2550-
CoinFeature.CUSTODY_BITGO_FRANKFURT,
2551-
CoinFeature.CUSTODY_BITGO_GERMANY,
2552-
CoinFeature.CUSTODY_BITGO_SINGAPORE,
2553-
],
2544+
[...SOL_TOKEN_FEATURES_EXCLUDE_SINGAPORE, CoinFeature.CUSTODY_BITGO_GERMANY],
25542545
ProgramID.Token2022ProgramId
25552546
),
25562547
solToken(
@@ -2561,12 +2552,7 @@ export const solTokens = [
25612552
'BRNTNaZeTJANz9PeuD8drNbBHwGgg7ZTjiQYrFgWQ48p',
25622553
'BRNTNaZeTJANz9PeuD8drNbBHwGgg7ZTjiQYrFgWQ48p',
25632554
UnderlyingAsset['sol:tesouro'],
2564-
[
2565-
...SOL_TOKEN_FEATURES,
2566-
CoinFeature.CUSTODY_BITGO_FRANKFURT,
2567-
CoinFeature.CUSTODY_BITGO_GERMANY,
2568-
CoinFeature.CUSTODY_BITGO_SINGAPORE,
2569-
],
2555+
[...SOL_TOKEN_FEATURES_EXCLUDE_SINGAPORE, CoinFeature.CUSTODY_BITGO_GERMANY],
25702556
ProgramID.Token2022ProgramId
25712557
),
25722558
solToken(
@@ -2577,12 +2563,7 @@ export const solTokens = [
25772563
'CETES7CKqqKQizuSN6iWQwmTeFRjbJR6Vw2XRKfEDR8f',
25782564
'CETES7CKqqKQizuSN6iWQwmTeFRjbJR6Vw2XRKfEDR8f',
25792565
UnderlyingAsset['sol:cetes'],
2580-
[
2581-
...SOL_TOKEN_FEATURES,
2582-
CoinFeature.CUSTODY_BITGO_FRANKFURT,
2583-
CoinFeature.CUSTODY_BITGO_GERMANY,
2584-
CoinFeature.CUSTODY_BITGO_SINGAPORE,
2585-
],
2566+
[...SOL_TOKEN_FEATURES_EXCLUDE_SINGAPORE, CoinFeature.CUSTODY_BITGO_GERMANY],
25862567
ProgramID.Token2022ProgramId
25872568
),
25882569
solToken(
@@ -2593,12 +2574,7 @@ export const solTokens = [
25932574
'GiLTSeSFnNse7xQVYeKdMyckGw66AoRmyggGg1NNd4yr',
25942575
'GiLTSeSFnNse7xQVYeKdMyckGw66AoRmyggGg1NNd4yr',
25952576
UnderlyingAsset['sol:gilts'],
2596-
[
2597-
...SOL_TOKEN_FEATURES,
2598-
CoinFeature.CUSTODY_BITGO_FRANKFURT,
2599-
CoinFeature.CUSTODY_BITGO_GERMANY,
2600-
CoinFeature.CUSTODY_BITGO_SINGAPORE,
2601-
],
2577+
[...SOL_TOKEN_FEATURES_EXCLUDE_SINGAPORE, CoinFeature.CUSTODY_BITGO_GERMANY],
26022578
ProgramID.Token2022ProgramId
26032579
),
26042580
solToken(

modules/statics/test/unit/coins.ts

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -300,39 +300,19 @@ const custodyFeatures: Record<string, { features: CoinFeature[] }> = {
300300
],
301301
},
302302
'sol:ustry': {
303-
features: [
304-
CoinFeature.CUSTODY_BITGO_FRANKFURT,
305-
CoinFeature.CUSTODY_BITGO_GERMANY,
306-
CoinFeature.CUSTODY_BITGO_SINGAPORE,
307-
],
303+
features: [CoinFeature.CUSTODY_BITGO_FRANKFURT, CoinFeature.CUSTODY_BITGO_GERMANY],
308304
},
309305
'sol:eurob': {
310-
features: [
311-
CoinFeature.CUSTODY_BITGO_FRANKFURT,
312-
CoinFeature.CUSTODY_BITGO_GERMANY,
313-
CoinFeature.CUSTODY_BITGO_SINGAPORE,
314-
],
306+
features: [CoinFeature.CUSTODY_BITGO_FRANKFURT, CoinFeature.CUSTODY_BITGO_GERMANY],
315307
},
316308
'sol:tesouro': {
317-
features: [
318-
CoinFeature.CUSTODY_BITGO_FRANKFURT,
319-
CoinFeature.CUSTODY_BITGO_GERMANY,
320-
CoinFeature.CUSTODY_BITGO_SINGAPORE,
321-
],
309+
features: [CoinFeature.CUSTODY_BITGO_FRANKFURT, CoinFeature.CUSTODY_BITGO_GERMANY],
322310
},
323311
'sol:cetes': {
324-
features: [
325-
CoinFeature.CUSTODY_BITGO_FRANKFURT,
326-
CoinFeature.CUSTODY_BITGO_GERMANY,
327-
CoinFeature.CUSTODY_BITGO_SINGAPORE,
328-
],
312+
features: [CoinFeature.CUSTODY_BITGO_FRANKFURT, CoinFeature.CUSTODY_BITGO_GERMANY],
329313
},
330314
'sol:gilts': {
331-
features: [
332-
CoinFeature.CUSTODY_BITGO_FRANKFURT,
333-
CoinFeature.CUSTODY_BITGO_GERMANY,
334-
CoinFeature.CUSTODY_BITGO_SINGAPORE,
335-
],
315+
features: [CoinFeature.CUSTODY_BITGO_FRANKFURT, CoinFeature.CUSTODY_BITGO_GERMANY],
336316
},
337317
'sol:muskit': {
338318
features: [

0 commit comments

Comments
 (0)