Skip to content

Commit

Permalink
Merge pull request #4 from Savid/fix/uniswap-pair
Browse files Browse the repository at this point in the history
fix(uniswap-pair): check reservers response length
  • Loading branch information
Savid committed Sep 16, 2022
2 parents 6590d12 + 4fd042d commit 44ade8a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/exporter/jobs/uniswap_pair.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ func (n *UniswapPair) getBalance(address *AddressUniswapPair) error {
return err
}

if len(balanceStr) < 130 {
n.log.WithFields(logrus.Fields{
"address": address,
"balance": balanceStr,
}).Warn("Got empty uniswap pair balance")

return nil
}

fromBalance := hexStringToFloat64(balanceStr[0:66])
toBalance := hexStringToFloat64("0x" + balanceStr[66:130])

Expand Down

0 comments on commit 44ade8a

Please sign in to comment.