{"record":{"id":"fd836320d97fc079","repo":"nautechsystems/nautilus_trader","slug":"deployment-manifest-wrapped-native-contract-does-n","errorCode":null,"errorMessage":"Deployment manifest wrapped native contract does not match `weth_address`","messagePattern":"Deployment manifest wrapped native contract does not match `weth_address`","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":398,"sourceCode":"                        .map_err(|_| anyhow::anyhow!(\"Deployment manifest address is invalid\"))\n                })\n                .collect::<anyhow::Result<HashSet<_>>>()\n        };\n        let singleton = |role, description: &str| {\n            let addresses = role_addresses(role)?;\n            anyhow::ensure!(\n                addresses.len() == 1,\n                \"Deployment manifest must contain exactly one {description} contract\"\n            );\n            Ok(*addresses.iter().next().expect(\"singleton role address\"))\n        };\n\n        let configured_routers = routers.iter().copied().collect::<HashSet<_>>();\n        anyhow::ensure!(\n            role_addresses(BlockchainContractRole::Router)? == configured_routers,\n            \"Deployment manifest router set does not match `router_addresses`\"\n        );\n        anyhow::ensure!(\n            singleton(BlockchainContractRole::WrappedNative, \"wrapped native\")? == weth,\n            \"Deployment manifest wrapped native contract does not match `weth_address`\"\n        );\n        let factory = singleton(BlockchainContractRole::Factory, \"factory\")?;\n        let registered_factory =\n            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\")?;","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L380-L416","documentation":"`validate_manifest_contracts` resolves the single `WrappedNative` role contract from the manifest and compares it to the `weth` address supplied in the client config. The `anyhow::ensure!` check fails when the manifest's wrapped-native address differs from the configured `weth_address`, blocking a client that would otherwise wrap/unwrap against the wrong token contract.","triggerScenarios":"Client initialization where the manifest's `WrappedNative` singleton address != the `weth` argument (typically from config's `weth_address`), e.g. after changing config for a new chain while reusing an old manifest.","commonSituations":"Switching chains (e.g. mainnet to Arbitrum) and updating `weth_address` in config but not the manifest; deploying a new wrapped-native token and updating only one of the two sources; copy-pasting the wrong token address into either the manifest or config.","solutions":["Set the manifest's WrappedNative contract address equal to the configured `weth_address`","Regenerate the deployment manifest for the target chain so wrapped native matches the canonical WETH/WMATIC/etc. address for that chain","Update config `weth_address` if the manifest reflects the newer deployment"],"exampleFix":"// before\nmanifest: {\"role\": \"WrappedNative\", \"address\": \"0xOLD...\"}; config weth_address: 0xNEW...\n// after\nmanifest: {\"role\": \"WrappedNative\", \"address\": \"0xNEW...\"}; config weth_address: 0xNEW...","handlingStrategy":"validation","validationCode":"let manifest_weth = manifest.contracts.iter()\n    .find(|c| c.role == BlockchainContractRole::WrappedNative)\n    .map(|c| Address::from_str(&c.address));\nassert_eq!(manifest_weth.transpose().ok().flatten(), Some(config.weth_address), \"weth mismatch\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Single source of truth: read weth_address from the manifest, or write it into both from one script","When switching chains, regenerate config and manifest together","Keep per-chain config files to avoid cross-chain address bleed"],"tags":["rust","config","ethereum","consistency"],"backgroundTag":"invalid-config-value","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"}