mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 02:55:50 +00:00
Add Scale to SingleAssetVault (#5652)
* Add and Scale to VaultCreate * Add round-trip calculation to VaultDeposit VaultWithdraw and VaultClawback * Implement Number::truncate() for VaultClawback * Add rounding to DepositWithdraw * Disallow zero shares withdraw or deposit with tecPRECISION_LOSS * Return tecPATH_DRY on overflow when converting shares/assets * Remove empty shares MPToken in clawback or withdraw (except for vault owner) * Implicitly create shares MPToken for vault owner in VaultCreate * Review feedback: defensive checks in shares/assets calculations --------- Co-authored-by: Ed Hennis <ed@ripple.com>
This commit is contained in:
@@ -499,6 +499,7 @@ LEDGER_ENTRY(ltVAULT, 0x0084, Vault, vault, ({
|
||||
{sfLossUnrealized, soeREQUIRED},
|
||||
{sfShareMPTID, soeREQUIRED},
|
||||
{sfWithdrawalPolicy, soeREQUIRED},
|
||||
{sfScale, soeDEFAULT},
|
||||
// no SharesTotal ever (use MPTIssuance.sfOutstandingAmount)
|
||||
// no PermissionedDomainID ever (use MPTIssuance.sfDomainID)
|
||||
}))
|
||||
|
||||
@@ -483,6 +483,7 @@ TRANSACTION(ttVAULT_CREATE, 65, VaultCreate, Delegation::delegatable, ({
|
||||
{sfDomainID, soeOPTIONAL},
|
||||
{sfWithdrawalPolicy, soeOPTIONAL},
|
||||
{sfData, soeOPTIONAL},
|
||||
{sfScale, soeOPTIONAL},
|
||||
}))
|
||||
|
||||
/** This transaction updates a single asset vault. */
|
||||
|
||||
Reference in New Issue
Block a user