Clawback update

This commit is contained in:
Ekiserrepé
2025-10-02 20:51:14 +02:00
parent c25e8f7c57
commit ee862a8ba7
2 changed files with 51 additions and 0 deletions

View File

@@ -61,6 +61,7 @@ The available AccountSet flags are:
| Flag Name | Decimal Value | Corresponding Ledger Flag | Description | | Flag Name | Decimal Value | Corresponding Ledger Flag | Description |
| --------------------------------- | ------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------------------------------- | ------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `asfAccountTxnID` | 5 | (None) | Track the ID of this account's most recent transaction. Required for `AccountTxnID` | | `asfAccountTxnID` | 5 | (None) | Track the ID of this account's most recent transaction. Required for `AccountTxnID` |
| `asfAllowTrustLineClawback` | 17 | `lsfAllowTrustLineClawback` | Enables an account to clawback tokens it has issued. This flag can only be enabled if the accounts owner directory is empty (no trust lines, offers, escrows, payment channels, checks, or signer lists). Once set, it cannot be undone. |
| `asfAuthorizedNFTokenMinter` | 10 | (None) | Enable to allow another account to mint non-fungible tokens (NFTokens) on this account's behalf. Specify the authorized account in the `NFTokenMinter` field of the AccountRoot object. To remove an authorized minter, enable this flag and omit the `NFTokenMinter` field. _(Added by the \[NonFungibleTokensV1_1 amendment]\[].)_ | | `asfAuthorizedNFTokenMinter` | 10 | (None) | Enable to allow another account to mint non-fungible tokens (NFTokens) on this account's behalf. Specify the authorized account in the `NFTokenMinter` field of the AccountRoot object. To remove an authorized minter, enable this flag and omit the `NFTokenMinter` field. _(Added by the \[NonFungibleTokensV1_1 amendment]\[].)_ |
| `asfDefaultRipple` | 8 | `lsfDefaultRipple` | Enable rippling on this account's trust lines by default. | | `asfDefaultRipple` | 8 | `lsfDefaultRipple` | Enable rippling on this account's trust lines by default. |
| `asfDepositAuth` | 9 | `lsfDepositAuth` | Enable Deposit Authorization on this account. _(Added by the \[DepositAuth amendment]\[].)_ | | `asfDepositAuth` | 9 | `lsfDepositAuth` | Enable Deposit Authorization on this account. _(Added by the \[DepositAuth amendment]\[].)_ |

View File

@@ -0,0 +1,50 @@
---
title: Clawback
description: >-
Revoke tokens that were previously issued by your account.
---
# Clawback
Revoke tokens that were previously issued by your account. The **Clawback** feature is disabled by default. To use it, you must first submit an **AccountSet** transaction that enables *Allow Trust Line Clawback*. If your account has already issued tokens, you cannot enable Clawback afterward. You can only activate *Allow Trust Line Clawback* if your owner directory is completely empty — meaning before creating trust lines, offers, escrows, payment channels, checks, or signer lists. Once enabled, Clawback becomes a permanent capability of your account and cannot be undone.
---
## Example
```json
{
"TransactionType": "Clawback",
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Amount": {
"currency": "USD",
"issuer": "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
"value": "123.45"
}
}
````
---
### Fields
A **Clawback** transaction includes:
| Field | JSON Type | Description |
| -------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Amount` | *Currency Amount* | The quantity to be revoked, as well as the counterparty from which it is taken. The `value` must not be zero. If greater than the holders balance, the entire balance is revoked. In the `issuer` sub-field, specify the holders address (not the issuers). |
In Xahau, an IOU/Non-XAH token on a trust line always has an issuer, but trust lines are bidirectional and under certain settings both sides may act as issuers. In this transaction, the issuers address goes in the `Account` field, while the holders address goes in the `issuer` sub-field of `Amount`.
---
## Error Cases
Besides the standard transaction errors, Clawback may fail with:
| Error Code | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `temDISABLED` | The **Clawback** amendment is not enabled on Xahau. |
| `temBAD_AMOUNT` | The holders balance is zero. (It is not an error if the specified amount exceeds the holders balance — in that case, the full available balance is revoked). Also occurs if the counterparty in `Amount` is the same account submitting the transaction. |
| `tecNO_LINE` | No trust line exists with the specified counterparty, or the trust line has a balance of zero. |
| `tecNO_PERMISSION` | Happens if you try to enable `lsfAllowTrustLineClawback` while `lsfNoFreeze` is already enabled, or vice versa. |