{"record":{"id":"0d420f746f79507a","repo":"nautechsystems/nautilus_trader","slug":"call-edge-address-is-invalid","errorCode":null,"errorMessage":"Call edge address is invalid","messagePattern":"Call edge address is invalid","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/rpc/verification.rs","lineNumber":1401,"sourceCode":"        anyhow::ensure!(\n            pool.fee != 0 && pool.fee <= 1_000_000,\n            \"Pool fee is invalid\"\n        );\n    }\n    let mut call_edges = HashSet::new();\n    for edge in &manifest.call_edges {\n        anyhow::ensure!(\n            matches!(\n                edge.purpose.as_str(),\n                \"wrap\" | \"approve\" | \"swap_sell\" | \"swap_buy\"\n            ) && matches!(\n                edge.call_type.as_str(),\n                \"call\" | \"staticcall\" | \"delegatecall\" | \"callcode\"\n            ),\n            \"Deployment manifest call edge is invalid\"\n        );\n        let caller = Address::from_str(&edge.caller)\n            .map_err(|_| anyhow::anyhow!(\"Call edge address is invalid\"))?;\n        let target = Address::from_str(&edge.target)\n            .map_err(|_| anyhow::anyhow!(\"Call edge address is invalid\"))?;\n        for address in [caller, target] {\n            anyhow::ensure!(\n                contract_addresses.contains(&address),\n                \"Call edge references an unpinned contract\"\n            );\n        }\n        anyhow::ensure!(\n            call_edges.insert((\n                edge.purpose.as_str(),\n                caller,\n                target,\n                edge.call_type.as_str()\n            )),\n            \"Deployment manifest contains a duplicate call edge\"\n        );\n    }","sourceCodeStart":1383,"sourceCodeEnd":1419,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/rpc/verification.rs#L1383-L1419","documentation":"The caller field of a call edge must parse as a valid Ethereum address (via Address::from_str). If the string is malformed — wrong length, non-hex characters, missing 0x — the library maps the parse failure to this error. Unlike the pinning check, this fires before any contract-set lookup, so it is purely an address format problem.","triggerScenarios":"Validating a manifest with a call edge whose caller is not a 20-byte hex address: empty string, truncated address, invalid characters, or a value accidentally holding a name or placeholder.","commonSituations":"Copy-paste truncation of an address; leaving a \"<CALLER>\" placeholder unfilled; mixing an ENS name or alias into a field that requires a raw hex address; editing JSON and dropping characters.","solutions":["Replace edge.caller with the full 20-byte hex address (0x followed by 40 hex characters) of the calling contract","Copy the address directly from the pinned contracts section rather than retyping it","Resolve any ENS names/aliases to raw addresses before writing the manifest","Validate all address strings with a hex/address parser before submitting the manifest"],"exampleFix":"// before\n{\"caller\": \"0xabc123\", \"target\": \"0xdef...\", \"purpose\": \"approve\"}\n// after\n{\"caller\": \"0xabc123def4567890abcdef1234567890abcdef12\", \"target\": \"0xdef...\", \"purpose\": \"approve\"}","handlingStrategy":"validation","validationCode":"fn valid_eth_address(s: &str) -> bool {\n    s.len() == 42 && s.starts_with(\"0x\") && s[2..].chars().all(|c| c.is_ascii_hexdigit())\n}\nfor edge in &manifest.call_edges {\n    if !valid_eth_address(&edge.caller) {\n        return Err(format!(\"caller not a hex address: {}\", edge.caller));\n    }\n}","typeGuard":"fn is_eth_address(s: &str) -> bool {\n    s.len() == 42 && s.starts_with(\"0x\") && s[2..].chars().all(|c| c.is_ascii_hexdigit())\n}","tryCatchPattern":"match validate_deployment_manifest(&manifest) {\n    Err(e) if e.to_string().contains(\"Call edge address is invalid\") => {\n        eprintln!(\"Use a full 0x-prefixed 40-hex-char address for edge.caller: {e}\");\n    }\n    Err(e) => return Err(e),\n    Ok(()) => {}\n}","preventionTips":["Paste addresses instead of retyping them","Resolve ENS names to raw hex addresses before writing manifests","Run an address-format linter over all manifest fields before submission"],"tags":["blockchain","address-format","manifest-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-14T00:17:10.932Z"}