From cc2ce5eeb6779b12cf51ac2cbaba6be0e7589dc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bald=C3=A9=20=28WSL=20Win11=20Pro=29?= Date: Sun, 21 Apr 2024 17:36:08 +0100 Subject: [PATCH] Handle the deleted RAMM's LP token `Bag` of `Supply`es --- ramm-sui/sources/ramm.move | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/ramm-sui/sources/ramm.move b/ramm-sui/sources/ramm.move index ca8bc64..ffc19bc 100644 --- a/ramm-sui/sources/ramm.move +++ b/ramm-sui/sources/ramm.move @@ -763,12 +763,29 @@ module ramm_sui::ramm { typed_balances.destroy_empty(); collected_protocol_fees.destroy_empty(); - /* - */ transfer::public_transfer(fst_coin, fee_collector); transfer::public_transfer(snd_coin, fee_collector); transfer::public_transfer(trd_coin, fee_collector); + /* + */ + + /* + Handle `typed_lp_tokens_issued` + */ + + let fst_supply: Supply = typed_lp_tokens_issued.remove(fst_ix); + let snd_supply: Supply = typed_lp_tokens_issued.remove(snd_ix); + let trd_supply: Supply = typed_lp_tokens_issued.remove(trd_ix); + + transfer::public_transfer(fst_supply, fee_collector); + transfer::public_transfer(snd_supply, fee_collector); + transfer::public_transfer(trd_supply, fee_collector); + + typed_lp_tokens_issued.destroy_empty(); + + /* + */ ramm_uid.delete(); }