From 4d5fe4eeb68f42204fb55b1daa576a1b07f44b8b Mon Sep 17 00:00:00 2001 From: Sergii Khliustin Date: Mon, 8 Dec 2025 16:33:54 +0100 Subject: [PATCH] Fix ABIDecoder: String index is out of bounds --- Sources/ContractABI/ABI/ABIDecoder.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/ContractABI/ABI/ABIDecoder.swift b/Sources/ContractABI/ABI/ABIDecoder.swift index 0c3affe5..684f7c9d 100644 --- a/Sources/ContractABI/ABI/ABIDecoder.swift +++ b/Sources/ContractABI/ABI/ABIDecoder.swift @@ -68,6 +68,11 @@ public struct ABIDecoder { let hexString = hexString.replacingOccurrences(of: "0x", with: "") + if hexString.isEmpty { + // Return an empty dictionary or handle accordingly + return [:] + } + var returnDictionary: [String: Any] = [:] if outputs.count == 1 {