Quellcode durchsuchen

2025-06-05學費,okx返回空狀態異常處理

skyfffire vor 5 Monaten
Ursprung
Commit
67dc42827c
2 geänderte Dateien mit 9 neuen und 1 gelöschten Zeilen
  1. 7 0
      2025-6-5學費.txt
  2. 2 1
      erc20_to_mexc.py

+ 7 - 0
2025-6-5學費.txt

@@ -0,0 +1,7 @@
+链上交易失敗。{'chainId': '1', 'chainIndex': '1', 'dexRouter': '0x6088d94c5a40cecd3ae2d4e0710ca687b91c61d0', 'errorMsg': '', 'fromAddress': '', 'fromTokenDetails': {'amount': '328730000', 'symbol': 'USDT', 'tokenAddress': '0xdac17f958d2ee523a2206206994597c13d831ec7'}, 'gasLimit': '', 'gasPrice': '', 'gasUsed': '', 'height': '', 'referralAmount': '', 'status': '', 'toAddress': '', 'toTokenDetails': {'amount': '45686142846636739', 'symbol': 'RATO', 'tokenAddress': '0xf816507e690f5aa4e29d164885eb5fa7a5627860'}, 'txFee': '', 'txHash': '0xc128ed22285b4818fed247588d9855d9b9a5ffe7cdc4efd396e8382a77bf8dda', 'txTime': '', 'txType': 'swap'}
+
+链上交易失敗。{'chainId': '1', 'chainIndex': '1', 'dexRouter': '0x6088d94c5a40cecd3ae2d4e0710ca687b91c61d0', 'errorMsg': '', 'fromAddress': '', 'fromTokenDetails': {'amount': '602840000', 'symbol': 'USDT', 'tokenAddress': '0xdac17f958d2ee523a2206206994597c13d831ec7'}, 'gasLimit': '', 'gasPrice': '', 'gasUsed': '', 'height': '', 'referralAmount': '', 'status': '', 'toAddress': '', 'toTokenDetails': {'amount': '14986462539095', 'symbol': 'KEKIUS', 'tokenAddress': '0x26e550ac11b26f78a04489d5f20f24e3559f7dd9'}, 'txFee': '', 'txHash': '0xdf1f291ae741579ae413214c9389b1e0e00aca51940738803a8e5634f3e435c9', 'txTime': '', 'txType': 'swap'}
+
+链上交易失敗。{'chainId': '1', 'chainIndex': '1', 'errorMsg': 'execution reverted-Min return not reached', 'fromAddress': '0xc36b5466d88d3ebe9e538ed650f61b7f9902e6cc', 'gasLimit': '285000', 'gasPrice': '3776039664', 'gasUsed': '258617', 'height': '22641798', 'status': 'fail', 'txFee': '', 'txHash': '0x55262bc84dbc970a44866280964d61443b49317a126583ac20260195268a5fd1', 'txTime': '1749167483', 'txType': ''}
+
+链上交易已确认。{'chainId': '1', 'chainIndex': '1', 'dexRouter': '0x6088d94c5a40cecd3ae2d4e0710ca687b91c61d0', 'errorMsg': '', 'fromAddress': '0xc36b5466d88d3ebe9e538ed650f61b7f9902e6cc', 'fromTokenDetails': {'amount': '287100000', 'symbol': 'USDT', 'tokenAddress': '0xdac17f958d2ee523a2206206994597c13d831ec7'}, 'gasLimit': '285000', 'gasPrice': '7638035446', 'gasUsed': '218819', 'height': '22640410', 'referralAmount': '', 'status': 'success', 'toAddress': '0xd493ddc634928546e0ac9740ad542bc6eeeb6c25', 'toTokenDetails': {'amount': '45926476656820689', 'symbol': 'RATO', 'tokenAddress': '0xf816507e690f5aa4e29d164885eb5fa7a5627860'}, 'txFee': '', 'txHash': '0x2d0fe49837c201d54bd4996bf82769b3fabee8650907096bbf47fa1acd26e025', 'txTime': '1749150683', 'txType': 'swap'}

+ 2 - 1
erc20_to_mexc.py

@@ -431,7 +431,8 @@ class ArbitrageProcess:
                 #     del self.pending_data[chain_tx_hash]
 
                 # 交易失敗的邏輯處理,直接進行回滾
-                if tx_details['status'] != 'success':
+                if 'fromTokenDetails' not in tx_details \
+                or 'toTokenDetails' not in tx_details:
                     msg = f"链上交易失敗。{tx_details}"
                     logger.info(msg)
                     add_state_flow_entry(self.process_item, self.current_state, msg, "fail")