fix: prevent crash when erc20 tx is contract creation
This commit is contained in:
parent
9be202be50
commit
f502d991b7
|
@ -400,7 +400,8 @@ func (c *transfersCommand) checkAndProcessBridgeMultiTx(ctx context.Context, tx
|
|||
|
||||
func (c *transfersCommand) processUnknownErc20CommunityTransactions(ctx context.Context, allTransfers []Transfer) {
|
||||
for _, tx := range allTransfers {
|
||||
if tx.Type == w_common.Erc20Transfer {
|
||||
// To can be nil in case of erc20 contract creation
|
||||
if tx.Type == w_common.Erc20Transfer && tx.Transaction.To() != nil {
|
||||
// Find token in db or if this is a community token, find its metadata
|
||||
_ = c.tokenManager.FindOrCreateTokenByAddress(ctx, tx.NetworkID, *tx.Transaction.To())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue