From 57a7cf8451f9e8dd4fdb7bb19c324ccb98dead83 Mon Sep 17 00:00:00 2001 From: sowle Date: Tue, 22 Aug 2023 20:23:52 +0200 Subject: [PATCH] fixed construct_tx_handle_ado() to correctly calculate asset operation amount commitment for burn operation --- src/currency_core/currency_format_utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/currency_core/currency_format_utils.cpp b/src/currency_core/currency_format_utils.cpp index 7872d550..98eb3256 100644 --- a/src/currency_core/currency_format_utils.cpp +++ b/src/currency_core/currency_format_utils.cpp @@ -2191,7 +2191,7 @@ namespace currency } ado.descriptor.current_supply -= amount_of_burned_assets; // TODO: consider setting current_supply beforehand, not setting it hear in ad-hoc manner -- sowle - gen_context.ao_amount_commitment = amount_of_burned_assets * gen_context.ao_asset_id_pt + gen_context.ao_amount_blinding_mask * crypto::c_point_G; + gen_context.ao_amount_commitment = gen_context.ao_amount_blinding_mask * crypto::c_point_G - amount_of_burned_assets * gen_context.ao_asset_id_pt; ado.opt_amount_commitment = (crypto::c_scalar_1div8 * gen_context.ao_amount_commitment).to_public_key(); }