You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
guardlet valueUnwrapped = v,let consumedUnwrapped = c else{return(nil,nil)}
175
175
toReturn.append(valueUnwrapped)
176
-
consumed = consumed + consumedUnwrapped
176
+
/*
177
+
When decoding a tuple that is not static or an array with a subtype that is not static, the second value in the tuple returned by decodeSignleType is a pointer to the next element, NOT the length of the consumed element. So when decoding such an element, consumed should be set to consumedUnwrapped, NOT incremented by consumedUnwrapped.
178
+
*/
179
+
switchsubTypes[i]{
180
+
case.array(type:let subType, length: _):
181
+
if !subType.isStatic {
182
+
consumed = consumedUnwrapped
183
+
}else{
184
+
consumed = consumed + consumedUnwrapped
185
+
}
186
+
case.tuple(types: _):
187
+
if !subTypes[i].isStatic {
188
+
consumed = consumedUnwrapped
189
+
}else{
190
+
consumed = consumed + consumedUnwrapped
191
+
}
192
+
default:
193
+
consumed = consumed + consumedUnwrapped
194
+
}
177
195
}
178
196
// print("Tuple element is: \n" + String(describing: toReturn))
179
197
if type.isStatic {
@@ -253,11 +271,11 @@ extension ABIDecoder {
253
271
letdata=logs[i+1]
254
272
letinput=indexedInputs[i]
255
273
if !input.type.isStatic || input.type.isArray || input.type.memoryUsage !=32{
0 commit comments