Merge remote-tracking branch 'origin/tapanito/vault-block-deposit' into ripple/lending-protocol-fv

This commit is contained in:
Vito
2026-09-02 11:05:29 +02:00
13 changed files with 412 additions and 17 deletions

View File

@@ -171,6 +171,18 @@ sharesToAssetsWithdraw(
[[nodiscard]] bool
isSoleShareholder(ReadView const& view, AccountID const& account, SLE::const_ref issuance);
/**
* Determine if a vault is insolvent. A vault is considered insolvent when
* the total assets in the vault are zero, and outstanding shares are non-zero.
*
* @param vault The vault SLE.
* @param shareIssuance The MPTokenIssuance SLE for the vault's shares.
*
* @return True if the vault is insolvent, false otherwise.
*/
[[nodiscard]] bool
isVaultInsolvent(SLE::const_ref vault, SLE::const_ref shareIssuance);
/**
* Resolves a Vault's LEVersion, the single point every accounting touch
* point should call to determine which recognition model (accrual vs.

View File

@@ -199,7 +199,9 @@ enum LedgerEntryType : std::uint16_t {
LSF_FLAG(lsfAccepted, 0x00010000)) \
\
LEDGER_OBJECT(Vault, \
LSF_FLAG(lsfVaultPrivate, 0x00010000)) \
LSF_FLAG(lsfVaultPrivate, 0x00010000) \
LSF_FLAG(lsfVaultDepositBlocked, 0x00020000) /* True, vault deposit is blocked */ \
LSF_FLAG(lsfVaultOwnerCanBlockDeposit, 0x00040000)) /* True, vault owner can block deposit */ \
\
LEDGER_OBJECT(Loan, \
LSF_FLAG(lsfLoanDefault, 0x00010000) \

View File

@@ -195,7 +195,13 @@ inline constexpr FlagValue tfUniversalMask = ~tfUniversal;
\
TRANSACTION(VaultCreate, \
TF_FLAG(tfVaultPrivate, lsfVaultPrivate) \
TF_FLAG(tfVaultShareNonTransferable, 0x00020000), \
TF_FLAG(tfVaultShareNonTransferable, 0x00020000) \
TF_FLAG(tfVaultOwnerCanBlockDeposit, lsfVaultOwnerCanBlockDeposit), \
MASK_ADJ(0)) \
\
TRANSACTION(VaultSet, \
TF_FLAG(tfVaultDepositBlock, 0x00010000) \
TF_FLAG(tfVaultDepositUnblock, 0x00020000), \
MASK_ADJ(0)) \
\
TRANSACTION(VaultDeposit, \
@@ -243,7 +249,6 @@ inline constexpr FlagValue tfUniversalMask = ~tfUniversal;
TF_FLAG(tfSponsorshipCreate, 0x00020000) \
TF_FLAG(tfSponsorshipReassign, 0x00040000), \
MASK_ADJ(0))
// clang-format on
// Create all the flag values.

View File

@@ -20,6 +20,9 @@ public:
{
}
static std::uint32_t
getFlagsMask(PreflightContext const& ctx);
static bool
checkExtraFeatures(PreflightContext const& ctx);