From 2adf35502dda1df1ba442079a6c037e667fabbda Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Thu, 24 Apr 2025 06:03:58 +0000 Subject: [PATCH] Critical Ethereum THORChain swap bugfix If you swap from Ethereum, please upgrade immediately. The bug caused the funds to be returned to the wallet, minus a small fee. No significant loss of funds would have occurred. Swaps to ETH were unaffected. --- mmgen/data/version | 2 +- mmgen/proto/eth/tx/unsigned.py | 2 +- test/cmdtest_d/ethswap.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mmgen/data/version b/mmgen/data/version index 033560e1..258541a5 100644 --- a/mmgen/data/version +++ b/mmgen/data/version @@ -1 +1 @@ -15.1.dev28 +15.1.dev29 diff --git a/mmgen/proto/eth/tx/unsigned.py b/mmgen/proto/eth/tx/unsigned.py index 912caaf6..6d9b3a05 100755 --- a/mmgen/proto/eth/tx/unsigned.py +++ b/mmgen/proto/eth/tx/unsigned.py @@ -47,7 +47,7 @@ class Unsigned(Completed, TxBase.Unsigned): 'gasprice': o['gasPrice'].toWei(), 'value': o['amt'].toWei() if o['amt'] else 0, 'nonce': o['nonce'], - 'data': bytes.fromhex(o['data'])} + 'data': self.swap_memo.encode() if self.is_swap else bytes.fromhex(o['data'])} from ..pyethereum.transactions import Transaction etx = Transaction(**o_conv).sign(wif, o['chainId']) diff --git a/test/cmdtest_d/ethswap.py b/test/cmdtest_d/ethswap.py index 87720724..b65e2d61 100755 --- a/test/cmdtest_d/ethswap.py +++ b/test/cmdtest_d/ethswap.py @@ -245,7 +245,7 @@ class CmdTestEthSwapEth(CmdTestEthSwapMethods, CmdTestSwapMethods, CmdTestEthdev bals = lambda self, k: { 'swap1': [('98831F3A:E:1', '123.456')], - 'swap2': [('98831F3A:E:1', '114.690979')], + 'swap2': [('98831F3A:E:1', '114.690978056')], }[k] cmd_group_in = CmdTestEthdev.cmd_group_in + (