Add mainnet cWBTC token-aggregation indexing, supply proof, and Etherscan verify scripts.
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m25s
CI/CD Pipeline / Security Scanning (push) Successful in 3m28s
CI/CD Pipeline / Lint and Format (push) Failing after 43s
CI/CD Pipeline / Terraform Validation (push) Failing after 25s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 28s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 45s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 29s
Validation / validate-genesis (push) Successful in 32s
Validation / validate-terraform (push) Failing after 30s
Validation / validate-kubernetes (push) Failing after 10s
Validation / validate-smart-contracts (push) Failing after 10s
Validation / validate-security (push) Failing after 1m36s
Validation / validate-documentation (push) Failing after 17s
Verify Deployment / Verify Deployment (push) Failing after 48s
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m25s
CI/CD Pipeline / Security Scanning (push) Successful in 3m28s
CI/CD Pipeline / Lint and Format (push) Failing after 43s
CI/CD Pipeline / Terraform Validation (push) Failing after 25s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 28s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 45s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 29s
Validation / validate-genesis (push) Successful in 32s
Validation / validate-terraform (push) Failing after 30s
Validation / validate-kubernetes (push) Failing after 10s
Validation / validate-smart-contracts (push) Failing after 10s
Validation / validate-security (push) Failing after 1m36s
Validation / validate-documentation (push) Failing after 17s
Verify Deployment / Verify Deployment (push) Failing after 48s
Wire live 0x2BBe3c… address into canonical tokens, pool catalog merge from mesh health, and bridge/cWBTC explorer verification helpers. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -218,4 +218,16 @@ describe('Config API runtime networks loader', () => {
|
||||
)
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it('excludes hub cUSDC/cUSDT peg references from Ethereum mainnet watchAssets', async () => {
|
||||
const metamaskRes = await fetch(`${baseUrl}/api/v1/config/metamask?chainId=1`);
|
||||
expect(metamaskRes.status).toBe(200);
|
||||
const metamaskBody = (await metamaskRes.json()) as Record<string, any>;
|
||||
const symbols = metamaskBody.watchAssets.map((entry: Record<string, any>) => entry.options?.symbol);
|
||||
expect(symbols).not.toContain('cUSDC');
|
||||
expect(symbols).not.toContain('cUSDT');
|
||||
expect(symbols).toEqual(
|
||||
expect.arrayContaining(['cWUSDC', 'cWUSDT'])
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -72,6 +72,19 @@ function resolveWalletWatchAssetSymbol(spec: { symbol: string; familySymbol?: st
|
||||
return spec.symbol;
|
||||
}
|
||||
|
||||
const HUB_COMPLIANT_WATCH_SYMBOLS = new Set(['cUSDC', 'cUSDT']);
|
||||
const HUB_COMPLIANT_WATCH_CHAIN_IDS = new Set([138, 651940]);
|
||||
|
||||
function isWalletWatchAssetEligible(spec: { symbol: string }, chainId: number): boolean {
|
||||
// Off the hub, cUSDC/cUSDT catalog rows point at official USDC/USDT peg contracts
|
||||
// (symbol USDC/USDT on-chain). MetaMask rejects wallet_watchAsset when options.symbol
|
||||
// does not match ERC-20 symbol(). Public wrapped transports are cWUSDC/cWUSDT instead.
|
||||
if (HUB_COMPLIANT_WATCH_SYMBOLS.has(spec.symbol) && !HUB_COMPLIANT_WATCH_CHAIN_IDS.has(chainId)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
type RuntimeNetworksPayload = {
|
||||
version?: string | { major?: number; minor?: number; patch?: number };
|
||||
networks?: unknown[];
|
||||
@@ -219,6 +232,7 @@ router.get(['/config/metamask', '/metamask'], cacheMiddleware(5 * 60 * 1000), as
|
||||
}
|
||||
|
||||
const watchAssets = getCanonicalTokensByChain(chainId)
|
||||
.filter((spec) => isWalletWatchAssetEligible(spec, chainId))
|
||||
.map((spec) => {
|
||||
const address = spec.addresses[chainId];
|
||||
if (!address) return null;
|
||||
|
||||
Reference in New Issue
Block a user