diff --git a/config/config.go b/config/config.go index f1b05c3..9e8e166 100644 --- a/config/config.go +++ b/config/config.go @@ -179,7 +179,7 @@ func GetPaymentAddress(payTokenId tables.PayTokenId, paymentAddress string) (str if _, ok := Cfg.Chain.Bsc.AddrMap[paymentAddress]; ok { return strings.ToLower(paymentAddress), nil } - case tables.PayTokenIdMATIC: + case tables.PayTokenIdPOL: //,tables.PayTokenIdMATIC: if _, ok := Cfg.Chain.Polygon.AddrMap[paymentAddress]; ok { return strings.ToLower(paymentAddress), nil } diff --git a/parser/parser.go b/parser/parser.go index dce786a..9b78062 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -146,7 +146,7 @@ func (t *ToolParser) initParserPolygon() error { DbDao: t.dbDao, CN: t.cn, ParserType: tables.ParserTypePOLYGON, - PayTokenId: tables.PayTokenIdMATIC, + PayTokenId: tables.PayTokenIdPOL, //tables.PayTokenIdMATIC, CurrentBlockNumber: 0, ConcurrencyNum: 10, ConfirmNum: 10, diff --git a/refund/refund_evm.go b/refund/refund_evm.go index 5c7e0fc..44486ba 100644 --- a/refund/refund_evm.go +++ b/refund/refund_evm.go @@ -83,6 +83,7 @@ func (t *ToolRefund) refundEvm(p refundEvmParam) (ok bool, e error) { } fee = gasPrice.Mul(gasLimit) + log.Info("refundAmount fee:", refundAmount.String(), fee.String()) // NOTE fee more than refundAmount if refundAmount.Cmp(fee) != 1 { if err = t.DbDao.UpdateRefundStatusToRejected(payHash); err != nil { diff --git a/refund/refund_order.go b/refund/refund_order.go index c0d50cf..753b0f2 100644 --- a/refund/refund_order.go +++ b/refund/refund_order.go @@ -31,7 +31,7 @@ func (t *ToolRefund) doRefund() error { parserType = tables.ParserTypeETH case tables.PayTokenIdBNB, tables.PayTokenIdBep20USDT: parserType = tables.ParserTypeBSC - case tables.PayTokenIdMATIC: + case tables.PayTokenIdPOL: //tables.PayTokenIdMATIC: parserType = tables.ParserTypePOLYGON case tables.PayTokenIdTRX, tables.PayTokenIdTrc20USDT: parserType = tables.ParserTypeTRON @@ -196,7 +196,8 @@ func (t *ToolRefund) getParserTypeEvmMap() (map[tables.ParserType]parserTypeEvm, return nil, fmt.Errorf("NonceAt polygon err: %s", err.Error()) } parserTypePolygon.nonceMap[strings.ToLower(k)] = nonce - nonceInfo, err := t.DbDao.GetRefundNonce(nonce, k, []tables.PayTokenId{tables.PayTokenIdMATIC}) + //nonceInfo, err := t.DbDao.GetRefundNonce(nonce, k, []tables.PayTokenId{tables.PayTokenIdMATIC}) + nonceInfo, err := t.DbDao.GetRefundNonce(nonce, k, []tables.PayTokenId{tables.PayTokenIdPOL}) if err != nil { return nil, fmt.Errorf("GetRefundNonce polygon err: %s[%d][%s]", err.Error(), nonce, k) } else if nonceInfo.Id > 0 { diff --git a/tables/t_order_info.go b/tables/t_order_info.go index 69eadd7..29fbf3b 100644 --- a/tables/t_order_info.go +++ b/tables/t_order_info.go @@ -49,6 +49,7 @@ const ( PayTokenIdBNB PayTokenId = "bsc_bnb" PayTokenIdBep20USDT PayTokenId = "bsc_bep20_usdt" PayTokenIdMATIC PayTokenId = "polygon_matic" + PayTokenIdPOL PayTokenId = "polygon_pol" PayTokenIdDOGE PayTokenId = "doge_doge" PayTokenIdDAS PayTokenId = "ckb_das" PayTokenIdCKB PayTokenId = "ckb_ckb"