Skip to content

Commit 97ffb53

Browse files
authored
Merge pull request #6255 from BitGo/WIN-5769
chore: gate keep tokens for SINGAPORE and MENA trust
2 parents 2e7f0f5 + 83c3d81 commit 97ffb53

File tree

6 files changed

+108
-14
lines changed

6 files changed

+108
-14
lines changed

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
/modules/sdk-rpc-wrapper @BitGo/ethalt-team
124124
/modules/sdk-test/ @BitGo/web-experience @BitGo/wallet-platform
125125
/modules/sjcl/ @BitGo/coins @BitGo/web-experience @BitGo/wallet-platform
126-
/modules/statics/ @BitGo/web-experience @BitGo/wallet-platform @BitGo/ethalt-team
126+
/modules/statics/ @BitGo/web-experience @BitGo/ethalt-team
127127
/modules/statics/src/utxo.ts @BitGo/btc-team
128128
/modules/web-demo/ @BitGo/coins @BitGo/web-experience @BitGo/wallet-platform
129129
/scripts/ @BitGo/coins @BitGo/web-experience @BitGo/wallet-platform

modules/statics/src/coins/avaxTokens.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ export const avaxTokens = [
273273
'Staked AVAX',
274274
18,
275275
'0x2b2c81e08f1af8835a78bb2a90ae924ace0ea4be',
276-
UnderlyingAsset['avaxc:savax']
276+
UnderlyingAsset['avaxc:savax'],
277+
AccountCoin.DEFAULT_FEATURES_EXCLUDE_SINGAPORE
277278
),
278279
avaxErc20(
279280
'772a2498-2bef-4da8-9bce-f1a89e6f4536',

modules/statics/src/coins/bscTokens.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { bscToken, tbscToken } from '../account';
2-
import { UnderlyingAsset } from '../base';
1+
import { bscToken, tbscToken, AccountCoin } from '../account';
2+
import { UnderlyingAsset, CoinFeature } from '../base';
33
import { BSC_TOKEN_FEATURES, BSC_TOKEN_FEATURES_EXCLUDE_SINGAPORE } from '../coinFeatures';
44

55
export const bscTokens = [
@@ -343,7 +343,11 @@ export const bscTokens = [
343343
18,
344344
'0x2a459dd33f05ed8ea9584505cf04698be5654e6d',
345345
UnderlyingAsset['bsc:wrx'],
346-
BSC_TOKEN_FEATURES
346+
AccountCoin.getFeaturesExcluding([
347+
CoinFeature.CUSTODY_BITGO_SINGAPORE,
348+
CoinFeature.CUSTODY_BITGO_CUSTODY_MENA_FZE,
349+
CoinFeature.CUSTODY_BITGO_MENA_FZE,
350+
])
347351
),
348352
bscToken(
349353
'1a26f668-9cde-4768-be8c-1fdcdf8e39e9',
@@ -622,7 +626,7 @@ export const bscTokens = [
622626
18,
623627
'0x5d5c5c1d14faf8ff704295b2f502daa9d06799a0',
624628
UnderlyingAsset['bsc:nnn'],
625-
BSC_TOKEN_FEATURES
629+
BSC_TOKEN_FEATURES_EXCLUDE_SINGAPORE
626630
),
627631
bscToken(
628632
'9b2925ed-7e66-4f60-b1bb-edae3931e9cd',
@@ -1116,7 +1120,11 @@ export const bscTokens = [
11161120
18,
11171121
'0x9fb9a33956351cf4fa040f65a13b835a3c8764e3',
11181122
UnderlyingAsset['bsc:multi'],
1119-
BSC_TOKEN_FEATURES
1123+
AccountCoin.getFeaturesExcluding([
1124+
CoinFeature.CUSTODY_BITGO_SINGAPORE,
1125+
CoinFeature.CUSTODY_BITGO_CUSTODY_MENA_FZE,
1126+
CoinFeature.CUSTODY_BITGO_MENA_FZE,
1127+
])
11201128
),
11211129
bscToken(
11221130
'ec186a0f-8e7c-4844-92b0-630d4bce7eef',

modules/statics/src/coins/erc20Coins.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,12 @@ export const erc20Coins = [
769769
'Beam',
770770
18,
771771
'0x62d0a8458ed7719fdaf978fe5929c6d342b0bfce',
772-
UnderlyingAsset.BEAM
772+
UnderlyingAsset.BEAM,
773+
AccountCoin.getFeaturesExcluding([
774+
CoinFeature.CUSTODY_BITGO_SINGAPORE,
775+
CoinFeature.CUSTODY_BITGO_CUSTODY_MENA_FZE,
776+
CoinFeature.CUSTODY_BITGO_MENA_FZE,
777+
])
773778
),
774779
erc20(
775780
'04c44584-c417-4fce-883f-8f316854c63e',
@@ -1110,7 +1115,8 @@ export const erc20Coins = [
11101115
'Backed NVIDIA Corp',
11111116
18,
11121117
'0xa34c5e0abe843e10461e2c9586ea03e55dbcc495',
1113-
UnderlyingAsset.BNVDA
1118+
UnderlyingAsset.BNVDA,
1119+
AccountCoin.DEFAULT_FEATURES_EXCLUDE_SINGAPORE
11141120
),
11151121
erc20(
11161122
'44fefbae-d835-4fb2-931a-22167f9f4894',
@@ -3292,7 +3298,8 @@ export const erc20Coins = [
32923298
'Kroma',
32933299
18,
32943300
'0x25500000d700bbe27104577cccce8eabcc96c8ad',
3295-
UnderlyingAsset.KRO
3301+
UnderlyingAsset.KRO,
3302+
AccountCoin.DEFAULT_FEATURES_EXCLUDE_SINGAPORE
32963303
),
32973304
erc20(
32983305
'cbcebae0-e2a8-4ebe-8da7-89983f04f917',
@@ -5318,7 +5325,12 @@ export const erc20Coins = [
53185325
'Serum',
53195326
6,
53205327
'0x476c5e26a75bd202a9683ffd34359c0cc15be0ff',
5321-
UnderlyingAsset.SRM
5328+
UnderlyingAsset.SRM,
5329+
AccountCoin.getFeaturesExcluding([
5330+
CoinFeature.CUSTODY_BITGO_SINGAPORE,
5331+
CoinFeature.CUSTODY_BITGO_CUSTODY_MENA_FZE,
5332+
CoinFeature.CUSTODY_BITGO_MENA_FZE,
5333+
])
53225334
),
53235335
erc20(
53245336
'7c786a41-3527-4e87-8b7a-addfe4f4e02a',
@@ -9862,7 +9874,8 @@ export const erc20Coins = [
98629874
'USCC',
98639875
8,
98649876
'0x7b13abb88eb01aa0cd9739b91d4d4f273262eacf',
9865-
UnderlyingAsset.USCC
9877+
UnderlyingAsset.USCC,
9878+
AccountCoin.DEFAULT_FEATURES_EXCLUDE_SINGAPORE
98669879
),
98679880
erc20(
98689881
'efae2e71-10b8-4461-8e84-51390f6e77df',

modules/statics/src/coins/polygonTokens.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { polygonErc20, tpolygonErc20 } from '../account';
2-
import { UnderlyingAsset } from '../base';
2+
import { UnderlyingAsset, CoinFeature } from '../base';
33
import { POLYGON_TOKEN_FEATURES, POLYGON_TOKEN_FEATURES_WITH_FRANKFURT } from '../coinFeatures';
44

55
export const polygonTokens = [
@@ -874,7 +874,14 @@ export const polygonTokens = [
874874
8,
875875
'0x72d6066f486bd0052eefb9114b66ae40e0a6031a',
876876
UnderlyingAsset['polygon:wrx'],
877-
POLYGON_TOKEN_FEATURES
877+
POLYGON_TOKEN_FEATURES.filter(
878+
(feature) =>
879+
![
880+
CoinFeature.CUSTODY_BITGO_SINGAPORE,
881+
CoinFeature.CUSTODY_BITGO_CUSTODY_MENA_FZE,
882+
CoinFeature.CUSTODY_BITGO_MENA_FZE,
883+
].includes(feature)
884+
)
878885
),
879886
polygonErc20(
880887
'8c61bb88-f103-4d42-bf5e-26826d4b7712',

modules/statics/test/unit/coins.ts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,32 @@ const coinsWithExcludedFeatures: Record<string, { features: CoinFeature[] }> = {
598598
CoinFeature.CUSTODY_BITGO_FRANKFURT,
599599
],
600600
},
601+
beam: {
602+
features: [
603+
CoinFeature.ACCOUNT_MODEL,
604+
CoinFeature.REQUIRES_BIG_NUMBER,
605+
CoinFeature.VALUELESS_TRANSFER,
606+
CoinFeature.TRANSACTION_DATA,
607+
CoinFeature.CUSTODY_BITGO_TRUST,
608+
CoinFeature.CUSTODY_BITGO_KOREA,
609+
CoinFeature.CUSTODY_BITGO_EUROPE_APS,
610+
CoinFeature.CUSTODY_BITGO_FRANKFURT,
611+
CoinFeature.CUSTODY,
612+
],
613+
},
614+
srm: {
615+
features: [
616+
CoinFeature.ACCOUNT_MODEL,
617+
CoinFeature.REQUIRES_BIG_NUMBER,
618+
CoinFeature.VALUELESS_TRANSFER,
619+
CoinFeature.TRANSACTION_DATA,
620+
CoinFeature.CUSTODY_BITGO_TRUST,
621+
CoinFeature.CUSTODY_BITGO_KOREA,
622+
CoinFeature.CUSTODY_BITGO_EUROPE_APS,
623+
CoinFeature.CUSTODY_BITGO_FRANKFURT,
624+
CoinFeature.CUSTODY,
625+
],
626+
},
601627
'eth:usdf': {
602628
features: [
603629
CoinFeature.ACCOUNT_MODEL,
@@ -652,6 +678,45 @@ const coinsWithExcludedFeatures: Record<string, { features: CoinFeature[] }> = {
652678
CoinFeature.CUSTODY_BITGO_FRANKFURT,
653679
],
654680
},
681+
'polygon:wrx': {
682+
features: [
683+
CoinFeature.ACCOUNT_MODEL,
684+
CoinFeature.REQUIRES_BIG_NUMBER,
685+
CoinFeature.VALUELESS_TRANSFER,
686+
CoinFeature.TRANSACTION_DATA,
687+
CoinFeature.CUSTODY,
688+
CoinFeature.CUSTODY_BITGO_TRUST,
689+
CoinFeature.CUSTODY_BITGO_KOREA,
690+
CoinFeature.CUSTODY_BITGO_EUROPE_APS,
691+
CoinFeature.CUSTODY_BITGO_FRANKFURT,
692+
],
693+
},
694+
'bsc:wrx': {
695+
features: [
696+
CoinFeature.ACCOUNT_MODEL,
697+
CoinFeature.REQUIRES_BIG_NUMBER,
698+
CoinFeature.VALUELESS_TRANSFER,
699+
CoinFeature.TRANSACTION_DATA,
700+
CoinFeature.CUSTODY_BITGO_TRUST,
701+
CoinFeature.CUSTODY,
702+
CoinFeature.CUSTODY_BITGO_KOREA,
703+
CoinFeature.CUSTODY_BITGO_EUROPE_APS,
704+
CoinFeature.CUSTODY_BITGO_FRANKFURT,
705+
],
706+
},
707+
'bsc:multi': {
708+
features: [
709+
CoinFeature.ACCOUNT_MODEL,
710+
CoinFeature.REQUIRES_BIG_NUMBER,
711+
CoinFeature.VALUELESS_TRANSFER,
712+
CoinFeature.TRANSACTION_DATA,
713+
CoinFeature.CUSTODY,
714+
CoinFeature.CUSTODY_BITGO_TRUST,
715+
CoinFeature.CUSTODY_BITGO_KOREA,
716+
CoinFeature.CUSTODY_BITGO_EUROPE_APS,
717+
CoinFeature.CUSTODY_BITGO_FRANKFURT,
718+
],
719+
},
655720
};
656721

657722
describe('CoinMap', function () {

0 commit comments

Comments
 (0)