From fa094606001434a24007d9cb87fe4a1b35fe2fa9 Mon Sep 17 00:00:00 2001 From: zhanglin9833 Date: Wed, 15 May 2024 09:45:15 +0800 Subject: [PATCH] fix runtime error (#276) Co-authored-by: XingQiang Bai --- v3/abi/bind/base.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/v3/abi/bind/base.go b/v3/abi/bind/base.go index aaf0680f..91e71f52 100755 --- a/v3/abi/bind/base.go +++ b/v3/abi/bind/base.go @@ -189,7 +189,13 @@ func (c *BoundContract) TransactWithResult(opts *TransactOpts, result interface{ return nil, nil, err } tx, receipt, err := c.transact(opts, &c.address, input, "") - c.abi.Unpack(result, method, common.FromHex(receipt.GetOutput())) + if err != nil { + return tx, receipt, err + } + err = c.abi.Unpack(result, method, common.FromHex(receipt.GetOutput())) + if err != nil { + return tx, receipt, err + } return tx, receipt, err }