From c6305e534eb13d6b2acc18d82bef5f3eb82f0212 Mon Sep 17 00:00:00 2001 From: Alexander Osokin Date: Fri, 30 Sep 2022 18:17:59 +0500 Subject: [PATCH 1/2] Fix abi parsing --- Sources/web3swift/EthereumABI/ABIParsing.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/web3swift/EthereumABI/ABIParsing.swift b/Sources/web3swift/EthereumABI/ABIParsing.swift index bc4610d08..93ec5ffee 100755 --- a/Sources/web3swift/EthereumABI/ABIParsing.swift +++ b/Sources/web3swift/EthereumABI/ABIParsing.swift @@ -75,7 +75,7 @@ fileprivate func parseFunction(abiRecord:ABI.Record) throws -> ABI.Element.Funct let abiOutputs = outputs != nil ? outputs! : [ABI.Element.InOut]() let name = abiRecord.name != nil ? abiRecord.name! : "" let payable = abiRecord.stateMutability != nil ? - (abiRecord.stateMutability == "payable" || abiRecord.payable!) : false + (abiRecord.stateMutability == "payable" || (abiRecord.payable ?? false)) : false let constant = (abiRecord.constant == true || abiRecord.stateMutability == "view" || abiRecord.stateMutability == "pure") let functionElement = ABI.Element.Function(name: name, inputs: abiInputs, outputs: abiOutputs, constant: constant, payable: payable) return functionElement From b854a5b9aeb7826b847ca8906e239cb1ca5b4636 Mon Sep 17 00:00:00 2001 From: Alexander Osokin Date: Fri, 21 Oct 2022 16:40:41 +0500 Subject: [PATCH 2/2] Fix abi parsing --- Sources/web3swift/EthereumABI/ABIParsing.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/web3swift/EthereumABI/ABIParsing.swift b/Sources/web3swift/EthereumABI/ABIParsing.swift index 93ec5ffee..ab437f5f6 100755 --- a/Sources/web3swift/EthereumABI/ABIParsing.swift +++ b/Sources/web3swift/EthereumABI/ABIParsing.swift @@ -82,7 +82,7 @@ fileprivate func parseFunction(abiRecord:ABI.Record) throws -> ABI.Element.Funct } fileprivate func parseFallback(abiRecord:ABI.Record) throws -> ABI.Element.Fallback { - let payable = (abiRecord.stateMutability == "payable" || abiRecord.payable!) + let payable = (abiRecord.stateMutability == "payable" || (abiRecord.payable ?? false)) var constant = abiRecord.constant == true if (abiRecord.stateMutability == "view" || abiRecord.stateMutability == "pure") { constant = true