{"record":{"id":"1f9e99117299793b","repo":"nautechsystems/nautilus_trader","slug":"invalid-multicall-address","errorCode":null,"errorMessage":"Invalid multicall address","messagePattern":"Invalid multicall address","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/contracts/base.rs","lineNumber":116,"sourceCode":"        multicall_calls_per_rpc_request: u32,\n    ) -> Self {\n        Self::new_with_multicall_limit_and_timeout(client, multicall_calls_per_rpc_request, None)\n    }\n\n    /// Creates a new base contract interface with an explicit Multicall request size and\n    /// per-request RPC timeout.\n    ///\n    /// # Panics\n    ///\n    /// Panics if the multicall address is invalid (which should never happen with the hardcoded address).\n    #[must_use]\n    pub fn new_with_multicall_limit_and_timeout(\n        client: Arc<BlockchainHttpRpcClient>,\n        multicall_calls_per_rpc_request: u32,\n        rpc_timeout_secs: Option<u64>,\n    ) -> Self {\n        let multicall_address =\n            validate_address(MULTICALL3_ADDRESS).expect(\"Invalid multicall address\");\n        let multicall_calls_per_rpc_request = (multicall_calls_per_rpc_request as usize).max(1);\n\n        Self {\n            client,\n            multicall_address,\n            multicall_calls_per_rpc_request,\n            rpc_timeout_secs,\n        }\n    }\n\n    /// Gets a reference to the RPC client.\n    #[must_use]\n    pub const fn client(&self) -> &Arc<BlockchainHttpRpcClient> {\n        &self.client\n    }\n\n    /// Executes a single contract call and returns the raw response bytes.\n    ///","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/contracts/base.rs#L98-L134","documentation":"The multicall contract constructor hardcodes the well-known MULTICALL3 address and validates it with `validate_address`, panicking with \"Invalid multicall address\" if validation fails. This is a build-time constant, so the panic indicates the compiled-in constant is malformed or the validator rejects it — an internal invariant, not user input.","triggerScenarios":"Calling `BlockchainDataClient::new_with_multicall_limit_and_timeout(...)` when the compiled-in MULTICALL3_ADDRESS constant fails address validation (wrong length, bad hex, or a validator build that rejects it).","commonSituations":"Custom builds/patches where MULTICALL3_ADDRESS was edited incorrectly; chain builds with a stale or mistyped constant; checksum/EIP-55 validation strictness differences.","solutions":["Check the MULTICALL3_ADDRESS constant in crates/adapters/blockchain/src/contracts/base.rs is a valid 20-byte hex address.","Compare against the official Multicall3 deployment addresses for your chain.","Rebuild from an unmodified upstream version to rule out local edits.","If the validator rejects checksummed vs lowercase forms, fix the constant's EIP-55 checksum."],"exampleFix":"// before\nconst MULTICALL3_ADDRESS: &str = \"0xcA11bde05977b3631167028862bE2a173976CA1\"; // truncated/invalid\n// after\nconst MULTICALL3_ADDRESS: &str = \"0xcA11bde05977b3631167028862bE2a173976CA11\"; // valid Multicall3","handlingStrategy":"validation","validationCode":"// Validate the constant at startup or in tests\nassert!(Address::from_str(MULTICALL3_ADDRESS).is_ok(), \"MULTICALL3_ADDRESS is not a valid address\");","typeGuard":null,"tryCatchPattern":"// Use the fallible constructor path instead of the panicking one if available,\n// or wrap calls in catch_unwind during startup smoke tests.","preventionTips":["Never hand-edit the MULTICALL3_ADDRESS constant; verify EIP-55 checksum when updating.","Add a unit test asserting the constant parses as a valid address.","Diff contract constants against official Multicall3 deployment lists after upgrades."],"tags":["blockchain","multicall","address-validation","panic"],"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"}