Category
Blockchain Chain IDs
Locations
Inline integer literals (no named constant):
core/src/exchanges/limitless/index.ts:552 — chainId: 8453 (Base mainnet)
core/src/exchanges/limitless/client.ts:205 — chainId: 8453 (Base mainnet)
core/src/exchanges/limitless/client.ts:383 — chainId: 8453 (Base mainnet)
core/src/exchanges/polymarket/index.ts:675 — chainId: 137 (Polygon mainnet)
core/src/exchanges/probable/auth.ts:61 — chainId: 56 (BSC mainnet)
Already using named constants (correct pattern):
core/src/exchanges/hyperliquid/config.ts:17 — export const EXCHANGE_CHAIN_ID = 1337
core/src/exchanges/myriad/utils.ts:8-9 — ABSTRACT: 2741, LINEA: 59144 in a NETWORKS map
Inconsistencies
- Limitless repeats
8453 three times across two files. A testnet migration or chain upgrade requires 3 independent edits.
- Hyperliquid and Myriad use named constants; Limitless, Polymarket, and Probable do not — no consistent pattern.
- Chain ID
56 (BSC) in probable/auth.ts is particularly opaque: there is no PROBABLE_CHAIN_ID constant or comment naming the network.
Risk
Chain IDs are critical for transaction signing. An inline 8453 copy-pasted to a test file could silently sign transactions for the wrong network. No grep for "Base mainnet" will find 8453 without knowing to look.
Suggested Fix
Follow the Hyperliquid/Myriad pattern and define named constants per exchange:
// core/src/exchanges/limitless/config.ts
export const LIMITLESS_CHAIN_ID = 8453; // Base mainnet
// core/src/exchanges/polymarket/config.ts
export const POLYMARKET_CHAIN_ID = 137; // Polygon mainnet
// core/src/exchanges/probable/config.ts
export const PROBABLE_CHAIN_ID = 56; // BSC mainnet
Found by automated magic numbers audit
Category
Blockchain Chain IDs
Locations
Inline integer literals (no named constant):
core/src/exchanges/limitless/index.ts:552—chainId: 8453(Base mainnet)core/src/exchanges/limitless/client.ts:205—chainId: 8453(Base mainnet)core/src/exchanges/limitless/client.ts:383—chainId: 8453(Base mainnet)core/src/exchanges/polymarket/index.ts:675—chainId: 137(Polygon mainnet)core/src/exchanges/probable/auth.ts:61—chainId: 56(BSC mainnet)Already using named constants (correct pattern):
core/src/exchanges/hyperliquid/config.ts:17—export const EXCHANGE_CHAIN_ID = 1337core/src/exchanges/myriad/utils.ts:8-9—ABSTRACT: 2741,LINEA: 59144in aNETWORKSmapInconsistencies
8453three times across two files. A testnet migration or chain upgrade requires 3 independent edits.56(BSC) inprobable/auth.tsis particularly opaque: there is noPROBABLE_CHAIN_IDconstant or comment naming the network.Risk
Chain IDs are critical for transaction signing. An inline
8453copy-pasted to a test file could silently sign transactions for the wrong network. No grep for "Base mainnet" will find8453without knowing to look.Suggested Fix
Follow the Hyperliquid/Myriad pattern and define named constants per exchange:
Found by automated magic numbers audit