Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/key-card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"qrcode": "^1.5.1"
},
"devDependencies": {
"@bitgo/sdk-lib-mpc": "^11.6.0",
"@bitgo/sdk-lib-mpc": "^11.6.1",
"@bitgo/utxo-lib": "^11.25.0",
"@types/qrcode": "1.5.0"
},
Expand Down
8 changes: 8 additions & 0 deletions modules/statics/src/allCoinsAndTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5528,6 +5528,14 @@ export const allCoinsAndTokens = [
'0x0cb6d03b0ac88a463f67b7ad99f9f3ec4678092e',
UnderlyingAsset['mon:sofid']
),
monErc20(
'6c615ca8-2bbd-4713-a162-e4b2e1b49407', // CECHO-2732
'mon:usdt0',
'USDT0',
6,
'0xe7cd86e13ac4309349f30b3435a9d337750fc82d', // https://monadexplorer.com/token/0xe7cd86e13ac4309349f30b3435a9d337750fc82d
UnderlyingAsset['mon:usdt0']
),

// MON testnet tokens
tmonErc20(
Expand Down
2 changes: 2 additions & 0 deletions modules/statics/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2626,6 +2626,7 @@ export enum UnderlyingAsset {
ZUSD = 'zusd',
'eth:usdg' = 'eth:usdg',
'eth:spxux' = 'eth:spxux',
'eth:stampx' = 'eth:stampx', // CECHO-2732
'eth:aleo' = 'eth:aleo',
'eth:dbusd' = 'eth:dbusd',
'eth:edu' = 'eth:edu',
Expand Down Expand Up @@ -3918,6 +3919,7 @@ export enum UnderlyingAsset {
'mon:usdc' = 'mon:usdc',
'mon:wmon' = 'mon:wmon',
'mon:sofid' = 'mon:sofid',
'mon:usdt0' = 'mon:usdt0', // CECHO-2732

// Monad testnet tokens
'tmon:tmt' = 'tmon:tmt',
Expand Down
8 changes: 8 additions & 0 deletions modules/statics/src/coins/erc20Coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10886,6 +10886,14 @@ export const erc20Coins = [
'0x873d589f38abbcdd1fca27261aba2f1aa0661d44',
UnderlyingAsset['eth:spxux']
),
erc20(
'19f73ddf-723e-4eec-9deb-279794bca9f6', // CECHO-2732
'eth:stampx',
'STAMPx',
18,
'0xc0aca7acdd9adeed3177a4b299caebe816842f52', // https://etherscan.io/token/0xc0aca7acdd9adeed3177a4b299caebe816842f52
UnderlyingAsset['eth:stampx']
),
erc20(
'cd21be23-a0f4-4706-8b00-cee136e1188a',
'eth:aleo',
Expand Down
54 changes: 50 additions & 4 deletions modules/statics/src/coins/ofcCoins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import {
SOL_OFC_TOKEN_FEATURES,
APT_OFC_TOKEN_FEATURES,
ACCOUNT_COIN_DEFAULT_FEATURES,
ACCOUNT_COIN_DEFAULT_FEATURES_TRUST_ONLY,
} from '../coinFeatures';

export const ofcCoins = [
Expand Down Expand Up @@ -4997,6 +4998,13 @@ export const ofcCoins = [
undefined,
[CoinFeature.STABLECOIN]
),
tofcHederaToken(
'2341e390-b6a2-4b04-a2ad-ca5d0bd1b10c', // CECHO-2732
'ofcthbar:fly',
'Fluency (Testnet)',
18,
UnderlyingAsset['thbar:fly']
),

ofcStellarToken(
'fd90a80b-d615-434e-9821-1ef179a06071',
Expand Down Expand Up @@ -5049,11 +5057,13 @@ export const ofcCoins = [
),

ofcStellarToken(
'bebecdfe-0a09-4e43-be91-62afdbe2ce49',
'ofcxlm:btgo',
'BTGO',
'8ad91a65-6cc9-443f-8e88-23afc0404b03', // CECHO-2732
'ofcxlm:SPXU-GDJBVX3QA5HJPBSAU5VIX2W6MC37NU4UFXPKEGK42SJCYN6AEQ4Z6COM',
'WisdomTree 500 Digital Fund',
7,
UnderlyingAsset['xlm:BTGO-GAXTPUVP2XINTMEN57FPJ34DAPZXDMMGX7TB7ASIBWHWT6ARC3IOGA2W']
UnderlyingAsset['xlm:SPXU-GDJBVX3QA5HJPBSAU5VIX2W6MC37NU4UFXPKEGK42SJCYN6AEQ4Z6COM'],
undefined,
ACCOUNT_COIN_DEFAULT_FEATURES_TRUST_ONLY
),
Comment on lines +5059 to +5067

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 The new OFC WisdomTree 500 coin would be listed as custodied in MENA FZE and India, while its base xlm:SPXU-… token is BitGo Trust only. ofcStellarToken only inherits base features through getFilteredFeatures(suffix), which looks up suffix.toLowerCase() with a case-sensitive key. The mixed-case Stellar name never matches, so the coin gets OfcCoin.DEFAULT_FEATURES. Fix: pass ACCOUNT_COIN_DEFAULT_FEATURES_TRUST_ONLY explicitly at ofcCoins.ts:5065-5071 and add the name to the 'WTGXX Trust-only custody' test.

Why this was flagged

The base token at allCoinsAndTokens.ts:6447-6457 is declared with ACCOUNT_COIN_DEFAULT_FEATURES_TRUST_ONLY. That set drops every custody feature in BITGO_CUSTODY_JURISDICTIONS except CUSTODY_BITGO_TRUST (coinFeatures.ts:52). The new OFC entry passes no features, so ofcStellarToken (ofc.ts:497-515) calls getFilteredFeatures. That function checks coinsMap.has(input.toLowerCase()) (ofc.ts:53). CoinMap.has is case-sensitive (map.ts:295), and the base is stored under the mixed-case key 'xlm:SPXU-GDJBVX3QA5HJPBSAU5VIX2W6MC37NU4UFXPKEGK42SJCYN6AEQ4Z6COM'. The lookup returns [], and the coin falls back to OfcCoin.DEFAULT_FEATURES (ofc.ts:66-74), which includes CUSTODY_BITGO_MENA_FZE, CUSTODY_BITGO_CUSTODY_MENA_FZE and CUSTODY_BITGO_INDIA. Lowercase-named OFC tokens such as ofcarbeth:wtgxx and ofcsol:wtgxx do inherit trust-only gating, and test/unit/coins.ts:1111-1145 enforces it for them. On the base branch this OFC coin does not exist, so after the merge any consumer gating custody by these features would offer it in jurisdictions the base token excludes.

Verification: The base token in allCoinsAndTokens.ts:6447-6457 uses ACCOUNT_COIN_DEFAULT_FEATURES_TRUST_ONLY, but the new OFC entry at ofcCoins.ts:5065-5071 passes no features. getFilteredFeatures checks coinsMap.has(input.toLowerCase()), and has() does exact Map lookups (map.ts:295-300), so the mixed-case name never matches. The new coin is not on the 'WTGXX Trust-only custody' test list (test/unit/coins.ts:1111-1145).

ofcStellarToken(
'66c55a71-3352-407b-945a-ceed3fdc7487',
Expand Down Expand Up @@ -6652,6 +6662,34 @@ export const ofcCoins = [
10,
UnderlyingAsset['canton:ibenji']
),
ofcCantonToken(
'8b1dcf20-aa1f-4348-a4c0-e0df61e45b42', // CECHO-2732
'ofccanton:beth',
'BitSafe Ethereum',
10,
UnderlyingAsset['canton:beth']
),
ofcCantonToken(
'e01c1955-98ae-445e-9858-765dce7a6d20', // CECHO-2732
'ofccanton:usty',
'US Treasury Bill',
10,
UnderlyingAsset['canton:usty']
),
ofcCantonToken(
'4f1e118b-afc3-4c32-af2a-acc81be89442', // CECHO-2732
'ofccanton:exau',
'Ember Gold',
10,
UnderlyingAsset['canton:exau']
),
ofcCantonToken(
'154d2cca-4970-4445-aac7-58b995ff4f9e', // CECHO-2732
'ofccanton:exag',
'Ember Silver',
10,
UnderlyingAsset['canton:exag']
),
ofcCantonToken(
'784c76fb-59c6-4826-b72e-20e996a35739',
'ofccanton:ceth',
Expand Down Expand Up @@ -7033,6 +7071,14 @@ export const ofcCoins = [
),
ofcsolToken('7826627c-7358-47ff-ac6f-03a2e9eff95c', 'ofcsol:jlp', 'Jupiter Perps LP', 6, UnderlyingAsset['sol:jlp']),
ofcsolToken('00f31d2d-6946-43f6-bde1-7fda6887750d', 'ofcsol:grass', 'Grass', 9, UnderlyingAsset['sol:grass']),
ofcsolToken(
'99924682-e24d-4e94-8479-0d34ffbe4b90', // CECHO-2732
'ofcsol:cash',
'Cash',
6,
UnderlyingAsset.CASH,
[...SOL_OFC_TOKEN_FEATURES, CoinFeature.STABLECOIN]
),
Comment on lines +7074 to +7081

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 (optional) Two new OFC stablecoins are not flagged as stablecoins, so anything that filters OFC assets by CoinFeature.STABLECOIN will miss them. ofcsol:cash uses [...ACCOUNT_COIN_DEFAULT_FEATURES, CoinFeature.REQUIRES_RESERVE], and ofchoodeth:rlusd keeps the default features. Their base tokens sol:cash and hoodeth:rlusd both include STABLECOIN. Fix: add CoinFeature.STABLECOIN to both OFC feature lists, as this PR already does for ofcmon:usdt0, which covers the 2 sites listed. Same pattern at 2 sites (ofcCoins.ts:7084, ofcHoodethTokens.ts:4326).

Why this was flagged

The base token sol:cash at solTokens.ts:845 is declared with [...SOL_TOKEN_FEATURES, CoinFeature.STABLECOIN]. Its new OFC counterpart at ofcCoins.ts:7084 passes [...ACCOUNT_COIN_DEFAULT_FEATURES, CoinFeature.REQUIRES_RESERVE] and leaves STABLECOIN out. The base hoodeth:rlusd at hoodethTokens.ts:3075 also carries CoinFeature.STABLECOIN. Its new ofchoodeth:rlusd at ofcHoodethTokens.ts:4326 passes undefined for features, so it falls back to the OFC defaults without STABLECOIN. Other OFC stablecoins do set the flag: ofcxrp:rlusd (ofcCoins.ts:2411), the ofcsol:usdc/usdt/pyusd entries, and this PR's own ofcmon:usdt0 (ofcErc20Coins.ts:6657). Any consumer that reads features.includes(CoinFeature.STABLECOIN) on these OFC coins will treat Cash and RLUSD as non-stablecoins. These are new entries, so the base branch has no OFC coin to compare against.

Verification: Base sol:cash at modules/statics/src/coins/solTokens.ts:845 is declared with [...SOL_TOKEN_FEATURES, CoinFeature.STABLECOIN]. The new ofcsol:cash at modules/statics/src/coins/ofcCoins.ts:7078-7085 passes [...ACCOUNT_COIN_DEFAULT_FEATURES, CoinFeature.REQUIRES_RESERVE], which has no STABLECOIN. The new ofchoodeth:rlusd at ofcHoodethTokens.ts:4319-4332 passes undefined for features.

ofcBscToken('3a9daeda-7e08-494d-a47c-d2c89dd1c735', 'ofcbsc:godl', 'GODL', 18, UnderlyingAsset['bsc:godl']),
ofcBscToken('93a459bc-c661-4001-be26-9175046c9a36', 'ofcbsc:gdl', 'GDL', 18, UnderlyingAsset['bsc:gdl']),
ofcBscToken('9febc919-85af-48eb-9821-e9d18e4cd98e', 'ofcbsc:usgd', 'USGD', 18, UnderlyingAsset['bsc:usgd']),
Expand Down
21 changes: 21 additions & 0 deletions modules/statics/src/coins/ofcErc20Coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3358,6 +3358,13 @@ export const ofcErc20Coins = [
18,
underlyingAssetForSymbol('eth:spxux')
),
ofcerc20(
'e8e161f1-b3d7-411e-851e-d3c987c42bc0', // CECHO-2732
'ofceth:stampx',
'STAMPx',
18,
underlyingAssetForSymbol('eth:stampx')
),
ofcerc20('830c6c0f-b601-406b-a853-3a88ff85533d', 'ofceth:aleo', 'Aleo', 3, underlyingAssetForSymbol('eth:aleo')),
ofcerc20(
'c35c457f-2741-41aa-9c33-3a41f5ce6b1b',
Expand Down Expand Up @@ -6640,6 +6647,20 @@ export const tOfcErc20Coins = [
true,
'mon'
),
ofcerc20(
'f2cd10f8-a5eb-4fe3-b070-af7804667319', // CECHO-2732
'ofcmon:usdt0',
'MON:USDT0',
6,
underlyingAssetForSymbol('mon:usdt0'),
undefined,
[...OfcCoin.DEFAULT_FEATURES, CoinFeature.STABLECOIN],
'',
undefined,
undefined,
true,
'mon'
),
ofcerc20(
'a59c0575-4bf1-4789-8fdf-292ebc1a649c',
'ofcmon:sofid',
Expand Down
14 changes: 14 additions & 0 deletions modules/statics/src/coins/ofcHoodethTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4316,4 +4316,18 @@ export const ofcHoodethTokens = [
true,
'hoodeth'
),
ofcerc20(
'ab7828c0-d5f8-493c-9933-da17f92b20cc', // CECHO-2732
'ofchoodeth:rlusd',
'Ripple USD • Robinhood',
18,
UnderlyingAsset['hoodeth:rlusd'],
undefined,
undefined,
'',
undefined,
undefined,
true,
'hoodeth'
),
];
1 change: 1 addition & 0 deletions modules/statics/test/unit/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,7 @@ describe('WTGXX Trust-only custody', () => {
'sepeth:wtgxx',
'sol:wtgxx',
'ofcwtgxx',
'ofcxlm:SPXU-GDJBVX3QA5HJPBSAU5VIX2W6MC37NU4UFXPKEGK42SJCYN6AEQ4Z6COM',
'ofcarbeth:wtgxx',
'ofcopeth:wtgxx',
'ofcsol:wtgxx',
Expand Down
Loading