{"record":{"id":"6e9b4d3d3d7ec798","repo":"nautechsystems/nautilus_trader","slug":"validated-proxy-target-address","errorCode":null,"errorMessage":"validated proxy target address","messagePattern":"validated proxy target address","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/rpc/verification.rs","lineNumber":1322,"sourceCode":"                    && storage_value[12..] == *target.as_slice(),\n                \"Proxy target binding is invalid\"\n            );\n        }\n\n        for probe in &contract.probes {\n            Bytes::from_str(&probe.call_data)\n                .map_err(|_| anyhow::anyhow!(\"Manifest probe call data is invalid\"))?;\n            Bytes::from_str(&probe.expected_output)\n                .map_err(|_| anyhow::anyhow!(\"Manifest probe output is invalid\"))?;\n        }\n    }\n\n    for contract in &manifest.contracts {\n        let Some(proxy) = &contract.proxy else {\n            continue;\n        };\n        let target =\n            Address::from_str(&proxy.target_address).expect(\"validated proxy target address\");\n        let target_contract = manifest\n            .contracts\n            .iter()\n            .find(|candidate| Address::from_str(&candidate.address).ok() == Some(target))\n            .ok_or_else(|| {\n                anyhow::anyhow!(\"Proxy target has no unique deployment manifest identity\")\n            })?;\n        anyhow::ensure!(\n            target_contract.role == BlockchainContractRole::Implementation\n                && target_contract\n                    .runtime_code_hash\n                    .eq_ignore_ascii_case(&proxy.target_code_hash),\n            \"Proxy target role or code hash conflicts with its deployment identity\"\n        );\n    }\n\n    for required in [\n        BlockchainContractRole::Router,","sourceCodeStart":1304,"sourceCodeEnd":1340,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/rpc/verification.rs#L1304-L1340","documentation":"This helper resolves a proxy's target contract in the manifest to derive its deployment identity. It parses proxy.target_address with expect() because the manifest is pre-validated; a panic means the address string is not valid 20-byte hex. Like its siblings it is an internal invariant check, not a runtime condition.","triggerScenarios":"Calling the manifest-identity function with a manifest whose proxy.target_address is empty, malformed, or contains checksum/EIP-55 casing the parser rejects (alloy's from_str accepts checksummed hex, but not non-hex text).","commonSituations":"Proxy entries pointing at an EOA or empty string because the target was not deployed; hand-edited manifests; tooling that wrote a name like 'implementation' instead of an address.","solutions":["Validate proxy.target_address with Address::from_str before calling this API","Ensure the proxy target address in the manifest is a real deployed contract address","Regenerate the manifest with the deployment tooling rather than editing addresses by hand","If the validator accepts a bad address, report the missing validation"],"exampleFix":"// before\nlet target = Address::from_str(&proxy.target_address)\n    .expect(\"validated proxy target address\");\n// after\nlet target = Address::from_str(&proxy.target_address)\n    .map_err(|e| ManifestError::InvalidProxyTarget(contract.address.clone(), e))?;","handlingStrategy":"validation","validationCode":"fn validate_proxy_address(proxy: &ProxyConfig) -> Result<(), String> {\n    Address::from_str(&proxy.target_address)\n        .map(|_| ())\n        .map_err(|e| format!(\"invalid proxy target_address '{}': {e}\", proxy.target_address))\n}","typeGuard":"fn is_valid_address(s: &str) -> bool {\n    let h = s.trim_start_matches(\"0x\");\n    h.len() == 40 && h.chars().all(|c| c.is_ascii_hexdigit())\n}","tryCatchPattern":null,"preventionTips":["Verify the proxy target is deployed before recording it in the manifest","Validate addresses at manifest load time","Never store names or placeholders where contract addresses belong"],"tags":["panic","invariant","manifest","address-parsing"],"backgroundTag":"internal-invariant-violation","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"}