Skip to content

Commit

Permalink
Do not panic on missing tokenID erc1155
Browse files Browse the repository at this point in the history
  • Loading branch information
lukanus committed Feb 19, 2024
1 parent 44f9915 commit e7dee05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion eth/tracers/blocknative/decoder/calldata.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package decoder

import (
"math/big"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"math/big"
)

func decodeCallData(sender common.Address, contract *Contract, input []byte) (*CallData, error) {
Expand Down
4 changes: 4 additions & 0 deletions eth/tracers/blocknative/decoder/evm_caller.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ func evmCallMethodBalanceOf(evmCall evmCallFn, addr common.Address, owner common

// evmCallMethodBalanceOf2 decodes the balance of an asset from the EVM.
func evmCallMethodBalanceOf2(evmCall evmCallFn, addr common.Address, owner common.Address, tokenID *big.Int) (*big.Int, error) {
if tokenID == nil {
return nil, fmt.Errorf("tokenID is nil")
}

tokenIDBytes := common.LeftPadBytes(tokenID.Bytes(), 32)
ownerBytes := common.LeftPadBytes(owner.Bytes(), 32)
input := append(methodIDBalanceOf2, ownerBytes...)
Expand Down

0 comments on commit e7dee05

Please sign in to comment.