{"record":{"id":"b72776cce3be4259","repo":"nautechsystems/nautilus_trader","slug":"deployment-manifest-token-address-is-invalid","errorCode":null,"errorMessage":"Deployment manifest token address is invalid","messagePattern":"Deployment manifest token address is invalid","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":422,"sourceCode":"            crate::exchanges::get_dex_extended(config.chain.name, &DexType::UniswapV3)\n                .map(|dex| dex.factory)\n                .ok_or_else(|| {\n                    anyhow::anyhow!(\n                        \"No registered Uniswap V3 deployment for chain {}\",\n                        config.chain.name\n                    )\n                })?;\n        anyhow::ensure!(\n            factory == registered_factory,\n            \"Deployment manifest factory does not match the registered Uniswap V3 factory\"\n        );\n        let quote_contract = singleton(BlockchainContractRole::Quote, \"quote\")?;\n\n        let mut token_decimals = HashMap::new();\n\n        for token in &manifest.tokens {\n            let address = Address::from_str(&token.address)\n                .map_err(|_| anyhow::anyhow!(\"Deployment manifest token address is invalid\"))?;\n            anyhow::ensure!(\n                token_decimals.insert(address, token.decimals).is_none(),\n                \"Deployment manifest contains a duplicate token identity\"\n            );\n        }\n        anyhow::ensure!(\n            token_decimals.contains_key(&weth),\n            \"Deployment manifest has no wrapped native token identity\"\n        );\n\n        if let Some(tokens) = &config.tokens {\n            for token in tokens {\n                let address = validate_address(token)?;\n                anyhow::ensure!(\n                    token_decimals.contains_key(&address),\n                    \"Configured token {address} has no deployment manifest identity\"\n                );\n            }","sourceCodeStart":404,"sourceCodeEnd":440,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L404-L440","documentation":"While building the manifest's token table, `validate_manifest_contracts` parses each `manifest.tokens[].address` with `Address::from_str` and maps any parse failure to this error. Every token listed in the deployment manifest must be a well-formed Ethereum address, since these addresses key the `token_decimals` map used for amount handling.","triggerScenarios":"Client validation where any entry in `manifest.tokens` has an `address` string that fails `Address::from_str`: empty, missing `0x`, wrong hex length, invalid characters, or bad checksum.","commonSituations":"Manually adding a token row to the manifest with a typo; pasting a symbol or name into the address field; truncating an address when copying from a block explorer; addresses exported from another tool in a non-hex format.","solutions":["Fix the malformed token `address` in the deployment manifest to a valid 0x-prefixed 40-hex-char address","Regenerate the manifest's token list from the chain's authoritative token registry","Pre-validate all token addresses with `Address::from_str` before loading the manifest"],"exampleFix":"// before\n{\"symbol\": \"USDC\", \"address\": \"0xA0b86991...\"}  // truncated\n// after\n{\"symbol\": \"USDC\", \"address\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\"}","handlingStrategy":"validation","validationCode":"for t in &manifest.tokens {\n    Address::from_str(&t.address).map_err(|e| format!(\"token {} has invalid address: {e}\", t.symbol))?;\n}","typeGuard":"fn is_valid_address(s: &str) -> bool { Address::from_str(s).is_ok() }","tryCatchPattern":null,"preventionTips":["Copy token addresses from verified sources (project docs, block explorers) in full","Lint manifests with an address-format validator in CI","Never truncate addresses when copying"],"tags":["rust","config","ethereum","validation"],"backgroundTag":"invalid-argument-format","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}