{"record":{"id":"3aac6860dcf5d68d","repo":"nautechsystems/nautilus_trader","slug":"token-manifest-address-is-invalid","errorCode":null,"errorMessage":"Token manifest address is invalid","messagePattern":"Token manifest address is invalid","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/rpc/verification.rs","lineNumber":1355,"sourceCode":"    }\n\n    for required in [\n        BlockchainContractRole::Router,\n        BlockchainContractRole::Factory,\n        BlockchainContractRole::WrappedNative,\n        BlockchainContractRole::Quote,\n        BlockchainContractRole::Token,\n        BlockchainContractRole::Pool,\n    ] {\n        anyhow::ensure!(\n            roles.contains(&required),\n            \"Deployment manifest is missing a required role\"\n        );\n    }\n\n    for token in &manifest.tokens {\n        let address = Address::from_str(&token.address)\n            .map_err(|_| anyhow::anyhow!(\"Token manifest address is invalid\"))?;\n        anyhow::ensure!(\n            contract_addresses.contains(&address),\n            \"Token manifest address has no contract identity\"\n        );\n        anyhow::ensure!(\n            !token.name.trim().is_empty()\n                && !token.symbol.trim().is_empty()\n                && matches!(token.asset_role.as_str(), \"base\" | \"quote\" | \"both\"),\n            \"Token manifest identity or asset role is invalid\"\n        );\n    }\n\n    for pool in &manifest.pools {\n        for address in [\n            &pool.address,\n            &pool.token0,\n            &pool.token1,\n            &pool.factory,","sourceCodeStart":1337,"sourceCodeEnd":1373,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/rpc/verification.rs#L1337-L1373","documentation":"Each entry in manifest.tokens must carry a valid 20-byte Ethereum address; the validator parses token.address with alloy's Address::from_str and throws this error when parsing fails. Without a parseable address the token cannot be cross-checked against the pinned contract set.","triggerScenarios":"Running manifest verification when a tokens[] entry has an address that is not valid hex-20: empty string, wrong length, non-hex characters, or an EVM-unfriendly value like an ENS name or a Solana/SPL address pasted from another chain's config.","commonSituations":"Copying token addresses from another network's manifest; ENS names instead of resolved addresses; truncated hex from spreadsheet/CSV round-trips; wrong chain's token contract in a multi-chain config.","solutions":["Set token.address to the correct 20-byte hex contract address (0x + 40 hex chars)","Resolve any ENS name to its address off-chain before writing the manifest","Copy the address from the contract entry of the same deployment to keep them consistent"],"exampleFix":"// before\n{\"address\": \"weth.eth\", \"name\": \"WETH\"}\n// after\n{\"address\": \"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\", \"name\": \"WETH\"}","handlingStrategy":"validation","validationCode":"fn valid_address(s: &str) -> bool {\n    Address::from_str(s).is_ok()\n}\nassert!(manifest.tokens.iter().all(|t| valid_address(&t.address)));","typeGuard":null,"tryCatchPattern":"match validate_manifest(&config) {\n    Err(e) if e.to_string().contains(\"Token manifest address is invalid\") => {\n        eprintln!(\"fix the malformed 20-byte hex token address: {e}\");\n    }\n    Err(e) => return Err(e),\n    Ok(v) => v,\n}","preventionTips":["Resolve ENS names to addresses before writing manifests","Copy addresses from the same chain's deployment records","Hex-validate all address fields in a pre-verification lint script"],"tags":["validation","hex-parsing","manifest"],"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"}