-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Porting Clawback documentation to xrpl.org #2111
Merged
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4826b76
Porting Clawback documentation to xrpl.org as the feature is in rippl…
amarantha-k 49a67b7
change trust lines to two words
DennisDawson e6fbebb
Change trust lines to two words, remove redundant *from*
DennisDawson 620974f
WIP clawback fixes
DennisDawson 7f5752b
Address review comments.
DennisDawson d512132
Fix format and links
DennisDawson 2c8d4a6
fix line break
DennisDawson b770b82
innocuous change to kick off build
DennisDawson 6e519d6
Merge branch 'master' into clawback-docs
DennisDawson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_Requires the [Clawback amendment](https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-39d-clawback)._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
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 Trust Line Clawback** setting. **An issuer with any existing tokens cannot enable Clawback.** You can only enable **Allow Trust Line 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 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' %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
content/references/protocol-reference/transactions/transaction-types/clawback.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
html: clawback.html | ||
parent: transaction-types.html | ||
blurb: Claw back tokens you've issued. | ||
labels: | ||
- Tokens | ||
status: not_enabled | ||
--- | ||
# Clawback | ||
|
||
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/app/tx/impl/Clawback.cpp "Source") | ||
|
||
{% include '_snippets/clawback-disclaimer.md' %} | ||
|
||
Claw back tokens issued by your account. | ||
|
||
Clawback is disabled by default. To use clawback, you must send an [AccountSet transaction][] to enable the **Allow Trust Line Clawback** setting. An issuer with any existing tokens cannot enable Clawback. You can only enable **Allow Trust Line 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 signer lists. After you enable Clawback, it cannot reverted: the account permanently gains the ability to claw back issued assets on trust lines. | ||
|
||
## Example Clawback JSON | ||
|
||
```json | ||
{ | ||
"TransactionType": "Clawback", | ||
"Account": "rp6abvbTbjoce8ZDJkT6snvxTZSYMBCC9S", | ||
"Amount": { | ||
"currency": "FOO", | ||
"issuer": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW", | ||
"value": "314.159" | ||
} | ||
} | ||
``` | ||
|
||
<!-- | ||
[Clawback example transaction. >](websocket-api-tool.html?) | ||
--> | ||
|
||
## Clawback Fields | ||
|
||
{% include '_snippets/tx-fields-intro.md' %} | ||
|
||
| Field | JSON Type | [Internal Type][] | Description | | ||
|:-------------------|:----------|:------------------|:------------------| | ||
| `Amount` | [Currency Amount][] | Amount |Indicates the amount being clawed back, as well as the counterparty from which the amount is being clawed back. The quantity to claw back, in the `value` sub-field, must not be zero. If this is more than the current balance, the transaction claws back the entire balance. The sub-field `issuer` within `Amount` represents the token holder's account ID, rather than the issuer's.| | ||
|
||
The account executing this transaction must be the issuer of the asset being clawed back. Note that in the XRP Ledger, trust lines are bidirectional and, under some configurations, both sides can be seen as the *issuer* of an asset. In this specification, the term *issuer* is used to mean the side of the trust line that has an outstanding balance (that is, 'owes' the issued asset) that it wants to claw back. | ||
|
||
|
||
## Error Cases | ||
|
||
Besides errors that can occur for all transactions, {{currentpage.name}} transactions can result in the following [transaction result codes](transaction-results.html): | ||
|
||
| Error Code | Description | | ||
|:-----------|:------------| | ||
| `temDISABLED` | Occurs if the [Clawback amendment](known-amendments.html#clawback) is not enabled. | | ||
| `temBAD_AMOUNT` | Occurs if the holder's balance is 0. It is not an error if the amount exceeds the holder's balance; in that case, the maximum available balance is clawed back. Also occurs if the counterparty listed in `Amount` is the same as the `Account` issuing this transaction. | | ||
| `tecNO-LINE` | Occurs there is no trust line with the counterparty or that trust line's balance is 0. | | ||
| `tecNO-PERMISSION` | Occurs if you attempt to set `lsfAllowTrustlineClawback` while `lsfNoFreeze` is set. Also occurs, conversely, if you try to set `lsfNoFreeze` while `lsfAllowTrustLineClawback` is set. | | ||
|
||
<!-- {# common link defs #} --> | ||
{% include '_snippets/rippled-api-links.md' %} | ||
{% include '_snippets/tx-type-links.md' %} | ||
{% include '_snippets/rippled_versions.md' %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines need to be combined to make the table display properly.