mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-28 23:55:49 +00:00
WIP clawback fixes
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
---
|
||||
html: clawback-of-issued-currency.html
|
||||
parent: tokens.html
|
||||
blurb: Issuers can claw back their issued tokens for compliance purposes.
|
||||
labels:
|
||||
- Tokens
|
||||
status: not_enabled
|
||||
---
|
||||
# Clawback
|
||||
<embed src="/snippets/_clawback-disclaimer.md" />
|
||||
For regulatory purposes, some issuers must have the ability to recover issued tokens after they are distributed to accounts. For example, if an issuer were to discover that tokens were sent to an account sanctioned for illegal activity, the issuer could recover, or *claw back*, the funds.
|
||||
|
||||
Issuers can create tokens that they can claw back by adding the `lsfAllowTrustLineClawback` flag to the issuing account.
|
||||
|
||||
**Note:** You can only claw back issued tokens created by your account. You cannot claw back XRP in this way.
|
||||
|
||||
Clawback is disabled by default. To use clawback, you must set the `lsfAllowTrustLineClawback` flag through an `AccountSet` transaction. The `AccountSet` transaction only succeeds if the account has an empty owner directory, meaning that the account has no trust lines, offers, escrows, payment channels, or checks. After you set this flag, it cannot reverted. The account permanently gains the ability to claw back issued assets on trust lines.
|
||||
|
||||
If you attempt to set `lsfAllowTrustLineClawback` while `lsfNoFreeze` is set, the transaction returns `tecNO_PERMISSION`, because clawback cannot be enabled on an account that has already disclaimed the ability to freeze trust lines.
|
||||
Conversely, if you try to set `lsfNoFreeze` while `lsfAllowTrustLineClawback` is set, the transaction also returns `tecNO_PERMISSION`.
|
||||
|
||||
## Example Clawback Transaction
|
||||
|
||||
```json
|
||||
{
|
||||
"TransactionType": "Clawback",
|
||||
"Account": "rp6abvbTbjoce8ZDJkT6snvxTZSYMBCC9S",
|
||||
"Amount": {
|
||||
"currency": "FOO",
|
||||
"issuer": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
|
||||
"value": "314.159"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
In execution, this transaction would claw back at most 314.159 FOO issued by rp6abvbTbjoce8ZDJkT6snvxTZSYMBCC9S and held by rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW. If rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW does not have a trust line set up or that trust line's balance is 0, then the error `tecNO_LINE` is returned and a fee is consumed.
|
||||
41
content/concepts/tokens/clawing-back-tokens.md
Normal file
41
content/concepts/tokens/clawing-back-tokens.md
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
html: clawing-back-tokens.html
|
||||
parent: tokens.html
|
||||
blurb: Issuers can claw back their tokens for compliance purposes if they enable the Clawback feature before issuing tokens.
|
||||
labels:
|
||||
- Tokens
|
||||
status: not_enabled
|
||||
---
|
||||
# Clawing Back Tokens
|
||||
{% include '_snippets/_clawback-disclaimer.md' %}
|
||||
For regulatory purposes, some issuers need the ability to recover tokens after they are distributed to accounts. For example, if an issuer were to discover that tokens were sent to an account sanctioned for illegal activity, the issuer could recover, or *claw back*, the funds.
|
||||
|
||||
Issuers can gain the ability to claw back their tokens by enabling the **Allow Clawback** flag on their issuing account. This flag cannot be enabled if the issuer has already issued tokens.
|
||||
|
||||
**Note:** You can only claw back issued tokens created by your account. You cannot claw back XRP in this way.
|
||||
|
||||
Clawback is disabled by default. To use clawback, you must send an [AccountSet transaction][] to enable the **Allow Clawback** setting. **An issuer with any existing tokens cannot enable Clawback.** You can only enable Allow Clawback if you have a completely empty owner directory, meaning you must do so before you set up any trust lines, offers, escrows, payment channels, checks, or even signer lists.
|
||||
|
||||
If you attempt to set `lsfAllowTrustLineClawback` while `lsfNoFreeze` is set, the transaction returns `tecNO_PERMISSION`, because clawback cannot be enabled on an account that has already disclaimed the ability to freeze trust lines.
|
||||
Conversely, if you try to set `lsfNoFreeze` while `lsfAllowTrustLineClawback` is set, the transaction also returns `tecNO_PERMISSION`.
|
||||
|
||||
## Example Clawback Transaction
|
||||
|
||||
```json
|
||||
{
|
||||
"TransactionType": "Clawback",
|
||||
"Account": "rp6abvbTbjoce8ZDJkT6snvxTZSYMBCC9S",
|
||||
"Amount": {
|
||||
"currency": "FOO",
|
||||
"issuer": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
|
||||
"value": "314.159"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If successful, this transaction would claw back at most 314.159 FOO issued by rp6abvbTbjoce8ZDJkT6snvxTZSYMBCC9S and held by rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW.
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
Reference in New Issue
Block a user