Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from tangem/fix_abi_parsing
Browse files Browse the repository at this point in the history
Fix abi parsing
  • Loading branch information
tureck1y authored Oct 21, 2022
2 parents e4c8f47 + b854a5b commit 3512470
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/web3swift/EthereumABI/ABIParsing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ 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
}

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
Expand Down

0 comments on commit 3512470

Please sign in to comment.