From 199ec2c03dadcc174cff181aa32a88a4552b61f6 Mon Sep 17 00:00:00 2001 From: yinyiqian1 Date: Wed, 24 Jul 2024 10:17:49 -0400 Subject: [PATCH 1/2] Add Spec for clawback-enabled assets and frozen assets --- XLS-0074d-amm-clawback/README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/XLS-0074d-amm-clawback/README.md b/XLS-0074d-amm-clawback/README.md index 5f795d5c..0c015c12 100644 --- a/XLS-0074d-amm-clawback/README.md +++ b/XLS-0074d-amm-clawback/README.md @@ -30,8 +30,37 @@ Currently, accounts that have enabled clawback cannot create AMM pools. This pro ## 2. Specification ### 2.1. AMM and Frozen Asset #### 2.1.1. Prohibiting depositing new tokens + +The AMMClawback amendment introduces changes to the behavior of the `AMMDeposit` transaction when tokens in trustlines interact with Automated Market Maker (AMM) pools. + +Assume we have created an Automated Market Maker (AMM) pool with two assets: A and B. Currently, asset A is frozen by individual freeze. The following table outlines whether specific scenarios are allowed or prohibited before and after the amendment: + +| Scenario | Before Amendment | After Amendment | +|-------------------------|-------------------|-----------------------| +| Double-Asset Deposit | Prohibited | Prohibited | +| Only Deposit A (frozen) | Prohibited | Prohibited | +| Only Deposit B | Allowed | Prohibited | + +As illustrated in the table above, the primary change is that when one asset in the AMM pool is frozen, depositing the other asset is no longer allowed. This means that deposits are prohibited for the non-frozen asset when its paired asset is frozen. + #### 2.1.2. Prohibiting transfering LPTokens that are frozen ### 2.2. AMM and Clawback #### 2.2.1. Allow creation of AMM pool when tokens have enabled clawback +Currently, when clawback is enabled for the issuer account by setting `lsfAllowTrustLineClawback` flag, `AMMCreate` is prohibited against this issuer. After the AMMClawback amendment, `AMMCreate` is allowed for clawback-enabled issuer. But the issuer can not clawback from the AMM account using `Clawback` transaction. `AMMClawback` transaction is needed for the issuer to clawback from an AMM account. + +**Example Illustrating the AMMClawback Amendment:** + +Suppose an issuer has enabled clawback by setting the `lsfAllowTrustLineClawback` flag through an `AccountSet` transaction. Additionally, two trustlines have been established between the holder and the issuer for currencies A and B + +- **Pre-Amendment Behavior:** + - If the holder attempts to create an AMM pool (`AMMCreate`) using the pair of trustline assets A and B associated with the issuer, the transaction will fail with a `tecNO_PERMISSION` error. + +- **Post-Amendment Behavior:** + - After the AMMClawback amendment, if the holder submits an `AMMCreate` transaction to create an AMM pool with assets A and B, the transaction will be successful. + - However, if the issuer wants to clawback assets from the AMM account, they must use the `AMMClawback` transaction instead of the regular `Clawback` transaction. + +This change allows for the creation of AMM pools with clawback-enabled issuers while introducing a new transaction type (`AMMClawback`) for issuers to clawback assets from AMM accounts. + + #### 2.2.2. New transaction to claw back from AMM pools From a008e486be525eb7ee57fb30909c739a80602074 Mon Sep 17 00:00:00 2001 From: yinyiqian1 Date: Wed, 31 Jul 2024 11:17:14 -0400 Subject: [PATCH 2/2] modify according to some comments --- XLS-0074d-amm-clawback/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/XLS-0074d-amm-clawback/README.md b/XLS-0074d-amm-clawback/README.md index 0c015c12..c96f90c9 100644 --- a/XLS-0074d-amm-clawback/README.md +++ b/XLS-0074d-amm-clawback/README.md @@ -31,11 +31,11 @@ Currently, accounts that have enabled clawback cannot create AMM pools. This pro ### 2.1. AMM and Frozen Asset #### 2.1.1. Prohibiting depositing new tokens -The AMMClawback amendment introduces changes to the behavior of the `AMMDeposit` transaction when tokens in trustlines interact with Automated Market Maker (AMM) pools. +This proposal introduces changes to the behavior of the `AMMDeposit` transaction when tokens in trustlines interact with Automated Market Maker (AMM) pools. -Assume we have created an Automated Market Maker (AMM) pool with two assets: A and B. Currently, asset A is frozen by individual freeze. The following table outlines whether specific scenarios are allowed or prohibited before and after the amendment: +Assume we have created an Automated Market Maker (AMM) pool with two assets: A and B. Currently, asset A is frozen by individual freeze. The following table outlines whether specific scenarios are allowed or prohibited for the current behavior and proposed behavior: -| Scenario | Before Amendment | After Amendment | +| Scenario | Current Behavior | Proposed Behavior | |-------------------------|-------------------|-----------------------| | Double-Asset Deposit | Prohibited | Prohibited | | Only Deposit A (frozen) | Prohibited | Prohibited | @@ -48,7 +48,7 @@ As illustrated in the table above, the primary change is that when one asset in #### 2.2.1. Allow creation of AMM pool when tokens have enabled clawback Currently, when clawback is enabled for the issuer account by setting `lsfAllowTrustLineClawback` flag, `AMMCreate` is prohibited against this issuer. After the AMMClawback amendment, `AMMCreate` is allowed for clawback-enabled issuer. But the issuer can not clawback from the AMM account using `Clawback` transaction. `AMMClawback` transaction is needed for the issuer to clawback from an AMM account. -**Example Illustrating the AMMClawback Amendment:** +##### Example: Illustrating the AMMClawback Amendment Suppose an issuer has enabled clawback by setting the `lsfAllowTrustLineClawback` flag through an `AccountSet` transaction. Additionally, two trustlines have been established between the holder and the issuer for currencies A and B