Skip to content

Commit 82cd4e4

Browse files
committed
adds fields section to each tx
1 parent 5d8a3a5 commit 82cd4e4

File tree

1 file changed

+35
-27
lines changed

1 file changed

+35
-27
lines changed

XLS-0065-single-asset-vault/README.md

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,8 @@ All transactions introduced by this proposal incorporate the [common transaction
358358

359359
The `VaultCreate` transaction creates a new `Vault` object.
360360

361+
#### 3.1.1 Fields
362+
361363
| Field Name | Required? | JSON Type | Internal Type | Default Value | Description |
362364
| ------------------ | :----------------: | :----------------: | :-----------: | :----------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------- |
363365
| `TransactionType` | :heavy_check_mark: | `string` | `UINT16` | `58` | The transaction type. |
@@ -370,26 +372,26 @@ The `VaultCreate` transaction creates a new `Vault` object.
370372
| `DomainID` | | `string` | `HASH256` | | The `PermissionedDomain` object ID associated with the shares of this Vault. |
371373
| `Scale` | | `number` | `UINT8` | 6 | The `Scale` specifies the power of 10 ($10^{\text{scale}}$) to multiply an asset's value by when converting it into an integer-based number of shares. |
372374

373-
#### 3.1.1 Flags
375+
#### 3.1.2 Flags
374376

375377
| Flag Name | Flag Value | Description |
376378
| ----------------------------- | :----------: | :--------------------------------------------------------------------------------------- |
377379
| `tfVaultPrivate` | `0x00010000` | Indicates that the vault is private. It can only be set during Vault creation. |
378380
| `tfVaultShareNonTransferable` | `0x00020000` | Indicates the vault share is non-transferable. It can only be set during Vault creation. |
379381

380-
##### 3.1.2 WithdrawalPolicy
382+
##### 3.1.3 WithdrawalPolicy
381383

382384
The type indicates the withdrawal strategy supported by the vault. The following values are supported:
383385

384386
| Strategy Name | Value | Description |
385387
| ---------------------------------- | :------: | :-------------------------------------------------------: |
386388
| `vaultStrategyFirstComeFirstServe` | `0x0001` | Requests are processed on a first-come-first-serve basis. |
387389

388-
#### 3.1.3 Transaction Fees
390+
#### 3.1.4 Transaction Fees
389391

390392
The transaction creates an `AccountRoot` object for the `_pseudo-account_`. Therefore, the transaction [must destroy](../XLS-0064-pseudo-account/README.md) one incremental owner reserve amount.
391393

392-
#### 3.1.4 Failure Conditions
394+
#### 3.1.5 Failure Conditions
393395

394396
1. The `Asset` is `XRP`:
395397
1. The `Scale` parameter is provided.
@@ -409,7 +411,7 @@ The transaction creates an `AccountRoot` object for the `_pseudo-account_`. Ther
409411
6. The `Data` field is larger than 256 bytes.
410412
7. The account submiting the transaction has insufficient `AccountRoot.Balance` for the Owner Reserve.
411413

412-
#### 3.1.5 State Changes
414+
#### 3.1.6 State Changes
413415

414416
1. Create a new `Vault` ledger object.
415417
2. Create a new `MPTokenIssuance` ledger object for the vault shares.
@@ -423,7 +425,7 @@ The transaction creates an `AccountRoot` object for the `_pseudo-account_`. Ther
423425
5. If `Vault.Asset` is an `MPT`:
424426
1. Create `MPToken` object for the _pseudo-account_ for the `Asset.MPTokenIssuance`.
425427

426-
#### 3.1.6 Invariants
428+
#### 3.1.7 Invariants
427429

428430
**TBD**
429431

@@ -433,6 +435,8 @@ The transaction creates an `AccountRoot` object for the `_pseudo-account_`. Ther
433435

434436
The `VaultSet` updates an existing `Vault` ledger object.
435437

438+
#### 3.2.1 Fields
439+
436440
| Field Name | Required? | JSON Type | Internal Type | Default Value | Description |
437441
| ----------------- | :----------------: | :-------: | :-----------: | :-----------: | :-------------------------------------------------------------------------------------------------------------------------------------- |
438442
| `TransactionType` | :heavy_check_mark: | `string` | `Uint16` | `59` | The transaction type. |
@@ -441,7 +445,7 @@ The `VaultSet` updates an existing `Vault` ledger object.
441445
| `AssetsMaximum` | | `number` | `Number` | | The maximum asset amount that can be held in a vault. The value cannot be lower than the current `AssetsTotal` unless the value is `0`. |
442446
| `DomainID` | | `string` | `Hash256` | | The `PermissionedDomain` object ID associated with the shares of this Vault. |
443447

444-
#### 3.2.1 Failure Conditions
448+
#### 3.2.2 Failure Conditions
445449

446450
1. `Vault` object with the specified `VaultID` does not exist on the ledger.
447451
2. The submitting account is not the `Owner` of the vault.
@@ -453,13 +457,13 @@ The `VaultSet` updates an existing `Vault` ledger object.
453457
7. The transaction is attempting to modify an immutable field.
454458
8. The transaction does not specify any of the modifiable fields.
455459

456-
#### 3.2.2 State Changes
460+
#### 3.2.3 State Changes
457461

458462
1. Update mutable fields in the `Vault` ledger object.
459463
2. If `DomainID` is provided:
460464
1. Set `MPTokenIssuance(Vault.ShareMPTID).DomainID = DomainID` (Set the Permissioned Domain).
461465

462-
#### 3.2.3 Invariants
466+
#### 3.2.4 Invariants
463467

464468
**TBD**
465469

@@ -469,27 +473,29 @@ The `VaultSet` updates an existing `Vault` ledger object.
469473

470474
The `VaultDelete` transaction deletes an existing vault object.
471475

476+
#### 3.3.1 Fields
477+
472478
| Field Name | Required? | JSON Type | Internal Type | Default Value | Description |
473479
| ----------------- | :----------------: | :-------: | :-----------: | :-----------: | :--------------------------------: |
474480
| `TransactionType` | :heavy_check_mark: | `string` | `Uint16` | `60` | Transaction type. |
475481
| `VaultID` | :heavy_check_mark: | `string` | `Hash256` | `N/A` | The ID of the vault to be deleted. |
476482

477-
#### 3.3.1 Failure Conditions
483+
#### 3.3.2 Failure Conditions
478484

479485
1. `Vault` object with the `VaultID` does not exist on the ledger.
480486
2. The submitting account is not the `Owner` of the vault.
481487
3. `AssetsTotal`, `AssetsAvailable`, or `MPTokenIssuance(Vault.ShareMPTID).OutstandingAmount` are greater than zero.
482488
4. The `OwnerDirectory` of the Vault _pseudo-account_ contains pointers to objects other than the `Vault`, the `MPTokenIssuance` for its shares, or an `MPToken` or trust line for its asset.
483489

484-
#### 3.3.2 State Changes
490+
#### 3.3.3 State Changes
485491

486492
1. Delete the `MPTokenIssuance` object for the vault shares.
487493
2. Delete the `MPToken` or `RippleState` object corresponding to the vault's holding of the asset, if one exists.
488494
3. Delete the `AccountRoot` object of the _pseudo-account_, and its `DirectoryNode` objects.
489495
4. Release the Owner Reserve to the `Vault.Owner` account.
490496
5. Delete the `Vault` object.
491497

492-
#### 3.3.3 Invariants
498+
#### 3.3.4 Invariants
493499

494500
**TBD**
495501

@@ -499,13 +505,15 @@ The `VaultDelete` transaction deletes an existing vault object.
499505

500506
The `VaultDeposit` transaction adds Liqudity in exchange for vault shares.
501507

508+
#### 3.4.1 Fields
509+
502510
| Field Name | Required? | JSON Type | Internal Type | Default Value | Description |
503511
| ----------------- | :----------------: | :------------------: | :-----------: | :-----------: | :----------------------------------------------------- |
504512
| `TransactionType` | :heavy_check_mark: | `string` | `UINT16` | `61` | Transaction type. |
505513
| `VaultID` | :heavy_check_mark: | `string` | `HASH256` | `N/A` | The ID of the vault to which the assets are deposited. |
506514
| `Amount` | :heavy_check_mark: | `string` or `object` | `STAmount` | `N/A` | Asset amount to deposit. |
507515

508-
#### 3.4.1 Failure conditions
516+
#### 3.4.2 Failure conditions
509517

510518
1. `Vault` object with the `VaultID` does not exist on the ledger.
511519
2. The asset type of the vault does not match the asset type the depositor is depositing.
@@ -524,7 +532,7 @@ The `VaultDeposit` transaction adds Liqudity in exchange for vault shares.
524532
2. The `lsfHighFreeze` or `lsfLowFreeze` flag is set on the `RippleState` object between the Asset `Issuer` and the depositor.
525533
3. The `RippleState` object `Balance` < `Amount` (insufficient balance).
526534

527-
#### 3.4.2 State Changes
535+
#### 3.4.3 State Changes
528536

529537
1. If no `MPToken` object exists for the depositor, create one. For object details, see [2.1.6.2 `MPToken`](#2162-mptoken).
530538

@@ -544,7 +552,7 @@ The `VaultDeposit` transaction adds Liqudity in exchange for vault shares.
544552
1. Increase the `MPToken.MPTAmount` by `Amount` of the _pseudo-account_ `MPToken` object for the `Vault.Asset`.
545553
2. Decrease the `MPToken.MPTAmount` by `Amount` of the depositor `MPToken` object for the `Vault.Asset`.
546554

547-
#### 3.4.3 Invariants
555+
#### 3.4.4 Invariants
548556

549557
**TBD**
550558

@@ -554,6 +562,8 @@ The `VaultDeposit` transaction adds Liqudity in exchange for vault shares.
554562

555563
The `VaultWithdraw` transaction withdraws assets in exchange for the vault's shares.
556564

565+
#### 3.5.1 Fields
566+
557567
| Field Name | Required? | JSON Type | Internal Type | Default Value | Description |
558568
| ----------------- | :----------------: | :-------: | :-----------: | :-----------: | :-------------------------------------------------------------------------- |
559569
| `TransactionType` | :heavy_check_mark: | `string` | `UINT16` | `62` | Transaction type. |
@@ -573,7 +583,7 @@ In sections below assume the following variables:
573583
- $\Delta_{asset}$ - the change in the total amount of assets after a deposit, withdrawal, or redemption.
574584
- $\Delta_{share}$ - che change in the total amount of shares after a deposit, withdrawal, or redemption.
575585

576-
#### 3.5.1 Failure conditions
586+
#### 3.5.2 Failure conditions
577587

578588
1. `Vault` object with the `VaultID` does not exist on the ledger.
579589

@@ -603,7 +613,7 @@ In sections below assume the following variables:
603613
1. The account does not have permission to receive the asset.
604614
2. The account does not have a `RippleState` or `MPToken` object for the asset.
605615

606-
#### 3.5.2 State Changes
616+
#### 3.5.3 State Changes
607617

608618
1. If the `Vault.Asset` is XRP:
609619
1. Decrease the `Balance` field of _pseudo-account_ `AccountRoot` by $\Delta_{asset}$.
@@ -628,26 +638,26 @@ In sections below assume the following variables:
628638

629639
6. Decrease the `AssetsTotal` and `AssetsAvailable` by $\Delta_{asset}$
630640

631-
#### 3.5.3 Invariants
641+
#### 3.5.4 Invariants
632642

633643
**TBD**
634644

635645
[**Return to Index**](#index)
636646

637647
### 3.6 VaultClawback Transaction
638648

639-
#### 3.6.1 `VaultClawback` Transaction
640-
641649
The `VaultClawback` transaction performs a Clawback from the Vault, exchanging the shares of an account. Conceptually, the transaction performs `VaultWithdraw` on behalf of the `Holder`, sending the funds to the `Issuer` account of the asset. In case there are insufficient funds for the entire `Amount` the transaction will perform a partial Clawback, up to the `Vault.AssetsAvailable`. The Clawback transaction must respect any future fees or penalties.
642650

651+
#### 3.6.1 Fields
652+
643653
| Field Name | Required? | JSON Type | Internal Type | Default Value | Description |
644654
| ----------------- | :----------------: | :-------: | :-----------: | :-----------: | :------------------------------------------------------------------------------------------------------------- |
645655
| `TransactionType` | :heavy_check_mark: | `string` | `UINT16` | `63` | Transaction type. |
646656
| `VaultID` | :heavy_check_mark: | `string` | `HASH256` | `N/A` | The ID of the vault from which assets are withdrawn. |
647657
| `Holder` | :heavy_check_mark: | `string` | `AccountID` | `N/A` | The account ID from which to clawback the assets. |
648658
| `Amount` | | `number` | `NUMBER` | 0 | The asset amount to clawback. When Amount is `0` clawback all funds, up to the total shares the `Holder` owns. |
649659

650-
##### 3.6.1.1 Failure conditions
660+
#### 3.6.2 Failure conditions
651661

652662
1. `Vault` object with the `VaultID` does not exist on the ledger.
653663

@@ -665,7 +675,7 @@ The `VaultClawback` transaction performs a Clawback from the Vault, exchanging t
665675

666676
5. The `MPToken` object for the `Vault.ShareMPTID` of the `Holder` `AccountRoot` does not exist OR `MPToken.MPTAmount == 0`.
667677

668-
##### 3.6.1.2 State Changes
678+
#### 3.6.3 State Changes
669679

670680
1. If the `Vault.Asset` is an `IOU`:
671681
1. Decrease the `RippleState` balance between the _pseudo-account_ `AccountRoot` and the `Issuer` `AccountRoot` by `min(Vault.AssetsAvailable`, $\Delta_{asset}$`)`.
@@ -682,19 +692,17 @@ The `VaultClawback` transaction performs a Clawback from the Vault, exchanging t
682692

683693
5. Decrease the `AssetsTotal` and `AssetsAvailable` by `min(Vault.AssetsAvailable`, $\Delta_{asset}$`)`
684694

685-
##### 3.6.1.3 Invariants
695+
#### 3.6.4 Invariants
686696

687697
**TBD**
688698

689699
[**Return to Index**](#index)
690700

691701
### 3.7 Payment Transaction
692702

693-
#### 3.7.1 `Payment` transaction
694-
695703
The Single Asset Vault does not introduce new `Payment` transaction fields. However, it adds additional failure conditions and state changes when transfering Vault shares.
696704

697-
##### 3.7.1.1 Failure Conditions
705+
#### 3.7.1 Failure Conditions
698706

699707
1. If `Payment.Amount` is a `Vault` share AND:
700708
1. The `Vault` `lsfVaultPrivate` flag is set and the `Payment.Destination` account does not have credentials in the permissioned domain of the Vaults Share.
@@ -713,7 +721,7 @@ The Single Asset Vault does not introduce new `Payment` transaction fields. Howe
713721
3. The `lsfHighFreeze` or `lsfLowFreeze` flag is set on the `RippleState` object between the Asset `Issuer` and the destination account.
714722
4. The `lsfHighFreeze` or `lsfLowFreeze` flag is set on the `RippleState` object between the Asset `Issuer` and the `pseudo-account`.
715723

716-
##### 3.7.1.2 State Changes
724+
#### 3.7.2 State Changes
717725

718726
1. If `MPToken`object for shares does not exist for the destination account, create one.
719727

0 commit comments

Comments
 (0)