@@ -255,7 +255,7 @@ func toGoType(index int, t Type, output []byte) (interface{}, error) {
255
255
256
256
// lengthPrefixPointsTo interprets a 32 byte slice as an offset and then determines which indices to look to decode the type.
257
257
func lengthPrefixPointsTo (index int , output []byte ) (start int , length int , err error ) {
258
- bigOffsetEnd := big .NewInt ( 0 ).SetBytes (output [index : index + 32 ])
258
+ bigOffsetEnd := new ( big.Int ).SetBytes (output [index : index + 32 ])
259
259
bigOffsetEnd .Add (bigOffsetEnd , common .Big32 )
260
260
outputLength := big .NewInt (int64 (len (output )))
261
261
@@ -268,11 +268,9 @@ func lengthPrefixPointsTo(index int, output []byte) (start int, length int, err
268
268
}
269
269
270
270
offsetEnd := int (bigOffsetEnd .Uint64 ())
271
- lengthBig := big .NewInt ( 0 ).SetBytes (output [offsetEnd - 32 : offsetEnd ])
271
+ lengthBig := new ( big.Int ).SetBytes (output [offsetEnd - 32 : offsetEnd ])
272
272
273
- totalSize := big .NewInt (0 )
274
- totalSize .Add (totalSize , bigOffsetEnd )
275
- totalSize .Add (totalSize , lengthBig )
273
+ totalSize := new (big.Int ).Add (bigOffsetEnd , lengthBig )
276
274
if totalSize .BitLen () > 63 {
277
275
return 0 , 0 , fmt .Errorf ("abi: length larger than int64: %v" , totalSize )
278
276
}
@@ -287,7 +285,7 @@ func lengthPrefixPointsTo(index int, output []byte) (start int, length int, err
287
285
288
286
// tuplePointsTo resolves the location reference for dynamic tuple.
289
287
func tuplePointsTo (index int , output []byte ) (start int , err error ) {
290
- offset := big .NewInt ( 0 ).SetBytes (output [index : index + 32 ])
288
+ offset := new ( big.Int ).SetBytes (output [index : index + 32 ])
291
289
outputLen := big .NewInt (int64 (len (output )))
292
290
293
291
if offset .Cmp (outputLen ) > 0 {
0 commit comments