@@ -82,18 +82,15 @@ fileprivate func parseFunction(abiRecord:ABI.Record) throws -> ABI.Element.Funct
82
82
} )
83
83
let abiOutputs = outputs ?? [ ABI . Element. InOut] ( )
84
84
let name = abiRecord. name ?? " "
85
- let payable = abiRecord. stateMutability == " payable " || abiRecord. payable ?? false
86
- let constant = ( abiRecord. constant == true || abiRecord. stateMutability == " view " || abiRecord. stateMutability == " pure " )
85
+ let payable = abiRecord. stateMutability == " payable " || abiRecord. payable == true
86
+ let constant = abiRecord. constant == true || abiRecord. stateMutability == " view " || abiRecord. stateMutability == " pure "
87
87
let functionElement = ABI . Element. Function ( name: name, inputs: abiInputs, outputs: abiOutputs, constant: constant, payable: payable)
88
88
return functionElement
89
89
}
90
90
91
91
fileprivate func parseFallback( abiRecord: ABI . Record ) throws -> ABI . Element . Fallback {
92
92
let payable = ( abiRecord. stateMutability == " payable " || abiRecord. payable == true )
93
- var constant = abiRecord. constant == true
94
- if ( abiRecord. stateMutability == " view " || abiRecord. stateMutability == " pure " ) {
95
- constant = true
96
- }
93
+ let constant = abiRecord. constant == true || abiRecord. stateMutability == " view " || abiRecord. stateMutability == " pure "
97
94
let functionElement = ABI . Element. Fallback ( constant: constant, payable: payable)
98
95
return functionElement
99
96
}
@@ -104,7 +101,7 @@ fileprivate func parseConstructor(abiRecord:ABI.Record) throws -> ABI.Element.Co
104
101
return nativeInput
105
102
} )
106
103
let abiInputs = inputs ?? [ ABI . Element. InOut] ( )
107
- var payable = abiRecord. stateMutability == " payable " || abiRecord. payable ?? false
104
+ let payable = abiRecord. stateMutability == " payable " || abiRecord. payable == true
108
105
let functionElement = ABI . Element. Constructor ( inputs: abiInputs, constant: false , payable: payable)
109
106
return functionElement
110
107
}
@@ -127,7 +124,7 @@ fileprivate func parseReceive(abiRecord:ABI.Record) throws -> ABI.Element.Receiv
127
124
return nativeInput
128
125
} )
129
126
let abiInputs = inputs ?? [ ABI . Element. InOut] ( )
130
- var payable = abiRecord. stateMutability == " payable " || abiRecord. payable ?? false
127
+ let payable = abiRecord. stateMutability == " payable " || abiRecord. payable == true
131
128
let functionElement = ABI . Element. Receive ( inputs: abiInputs, payable: payable)
132
129
return functionElement
133
130
}
0 commit comments