From 76a34a05b5d74c09aaebb97690e4b26775572395 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sun, 16 Mar 2025 10:46:37 +0000 Subject: [PATCH] proto.eth.tx: add mmid to output; check addrs, amt before signing --- mmgen/data/version | 2 +- mmgen/proto/eth/tx/new.py | 2 ++ mmgen/proto/eth/tx/unsigned.py | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mmgen/data/version b/mmgen/data/version index 7965f352..ac5663e7 100644 --- a/mmgen/data/version +++ b/mmgen/data/version @@ -1 +1 @@ -15.1.dev20 +15.1.dev21 diff --git a/mmgen/proto/eth/tx/new.py b/mmgen/proto/eth/tx/new.py index e2b0c93c..c847a773 100755 --- a/mmgen/proto/eth/tx/new.py +++ b/mmgen/proto/eth/tx/new.py @@ -96,6 +96,8 @@ class New(Base, TxBase.New): amt = self.proto.coin_amt(arg.amt or '0'), is_chg = not arg.amt) + self.add_mmaddrs_to_outputs(ad_f, ad_w) + def get_unspent_nums_from_user(self, unspent): from ....ui import line_input while True: diff --git a/mmgen/proto/eth/tx/unsigned.py b/mmgen/proto/eth/tx/unsigned.py index f9e976dd..0eb625db 100755 --- a/mmgen/proto/eth/tx/unsigned.py +++ b/mmgen/proto/eth/tx/unsigned.py @@ -74,6 +74,12 @@ class Unsigned(Completed, TxBase.Unsigned): o = self.txobj + m = 'mismatch -- a compromised online installation may have altered your serialized data!' + assert o['from'] == self.inputs[0].addr, f'from_addr {m}' + if self.outputs: + assert o['to'] == self.outputs[0].addr, f'to_addr {m}' + assert o['amt'] == self.outputs[0].amt, f'to_amt {m}' + msg_r(f'Signing transaction{tx_num_str}...') try: