diff --git a/AMMBid_8cpp_source.html b/AMMBid_8cpp_source.html index a1cd69812d..efad45a434 100644 --- a/AMMBid_8cpp_source.html +++ b/AMMBid_8cpp_source.html @@ -508,7 +508,7 @@ $(function() {
ripple::TOTAL_TIME_SLOT_SECS
std::uint32_t constexpr TOTAL_TIME_SLOT_SECS
Definition: AMMCore.h:34
ripple::AUCTION_SLOT_TIME_INTERVALS
std::uint16_t constexpr AUCTION_SLOT_TIME_INTERVALS
Definition: AMMCore.h:35
ripple::ammAuctionTimeSlot
std::optional< std::uint8_t > ammAuctionTimeSlot(std::uint64_t current, STObject const &auctionSlot)
Get time slot of the auction slot.
Definition: AMMCore.cpp:108
-
ripple::redeemIOU
TER redeemIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
Definition: View.cpp:2185
+
ripple::redeemIOU
TER redeemIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
Definition: View.cpp:2288
ripple::toSTAmount
STAmount toSTAmount(IOUAmount const &iou, Issue const &iss)
Definition: AmountConversions.h:32
ripple::ammEnabled
bool ammEnabled(Rules const &)
Return true if required AMM amendments are enabled.
Definition: AMMCore.cpp:129
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
@@ -533,7 +533,7 @@ $(function() {
ripple::terNO_AMM
@ terNO_AMM
Definition: TER.h:227
ripple::TER
TERSubset< CanCvtToTER > TER
Definition: TER.h:645
ripple::AUCTION_SLOT_MAX_AUTH_ACCOUNTS
std::uint16_t constexpr AUCTION_SLOT_MAX_AUTH_ACCOUNTS
Definition: AMMCore.h:36
-
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2011
+
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2114
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
ripple::AUCTION_SLOT_DISCOUNTED_FEE_FRACTION
std::uint32_t constexpr AUCTION_SLOT_DISCOUNTED_FEE_FRACTION
Definition: AMMCore.h:38
ripple::temMALFORMED
@ temMALFORMED
Definition: TER.h:87
diff --git a/AMMClawback_8cpp_source.html b/AMMClawback_8cpp_source.html index a99fcb7e08..12771e9f55 100644 --- a/AMMClawback_8cpp_source.html +++ b/AMMClawback_8cpp_source.html @@ -482,7 +482,7 @@ $(function() {
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
ripple::ammHolds
Expected< std::tuple< STAmount, STAmount, STAmount >, TER > ammHolds(ReadView const &view, SLE const &ammSle, std::optional< Issue > const &optIssue1, std::optional< Issue > const &optIssue2, FreezeHandling freezeHandling, beast::Journal const j)
Get AMM pool and LP token balances.
Definition: AMMUtils.cpp:47
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
-
ripple::rippleCredit
TER rippleCredit(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Calls static rippleCreditIOU if saAmount represents Issue.
Definition: View.cpp:2669
+
ripple::rippleCredit
TER rippleCredit(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Calls static rippleCreditIOU if saAmount represents Issue.
Definition: View.cpp:2769
ripple::terNO_ACCOUNT
@ terNO_ACCOUNT
Definition: TER.h:217
ripple::terNO_AMM
@ terNO_AMM
Definition: TER.h:227
ripple::getRoundedAsset
STAmount getRoundedAsset(Rules const &rules, STAmount const &balance, A const &frac, IsDeposit isDeposit)
Round AMM equal deposit/withdrawal amount.
Definition: AMMHelpers.h:678
diff --git a/AMMCreate_8cpp_source.html b/AMMCreate_8cpp_source.html index bf9d748c93..d13e53f8cd 100644 --- a/AMMCreate_8cpp_source.html +++ b/AMMCreate_8cpp_source.html @@ -483,9 +483,9 @@ $(function() {
ripple::keylet::book
static book_t const book
Definition: Indexes.h:105
ripple::keylet::account
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition: Indexes.cpp:184
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::createPseudoAccount
Expected< std::shared_ptr< SLE >, TER > createPseudoAccount(ApplyView &view, uint256 const &pseudoOwnerKey, SField const &ownerField)
Create pseudo-account, storing pseudoOwnerKey into ownerField.
Definition: View.cpp:1095
+
ripple::createPseudoAccount
Expected< std::shared_ptr< SLE >, TER > createPseudoAccount(ApplyView &view, uint256 const &pseudoOwnerKey, SField const &ownerField)
Create pseudo-account, storing pseudoOwnerKey into ownerField.
Definition: View.cpp:1094
ripple::invalidAMMAmount
NotTEC invalidAMMAmount(STAmount const &amount, std::optional< std::pair< Issue, Issue > > const &pair=std::nullopt, bool validZero=false)
Validate the amount.
Definition: AMMCore.cpp:95
-
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2301
+
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2404
ripple::fhZERO_IF_FROZEN
@ fhZERO_IF_FROZEN
Definition: View.h:78
ripple::isXRP
bool isXRP(AccountID const &c)
Definition: AccountID.h:90
ripple::lsfDefaultRipple
@ lsfDefaultRipple
Definition: LedgerFormats.h:134
@@ -494,7 +494,7 @@ $(function() {
ripple::ammEnabled
bool ammEnabled(Rules const &)
Return true if required AMM amendments are enabled.
Definition: AMMCore.cpp:129
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::ammLPTIssue
Issue ammLPTIssue(Currency const &cur1, Currency const &cur2, AccountID const &ammAccountID)
Calculate LPT Issue from AMM asset pair.
Definition: AMMCore.cpp:57
-
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:249
+
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:248
ripple::getRate
std::uint64_t getRate(STAmount const &offerOut, STAmount const &offerIn)
Definition: STAmount.cpp:486
ripple::initializeFeeAuctionVote
void initializeFeeAuctionVote(ApplyView &view, std::shared_ptr< SLE > &ammSle, AccountID const &account, Issue const &lptIssue, std::uint16_t tfee)
Initialize Auction and Voting slots and set the trading/discounted fee.
Definition: AMMUtils.cpp:340
ripple::preflight2
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
Definition: Transactor.cpp:160
@@ -508,8 +508,8 @@ $(function() {
ripple::tecUNFUNDED_AMM
@ tecUNFUNDED_AMM
Definition: TER.h:328
ripple::tecAMM_INVALID_TOKENS
@ tecAMM_INVALID_TOKENS
Definition: TER.h:331
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
-
ripple::pseudoAccountAddress
AccountID pseudoAccountAddress(ReadView const &view, uint256 const &pseudoOwnerKey)
Definition: View.cpp:1068
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
+
ripple::pseudoAccountAddress
AccountID pseudoAccountAddress(ReadView const &view, uint256 const &pseudoOwnerKey)
Definition: View.cpp:1067
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
ripple::ammLPTokens
STAmount ammLPTokens(STAmount const &asset1, STAmount const &asset2, Issue const &lptIssue)
Calculate LP Tokens given AMM pool reserves.
Definition: AMMHelpers.cpp:25
ripple::tfUniversalMask
constexpr std::uint32_t tfUniversalMask
Definition: TxFlags.h:63
@@ -517,10 +517,10 @@ $(function() {
ripple::terNO_RIPPLE
@ terNO_RIPPLE
Definition: TER.h:224
ripple::TER
TERSubset< CanCvtToTER > TER
Definition: TER.h:645
ripple::TRADING_FEE_THRESHOLD
std::uint16_t constexpr TRADING_FEE_THRESHOLD
Definition: AMMCore.h:31
-
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2011
+
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2114
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
-
ripple::dirLink
TER dirLink(ApplyView &view, AccountID const &owner, std::shared_ptr< SLE > &object)
Definition: View.cpp:1057
-
ripple::xrpLiquid
XRPAmount xrpLiquid(ReadView const &view, AccountID const &id, std::int32_t ownerCountAdj, beast::Journal j)
Definition: View.cpp:617
+
ripple::dirLink
TER dirLink(ApplyView &view, AccountID const &owner, std::shared_ptr< SLE > &object)
Definition: View.cpp:1056
+
ripple::xrpLiquid
XRPAmount xrpLiquid(ReadView const &view, AccountID const &id, std::int32_t ownerCountAdj, beast::Journal j)
Definition: View.cpp:616
ripple::temBAD_FEE
@ temBAD_FEE
Definition: TER.h:92
ripple::temBAD_AMM_TOKENS
@ temBAD_AMM_TOKENS
Definition: TER.h:129
ripple::temINVALID_FLAG
@ temINVALID_FLAG
Definition: TER.h:111
diff --git a/AMMDeposit_8cpp_source.html b/AMMDeposit_8cpp_source.html index 5f538a36c2..8d7a6fb47e 100644 --- a/AMMDeposit_8cpp_source.html +++ b/AMMDeposit_8cpp_source.html @@ -1081,11 +1081,11 @@ $(function() {
ripple::invalidAMMAmount
NotTEC invalidAMMAmount(STAmount const &amount, std::optional< std::pair< Issue, Issue > > const &pair=std::nullopt, bool validZero=false)
Validate the amount.
Definition: AMMCore.cpp:95
ripple::divide
STAmount divide(STAmount const &amount, Rate const &rate)
Definition: Rate2.cpp:93
ripple::adjustAssetInByTokens
std::pair< STAmount, STAmount > adjustAssetInByTokens(Rules const &rules, STAmount const &balance, STAmount const &amount, STAmount const &lptAMMBalance, STAmount const &tokens, std::uint16_t tfee)
Definition: AMMHelpers.cpp:349
-
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2301
+
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2404
ripple::fhZERO_IF_FROZEN
@ fhZERO_IF_FROZEN
Definition: View.h:78
ripple::fhIGNORE_FREEZE
@ fhIGNORE_FREEZE
Definition: View.h:78
ripple::isXRP
bool isXRP(AccountID const &c)
Definition: AccountID.h:90
-
ripple::isIndividualFrozen
bool isIndividualFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:215
+
ripple::isIndividualFrozen
bool isIndividualFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:214
ripple::getTradingFee
std::uint16_t getTradingFee(ReadView const &view, SLE const &ammSle, AccountID const &account)
Get AMM trading fee for the given account.
Definition: AMMUtils.cpp:179
ripple::solveQuadraticEq
Number solveQuadraticEq(Number const &a, Number const &b, Number const &c)
Positive solution for quadratic equation: x = (-b + sqrt(b**2 + 4*a*c))/(2*a)
Definition: AMMHelpers.cpp:264
ripple::tfLimitLPToken
constexpr std::uint32_t tfLimitLPToken
Definition: TxFlags.h:214
@@ -1094,7 +1094,7 @@ $(function() {
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::tfOneAssetLPToken
constexpr std::uint32_t tfOneAssetLPToken
Definition: TxFlags.h:213
ripple::getRoundedLPTokens
STAmount getRoundedLPTokens(Rules const &rules, STAmount const &balance, Number const &frac, IsDeposit isDeposit)
Round AMM deposit/withdrawal LPToken amount.
Definition: AMMHelpers.cpp:311
-
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:249
+
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:248
ripple::adjustLPTokens
STAmount adjustLPTokens(STAmount const &lptAMMBalance, STAmount const &lpTokens, IsDeposit isDeposit)
Adjust LP tokens to deposit/withdraw.
Definition: AMMHelpers.cpp:173
ripple::feeMult
Number feeMult(std::uint16_t tfee)
Get fee multiplier (1 - tfee) @tfee trading fee in basis points.
Definition: AMMCore.h:110
ripple::initializeFeeAuctionVote
void initializeFeeAuctionVote(ApplyView &view, std::shared_ptr< SLE > &ammSle, AccountID const &account, Issue const &lptIssue, std::uint16_t tfee)
Initialize Auction and Voting slots and set the trading/discounted fee.
Definition: AMMUtils.cpp:340
@@ -1117,7 +1117,7 @@ $(function() {
ripple::IsDeposit::Yes
@ Yes
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
ripple::invalidAMMAssetPair
NotTEC invalidAMMAssetPair(Issue const &issue1, Issue const &issue2, std::optional< std::pair< Issue, Issue > > const &pair=std::nullopt)
Definition: AMMCore.cpp:80
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
ripple::tfDepositMask
constexpr std::uint32_t tfDepositMask
Definition: TxFlags.h:223
ripple::ammHolds
Expected< std::tuple< STAmount, STAmount, STAmount >, TER > ammHolds(ReadView const &view, SLE const &ammSle, std::optional< Issue > const &optIssue1, std::optional< Issue > const &optIssue2, FreezeHandling freezeHandling, beast::Journal const j)
Get AMM pool and LP token balances.
Definition: AMMUtils.cpp:47
@@ -1131,9 +1131,9 @@ $(function() {
ripple::TRADING_FEE_THRESHOLD
std::uint16_t constexpr TRADING_FEE_THRESHOLD
Definition: AMMCore.h:31
ripple::getRoundedAsset
STAmount getRoundedAsset(Rules const &rules, STAmount const &balance, A const &frac, IsDeposit isDeposit)
Round AMM equal deposit/withdrawal amount.
Definition: AMMHelpers.h:678
ripple::adjustFracByTokens
Number adjustFracByTokens(Rules const &rules, STAmount const &lptAMMBalance, STAmount const &tokens, Number const &frac)
Find a fraction of tokens after the tokens are adjusted.
Definition: AMMHelpers.cpp:401
-
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2011
+
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2114
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
-
ripple::xrpLiquid
XRPAmount xrpLiquid(ReadView const &view, AccountID const &id, std::int32_t ownerCountAdj, beast::Journal j)
Definition: View.cpp:617
+
ripple::xrpLiquid
XRPAmount xrpLiquid(ReadView const &view, AccountID const &id, std::int32_t ownerCountAdj, beast::Journal j)
Definition: View.cpp:616
ripple::temBAD_AMOUNT
@ temBAD_AMOUNT
Definition: TER.h:89
ripple::temBAD_FEE
@ temBAD_FEE
Definition: TER.h:92
ripple::temMALFORMED
@ temMALFORMED
Definition: TER.h:87
diff --git a/AMMExtended__test_8cpp_source.html b/AMMExtended__test_8cpp_source.html index 071212b411..63764b3355 100644 --- a/AMMExtended__test_8cpp_source.html +++ b/AMMExtended__test_8cpp_source.html @@ -4088,7 +4088,7 @@ $(function() {
ripple::flow
StrandResult< TInAmt, TOutAmt > flow(PaymentSandbox const &baseView, Strand const &strand, std::optional< TInAmt > const &maxIn, TOutAmt const &out, beast::Journal j)
Request out amount from a strand.
Definition: StrandFlow.h:105
ripple::tfPassive
constexpr std::uint32_t tfPassive
Definition: TxFlags.h:98
ripple::tfImmediateOrCancel
constexpr std::uint32_t tfImmediateOrCancel
Definition: TxFlags.h:99
-
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1471
+
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1574
ripple::asfDisableMaster
constexpr std::uint32_t asfDisableMaster
Definition: TxFlags.h:80
ripple::no
@ no
Definition: Steps.h:45
ripple::tfPartialPayment
constexpr std::uint32_t tfPartialPayment
Definition: TxFlags.h:108
diff --git a/AMMInfo_8cpp_source.html b/AMMInfo_8cpp_source.html index 9c58fccc7f..22ec24c12e 100644 --- a/AMMInfo_8cpp_source.html +++ b/AMMInfo_8cpp_source.html @@ -382,7 +382,7 @@ $(function() {
ripple::getIssue
Issue getIssue(T const &amt)
Definition: AmountConversions.h:186
ripple::getAccount
std::optional< AccountID > getAccount(Json::Value const &v, Json::Value &result)
Definition: AMMInfo.cpp:35
ripple::doAMMInfo
Json::Value doAMMInfo(RPC::JsonContext &context)
Definition: AMMInfo.cpp:76
-
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:249
+
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:248
ripple::ammLPHolds
STAmount ammLPHolds(ReadView const &view, Currency const &cur1, Currency const &cur2, AccountID const &ammAccount, AccountID const &lpAccount, beast::Journal const j)
Get the balance of LP tokens.
Definition: AMMUtils.cpp:113
ripple::issueFromJson
Issue issueFromJson(Json::Value const &v)
Definition: Issue.cpp:95
ripple::ammPoolHolds
std::pair< STAmount, STAmount > ammPoolHolds(ReadView const &view, AccountID const &ammAccountID, Issue const &issue1, Issue const &issue2, FreezeHandling freezeHandling, beast::Journal const j)
Get AMM pool balances.
Definition: AMMUtils.cpp:31
diff --git a/AMMOffer_8h_source.html b/AMMOffer_8h_source.html index 0d7f075f37..9b0a045294 100644 --- a/AMMOffer_8h_source.html +++ b/AMMOffer_8h_source.html @@ -241,7 +241,7 @@ $(function() {
std::uint32_t
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::WaiveTransferFee::Yes
@ Yes
-
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2011
+
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2114
std::optional
std::pair
diff --git a/AMMUtils_8cpp_source.html b/AMMUtils_8cpp_source.html index 6f051f7eab..95d71faaf6 100644 --- a/AMMUtils_8cpp_source.html +++ b/AMMUtils_8cpp_source.html @@ -630,7 +630,7 @@ $(function() {
ripple::FreezeHandling
FreezeHandling
Controls the treatment of frozen account balances.
Definition: View.h:78
ripple::TOTAL_TIME_SLOT_SECS
std::uint32_t constexpr TOTAL_TIME_SLOT_SECS
Definition: AMMCore.h:34
ripple::isXRP
bool isXRP(AccountID const &c)
Definition: AccountID.h:90
-
ripple::deleteAMMTrustLine
TER deleteAMMTrustLine(ApplyView &view, std::shared_ptr< SLE > sleState, std::optional< AccountID > const &ammAccountID, beast::Journal j)
Delete trustline to AMM.
Definition: View.cpp:2620
+
ripple::deleteAMMTrustLine
TER deleteAMMTrustLine(ApplyView &view, std::shared_ptr< SLE > sleState, std::optional< AccountID > const &ammAccountID, beast::Journal j)
Delete trustline to AMM.
Definition: View.cpp:2720
ripple::ammLPTCurrency
Currency ammLPTCurrency(Currency const &cur1, Currency const &cur2)
Calculate Liquidity Provider Token (LPT) Currency.
Definition: AMMCore.cpp:43
ripple::getTradingFee
std::uint16_t getTradingFee(ReadView const &view, SLE const &ammSle, AccountID const &account)
Get AMM trading fee for the given account.
Definition: AMMUtils.cpp:179
ripple::deleteAMMAccount
TER deleteAMMAccount(Sandbox &view, Issue const &asset, Issue const &asset2, beast::Journal j)
Delete trustlines to AMM.
Definition: AMMUtils.cpp:283
@@ -638,7 +638,7 @@ $(function() {
ripple::SkipEntry::No
@ No
ripple::isOnlyLiquidityProvider
Expected< bool, TER > isOnlyLiquidityProvider(ReadView const &view, Issue const &ammIssue, AccountID const &lpAccount)
Return true if the Liquidity Provider is the only AMM provider, false otherwise.
Definition: AMMUtils.cpp:387
ripple::verifyAndAdjustLPTokenBalance
Expected< bool, TER > verifyAndAdjustLPTokenBalance(Sandbox &sb, STAmount const &lpTokens, std::shared_ptr< SLE > &ammSle, AccountID const &account)
Due to rounding, the LPTokenBalance of the last LP might not match the LP's trustline balance.
Definition: AMMUtils.cpp:469
-
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:249
+
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:248
ripple::initializeFeeAuctionVote
void initializeFeeAuctionVote(ApplyView &view, std::shared_ptr< SLE > &ammSle, AccountID const &account, Issue const &lptIssue, std::uint16_t tfee)
Initialize Auction and Voting slots and set the trading/discounted fee.
Definition: AMMUtils.cpp:340
ripple::ammLPHolds
STAmount ammLPHolds(ReadView const &view, Currency const &cur1, Currency const &cur2, AccountID const &ammAccount, AccountID const &lpAccount, beast::Journal const j)
Get the balance of LP tokens.
Definition: AMMUtils.cpp:113
ripple::ammPoolHolds
std::pair< STAmount, STAmount > ammPoolHolds(ReadView const &view, AccountID const &ammAccountID, Issue const &issue1, Issue const &issue2, FreezeHandling freezeHandling, beast::Journal const j)
Get AMM pool balances.
Definition: AMMUtils.cpp:31
@@ -649,11 +649,11 @@ $(function() {
ripple::VOTE_WEIGHT_SCALE_FACTOR
std::uint32_t constexpr VOTE_WEIGHT_SCALE_FACTOR
Definition: AMMCore.h:45
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
ripple::invalidAMMAssetPair
NotTEC invalidAMMAssetPair(Issue const &issue1, Issue const &issue2, std::optional< std::pair< Issue, Issue > > const &pair=std::nullopt)
Definition: AMMCore.cpp:80
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
ripple::ammHolds
Expected< std::tuple< STAmount, STAmount, STAmount >, TER > ammHolds(ReadView const &view, SLE const &ammSle, std::optional< Issue > const &optIssue1, std::optional< Issue > const &optIssue2, FreezeHandling freezeHandling, beast::Journal const j)
Get AMM pool and LP token balances.
Definition: AMMUtils.cpp:47
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::LedgerEntryType
LedgerEntryType
Identifiers for on-ledger objects.
Definition: LedgerFormats.h:54
-
ripple::cleanupOnAccountDelete
TER cleanupOnAccountDelete(ApplyView &view, Keylet const &ownerDirKeylet, EntryDeleter const &deleter, beast::Journal j, std::optional< uint16_t > maxNodesToDelete)
Definition: View.cpp:2542
+
ripple::cleanupOnAccountDelete
TER cleanupOnAccountDelete(ApplyView &view, Keylet const &ownerDirKeylet, EntryDeleter const &deleter, beast::Journal j, std::optional< uint16_t > maxNodesToDelete)
Definition: View.cpp:2642
ripple::ammAccountHolds
STAmount ammAccountHolds(ReadView const &view, AccountID const &ammAccountID, Issue const &issue)
Returns total amount held by AMM for the given token.
Definition: AMMUtils.cpp:211
ripple::root
Number root(Number f, unsigned d)
Definition: Number.cpp:636
ripple::maxDeletableAMMTrustLines
std::uint16_t constexpr maxDeletableAMMTrustLines
The maximum number of trustlines to delete as part of AMM account deletion cleanup.
Definition: Protocol.h:141
diff --git a/AMMWithdraw_8cpp_source.html b/AMMWithdraw_8cpp_source.html index 9ded39858e..cac19096d9 100644 --- a/AMMWithdraw_8cpp_source.html +++ b/AMMWithdraw_8cpp_source.html @@ -1180,17 +1180,17 @@ $(function() {
ripple::WithdrawAll
WithdrawAll
AMMWithdraw implements AMM withdraw Transactor.
Definition: AMMWithdraw.h:67
ripple::WithdrawAll::Yes
@ Yes
ripple::WithdrawAll::No
@ No
-
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2301
+
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2404
ripple::FreezeHandling
FreezeHandling
Controls the treatment of frozen account balances.
Definition: View.h:78
ripple::fhZERO_IF_FROZEN
@ fhZERO_IF_FROZEN
Definition: View.h:78
ripple::fhIGNORE_FREEZE
@ fhIGNORE_FREEZE
Definition: View.h:78
ripple::isXRP
bool isXRP(AccountID const &c)
Definition: AccountID.h:90
-
ripple::isIndividualFrozen
bool isIndividualFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:215
+
ripple::isIndividualFrozen
bool isIndividualFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:214
ripple::getTradingFee
std::uint16_t getTradingFee(ReadView const &view, SLE const &ammSle, AccountID const &account)
Get AMM trading fee for the given account.
Definition: AMMUtils.cpp:179
ripple::tfWithdrawMask
constexpr std::uint32_t tfWithdrawMask
Definition: TxFlags.h:222
ripple::deleteAMMAccount
TER deleteAMMAccount(Sandbox &view, Issue const &asset, Issue const &asset2, beast::Journal j)
Delete trustlines to AMM.
Definition: AMMUtils.cpp:283
ripple::adjustAssetOutByTokens
std::pair< STAmount, STAmount > adjustAssetOutByTokens(Rules const &rules, STAmount const &balance, STAmount const &amount, STAmount const &lptAMMBalance, STAmount const &tokens, std::uint16_t tfee)
Definition: AMMHelpers.cpp:375
-
ripple::redeemIOU
TER redeemIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
Definition: View.cpp:2185
+
ripple::redeemIOU
TER redeemIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
Definition: View.cpp:2288
ripple::tfLimitLPToken
constexpr std::uint32_t tfLimitLPToken
Definition: TxFlags.h:214
ripple::ammEnabled
bool ammEnabled(Rules const &)
Return true if required AMM amendments are enabled.
Definition: AMMCore.cpp:129
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
@@ -1198,7 +1198,7 @@ $(function() {
ripple::getRoundedLPTokens
STAmount getRoundedLPTokens(Rules const &rules, STAmount const &balance, Number const &frac, IsDeposit isDeposit)
Round AMM deposit/withdrawal LPToken amount.
Definition: AMMHelpers.cpp:311
ripple::tokensWithdraw
static std::optional< STAmount > tokensWithdraw(STAmount const &lpTokens, std::optional< STAmount > const &tokensIn, std::uint32_t flags)
Definition: AMMWithdraw.cpp:157
ripple::verifyAndAdjustLPTokenBalance
Expected< bool, TER > verifyAndAdjustLPTokenBalance(Sandbox &sb, STAmount const &lpTokens, std::shared_ptr< SLE > &ammSle, AccountID const &account)
Due to rounding, the LPTokenBalance of the last LP might not match the LP's trustline balance.
Definition: AMMUtils.cpp:469
-
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:249
+
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:248
ripple::adjustLPTokens
STAmount adjustLPTokens(STAmount const &lptAMMBalance, STAmount const &lpTokens, IsDeposit isDeposit)
Adjust LP tokens to deposit/withdraw.
Definition: AMMHelpers.cpp:173
ripple::tfTwoAsset
constexpr std::uint32_t tfTwoAsset
Definition: TxFlags.h:212
ripple::ammLPHolds
STAmount ammLPHolds(ReadView const &view, Currency const &cur1, Currency const &cur2, AccountID const &ammAccount, AccountID const &lpAccount, beast::Journal const j)
Get the balance of LP tokens.
Definition: AMMUtils.cpp:113
@@ -1231,7 +1231,7 @@ $(function() {
ripple::TER
TERSubset< CanCvtToTER > TER
Definition: TER.h:645
ripple::getRoundedAsset
STAmount getRoundedAsset(Rules const &rules, STAmount const &balance, A const &frac, IsDeposit isDeposit)
Round AMM equal deposit/withdrawal amount.
Definition: AMMHelpers.h:678
ripple::adjustFracByTokens
Number adjustFracByTokens(Rules const &rules, STAmount const &lptAMMBalance, STAmount const &tokens, Number const &frac)
Find a fraction of tokens after the tokens are adjusted.
Definition: AMMHelpers.cpp:401
-
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2011
+
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2114
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
ripple::temMALFORMED
@ temMALFORMED
Definition: TER.h:87
ripple::temBAD_AMM_TOKENS
@ temBAD_AMM_TOKENS
Definition: TER.h:129
diff --git a/AMM_8cpp_source.html b/AMM_8cpp_source.html index 5d49c4a21b..ba2ead2bee 100644 --- a/AMM_8cpp_source.html +++ b/AMM_8cpp_source.html @@ -1034,7 +1034,7 @@ $(function() {
ripple::tfLPToken
constexpr std::uint32_t tfLPToken
Definition: TxFlags.h:208
ripple::amountFromJsonNoThrow
bool amountFromJsonNoThrow(STAmount &result, Json::Value const &jvSource)
Definition: STAmount.cpp:1163
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
ripple::tfWithdrawSubTx
constexpr std::uint32_t tfWithdrawSubTx
Definition: TxFlags.h:216
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::root2
Number root2(Number f)
Definition: Number.cpp:701
diff --git a/AMM__test_8cpp_source.html b/AMM__test_8cpp_source.html index de41c0deec..4157f74000 100644 --- a/AMM__test_8cpp_source.html +++ b/AMM__test_8cpp_source.html @@ -8211,7 +8211,7 @@ $(function() {
ripple::tfLPToken
constexpr std::uint32_t tfLPToken
Definition: TxFlags.h:208
ripple::tfNoRippleDirect
constexpr std::uint32_t tfNoRippleDirect
Definition: TxFlags.h:107
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
-
ripple::pseudoAccountAddress
AccountID pseudoAccountAddress(ReadView const &view, uint256 const &pseudoOwnerKey)
Definition: View.cpp:1068
+
ripple::pseudoAccountAddress
AccountID pseudoAccountAddress(ReadView const &view, uint256 const &pseudoOwnerKey)
Definition: View.cpp:1067
ripple::AUCTION_SLOT_INTERVAL_DURATION
std::uint32_t constexpr AUCTION_SLOT_INTERVAL_DURATION
Definition: AMMCore.h:40
ripple::tfLimitQuality
constexpr std::uint32_t tfLimitQuality
Definition: TxFlags.h:109
ripple::tfTwoAssetIfEmpty
constexpr std::uint32_t tfTwoAssetIfEmpty
Definition: TxFlags.h:215
diff --git a/AcceptedLedgerTx_8cpp_source.html b/AcceptedLedgerTx_8cpp_source.html index 28cef90b08..570a8571be 100644 --- a/AcceptedLedgerTx_8cpp_source.html +++ b/AcceptedLedgerTx_8cpp_source.html @@ -186,7 +186,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::transHuman
std::string transHuman(TER code)
Definition: TER.cpp:273
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:114
-
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:553
+
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:552
ripple::fhIGNORE_FREEZE
@ fhIGNORE_FREEZE
Definition: View.h:78
ripple::sqlBlobLiteral
std::string sqlBlobLiteral(Blob const &blob)
Format arbitrary binary data as an SQLite "blob literal".
Definition: StringUtilities.cpp:42
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
diff --git a/AccountChannels_8cpp_source.html b/AccountChannels_8cpp_source.html index b180a38891..93ce853abe 100644 --- a/AccountChannels_8cpp_source.html +++ b/AccountChannels_8cpp_source.html @@ -326,7 +326,7 @@ $(function() {
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::ltANY
@ ltANY
A special type, matching any ledger entry type.
Definition: LedgerFormats.h:78
-
ripple::forEachItemAfter
bool forEachItemAfter(ReadView const &view, Keylet const &root, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items after an item in the given directory.
Definition: View.cpp:683
+
ripple::forEachItemAfter
bool forEachItemAfter(ReadView const &view, Keylet const &root, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items after an item in the given directory.
Definition: View.cpp:682
ripple::doAccountChannels
Json::Value doAccountChannels(RPC::JsonContext &context)
Definition: AccountChannels.cpp:68
std::optional
std::shared_ptr
diff --git a/AccountLines_8cpp_source.html b/AccountLines_8cpp_source.html index f5ec54bc3d..851675469e 100644 --- a/AccountLines_8cpp_source.html +++ b/AccountLines_8cpp_source.html @@ -377,7 +377,7 @@ $(function() {
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:31
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::ltANY
@ ltANY
A special type, matching any ledger entry type.
Definition: LedgerFormats.h:78
-
ripple::forEachItemAfter
bool forEachItemAfter(ReadView const &view, Keylet const &root, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items after an item in the given directory.
Definition: View.cpp:683
+
ripple::forEachItemAfter
bool forEachItemAfter(ReadView const &view, Keylet const &root, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items after an item in the given directory.
Definition: View.cpp:682
std::optional
std::shared_ptr
ripple::RPC::Context::loadType
Resource::Charge & loadType
Definition: Context.h:42
diff --git a/AccountOffers_8cpp_source.html b/AccountOffers_8cpp_source.html index 13cd5fa95d..d66d6baca4 100644 --- a/AccountOffers_8cpp_source.html +++ b/AccountOffers_8cpp_source.html @@ -294,7 +294,7 @@ $(function() {
ripple::doAccountOffers
Json::Value doAccountOffers(RPC::JsonContext &context)
Definition: AccountOffers.cpp:57
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::ltANY
@ ltANY
A special type, matching any ledger entry type.
Definition: LedgerFormats.h:78
-
ripple::forEachItemAfter
bool forEachItemAfter(ReadView const &view, Keylet const &root, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items after an item in the given directory.
Definition: View.cpp:683
+
ripple::forEachItemAfter
bool forEachItemAfter(ReadView const &view, Keylet const &root, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items after an item in the given directory.
Definition: View.cpp:682
ripple::appendOfferJson
void appendOfferJson(std::shared_ptr< SLE const > const &offer, Json::Value &offers)
Definition: AccountOffers.cpp:35
std::optional
std::shared_ptr
diff --git a/AccountSet__test_8cpp_source.html b/AccountSet__test_8cpp_source.html index 1013a643d0..613921f15b 100644 --- a/AccountSet__test_8cpp_source.html +++ b/AccountSet__test_8cpp_source.html @@ -720,7 +720,7 @@ $(function() {
ripple::asfAllowTrustLineLocking
constexpr std::uint32_t asfAllowTrustLineLocking
Definition: TxFlags.h:95
ripple::asfRequireDest
constexpr std::uint32_t asfRequireDest
Definition: TxFlags.h:77
ripple::toAmount< STAmount >
STAmount toAmount< STAmount >(STAmount const &amt)
Definition: AmountConversions.h:68
-
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:761
+
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:760
ripple::asfAuthorizedNFTokenMinter
constexpr std::uint32_t asfAuthorizedNFTokenMinter
Definition: TxFlags.h:86
ripple::tfOptionalDestTag
constexpr std::uint32_t tfOptionalDestTag
Definition: TxFlags.h:67
ripple::tfAccountSetMask
constexpr std::uint32_t tfAccountSetMask
Definition: TxFlags.h:72
@@ -750,7 +750,7 @@ $(function() {
ripple::asfAllowTrustLineClawback
constexpr std::uint32_t asfAllowTrustLineClawback
Definition: TxFlags.h:94
ripple::asfRequireAuth
constexpr std::uint32_t asfRequireAuth
Definition: TxFlags.h:78
ripple::terPRE_TICKET
@ terPRE_TICKET
Definition: TER.h:226
-
ripple::dirIsEmpty
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
Definition: View.cpp:906
+
ripple::dirIsEmpty
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
Definition: View.cpp:905
ripple::asfDisallowXRP
constexpr std::uint32_t asfDisallowXRP
Definition: TxFlags.h:79
ripple::temINVALID_FLAG
@ temINVALID_FLAG
Definition: TER.h:111
ripple::temBAD_TRANSFER_RATE
@ temBAD_TRANSFER_RATE
Definition: TER.h:107
diff --git a/AmendmentTable_8h_source.html b/AmendmentTable_8h_source.html index 7e722d08a1..b6bd9e8745 100644 --- a/AmendmentTable_8h_source.html +++ b/AmendmentTable_8h_source.html @@ -298,11 +298,11 @@ $(function() {
std::map
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::isAdmin
bool isAdmin(Port const &port, Json::Value const &params, beast::IP::Address const &remoteIp)
Definition: Role.cpp:85
-
ripple::getEnabledAmendments
std::set< uint256 > getEnabledAmendments(ReadView const &view)
Definition: View.cpp:920
+
ripple::getEnabledAmendments
std::set< uint256 > getEnabledAmendments(ReadView const &view)
Definition: View.cpp:919
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::VoteBehavior
VoteBehavior
Definition: Feature.h:87
ripple::make_shamapitem
boost::intrusive_ptr< SHAMapItem > make_shamapitem(uint256 const &tag, Slice data)
Definition: SHAMapItem.h:161
-
ripple::getMajorityAmendments
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:937
+
ripple::getMajorityAmendments
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:936
ripple::make_AmendmentTable
std::unique_ptr< AmendmentTable > make_AmendmentTable(Application &app, std::chrono::seconds majorityTime, std::vector< AmendmentTable::FeatureInfo > const &supported, Section const &enabled, Section const &vetoed, beast::Journal journal)
Definition: AmendmentTable.cpp:1072
ripple::SHAMapNodeType::tnTRANSACTION_NM
@ tnTRANSACTION_NM
optional
diff --git a/ApplyContext_8cpp_source.html b/ApplyContext_8cpp_source.html index a7d77d076a..c7c07951b8 100644 --- a/ApplyContext_8cpp_source.html +++ b/ApplyContext_8cpp_source.html @@ -272,7 +272,7 @@ $(function() {
ripple::tecINVARIANT_FAILED
@ tecINVARIANT_FAILED
Definition: TER.h:313
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
ripple::getInvariantChecks
InvariantChecks getInvariantChecks()
get a tuple of all invariant checks
Definition: InvariantCheck.h:739
ripple::ApplyFlags
ApplyFlags
Definition: ApplyView.h:31
ripple::tapDRY_RUN
@ tapDRY_RUN
Definition: ApplyView.h:50
diff --git a/ApplyContext_8h_source.html b/ApplyContext_8h_source.html index 3fcdcf5aa5..e01be67fc2 100644 --- a/ApplyContext_8h_source.html +++ b/ApplyContext_8h_source.html @@ -266,7 +266,7 @@ $(function() {
std::function
std::index_sequence
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
ripple::ApplyFlags
ApplyFlags
Definition: ApplyView.h:31
ripple::tapBATCH
@ tapBATCH
Definition: ApplyView.h:46
optional
diff --git a/ApplyStateTable_8cpp_source.html b/ApplyStateTable_8cpp_source.html index b42d775163..fbe1d173a4 100644 --- a/ApplyStateTable_8cpp_source.html +++ b/ApplyStateTable_8cpp_source.html @@ -853,7 +853,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:114
ripple::LedgerEntryType
LedgerEntryType
Identifiers for on-ledger objects.
Definition: LedgerFormats.h:54
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
ripple::LogicError
void LogicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
Definition: libxrpl/basics/contract.cpp:37
std
STL namespace.
std::optional
diff --git a/ApplyStateTable_8h_source.html b/ApplyStateTable_8h_source.html index c18c203fc1..aa9b8ef57b 100644 --- a/ApplyStateTable_8h_source.html +++ b/ApplyStateTable_8h_source.html @@ -283,7 +283,7 @@ $(function() {
std::map< key_type, std::pair< Action, std::shared_ptr< SLE > > >
memory
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
std::optional
std::shared_ptr
std::size_t
diff --git a/ApplyViewImpl_8cpp_source.html b/ApplyViewImpl_8cpp_source.html index 300254e00a..077dcd2a5f 100644 --- a/ApplyViewImpl_8cpp_source.html +++ b/ApplyViewImpl_8cpp_source.html @@ -152,7 +152,7 @@ $(function() {
ripple::detail::ApplyViewBase::items_
detail::ApplyStateTable items_
Definition: ApplyViewBase.h:125
std::function
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
ripple::ApplyFlags
ApplyFlags
Definition: ApplyView.h:31
std::optional
std::shared_ptr
diff --git a/ApplyViewImpl_8h_source.html b/ApplyViewImpl_8h_source.html index d7df972da5..cfb334d495 100644 --- a/ApplyViewImpl_8h_source.html +++ b/ApplyViewImpl_8h_source.html @@ -175,7 +175,7 @@ $(function() {
ripple::detail::ApplyViewBase::flags
ApplyFlags flags() const override
Returns the tx apply flags.
Definition: ApplyViewBase.cpp:121
std::function
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
ripple::ApplyFlags
ApplyFlags
Definition: ApplyView.h:31
std::optional
std::shared_ptr
diff --git a/BookDirs_8cpp_source.html b/BookDirs_8cpp_source.html index 70b9a81834..642558b96a 100644 --- a/BookDirs_8cpp_source.html +++ b/BookDirs_8cpp_source.html @@ -241,8 +241,8 @@ $(function() {
beast
Definition: base_uint.h:662
ripple::keylet::offer
Keylet offer(AccountID const &id, std::uint32_t seq) noexcept
An offer from an account.
Definition: Indexes.cpp:274
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::cdirFirst
bool cdirFirst(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the first entry in the directory, advancing the index.
Definition: View.cpp:147
-
ripple::cdirNext
bool cdirNext(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the next entry in the directory, advancing the index.
Definition: View.cpp:158
+
ripple::cdirFirst
bool cdirFirst(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the first entry in the directory, advancing the index.
Definition: View.cpp:146
+
ripple::cdirNext
bool cdirNext(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the next entry in the directory, advancing the index.
Definition: View.cpp:157
ripple::getQualityNext
uint256 getQualityNext(uint256 const &uBase)
Definition: Indexes.cpp:141
ripple::getBookBase
uint256 getBookBase(Book const &book)
Definition: Indexes.cpp:115
diff --git a/BookStep_8cpp_source.html b/BookStep_8cpp_source.html index 0edb3dadd8..ca42044d0b 100644 --- a/BookStep_8cpp_source.html +++ b/BookStep_8cpp_source.html @@ -1684,7 +1684,7 @@ $(function() {
ripple::StrandDirection::reverse
@ reverse
ripple::StrandDirection::forward
@ forward
ripple::getTradingFee
std::uint16_t getTradingFee(ReadView const &view, SLE const &ammSle, AccountID const &account)
Get AMM trading fee for the given account.
Definition: AMMUtils.cpp:179
-
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:761
+
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:760
ripple::lsfHighNoRipple
@ lsfHighNoRipple
Definition: LedgerFormats.h:164
ripple::lsfRequireAuth
@ lsfRequireAuth
Definition: LedgerFormats.h:128
ripple::lsfLowNoRipple
@ lsfLowNoRipple
Definition: LedgerFormats.h:163
diff --git a/BookTip_8cpp_source.html b/BookTip_8cpp_source.html index 9ebcc5c26a..3594673ab8 100644 --- a/BookTip_8cpp_source.html +++ b/BookTip_8cpp_source.html @@ -176,8 +176,8 @@ $(function() {
ripple::keylet::offer
Keylet offer(AccountID const &id, std::uint32_t seq) noexcept
An offer from an account.
Definition: Indexes.cpp:274
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::getQuality
std::uint64_t getQuality(uint256 const &uBase)
Definition: Indexes.cpp:149
-
ripple::dirFirst
bool dirFirst(ApplyView &view, uint256 const &root, std::shared_ptr< SLE > &page, unsigned int &index, uint256 &entry)
Definition: View.cpp:125
-
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1471
+
ripple::dirFirst
bool dirFirst(ApplyView &view, uint256 const &root, std::shared_ptr< SLE > &page, unsigned int &index, uint256 &entry)
Definition: View.cpp:124
+
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1574
ripple::getQualityNext
uint256 getQualityNext(uint256 const &uBase)
Definition: Indexes.cpp:141
ripple::getBookBase
uint256 getBookBase(Book const &book)
Definition: Indexes.cpp:115
std::shared_ptr
diff --git a/Book__test_8cpp_source.html b/Book__test_8cpp_source.html index 29a6670662..e28773716f 100644 --- a/Book__test_8cpp_source.html +++ b/Book__test_8cpp_source.html @@ -2173,7 +2173,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::noAccount
AccountID const & noAccount()
A placeholder for empty accounts.
Definition: AccountID.cpp:185
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:114
-
ripple::cdirFirst
bool cdirFirst(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the first entry in the directory, advancing the index.
Definition: View.cpp:147
+
ripple::cdirFirst
bool cdirFirst(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the first entry in the directory, advancing the index.
Definition: View.cpp:146
ripple::xrpAccount
AccountID const & xrpAccount()
Compute AccountID from public key.
Definition: AccountID.cpp:178
ripple::lsfHybrid
@ lsfHybrid
Definition: LedgerFormats.h:156
ripple::tfHybrid
constexpr std::uint32_t tfHybrid
Definition: TxFlags.h:102
diff --git a/CancelCheck_8cpp_source.html b/CancelCheck_8cpp_source.html index a1dc7a4db0..03a52565e5 100644 --- a/CancelCheck_8cpp_source.html +++ b/CancelCheck_8cpp_source.html @@ -226,7 +226,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::tefBAD_LEDGER
@ tefBAD_LEDGER
Definition: TER.h:170
-
ripple::adjustOwnerCount
void adjustOwnerCount(ApplyView &view, std::shared_ptr< SLE > const &sle, std::int32_t amount, beast::Journal j)
Adjust the owner count up or down.
Definition: View.cpp:1031
+
ripple::adjustOwnerCount
void adjustOwnerCount(ApplyView &view, std::shared_ptr< SLE > const &sle, std::int32_t amount, beast::Journal j)
Adjust the owner count up or down.
Definition: View.cpp:1030
ripple::preflight2
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
Definition: Transactor.cpp:160
ripple::tecNO_ENTRY
@ tecNO_ENTRY
Definition: TER.h:306
ripple::tecNO_PERMISSION
@ tecNO_PERMISSION
Definition: TER.h:305
diff --git a/CancelOffer_8cpp_source.html b/CancelOffer_8cpp_source.html index a6f3a87d52..a97457ef3c 100644 --- a/CancelOffer_8cpp_source.html +++ b/CancelOffer_8cpp_source.html @@ -190,7 +190,7 @@ $(function() {
ripple::keylet::offer
Keylet offer(AccountID const &id, std::uint32_t seq) noexcept
An offer from an account.
Definition: Indexes.cpp:274
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
-
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1471
+
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1574
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
ripple::preflight2
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
Definition: Transactor.cpp:160
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
diff --git a/CanonicalTXSet_8cpp_source.html b/CanonicalTXSet_8cpp_source.html index 5d9f798c25..88021f89a4 100644 --- a/CanonicalTXSet_8cpp_source.html +++ b/CanonicalTXSet_8cpp_source.html @@ -183,7 +183,7 @@ $(function() {
std::make_pair
T make_pair(T... args)
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::operator<
bool operator<(Slice const &lhs, Slice const &rhs) noexcept
Definition: Slice.h:223
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
std::shared_ptr
diff --git a/CashCheck_8cpp_source.html b/CashCheck_8cpp_source.html index b439a5ce1f..1b94ca0db8 100644 --- a/CashCheck_8cpp_source.html +++ b/CashCheck_8cpp_source.html @@ -654,7 +654,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::noAccount
AccountID const & noAccount()
A placeholder for empty accounts.
Definition: AccountID.cpp:185
ripple::badCurrency
Currency const & badCurrency()
We deliberately disallow the currency that looks like "XRP" because too many people were using it ins...
Definition: UintTypes.cpp:133
-
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:553
+
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:552
ripple::fhZERO_IF_FROZEN
@ fhZERO_IF_FROZEN
Definition: View.h:78
ripple::isLegalNet
bool isLegalNet(STAmount const &value)
Definition: STAmount.h:600
ripple::lsfRequireDestTag
@ lsfRequireDestTag
Definition: LedgerFormats.h:126
@@ -663,14 +663,14 @@ $(function() {
ripple::lsfHighAuth
@ lsfHighAuth
Definition: LedgerFormats.h:162
ripple::lsfLowAuth
@ lsfLowAuth
Definition: LedgerFormats.h:161
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
-
ripple::transferXRP
TER transferXRP(ApplyView &view, AccountID const &from, AccountID const &to, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2258
+
ripple::transferXRP
TER transferXRP(ApplyView &view, AccountID const &from, AccountID const &to, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2361
ripple::flow
StrandResult< TInAmt, TOutAmt > flow(PaymentSandbox const &baseView, Strand const &strand, std::optional< TInAmt > const &maxIn, TOutAmt const &out, beast::Journal j)
Request out amount from a strand.
Definition: StrandFlow.h:105
-
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:249
+
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:248
ripple::tefBAD_LEDGER
@ tefBAD_LEDGER
Definition: TER.h:170
ripple::no
@ no
Definition: Steps.h:45
ripple::adjustOwnerCount
static bool adjustOwnerCount(ApplyContext &ctx, int count)
Definition: SetOracle.cpp:186
ripple::preflight2
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
Definition: Transactor.cpp:160
-
ripple::trustCreate
TER trustCreate(ApplyView &view, bool const bSrcHigh, AccountID const &uSrcAccountID, AccountID const &uDstAccountID, uint256 const &uIndex, SLE::ref sleAccount, bool const bAuth, bool const bNoRipple, bool const bFreeze, bool bDeepFreeze, STAmount const &saBalance, STAmount const &saLimit, std::uint32_t uQualityIn, std::uint32_t uQualityOut, beast::Journal j)
Create a trust line.
Definition: View.cpp:1227
+
ripple::trustCreate
TER trustCreate(ApplyView &view, bool const bSrcHigh, AccountID const &uSrcAccountID, AccountID const &uDstAccountID, uint256 const &uIndex, SLE::ref sleAccount, bool const bAuth, bool const bNoRipple, bool const bFreeze, bool bDeepFreeze, STAmount const &saBalance, STAmount const &saLimit, std::uint32_t uQualityIn, std::uint32_t uQualityOut, beast::Journal j)
Create a trust line.
Definition: View.cpp:1329
ripple::tecNO_ENTRY
@ tecNO_ENTRY
Definition: TER.h:306
ripple::tecNO_LINE_INSUF_RESERVE
@ tecNO_LINE_INSUF_RESERVE
Definition: TER.h:292
ripple::tecNO_ISSUER
@ tecNO_ISSUER
Definition: TER.h:299
@@ -688,9 +688,9 @@ $(function() {
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::tfUniversalMask
constexpr std::uint32_t tfUniversalMask
Definition: TxFlags.h:63
-
ripple::hasExpired
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
Definition: View.cpp:175
+
ripple::hasExpired
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
Definition: View.cpp:174
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
-
ripple::xrpLiquid
XRPAmount xrpLiquid(ReadView const &view, AccountID const &id, std::int32_t ownerCountAdj, beast::Journal j)
Definition: View.cpp:617
+
ripple::xrpLiquid
XRPAmount xrpLiquid(ReadView const &view, AccountID const &id, std::int32_t ownerCountAdj, beast::Journal j)
Definition: View.cpp:616
ripple::temBAD_AMOUNT
@ temBAD_AMOUNT
Definition: TER.h:89
ripple::temBAD_CURRENCY
@ temBAD_CURRENCY
Definition: TER.h:90
ripple::temMALFORMED
@ temMALFORMED
Definition: TER.h:87
diff --git a/Check__test_8cpp_source.html b/Check__test_8cpp_source.html index d2f8f586a5..efe3006581 100644 --- a/Check__test_8cpp_source.html +++ b/Check__test_8cpp_source.html @@ -2900,7 +2900,7 @@ $(function() {
ripple::tecEXPIRED
@ tecEXPIRED
Definition: TER.h:314
ripple::tecNO_AUTH
@ tecNO_AUTH
Definition: TER.h:300
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
-
ripple::forEachItem
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:655
+
ripple::forEachItem
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:654
ripple::asfRequireAuth
constexpr std::uint32_t asfRequireAuth
Definition: TxFlags.h:78
ripple::terNO_RIPPLE
@ terNO_RIPPLE
Definition: TER.h:224
ripple::terNO_LINE
@ terNO_LINE
Definition: TER.h:219
diff --git a/Clawback_8cpp_source.html b/Clawback_8cpp_source.html index ad2c39c628..457bcb0e58 100644 --- a/Clawback_8cpp_source.html +++ b/Clawback_8cpp_source.html @@ -430,14 +430,14 @@ $(function() {
ripple::tecNO_LINE
@ tecNO_LINE
Definition: TER.h:301
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
ripple::applyHelper
static TER applyHelper(ApplyContext &ctx)
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
ripple::preclaimHelper
static TER preclaimHelper(PreclaimContext const &ctx, SLE const &sleIssuer, AccountID const &issuer, AccountID const &holder, STAmount const &clawAmount)
ripple::applyHelper< MPTIssue >
TER applyHelper< MPTIssue >(ApplyContext &ctx)
Definition: Clawback.cpp:263
-
ripple::rippleCredit
TER rippleCredit(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Calls static rippleCreditIOU if saAmount represents Issue.
Definition: View.cpp:2669
+
ripple::rippleCredit
TER rippleCredit(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Calls static rippleCreditIOU if saAmount represents Issue.
Definition: View.cpp:2769
ripple::terNO_ACCOUNT
@ terNO_ACCOUNT
Definition: TER.h:217
ripple::TER
TERSubset< CanCvtToTER > TER
Definition: TER.h:645
-
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1140
+
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1139
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
ripple::temBAD_AMOUNT
@ temBAD_AMOUNT
Definition: TER.h:89
ripple::temMALFORMED
@ temMALFORMED
Definition: TER.h:87
diff --git a/CreateCheck_8cpp_source.html b/CreateCheck_8cpp_source.html index 576c283388..f7d12394ed 100644 --- a/CreateCheck_8cpp_source.html +++ b/CreateCheck_8cpp_source.html @@ -367,7 +367,7 @@ $(function() {
ripple::lsfHighFreeze
@ lsfHighFreeze
Definition: LedgerFormats.h:166
ripple::lsfDisallowIncomingCheck
@ lsfDisallowIncomingCheck
Definition: LedgerFormats.h:142
ripple::lsfLowFreeze
@ lsfLowFreeze
Definition: LedgerFormats.h:165
-
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1049
+
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1048
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
ripple::adjustOwnerCount
static bool adjustOwnerCount(ApplyContext &ctx, int count)
Definition: SetOracle.cpp:186
@@ -383,10 +383,10 @@ $(function() {
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::tfUniversalMask
constexpr std::uint32_t tfUniversalMask
Definition: TxFlags.h:63
-
ripple::hasExpired
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
Definition: View.cpp:175
-
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1140
+
ripple::hasExpired
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
Definition: View.cpp:174
+
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1139
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
-
ripple::isGlobalFrozen
bool isGlobalFrozen(ReadView const &view, AccountID const &issuer)
Definition: View.cpp:184
+
ripple::isGlobalFrozen
bool isGlobalFrozen(ReadView const &view, AccountID const &issuer)
Definition: View.cpp:183
ripple::temBAD_AMOUNT
@ temBAD_AMOUNT
Definition: TER.h:89
ripple::temREDUNDANT
@ temREDUNDANT
Definition: TER.h:112
ripple::temBAD_CURRENCY
@ temBAD_CURRENCY
Definition: TER.h:90
diff --git a/CreateOffer_8cpp_source.html b/CreateOffer_8cpp_source.html index ab27beaff0..fe982c9e62 100644 --- a/CreateOffer_8cpp_source.html +++ b/CreateOffer_8cpp_source.html @@ -1113,14 +1113,14 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::divide
STAmount divide(STAmount const &amount, Rate const &rate)
Definition: Rate2.cpp:93
ripple::badCurrency
Currency const & badCurrency()
We deliberately disallow the currency that looks like "XRP" because too many people were using it ins...
Definition: UintTypes.cpp:133
-
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:553
+
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:552
ripple::fhZERO_IF_FROZEN
@ fhZERO_IF_FROZEN
Definition: View.h:78
ripple::isXRP
bool isXRP(AccountID const &c)
Definition: AccountID.h:90
ripple::telFAILED_PROCESSING
@ telFAILED_PROCESSING
Definition: TER.h:56
ripple::tfOfferCreateMask
constexpr std::uint32_t tfOfferCreateMask
Definition: TxFlags.h:103
ripple::divRoundStrict
STAmount divRoundStrict(STAmount const &v1, STAmount const &v2, Asset const &asset, bool roundUp)
Definition: STAmount.cpp:1761
ripple::isLegalNet
bool isLegalNet(STAmount const &value)
Definition: STAmount.h:600
-
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:761
+
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:760
ripple::lsfHighDeepFreeze
@ lsfHighDeepFreeze
Definition: LedgerFormats.h:168
ripple::lsfRequireAuth
@ lsfRequireAuth
Definition: LedgerFormats.h:128
ripple::lsfHybrid
@ lsfHybrid
Definition: LedgerFormats.h:156
@@ -1131,14 +1131,14 @@ $(function() {
ripple::lsfPassive
@ lsfPassive
Definition: LedgerFormats.h:154
ripple::tfHybrid
constexpr std::uint32_t tfHybrid
Definition: TxFlags.h:102
ripple::multiply
STAmount multiply(STAmount const &amount, Rate const &rate)
Definition: Rate2.cpp:53
-
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1049
+
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1048
ripple::tfFillOrKill
constexpr std::uint32_t tfFillOrKill
Definition: TxFlags.h:100
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::divideRound
STAmount divideRound(STAmount const &amount, Rate const &rate, bool roundUp)
Definition: Rate2.cpp:104
ripple::flow
StrandResult< TInAmt, TOutAmt > flow(PaymentSandbox const &baseView, Strand const &strand, std::optional< TInAmt > const &maxIn, TOutAmt const &out, beast::Journal j)
Request out amount from a strand.
Definition: StrandFlow.h:105
ripple::tfPassive
constexpr std::uint32_t tfPassive
Definition: TxFlags.h:98
ripple::tfImmediateOrCancel
constexpr std::uint32_t tfImmediateOrCancel
Definition: TxFlags.h:99
-
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1471
+
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1574
ripple::getRate
std::uint64_t getRate(STAmount const &offerOut, STAmount const &offerIn)
Definition: STAmount.cpp:486
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
ripple::OfferCrossing
OfferCrossing
Definition: Steps.h:45
@@ -1169,12 +1169,12 @@ $(function() {
ripple::ApplyFlags
ApplyFlags
Definition: ApplyView.h:31
ripple::tapRETRY
@ tapRETRY
Definition: ApplyView.h:40
ripple::tfSell
constexpr std::uint32_t tfSell
Definition: TxFlags.h:101
-
ripple::hasExpired
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
Definition: View.cpp:175
+
ripple::hasExpired
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
Definition: View.cpp:174
ripple::terNO_ACCOUNT
@ terNO_ACCOUNT
Definition: TER.h:217
ripple::terNO_AUTH
@ terNO_AUTH
Definition: TER.h:218
ripple::terNO_LINE
@ terNO_LINE
Definition: TER.h:219
ripple::isTecClaim
bool isTecClaim(TER x) noexcept
Definition: TER.h:680
-
ripple::isGlobalFrozen
bool isGlobalFrozen(ReadView const &view, AccountID const &issuer)
Definition: View.cpp:184
+
ripple::isGlobalFrozen
bool isGlobalFrozen(ReadView const &view, AccountID const &issuer)
Definition: View.cpp:183
ripple::temBAD_ISSUER
@ temBAD_ISSUER
Definition: TER.h:93
ripple::temBAD_AMOUNT
@ temBAD_AMOUNT
Definition: TER.h:89
ripple::temREDUNDANT
@ temREDUNDANT
Definition: TER.h:112
diff --git a/CreateTicket_8cpp_source.html b/CreateTicket_8cpp_source.html index 4948e0cdbb..5d5e0ada3a 100644 --- a/CreateTicket_8cpp_source.html +++ b/CreateTicket_8cpp_source.html @@ -265,7 +265,7 @@ $(function() {
ripple::keylet::ownerDir
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Definition: Indexes.cpp:374
ripple::keylet::ticket
static ticket_t const ticket
Definition: Indexes.h:171
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1049
+
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1048
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
ripple::adjustOwnerCount
static bool adjustOwnerCount(ApplyContext &ctx, int count)
Definition: SetOracle.cpp:186
diff --git a/Credentials_8cpp_source.html b/Credentials_8cpp_source.html index 14225eaef5..7a376ee0d0 100644 --- a/Credentials_8cpp_source.html +++ b/Credentials_8cpp_source.html @@ -522,7 +522,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::maxCredentialURILength
std::size_t constexpr maxCredentialURILength
The maximum length of a URI inside a Credential.
Definition: Protocol.h:101
ripple::lsfAccepted
@ lsfAccepted
Definition: LedgerFormats.h:195
-
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1049
+
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1048
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
ripple::adjustOwnerCount
static bool adjustOwnerCount(ApplyContext &ctx, int count)
Definition: SetOracle.cpp:186
diff --git a/DID_8cpp_source.html b/DID_8cpp_source.html index 239a590eee..a759a05352 100644 --- a/DID_8cpp_source.html +++ b/DID_8cpp_source.html @@ -348,7 +348,7 @@ $(function() {
ripple::addSLE
TER addSLE(ApplyContext &ctx, std::shared_ptr< SLE > const &sle, AccountID const &owner)
Definition: DID.cpp:81
ripple::set
bool set(T &target, std::string const &name, Section const &section)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
Definition: BasicConfig.h:315
ripple::maxDIDDocumentLength
std::size_t constexpr maxDIDDocumentLength
The maximum length of a Data element inside a DID.
Definition: Protocol.h:89
-
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1049
+
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1048
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::tefBAD_LEDGER
@ tefBAD_LEDGER
Definition: TER.h:170
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
diff --git a/DelegateSet_8cpp_source.html b/DelegateSet_8cpp_source.html index 77781f559a..13c14a6c94 100644 --- a/DelegateSet_8cpp_source.html +++ b/DelegateSet_8cpp_source.html @@ -273,7 +273,7 @@ $(function() {
ripple::keylet::ownerDir
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Definition: Indexes.cpp:374
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::permissionMaxSize
std::size_t constexpr permissionMaxSize
The maximum number of delegate permissions an account can grant.
Definition: Protocol.h:170
-
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1049
+
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1048
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::tefBAD_LEDGER
@ tefBAD_LEDGER
Definition: TER.h:170
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
diff --git a/DeleteAccount_8cpp_source.html b/DeleteAccount_8cpp_source.html index cbb9cbc20f..e7c22c56ee 100644 --- a/DeleteAccount_8cpp_source.html +++ b/DeleteAccount_8cpp_source.html @@ -575,7 +575,7 @@ $(function() {
ripple::AccountID
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition: AccountID.h:48
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:114
ripple::maxDeletableDirEntries
std::size_t constexpr maxDeletableDirEntries
The maximum number of owner directory entries for account to be deletable.
Definition: Protocol.h:66
-
ripple::cdirFirst
bool cdirFirst(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the first entry in the directory, advancing the index.
Definition: View.cpp:147
+
ripple::cdirFirst
bool cdirFirst(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the first entry in the directory, advancing the index.
Definition: View.cpp:146
ripple::uint256
base_uint< 256 > uint256
Definition: base_uint.h:558
ripple::removeSignersFromLedger
static TER removeSignersFromLedger(Application &app, ApplyView &view, Keylet const &accountKeylet, Keylet const &ownerDirKeylet, Keylet const &signerListKeylet, beast::Journal j)
Definition: SetSignerList.cpp:197
ripple::lsfRequireDestTag
@ lsfRequireDestTag
Definition: LedgerFormats.h:126
@@ -583,12 +583,12 @@ $(function() {
ripple::lsfDepositAuth
@ lsfDepositAuth
Definition: LedgerFormats.h:136
ripple::SkipEntry::No
@ No
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
-
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1471
+
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1574
ripple::verifyDepositPreauth
TER verifyDepositPreauth(STTx const &tx, ApplyView &view, AccountID const &src, AccountID const &dst, std::shared_ptr< SLE > const &sleDst, beast::Journal j)
Definition: CredentialHelpers.cpp:358
ripple::tefBAD_LEDGER
@ tefBAD_LEDGER
Definition: TER.h:170
ripple::tefTOO_BIG
@ tefTOO_BIG
Definition: TER.h:184
ripple::preflight2
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
Definition: Transactor.cpp:160
-
ripple::cdirNext
bool cdirNext(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the next entry in the directory, advancing the index.
Definition: View.cpp:158
+
ripple::cdirNext
bool cdirNext(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the next entry in the directory, advancing the index.
Definition: View.cpp:157
ripple::tecNO_DST
@ tecNO_DST
Definition: TER.h:290
ripple::tecTOO_SOON
@ tecTOO_SOON
Definition: TER.h:318
ripple::tecNO_PERMISSION
@ tecNO_PERMISSION
Definition: TER.h:305
@@ -598,11 +598,11 @@ $(function() {
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::LedgerEntryType
LedgerEntryType
Identifiers for on-ledger objects.
Definition: LedgerFormats.h:54
-
ripple::cleanupOnAccountDelete
TER cleanupOnAccountDelete(ApplyView &view, Keylet const &ownerDirKeylet, EntryDeleter const &deleter, beast::Journal j, std::optional< uint16_t > maxNodesToDelete)
Definition: View.cpp:2542
+
ripple::cleanupOnAccountDelete
TER cleanupOnAccountDelete(ApplyView &view, Keylet const &ownerDirKeylet, EntryDeleter const &deleter, beast::Journal j, std::optional< uint16_t > maxNodesToDelete)
Definition: View.cpp:2642
ripple::tfUniversalMask
constexpr std::uint32_t tfUniversalMask
Definition: TxFlags.h:63
ripple::terNO_ACCOUNT
@ terNO_ACCOUNT
Definition: TER.h:217
ripple::TER
TERSubset< CanCvtToTER > TER
Definition: TER.h:645
-
ripple::dirIsEmpty
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
Definition: View.cpp:906
+
ripple::dirIsEmpty
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
Definition: View.cpp:905
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
ripple::temINVALID_FLAG
@ temINVALID_FLAG
Definition: TER.h:111
ripple::temDISABLED
@ temDISABLED
Definition: TER.h:114
diff --git a/DepositPreauth_8cpp_source.html b/DepositPreauth_8cpp_source.html index 833549a38d..12dee28398 100644 --- a/DepositPreauth_8cpp_source.html +++ b/DepositPreauth_8cpp_source.html @@ -437,7 +437,7 @@ $(function() {
ripple::keylet::ownerDir
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Definition: Indexes.cpp:374
ripple::keylet::depositPreauth
Keylet depositPreauth(AccountID const &owner, AccountID const &preauthorized) noexcept
A DepositPreauth.
Definition: Indexes.cpp:342
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1049
+
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1048
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::tefBAD_LEDGER
@ tefBAD_LEDGER
Definition: TER.h:170
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
diff --git a/DirectStep_8cpp_source.html b/DirectStep_8cpp_source.html index 6536ca79f2..343cbbaec8 100644 --- a/DirectStep_8cpp_source.html +++ b/DirectStep_8cpp_source.html @@ -1168,7 +1168,7 @@ $(function() {
ripple::StrandDirection::reverse
@ reverse
ripple::StrandDirection::forward
@ forward
ripple::checkFreeze
TER checkFreeze(ReadView const &view, AccountID const &src, AccountID const &dst, Currency const &currency)
Definition: StepChecks.h:34
-
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:761
+
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:760
ripple::lsfHighNoRipple
@ lsfHighNoRipple
Definition: LedgerFormats.h:164
ripple::lsfRequireAuth
@ lsfRequireAuth
Definition: LedgerFormats.h:128
ripple::lsfLowNoRipple
@ lsfLowNoRipple
Definition: LedgerFormats.h:163
@@ -1191,11 +1191,11 @@ $(function() {
ripple::tecPATH_DRY
@ tecPATH_DRY
Definition: TER.h:294
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
ripple::mulRatio
IOUAmount mulRatio(IOUAmount const &amt, std::uint32_t num, std::uint32_t den, bool roundUp)
Definition: IOUAmount.cpp:190
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
ripple::make_DirectStepI
std::pair< TER, std::unique_ptr< Step > > make_DirectStepI(StrandContext const &ctx, AccountID const &src, AccountID const &dst, Currency const &c)
Definition: DirectStep.cpp:985
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::creditLimit2
IOUAmount creditLimit2(ReadView const &v, AccountID const &acc, AccountID const &iss, Currency const &cur)
Definition: Credit.cpp:56
-
ripple::rippleCredit
TER rippleCredit(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Calls static rippleCreditIOU if saAmount represents Issue.
Definition: View.cpp:2669
+
ripple::rippleCredit
TER rippleCredit(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Calls static rippleCreditIOU if saAmount represents Issue.
Definition: View.cpp:2769
ripple::terNO_ACCOUNT
@ terNO_ACCOUNT
Definition: TER.h:217
ripple::terNO_RIPPLE
@ terNO_RIPPLE
Definition: TER.h:224
ripple::terNO_AUTH
@ terNO_AUTH
Definition: TER.h:218
diff --git a/Directory__test_8cpp_source.html b/Directory__test_8cpp_source.html index d60776f615..41cb7fc086 100644 --- a/Directory__test_8cpp_source.html +++ b/Directory__test_8cpp_source.html @@ -633,7 +633,7 @@ $(function() {
ripple::ReleaseStrongRefAction::noop
@ noop
ripple::tapNONE
@ tapNONE
Definition: ApplyView.h:32
ripple::getBookBase
uint256 getBookBase(Book const &book)
Definition: Indexes.cpp:115
-
ripple::dirIsEmpty
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
Definition: View.cpp:906
+
ripple::dirIsEmpty
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
Definition: View.cpp:905
ripple::default_prng
beast::xor_shift_engine & default_prng()
Return the default random engine.
Definition: include/xrpl/basics/random.h:65
std::string::push_back
T push_back(T... args)
std::shuffle
T shuffle(T... args)
diff --git a/EscrowToken__test_8cpp_source.html b/EscrowToken__test_8cpp_source.html index 9e1c026bfd..e290aa2f0e 100644 --- a/EscrowToken__test_8cpp_source.html +++ b/EscrowToken__test_8cpp_source.html @@ -4031,7 +4031,7 @@ $(function() {
ripple::tfSetDeepFreeze
constexpr std::uint32_t tfSetDeepFreeze
Definition: TxFlags.h:120
ripple::asfAllowTrustLineLocking
constexpr std::uint32_t asfAllowTrustLineLocking
Definition: TxFlags.h:95
ripple::tfMPTCanTransfer
constexpr std::uint32_t const tfMPTCanTransfer
Definition: TxFlags.h:149
-
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:761
+
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:760
ripple::maxMPTokenAmount
std::uint64_t constexpr maxMPTokenAmount
The maximum amount of MPTokenIssuance.
Definition: Protocol.h:117
ripple::HashRouterFlags::BAD
@ BAD
ripple::TxSearched::all
@ all
diff --git a/Escrow_8cpp_source.html b/Escrow_8cpp_source.html index d8c839198a..d936181461 100644 --- a/Escrow_8cpp_source.html +++ b/Escrow_8cpp_source.html @@ -1569,19 +1569,19 @@ $(function() {
ripple::keylet::escrow
Keylet escrow(AccountID const &src, std::uint32_t seq) noexcept
An escrow entry.
Definition: Indexes.cpp:389
ripple::keylet::ownerDir
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Definition: Indexes.cpp:374
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::rippleLockEscrowMPT
TER rippleLockEscrowMPT(ApplyView &view, AccountID const &sender, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2753
+
ripple::rippleLockEscrowMPT
TER rippleLockEscrowMPT(ApplyView &view, AccountID const &sender, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2853
ripple::noAccount
AccountID const & noAccount()
A placeholder for empty accounts.
Definition: AccountID.cpp:185
ripple::escrowFinishPreclaimHelper< Issue >
TER escrowFinishPreclaimHelper< Issue >(PreclaimContext const &ctx, AccountID const &dest, STAmount const &amount)
Definition: Escrow.cpp:704
ripple::badCurrency
Currency const & badCurrency()
We deliberately disallow the currency that looks like "XRP" because too many people were using it ins...
Definition: UintTypes.cpp:133
-
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2301
+
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2404
ripple::fhIGNORE_FREEZE
@ fhIGNORE_FREEZE
Definition: View.h:78
ripple::escrowCreatePreclaimHelper< MPTIssue >
TER escrowCreatePreclaimHelper< MPTIssue >(PreclaimContext const &ctx, AccountID const &account, AccountID const &dest, STAmount const &amount)
Definition: Escrow.cpp:283
ripple::isXRP
bool isXRP(AccountID const &c)
Definition: AccountID.h:90
ripple::escrowFinishPreclaimHelper
static TER escrowFinishPreclaimHelper(PreclaimContext const &ctx, AccountID const &dest, STAmount const &amount)
ripple::canAdd
bool canAdd(STAmount const &amt1, STAmount const &amt2)
Safely checks if two STAmount values can be added without overflow, underflow, or precision loss.
Definition: STAmount.cpp:528
ripple::escrowLockApplyHelper< Issue >
TER escrowLockApplyHelper< Issue >(ApplyView &view, AccountID const &issuer, AccountID const &sender, STAmount const &amount, beast::Journal journal)
Definition: Escrow.cpp:408
-
ripple::isDeepFrozen
bool isDeepFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:349
-
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:761
+
ripple::isDeepFrozen
bool isDeepFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:348
+
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:760
ripple::lsfRequireDestTag
@ lsfRequireDestTag
Definition: LedgerFormats.h:126
ripple::lsfMPTCanEscrow
@ lsfMPTCanEscrow
Definition: LedgerFormats.h:186
ripple::lsfDefaultRipple
@ lsfDefaultRipple
Definition: LedgerFormats.h:134
@@ -1591,12 +1591,12 @@ $(function() {
ripple::AuthType::WeakAuth
@ WeakAuth
ripple::escrowLockApplyHelper
static TER escrowLockApplyHelper(ApplyView &view, AccountID const &issuer, AccountID const &sender, STAmount const &amount, beast::Journal journal)
ripple::ahIGNORE_AUTH
@ ahIGNORE_AUTH
Definition: View.h:81
-
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1049
+
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1048
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::divideRound
STAmount divideRound(STAmount const &amount, Rate const &rate, bool roundUp)
Definition: Rate2.cpp:104
ripple::verifyDepositPreauth
TER verifyDepositPreauth(STTx const &tx, ApplyView &view, AccountID const &src, AccountID const &dst, std::shared_ptr< SLE > const &sleDst, beast::Journal j)
Definition: CredentialHelpers.cpp:358
-
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:249
-
ripple::canTransfer
TER canTransfer(ReadView const &view, MPTIssue const &mptIssue, AccountID const &from, AccountID const &to)
Check if the destination account is allowed to receive MPT.
Definition: View.cpp:2522
+
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:248
+
ripple::canTransfer
TER canTransfer(ReadView const &view, MPTIssue const &mptIssue, AccountID const &from, AccountID const &to)
Check if the destination account is allowed to receive MPT.
Definition: View.cpp:2622
ripple::SF_CF_VALID
constexpr HashRouterFlags SF_CF_VALID
Definition: Escrow.cpp:43
ripple::tefBAD_LEDGER
@ tefBAD_LEDGER
Definition: TER.h:170
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
@@ -1604,14 +1604,14 @@ $(function() {
ripple::HashRouterFlags::PRIVATE6
@ PRIVATE6
ripple::HashRouterFlags::PRIVATE5
@ PRIVATE5
ripple::escrowCreatePreclaimHelper< Issue >
TER escrowCreatePreclaimHelper< Issue >(PreclaimContext const &ctx, AccountID const &account, AccountID const &dest, STAmount const &amount)
Definition: Escrow.cpp:205
-
ripple::rippleUnlockEscrowMPT
TER rippleUnlockEscrowMPT(ApplyView &view, AccountID const &sender, AccountID const &receiver, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2850
+
ripple::rippleUnlockEscrowMPT
TER rippleUnlockEscrowMPT(ApplyView &view, AccountID const &sender, AccountID const &receiver, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2950
ripple::adjustOwnerCount
static bool adjustOwnerCount(ApplyContext &ctx, int count)
Definition: SetOracle.cpp:186
ripple::preflight2
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
Definition: Transactor.cpp:160
ripple::checkCondition
static bool checkCondition(Slice f, Slice c)
Definition: Escrow.cpp:610
ripple::escrowUnlockApplyHelper< MPTIssue >
TER escrowUnlockApplyHelper< MPTIssue >(ApplyView &view, Rate lockedRate, std::shared_ptr< SLE > const &sleDest, STAmount const &xrpBalance, STAmount const &amount, AccountID const &issuer, AccountID const &sender, AccountID const &receiver, bool createAsset, beast::Journal journal)
Definition: Escrow.cpp:946
ripple::escrowCreatePreflightHelper
static NotTEC escrowCreatePreflightHelper(PreflightContext const &ctx)
ripple::escrowCancelPreclaimHelper
static TER escrowCancelPreclaimHelper(PreclaimContext const &ctx, AccountID const &account, STAmount const &amount)
-
ripple::trustCreate
TER trustCreate(ApplyView &view, bool const bSrcHigh, AccountID const &uSrcAccountID, AccountID const &uDstAccountID, uint256 const &uIndex, SLE::ref sleAccount, bool const bAuth, bool const bNoRipple, bool const bFreeze, bool bDeepFreeze, STAmount const &saBalance, STAmount const &saLimit, std::uint32_t uQualityIn, std::uint32_t uQualityOut, beast::Journal j)
Create a trust line.
Definition: View.cpp:1227
+
ripple::trustCreate
TER trustCreate(ApplyView &view, bool const bSrcHigh, AccountID const &uSrcAccountID, AccountID const &uDstAccountID, uint256 const &uIndex, SLE::ref sleAccount, bool const bAuth, bool const bNoRipple, bool const bFreeze, bool bDeepFreeze, STAmount const &saBalance, STAmount const &saLimit, std::uint32_t uQualityIn, std::uint32_t uQualityOut, beast::Journal j)
Create a trust line.
Definition: View.cpp:1329
ripple::tecCRYPTOCONDITION_ERROR
@ tecCRYPTOCONDITION_ERROR
Definition: TER.h:312
ripple::tecNO_DST
@ tecNO_DST
Definition: TER.h:290
ripple::tecNO_LINE_INSUF_RESERVE
@ tecNO_LINE_INSUF_RESERVE
Definition: TER.h:292
@@ -1631,19 +1631,19 @@ $(function() {
ripple::tecINSUFFICIENT_RESERVE
@ tecINSUFFICIENT_RESERVE
Definition: TER.h:307
ripple::tecLOCKED
@ tecLOCKED
Definition: TER.h:358
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
ripple::SF_CF_INVALID
constexpr HashRouterFlags SF_CF_INVALID
Definition: Escrow.cpp:42
ripple::escrowCreatePreflightHelper< MPTIssue >
NotTEC escrowCreatePreflightHelper< MPTIssue >(PreflightContext const &ctx)
Definition: Escrow.cpp:108
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
ripple::escrowFinishPreclaimHelper< MPTIssue >
TER escrowFinishPreclaimHelper< MPTIssue >(PreclaimContext const &ctx, AccountID const &dest, STAmount const &amount)
Definition: Escrow.cpp:728
ripple::escrowCreatePreflightHelper< Issue >
NotTEC escrowCreatePreflightHelper< Issue >(PreflightContext const &ctx)
Definition: Escrow.cpp:94
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
ripple::tfUniversalMask
constexpr std::uint32_t tfUniversalMask
Definition: TxFlags.h:63
-
ripple::rippleCredit
TER rippleCredit(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Calls static rippleCreditIOU if saAmount represents Issue.
Definition: View.cpp:2669
+
ripple::rippleCredit
TER rippleCredit(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Calls static rippleCreditIOU if saAmount represents Issue.
Definition: View.cpp:2769
ripple::escrowCancelPreclaimHelper< Issue >
TER escrowCancelPreclaimHelper< Issue >(PreclaimContext const &ctx, AccountID const &account, STAmount const &amount)
Definition: Escrow.cpp:1221
ripple::escrowLockApplyHelper< MPTIssue >
TER escrowLockApplyHelper< MPTIssue >(ApplyView &view, AccountID const &issuer, AccountID const &sender, STAmount const &amount, beast::Journal journal)
Definition: Escrow.cpp:435
ripple::escrowUnlockApplyHelper
static TER escrowUnlockApplyHelper(ApplyView &view, Rate lockedRate, std::shared_ptr< SLE > const &sleDest, STAmount const &xrpBalance, STAmount const &amount, AccountID const &issuer, AccountID const &sender, AccountID const &receiver, bool createAsset, beast::Journal journal)
-
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1140
+
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1139
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
ripple::escrowUnlockApplyHelper< Issue >
TER escrowUnlockApplyHelper< Issue >(ApplyView &view, Rate lockedRate, std::shared_ptr< SLE > const &sleDest, STAmount const &xrpBalance, STAmount const &amount, AccountID const &issuer, AccountID const &sender, AccountID const &receiver, bool createAsset, beast::Journal journal)
Definition: Escrow.cpp:811
ripple::parityRate
Rate const parityRate
A transfer rate signifying a 1:1 exchange.
diff --git a/Feature1_8cpp_source.html b/Feature1_8cpp_source.html index 40f994cb6c..27953104c4 100644 --- a/Feature1_8cpp_source.html +++ b/Feature1_8cpp_source.html @@ -195,7 +195,7 @@ $(function() {
ripple::isAdmin
bool isAdmin(Port const &port, Json::Value const &params, beast::IP::Address const &remoteIp)
Definition: Role.cpp:85
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:31
ripple::doFeature
Json::Value doFeature(RPC::JsonContext &context)
Definition: Feature1.cpp:36
-
ripple::getMajorityAmendments
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:937
+
ripple::getMajorityAmendments
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:936
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::Role::ADMIN
@ ADMIN
ripple::RPC::Context::role
Role role
Definition: Context.h:46
diff --git a/Feature__test_8cpp_source.html b/Feature__test_8cpp_source.html index 8ac790507a..953eda21ae 100644 --- a/Feature__test_8cpp_source.html +++ b/Feature__test_8cpp_source.html @@ -758,7 +758,7 @@ $(function() {
ripple::VoteBehavior::DefaultNo
@ DefaultNo
ripple::VoteBehavior::DefaultYes
@ DefaultYes
ripple::VoteBehavior::Obsolete
@ Obsolete
-
ripple::getMajorityAmendments
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:937
+
ripple::getMajorityAmendments
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:936
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
std::size_t
std::unique_ptr
diff --git a/Flow__test_8cpp_source.html b/Flow__test_8cpp_source.html index 249d86ff6e..821b47695d 100644 --- a/Flow__test_8cpp_source.html +++ b/Flow__test_8cpp_source.html @@ -1512,7 +1512,7 @@ $(function() {
ripple::lsfLowNoRipple
@ lsfLowNoRipple
Definition: LedgerFormats.h:163
ripple::flow
StrandResult< TInAmt, TOutAmt > flow(PaymentSandbox const &baseView, Strand const &strand, std::optional< TInAmt > const &maxIn, TOutAmt const &out, beast::Journal j)
Request out amount from a strand.
Definition: StrandFlow.h:105
ripple::tfPassive
constexpr std::uint32_t tfPassive
Definition: TxFlags.h:98
-
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1471
+
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1574
ripple::getRate
std::uint64_t getRate(STAmount const &offerOut, STAmount const &offerIn)
Definition: STAmount.cpp:486
ripple::no
@ no
Definition: Steps.h:45
ripple::tfPartialPayment
constexpr std::uint32_t tfPartialPayment
Definition: TxFlags.h:108
@@ -1523,7 +1523,7 @@ $(function() {
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
ripple::tfLimitQuality
constexpr std::uint32_t tfLimitQuality
Definition: TxFlags.h:109
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
-
ripple::forEachItem
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:655
+
ripple::forEachItem
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:654
ripple::tapNONE
@ tapNONE
Definition: ApplyView.h:32
ripple::TER
TERSubset< CanCvtToTER > TER
Definition: TER.h:645
ripple::tfSetNoRipple
constexpr std::uint32_t tfSetNoRipple
Definition: TxFlags.h:116
diff --git a/GatewayBalances_8cpp_source.html b/GatewayBalances_8cpp_source.html index b9edf616fd..49b0fc115d 100644 --- a/GatewayBalances_8cpp_source.html +++ b/GatewayBalances_8cpp_source.html @@ -399,7 +399,7 @@ $(function() {
ripple::rpcINVALID_HOTWALLET
@ rpcINVALID_HOTWALLET
Definition: ErrorCodes.h:81
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:31
ripple::doGatewayBalances
Json::Value doGatewayBalances(RPC::JsonContext &context)
Definition: GatewayBalances.cpp:54
-
ripple::forEachItem
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:655
+
ripple::forEachItem
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:654
std::runtime_error
std::set
std::shared_ptr
diff --git a/InvariantCheck_8cpp_source.html b/InvariantCheck_8cpp_source.html index a65445aa58..1a70877c4a 100644 --- a/InvariantCheck_8cpp_source.html +++ b/InvariantCheck_8cpp_source.html @@ -2272,13 +2272,13 @@ $(function() {
ripple::ammPoolHolds
std::pair< STAmount, STAmount > ammPoolHolds(ReadView const &view, AccountID const &ammAccountID, Issue const &issue1, Issue const &issue2, FreezeHandling freezeHandling, beast::Journal const j)
Get AMM pool balances.
Definition: AMMUtils.cpp:31
ripple::tecINCOMPLETE
@ tecINCOMPLETE
Definition: TER.h:335
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
ripple::ammLPTokens
STAmount ammLPTokens(STAmount const &asset1, STAmount const &asset2, Issue const &lptIssue)
Calculate LP Tokens given AMM pool reserves.
Definition: AMMHelpers.cpp:25
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
ripple::HashPrefix::transactionID
@ transactionID
transaction plus signature to give transaction ID
ripple::withinRelativeDistance
bool withinRelativeDistance(Quality const &calcQuality, Quality const &reqQuality, Number const &dist)
Check if the relative distance between the qualities is within the requested distance.
Definition: AMMHelpers.h:129
ripple::root2
Number root2(Number f)
Definition: Number.cpp:701
-
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1140
+
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1139
std::optional
std::shared_ptr
std::size_t
diff --git a/InvariantCheck_8h_source.html b/InvariantCheck_8h_source.html index 1a2c073bc6..738e710bd7 100644 --- a/InvariantCheck_8h_source.html +++ b/InvariantCheck_8h_source.html @@ -800,7 +800,7 @@ $(function() {
std::int64_t
std::map< Issue, IssuerChanges >
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
ripple::getInvariantChecks
InvariantChecks getInvariantChecks()
get a tuple of all invariant checks
Definition: InvariantCheck.h:739
std::optional
std::shared_ptr
diff --git a/Invariants__test_8cpp_source.html b/Invariants__test_8cpp_source.html index 73265921fd..f79c9f12d3 100644 --- a/Invariants__test_8cpp_source.html +++ b/Invariants__test_8cpp_source.html @@ -1781,7 +1781,7 @@ $(function() {
ripple::directAccountKeylets
std::array< keyletDesc< AccountID const & >, 6 > const directAccountKeylets
Definition: Indexes.h:382
ripple::tefINVARIANT_FAILED
@ tefINVARIANT_FAILED
Definition: TER.h:183
ripple::Currency
base_uint< 160, detail::CurrencyTag > Currency
Currency is a hash representing a specific currency.
Definition: UintTypes.h:56
-
ripple::trustDelete
TER trustDelete(ApplyView &view, std::shared_ptr< SLE > const &sleRippleState, AccountID const &uLowAccountID, AccountID const &uHighAccountID, beast::Journal j)
Definition: View.cpp:1431
+
ripple::trustDelete
TER trustDelete(ApplyView &view, std::shared_ptr< SLE > const &sleRippleState, AccountID const &uLowAccountID, AccountID const &uHighAccountID, beast::Journal j)
Definition: View.cpp:1534
ripple::tecINVARIANT_FAILED
@ tecINVARIANT_FAILED
Definition: TER.h:313
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
diff --git a/LedgerCleaner_8cpp_source.html b/LedgerCleaner_8cpp_source.html index 37cade0410..e28a96be37 100644 --- a/LedgerCleaner_8cpp_source.html +++ b/LedgerCleaner_8cpp_source.html @@ -593,7 +593,7 @@ $(function() {
ripple::make_LedgerCleaner
std::unique_ptr< LedgerCleaner > make_LedgerCleaner(Application &app, beast::Journal journal)
Definition: LedgerCleaner.cpp:460
ripple::loadByIndex
std::shared_ptr< Ledger > loadByIndex(std::uint32_t ledgerIndex, Application &app, bool acquire)
Definition: Ledger.cpp:1114
ripple::getCandidateLedger
LedgerIndex getCandidateLedger(LedgerIndex requested)
Find a ledger index from which we could easily get the requested ledger.
Definition: View.h:430
-
ripple::hashOfSeq
std::optional< uint256 > hashOfSeq(ReadView const &ledger, LedgerIndex seq, beast::Journal journal)
Return the hash of a ledger by sequence.
Definition: View.cpp:960
+
ripple::hashOfSeq
std::optional< uint256 > hashOfSeq(ReadView const &ledger, LedgerIndex seq, beast::Journal journal)
Return the hash of a ledger by sequence.
Definition: View.cpp:959
ripple::LogicError
void LogicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
Definition: libxrpl/basics/contract.cpp:37
ripple::pendSaveValidated
bool pendSaveValidated(Application &app, std::shared_ptr< Ledger const > const &ledger, bool isSynchronous, bool isCurrent)
Save, or arrange to save, a fully-validated ledger Returns false on error.
Definition: Ledger.cpp:993
std::condition_variable::notify_one
T notify_one(T... args)
diff --git a/LedgerData__test_8cpp_source.html b/LedgerData__test_8cpp_source.html index 9e07cc4ef3..25e6c4f4ae 100644 --- a/LedgerData__test_8cpp_source.html +++ b/LedgerData__test_8cpp_source.html @@ -630,7 +630,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::strUnHex
std::optional< Blob > strUnHex(std::size_t strSize, Iterator begin, Iterator end)
Definition: StringUtilities.h:51
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
-
ripple::getMajorityAmendments
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:937
+
ripple::getMajorityAmendments
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:936
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::makeRequest
auto makeRequest(bool crawlPublic, bool comprEnabled, bool ledgerReplayEnabled, bool txReduceRelayEnabled, bool vpReduceRelayEnabled) -> request_type
Make outbound http request.
Definition: Handshake.cpp:365
std::chrono
diff --git a/LedgerMaster_8cpp_source.html b/LedgerMaster_8cpp_source.html index 5d36bea4ce..9504539e6c 100644 --- a/LedgerMaster_8cpp_source.html +++ b/LedgerMaster_8cpp_source.html @@ -2563,7 +2563,7 @@ $(function() {
ripple::shouldAcquire
static bool shouldAcquire(std::uint32_t const currentLedger, std::uint32_t const ledgerHistory, std::optional< LedgerIndex > const minimumOnline, std::uint32_t const candidateLedger, beast::Journal j)
Definition: LedgerMaster.cpp:73
ripple::prevMissing
std::optional< T > prevMissing(RangeSet< T > const &rs, T t, T minVal=0)
Find the largest value not in the set that is less than a given value.
Definition: RangeSet.h:183
ripple::isCurrent
bool isCurrent(ValidationParms const &p, NetClock::time_point now, NetClock::time_point signTime, NetClock::time_point seenTime)
Whether a validation is still current.
Definition: Validations.h:149
-
ripple::hashOfSeq
std::optional< uint256 > hashOfSeq(ReadView const &ledger, LedgerIndex seq, beast::Journal journal)
Return the hash of a ledger by sequence.
Definition: View.cpp:960
+
ripple::hashOfSeq
std::optional< uint256 > hashOfSeq(ReadView const &ledger, LedgerIndex seq, beast::Journal journal)
Return the hash of a ledger by sequence.
Definition: View.cpp:959
ripple::set
bool set(T &target, std::string const &name, Section const &section)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
Definition: BasicConfig.h:315
ripple::MAX_LEDGER_GAP
static constexpr int MAX_LEDGER_GAP
Definition: LedgerMaster.cpp:62
ripple::calculatePercent
constexpr std::size_t calculatePercent(std::size_t count, std::size_t total)
Calculate one number divided by another number in percentage.
Definition: MathUtilities.h:44
@@ -2581,7 +2581,7 @@ $(function() {
ripple::jtPUBOLDLEDGER
@ jtPUBOLDLEDGER
Definition: Job.h:44
ripple::jtADVANCE
@ jtADVANCE
Definition: Job.h:67
ripple::sha512Half
sha512_half_hasher::result_type sha512Half(Args const &... args)
Returns the SHA512-Half of a series of objects.
Definition: digest.h:224
-
ripple::areCompatible
bool areCompatible(ReadView const &validLedger, ReadView const &testLedger, beast::Journal::Stream &s, char const *reason)
Return false if the test ledger is provably incompatible with the valid ledger, that is,...
Definition: View.cpp:798
+
ripple::areCompatible
bool areCompatible(ReadView const &validLedger, ReadView const &testLedger, beast::Journal::Stream &s, char const *reason)
Return false if the test ledger is provably incompatible with the valid ledger, that is,...
Definition: View.cpp:797
ripple::LogicError
void LogicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
Definition: libxrpl/basics/contract.cpp:37
ripple::pendSaveValidated
bool pendSaveValidated(Application &app, std::shared_ptr< Ledger const > const &ledger, bool isSynchronous, bool isCurrent)
Save, or arrange to save, a fully-validated ledger Returns false on error.
Definition: Ledger.cpp:993
std::chrono
diff --git a/LedgerToJson_8cpp_source.html b/LedgerToJson_8cpp_source.html index f7cb8927f2..1747a6c44e 100644 --- a/LedgerToJson_8cpp_source.html +++ b/LedgerToJson_8cpp_source.html @@ -456,7 +456,7 @@ $(function() {
ripple::RPC::insertDeliverMax
void insertDeliverMax(Json::Value &tx_json, TxType txnType, unsigned int apiVersion)
Copy Amount field to DeliverMax field in transaction output JSON.
Definition: DeliverMax.cpp:28
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::getCloseAgree
bool getCloseAgree(LedgerHeader const &info)
Definition: LedgerHeader.h:85
-
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:553
+
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:552
ripple::fhIGNORE_FREEZE
@ fhIGNORE_FREEZE
Definition: View.h:78
ripple::serializeHex
std::string serializeHex(STObject const &o)
Serialize an object to a hex string.
Definition: serialize.h:41
ripple::addJson
void addJson(Json::Value &json, LedgerFill const &fill)
Given a Ledger and options, fill a Json::Object or Json::Value with a description of the ledger.
Definition: LedgerToJson.cpp:347
diff --git a/Livecache__test_8cpp_source.html b/Livecache__test_8cpp_source.html index 8cee0bd843..df55c5153b 100644 --- a/Livecache__test_8cpp_source.html +++ b/Livecache__test_8cpp_source.html @@ -360,7 +360,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::sum
static auto sum(TCollection const &col)
Definition: BookStep.cpp:1004
ripple::rand_int
std::enable_if_t< std::is_integral< Integral >::value, Integral > rand_int()
Definition: include/xrpl/basics/random.h:159
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
std::sort
T sort(T... args)
ripple::PeerFinder::Endpoint
Describes a connectible peer address along with some metadata.
Definition: PeerfinderManager.h:116
ripple::PeerFinder::Endpoint::address
beast::IP::Endpoint address
Definition: PeerfinderManager.h:122
diff --git a/MPTokenAuthorize_8cpp_source.html b/MPTokenAuthorize_8cpp_source.html index 0a3dd69803..b8933ecbaf 100644 --- a/MPTokenAuthorize_8cpp_source.html +++ b/MPTokenAuthorize_8cpp_source.html @@ -254,154 +254,40 @@ $(function() {
176}
177
178TER
-
179MPTokenAuthorize::authorize(
-
180 ApplyView& view,
-
181 beast::Journal journal,
-
182 MPTAuthorizeArgs const& args)
-
183{
-
184 auto const sleAcct = view.peek(keylet::account(args.account));
-
185 if (!sleAcct)
-
186 return tecINTERNAL;
-
187
-
188 // If the account that submitted the tx is a holder
-
189 // Note: `account_` is holder's account
-
190 // `holderID` is NOT used
-
191 if (!args.holderID)
-
192 {
-
193 // When a holder wants to unauthorize/delete a MPT, the ledger must
-
194 // - delete mptokenKey from owner directory
-
195 // - delete the MPToken
-
196 if (args.flags & tfMPTUnauthorize)
-
197 {
-
198 auto const mptokenKey =
-
199 keylet::mptoken(args.mptIssuanceID, args.account);
-
200 auto const sleMpt = view.peek(mptokenKey);
-
201 if (!sleMpt || (*sleMpt)[sfMPTAmount] != 0)
-
202 return tecINTERNAL; // LCOV_EXCL_LINE
-
203
-
204 if (!view.dirRemove(
-
205 keylet::ownerDir(args.account),
-
206 (*sleMpt)[sfOwnerNode],
-
207 sleMpt->key(),
-
208 false))
-
209 return tecINTERNAL; // LCOV_EXCL_LINE
-
210
-
211 adjustOwnerCount(view, sleAcct, -1, journal);
-
212
-
213 view.erase(sleMpt);
-
214 return tesSUCCESS;
-
215 }
-
216
-
217 // A potential holder wants to authorize/hold a mpt, the ledger must:
-
218 // - add the new mptokenKey to the owner directory
-
219 // - create the MPToken object for the holder
-
220
-
221 // The reserve that is required to create the MPToken. Note
-
222 // that although the reserve increases with every item
-
223 // an account owns, in the case of MPTokens we only
-
224 // *enforce* a reserve if the user owns more than two
-
225 // items. This is similar to the reserve requirements of trust lines.
-
226 std::uint32_t const uOwnerCount = sleAcct->getFieldU32(sfOwnerCount);
-
227 XRPAmount const reserveCreate(
-
228 (uOwnerCount < 2) ? XRPAmount(beast::zero)
-
229 : view.fees().accountReserve(uOwnerCount + 1));
-
230
-
231 if (args.priorBalance < reserveCreate)
-
232 return tecINSUFFICIENT_RESERVE;
-
233
-
234 auto const mptokenKey =
-
235 keylet::mptoken(args.mptIssuanceID, args.account);
-
236 auto mptoken = std::make_shared<SLE>(mptokenKey);
-
237 if (auto ter = dirLink(view, args.account, mptoken))
-
238 return ter; // LCOV_EXCL_LINE
-
239
-
240 (*mptoken)[sfAccount] = args.account;
-
241 (*mptoken)[sfMPTokenIssuanceID] = args.mptIssuanceID;
-
242 (*mptoken)[sfFlags] = 0;
-
243 view.insert(mptoken);
-
244
-
245 // Update owner count.
-
246 adjustOwnerCount(view, sleAcct, 1, journal);
-
247
-
248 return tesSUCCESS;
-
249 }
-
250
-
251 auto const sleMptIssuance =
-
252 view.read(keylet::mptIssuance(args.mptIssuanceID));
-
253 if (!sleMptIssuance)
-
254 return tecINTERNAL;
-
255
-
256 // If the account that submitted this tx is the issuer of the MPT
-
257 // Note: `account_` is issuer's account
-
258 // `holderID` is holder's account
-
259 if (args.account != (*sleMptIssuance)[sfIssuer])
-
260 return tecINTERNAL;
-
261
-
262 auto const sleMpt =
-
263 view.peek(keylet::mptoken(args.mptIssuanceID, *args.holderID));
-
264 if (!sleMpt)
-
265 return tecINTERNAL;
-
266
-
267 std::uint32_t const flagsIn = sleMpt->getFieldU32(sfFlags);
-
268 std::uint32_t flagsOut = flagsIn;
-
269
-
270 // Issuer wants to unauthorize the holder, unset lsfMPTAuthorized on
-
271 // their MPToken
-
272 if (args.flags & tfMPTUnauthorize)
-
273 flagsOut &= ~lsfMPTAuthorized;
-
274 // Issuer wants to authorize a holder, set lsfMPTAuthorized on their
-
275 // MPToken
-
276 else
-
277 flagsOut |= lsfMPTAuthorized;
-
278
-
279 if (flagsIn != flagsOut)
-
280 sleMpt->setFieldU32(sfFlags, flagsOut);
-
281
-
282 view.update(sleMpt);
-
283 return tesSUCCESS;
-
284}
-
285
-
286TER
-
287MPTokenAuthorize::doApply()
-
288{
-
289 auto const& tx = ctx_.tx;
-
290 return authorize(
-
291 ctx_.view(),
-
292 ctx_.journal,
-
293 {.priorBalance = mPriorBalance,
-
294 .mptIssuanceID = tx[sfMPTokenIssuanceID],
-
295 .account = account_,
-
296 .flags = tx.getFlags(),
-
297 .holderID = tx[~sfHolder]});
-
298}
-
299
-
300} // namespace ripple
-
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:60
+
179MPTokenAuthorize::doApply()
+
180{
+
181 auto const& tx = ctx_.tx;
+
182 return authorizeMPToken(
+
183 ctx_.view(),
+
184 mPriorBalance,
+
185 tx[sfMPTokenIssuanceID],
+
186 account_,
+
187 ctx_.journal,
+
188 tx.getFlags(),
+
189 tx[~sfHolder]);
+
190}
+
191
+
192} // namespace ripple
ripple::ApplyContext::view
ApplyView & view()
Definition: ApplyContext.h:78
ripple::ApplyContext::journal
beast::Journal const journal
Definition: ApplyContext.h:75
ripple::ApplyContext::tx
STTx const & tx
Definition: ApplyContext.h:72
ripple::ApplyView
Writeable view to a ledger, for applying a transaction.
Definition: ApplyView.h:144
-
ripple::ApplyView::update
virtual void update(std::shared_ptr< SLE > const &sle)=0
Indicate changes to a peeked SLE.
-
ripple::ApplyView::dirRemove
bool dirRemove(Keylet const &directory, std::uint64_t page, uint256 const &key, bool keepRoot)
Remove an entry from a directory.
Definition: ApplyView.cpp:190
ripple::ApplyView::insert
virtual void insert(std::shared_ptr< SLE > const &sle)=0
Insert a new state SLE.
ripple::ApplyView::dirInsert
std::optional< std::uint64_t > dirInsert(Keylet const &directory, uint256 const &key, std::function< void(std::shared_ptr< SLE > const &)> const &describe)
Insert an entry to a directory.
Definition: ApplyView.h:318
-
ripple::ApplyView::peek
virtual std::shared_ptr< SLE > peek(Keylet const &k)=0
Prepare to modify the SLE associated with key.
-
ripple::ApplyView::erase
virtual void erase(std::shared_ptr< SLE > const &sle)=0
Remove a peeked SLE.
ripple::MPTokenAuthorize::createMPToken
static TER createMPToken(ApplyView &view, MPTID const &mptIssuanceID, AccountID const &account, std::uint32_t const flags)
Definition: MPTokenAuthorize.cpp:153
ripple::MPTokenAuthorize::preflight
static NotTEC preflight(PreflightContext const &ctx)
Definition: MPTokenAuthorize.cpp:30
-
ripple::MPTokenAuthorize::doApply
TER doApply() override
Definition: MPTokenAuthorize.cpp:287
+
ripple::MPTokenAuthorize::doApply
TER doApply() override
Definition: MPTokenAuthorize.cpp:179
ripple::MPTokenAuthorize::preclaim
static TER preclaim(PreclaimContext const &ctx)
Definition: MPTokenAuthorize.cpp:48
-
ripple::MPTokenAuthorize::authorize
static TER authorize(ApplyView &view, beast::Journal journal, MPTAuthorizeArgs const &args)
Definition: MPTokenAuthorize.cpp:179
ripple::ReadView::read
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
-
ripple::ReadView::fees
virtual Fees const & fees() const =0
Returns the fees for the base ledger.
ripple::ReadView::exists
virtual bool exists(Keylet const &k) const =0
Determine if a state item exists.
ripple::ReadView::rules
virtual Rules const & rules() const =0
Returns the tx processing rules.
ripple::Rules::enabled
bool enabled(uint256 const &feature) const
Returns true if a feature is enabled.
Definition: Rules.cpp:130
ripple::STObject::getFlags
std::uint32_t getFlags() const
Definition: STObject.cpp:537
ripple::TERSubset< CanCvtToTER >
+
ripple::Transactor::account_
AccountID const account_
Definition: Transactor.h:143
ripple::Transactor::view
ApplyView & view()
Definition: Transactor.h:159
+
ripple::Transactor::mPriorBalance
XRPAmount mPriorBalance
Definition: Transactor.h:144
ripple::Transactor::ctx_
ApplyContext & ctx_
Definition: Transactor.h:140
-
ripple::XRPAmount
Definition: XRPAmount.h:43
ripple::base_uint< 192 >
std::uint32_t
ripple::keylet::mptoken
Keylet mptoken(MPTID const &issuanceID, AccountID const &holder) noexcept
Definition: Indexes.cpp:540
@@ -410,40 +296,28 @@ $(function() {
ripple::keylet::ownerDir
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Definition: Indexes.cpp:374
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::lsfMPTRequireAuth
@ lsfMPTRequireAuth
Definition: LedgerFormats.h:185
-
ripple::lsfMPTAuthorized
@ lsfMPTAuthorized
Definition: LedgerFormats.h:192
ripple::lsfMPTLocked
@ lsfMPTLocked
Definition: LedgerFormats.h:183
ripple::tfMPTokenAuthorizeMask
constexpr std::uint32_t const tfMPTokenAuthorizeMask
Definition: TxFlags.h:156
-
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1049
+
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1048
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
-
ripple::adjustOwnerCount
static bool adjustOwnerCount(ApplyContext &ctx, int count)
Definition: SetOracle.cpp:186
+
ripple::authorizeMPToken
TER authorizeMPToken(ApplyView &view, XRPAmount const &priorBalance, MPTID const &mptIssuanceID, AccountID const &account, beast::Journal journal, std::uint32_t flags, std::optional< AccountID > holderID)
Definition: View.cpp:1221
ripple::tfMPTUnauthorize
constexpr std::uint32_t const tfMPTUnauthorize
Definition: TxFlags.h:155
ripple::preflight2
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
Definition: Transactor.cpp:160
ripple::tecNO_DST
@ tecNO_DST
Definition: TER.h:290
ripple::tecOBJECT_NOT_FOUND
@ tecOBJECT_NOT_FOUND
Definition: TER.h:326
ripple::tecDIR_FULL
@ tecDIR_FULL
Definition: TER.h:287
ripple::tecDUPLICATE
@ tecDUPLICATE
Definition: TER.h:315
-
ripple::tecINTERNAL
@ tecINTERNAL
Definition: TER.h:310
ripple::tecNO_PERMISSION
@ tecNO_PERMISSION
Definition: TER.h:305
ripple::tecHAS_OBLIGATIONS
@ tecHAS_OBLIGATIONS
Definition: TER.h:317
-
ripple::tecINSUFFICIENT_RESERVE
@ tecINSUFFICIENT_RESERVE
Definition: TER.h:307
ripple::tecNO_AUTH
@ tecNO_AUTH
Definition: TER.h:300
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
-
ripple::dirLink
TER dirLink(ApplyView &view, AccountID const &owner, std::shared_ptr< SLE > &object)
Definition: View.cpp:1057
ripple::temMALFORMED
@ temMALFORMED
Definition: TER.h:87
ripple::temINVALID_FLAG
@ temINVALID_FLAG
Definition: TER.h:111
ripple::temDISABLED
@ temDISABLED
Definition: TER.h:114
std::shared_ptr
-
ripple::Fees::accountReserve
XRPAmount accountReserve(std::size_t ownerCount) const
Returns the account reserve given the owner count, in drops.
Definition: protocol/Fees.h:49
-
ripple::Keylet::key
uint256 key
Definition: Keylet.h:40
-
ripple::MPTAuthorizeArgs
Definition: MPTokenAuthorize.h:28
-
ripple::MPTAuthorizeArgs::flags
std::uint32_t flags
Definition: MPTokenAuthorize.h:32
-
ripple::MPTAuthorizeArgs::account
AccountID const & account
Definition: MPTokenAuthorize.h:31
-
ripple::MPTAuthorizeArgs::holderID
std::optional< AccountID > holderID
Definition: MPTokenAuthorize.h:33
-
ripple::MPTAuthorizeArgs::mptIssuanceID
MPTID const & mptIssuanceID
Definition: MPTokenAuthorize.h:30
-
ripple::MPTAuthorizeArgs::priorBalance
XRPAmount const & priorBalance
Definition: MPTokenAuthorize.h:29
ripple::PreclaimContext
State information when determining if a tx is likely to claim a fee.
Definition: Transactor.h:79
ripple::PreclaimContext::view
ReadView const & view
Definition: Transactor.h:82
ripple::PreclaimContext::tx
STTx const & tx
Definition: Transactor.h:85
diff --git a/MPTokenAuthorize_8h_source.html b/MPTokenAuthorize_8h_source.html index 80915ae5f1..eb45d63818 100644 --- a/MPTokenAuthorize_8h_source.html +++ b/MPTokenAuthorize_8h_source.html @@ -127,26 +127,19 @@ $(function() {
49 preclaim(PreclaimContext const& ctx);
50
51 static TER
-
52 authorize(
+
52 createMPToken(
53 ApplyView& view,
-
54 beast::Journal journal,
-
55 MPTAuthorizeArgs const& args);
-
56
-
57 static TER
-
58 createMPToken(
-
59 ApplyView& view,
-
60 MPTID const& mptIssuanceID,
-
61 AccountID const& account,
-
62 std::uint32_t const flags);
+
54 MPTID const& mptIssuanceID,
+
55 AccountID const& account,
+
56 std::uint32_t const flags);
+
57
+
58 TER
+
59 doApply() override;
+
60};
+
61
+
62} // namespace ripple
63
-
64 TER
-
65 doApply() override;
-
66};
-
67
-
68} // namespace ripple
-
69
-
70#endif
-
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:60
+
64#endif
ripple::ApplyContext
State information when applying a tx.
Definition: ApplyContext.h:37
ripple::ApplyView
Writeable view to a ledger, for applying a transaction.
Definition: ApplyView.h:144
ripple::MPTokenAuthorize
Definition: MPTokenAuthorize.h:37
@@ -154,9 +147,8 @@ $(function() {
ripple::MPTokenAuthorize::MPTokenAuthorize
MPTokenAuthorize(ApplyContext &ctx)
Definition: MPTokenAuthorize.h:41
ripple::MPTokenAuthorize::preflight
static NotTEC preflight(PreflightContext const &ctx)
Definition: MPTokenAuthorize.cpp:30
ripple::MPTokenAuthorize::ConsequencesFactory
static constexpr ConsequencesFactoryType ConsequencesFactory
Definition: MPTokenAuthorize.h:39
-
ripple::MPTokenAuthorize::doApply
TER doApply() override
Definition: MPTokenAuthorize.cpp:287
+
ripple::MPTokenAuthorize::doApply
TER doApply() override
Definition: MPTokenAuthorize.cpp:179
ripple::MPTokenAuthorize::preclaim
static TER preclaim(PreclaimContext const &ctx)
Definition: MPTokenAuthorize.cpp:48
-
ripple::MPTokenAuthorize::authorize
static TER authorize(ApplyView &view, beast::Journal journal, MPTAuthorizeArgs const &args)
Definition: MPTokenAuthorize.cpp:179
ripple::TERSubset
Definition: TER.h:411
ripple::Transactor
Definition: Transactor.h:138
ripple::Transactor::ConsequencesFactoryType
ConsequencesFactoryType
Definition: Transactor.h:153
diff --git a/MPTokenIssuanceCreate_8cpp_source.html b/MPTokenIssuanceCreate_8cpp_source.html index 70266cff17..36d524d2a6 100644 --- a/MPTokenIssuanceCreate_8cpp_source.html +++ b/MPTokenIssuanceCreate_8cpp_source.html @@ -271,7 +271,7 @@ $(function() {
ripple::maxMPTokenAmount
std::uint64_t constexpr maxMPTokenAmount
The maximum amount of MPTokenIssuance.
Definition: Protocol.h:117
ripple::tfMPTokenIssuanceCreateMask
constexpr std::uint32_t const tfMPTokenIssuanceCreateMask
Definition: TxFlags.h:151
ripple::maxTransferFee
std::uint16_t constexpr maxTransferFee
The maximum token transfer fee allowed.
Definition: Protocol.h:83
-
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1049
+
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1048
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::maxMPTokenMetadataLength
std::size_t constexpr maxMPTokenMetadataLength
The maximum length of MPTokenMetadata.
Definition: Protocol.h:114
ripple::adjustOwnerCount
static bool adjustOwnerCount(ApplyContext &ctx, int count)
Definition: SetOracle.cpp:186
diff --git a/NFTOffers_8cpp_source.html b/NFTOffers_8cpp_source.html index 404e9becb8..af3153e24a 100644 --- a/NFTOffers_8cpp_source.html +++ b/NFTOffers_8cpp_source.html @@ -283,7 +283,7 @@ $(function() {
ripple::doNFTSellOffers
Json::Value doNFTSellOffers(RPC::JsonContext &)
Definition: NFTOffers.cpp:151
ripple::appendNftOfferJson
static void appendNftOfferJson(Application const &app, std::shared_ptr< SLE const > const &offer, Json::Value &offers)
Definition: NFTOffers.cpp:35
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
-
ripple::forEachItemAfter
bool forEachItemAfter(ReadView const &view, Keylet const &root, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items after an item in the given directory.
Definition: View.cpp:683
+
ripple::forEachItemAfter
bool forEachItemAfter(ReadView const &view, Keylet const &root, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items after an item in the given directory.
Definition: View.cpp:682
std::shared_ptr
ripple::Keylet
A pair of SHAMap key and LedgerEntryType.
Definition: Keylet.h:39
ripple::Keylet::key
uint256 key
Definition: Keylet.h:40
diff --git a/NFTokenAcceptOffer_8cpp_source.html b/NFTokenAcceptOffer_8cpp_source.html index 7d0a4c1adb..f98ac1ebda 100644 --- a/NFTokenAcceptOffer_8cpp_source.html +++ b/NFTokenAcceptOffer_8cpp_source.html @@ -727,7 +727,7 @@ $(function() {
ripple::nft::checkTrustlineAuthorized
TER checkTrustlineAuthorized(ReadView const &view, AccountID const id, beast::Journal const j, Issue const &issue)
Definition: NFTokenUtils.cpp:1097
ripple::nft::transferFeeAsRate
Rate transferFeeAsRate(std::uint16_t fee)
Given a transfer fee (in basis points) convert it to a transfer rate.
Definition: Rate2.cpp:45
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:553
+
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:552
ripple::fhZERO_IF_FROZEN
@ fhZERO_IF_FROZEN
Definition: View.h:78
ripple::lsfSellNFToken
@ lsfSellNFToken
Definition: LedgerFormats.h:180
ripple::multiply
STAmount multiply(STAmount const &amount, Rate const &rate)
Definition: Rate2.cpp:53
@@ -745,12 +745,12 @@ $(function() {
ripple::tecCANT_ACCEPT_OWN_NFTOKEN_OFFER
@ tecCANT_ACCEPT_OWN_NFTOKEN_OFFER
Definition: TER.h:324
ripple::tecEXPIRED
@ tecEXPIRED
Definition: TER.h:314
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
-
ripple::hasExpired
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
Definition: View.cpp:175
+
ripple::hasExpired
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
Definition: View.cpp:174
ripple::tfNFTokenAcceptOfferMask
constexpr std::uint32_t const tfNFTokenAcceptOfferMask
Definition: TxFlags.h:202
-
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2011
+
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2114
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
ripple::temMALFORMED
@ temMALFORMED
Definition: TER.h:87
ripple::temBAD_OFFER
@ temBAD_OFFER
Definition: TER.h:95
diff --git a/NFTokenCreateOffer_8cpp_source.html b/NFTokenCreateOffer_8cpp_source.html index c0bfa6eaf5..bb48daf789 100644 --- a/NFTokenCreateOffer_8cpp_source.html +++ b/NFTokenCreateOffer_8cpp_source.html @@ -212,7 +212,7 @@ $(function() {
ripple::tecNO_ENTRY
@ tecNO_ENTRY
Definition: TER.h:306
ripple::tecEXPIRED
@ tecEXPIRED
Definition: TER.h:314
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
-
ripple::hasExpired
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
Definition: View.cpp:175
+
ripple::hasExpired
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
Definition: View.cpp:174
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
ripple::temINVALID_FLAG
@ temINVALID_FLAG
Definition: TER.h:111
ripple::temDISABLED
@ temDISABLED
Definition: TER.h:114
diff --git a/NFTokenMint_8cpp_source.html b/NFTokenMint_8cpp_source.html index 2e5e1383d1..69e02e3ecf 100644 --- a/NFTokenMint_8cpp_source.html +++ b/NFTokenMint_8cpp_source.html @@ -500,7 +500,7 @@ $(function() {
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
ripple::root
Number root(Number f, unsigned d)
Definition: Number.cpp:636
-
ripple::hasExpired
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
Definition: View.cpp:175
+
ripple::hasExpired
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
Definition: View.cpp:174
ripple::extractNFTokenFlagsFromTxFlags
static std::uint16_t extractNFTokenFlagsFromTxFlags(std::uint32_t txFlags)
Definition: NFTokenMint.cpp:36
ripple::tfTransferable
constexpr std::uint32_t const tfTransferable
Definition: TxFlags.h:140
ripple::tfNFTokenMintMask
constexpr std::uint32_t const tfNFTokenMintMask
Definition: TxFlags.h:180
diff --git a/NFTokenUtils_8cpp_source.html b/NFTokenUtils_8cpp_source.html index 8d5d54b986..ae82da58f4 100644 --- a/NFTokenUtils_8cpp_source.html +++ b/NFTokenUtils_8cpp_source.html @@ -1368,7 +1368,7 @@ $(function() {
ripple::nft::mergePages
static bool mergePages(ApplyView &view, std::shared_ptr< SLE > const &p1, std::shared_ptr< SLE > const &p2)
Definition: NFTokenUtils.cpp:322
ripple::nft::pageMask
uint256 constexpr pageMask(std::string_view("0000000000000000000000000000000000000000ffffffffffffffffffffffff"))
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:553
+
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:552
ripple::fhZERO_IF_FROZEN
@ fhZERO_IF_FROZEN
Definition: View.h:78
ripple::isXRP
bool isXRP(AccountID const &c)
Definition: AccountID.h:90
ripple::tfSellNFToken
constexpr std::uint32_t const tfSellNFToken
Definition: TxFlags.h:194
@@ -1382,9 +1382,9 @@ $(function() {
ripple::lsfSellNFToken
@ lsfSellNFToken
Definition: LedgerFormats.h:180
ripple::lsfLowAuth
@ lsfLowAuth
Definition: LedgerFormats.h:161
ripple::maxDeletableTokenOfferEntries
std::size_t constexpr maxDeletableTokenOfferEntries
The maximum number of offers in an offer directory for NFT to be burnable.
Definition: Protocol.h:72
-
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1049
+
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1048
ripple::dirMaxTokensPerPage
std::size_t constexpr dirMaxTokensPerPage
The maximum number of items in an NFT page.
Definition: Protocol.h:63
-
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:249
+
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:248
ripple::tefNFTOKEN_IS_NOT_TRANSFERABLE
@ tefNFTOKEN_IS_NOT_TRANSFERABLE
Definition: TER.h:186
ripple::tefTOO_BIG
@ tefTOO_BIG
Definition: TER.h:184
ripple::adjustOwnerCount
static bool adjustOwnerCount(ApplyContext &ctx, int count)
Definition: SetOracle.cpp:186
@@ -1402,7 +1402,7 @@ $(function() {
ripple::tecINSUFFICIENT_RESERVE
@ tecINSUFFICIENT_RESERVE
Definition: TER.h:307
ripple::tecNO_AUTH
@ tecNO_AUTH
Definition: TER.h:300
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::root
Number root(Number f, unsigned d)
Definition: Number.cpp:636
ripple::temBAD_AMOUNT
@ temBAD_AMOUNT
Definition: TER.h:89
diff --git a/NetworkOPs_8cpp_source.html b/NetworkOPs_8cpp_source.html index b85cd49c22..cee5107373 100644 --- a/NetworkOPs_8cpp_source.html +++ b/NetworkOPs_8cpp_source.html @@ -5273,12 +5273,12 @@ $(function() {
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:114
ripple::divide
STAmount divide(STAmount const &amount, Rate const &rate)
Definition: Rate2.cpp:93
ripple::sterilize
std::shared_ptr< STTx const > sterilize(STTx const &stx)
Sterilize a transaction.
Definition: STTx.cpp:811
-
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:553
+
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:552
ripple::fhZERO_IF_FROZEN
@ fhZERO_IF_FROZEN
Definition: View.h:78
ripple::fhIGNORE_FREEZE
@ fhIGNORE_FREEZE
Definition: View.h:78
ripple::TokenType::None
@ None
ripple::TokenType::NodePublic
@ NodePublic
-
ripple::cdirFirst
bool cdirFirst(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the first entry in the directory, advancing the index.
Definition: View.cpp:147
+
ripple::cdirFirst
bool cdirFirst(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the first entry in the directory, advancing the index.
Definition: View.cpp:146
ripple::getQuality
std::uint64_t getQuality(uint256 const &uBase)
Definition: Indexes.cpp:149
ripple::INCLUDED
@ INCLUDED
Definition: Transaction.h:49
ripple::HELD
@ HELD
Definition: Transaction.h:52
@@ -5291,7 +5291,7 @@ $(function() {
ripple::generateKeyPair
std::pair< PublicKey, SecretKey > generateKeyPair(KeyType type, Seed const &seed)
Generate a key pair deterministically.
Definition: SecretKey.cpp:369
ripple::muldiv_max
auto constexpr muldiv_max
Definition: mulDiv.h:28
ripple::make_LocalTxs
std::unique_ptr< LocalTxs > make_LocalTxs()
Definition: LocalTxs.cpp:192
-
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:761
+
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:760
ripple::amountFromQuality
STAmount amountFromQuality(std::uint64_t rate)
Definition: STAmount.cpp:1013
ripple::handleNewValidation
void handleNewValidation(Application &app, std::shared_ptr< STValidation > const &val, std::string const &source, BypassAccept const bypassAccept, std::optional< beast::Journal > j)
Handle a new validation.
Definition: RCLValidations.cpp:165
ripple::make_NetworkOPs
std::unique_ptr< NetworkOPs > make_NetworkOPs(Application &app, NetworkOPs::clock_type &clock, bool standalone, std::size_t minPeerCount, bool startvalid, JobQueue &job_queue, LedgerMaster &ledgerMaster, ValidatorKeys const &validatorKeys, boost::asio::io_service &io_svc, beast::Journal journal, beast::insight::Collector::ptr const &collector)
Definition: NetworkOPs.cpp:4849
@@ -5316,14 +5316,14 @@ $(function() {
ripple::ConsensusPhase
ConsensusPhase
Phases of consensus for a single ledger round.
Definition: ConsensusTypes.h:105
ripple::stateNames
static std::array< char const *, 5 > const stateNames
Definition: NetworkOPs.cpp:871
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
-
ripple::cdirNext
bool cdirNext(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the next entry in the directory, advancing the index.
Definition: View.cpp:158
+
ripple::cdirNext
bool cdirNext(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the next entry in the directory, advancing the index.
Definition: View.cpp:157
ripple::KeyType::secp256k1
@ secp256k1
ripple::forAllApiVersions
void forAllApiVersions(Fn const &fn, Args &&... args)
Definition: ApiVersion.h:101
ripple::isTerRetry
bool isTerRetry(TER x) noexcept
Definition: TER.h:668
ripple::send_if
send_if_pred< Predicate > send_if(std::shared_ptr< Message > const &m, Predicate const &f)
Helper function to aid in type deduction.
Definition: predicates.h:75
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
ripple::getQualityNext
uint256 getQualityNext(uint256 const &uBase)
Definition: Indexes.cpp:141
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
ripple::makeRulesGivenLedger
Rules makeRulesGivenLedger(DigestAwareReadView const &ledger, Rules const &current)
Definition: ReadView.cpp:69
ripple::to_string_iso
std::string to_string_iso(date::sys_time< Duration > tp)
Definition: chrono.h:92
@@ -5355,7 +5355,7 @@ $(function() {
ripple::getBookBase
uint256 getBookBase(Book const &book)
Definition: Indexes.cpp:115
ripple::tfInnerBatchTxn
constexpr std::uint32_t tfInnerBatchTxn
Definition: TxFlags.h:61
ripple::parityRate
Rate const parityRate
A transfer rate signifying a 1:1 exchange.
-
ripple::isGlobalFrozen
bool isGlobalFrozen(ReadView const &view, AccountID const &issuer)
Definition: View.cpp:184
+
ripple::isGlobalFrozen
bool isGlobalFrozen(ReadView const &view, AccountID const &issuer)
Definition: View.cpp:183
ripple::trunc32
static std::uint32_t trunc32(std::uint64_t v)
Definition: NetworkOPs.cpp:2295
ripple::temINVALID_FLAG
@ temINVALID_FLAG
Definition: TER.h:111
ripple::temBAD_SIGNATURE
@ temBAD_SIGNATURE
Definition: TER.h:105
diff --git a/NoRippleCheck_8cpp_source.html b/NoRippleCheck_8cpp_source.html index 47ef3997ab..37b9747cb6 100644 --- a/NoRippleCheck_8cpp_source.html +++ b/NoRippleCheck_8cpp_source.html @@ -315,7 +315,7 @@ $(function() {
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:31
ripple::tfClearNoRipple
constexpr std::uint32_t tfClearNoRipple
Definition: TxFlags.h:117
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
-
ripple::forEachItemAfter
bool forEachItemAfter(ReadView const &view, Keylet const &root, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items after an item in the given directory.
Definition: View.cpp:683
+
ripple::forEachItemAfter
bool forEachItemAfter(ReadView const &view, Keylet const &root, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items after an item in the given directory.
Definition: View.cpp:682
ripple::scaleFeeLoad
XRPAmount scaleFeeLoad(XRPAmount fee, LoadFeeTrack const &feeTrack, Fees const &fees, bool bUnlimited)
Definition: LoadFeeTrack.cpp:85
ripple::tfSetNoRipple
constexpr std::uint32_t tfSetNoRipple
Definition: TxFlags.h:116
ripple::fillTransaction
static void fillTransaction(RPC::JsonContext &context, Json::Value &txArray, AccountID const &accountID, std::uint32_t &sequence, ReadView const &ledger)
Definition: NoRippleCheck.cpp:36
diff --git a/OfferStream_8cpp_source.html b/OfferStream_8cpp_source.html index a60f367400..44e690e2bc 100644 --- a/OfferStream_8cpp_source.html +++ b/OfferStream_8cpp_source.html @@ -542,16 +542,16 @@ $(function() {
ripple::keylet::page
Keylet page(uint256 const &root, std::uint64_t index=0) noexcept
A page in a directory.
Definition: Indexes.cpp:380
ripple::permissioned_dex::offerInDomain
bool offerInDomain(ReadView const &view, uint256 const &offerID, Domain const &domainID, beast::Journal j)
Definition: PermissionedDEXHelpers.cpp:57
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:553
+
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:552
ripple::FreezeHandling
FreezeHandling
Controls the treatment of frozen account balances.
Definition: View.h:78
ripple::fhZERO_IF_FROZEN
@ fhZERO_IF_FROZEN
Definition: View.h:78
ripple::isXRP
bool isXRP(AccountID const &c)
Definition: AccountID.h:90
-
ripple::isDeepFrozen
bool isDeepFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:349
+
ripple::isDeepFrozen
bool isDeepFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:348
ripple::accountFundsHelper
static STAmount accountFundsHelper(ReadView const &view, AccountID const &id, STAmount const &saDefault, Issue const &, FreezeHandling freezeHandling, beast::Journal j)
Definition: OfferStream.cpp:100
ripple::toAmount< IOUAmount >
IOUAmount toAmount< IOUAmount >(STAmount const &amt)
Definition: AmountConversions.h:75
-
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1471
+
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1574
ripple::erase
void erase(STObject &st, TypedField< U > const &f)
Remove a field in an STObject.
Definition: STExchange.h:172
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
ripple::toAmount< XRPAmount >
XRPAmount toAmount< XRPAmount >(STAmount const &amt)
Definition: AmountConversions.h:90
std::shared_ptr
std::chrono::time_point
diff --git a/Offer_8h_source.html b/Offer_8h_source.html index 8dec349a69..48f2ef7c09 100644 --- a/Offer_8h_source.html +++ b/Offer_8h_source.html @@ -450,7 +450,7 @@ $(function() {
ripple::operator<<
std::ostream & operator<<(std::ostream &out, base_uint< Bits, Tag > const &u)
Definition: base_uint.h:637
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::getCurrentTransactionRules
std::optional< Rules > const & getCurrentTransactionRules()
Definition: Rules.cpp:47
-
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2011
+
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2114
std::optional
std::pair
std::shared_ptr< STLedgerEntry >
diff --git a/Offer__test_8cpp_source.html b/Offer__test_8cpp_source.html index beabdde52b..810d740d9b 100644 --- a/Offer__test_8cpp_source.html +++ b/Offer__test_8cpp_source.html @@ -5743,7 +5743,7 @@ $(function() {
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::ReleaseStrongRefAction::noop
@ noop
-
ripple::forEachItem
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:655
+
ripple::forEachItem
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:654
ripple::getJson
Json::Value getJson(LedgerFill const &fill)
Return a new Json::Value representing the ledger with given options.
Definition: LedgerToJson.cpp:357
ripple::tfSell
constexpr std::uint32_t tfSell
Definition: TxFlags.h:101
ripple::asfRequireAuth
constexpr std::uint32_t asfRequireAuth
Definition: TxFlags.h:78
diff --git a/PathSet_8h_source.html b/PathSet_8h_source.html index cc21be1076..187aae16e9 100644 --- a/PathSet_8h_source.html +++ b/PathSet_8h_source.html @@ -315,7 +315,7 @@ $(function() {
ripple::test::isOffer
bool isOffer(jtx::Env &env, jtx::Account const &account, STAmount const &takerPays, STAmount const &takerGets)
An offer exists.
Definition: PathSet.h:72
ripple::test::countOffers
std::size_t countOffers(jtx::Env &env, jtx::Account const &account, Issue const &takerPays, Issue const &takerGets)
Count offer.
Definition: PathSet.h:34
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::forEachItem
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:655
+
ripple::forEachItem
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:654
std::shared_ptr
std::size_t
ripple::JsonOptions::none
@ none
Definition: STBase.h:43
diff --git a/PayChan_8cpp_source.html b/PayChan_8cpp_source.html index 4332609c5e..b5052de77b 100644 --- a/PayChan_8cpp_source.html +++ b/PayChan_8cpp_source.html @@ -734,7 +734,7 @@ $(function() {
ripple::lsfRequireDestTag
@ lsfRequireDestTag
Definition: LedgerFormats.h:126
ripple::lsfDisallowIncomingPayChan
@ lsfDisallowIncomingPayChan
Definition: LedgerFormats.h:144
ripple::lsfDisallowXRP
@ lsfDisallowXRP
Definition: LedgerFormats.h:130
-
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1049
+
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1048
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::verifyDepositPreauth
TER verifyDepositPreauth(STTx const &tx, ApplyView &view, AccountID const &src, AccountID const &dst, std::shared_ptr< SLE > const &sleDst, beast::Journal j)
Definition: CredentialHelpers.cpp:358
ripple::serializePayChanAuthorization
void serializePayChanAuthorization(Serializer &msg, uint256 const &key, XRPAmount const &amt)
Definition: include/xrpl/protocol/PayChan.h:31
@@ -757,11 +757,11 @@ $(function() {
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
ripple::tfClose
constexpr std::uint32_t tfClose
Definition: TxFlags.h:133
ripple::tfPayChanClaimMask
constexpr std::uint32_t tfPayChanClaimMask
Definition: TxFlags.h:134
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
ripple::tfUniversalMask
constexpr std::uint32_t tfUniversalMask
Definition: TxFlags.h:63
ripple::terNO_ACCOUNT
@ terNO_ACCOUNT
Definition: TER.h:217
ripple::TER
TERSubset< CanCvtToTER > TER
Definition: TER.h:645
-
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1140
+
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1139
ripple::temBAD_AMOUNT
@ temBAD_AMOUNT
Definition: TER.h:89
ripple::temBAD_SIGNER
@ temBAD_SIGNER
Definition: TER.h:115
ripple::temMALFORMED
@ temMALFORMED
Definition: TER.h:87
diff --git a/PaymentSandbox_8cpp_source.html b/PaymentSandbox_8cpp_source.html index f074eec55d..87a035c551 100644 --- a/PaymentSandbox_8cpp_source.html +++ b/PaymentSandbox_8cpp_source.html @@ -518,7 +518,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::isXRP
bool isXRP(AccountID const &c)
Definition: AccountID.h:90
ripple::xrpAccount
AccountID const & xrpAccount()
Compute AccountID from public key.
Definition: AccountID.cpp:178
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
std::optional
std::shared_ptr
ripple::detail::DeferredCredits::Value
Definition: PaymentSandbox.h:82
diff --git a/PaymentSandbox__test_8cpp_source.html b/PaymentSandbox__test_8cpp_source.html index bf29a76bc6..f3216f4713 100644 --- a/PaymentSandbox__test_8cpp_source.html +++ b/PaymentSandbox__test_8cpp_source.html @@ -561,19 +561,19 @@ $(function() {
ripple::fhZERO_IF_FROZEN
@ fhZERO_IF_FROZEN
Definition: View.h:78
ripple::fhIGNORE_FREEZE
@ fhIGNORE_FREEZE
Definition: View.h:78
ripple::xrpAccount
AccountID const & xrpAccount()
Compute AccountID from public key.
Definition: AccountID.cpp:178
-
ripple::redeemIOU
TER redeemIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
Definition: View.cpp:2185
+
ripple::redeemIOU
TER redeemIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
Definition: View.cpp:2288
ripple::tfPassive
constexpr std::uint32_t tfPassive
Definition: TxFlags.h:98
ripple::tfPartialPayment
constexpr std::uint32_t tfPartialPayment
Definition: TxFlags.h:108
ripple::xrpCurrency
Currency const & xrpCurrency()
XRP currency.
Definition: UintTypes.cpp:119
-
ripple::issueIOU
TER issueIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
Definition: View.cpp:2085
+
ripple::issueIOU
TER issueIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
Definition: View.cpp:2188
ripple::noIssue
Issue const & noIssue()
Returns an asset specifier that represents no account and currency.
Definition: Issue.h:123
ripple::tfNoRippleDirect
constexpr std::uint32_t tfNoRippleDirect
Definition: TxFlags.h:107
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
ripple::tapNONE
@ tapNONE
Definition: ApplyView.h:32
-
ripple::rippleCredit
TER rippleCredit(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Calls static rippleCreditIOU if saAmount represents Issue.
Definition: View.cpp:2669
+
ripple::rippleCredit
TER rippleCredit(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Calls static rippleCreditIOU if saAmount represents Issue.
Definition: View.cpp:2769
ripple::toAmount< XRPAmount >
XRPAmount toAmount< XRPAmount >(STAmount const &amt)
Definition: AmountConversions.h:90
-
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2011
+
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2114
ripple::STAmount::unchecked
Definition: STAmount.h:86
diff --git a/Payment_8cpp_source.html b/Payment_8cpp_source.html index 01a344ef2a..e7ffadde5e 100644 --- a/Payment_8cpp_source.html +++ b/Payment_8cpp_source.html @@ -845,13 +845,13 @@ $(function() {
ripple::divide
STAmount divide(STAmount const &amount, Rate const &rate)
Definition: Rate2.cpp:93
ripple::badCurrency
Currency const & badCurrency()
We deliberately disallow the currency that looks like "XRP" because too many people were using it ins...
Definition: UintTypes.cpp:133
ripple::equalTokens
constexpr bool equalTokens(Asset const &lhs, Asset const &rhs)
Definition: Asset.h:201
-
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2301
+
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2404
ripple::isXRP
bool isXRP(AccountID const &c)
Definition: AccountID.h:90
ripple::telBAD_PATH_COUNT
@ telBAD_PATH_COUNT
Definition: TER.h:54
ripple::telNO_DST_PARTIAL
@ telNO_DST_PARTIAL
Definition: TER.h:58
ripple::isLegalNet
bool isLegalNet(STAmount const &value)
Definition: STAmount.h:600
ripple::tfMPTPaymentMask
constexpr std::uint32_t tfMPTPaymentMask
Definition: TxFlags.h:112
-
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:761
+
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:760
ripple::getMaxSourceAmount
STAmount getMaxSourceAmount(AccountID const &account, STAmount const &dstAmount, std::optional< STAmount > const &sendMax)
Definition: Payment.cpp:51
ripple::lsfRequireDestTag
@ lsfRequireDestTag
Definition: LedgerFormats.h:126
ripple::lsfPasswordSpent
@ lsfPasswordSpent
Definition: LedgerFormats.h:125
@@ -859,7 +859,7 @@ $(function() {
ripple::multiply
STAmount multiply(STAmount const &amount, Rate const &rate)
Definition: Rate2.cpp:53
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::verifyDepositPreauth
TER verifyDepositPreauth(STTx const &tx, ApplyView &view, AccountID const &src, AccountID const &dst, std::shared_ptr< SLE > const &sleDst, beast::Journal j)
Definition: CredentialHelpers.cpp:358
-
ripple::canTransfer
TER canTransfer(ReadView const &view, MPTIssue const &mptIssue, AccountID const &from, AccountID const &to)
Check if the destination account is allowed to receive MPT.
Definition: View.cpp:2522
+
ripple::canTransfer
TER canTransfer(ReadView const &view, MPTIssue const &mptIssue, AccountID const &from, AccountID const &to)
Check if the destination account is allowed to receive MPT.
Definition: View.cpp:2622
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
ripple::tfPartialPayment
constexpr std::uint32_t tfPartialPayment
Definition: TxFlags.h:108
ripple::loadGranularPermission
void loadGranularPermission(std::shared_ptr< SLE const > const &delegate, TxType const &type, std::unordered_set< GranularPermissionType > &granularPermissions)
Load the granular permissions granted to the delegate account for the specified transaction type.
Definition: DelegateUtils.cpp:45
@@ -882,9 +882,9 @@ $(function() {
ripple::tfPaymentMask
constexpr std::uint32_t tfPaymentMask
Definition: TxFlags.h:110
ripple::tfLimitQuality
constexpr std::uint32_t tfLimitQuality
Definition: TxFlags.h:109
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
-
ripple::isAnyFrozen
bool isAnyFrozen(ReadView const &view, std::initializer_list< AccountID > const &accounts, MPTIssue const &mptIssue, int depth)
Definition: View.cpp:284
-
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1140
-
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2011
+
ripple::isAnyFrozen
bool isAnyFrozen(ReadView const &view, std::initializer_list< AccountID > const &accounts, MPTIssue const &mptIssue, int depth)
Definition: View.cpp:283
+
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1139
+
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2114
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
ripple::temBAD_SEND_XRP_PARTIAL
@ temBAD_SEND_XRP_PARTIAL
Definition: TER.h:102
ripple::temBAD_AMOUNT
@ temBAD_AMOUNT
Definition: TER.h:89
diff --git a/PermissionedDomainSet_8cpp_source.html b/PermissionedDomainSet_8cpp_source.html index 203ebd62ca..5ca21e3462 100644 --- a/PermissionedDomainSet_8cpp_source.html +++ b/PermissionedDomainSet_8cpp_source.html @@ -265,7 +265,7 @@ $(function() {
ripple::keylet::ownerDir
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Definition: Indexes.cpp:374
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::maxPermissionedDomainCredentialsArraySize
std::size_t constexpr maxPermissionedDomainCredentialsArraySize
The maximum number of credentials can be passed in array for permissioned domain.
Definition: Protocol.h:111
-
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1049
+
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1048
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
ripple::adjustOwnerCount
static bool adjustOwnerCount(ApplyContext &ctx, int count)
Definition: SetOracle.cpp:186
diff --git a/RCLConsensus_8cpp_source.html b/RCLConsensus_8cpp_source.html index 1435cbded4..f1ae8b6867 100644 --- a/RCLConsensus_8cpp_source.html +++ b/RCLConsensus_8cpp_source.html @@ -1364,7 +1364,7 @@ $(function() {
ripple::make_shamapitem
boost::intrusive_ptr< SHAMapItem > make_shamapitem(uint256 const &tag, Slice data)
Definition: SHAMapItem.h:161
ripple::makeRulesGivenLedger
Rules makeRulesGivenLedger(DigestAwareReadView const &ledger, Rules const &current)
Definition: ReadView.cpp:69
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
ripple::tapNONE
@ tapNONE
Definition: ApplyView.h:32
ripple::HashPrefix::ledgerMaster
@ ledgerMaster
ledger master data for signing
ripple::HashPrefix::proposal
@ proposal
proposal for signing
diff --git a/RCLConsensus_8h_source.html b/RCLConsensus_8h_source.html index cb330576f0..d6f6f2fc3c 100644 --- a/RCLConsensus_8h_source.html +++ b/RCLConsensus_8h_source.html @@ -576,7 +576,7 @@ $(function() {
ripple::NodeID
base_uint< 160, detail::NodeIDTag > NodeID
NodeID is a 160-bit hash representing one node.
Definition: UintTypes.h:59
ripple::Result
boost::outcome_v2::result< T, std::error_code > Result
Definition: b58_utils.h:37
ripple::ConsensusPhase
ConsensusPhase
Phases of consensus for a single ledger round.
Definition: ConsensusTypes.h:105
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
ripple::HashPrefix::ledgerMaster
@ ledgerMaster
ledger master data for signing
ripple::HashPrefix::proposal
@ proposal
proposal for signing
std::optional
diff --git a/RPCHelpers_8cpp_source.html b/RPCHelpers_8cpp_source.html index c66c83c326..87e0706a10 100644 --- a/RPCHelpers_8cpp_source.html +++ b/RPCHelpers_8cpp_source.html @@ -1341,7 +1341,7 @@ $(function() {
ripple::rpcNOT_SYNCED
@ rpcNOT_SYNCED
Definition: ErrorCodes.h:67
ripple::generateKeyPair
std::pair< PublicKey, SecretKey > generateKeyPair(KeyType type, Seed const &seed)
Generate a key pair deterministically.
Definition: SecretKey.cpp:369
ripple::uint256
base_uint< 256 > uint256
Definition: base_uint.h:558
-
ripple::hashOfSeq
std::optional< uint256 > hashOfSeq(ReadView const &ledger, LedgerIndex seq, beast::Journal journal)
Return the hash of a ledger by sequence.
Definition: View.cpp:960
+
ripple::hashOfSeq
std::optional< uint256 > hashOfSeq(ReadView const &ledger, LedgerIndex seq, beast::Journal journal)
Return the hash of a ledger by sequence.
Definition: View.cpp:959
ripple::calcAccountID
AccountID calcAccountID(PublicKey const &pk)
Definition: AccountID.cpp:168
ripple::rpcError
Json::Value rpcError(int iError)
Definition: RPCErr.cpp:31
ripple::isUnlimited
bool isUnlimited(Role const &role)
ADMIN and IDENTIFIED roles shall have unlimited resources.
Definition: Role.cpp:125
diff --git a/STNumber__test_8cpp_source.html b/STNumber__test_8cpp_source.html index 16c0c40f12..b062b2088d 100644 --- a/STNumber__test_8cpp_source.html +++ b/STNumber__test_8cpp_source.html @@ -391,7 +391,7 @@ $(function() {
ripple::QualityDirection::out
@ out
ripple::noIssue
Issue const & noIssue()
Returns an asset specifier that represents no account and currency.
Definition: Issue.h:123
ripple::numberFromJson
STNumber numberFromJson(SField const &field, Json::Value const &value)
Definition: STNumber.cpp:179
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
ostream
std::runtime_error
stdexcept
diff --git a/SetAccount_8cpp_source.html b/SetAccount_8cpp_source.html index a91c76a0aa..0c90e412aa 100644 --- a/SetAccount_8cpp_source.html +++ b/SetAccount_8cpp_source.html @@ -848,7 +848,7 @@ $(function() {
ripple::asfRequireAuth
constexpr std::uint32_t asfRequireAuth
Definition: TxFlags.h:78
ripple::terOWNERS
@ terOWNERS
Definition: TER.h:220
ripple::terNO_ACCOUNT
@ terNO_ACCOUNT
Definition: TER.h:217
-
ripple::dirIsEmpty
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
Definition: View.cpp:906
+
ripple::dirIsEmpty
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
Definition: View.cpp:905
ripple::asfDisallowXRP
constexpr std::uint32_t asfDisallowXRP
Definition: TxFlags.h:79
ripple::temMALFORMED
@ temMALFORMED
Definition: TER.h:87
ripple::temINVALID_FLAG
@ temINVALID_FLAG
Definition: TER.h:111
diff --git a/SetOracle_8cpp_source.html b/SetOracle_8cpp_source.html index 4d3b538411..2caaba7090 100644 --- a/SetOracle_8cpp_source.html +++ b/SetOracle_8cpp_source.html @@ -435,7 +435,7 @@ $(function() {
ripple::maxPriceScale
std::size_t constexpr maxPriceScale
The maximum price scaling factor.
Definition: Protocol.h:162
ripple::maxOracleURI
std::size_t constexpr maxOracleURI
The maximum length of a URI inside an Oracle.
Definition: Protocol.h:144
ripple::maxOracleProvider
std::size_t constexpr maxOracleProvider
The maximum length of a Provider inside an Oracle.
Definition: Protocol.h:147
-
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1049
+
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1048
ripple::tokenPairKey
static std::pair< Currency, Currency > tokenPairKey(STObject const &pair)
Definition: SetOracle.cpp:32
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
diff --git a/SetSignerList_8cpp_source.html b/SetSignerList_8cpp_source.html index eddc81b367..fae3701454 100644 --- a/SetSignerList_8cpp_source.html +++ b/SetSignerList_8cpp_source.html @@ -605,7 +605,7 @@ $(function() {
ripple::removeSignersFromLedger
static TER removeSignersFromLedger(Application &app, ApplyView &view, Keylet const &accountKeylet, Keylet const &ownerDirKeylet, Keylet const &signerListKeylet, beast::Journal j)
Definition: SetSignerList.cpp:197
ripple::lsfOneOwnerCount
@ lsfOneOwnerCount
Definition: LedgerFormats.h:173
ripple::lsfDisableMaster
@ lsfDisableMaster
Definition: LedgerFormats.h:131
-
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1049
+
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1048
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::sign
Buffer sign(PublicKey const &pk, SecretKey const &sk, Slice const &message)
Generate a signature for a message.
Definition: SecretKey.cpp:256
ripple::tefBAD_LEDGER
@ tefBAD_LEDGER
Definition: TER.h:170
diff --git a/SetTrust_8cpp_source.html b/SetTrust_8cpp_source.html index 1138e1de69..c294b2a3e1 100644 --- a/SetTrust_8cpp_source.html +++ b/SetTrust_8cpp_source.html @@ -898,9 +898,9 @@ $(function() {
ripple::preflight2
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
Definition: Transactor.cpp:160
ripple::tfSetfAuth
constexpr std::uint32_t tfSetfAuth
Definition: TxFlags.h:115
ripple::tfClearFreeze
constexpr std::uint32_t tfClearFreeze
Definition: TxFlags.h:119
-
ripple::trustCreate
TER trustCreate(ApplyView &view, bool const bSrcHigh, AccountID const &uSrcAccountID, AccountID const &uDstAccountID, uint256 const &uIndex, SLE::ref sleAccount, bool const bAuth, bool const bNoRipple, bool const bFreeze, bool bDeepFreeze, STAmount const &saBalance, STAmount const &saLimit, std::uint32_t uQualityIn, std::uint32_t uQualityOut, beast::Journal j)
Create a trust line.
Definition: View.cpp:1227
+
ripple::trustCreate
TER trustCreate(ApplyView &view, bool const bSrcHigh, AccountID const &uSrcAccountID, AccountID const &uDstAccountID, uint256 const &uIndex, SLE::ref sleAccount, bool const bAuth, bool const bNoRipple, bool const bFreeze, bool bDeepFreeze, STAmount const &saBalance, STAmount const &saLimit, std::uint32_t uQualityIn, std::uint32_t uQualityOut, beast::Journal j)
Create a trust line.
Definition: View.cpp:1329
ripple::checkTxPermission
TER checkTxPermission(std::shared_ptr< SLE const > const &delegate, STTx const &tx)
Check if the delegate account has permission to execute the transaction.
Definition: DelegateUtils.cpp:26
-
ripple::trustDelete
TER trustDelete(ApplyView &view, std::shared_ptr< SLE > const &sleRippleState, AccountID const &uLowAccountID, AccountID const &uHighAccountID, beast::Journal j)
Definition: View.cpp:1431
+
ripple::trustDelete
TER trustDelete(ApplyView &view, std::shared_ptr< SLE > const &sleRippleState, AccountID const &uLowAccountID, AccountID const &uHighAccountID, beast::Journal j)
Definition: View.cpp:1534
ripple::tecNO_LINE_REDUNDANT
@ tecNO_LINE_REDUNDANT
Definition: TER.h:293
ripple::tecNO_DELEGATE_PERMISSION
@ tecNO_DELEGATE_PERMISSION
Definition: TER.h:364
ripple::tecPSEUDO_ACCOUNT
@ tecPSEUDO_ACCOUNT
Definition: TER.h:362
@@ -918,7 +918,7 @@ $(function() {
ripple::terNO_ACCOUNT
@ terNO_ACCOUNT
Definition: TER.h:217
ripple::tfSetFreeze
constexpr std::uint32_t tfSetFreeze
Definition: TxFlags.h:118
ripple::tfSetNoRipple
constexpr std::uint32_t tfSetNoRipple
Definition: TxFlags.h:116
-
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1140
+
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1139
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
ripple::temBAD_AMOUNT
@ temBAD_AMOUNT
Definition: TER.h:89
ripple::temBAD_LIMIT
@ temBAD_LIMIT
Definition: TER.h:94
diff --git a/SkipList__test_8cpp_source.html b/SkipList__test_8cpp_source.html index bfadea8690..c3244021fd 100644 --- a/SkipList__test_8cpp_source.html +++ b/SkipList__test_8cpp_source.html @@ -198,7 +198,7 @@ $(function() {
ripple::test::jtx::Env::app
Application & app()
Definition: Env.h:261
ripple::test::jtx::Env::journal
beast::Journal const journal
Definition: Env.h:162
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::hashOfSeq
std::optional< uint256 > hashOfSeq(ReadView const &ledger, LedgerIndex seq, beast::Journal journal)
Return the hash of a ledger by sequence.
Definition: View.cpp:960
+
ripple::hashOfSeq
std::optional< uint256 > hashOfSeq(ReadView const &ledger, LedgerIndex seq, beast::Journal journal)
Return the hash of a ledger by sequence.
Definition: View.cpp:959
ripple::create_genesis
create_genesis_t const create_genesis
Definition: Ledger.cpp:51
std::next
T next(T... args)
std::vector::push_back
T push_back(T... args)
diff --git a/StepChecks_8h_source.html b/StepChecks_8h_source.html index 285680e645..edb64e17c7 100644 --- a/StepChecks_8h_source.html +++ b/StepChecks_8h_source.html @@ -216,7 +216,7 @@ $(function() {
ripple::checkNoRipple
TER checkNoRipple(ReadView const &view, AccountID const &prev, AccountID const &cur, AccountID const &next, Currency const &currency, beast::Journal j)
Definition: StepChecks.h:89
ripple::tecINTERNAL
@ tecINTERNAL
Definition: TER.h:310
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
-
ripple::isLPTokenFrozen
bool isLPTokenFrozen(ReadView const &view, AccountID const &account, Issue const &asset, Issue const &asset2)
Definition: View.cpp:375
+
ripple::isLPTokenFrozen
bool isLPTokenFrozen(ReadView const &view, AccountID const &account, Issue const &asset, Issue const &asset2)
Definition: View.cpp:374
ripple::terNO_RIPPLE
@ terNO_RIPPLE
Definition: TER.h:224
ripple::terNO_LINE
@ terNO_LINE
Definition: TER.h:219
ripple::TER
TERSubset< CanCvtToTER > TER
Definition: TER.h:645
diff --git a/StrandFlow_8h_source.html b/StrandFlow_8h_source.html index ab961f7c3f..97de354736 100644 --- a/StrandFlow_8h_source.html +++ b/StrandFlow_8h_source.html @@ -962,7 +962,7 @@ $(function() {
ripple::telFAILED_PROCESSING
@ telFAILED_PROCESSING
Definition: TER.h:56
ripple::Result
boost::outcome_v2::result< T, std::error_code > Result
Definition: b58_utils.h:37
ripple::flow
StrandResult< TInAmt, TOutAmt > flow(PaymentSandbox const &baseView, Strand const &strand, std::optional< TInAmt > const &maxIn, TOutAmt const &out, beast::Journal j)
Request out amount from a strand.
Definition: StrandFlow.h:105
-
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1471
+
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1574
ripple::tefEXCEPTION
@ tefEXCEPTION
Definition: TER.h:172
ripple::OfferCrossing
OfferCrossing
Definition: Steps.h:45
ripple::sell
@ sell
Definition: Steps.h:45
diff --git a/TestHelpers_8cpp_source.html b/TestHelpers_8cpp_source.html index e172b3b933..b1add4f82a 100644 --- a/TestHelpers_8cpp_source.html +++ b/TestHelpers_8cpp_source.html @@ -504,7 +504,7 @@ $(function() {
ripple::QualityDirection::out
@ out
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
-
ripple::forEachItem
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:655
+
ripple::forEachItem
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:654
std::optional
std::shared_ptr
std::size_t
diff --git a/Transactor_8cpp_source.html b/Transactor_8cpp_source.html index 1727bac04e..93a4de8fbb 100644 --- a/Transactor_8cpp_source.html +++ b/Transactor_8cpp_source.html @@ -1468,7 +1468,7 @@ $(function() {
ripple::telREQUIRES_NETWORK_ID
@ telREQUIRES_NETWORK_ID
Definition: TER.h:66
ripple::telNETWORK_ID_MAKES_TX_NON_CANONICAL
@ telNETWORK_ID_MAKES_TX_NON_CANONICAL
Definition: TER.h:67
ripple::isLegalAmount
bool isLegalAmount(XRPAmount const &amount)
Returns true if the amount does not exceed the initial XRP in existence.
Definition: SystemParameters.h:48
-
ripple::deleteAMMTrustLine
TER deleteAMMTrustLine(ApplyView &view, std::shared_ptr< SLE > sleState, std::optional< AccountID > const &ammAccountID, beast::Journal j)
Delete trustline to AMM.
Definition: View.cpp:2620
+
ripple::deleteAMMTrustLine
TER deleteAMMTrustLine(ApplyView &view, std::shared_ptr< SLE > sleState, std::optional< AccountID > const &ammAccountID, beast::Journal j)
Delete trustline to AMM.
Definition: View.cpp:2720
ripple::isPseudoTx
bool isPseudoTx(STObject const &tx)
Check whether a transaction is a pseudo-transaction.
Definition: STTx.cpp:820
ripple::unfundedOfferRemoveLimit
std::size_t constexpr unfundedOfferRemoveLimit
The maximum number of unfunded offers to delete at once.
Definition: Protocol.h:48
ripple::preflight0
NotTEC preflight0(PreflightContext const &ctx)
Performs early sanity checks on the txid.
Definition: Transactor.cpp:44
@@ -1477,7 +1477,7 @@ $(function() {
ripple::oversizeMetaDataCap
std::size_t constexpr oversizeMetaDataCap
The maximum number of metadata entries allowed in one transaction.
Definition: Protocol.h:54
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::calcAccountID
AccountID calcAccountID(PublicKey const &pk)
Definition: AccountID.cpp:168
-
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1471
+
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1574
ripple::removeUnfundedOffers
static void removeUnfundedOffers(ApplyView &view, std::vector< uint256 > const &offers, beast::Journal viewJ)
Definition: Transactor.cpp:916
ripple::tefNOT_MULTI_SIGNING
@ tefNOT_MULTI_SIGNING
Definition: TER.h:181
ripple::tefPAST_SEQ
@ tefPAST_SEQ
Definition: TER.h:175
@@ -1515,7 +1515,7 @@ $(function() {
ripple::Validity::SigBad
@ SigBad
Signature is bad. Didn't do local checks.
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::removeDeletedTrustLines
static void removeDeletedTrustLines(ApplyView &view, std::vector< uint256 > const &trustLines, beast::Journal viewJ)
Definition: Transactor.cpp:968
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
ripple::scaleFeeLoad
XRPAmount scaleFeeLoad(XRPAmount fee, LoadFeeTrack const &feeTrack, Fees const &fees, bool bUnlimited)
Definition: LoadFeeTrack.cpp:85
ripple::ApplyFlags
ApplyFlags
Definition: ApplyView.h:31
ripple::tapFAIL_HARD
@ tapFAIL_HARD
Definition: ApplyView.h:36
diff --git a/TrustLine_8cpp_source.html b/TrustLine_8cpp_source.html index 4d096411e4..78faa581d3 100644 --- a/TrustLine_8cpp_source.html +++ b/TrustLine_8cpp_source.html @@ -225,7 +225,7 @@ $(function() {
ripple::detail::getTrustLineItems
std::vector< T > getTrustLineItems(AccountID const &accountID, ReadView const &view, LineDirection direction=LineDirection::outgoing)
Definition: TrustLine.cpp:64
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
-
ripple::forEachItem
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:655
+
ripple::forEachItem
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:654
ripple::LineDirection
LineDirection
Describes how an account was found in a path, and how to find the next set of paths.
Definition: TrustLine.h:42
ripple::LineDirection::outgoing
@ outgoing
std::optional
diff --git a/TxQ__test_8cpp_source.html b/TxQ__test_8cpp_source.html index 65fe47d048..00c2763be2 100644 --- a/TxQ__test_8cpp_source.html +++ b/TxQ__test_8cpp_source.html @@ -5298,7 +5298,7 @@ $(function() {
ripple::toFeeLevel
FeeLevel64 toFeeLevel(XRPAmount const &drops, XRPAmount const &baseFee)
Definition: TxQ.h:870
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
ripple::apply
ApplyResult apply(Application &app, OpenView &view, STTx const &tx, ApplyFlags flags, beast::Journal journal)
Apply a transaction to an OpenView.
Definition: apply.cpp:148
-
ripple::getMajorityAmendments
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:937
+
ripple::getMajorityAmendments
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:936
ripple::ReleaseStrongRefAction::noop
@ noop
ripple::toDrops
XRPAmount toDrops(FeeLevel< T > const &level, XRPAmount baseFee)
Definition: TxQ.h:863
ripple::tapUNLIMITED
@ tapUNLIMITED
Definition: ApplyView.h:43
diff --git a/VaultClawback_8cpp_source.html b/VaultClawback_8cpp_source.html index e9995e9fbe..df1b57f71d 100644 --- a/VaultClawback_8cpp_source.html +++ b/VaultClawback_8cpp_source.html @@ -349,7 +349,7 @@ $(function() {
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::fhIGNORE_FREEZE
@ fhIGNORE_FREEZE
Definition: View.h:78
ripple::isXRP
bool isXRP(AccountID const &c)
Definition: AccountID.h:90
-
ripple::sharesToAssetsWithdraw
STAmount sharesToAssetsWithdraw(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &shares)
Definition: View.cpp:2734
+
ripple::sharesToAssetsWithdraw
STAmount sharesToAssetsWithdraw(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &shares)
Definition: View.cpp:2834
ripple::lsfAllowTrustLineClawback
@ lsfAllowTrustLineClawback
Definition: LedgerFormats.h:150
ripple::lsfMPTCanClawback
@ lsfMPTCanClawback
Definition: LedgerFormats.h:189
ripple::lsfNoFreeze
@ lsfNoFreeze
Definition: LedgerFormats.h:132
@@ -364,10 +364,10 @@ $(function() {
ripple::tecNO_PERMISSION
@ tecNO_PERMISSION
Definition: TER.h:305
ripple::tecWRONG_ASSET
@ tecWRONG_ASSET
Definition: TER.h:360
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
-
ripple::assetsToSharesWithdraw
STAmount assetsToSharesWithdraw(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &assets)
Definition: View.cpp:2715
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
+
ripple::assetsToSharesWithdraw
STAmount assetsToSharesWithdraw(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &assets)
Definition: View.cpp:2815
ripple::tfUniversalMask
constexpr std::uint32_t tfUniversalMask
Definition: TxFlags.h:63
-
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2011
+
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2114
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
ripple::temBAD_AMOUNT
@ temBAD_AMOUNT
Definition: TER.h:89
ripple::temMALFORMED
@ temMALFORMED
Definition: TER.h:87
diff --git a/VaultCreate_8cpp_source.html b/VaultCreate_8cpp_source.html index 4b47a8512f..0dc5bc584b 100644 --- a/VaultCreate_8cpp_source.html +++ b/VaultCreate_8cpp_source.html @@ -354,7 +354,7 @@ $(function() {
ripple::keylet::vault
Keylet vault(AccountID const &owner, std::uint32_t seq) noexcept
Definition: Indexes.cpp:564
ripple::keylet::account
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition: Indexes.cpp:184
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::createPseudoAccount
Expected< std::shared_ptr< SLE >, TER > createPseudoAccount(ApplyView &view, uint256 const &pseudoOwnerKey, SField const &ownerField)
Create pseudo-account, storing pseudoOwnerKey into ownerField.
Definition: View.cpp:1095
+
ripple::createPseudoAccount
Expected< std::shared_ptr< SLE >, TER > createPseudoAccount(ApplyView &view, uint256 const &pseudoOwnerKey, SField const &ownerField)
Create pseudo-account, storing pseudoOwnerKey into ownerField.
Definition: View.cpp:1094
ripple::lsfMPTCanTransfer
@ lsfMPTCanTransfer
Definition: LedgerFormats.h:188
ripple::lsfMPTCanTrade
@ lsfMPTCanTrade
Definition: LedgerFormats.h:187
ripple::lsfMPTCanEscrow
@ lsfMPTCanEscrow
Definition: LedgerFormats.h:186
@@ -363,7 +363,7 @@ $(function() {
ripple::tfVaultPrivate
constexpr std::uint32_t const tfVaultPrivate
Definition: TxFlags.h:234
ripple::maxDataPayloadLength
std::size_t constexpr maxDataPayloadLength
The maximum length of Data payload.
Definition: Protocol.h:120
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
-
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:249
+
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:248
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
ripple::maxMPTokenMetadataLength
std::size_t constexpr maxMPTokenMetadataLength
The maximum length of MPTokenMetadata.
Definition: Protocol.h:114
ripple::adjustOwnerCount
static bool adjustOwnerCount(ApplyContext &ctx, int count)
Definition: SetOracle.cpp:186
@@ -375,18 +375,18 @@ $(function() {
ripple::tecNO_AUTH
@ tecNO_AUTH
Definition: TER.h:300
ripple::tecLOCKED
@ tecLOCKED
Definition: TER.h:358
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
-
ripple::addEmptyHolding
TER addEmptyHolding(ApplyView &view, AccountID const &accountID, XRPAmount priorBalance, Issue const &issue, beast::Journal journal)
Definition: View.cpp:1154
+
ripple::addEmptyHolding
TER addEmptyHolding(ApplyView &view, AccountID const &accountID, XRPAmount priorBalance, Issue const &issue, beast::Journal journal)
Definition: View.cpp:1153
ripple::tfVaultShareNonTransferable
constexpr std::uint32_t const tfVaultShareNonTransferable
Definition: TxFlags.h:236
-
ripple::pseudoAccountAddress
AccountID pseudoAccountAddress(ReadView const &view, uint256 const &pseudoOwnerKey)
Definition: View.cpp:1068
+
ripple::pseudoAccountAddress
AccountID pseudoAccountAddress(ReadView const &view, uint256 const &pseudoOwnerKey)
Definition: View.cpp:1067
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
ripple::vaultStrategyFirstComeFirstServe
std::uint8_t constexpr vaultStrategyFirstComeFirstServe
Vault withdrawal policies.
Definition: Protocol.h:123
ripple::terADDRESS_COLLISION
@ terADDRESS_COLLISION
Definition: TER.h:228
ripple::terNO_ACCOUNT
@ terNO_ACCOUNT
Definition: TER.h:217
ripple::terNO_RIPPLE
@ terNO_RIPPLE
Definition: TER.h:224
ripple::tfVaultCreateMask
constexpr std::uint32_t const tfVaultCreateMask
Definition: TxFlags.h:237
-
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1140
+
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1139
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
-
ripple::dirLink
TER dirLink(ApplyView &view, AccountID const &owner, std::shared_ptr< SLE > &object)
Definition: View.cpp:1057
+
ripple::dirLink
TER dirLink(ApplyView &view, AccountID const &owner, std::shared_ptr< SLE > &object)
Definition: View.cpp:1056
ripple::temMALFORMED
@ temMALFORMED
Definition: TER.h:87
ripple::temINVALID_FLAG
@ temINVALID_FLAG
Definition: TER.h:111
ripple::temDISABLED
@ temDISABLED
Definition: TER.h:114
diff --git a/VaultDelete_8cpp_source.html b/VaultDelete_8cpp_source.html index fdc792641c..efa2c168ff 100644 --- a/VaultDelete_8cpp_source.html +++ b/VaultDelete_8cpp_source.html @@ -297,7 +297,7 @@ $(function() {
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
ripple::tfUniversalMask
constexpr std::uint32_t tfUniversalMask
Definition: TxFlags.h:63
-
ripple::removeEmptyHolding
TER removeEmptyHolding(ApplyView &view, AccountID const &accountID, Issue const &issue, beast::Journal journal)
Definition: View.cpp:1346
+
ripple::removeEmptyHolding
TER removeEmptyHolding(ApplyView &view, AccountID const &accountID, Issue const &issue, beast::Journal journal)
Definition: View.cpp:1448
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
ripple::temMALFORMED
@ temMALFORMED
Definition: TER.h:87
ripple::temINVALID_FLAG
@ temINVALID_FLAG
Definition: TER.h:111
diff --git a/VaultDeposit_8cpp_source.html b/VaultDeposit_8cpp_source.html index 963cb2bd82..b66ec9cc37 100644 --- a/VaultDeposit_8cpp_source.html +++ b/VaultDeposit_8cpp_source.html @@ -288,12 +288,12 @@ $(function() {
210 auto sleMpt = view().read(keylet::mptoken(mptIssuanceID, account_));
211 if (!sleMpt)
212 {
-
213 if (auto const err = MPTokenAuthorize::authorize(
+
213 if (auto const err = authorizeMPToken(
214 view(),
-
215 ctx_.journal,
-
216 {.priorBalance = mPriorBalance,
-
217 .mptIssuanceID = mptIssuanceID->value(),
-
218 .account = account_});
+
215 mPriorBalance,
+
216 mptIssuanceID->value(),
+
217 account_,
+
218 ctx_.journal);
219 !isTesSuccess(err))
220 return err;
221 }
@@ -301,15 +301,15 @@ $(function() {
223 // If the vault is private, set the authorized flag for the vault owner
224 if (vault->isFlag(tfVaultPrivate))
225 {
-
226 if (auto const err = MPTokenAuthorize::authorize(
+
226 if (auto const err = authorizeMPToken(
227 view(),
-
228 ctx_.journal,
-
229 {
-
230 .priorBalance = mPriorBalance,
-
231 .mptIssuanceID = mptIssuanceID->value(),
-
232 .account = sleIssuance->at(sfIssuer),
-
233 .holderID = account_,
-
234 });
+
228 mPriorBalance, // priorBalance
+
229 mptIssuanceID->value(), // mptIssuanceID
+
230 sleIssuance->at(sfIssuer), // account
+
231 ctx_.journal,
+
232 {}, // flags
+
233 account_ // holderID
+
234 );
235 !isTesSuccess(err))
236 return err;
237 }
@@ -368,7 +368,6 @@ $(function() {
ripple::ApplyView::peek
virtual std::shared_ptr< SLE > peek(Keylet const &k)=0
Prepare to modify the SLE associated with key.
ripple::Issue
A currency issued by an account.
Definition: Issue.h:33
ripple::MPTIssue
Definition: MPTIssue.h:33
-
ripple::MPTokenAuthorize::authorize
static TER authorize(ApplyView &view, beast::Journal journal, MPTAuthorizeArgs const &args)
Definition: MPTokenAuthorize.cpp:179
ripple::ReadView::read
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
ripple::Rules::enabled
bool enabled(uint256 const &feature) const
Returns true if a feature is enabled.
Definition: Rules.cpp:130
ripple::STObject::getFlags
std::uint32_t getFlags() const
Definition: STObject.cpp:537
@@ -381,13 +380,14 @@ $(function() {
ripple::VaultDeposit::doApply
TER doApply() override
Definition: VaultDeposit.cpp:180
ripple::VaultDeposit::preclaim
static TER preclaim(PreclaimContext const &ctx)
Definition: VaultDeposit.cpp:60
ripple::VaultDeposit::preflight
static NotTEC preflight(PreflightContext const &ctx)
Definition: VaultDeposit.cpp:36
+
ripple::XRPAmount::value
constexpr value_type value() const
Returns the underlying value.
Definition: XRPAmount.h:239
ripple::credentials::validDomain
TER validDomain(ReadView const &view, uint256 domainID, AccountID const &subject)
Definition: CredentialHelpers.cpp:193
ripple::keylet::mptoken
Keylet mptoken(MPTID const &issuanceID, AccountID const &holder) noexcept
Definition: Indexes.cpp:540
ripple::keylet::mptIssuance
Keylet mptIssuance(std::uint32_t seq, AccountID const &issuer) noexcept
Definition: Indexes.cpp:526
ripple::keylet::vault
Keylet vault(AccountID const &owner, std::uint32_t seq) noexcept
Definition: Indexes.cpp:564
ripple::keylet::account
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition: Indexes.cpp:184
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
-
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2301
+
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2404
ripple::fhZERO_IF_FROZEN
@ fhZERO_IF_FROZEN
Definition: View.h:78
ripple::fhIGNORE_FREEZE
@ fhIGNORE_FREEZE
Definition: View.h:78
ripple::lsfMPTCanTransfer
@ lsfMPTCanTransfer
Definition: LedgerFormats.h:188
@@ -396,9 +396,10 @@ $(function() {
ripple::ahZERO_IF_UNAUTHORIZED
@ ahZERO_IF_UNAUTHORIZED
Definition: View.h:81
ripple::ahIGNORE_AUTH
@ ahIGNORE_AUTH
Definition: View.h:81
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
-
ripple::enforceMPTokenAuthorization
TER enforceMPTokenAuthorization(ApplyView &view, MPTID const &mptIssuanceID, AccountID const &account, XRPAmount const &priorBalance, beast::Journal j)
Enforce account has MPToken to match its authorization.
Definition: View.cpp:2419
-
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:249
+
ripple::enforceMPTokenAuthorization
TER enforceMPTokenAuthorization(ApplyView &view, MPTID const &mptIssuanceID, AccountID const &account, XRPAmount const &priorBalance, beast::Journal j)
Enforce account has MPToken to match its authorization.
Definition: View.cpp:2522
+
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:248
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
+
ripple::authorizeMPToken
TER authorizeMPToken(ApplyView &view, XRPAmount const &priorBalance, MPTID const &mptIssuanceID, AccountID const &account, beast::Journal journal, std::uint32_t flags, std::optional< AccountID > holderID)
Definition: View.cpp:1221
ripple::preflight2
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
Definition: Transactor.cpp:160
ripple::WaiveTransferFee::Yes
@ Yes
ripple::tecNO_ENTRY
@ tecNO_ENTRY
Definition: TER.h:306
@@ -411,11 +412,11 @@ $(function() {
ripple::tecNO_AUTH
@ tecNO_AUTH
Definition: TER.h:300
ripple::tecLOCKED
@ tecLOCKED
Definition: TER.h:358
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
ripple::tfUniversalMask
constexpr std::uint32_t tfUniversalMask
Definition: TxFlags.h:63
-
ripple::assetsToSharesDeposit
STAmount assetsToSharesDeposit(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &assets)
Definition: View.cpp:2697
-
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2011
+
ripple::assetsToSharesDeposit
STAmount assetsToSharesDeposit(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &assets)
Definition: View.cpp:2797
+
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2114
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
ripple::temBAD_AMOUNT
@ temBAD_AMOUNT
Definition: TER.h:89
ripple::temMALFORMED
@ temMALFORMED
Definition: TER.h:87
diff --git a/VaultWithdraw_8cpp_source.html b/VaultWithdraw_8cpp_source.html index 1b250a518a..bf38f1faa0 100644 --- a/VaultWithdraw_8cpp_source.html +++ b/VaultWithdraw_8cpp_source.html @@ -380,14 +380,14 @@ $(function() {
ripple::keylet::depositPreauth
Keylet depositPreauth(AccountID const &owner, AccountID const &preauthorized) noexcept
A DepositPreauth.
Definition: Indexes.cpp:342
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::checkFrozen
TER checkFrozen(ReadView const &view, AccountID const &account, Issue const &issue)
Definition: View.h:179
-
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2301
+
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2404
ripple::fhZERO_IF_FROZEN
@ fhZERO_IF_FROZEN
Definition: View.h:78
ripple::fhIGNORE_FREEZE
@ fhIGNORE_FREEZE
Definition: View.h:78
-
ripple::sharesToAssetsWithdraw
STAmount sharesToAssetsWithdraw(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &shares)
Definition: View.cpp:2734
+
ripple::sharesToAssetsWithdraw
STAmount sharesToAssetsWithdraw(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &shares)
Definition: View.cpp:2834
ripple::lsfMPTCanTransfer
@ lsfMPTCanTransfer
Definition: LedgerFormats.h:188
ripple::lsfRequireDestTag
@ lsfRequireDestTag
Definition: LedgerFormats.h:126
ripple::lsfDepositAuth
@ lsfDepositAuth
Definition: LedgerFormats.h:136
-
ripple::AuthType
AuthType
Definition: View.h:760
+
ripple::AuthType
AuthType
Definition: View.h:770
ripple::AuthType::Legacy
@ Legacy
ripple::AuthType::StrongAuth
@ StrongAuth
ripple::ahIGNORE_AUTH
@ ahIGNORE_AUTH
Definition: View.h:81
@@ -404,12 +404,12 @@ $(function() {
ripple::tecWRONG_ASSET
@ tecWRONG_ASSET
Definition: TER.h:360
ripple::tecNO_AUTH
@ tecNO_AUTH
Definition: TER.h:300
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
-
ripple::assetsToSharesWithdraw
STAmount assetsToSharesWithdraw(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &assets)
Definition: View.cpp:2715
+
ripple::assetsToSharesWithdraw
STAmount assetsToSharesWithdraw(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &assets)
Definition: View.cpp:2815
ripple::tfUniversalMask
constexpr std::uint32_t tfUniversalMask
Definition: TxFlags.h:63
ripple::vaultStrategyFirstComeFirstServe
std::uint8_t constexpr vaultStrategyFirstComeFirstServe
Vault withdrawal policies.
Definition: Protocol.h:123
-
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2011
+
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2114
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:605
ripple::temBAD_AMOUNT
@ temBAD_AMOUNT
Definition: TER.h:89
ripple::temMALFORMED
@ temMALFORMED
Definition: TER.h:87
diff --git a/Vault__test_8cpp_source.html b/Vault__test_8cpp_source.html index 11d9442ca2..7beacab818 100644 --- a/Vault__test_8cpp_source.html +++ b/Vault__test_8cpp_source.html @@ -3471,7 +3471,7 @@ $(function() {
ripple::xrpIssue
Issue const & xrpIssue()
Returns an asset specifier that represents XRP.
Definition: Issue.h:115
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:114
ripple::asfGlobalFreeze
constexpr std::uint32_t asfGlobalFreeze
Definition: TxFlags.h:83
-
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2301
+
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2404
ripple::asfDepositAuth
constexpr std::uint32_t asfDepositAuth
Definition: TxFlags.h:85
ripple::LedgerNameSpace::AMM
@ AMM
ripple::telINSUF_FEE_P
@ telINSUF_FEE_P
Definition: TER.h:57
@@ -3508,7 +3508,7 @@ $(function() {
ripple::tfMPTLock
constexpr std::uint32_t const tfMPTLock
Definition: TxFlags.h:159
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
ripple::tfVaultShareNonTransferable
constexpr std::uint32_t const tfVaultShareNonTransferable
Definition: TxFlags.h:236
-
ripple::pseudoAccountAddress
AccountID pseudoAccountAddress(ReadView const &view, uint256 const &pseudoOwnerKey)
Definition: View.cpp:1068
+
ripple::pseudoAccountAddress
AccountID pseudoAccountAddress(ReadView const &view, uint256 const &pseudoOwnerKey)
Definition: View.cpp:1067
ripple::tfClearDeepFreeze
constexpr std::uint32_t tfClearDeepFreeze
Definition: TxFlags.h:121
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::vaultStrategyFirstComeFirstServe
std::uint8_t constexpr vaultStrategyFirstComeFirstServe
Vault withdrawal policies.
Definition: Protocol.h:123
diff --git a/View_8cpp_source.html b/View_8cpp_source.html index 248dc8ca6e..d575c462ce 100644 --- a/View_8cpp_source.html +++ b/View_8cpp_source.html @@ -96,2988 +96,3088 @@ $(function() {
18//==============================================================================
19
20#include <xrpld/app/misc/CredentialHelpers.h>
-
21#include <xrpld/app/tx/detail/MPTokenAuthorize.h>
-
22#include <xrpld/ledger/ReadView.h>
-
23#include <xrpld/ledger/View.h>
-
24
-
25#include <xrpl/basics/Expected.h>
-
26#include <xrpl/basics/Log.h>
-
27#include <xrpl/basics/chrono.h>
-
28#include <xrpl/beast/utility/instrumentation.h>
-
29#include <xrpl/protocol/Feature.h>
-
30#include <xrpl/protocol/Indexes.h>
-
31#include <xrpl/protocol/LedgerFormats.h>
-
32#include <xrpl/protocol/MPTIssue.h>
-
33#include <xrpl/protocol/Protocol.h>
-
34#include <xrpl/protocol/Quality.h>
-
35#include <xrpl/protocol/TER.h>
-
36#include <xrpl/protocol/TxFlags.h>
-
37#include <xrpl/protocol/digest.h>
-
38#include <xrpl/protocol/st.h>
-
39
-
40#include <type_traits>
-
41#include <variant>
-
42
-
43namespace ripple {
-
44
-
45namespace detail {
-
46
-
47template <
-
48 class V,
-
49 class N,
-
50 class = std::enable_if_t<
-
51 std::is_same_v<std::remove_cv_t<N>, SLE> &&
-
52 std::is_base_of_v<ReadView, V>>>
-
53bool
-
54internalDirNext(
-
55 V& view,
-
56 uint256 const& root,
-
57 std::shared_ptr<N>& page,
-
58 unsigned int& index,
-
59 uint256& entry)
-
60{
-
61 auto const& svIndexes = page->getFieldV256(sfIndexes);
-
62 XRPL_ASSERT(
-
63 index <= svIndexes.size(),
-
64 "ripple::detail::internalDirNext : index inside range");
-
65
-
66 if (index >= svIndexes.size())
-
67 {
-
68 auto const next = page->getFieldU64(sfIndexNext);
-
69
-
70 if (!next)
-
71 {
-
72 entry.zero();
-
73 return false;
-
74 }
-
75
-
76 if constexpr (std::is_const_v<N>)
-
77 page = view.read(keylet::page(root, next));
-
78 else
-
79 page = view.peek(keylet::page(root, next));
-
80
-
81 XRPL_ASSERT(page, "ripple::detail::internalDirNext : non-null root");
-
82
-
83 if (!page)
-
84 return false;
-
85
-
86 index = 0;
-
87
-
88 return internalDirNext(view, root, page, index, entry);
-
89 }
-
90
-
91 entry = svIndexes[index++];
-
92 return true;
-
93}
-
94
-
95template <
-
96 class V,
-
97 class N,
-
98 class = std::enable_if_t<
-
99 std::is_same_v<std::remove_cv_t<N>, SLE> &&
-
100 std::is_base_of_v<ReadView, V>>>
-
101bool
-
102internalDirFirst(
-
103 V& view,
-
104 uint256 const& root,
-
105 std::shared_ptr<N>& page,
-
106 unsigned int& index,
-
107 uint256& entry)
-
108{
-
109 if constexpr (std::is_const_v<N>)
-
110 page = view.read(keylet::page(root));
-
111 else
-
112 page = view.peek(keylet::page(root));
-
113
-
114 if (!page)
-
115 return false;
-
116
-
117 index = 0;
-
118
-
119 return internalDirNext(view, root, page, index, entry);
-
120}
-
121
-
122} // namespace detail
-
123
-
124bool
-
125dirFirst(
-
126 ApplyView& view,
-
127 uint256 const& root,
-
128 std::shared_ptr<SLE>& page,
-
129 unsigned int& index,
-
130 uint256& entry)
-
131{
-
132 return detail::internalDirFirst(view, root, page, index, entry);
-
133}
-
134
-
135bool
-
136dirNext(
-
137 ApplyView& view,
-
138 uint256 const& root,
-
139 std::shared_ptr<SLE>& page,
-
140 unsigned int& index,
-
141 uint256& entry)
-
142{
-
143 return detail::internalDirNext(view, root, page, index, entry);
-
144}
-
145
-
146bool
-
147cdirFirst(
-
148 ReadView const& view,
-
149 uint256 const& root,
-
150 std::shared_ptr<SLE const>& page,
-
151 unsigned int& index,
-
152 uint256& entry)
-
153{
-
154 return detail::internalDirFirst(view, root, page, index, entry);
-
155}
-
156
-
157bool
-
158cdirNext(
-
159 ReadView const& view,
-
160 uint256 const& root,
-
161 std::shared_ptr<SLE const>& page,
-
162 unsigned int& index,
-
163 uint256& entry)
-
164{
-
165 return detail::internalDirNext(view, root, page, index, entry);
-
166}
-
167
-
168//------------------------------------------------------------------------------
-
169//
-
170// Observers
-
171//
-
172//------------------------------------------------------------------------------
-
173
-
174bool
-
175hasExpired(ReadView const& view, std::optional<std::uint32_t> const& exp)
-
176{
-
177 using d = NetClock::duration;
-
178 using tp = NetClock::time_point;
-
179
-
180 return exp && (view.parentCloseTime() >= tp{d{*exp}});
-
181}
-
182
-
183bool
-
184isGlobalFrozen(ReadView const& view, AccountID const& issuer)
-
185{
-
186 if (isXRP(issuer))
-
187 return false;
-
188 if (auto const sle = view.read(keylet::account(issuer)))
-
189 return sle->isFlag(lsfGlobalFreeze);
-
190 return false;
-
191}
-
192
-
193bool
-
194isGlobalFrozen(ReadView const& view, MPTIssue const& mptIssue)
-
195{
-
196 if (auto const sle = view.read(keylet::mptIssuance(mptIssue.getMptID())))
-
197 return sle->isFlag(lsfMPTLocked);
-
198 return false;
-
199}
-
200
-
201bool
-
202isGlobalFrozen(ReadView const& view, Asset const& asset)
-
203{
-
204 return std::visit(
-
205 [&]<ValidIssueType TIss>(TIss const& issue) {
-
206 if constexpr (std::is_same_v<TIss, Issue>)
-
207 return isGlobalFrozen(view, issue.getIssuer());
-
208 else
-
209 return isGlobalFrozen(view, issue);
-
210 },
-
211 asset.value());
-
212}
-
213
-
214bool
-
215isIndividualFrozen(
-
216 ReadView const& view,
-
217 AccountID const& account,
-
218 Currency const& currency,
-
219 AccountID const& issuer)
-
220{
-
221 if (isXRP(currency))
-
222 return false;
-
223 if (issuer != account)
-
224 {
-
225 // Check if the issuer froze the line
-
226 auto const sle = view.read(keylet::line(account, issuer, currency));
-
227 if (sle &&
-
228 sle->isFlag((issuer > account) ? lsfHighFreeze : lsfLowFreeze))
-
229 return true;
-
230 }
-
231 return false;
-
232}
-
233
-
234bool
-
235isIndividualFrozen(
-
236 ReadView const& view,
-
237 AccountID const& account,
-
238 MPTIssue const& mptIssue)
-
239{
-
240 if (auto const sle =
-
241 view.read(keylet::mptoken(mptIssue.getMptID(), account)))
-
242 return sle->isFlag(lsfMPTLocked);
-
243 return false;
-
244}
-
245
-
246// Can the specified account spend the specified currency issued by
-
247// the specified issuer or does the freeze flag prohibit it?
-
248bool
-
249isFrozen(
-
250 ReadView const& view,
-
251 AccountID const& account,
-
252 Currency const& currency,
-
253 AccountID const& issuer)
-
254{
-
255 if (isXRP(currency))
-
256 return false;
-
257 auto sle = view.read(keylet::account(issuer));
-
258 if (sle && sle->isFlag(lsfGlobalFreeze))
-
259 return true;
-
260 if (issuer != account)
-
261 {
-
262 // Check if the issuer froze the line
-
263 sle = view.read(keylet::line(account, issuer, currency));
-
264 if (sle &&
-
265 sle->isFlag((issuer > account) ? lsfHighFreeze : lsfLowFreeze))
-
266 return true;
-
267 }
-
268 return false;
-
269}
-
270
-
271bool
-
272isFrozen(
-
273 ReadView const& view,
-
274 AccountID const& account,
-
275 MPTIssue const& mptIssue,
-
276 int depth)
-
277{
-
278 return isGlobalFrozen(view, mptIssue) ||
-
279 isIndividualFrozen(view, account, mptIssue) ||
-
280 isVaultPseudoAccountFrozen(view, account, mptIssue, depth);
-
281}
-
282
-
283[[nodiscard]] bool
-
284isAnyFrozen(
-
285 ReadView const& view,
-
286 std::initializer_list<AccountID> const& accounts,
-
287 MPTIssue const& mptIssue,
-
288 int depth)
-
289{
-
290 if (isGlobalFrozen(view, mptIssue))
-
291 return true;
-
292
-
293 for (auto const& account : accounts)
-
294 {
-
295 if (isIndividualFrozen(view, account, mptIssue))
-
296 return true;
-
297 }
-
298
-
299 for (auto const& account : accounts)
-
300 {
-
301 if (isVaultPseudoAccountFrozen(view, account, mptIssue, depth))
-
302 return true;
-
303 }
-
304
-
305 return false;
-
306}
-
307
-
308bool
-
309isVaultPseudoAccountFrozen(
-
310 ReadView const& view,
-
311 AccountID const& account,
-
312 MPTIssue const& mptShare,
-
313 int depth)
-
314{
-
315 if (!view.rules().enabled(featureSingleAssetVault))
-
316 return false;
-
317
-
318 if (depth >= maxAssetCheckDepth)
-
319 return true; // LCOV_EXCL_LINE
-
320
-
321 auto const mptIssuance =
-
322 view.read(keylet::mptIssuance(mptShare.getMptID()));
-
323 if (mptIssuance == nullptr)
-
324 return false; // zero MPToken won't block deletion of MPTokenIssuance
-
325
-
326 auto const issuer = mptIssuance->getAccountID(sfIssuer);
-
327 auto const mptIssuer = view.read(keylet::account(issuer));
-
328 if (mptIssuer == nullptr)
-
329 { // LCOV_EXCL_START
-
330 UNREACHABLE("ripple::isVaultPseudoAccountFrozen : null MPToken issuer");
-
331 return false;
-
332 } // LCOV_EXCL_STOP
-
333
-
334 if (!mptIssuer->isFieldPresent(sfVaultID))
-
335 return false; // not a Vault pseudo-account, common case
-
336
-
337 auto const vault =
-
338 view.read(keylet::vault(mptIssuer->getFieldH256(sfVaultID)));
-
339 if (vault == nullptr)
-
340 { // LCOV_EXCL_START
-
341 UNREACHABLE("ripple::isVaultPseudoAccountFrozen : null vault");
-
342 return false;
-
343 } // LCOV_EXCL_STOP
-
344
-
345 return isAnyFrozen(view, {issuer, account}, vault->at(sfAsset), depth + 1);
-
346}
-
347
-
348bool
-
349isDeepFrozen(
-
350 ReadView const& view,
-
351 AccountID const& account,
-
352 Currency const& currency,
-
353 AccountID const& issuer)
-
354{
-
355 if (isXRP(currency))
-
356 {
-
357 return false;
-
358 }
-
359
-
360 if (issuer == account)
-
361 {
-
362 return false;
-
363 }
-
364
-
365 auto const sle = view.read(keylet::line(account, issuer, currency));
-
366 if (!sle)
-
367 {
-
368 return false;
-
369 }
-
370
-
371 return sle->isFlag(lsfHighDeepFreeze) || sle->isFlag(lsfLowDeepFreeze);
-
372}
-
373
-
374bool
-
375isLPTokenFrozen(
-
376 ReadView const& view,
-
377 AccountID const& account,
-
378 Issue const& asset,
-
379 Issue const& asset2)
-
380{
-
381 return isFrozen(view, account, asset.currency, asset.account) ||
-
382 isFrozen(view, account, asset2.currency, asset2.account);
-
383}
-
384
-
385STAmount
-
386accountHolds(
-
387 ReadView const& view,
-
388 AccountID const& account,
-
389 Currency const& currency,
-
390 AccountID const& issuer,
-
391 FreezeHandling zeroIfFrozen,
-
392 beast::Journal j)
-
393{
-
394 STAmount amount;
-
395 if (isXRP(currency))
-
396 {
-
397 return {xrpLiquid(view, account, 0, j)};
-
398 }
-
399
-
400 // IOU: Return balance on trust line modulo freeze
-
401 auto const sle = view.read(keylet::line(account, issuer, currency));
-
402 auto const allowBalance = [&]() {
-
403 if (!sle)
-
404 {
-
405 return false;
-
406 }
-
407
-
408 if (zeroIfFrozen == fhZERO_IF_FROZEN)
-
409 {
-
410 if (isFrozen(view, account, currency, issuer) ||
-
411 isDeepFrozen(view, account, currency, issuer))
-
412 {
-
413 return false;
-
414 }
-
415
-
416 // when fixFrozenLPTokenTransfer is enabled, if currency is lptoken,
-
417 // we need to check if the associated assets have been frozen
-
418 if (view.rules().enabled(fixFrozenLPTokenTransfer))
-
419 {
-
420 auto const sleIssuer = view.read(keylet::account(issuer));
-
421 if (!sleIssuer)
-
422 {
-
423 return false; // LCOV_EXCL_LINE
-
424 }
-
425 else if (sleIssuer->isFieldPresent(sfAMMID))
-
426 {
-
427 auto const sleAmm =
-
428 view.read(keylet::amm((*sleIssuer)[sfAMMID]));
-
429
-
430 if (!sleAmm ||
-
431 isLPTokenFrozen(
-
432 view,
-
433 account,
-
434 (*sleAmm)[sfAsset].get<Issue>(),
-
435 (*sleAmm)[sfAsset2].get<Issue>()))
-
436 {
-
437 return false;
-
438 }
-
439 }
-
440 }
-
441 }
-
442
-
443 return true;
-
444 }();
-
445
-
446 if (allowBalance)
-
447 {
-
448 amount = sle->getFieldAmount(sfBalance);
-
449 if (account > issuer)
-
450 {
-
451 // Put balance in account terms.
-
452 amount.negate();
-
453 }
-
454 amount.setIssuer(issuer);
-
455 }
-
456 else
-
457 {
-
458 amount.clear(Issue{currency, issuer});
-
459 }
-
460
-
461 JLOG(j.trace()) << "accountHolds:"
-
462 << " account=" << to_string(account)
-
463 << " amount=" << amount.getFullText();
-
464
-
465 return view.balanceHook(account, issuer, amount);
-
466}
-
467
-
468STAmount
-
469accountHolds(
-
470 ReadView const& view,
-
471 AccountID const& account,
-
472 Issue const& issue,
-
473 FreezeHandling zeroIfFrozen,
-
474 beast::Journal j)
-
475{
-
476 return accountHolds(
-
477 view, account, issue.currency, issue.account, zeroIfFrozen, j);
-
478}
-
479
-
480STAmount
-
481accountHolds(
-
482 ReadView const& view,
-
483 AccountID const& account,
-
484 MPTIssue const& mptIssue,
-
485 FreezeHandling zeroIfFrozen,
-
486 AuthHandling zeroIfUnauthorized,
-
487 beast::Journal j)
-
488{
-
489 STAmount amount;
-
490
-
491 auto const sleMpt =
-
492 view.read(keylet::mptoken(mptIssue.getMptID(), account));
-
493
-
494 if (!sleMpt)
-
495 amount.clear(mptIssue);
-
496 else if (
-
497 zeroIfFrozen == fhZERO_IF_FROZEN && isFrozen(view, account, mptIssue))
-
498 amount.clear(mptIssue);
-
499 else
-
500 {
-
501 amount = STAmount{mptIssue, sleMpt->getFieldU64(sfMPTAmount)};
-
502
-
503 // Only if auth check is needed, as it needs to do an additional read
-
504 // operation. Note featureSingleAssetVault will affect error codes.
-
505 if (zeroIfUnauthorized == ahZERO_IF_UNAUTHORIZED &&
-
506 view.rules().enabled(featureSingleAssetVault))
-
507 {
-
508 if (auto const err =
-
509 requireAuth(view, mptIssue, account, AuthType::StrongAuth);
-
510 !isTesSuccess(err))
-
511 amount.clear(mptIssue);
-
512 }
-
513 else if (zeroIfUnauthorized == ahZERO_IF_UNAUTHORIZED)
-
514 {
-
515 auto const sleIssuance =
-
516 view.read(keylet::mptIssuance(mptIssue.getMptID()));
-
517
-
518 // if auth is enabled on the issuance and mpt is not authorized,
-
519 // clear amount
-
520 if (sleIssuance && sleIssuance->isFlag(lsfMPTRequireAuth) &&
-
521 !sleMpt->isFlag(lsfMPTAuthorized))
-
522 amount.clear(mptIssue);
-
523 }
-
524 }
-
525
-
526 return amount;
-
527}
-
528
-
529[[nodiscard]] STAmount
-
530accountHolds(
-
531 ReadView const& view,
-
532 AccountID const& account,
-
533 Asset const& asset,
-
534 FreezeHandling zeroIfFrozen,
-
535 AuthHandling zeroIfUnauthorized,
-
536 beast::Journal j)
-
537{
-
538 return std::visit(
-
539 [&](auto const& value) {
-
540 if constexpr (std::is_same_v<
-
541 std::remove_cvref_t<decltype(value)>,
-
542 Issue>)
-
543 {
-
544 return accountHolds(view, account, value, zeroIfFrozen, j);
-
545 }
-
546 return accountHolds(
-
547 view, account, value, zeroIfFrozen, zeroIfUnauthorized, j);
-
548 },
-
549 asset.value());
-
550}
-
551
-
552STAmount
-
553accountFunds(
-
554 ReadView const& view,
-
555 AccountID const& id,
-
556 STAmount const& saDefault,
-
557 FreezeHandling freezeHandling,
-
558 beast::Journal j)
-
559{
-
560 if (!saDefault.native() && saDefault.getIssuer() == id)
-
561 return saDefault;
-
562
-
563 return accountHolds(
-
564 view,
-
565 id,
-
566 saDefault.getCurrency(),
-
567 saDefault.getIssuer(),
-
568 freezeHandling,
-
569 j);
-
570}
-
571
-
572// Prevent ownerCount from wrapping under error conditions.
-
573//
-
574// adjustment allows the ownerCount to be adjusted up or down in multiple steps.
-
575// If id != std::nullopt, then do error reporting.
-
576//
-
577// Returns adjusted owner count.
-
578static std::uint32_t
-
579confineOwnerCount(
-
580 std::uint32_t current,
-
581 std::int32_t adjustment,
-
582 std::optional<AccountID> const& id = std::nullopt,
-
583 beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
-
584{
-
585 std::uint32_t adjusted{current + adjustment};
-
586 if (adjustment > 0)
-
587 {
-
588 // Overflow is well defined on unsigned
-
589 if (adjusted < current)
-
590 {
-
591 if (id)
-
592 {
-
593 JLOG(j.fatal())
-
594 << "Account " << *id << " owner count exceeds max!";
-
595 }
-
596 adjusted = std::numeric_limits<std::uint32_t>::max();
-
597 }
-
598 }
-
599 else
-
600 {
-
601 // Underflow is well defined on unsigned
-
602 if (adjusted > current)
-
603 {
-
604 if (id)
-
605 {
-
606 JLOG(j.fatal())
-
607 << "Account " << *id << " owner count set below 0!";
-
608 }
-
609 adjusted = 0;
-
610 XRPL_ASSERT(!id, "ripple::confineOwnerCount : id is not set");
-
611 }
-
612 }
-
613 return adjusted;
-
614}
-
615
-
616XRPAmount
-
617xrpLiquid(
-
618 ReadView const& view,
-
619 AccountID const& id,
-
620 std::int32_t ownerCountAdj,
-
621 beast::Journal j)
-
622{
-
623 auto const sle = view.read(keylet::account(id));
-
624 if (sle == nullptr)
-
625 return beast::zero;
-
626
-
627 // Return balance minus reserve
-
628 std::uint32_t const ownerCount = confineOwnerCount(
-
629 view.ownerCountHook(id, sle->getFieldU32(sfOwnerCount)), ownerCountAdj);
-
630
-
631 // AMMs have no reserve requirement
-
632 auto const reserve = sle->isFieldPresent(sfAMMID)
-
633 ? XRPAmount{0}
-
634 : view.fees().accountReserve(ownerCount);
-
635
-
636 auto const fullBalance = sle->getFieldAmount(sfBalance);
-
637
-
638 auto const balance = view.balanceHook(id, xrpAccount(), fullBalance);
-
639
-
640 STAmount const amount =
-
641 (balance < reserve) ? STAmount{0} : balance - reserve;
-
642
-
643 JLOG(j.trace()) << "accountHolds:"
-
644 << " account=" << to_string(id)
-
645 << " amount=" << amount.getFullText()
-
646 << " fullBalance=" << fullBalance.getFullText()
-
647 << " balance=" << balance.getFullText()
-
648 << " reserve=" << reserve << " ownerCount=" << ownerCount
-
649 << " ownerCountAdj=" << ownerCountAdj;
-
650
-
651 return amount.xrp();
-
652}
-
653
-
654void
-
655forEachItem(
-
656 ReadView const& view,
-
657 Keylet const& root,
-
658 std::function<void(std::shared_ptr<SLE const> const&)> const& f)
-
659{
-
660 XRPL_ASSERT(
-
661 root.type == ltDIR_NODE, "ripple::forEachItem : valid root type");
-
662
-
663 if (root.type != ltDIR_NODE)
-
664 return;
-
665
-
666 auto pos = root;
-
667
-
668 while (true)
-
669 {
-
670 auto sle = view.read(pos);
-
671 if (!sle)
-
672 return;
-
673 for (auto const& key : sle->getFieldV256(sfIndexes))
-
674 f(view.read(keylet::child(key)));
-
675 auto const next = sle->getFieldU64(sfIndexNext);
-
676 if (!next)
-
677 return;
-
678 pos = keylet::page(root, next);
-
679 }
-
680}
-
681
-
682bool
-
683forEachItemAfter(
-
684 ReadView const& view,
-
685 Keylet const& root,
-
686 uint256 const& after,
-
687 std::uint64_t const hint,
-
688 unsigned int limit,
-
689 std::function<bool(std::shared_ptr<SLE const> const&)> const& f)
-
690{
-
691 XRPL_ASSERT(
-
692 root.type == ltDIR_NODE, "ripple::forEachItemAfter : valid root type");
-
693
-
694 if (root.type != ltDIR_NODE)
-
695 return false;
-
696
-
697 auto currentIndex = root;
-
698
-
699 // If startAfter is not zero try jumping to that page using the hint
-
700 if (after.isNonZero())
-
701 {
-
702 auto const hintIndex = keylet::page(root, hint);
-
703
-
704 if (auto hintDir = view.read(hintIndex))
-
705 {
-
706 for (auto const& key : hintDir->getFieldV256(sfIndexes))
-
707 {
-
708 if (key == after)
-
709 {
-
710 // We found the hint, we can start here
-
711 currentIndex = hintIndex;
-
712 break;
-
713 }
-
714 }
-
715 }
-
716
-
717 bool found = false;
-
718 for (;;)
-
719 {
-
720 auto const ownerDir = view.read(currentIndex);
-
721 if (!ownerDir)
-
722 return found;
-
723 for (auto const& key : ownerDir->getFieldV256(sfIndexes))
-
724 {
-
725 if (!found)
-
726 {
-
727 if (key == after)
-
728 found = true;
-
729 }
-
730 else if (f(view.read(keylet::child(key))) && limit-- <= 1)
-
731 {
-
732 return found;
-
733 }
-
734 }
-
735
-
736 auto const uNodeNext = ownerDir->getFieldU64(sfIndexNext);
-
737 if (uNodeNext == 0)
-
738 return found;
-
739 currentIndex = keylet::page(root, uNodeNext);
-
740 }
-
741 }
-
742 else
-
743 {
-
744 for (;;)
-
745 {
-
746 auto const ownerDir = view.read(currentIndex);
-
747 if (!ownerDir)
-
748 return true;
-
749 for (auto const& key : ownerDir->getFieldV256(sfIndexes))
-
750 if (f(view.read(keylet::child(key))) && limit-- <= 1)
-
751 return true;
-
752 auto const uNodeNext = ownerDir->getFieldU64(sfIndexNext);
-
753 if (uNodeNext == 0)
-
754 return true;
-
755 currentIndex = keylet::page(root, uNodeNext);
-
756 }
-
757 }
-
758}
-
759
-
760Rate
-
761transferRate(ReadView const& view, AccountID const& issuer)
-
762{
-
763 auto const sle = view.read(keylet::account(issuer));
-
764
-
765 if (sle && sle->isFieldPresent(sfTransferRate))
-
766 return Rate{sle->getFieldU32(sfTransferRate)};
-
767
-
768 return parityRate;
-
769}
-
770
-
771Rate
-
772transferRate(ReadView const& view, MPTID const& issuanceID)
-
773{
-
774 // fee is 0-50,000 (0-50%), rate is 1,000,000,000-2,000,000,000
-
775 // For example, if transfer fee is 50% then 10,000 * 50,000 = 500,000
-
776 // which represents 50% of 1,000,000,000
-
777 if (auto const sle = view.read(keylet::mptIssuance(issuanceID));
-
778 sle && sle->isFieldPresent(sfTransferFee))
-
779 return Rate{1'000'000'000u + 10'000 * sle->getFieldU16(sfTransferFee)};
-
780
-
781 return parityRate;
-
782}
-
783
-
784Rate
-
785transferRate(ReadView const& view, STAmount const& amount)
-
786{
-
787 return std::visit(
-
788 [&]<ValidIssueType TIss>(TIss const& issue) {
-
789 if constexpr (std::is_same_v<TIss, Issue>)
-
790 return transferRate(view, issue.getIssuer());
-
791 else
-
792 return transferRate(view, issue.getMptID());
-
793 },
-
794 amount.asset().value());
-
795}
-
796
-
797bool
-
798areCompatible(
-
799 ReadView const& validLedger,
-
800 ReadView const& testLedger,
-
801 beast::Journal::Stream& s,
-
802 char const* reason)
-
803{
-
804 bool ret = true;
-
805
-
806 if (validLedger.info().seq < testLedger.info().seq)
-
807 {
-
808 // valid -> ... -> test
-
809 auto hash = hashOfSeq(
-
810 testLedger,
-
811 validLedger.info().seq,
-
812 beast::Journal{beast::Journal::getNullSink()});
-
813 if (hash && (*hash != validLedger.info().hash))
-
814 {
-
815 JLOG(s) << reason << " incompatible with valid ledger";
-
816
-
817 JLOG(s) << "Hash(VSeq): " << to_string(*hash);
-
818
-
819 ret = false;
-
820 }
-
821 }
-
822 else if (validLedger.info().seq > testLedger.info().seq)
-
823 {
-
824 // test -> ... -> valid
-
825 auto hash = hashOfSeq(
-
826 validLedger,
-
827 testLedger.info().seq,
-
828 beast::Journal{beast::Journal::getNullSink()});
-
829 if (hash && (*hash != testLedger.info().hash))
-
830 {
-
831 JLOG(s) << reason << " incompatible preceding ledger";
-
832
-
833 JLOG(s) << "Hash(NSeq): " << to_string(*hash);
-
834
-
835 ret = false;
-
836 }
-
837 }
-
838 else if (
-
839 (validLedger.info().seq == testLedger.info().seq) &&
-
840 (validLedger.info().hash != testLedger.info().hash))
-
841 {
-
842 // Same sequence number, different hash
-
843 JLOG(s) << reason << " incompatible ledger";
-
844
-
845 ret = false;
-
846 }
-
847
-
848 if (!ret)
-
849 {
-
850 JLOG(s) << "Val: " << validLedger.info().seq << " "
-
851 << to_string(validLedger.info().hash);
-
852
-
853 JLOG(s) << "New: " << testLedger.info().seq << " "
-
854 << to_string(testLedger.info().hash);
-
855 }
-
856
-
857 return ret;
-
858}
-
859
-
860bool
-
861areCompatible(
-
862 uint256 const& validHash,
-
863 LedgerIndex validIndex,
-
864 ReadView const& testLedger,
-
865 beast::Journal::Stream& s,
-
866 char const* reason)
-
867{
-
868 bool ret = true;
-
869
-
870 if (testLedger.info().seq > validIndex)
-
871 {
-
872 // Ledger we are testing follows last valid ledger
-
873 auto hash = hashOfSeq(
-
874 testLedger,
-
875 validIndex,
-
876 beast::Journal{beast::Journal::getNullSink()});
-
877 if (hash && (*hash != validHash))
-
878 {
-
879 JLOG(s) << reason << " incompatible following ledger";
-
880 JLOG(s) << "Hash(VSeq): " << to_string(*hash);
-
881
-
882 ret = false;
-
883 }
-
884 }
-
885 else if (
-
886 (validIndex == testLedger.info().seq) &&
-
887 (testLedger.info().hash != validHash))
-
888 {
-
889 JLOG(s) << reason << " incompatible ledger";
-
890
-
891 ret = false;
-
892 }
-
893
-
894 if (!ret)
-
895 {
-
896 JLOG(s) << "Val: " << validIndex << " " << to_string(validHash);
-
897
-
898 JLOG(s) << "New: " << testLedger.info().seq << " "
-
899 << to_string(testLedger.info().hash);
-
900 }
-
901
-
902 return ret;
-
903}
-
904
-
905bool
-
906dirIsEmpty(ReadView const& view, Keylet const& k)
-
907{
-
908 auto const sleNode = view.read(k);
-
909 if (!sleNode)
-
910 return true;
-
911 if (!sleNode->getFieldV256(sfIndexes).empty())
-
912 return false;
-
913 // The first page of a directory may legitimately be empty even if there
-
914 // are other pages (the first page is the anchor page) so check to see if
-
915 // there is another page. If there is, the directory isn't empty.
-
916 return sleNode->getFieldU64(sfIndexNext) == 0;
-
917}
-
918
-
919std::set<uint256>
-
920getEnabledAmendments(ReadView const& view)
-
921{
-
922 std::set<uint256> amendments;
-
923
-
924 if (auto const sle = view.read(keylet::amendments()))
-
925 {
-
926 if (sle->isFieldPresent(sfAmendments))
-
927 {
-
928 auto const& v = sle->getFieldV256(sfAmendments);
-
929 amendments.insert(v.begin(), v.end());
-
930 }
-
931 }
-
932
-
933 return amendments;
-
934}
-
935
-
936majorityAmendments_t
-
937getMajorityAmendments(ReadView const& view)
-
938{
-
939 majorityAmendments_t ret;
-
940
-
941 if (auto const sle = view.read(keylet::amendments()))
-
942 {
-
943 if (sle->isFieldPresent(sfMajorities))
-
944 {
-
945 using tp = NetClock::time_point;
-
946 using d = tp::duration;
-
947
-
948 auto const majorities = sle->getFieldArray(sfMajorities);
-
949
-
950 for (auto const& m : majorities)
-
951 ret[m.getFieldH256(sfAmendment)] =
-
952 tp(d(m.getFieldU32(sfCloseTime)));
-
953 }
-
954 }
-
955
-
956 return ret;
-
957}
-
958
-
959std::optional<uint256>
-
960hashOfSeq(ReadView const& ledger, LedgerIndex seq, beast::Journal journal)
-
961{
-
962 // Easy cases...
-
963 if (seq > ledger.seq())
-
964 {
-
965 JLOG(journal.warn())
-
966 << "Can't get seq " << seq << " from " << ledger.seq() << " future";
-
967 return std::nullopt;
-
968 }
-
969 if (seq == ledger.seq())
-
970 return ledger.info().hash;
-
971 if (seq == (ledger.seq() - 1))
-
972 return ledger.info().parentHash;
-
973
-
974 if (int diff = ledger.seq() - seq; diff <= 256)
-
975 {
-
976 // Within 256...
-
977 auto const hashIndex = ledger.read(keylet::skip());
-
978 if (hashIndex)
-
979 {
-
980 XRPL_ASSERT(
-
981 hashIndex->getFieldU32(sfLastLedgerSequence) ==
-
982 (ledger.seq() - 1),
-
983 "ripple::hashOfSeq : matching ledger sequence");
-
984 STVector256 vec = hashIndex->getFieldV256(sfHashes);
-
985 if (vec.size() >= diff)
-
986 return vec[vec.size() - diff];
-
987 JLOG(journal.warn())
-
988 << "Ledger " << ledger.seq() << " missing hash for " << seq
-
989 << " (" << vec.size() << "," << diff << ")";
-
990 }
-
991 else
-
992 {
-
993 JLOG(journal.warn())
-
994 << "Ledger " << ledger.seq() << ":" << ledger.info().hash
-
995 << " missing normal list";
-
996 }
-
997 }
-
998
-
999 if ((seq & 0xff) != 0)
-
1000 {
-
1001 JLOG(journal.debug())
-
1002 << "Can't get seq " << seq << " from " << ledger.seq() << " past";
-
1003 return std::nullopt;
-
1004 }
-
1005
-
1006 // in skiplist
-
1007 auto const hashIndex = ledger.read(keylet::skip(seq));
-
1008 if (hashIndex)
-
1009 {
-
1010 auto const lastSeq = hashIndex->getFieldU32(sfLastLedgerSequence);
-
1011 XRPL_ASSERT(lastSeq >= seq, "ripple::hashOfSeq : minimum last ledger");
-
1012 XRPL_ASSERT(
-
1013 (lastSeq & 0xff) == 0, "ripple::hashOfSeq : valid last ledger");
-
1014 auto const diff = (lastSeq - seq) >> 8;
-
1015 STVector256 vec = hashIndex->getFieldV256(sfHashes);
-
1016 if (vec.size() > diff)
-
1017 return vec[vec.size() - diff - 1];
-
1018 }
-
1019 JLOG(journal.warn()) << "Can't get seq " << seq << " from " << ledger.seq()
-
1020 << " error";
-
1021 return std::nullopt;
-
1022}
-
1023
-
1024//------------------------------------------------------------------------------
-
1025//
-
1026// Modifiers
-
1027//
-
1028//------------------------------------------------------------------------------
-
1029
-
1030void
-
1031adjustOwnerCount(
-
1032 ApplyView& view,
-
1033 std::shared_ptr<SLE> const& sle,
-
1034 std::int32_t amount,
-
1035 beast::Journal j)
-
1036{
-
1037 if (!sle)
-
1038 return;
-
1039 XRPL_ASSERT(amount, "ripple::adjustOwnerCount : nonzero amount input");
-
1040 std::uint32_t const current{sle->getFieldU32(sfOwnerCount)};
-
1041 AccountID const id = (*sle)[sfAccount];
-
1042 std::uint32_t const adjusted = confineOwnerCount(current, amount, id, j);
-
1043 view.adjustOwnerCountHook(id, current, adjusted);
-
1044 sle->setFieldU32(sfOwnerCount, adjusted);
-
1045 view.update(sle);
-
1046}
-
1047
-
1048std::function<void(SLE::ref)>
-
1049describeOwnerDir(AccountID const& account)
-
1050{
-
1051 return [&account](std::shared_ptr<SLE> const& sle) {
-
1052 (*sle)[sfOwner] = account;
-
1053 };
-
1054}
-
1055
-
1056TER
-
1057dirLink(ApplyView& view, AccountID const& owner, std::shared_ptr<SLE>& object)
-
1058{
-
1059 auto const page = view.dirInsert(
-
1060 keylet::ownerDir(owner), object->key(), describeOwnerDir(owner));
-
1061 if (!page)
-
1062 return tecDIR_FULL; // LCOV_EXCL_LINE
-
1063 object->setFieldU64(sfOwnerNode, *page);
-
1064 return tesSUCCESS;
-
1065}
-
1066
-
1067AccountID
-
1068pseudoAccountAddress(ReadView const& view, uint256 const& pseudoOwnerKey)
-
1069{
-
1070 // This number must not be changed without an amendment
-
1071 constexpr std::uint16_t maxAccountAttempts = 256;
-
1072 for (std::uint16_t i = 0; i < maxAccountAttempts; ++i)
-
1073 {
-
1074 ripesha_hasher rsh;
-
1075 auto const hash = sha512Half(i, view.info().parentHash, pseudoOwnerKey);
-
1076 rsh(hash.data(), hash.size());
-
1077 AccountID const ret{static_cast<ripesha_hasher::result_type>(rsh)};
-
1078 if (!view.read(keylet::account(ret)))
-
1079 return ret;
-
1080 }
-
1081 return beast::zero;
-
1082}
-
1083
-
1084// Note, the list of the pseudo-account designator fields below MUST be
-
1085// maintained but it does NOT need to be amendment-gated, since a
-
1086// non-active amendment will not set any field, by definition. Specific
-
1087// properties of a pseudo-account are NOT checked here, that's what
-
1088// InvariantCheck is for.
-
1089static std::array<SField const*, 2> const pseudoAccountOwnerFields = {
-
1090 &sfAMMID, //
-
1091 &sfVaultID, //
-
1092};
-
1093
-
1094Expected<std::shared_ptr<SLE>, TER>
-
1095createPseudoAccount(
-
1096 ApplyView& view,
-
1097 uint256 const& pseudoOwnerKey,
-
1098 SField const& ownerField)
-
1099{
-
1100 XRPL_ASSERT(
-
1101 std::count_if(
-
1102 pseudoAccountOwnerFields.begin(),
-
1103 pseudoAccountOwnerFields.end(),
-
1104 [&ownerField](SField const* sf) -> bool {
-
1105 return *sf == ownerField;
-
1106 }) == 1,
-
1107 "ripple::createPseudoAccount : valid owner field");
-
1108
-
1109 auto const accountId = pseudoAccountAddress(view, pseudoOwnerKey);
-
1110 if (accountId == beast::zero)
-
1111 return Unexpected(tecDUPLICATE);
-
1112
-
1113 // Create pseudo-account.
-
1114 auto account = std::make_shared<SLE>(keylet::account(accountId));
-
1115 account->setAccountID(sfAccount, accountId);
-
1116 account->setFieldAmount(sfBalance, STAmount{});
-
1117
-
1118 // Pseudo-accounts can't submit transactions, so set the sequence number
-
1119 // to 0 to make them easier to spot and verify, and add an extra level
-
1120 // of protection.
-
1121 std::uint32_t const seqno = //
-
1122 view.rules().enabled(featureSingleAssetVault) //
-
1123 ? 0 //
-
1124 : view.seq();
-
1125 account->setFieldU32(sfSequence, seqno);
-
1126 // Ignore reserves requirement, disable the master key, allow default
-
1127 // rippling, and enable deposit authorization to prevent payments into
-
1128 // pseudo-account.
-
1129 account->setFieldU32(
-
1130 sfFlags, lsfDisableMaster | lsfDefaultRipple | lsfDepositAuth);
-
1131 // Link the pseudo-account with its owner object.
-
1132 account->setFieldH256(ownerField, pseudoOwnerKey);
-
1133
-
1134 view.insert(account);
-
1135
-
1136 return account;
-
1137}
-
1138
-
1139[[nodiscard]] bool
-
1140isPseudoAccount(std::shared_ptr<SLE const> sleAcct)
-
1141{
-
1142 // Intentionally use defensive coding here because it's cheap and makes the
-
1143 // semantics of true return value clean.
-
1144 return sleAcct && sleAcct->getType() == ltACCOUNT_ROOT &&
-
1145 std::count_if(
-
1146 pseudoAccountOwnerFields.begin(),
-
1147 pseudoAccountOwnerFields.end(),
-
1148 [&sleAcct](SField const* sf) -> bool {
-
1149 return sleAcct->isFieldPresent(*sf);
-
1150 }) > 0;
-
1151}
-
1152
-
1153[[nodiscard]] TER
-
1154addEmptyHolding(
-
1155 ApplyView& view,
-
1156 AccountID const& accountID,
-
1157 XRPAmount priorBalance,
-
1158 Issue const& issue,
-
1159 beast::Journal journal)
-
1160{
-
1161 // Every account can hold XRP.
-
1162 if (issue.native())
-
1163 return tesSUCCESS;
-
1164
-
1165 auto const& issuerId = issue.getIssuer();
-
1166 auto const& currency = issue.currency;
-
1167 if (isGlobalFrozen(view, issuerId))
-
1168 return tecFROZEN; // LCOV_EXCL_LINE
-
1169
-
1170 auto const& srcId = issuerId;
-
1171 auto const& dstId = accountID;
-
1172 auto const high = srcId > dstId;
-
1173 auto const index = keylet::line(srcId, dstId, currency);
-
1174 auto const sleSrc = view.peek(keylet::account(srcId));
-
1175 auto const sleDst = view.peek(keylet::account(dstId));
-
1176 if (!sleDst || !sleSrc)
-
1177 return tefINTERNAL; // LCOV_EXCL_LINE
-
1178 if (!sleSrc->isFlag(lsfDefaultRipple))
-
1179 return tecINTERNAL; // LCOV_EXCL_LINE
-
1180 // If the line already exists, don't create it again.
-
1181 if (view.read(index))
-
1182 return tecDUPLICATE;
-
1183 return trustCreate(
-
1184 view,
-
1185 high,
-
1186 srcId,
-
1187 dstId,
-
1188 index.key,
-
1189 sleDst,
-
1190 /*auth=*/false,
-
1191 /*noRipple=*/true,
-
1192 /*freeze=*/false,
-
1193 /*deepFreeze*/ false,
-
1194 /*balance=*/STAmount{Issue{currency, noAccount()}},
-
1195 /*limit=*/STAmount{Issue{currency, dstId}},
-
1196 /*qualityIn=*/0,
-
1197 /*qualityOut=*/0,
-
1198 journal);
-
1199}
-
1200
-
1201[[nodiscard]] TER
-
1202addEmptyHolding(
-
1203 ApplyView& view,
-
1204 AccountID const& accountID,
-
1205 XRPAmount priorBalance,
-
1206 MPTIssue const& mptIssue,
-
1207 beast::Journal journal)
-
1208{
-
1209 auto const& mptID = mptIssue.getMptID();
-
1210 auto const mpt = view.peek(keylet::mptIssuance(mptID));
-
1211 if (!mpt)
-
1212 return tefINTERNAL; // LCOV_EXCL_LINE
-
1213 if (mpt->isFlag(lsfMPTLocked))
-
1214 return tefINTERNAL; // LCOV_EXCL_LINE
-
1215 if (view.peek(keylet::mptoken(mptID, accountID)))
-
1216 return tecDUPLICATE;
-
1217
-
1218 return MPTokenAuthorize::authorize(
-
1219 view,
-
1220 journal,
-
1221 {.priorBalance = priorBalance,
-
1222 .mptIssuanceID = mptID,
-
1223 .account = accountID});
-
1224}
-
1225
-
1226TER
-
1227trustCreate(
-
1228 ApplyView& view,
-
1229 bool const bSrcHigh,
-
1230 AccountID const& uSrcAccountID,
-
1231 AccountID const& uDstAccountID,
-
1232 uint256 const& uIndex, // --> ripple state entry
-
1233 SLE::ref sleAccount, // --> the account being set.
-
1234 bool const bAuth, // --> authorize account.
-
1235 bool const bNoRipple, // --> others cannot ripple through
-
1236 bool const bFreeze, // --> funds cannot leave
-
1237 bool bDeepFreeze, // --> can neither receive nor send funds
-
1238 STAmount const& saBalance, // --> balance of account being set.
-
1239 // Issuer should be noAccount()
-
1240 STAmount const& saLimit, // --> limit for account being set.
-
1241 // Issuer should be the account being set.
-
1242 std::uint32_t uQualityIn,
-
1243 std::uint32_t uQualityOut,
-
1244 beast::Journal j)
-
1245{
-
1246 JLOG(j.trace()) << "trustCreate: " << to_string(uSrcAccountID) << ", "
-
1247 << to_string(uDstAccountID) << ", "
-
1248 << saBalance.getFullText();
-
1249
-
1250 auto const& uLowAccountID = !bSrcHigh ? uSrcAccountID : uDstAccountID;
-
1251 auto const& uHighAccountID = bSrcHigh ? uSrcAccountID : uDstAccountID;
-
1252
-
1253 auto const sleRippleState = std::make_shared<SLE>(ltRIPPLE_STATE, uIndex);
-
1254 view.insert(sleRippleState);
+
21#include <xrpld/ledger/ReadView.h>
+
22#include <xrpld/ledger/View.h>
+
23
+
24#include <xrpl/basics/Expected.h>
+
25#include <xrpl/basics/Log.h>
+
26#include <xrpl/basics/chrono.h>
+
27#include <xrpl/beast/utility/instrumentation.h>
+
28#include <xrpl/protocol/Feature.h>
+
29#include <xrpl/protocol/Indexes.h>
+
30#include <xrpl/protocol/LedgerFormats.h>
+
31#include <xrpl/protocol/MPTIssue.h>
+
32#include <xrpl/protocol/Protocol.h>
+
33#include <xrpl/protocol/Quality.h>
+
34#include <xrpl/protocol/TER.h>
+
35#include <xrpl/protocol/TxFlags.h>
+
36#include <xrpl/protocol/digest.h>
+
37#include <xrpl/protocol/st.h>
+
38
+
39#include <type_traits>
+
40#include <variant>
+
41
+
42namespace ripple {
+
43
+
44namespace detail {
+
45
+
46template <
+
47 class V,
+
48 class N,
+
49 class = std::enable_if_t<
+
50 std::is_same_v<std::remove_cv_t<N>, SLE> &&
+
51 std::is_base_of_v<ReadView, V>>>
+
52bool
+
53internalDirNext(
+
54 V& view,
+
55 uint256 const& root,
+
56 std::shared_ptr<N>& page,
+
57 unsigned int& index,
+
58 uint256& entry)
+
59{
+
60 auto const& svIndexes = page->getFieldV256(sfIndexes);
+
61 XRPL_ASSERT(
+
62 index <= svIndexes.size(),
+
63 "ripple::detail::internalDirNext : index inside range");
+
64
+
65 if (index >= svIndexes.size())
+
66 {
+
67 auto const next = page->getFieldU64(sfIndexNext);
+
68
+
69 if (!next)
+
70 {
+
71 entry.zero();
+
72 return false;
+
73 }
+
74
+
75 if constexpr (std::is_const_v<N>)
+
76 page = view.read(keylet::page(root, next));
+
77 else
+
78 page = view.peek(keylet::page(root, next));
+
79
+
80 XRPL_ASSERT(page, "ripple::detail::internalDirNext : non-null root");
+
81
+
82 if (!page)
+
83 return false;
+
84
+
85 index = 0;
+
86
+
87 return internalDirNext(view, root, page, index, entry);
+
88 }
+
89
+
90 entry = svIndexes[index++];
+
91 return true;
+
92}
+
93
+
94template <
+
95 class V,
+
96 class N,
+
97 class = std::enable_if_t<
+
98 std::is_same_v<std::remove_cv_t<N>, SLE> &&
+
99 std::is_base_of_v<ReadView, V>>>
+
100bool
+
101internalDirFirst(
+
102 V& view,
+
103 uint256 const& root,
+
104 std::shared_ptr<N>& page,
+
105 unsigned int& index,
+
106 uint256& entry)
+
107{
+
108 if constexpr (std::is_const_v<N>)
+
109 page = view.read(keylet::page(root));
+
110 else
+
111 page = view.peek(keylet::page(root));
+
112
+
113 if (!page)
+
114 return false;
+
115
+
116 index = 0;
+
117
+
118 return internalDirNext(view, root, page, index, entry);
+
119}
+
120
+
121} // namespace detail
+
122
+
123bool
+
124dirFirst(
+
125 ApplyView& view,
+
126 uint256 const& root,
+
127 std::shared_ptr<SLE>& page,
+
128 unsigned int& index,
+
129 uint256& entry)
+
130{
+
131 return detail::internalDirFirst(view, root, page, index, entry);
+
132}
+
133
+
134bool
+
135dirNext(
+
136 ApplyView& view,
+
137 uint256 const& root,
+
138 std::shared_ptr<SLE>& page,
+
139 unsigned int& index,
+
140 uint256& entry)
+
141{
+
142 return detail::internalDirNext(view, root, page, index, entry);
+
143}
+
144
+
145bool
+
146cdirFirst(
+
147 ReadView const& view,
+
148 uint256 const& root,
+
149 std::shared_ptr<SLE const>& page,
+
150 unsigned int& index,
+
151 uint256& entry)
+
152{
+
153 return detail::internalDirFirst(view, root, page, index, entry);
+
154}
+
155
+
156bool
+
157cdirNext(
+
158 ReadView const& view,
+
159 uint256 const& root,
+
160 std::shared_ptr<SLE const>& page,
+
161 unsigned int& index,
+
162 uint256& entry)
+
163{
+
164 return detail::internalDirNext(view, root, page, index, entry);
+
165}
+
166
+
167//------------------------------------------------------------------------------
+
168//
+
169// Observers
+
170//
+
171//------------------------------------------------------------------------------
+
172
+
173bool
+
174hasExpired(ReadView const& view, std::optional<std::uint32_t> const& exp)
+
175{
+
176 using d = NetClock::duration;
+
177 using tp = NetClock::time_point;
+
178
+
179 return exp && (view.parentCloseTime() >= tp{d{*exp}});
+
180}
+
181
+
182bool
+
183isGlobalFrozen(ReadView const& view, AccountID const& issuer)
+
184{
+
185 if (isXRP(issuer))
+
186 return false;
+
187 if (auto const sle = view.read(keylet::account(issuer)))
+
188 return sle->isFlag(lsfGlobalFreeze);
+
189 return false;
+
190}
+
191
+
192bool
+
193isGlobalFrozen(ReadView const& view, MPTIssue const& mptIssue)
+
194{
+
195 if (auto const sle = view.read(keylet::mptIssuance(mptIssue.getMptID())))
+
196 return sle->isFlag(lsfMPTLocked);
+
197 return false;
+
198}
+
199
+
200bool
+
201isGlobalFrozen(ReadView const& view, Asset const& asset)
+
202{
+
203 return std::visit(
+
204 [&]<ValidIssueType TIss>(TIss const& issue) {
+
205 if constexpr (std::is_same_v<TIss, Issue>)
+
206 return isGlobalFrozen(view, issue.getIssuer());
+
207 else
+
208 return isGlobalFrozen(view, issue);
+
209 },
+
210 asset.value());
+
211}
+
212
+
213bool
+
214isIndividualFrozen(
+
215 ReadView const& view,
+
216 AccountID const& account,
+
217 Currency const& currency,
+
218 AccountID const& issuer)
+
219{
+
220 if (isXRP(currency))
+
221 return false;
+
222 if (issuer != account)
+
223 {
+
224 // Check if the issuer froze the line
+
225 auto const sle = view.read(keylet::line(account, issuer, currency));
+
226 if (sle &&
+
227 sle->isFlag((issuer > account) ? lsfHighFreeze : lsfLowFreeze))
+
228 return true;
+
229 }
+
230 return false;
+
231}
+
232
+
233bool
+
234isIndividualFrozen(
+
235 ReadView const& view,
+
236 AccountID const& account,
+
237 MPTIssue const& mptIssue)
+
238{
+
239 if (auto const sle =
+
240 view.read(keylet::mptoken(mptIssue.getMptID(), account)))
+
241 return sle->isFlag(lsfMPTLocked);
+
242 return false;
+
243}
+
244
+
245// Can the specified account spend the specified currency issued by
+
246// the specified issuer or does the freeze flag prohibit it?
+
247bool
+
248isFrozen(
+
249 ReadView const& view,
+
250 AccountID const& account,
+
251 Currency const& currency,
+
252 AccountID const& issuer)
+
253{
+
254 if (isXRP(currency))
+
255 return false;
+
256 auto sle = view.read(keylet::account(issuer));
+
257 if (sle && sle->isFlag(lsfGlobalFreeze))
+
258 return true;
+
259 if (issuer != account)
+
260 {
+
261 // Check if the issuer froze the line
+
262 sle = view.read(keylet::line(account, issuer, currency));
+
263 if (sle &&
+
264 sle->isFlag((issuer > account) ? lsfHighFreeze : lsfLowFreeze))
+
265 return true;
+
266 }
+
267 return false;
+
268}
+
269
+
270bool
+
271isFrozen(
+
272 ReadView const& view,
+
273 AccountID const& account,
+
274 MPTIssue const& mptIssue,
+
275 int depth)
+
276{
+
277 return isGlobalFrozen(view, mptIssue) ||
+
278 isIndividualFrozen(view, account, mptIssue) ||
+
279 isVaultPseudoAccountFrozen(view, account, mptIssue, depth);
+
280}
+
281
+
282[[nodiscard]] bool
+
283isAnyFrozen(
+
284 ReadView const& view,
+
285 std::initializer_list<AccountID> const& accounts,
+
286 MPTIssue const& mptIssue,
+
287 int depth)
+
288{
+
289 if (isGlobalFrozen(view, mptIssue))
+
290 return true;
+
291
+
292 for (auto const& account : accounts)
+
293 {
+
294 if (isIndividualFrozen(view, account, mptIssue))
+
295 return true;
+
296 }
+
297
+
298 for (auto const& account : accounts)
+
299 {
+
300 if (isVaultPseudoAccountFrozen(view, account, mptIssue, depth))
+
301 return true;
+
302 }
+
303
+
304 return false;
+
305}
+
306
+
307bool
+
308isVaultPseudoAccountFrozen(
+
309 ReadView const& view,
+
310 AccountID const& account,
+
311 MPTIssue const& mptShare,
+
312 int depth)
+
313{
+
314 if (!view.rules().enabled(featureSingleAssetVault))
+
315 return false;
+
316
+
317 if (depth >= maxAssetCheckDepth)
+
318 return true; // LCOV_EXCL_LINE
+
319
+
320 auto const mptIssuance =
+
321 view.read(keylet::mptIssuance(mptShare.getMptID()));
+
322 if (mptIssuance == nullptr)
+
323 return false; // zero MPToken won't block deletion of MPTokenIssuance
+
324
+
325 auto const issuer = mptIssuance->getAccountID(sfIssuer);
+
326 auto const mptIssuer = view.read(keylet::account(issuer));
+
327 if (mptIssuer == nullptr)
+
328 { // LCOV_EXCL_START
+
329 UNREACHABLE("ripple::isVaultPseudoAccountFrozen : null MPToken issuer");
+
330 return false;
+
331 } // LCOV_EXCL_STOP
+
332
+
333 if (!mptIssuer->isFieldPresent(sfVaultID))
+
334 return false; // not a Vault pseudo-account, common case
+
335
+
336 auto const vault =
+
337 view.read(keylet::vault(mptIssuer->getFieldH256(sfVaultID)));
+
338 if (vault == nullptr)
+
339 { // LCOV_EXCL_START
+
340 UNREACHABLE("ripple::isVaultPseudoAccountFrozen : null vault");
+
341 return false;
+
342 } // LCOV_EXCL_STOP
+
343
+
344 return isAnyFrozen(view, {issuer, account}, vault->at(sfAsset), depth + 1);
+
345}
+
346
+
347bool
+
348isDeepFrozen(
+
349 ReadView const& view,
+
350 AccountID const& account,
+
351 Currency const& currency,
+
352 AccountID const& issuer)
+
353{
+
354 if (isXRP(currency))
+
355 {
+
356 return false;
+
357 }
+
358
+
359 if (issuer == account)
+
360 {
+
361 return false;
+
362 }
+
363
+
364 auto const sle = view.read(keylet::line(account, issuer, currency));
+
365 if (!sle)
+
366 {
+
367 return false;
+
368 }
+
369
+
370 return sle->isFlag(lsfHighDeepFreeze) || sle->isFlag(lsfLowDeepFreeze);
+
371}
+
372
+
373bool
+
374isLPTokenFrozen(
+
375 ReadView const& view,
+
376 AccountID const& account,
+
377 Issue const& asset,
+
378 Issue const& asset2)
+
379{
+
380 return isFrozen(view, account, asset.currency, asset.account) ||
+
381 isFrozen(view, account, asset2.currency, asset2.account);
+
382}
+
383
+
384STAmount
+
385accountHolds(
+
386 ReadView const& view,
+
387 AccountID const& account,
+
388 Currency const& currency,
+
389 AccountID const& issuer,
+
390 FreezeHandling zeroIfFrozen,
+
391 beast::Journal j)
+
392{
+
393 STAmount amount;
+
394 if (isXRP(currency))
+
395 {
+
396 return {xrpLiquid(view, account, 0, j)};
+
397 }
+
398
+
399 // IOU: Return balance on trust line modulo freeze
+
400 auto const sle = view.read(keylet::line(account, issuer, currency));
+
401 auto const allowBalance = [&]() {
+
402 if (!sle)
+
403 {
+
404 return false;
+
405 }
+
406
+
407 if (zeroIfFrozen == fhZERO_IF_FROZEN)
+
408 {
+
409 if (isFrozen(view, account, currency, issuer) ||
+
410 isDeepFrozen(view, account, currency, issuer))
+
411 {
+
412 return false;
+
413 }
+
414
+
415 // when fixFrozenLPTokenTransfer is enabled, if currency is lptoken,
+
416 // we need to check if the associated assets have been frozen
+
417 if (view.rules().enabled(fixFrozenLPTokenTransfer))
+
418 {
+
419 auto const sleIssuer = view.read(keylet::account(issuer));
+
420 if (!sleIssuer)
+
421 {
+
422 return false; // LCOV_EXCL_LINE
+
423 }
+
424 else if (sleIssuer->isFieldPresent(sfAMMID))
+
425 {
+
426 auto const sleAmm =
+
427 view.read(keylet::amm((*sleIssuer)[sfAMMID]));
+
428
+
429 if (!sleAmm ||
+
430 isLPTokenFrozen(
+
431 view,
+
432 account,
+
433 (*sleAmm)[sfAsset].get<Issue>(),
+
434 (*sleAmm)[sfAsset2].get<Issue>()))
+
435 {
+
436 return false;
+
437 }
+
438 }
+
439 }
+
440 }
+
441
+
442 return true;
+
443 }();
+
444
+
445 if (allowBalance)
+
446 {
+
447 amount = sle->getFieldAmount(sfBalance);
+
448 if (account > issuer)
+
449 {
+
450 // Put balance in account terms.
+
451 amount.negate();
+
452 }
+
453 amount.setIssuer(issuer);
+
454 }
+
455 else
+
456 {
+
457 amount.clear(Issue{currency, issuer});
+
458 }
+
459
+
460 JLOG(j.trace()) << "accountHolds:"
+
461 << " account=" << to_string(account)
+
462 << " amount=" << amount.getFullText();
+
463
+
464 return view.balanceHook(account, issuer, amount);
+
465}
+
466
+
467STAmount
+
468accountHolds(
+
469 ReadView const& view,
+
470 AccountID const& account,
+
471 Issue const& issue,
+
472 FreezeHandling zeroIfFrozen,
+
473 beast::Journal j)
+
474{
+
475 return accountHolds(
+
476 view, account, issue.currency, issue.account, zeroIfFrozen, j);
+
477}
+
478
+
479STAmount
+
480accountHolds(
+
481 ReadView const& view,
+
482 AccountID const& account,
+
483 MPTIssue const& mptIssue,
+
484 FreezeHandling zeroIfFrozen,
+
485 AuthHandling zeroIfUnauthorized,
+
486 beast::Journal j)
+
487{
+
488 STAmount amount;
+
489
+
490 auto const sleMpt =
+
491 view.read(keylet::mptoken(mptIssue.getMptID(), account));
+
492
+
493 if (!sleMpt)
+
494 amount.clear(mptIssue);
+
495 else if (
+
496 zeroIfFrozen == fhZERO_IF_FROZEN && isFrozen(view, account, mptIssue))
+
497 amount.clear(mptIssue);
+
498 else
+
499 {
+
500 amount = STAmount{mptIssue, sleMpt->getFieldU64(sfMPTAmount)};
+
501
+
502 // Only if auth check is needed, as it needs to do an additional read
+
503 // operation. Note featureSingleAssetVault will affect error codes.
+
504 if (zeroIfUnauthorized == ahZERO_IF_UNAUTHORIZED &&
+
505 view.rules().enabled(featureSingleAssetVault))
+
506 {
+
507 if (auto const err =
+
508 requireAuth(view, mptIssue, account, AuthType::StrongAuth);
+
509 !isTesSuccess(err))
+
510 amount.clear(mptIssue);
+
511 }
+
512 else if (zeroIfUnauthorized == ahZERO_IF_UNAUTHORIZED)
+
513 {
+
514 auto const sleIssuance =
+
515 view.read(keylet::mptIssuance(mptIssue.getMptID()));
+
516
+
517 // if auth is enabled on the issuance and mpt is not authorized,
+
518 // clear amount
+
519 if (sleIssuance && sleIssuance->isFlag(lsfMPTRequireAuth) &&
+
520 !sleMpt->isFlag(lsfMPTAuthorized))
+
521 amount.clear(mptIssue);
+
522 }
+
523 }
+
524
+
525 return amount;
+
526}
+
527
+
528[[nodiscard]] STAmount
+
529accountHolds(
+
530 ReadView const& view,
+
531 AccountID const& account,
+
532 Asset const& asset,
+
533 FreezeHandling zeroIfFrozen,
+
534 AuthHandling zeroIfUnauthorized,
+
535 beast::Journal j)
+
536{
+
537 return std::visit(
+
538 [&](auto const& value) {
+
539 if constexpr (std::is_same_v<
+
540 std::remove_cvref_t<decltype(value)>,
+
541 Issue>)
+
542 {
+
543 return accountHolds(view, account, value, zeroIfFrozen, j);
+
544 }
+
545 return accountHolds(
+
546 view, account, value, zeroIfFrozen, zeroIfUnauthorized, j);
+
547 },
+
548 asset.value());
+
549}
+
550
+
551STAmount
+
552accountFunds(
+
553 ReadView const& view,
+
554 AccountID const& id,
+
555 STAmount const& saDefault,
+
556 FreezeHandling freezeHandling,
+
557 beast::Journal j)
+
558{
+
559 if (!saDefault.native() && saDefault.getIssuer() == id)
+
560 return saDefault;
+
561
+
562 return accountHolds(
+
563 view,
+
564 id,
+
565 saDefault.getCurrency(),
+
566 saDefault.getIssuer(),
+
567 freezeHandling,
+
568 j);
+
569}
+
570
+
571// Prevent ownerCount from wrapping under error conditions.
+
572//
+
573// adjustment allows the ownerCount to be adjusted up or down in multiple steps.
+
574// If id != std::nullopt, then do error reporting.
+
575//
+
576// Returns adjusted owner count.
+
577static std::uint32_t
+
578confineOwnerCount(
+
579 std::uint32_t current,
+
580 std::int32_t adjustment,
+
581 std::optional<AccountID> const& id = std::nullopt,
+
582 beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
+
583{
+
584 std::uint32_t adjusted{current + adjustment};
+
585 if (adjustment > 0)
+
586 {
+
587 // Overflow is well defined on unsigned
+
588 if (adjusted < current)
+
589 {
+
590 if (id)
+
591 {
+
592 JLOG(j.fatal())
+
593 << "Account " << *id << " owner count exceeds max!";
+
594 }
+
595 adjusted = std::numeric_limits<std::uint32_t>::max();
+
596 }
+
597 }
+
598 else
+
599 {
+
600 // Underflow is well defined on unsigned
+
601 if (adjusted > current)
+
602 {
+
603 if (id)
+
604 {
+
605 JLOG(j.fatal())
+
606 << "Account " << *id << " owner count set below 0!";
+
607 }
+
608 adjusted = 0;
+
609 XRPL_ASSERT(!id, "ripple::confineOwnerCount : id is not set");
+
610 }
+
611 }
+
612 return adjusted;
+
613}
+
614
+
615XRPAmount
+
616xrpLiquid(
+
617 ReadView const& view,
+
618 AccountID const& id,
+
619 std::int32_t ownerCountAdj,
+
620 beast::Journal j)
+
621{
+
622 auto const sle = view.read(keylet::account(id));
+
623 if (sle == nullptr)
+
624 return beast::zero;
+
625
+
626 // Return balance minus reserve
+
627 std::uint32_t const ownerCount = confineOwnerCount(
+
628 view.ownerCountHook(id, sle->getFieldU32(sfOwnerCount)), ownerCountAdj);
+
629
+
630 // AMMs have no reserve requirement
+
631 auto const reserve = sle->isFieldPresent(sfAMMID)
+
632 ? XRPAmount{0}
+
633 : view.fees().accountReserve(ownerCount);
+
634
+
635 auto const fullBalance = sle->getFieldAmount(sfBalance);
+
636
+
637 auto const balance = view.balanceHook(id, xrpAccount(), fullBalance);
+
638
+
639 STAmount const amount =
+
640 (balance < reserve) ? STAmount{0} : balance - reserve;
+
641
+
642 JLOG(j.trace()) << "accountHolds:"
+
643 << " account=" << to_string(id)
+
644 << " amount=" << amount.getFullText()
+
645 << " fullBalance=" << fullBalance.getFullText()
+
646 << " balance=" << balance.getFullText()
+
647 << " reserve=" << reserve << " ownerCount=" << ownerCount
+
648 << " ownerCountAdj=" << ownerCountAdj;
+
649
+
650 return amount.xrp();
+
651}
+
652
+
653void
+
654forEachItem(
+
655 ReadView const& view,
+
656 Keylet const& root,
+
657 std::function<void(std::shared_ptr<SLE const> const&)> const& f)
+
658{
+
659 XRPL_ASSERT(
+
660 root.type == ltDIR_NODE, "ripple::forEachItem : valid root type");
+
661
+
662 if (root.type != ltDIR_NODE)
+
663 return;
+
664
+
665 auto pos = root;
+
666
+
667 while (true)
+
668 {
+
669 auto sle = view.read(pos);
+
670 if (!sle)
+
671 return;
+
672 for (auto const& key : sle->getFieldV256(sfIndexes))
+
673 f(view.read(keylet::child(key)));
+
674 auto const next = sle->getFieldU64(sfIndexNext);
+
675 if (!next)
+
676 return;
+
677 pos = keylet::page(root, next);
+
678 }
+
679}
+
680
+
681bool
+
682forEachItemAfter(
+
683 ReadView const& view,
+
684 Keylet const& root,
+
685 uint256 const& after,
+
686 std::uint64_t const hint,
+
687 unsigned int limit,
+
688 std::function<bool(std::shared_ptr<SLE const> const&)> const& f)
+
689{
+
690 XRPL_ASSERT(
+
691 root.type == ltDIR_NODE, "ripple::forEachItemAfter : valid root type");
+
692
+
693 if (root.type != ltDIR_NODE)
+
694 return false;
+
695
+
696 auto currentIndex = root;
+
697
+
698 // If startAfter is not zero try jumping to that page using the hint
+
699 if (after.isNonZero())
+
700 {
+
701 auto const hintIndex = keylet::page(root, hint);
+
702
+
703 if (auto hintDir = view.read(hintIndex))
+
704 {
+
705 for (auto const& key : hintDir->getFieldV256(sfIndexes))
+
706 {
+
707 if (key == after)
+
708 {
+
709 // We found the hint, we can start here
+
710 currentIndex = hintIndex;
+
711 break;
+
712 }
+
713 }
+
714 }
+
715
+
716 bool found = false;
+
717 for (;;)
+
718 {
+
719 auto const ownerDir = view.read(currentIndex);
+
720 if (!ownerDir)
+
721 return found;
+
722 for (auto const& key : ownerDir->getFieldV256(sfIndexes))
+
723 {
+
724 if (!found)
+
725 {
+
726 if (key == after)
+
727 found = true;
+
728 }
+
729 else if (f(view.read(keylet::child(key))) && limit-- <= 1)
+
730 {
+
731 return found;
+
732 }
+
733 }
+
734
+
735 auto const uNodeNext = ownerDir->getFieldU64(sfIndexNext);
+
736 if (uNodeNext == 0)
+
737 return found;
+
738 currentIndex = keylet::page(root, uNodeNext);
+
739 }
+
740 }
+
741 else
+
742 {
+
743 for (;;)
+
744 {
+
745 auto const ownerDir = view.read(currentIndex);
+
746 if (!ownerDir)
+
747 return true;
+
748 for (auto const& key : ownerDir->getFieldV256(sfIndexes))
+
749 if (f(view.read(keylet::child(key))) && limit-- <= 1)
+
750 return true;
+
751 auto const uNodeNext = ownerDir->getFieldU64(sfIndexNext);
+
752 if (uNodeNext == 0)
+
753 return true;
+
754 currentIndex = keylet::page(root, uNodeNext);
+
755 }
+
756 }
+
757}
+
758
+
759Rate
+
760transferRate(ReadView const& view, AccountID const& issuer)
+
761{
+
762 auto const sle = view.read(keylet::account(issuer));
+
763
+
764 if (sle && sle->isFieldPresent(sfTransferRate))
+
765 return Rate{sle->getFieldU32(sfTransferRate)};
+
766
+
767 return parityRate;
+
768}
+
769
+
770Rate
+
771transferRate(ReadView const& view, MPTID const& issuanceID)
+
772{
+
773 // fee is 0-50,000 (0-50%), rate is 1,000,000,000-2,000,000,000
+
774 // For example, if transfer fee is 50% then 10,000 * 50,000 = 500,000
+
775 // which represents 50% of 1,000,000,000
+
776 if (auto const sle = view.read(keylet::mptIssuance(issuanceID));
+
777 sle && sle->isFieldPresent(sfTransferFee))
+
778 return Rate{1'000'000'000u + 10'000 * sle->getFieldU16(sfTransferFee)};
+
779
+
780 return parityRate;
+
781}
+
782
+
783Rate
+
784transferRate(ReadView const& view, STAmount const& amount)
+
785{
+
786 return std::visit(
+
787 [&]<ValidIssueType TIss>(TIss const& issue) {
+
788 if constexpr (std::is_same_v<TIss, Issue>)
+
789 return transferRate(view, issue.getIssuer());
+
790 else
+
791 return transferRate(view, issue.getMptID());
+
792 },
+
793 amount.asset().value());
+
794}
+
795
+
796bool
+
797areCompatible(
+
798 ReadView const& validLedger,
+
799 ReadView const& testLedger,
+
800 beast::Journal::Stream& s,
+
801 char const* reason)
+
802{
+
803 bool ret = true;
+
804
+
805 if (validLedger.info().seq < testLedger.info().seq)
+
806 {
+
807 // valid -> ... -> test
+
808 auto hash = hashOfSeq(
+
809 testLedger,
+
810 validLedger.info().seq,
+
811 beast::Journal{beast::Journal::getNullSink()});
+
812 if (hash && (*hash != validLedger.info().hash))
+
813 {
+
814 JLOG(s) << reason << " incompatible with valid ledger";
+
815
+
816 JLOG(s) << "Hash(VSeq): " << to_string(*hash);
+
817
+
818 ret = false;
+
819 }
+
820 }
+
821 else if (validLedger.info().seq > testLedger.info().seq)
+
822 {
+
823 // test -> ... -> valid
+
824 auto hash = hashOfSeq(
+
825 validLedger,
+
826 testLedger.info().seq,
+
827 beast::Journal{beast::Journal::getNullSink()});
+
828 if (hash && (*hash != testLedger.info().hash))
+
829 {
+
830 JLOG(s) << reason << " incompatible preceding ledger";
+
831
+
832 JLOG(s) << "Hash(NSeq): " << to_string(*hash);
+
833
+
834 ret = false;
+
835 }
+
836 }
+
837 else if (
+
838 (validLedger.info().seq == testLedger.info().seq) &&
+
839 (validLedger.info().hash != testLedger.info().hash))
+
840 {
+
841 // Same sequence number, different hash
+
842 JLOG(s) << reason << " incompatible ledger";
+
843
+
844 ret = false;
+
845 }
+
846
+
847 if (!ret)
+
848 {
+
849 JLOG(s) << "Val: " << validLedger.info().seq << " "
+
850 << to_string(validLedger.info().hash);
+
851
+
852 JLOG(s) << "New: " << testLedger.info().seq << " "
+
853 << to_string(testLedger.info().hash);
+
854 }
+
855
+
856 return ret;
+
857}
+
858
+
859bool
+
860areCompatible(
+
861 uint256 const& validHash,
+
862 LedgerIndex validIndex,
+
863 ReadView const& testLedger,
+
864 beast::Journal::Stream& s,
+
865 char const* reason)
+
866{
+
867 bool ret = true;
+
868
+
869 if (testLedger.info().seq > validIndex)
+
870 {
+
871 // Ledger we are testing follows last valid ledger
+
872 auto hash = hashOfSeq(
+
873 testLedger,
+
874 validIndex,
+
875 beast::Journal{beast::Journal::getNullSink()});
+
876 if (hash && (*hash != validHash))
+
877 {
+
878 JLOG(s) << reason << " incompatible following ledger";
+
879 JLOG(s) << "Hash(VSeq): " << to_string(*hash);
+
880
+
881 ret = false;
+
882 }
+
883 }
+
884 else if (
+
885 (validIndex == testLedger.info().seq) &&
+
886 (testLedger.info().hash != validHash))
+
887 {
+
888 JLOG(s) << reason << " incompatible ledger";
+
889
+
890 ret = false;
+
891 }
+
892
+
893 if (!ret)
+
894 {
+
895 JLOG(s) << "Val: " << validIndex << " " << to_string(validHash);
+
896
+
897 JLOG(s) << "New: " << testLedger.info().seq << " "
+
898 << to_string(testLedger.info().hash);
+
899 }
+
900
+
901 return ret;
+
902}
+
903
+
904bool
+
905dirIsEmpty(ReadView const& view, Keylet const& k)
+
906{
+
907 auto const sleNode = view.read(k);
+
908 if (!sleNode)
+
909 return true;
+
910 if (!sleNode->getFieldV256(sfIndexes).empty())
+
911 return false;
+
912 // The first page of a directory may legitimately be empty even if there
+
913 // are other pages (the first page is the anchor page) so check to see if
+
914 // there is another page. If there is, the directory isn't empty.
+
915 return sleNode->getFieldU64(sfIndexNext) == 0;
+
916}
+
917
+
918std::set<uint256>
+
919getEnabledAmendments(ReadView const& view)
+
920{
+
921 std::set<uint256> amendments;
+
922
+
923 if (auto const sle = view.read(keylet::amendments()))
+
924 {
+
925 if (sle->isFieldPresent(sfAmendments))
+
926 {
+
927 auto const& v = sle->getFieldV256(sfAmendments);
+
928 amendments.insert(v.begin(), v.end());
+
929 }
+
930 }
+
931
+
932 return amendments;
+
933}
+
934
+
935majorityAmendments_t
+
936getMajorityAmendments(ReadView const& view)
+
937{
+
938 majorityAmendments_t ret;
+
939
+
940 if (auto const sle = view.read(keylet::amendments()))
+
941 {
+
942 if (sle->isFieldPresent(sfMajorities))
+
943 {
+
944 using tp = NetClock::time_point;
+
945 using d = tp::duration;
+
946
+
947 auto const majorities = sle->getFieldArray(sfMajorities);
+
948
+
949 for (auto const& m : majorities)
+
950 ret[m.getFieldH256(sfAmendment)] =
+
951 tp(d(m.getFieldU32(sfCloseTime)));
+
952 }
+
953 }
+
954
+
955 return ret;
+
956}
+
957
+
958std::optional<uint256>
+
959hashOfSeq(ReadView const& ledger, LedgerIndex seq, beast::Journal journal)
+
960{
+
961 // Easy cases...
+
962 if (seq > ledger.seq())
+
963 {
+
964 JLOG(journal.warn())
+
965 << "Can't get seq " << seq << " from " << ledger.seq() << " future";
+
966 return std::nullopt;
+
967 }
+
968 if (seq == ledger.seq())
+
969 return ledger.info().hash;
+
970 if (seq == (ledger.seq() - 1))
+
971 return ledger.info().parentHash;
+
972
+
973 if (int diff = ledger.seq() - seq; diff <= 256)
+
974 {
+
975 // Within 256...
+
976 auto const hashIndex = ledger.read(keylet::skip());
+
977 if (hashIndex)
+
978 {
+
979 XRPL_ASSERT(
+
980 hashIndex->getFieldU32(sfLastLedgerSequence) ==
+
981 (ledger.seq() - 1),
+
982 "ripple::hashOfSeq : matching ledger sequence");
+
983 STVector256 vec = hashIndex->getFieldV256(sfHashes);
+
984 if (vec.size() >= diff)
+
985 return vec[vec.size() - diff];
+
986 JLOG(journal.warn())
+
987 << "Ledger " << ledger.seq() << " missing hash for " << seq
+
988 << " (" << vec.size() << "," << diff << ")";
+
989 }
+
990 else
+
991 {
+
992 JLOG(journal.warn())
+
993 << "Ledger " << ledger.seq() << ":" << ledger.info().hash
+
994 << " missing normal list";
+
995 }
+
996 }
+
997
+
998 if ((seq & 0xff) != 0)
+
999 {
+
1000 JLOG(journal.debug())
+
1001 << "Can't get seq " << seq << " from " << ledger.seq() << " past";
+
1002 return std::nullopt;
+
1003 }
+
1004
+
1005 // in skiplist
+
1006 auto const hashIndex = ledger.read(keylet::skip(seq));
+
1007 if (hashIndex)
+
1008 {
+
1009 auto const lastSeq = hashIndex->getFieldU32(sfLastLedgerSequence);
+
1010 XRPL_ASSERT(lastSeq >= seq, "ripple::hashOfSeq : minimum last ledger");
+
1011 XRPL_ASSERT(
+
1012 (lastSeq & 0xff) == 0, "ripple::hashOfSeq : valid last ledger");
+
1013 auto const diff = (lastSeq - seq) >> 8;
+
1014 STVector256 vec = hashIndex->getFieldV256(sfHashes);
+
1015 if (vec.size() > diff)
+
1016 return vec[vec.size() - diff - 1];
+
1017 }
+
1018 JLOG(journal.warn()) << "Can't get seq " << seq << " from " << ledger.seq()
+
1019 << " error";
+
1020 return std::nullopt;
+
1021}
+
1022
+
1023//------------------------------------------------------------------------------
+
1024//
+
1025// Modifiers
+
1026//
+
1027//------------------------------------------------------------------------------
+
1028
+
1029void
+
1030adjustOwnerCount(
+
1031 ApplyView& view,
+
1032 std::shared_ptr<SLE> const& sle,
+
1033 std::int32_t amount,
+
1034 beast::Journal j)
+
1035{
+
1036 if (!sle)
+
1037 return;
+
1038 XRPL_ASSERT(amount, "ripple::adjustOwnerCount : nonzero amount input");
+
1039 std::uint32_t const current{sle->getFieldU32(sfOwnerCount)};
+
1040 AccountID const id = (*sle)[sfAccount];
+
1041 std::uint32_t const adjusted = confineOwnerCount(current, amount, id, j);
+
1042 view.adjustOwnerCountHook(id, current, adjusted);
+
1043 sle->setFieldU32(sfOwnerCount, adjusted);
+
1044 view.update(sle);
+
1045}
+
1046
+
1047std::function<void(SLE::ref)>
+
1048describeOwnerDir(AccountID const& account)
+
1049{
+
1050 return [&account](std::shared_ptr<SLE> const& sle) {
+
1051 (*sle)[sfOwner] = account;
+
1052 };
+
1053}
+
1054
+
1055TER
+
1056dirLink(ApplyView& view, AccountID const& owner, std::shared_ptr<SLE>& object)
+
1057{
+
1058 auto const page = view.dirInsert(
+
1059 keylet::ownerDir(owner), object->key(), describeOwnerDir(owner));
+
1060 if (!page)
+
1061 return tecDIR_FULL; // LCOV_EXCL_LINE
+
1062 object->setFieldU64(sfOwnerNode, *page);
+
1063 return tesSUCCESS;
+
1064}
+
1065
+
1066AccountID
+
1067pseudoAccountAddress(ReadView const& view, uint256 const& pseudoOwnerKey)
+
1068{
+
1069 // This number must not be changed without an amendment
+
1070 constexpr std::uint16_t maxAccountAttempts = 256;
+
1071 for (std::uint16_t i = 0; i < maxAccountAttempts; ++i)
+
1072 {
+
1073 ripesha_hasher rsh;
+
1074 auto const hash = sha512Half(i, view.info().parentHash, pseudoOwnerKey);
+
1075 rsh(hash.data(), hash.size());
+
1076 AccountID const ret{static_cast<ripesha_hasher::result_type>(rsh)};
+
1077 if (!view.read(keylet::account(ret)))
+
1078 return ret;
+
1079 }
+
1080 return beast::zero;
+
1081}
+
1082
+
1083// Note, the list of the pseudo-account designator fields below MUST be
+
1084// maintained but it does NOT need to be amendment-gated, since a
+
1085// non-active amendment will not set any field, by definition. Specific
+
1086// properties of a pseudo-account are NOT checked here, that's what
+
1087// InvariantCheck is for.
+
1088static std::array<SField const*, 2> const pseudoAccountOwnerFields = {
+
1089 &sfAMMID, //
+
1090 &sfVaultID, //
+
1091};
+
1092
+
1093Expected<std::shared_ptr<SLE>, TER>
+
1094createPseudoAccount(
+
1095 ApplyView& view,
+
1096 uint256 const& pseudoOwnerKey,
+
1097 SField const& ownerField)
+
1098{
+
1099 XRPL_ASSERT(
+
1100 std::count_if(
+
1101 pseudoAccountOwnerFields.begin(),
+
1102 pseudoAccountOwnerFields.end(),
+
1103 [&ownerField](SField const* sf) -> bool {
+
1104 return *sf == ownerField;
+
1105 }) == 1,
+
1106 "ripple::createPseudoAccount : valid owner field");
+
1107
+
1108 auto const accountId = pseudoAccountAddress(view, pseudoOwnerKey);
+
1109 if (accountId == beast::zero)
+
1110 return Unexpected(tecDUPLICATE);
+
1111
+
1112 // Create pseudo-account.
+
1113 auto account = std::make_shared<SLE>(keylet::account(accountId));
+
1114 account->setAccountID(sfAccount, accountId);
+
1115 account->setFieldAmount(sfBalance, STAmount{});
+
1116
+
1117 // Pseudo-accounts can't submit transactions, so set the sequence number
+
1118 // to 0 to make them easier to spot and verify, and add an extra level
+
1119 // of protection.
+
1120 std::uint32_t const seqno = //
+
1121 view.rules().enabled(featureSingleAssetVault) //
+
1122 ? 0 //
+
1123 : view.seq();
+
1124 account->setFieldU32(sfSequence, seqno);
+
1125 // Ignore reserves requirement, disable the master key, allow default
+
1126 // rippling, and enable deposit authorization to prevent payments into
+
1127 // pseudo-account.
+
1128 account->setFieldU32(
+
1129 sfFlags, lsfDisableMaster | lsfDefaultRipple | lsfDepositAuth);
+
1130 // Link the pseudo-account with its owner object.
+
1131 account->setFieldH256(ownerField, pseudoOwnerKey);
+
1132
+
1133 view.insert(account);
+
1134
+
1135 return account;
+
1136}
+
1137
+
1138[[nodiscard]] bool
+
1139isPseudoAccount(std::shared_ptr<SLE const> sleAcct)
+
1140{
+
1141 // Intentionally use defensive coding here because it's cheap and makes the
+
1142 // semantics of true return value clean.
+
1143 return sleAcct && sleAcct->getType() == ltACCOUNT_ROOT &&
+
1144 std::count_if(
+
1145 pseudoAccountOwnerFields.begin(),
+
1146 pseudoAccountOwnerFields.end(),
+
1147 [&sleAcct](SField const* sf) -> bool {
+
1148 return sleAcct->isFieldPresent(*sf);
+
1149 }) > 0;
+
1150}
+
1151
+
1152[[nodiscard]] TER
+
1153addEmptyHolding(
+
1154 ApplyView& view,
+
1155 AccountID const& accountID,
+
1156 XRPAmount priorBalance,
+
1157 Issue const& issue,
+
1158 beast::Journal journal)
+
1159{
+
1160 // Every account can hold XRP.
+
1161 if (issue.native())
+
1162 return tesSUCCESS;
+
1163
+
1164 auto const& issuerId = issue.getIssuer();
+
1165 auto const& currency = issue.currency;
+
1166 if (isGlobalFrozen(view, issuerId))
+
1167 return tecFROZEN; // LCOV_EXCL_LINE
+
1168
+
1169 auto const& srcId = issuerId;
+
1170 auto const& dstId = accountID;
+
1171 auto const high = srcId > dstId;
+
1172 auto const index = keylet::line(srcId, dstId, currency);
+
1173 auto const sleSrc = view.peek(keylet::account(srcId));
+
1174 auto const sleDst = view.peek(keylet::account(dstId));
+
1175 if (!sleDst || !sleSrc)
+
1176 return tefINTERNAL; // LCOV_EXCL_LINE
+
1177 if (!sleSrc->isFlag(lsfDefaultRipple))
+
1178 return tecINTERNAL; // LCOV_EXCL_LINE
+
1179 // If the line already exists, don't create it again.
+
1180 if (view.read(index))
+
1181 return tecDUPLICATE;
+
1182 return trustCreate(
+
1183 view,
+
1184 high,
+
1185 srcId,
+
1186 dstId,
+
1187 index.key,
+
1188 sleDst,
+
1189 /*auth=*/false,
+
1190 /*noRipple=*/true,
+
1191 /*freeze=*/false,
+
1192 /*deepFreeze*/ false,
+
1193 /*balance=*/STAmount{Issue{currency, noAccount()}},
+
1194 /*limit=*/STAmount{Issue{currency, dstId}},
+
1195 /*qualityIn=*/0,
+
1196 /*qualityOut=*/0,
+
1197 journal);
+
1198}
+
1199
+
1200[[nodiscard]] TER
+
1201addEmptyHolding(
+
1202 ApplyView& view,
+
1203 AccountID const& accountID,
+
1204 XRPAmount priorBalance,
+
1205 MPTIssue const& mptIssue,
+
1206 beast::Journal journal)
+
1207{
+
1208 auto const& mptID = mptIssue.getMptID();
+
1209 auto const mpt = view.peek(keylet::mptIssuance(mptID));
+
1210 if (!mpt)
+
1211 return tefINTERNAL; // LCOV_EXCL_LINE
+
1212 if (mpt->isFlag(lsfMPTLocked))
+
1213 return tefINTERNAL; // LCOV_EXCL_LINE
+
1214 if (view.peek(keylet::mptoken(mptID, accountID)))
+
1215 return tecDUPLICATE;
+
1216
+
1217 return authorizeMPToken(view, priorBalance, mptID, accountID, journal);
+
1218}
+
1219
+
1220[[nodiscard]] TER
+
1221authorizeMPToken(
+
1222 ApplyView& view,
+
1223 XRPAmount const& priorBalance,
+
1224 MPTID const& mptIssuanceID,
+
1225 AccountID const& account,
+
1226 beast::Journal journal,
+
1227 std::uint32_t flags,
+
1228 std::optional<AccountID> holderID)
+
1229{
+
1230 auto const sleAcct = view.peek(keylet::account(account));
+
1231 if (!sleAcct)
+
1232 return tecINTERNAL;
+
1233
+
1234 // If the account that submitted the tx is a holder
+
1235 // Note: `account_` is holder's account
+
1236 // `holderID` is NOT used
+
1237 if (!holderID)
+
1238 {
+
1239 // When a holder wants to unauthorize/delete a MPT, the ledger must
+
1240 // - delete mptokenKey from owner directory
+
1241 // - delete the MPToken
+
1242 if (flags & tfMPTUnauthorize)
+
1243 {
+
1244 auto const mptokenKey = keylet::mptoken(mptIssuanceID, account);
+
1245 auto const sleMpt = view.peek(mptokenKey);
+
1246 if (!sleMpt || (*sleMpt)[sfMPTAmount] != 0)
+
1247 return tecINTERNAL; // LCOV_EXCL_LINE
+
1248
+
1249 if (!view.dirRemove(
+
1250 keylet::ownerDir(account),
+
1251 (*sleMpt)[sfOwnerNode],
+
1252 sleMpt->key(),
+
1253 false))
+
1254 return tecINTERNAL; // LCOV_EXCL_LINE
1255
-
1256 auto lowNode = view.dirInsert(
-
1257 keylet::ownerDir(uLowAccountID),
-
1258 sleRippleState->key(),
-
1259 describeOwnerDir(uLowAccountID));
-
1260
-
1261 if (!lowNode)
-
1262 return tecDIR_FULL;
-
1263
-
1264 auto highNode = view.dirInsert(
-
1265 keylet::ownerDir(uHighAccountID),
-
1266 sleRippleState->key(),
-
1267 describeOwnerDir(uHighAccountID));
-
1268
-
1269 if (!highNode)
-
1270 return tecDIR_FULL;
-
1271
-
1272 bool const bSetDst = saLimit.getIssuer() == uDstAccountID;
-
1273 bool const bSetHigh = bSrcHigh ^ bSetDst;
-
1274
-
1275 XRPL_ASSERT(sleAccount, "ripple::trustCreate : non-null SLE");
-
1276 if (!sleAccount)
-
1277 return tefINTERNAL;
+
1256 adjustOwnerCount(view, sleAcct, -1, journal);
+
1257
+
1258 view.erase(sleMpt);
+
1259 return tesSUCCESS;
+
1260 }
+
1261
+
1262 // A potential holder wants to authorize/hold a mpt, the ledger must:
+
1263 // - add the new mptokenKey to the owner directory
+
1264 // - create the MPToken object for the holder
+
1265
+
1266 // The reserve that is required to create the MPToken. Note
+
1267 // that although the reserve increases with every item
+
1268 // an account owns, in the case of MPTokens we only
+
1269 // *enforce* a reserve if the user owns more than two
+
1270 // items. This is similar to the reserve requirements of trust lines.
+
1271 std::uint32_t const uOwnerCount = sleAcct->getFieldU32(sfOwnerCount);
+
1272 XRPAmount const reserveCreate(
+
1273 (uOwnerCount < 2) ? XRPAmount(beast::zero)
+
1274 : view.fees().accountReserve(uOwnerCount + 1));
+
1275
+
1276 if (priorBalance < reserveCreate)
+
1277 return tecINSUFFICIENT_RESERVE;
1278
-
1279 XRPL_ASSERT(
-
1280 sleAccount->getAccountID(sfAccount) ==
-
1281 (bSetHigh ? uHighAccountID : uLowAccountID),
-
1282 "ripple::trustCreate : matching account ID");
-
1283 auto const slePeer =
-
1284 view.peek(keylet::account(bSetHigh ? uLowAccountID : uHighAccountID));
-
1285 if (!slePeer)
-
1286 return tecNO_TARGET;
-
1287
-
1288 // Remember deletion hints.
-
1289 sleRippleState->setFieldU64(sfLowNode, *lowNode);
-
1290 sleRippleState->setFieldU64(sfHighNode, *highNode);
+
1279 auto const mptokenKey = keylet::mptoken(mptIssuanceID, account);
+
1280 auto mptoken = std::make_shared<SLE>(mptokenKey);
+
1281 if (auto ter = dirLink(view, account, mptoken))
+
1282 return ter; // LCOV_EXCL_LINE
+
1283
+
1284 (*mptoken)[sfAccount] = account;
+
1285 (*mptoken)[sfMPTokenIssuanceID] = mptIssuanceID;
+
1286 (*mptoken)[sfFlags] = 0;
+
1287 view.insert(mptoken);
+
1288
+
1289 // Update owner count.
+
1290 adjustOwnerCount(view, sleAcct, 1, journal);
1291
-
1292 sleRippleState->setFieldAmount(
-
1293 bSetHigh ? sfHighLimit : sfLowLimit, saLimit);
-
1294 sleRippleState->setFieldAmount(
-
1295 bSetHigh ? sfLowLimit : sfHighLimit,
-
1296 STAmount(Issue{
-
1297 saBalance.getCurrency(), bSetDst ? uSrcAccountID : uDstAccountID}));
+
1292 return tesSUCCESS;
+
1293 }
+
1294
+
1295 auto const sleMptIssuance = view.read(keylet::mptIssuance(mptIssuanceID));
+
1296 if (!sleMptIssuance)
+
1297 return tecINTERNAL;
1298
-
1299 if (uQualityIn)
-
1300 sleRippleState->setFieldU32(
-
1301 bSetHigh ? sfHighQualityIn : sfLowQualityIn, uQualityIn);
-
1302
-
1303 if (uQualityOut)
-
1304 sleRippleState->setFieldU32(
-
1305 bSetHigh ? sfHighQualityOut : sfLowQualityOut, uQualityOut);
-
1306
-
1307 std::uint32_t uFlags = bSetHigh ? lsfHighReserve : lsfLowReserve;
+
1299 // If the account that submitted this tx is the issuer of the MPT
+
1300 // Note: `account_` is issuer's account
+
1301 // `holderID` is holder's account
+
1302 if (account != (*sleMptIssuance)[sfIssuer])
+
1303 return tecINTERNAL;
+
1304
+
1305 auto const sleMpt = view.peek(keylet::mptoken(mptIssuanceID, *holderID));
+
1306 if (!sleMpt)
+
1307 return tecINTERNAL;
1308
-
1309 if (bAuth)
-
1310 {
-
1311 uFlags |= (bSetHigh ? lsfHighAuth : lsfLowAuth);
-
1312 }
-
1313 if (bNoRipple)
-
1314 {
-
1315 uFlags |= (bSetHigh ? lsfHighNoRipple : lsfLowNoRipple);
-
1316 }
-
1317 if (bFreeze)
-
1318 {
-
1319 uFlags |= (bSetHigh ? lsfHighFreeze : lsfLowFreeze);
-
1320 }
-
1321 if (bDeepFreeze)
-
1322 {
-
1323 uFlags |= (bSetHigh ? lsfHighDeepFreeze : lsfLowDeepFreeze);
-
1324 }
-
1325
-
1326 if ((slePeer->getFlags() & lsfDefaultRipple) == 0)
-
1327 {
-
1328 // The other side's default is no rippling
-
1329 uFlags |= (bSetHigh ? lsfLowNoRipple : lsfHighNoRipple);
-
1330 }
-
1331
-
1332 sleRippleState->setFieldU32(sfFlags, uFlags);
-
1333 adjustOwnerCount(view, sleAccount, 1, j);
-
1334
-
1335 // ONLY: Create ripple balance.
-
1336 sleRippleState->setFieldAmount(
-
1337 sfBalance, bSetHigh ? -saBalance : saBalance);
-
1338
-
1339 view.creditHook(
-
1340 uSrcAccountID, uDstAccountID, saBalance, saBalance.zeroed());
-
1341
-
1342 return tesSUCCESS;
-
1343}
-
1344
-
1345[[nodiscard]] TER
-
1346removeEmptyHolding(
-
1347 ApplyView& view,
-
1348 AccountID const& accountID,
-
1349 Issue const& issue,
-
1350 beast::Journal journal)
-
1351{
-
1352 if (issue.native())
-
1353 {
-
1354 auto const sle = view.read(keylet::account(accountID));
-
1355 if (!sle)
-
1356 return tecINTERNAL;
-
1357 auto const balance = sle->getFieldAmount(sfBalance);
-
1358 if (balance.xrp() != 0)
-
1359 return tecHAS_OBLIGATIONS;
-
1360 return tesSUCCESS;
-
1361 }
+
1309 std::uint32_t const flagsIn = sleMpt->getFieldU32(sfFlags);
+
1310 std::uint32_t flagsOut = flagsIn;
+
1311
+
1312 // Issuer wants to unauthorize the holder, unset lsfMPTAuthorized on
+
1313 // their MPToken
+
1314 if (flags & tfMPTUnauthorize)
+
1315 flagsOut &= ~lsfMPTAuthorized;
+
1316 // Issuer wants to authorize a holder, set lsfMPTAuthorized on their
+
1317 // MPToken
+
1318 else
+
1319 flagsOut |= lsfMPTAuthorized;
+
1320
+
1321 if (flagsIn != flagsOut)
+
1322 sleMpt->setFieldU32(sfFlags, flagsOut);
+
1323
+
1324 view.update(sleMpt);
+
1325 return tesSUCCESS;
+
1326}
+
1327
+
1328TER
+
1329trustCreate(
+
1330 ApplyView& view,
+
1331 bool const bSrcHigh,
+
1332 AccountID const& uSrcAccountID,
+
1333 AccountID const& uDstAccountID,
+
1334 uint256 const& uIndex, // --> ripple state entry
+
1335 SLE::ref sleAccount, // --> the account being set.
+
1336 bool const bAuth, // --> authorize account.
+
1337 bool const bNoRipple, // --> others cannot ripple through
+
1338 bool const bFreeze, // --> funds cannot leave
+
1339 bool bDeepFreeze, // --> can neither receive nor send funds
+
1340 STAmount const& saBalance, // --> balance of account being set.
+
1341 // Issuer should be noAccount()
+
1342 STAmount const& saLimit, // --> limit for account being set.
+
1343 // Issuer should be the account being set.
+
1344 std::uint32_t uQualityIn,
+
1345 std::uint32_t uQualityOut,
+
1346 beast::Journal j)
+
1347{
+
1348 JLOG(j.trace()) << "trustCreate: " << to_string(uSrcAccountID) << ", "
+
1349 << to_string(uDstAccountID) << ", "
+
1350 << saBalance.getFullText();
+
1351
+
1352 auto const& uLowAccountID = !bSrcHigh ? uSrcAccountID : uDstAccountID;
+
1353 auto const& uHighAccountID = bSrcHigh ? uSrcAccountID : uDstAccountID;
+
1354
+
1355 auto const sleRippleState = std::make_shared<SLE>(ltRIPPLE_STATE, uIndex);
+
1356 view.insert(sleRippleState);
+
1357
+
1358 auto lowNode = view.dirInsert(
+
1359 keylet::ownerDir(uLowAccountID),
+
1360 sleRippleState->key(),
+
1361 describeOwnerDir(uLowAccountID));
1362
-
1363 // `asset` is an IOU.
-
1364 auto const line = view.peek(keylet::line(accountID, issue));
-
1365 if (!line)
-
1366 return tecOBJECT_NOT_FOUND;
-
1367 if (line->at(sfBalance)->iou() != beast::zero)
-
1368 return tecHAS_OBLIGATIONS;
-
1369
-
1370 // Adjust the owner count(s)
-
1371 if (line->isFlag(lsfLowReserve))
-
1372 {
-
1373 // Clear reserve for low account.
-
1374 auto sleLowAccount =
-
1375 view.peek(keylet::account(line->at(sfLowLimit)->getIssuer()));
-
1376 if (!sleLowAccount)
-
1377 return tecINTERNAL;
-
1378 adjustOwnerCount(view, sleLowAccount, -1, journal);
-
1379 // It's not really necessary to clear the reserve flag, since the line
-
1380 // is about to be deleted, but this will make the metadata reflect an
-
1381 // accurate state at the time of deletion.
-
1382 line->clearFlag(lsfLowReserve);
-
1383 }
-
1384
-
1385 if (line->isFlag(lsfHighReserve))
-
1386 {
-
1387 // Clear reserve for high account.
-
1388 auto sleHighAccount =
-
1389 view.peek(keylet::account(line->at(sfHighLimit)->getIssuer()));
-
1390 if (!sleHighAccount)
-
1391 return tecINTERNAL;
-
1392 adjustOwnerCount(view, sleHighAccount, -1, journal);
-
1393 // It's not really necessary to clear the reserve flag, since the line
-
1394 // is about to be deleted, but this will make the metadata reflect an
-
1395 // accurate state at the time of deletion.
-
1396 line->clearFlag(lsfHighReserve);
-
1397 }
-
1398
-
1399 return trustDelete(
-
1400 view,
-
1401 line,
-
1402 line->at(sfLowLimit)->getIssuer(),
-
1403 line->at(sfHighLimit)->getIssuer(),
-
1404 journal);
-
1405}
-
1406
-
1407[[nodiscard]] TER
-
1408removeEmptyHolding(
-
1409 ApplyView& view,
-
1410 AccountID const& accountID,
-
1411 MPTIssue const& mptIssue,
-
1412 beast::Journal journal)
-
1413{
-
1414 auto const& mptID = mptIssue.getMptID();
-
1415 auto const mptoken = view.peek(keylet::mptoken(mptID, accountID));
-
1416 if (!mptoken)
-
1417 return tecOBJECT_NOT_FOUND;
-
1418 if (mptoken->at(sfMPTAmount) != 0)
-
1419 return tecHAS_OBLIGATIONS;
-
1420
-
1421 return MPTokenAuthorize::authorize(
-
1422 view,
-
1423 journal,
-
1424 {.priorBalance = {},
-
1425 .mptIssuanceID = mptID,
-
1426 .account = accountID,
-
1427 .flags = tfMPTUnauthorize});
-
1428}
-
1429
-
1430TER
-
1431trustDelete(
-
1432 ApplyView& view,
-
1433 std::shared_ptr<SLE> const& sleRippleState,
-
1434 AccountID const& uLowAccountID,
-
1435 AccountID const& uHighAccountID,
-
1436 beast::Journal j)
-
1437{
-
1438 // Detect legacy dirs.
-
1439 std::uint64_t uLowNode = sleRippleState->getFieldU64(sfLowNode);
-
1440 std::uint64_t uHighNode = sleRippleState->getFieldU64(sfHighNode);
-
1441
-
1442 JLOG(j.trace()) << "trustDelete: Deleting ripple line: low";
+
1363 if (!lowNode)
+
1364 return tecDIR_FULL;
+
1365
+
1366 auto highNode = view.dirInsert(
+
1367 keylet::ownerDir(uHighAccountID),
+
1368 sleRippleState->key(),
+
1369 describeOwnerDir(uHighAccountID));
+
1370
+
1371 if (!highNode)
+
1372 return tecDIR_FULL;
+
1373
+
1374 bool const bSetDst = saLimit.getIssuer() == uDstAccountID;
+
1375 bool const bSetHigh = bSrcHigh ^ bSetDst;
+
1376
+
1377 XRPL_ASSERT(sleAccount, "ripple::trustCreate : non-null SLE");
+
1378 if (!sleAccount)
+
1379 return tefINTERNAL;
+
1380
+
1381 XRPL_ASSERT(
+
1382 sleAccount->getAccountID(sfAccount) ==
+
1383 (bSetHigh ? uHighAccountID : uLowAccountID),
+
1384 "ripple::trustCreate : matching account ID");
+
1385 auto const slePeer =
+
1386 view.peek(keylet::account(bSetHigh ? uLowAccountID : uHighAccountID));
+
1387 if (!slePeer)
+
1388 return tecNO_TARGET;
+
1389
+
1390 // Remember deletion hints.
+
1391 sleRippleState->setFieldU64(sfLowNode, *lowNode);
+
1392 sleRippleState->setFieldU64(sfHighNode, *highNode);
+
1393
+
1394 sleRippleState->setFieldAmount(
+
1395 bSetHigh ? sfHighLimit : sfLowLimit, saLimit);
+
1396 sleRippleState->setFieldAmount(
+
1397 bSetHigh ? sfLowLimit : sfHighLimit,
+
1398 STAmount(Issue{
+
1399 saBalance.getCurrency(), bSetDst ? uSrcAccountID : uDstAccountID}));
+
1400
+
1401 if (uQualityIn)
+
1402 sleRippleState->setFieldU32(
+
1403 bSetHigh ? sfHighQualityIn : sfLowQualityIn, uQualityIn);
+
1404
+
1405 if (uQualityOut)
+
1406 sleRippleState->setFieldU32(
+
1407 bSetHigh ? sfHighQualityOut : sfLowQualityOut, uQualityOut);
+
1408
+
1409 std::uint32_t uFlags = bSetHigh ? lsfHighReserve : lsfLowReserve;
+
1410
+
1411 if (bAuth)
+
1412 {
+
1413 uFlags |= (bSetHigh ? lsfHighAuth : lsfLowAuth);
+
1414 }
+
1415 if (bNoRipple)
+
1416 {
+
1417 uFlags |= (bSetHigh ? lsfHighNoRipple : lsfLowNoRipple);
+
1418 }
+
1419 if (bFreeze)
+
1420 {
+
1421 uFlags |= (bSetHigh ? lsfHighFreeze : lsfLowFreeze);
+
1422 }
+
1423 if (bDeepFreeze)
+
1424 {
+
1425 uFlags |= (bSetHigh ? lsfHighDeepFreeze : lsfLowDeepFreeze);
+
1426 }
+
1427
+
1428 if ((slePeer->getFlags() & lsfDefaultRipple) == 0)
+
1429 {
+
1430 // The other side's default is no rippling
+
1431 uFlags |= (bSetHigh ? lsfLowNoRipple : lsfHighNoRipple);
+
1432 }
+
1433
+
1434 sleRippleState->setFieldU32(sfFlags, uFlags);
+
1435 adjustOwnerCount(view, sleAccount, 1, j);
+
1436
+
1437 // ONLY: Create ripple balance.
+
1438 sleRippleState->setFieldAmount(
+
1439 sfBalance, bSetHigh ? -saBalance : saBalance);
+
1440
+
1441 view.creditHook(
+
1442 uSrcAccountID, uDstAccountID, saBalance, saBalance.zeroed());
1443
-
1444 if (!view.dirRemove(
-
1445 keylet::ownerDir(uLowAccountID),
-
1446 uLowNode,
-
1447 sleRippleState->key(),
-
1448 false))
-
1449 {
-
1450 return tefBAD_LEDGER;
-
1451 }
-
1452
-
1453 JLOG(j.trace()) << "trustDelete: Deleting ripple line: high";
-
1454
-
1455 if (!view.dirRemove(
-
1456 keylet::ownerDir(uHighAccountID),
-
1457 uHighNode,
-
1458 sleRippleState->key(),
-
1459 false))
-
1460 {
-
1461 return tefBAD_LEDGER;
-
1462 }
-
1463
-
1464 JLOG(j.trace()) << "trustDelete: Deleting ripple line: state";
-
1465 view.erase(sleRippleState);
-
1466
-
1467 return tesSUCCESS;
-
1468}
-
1469
-
1470TER
-
1471offerDelete(ApplyView& view, std::shared_ptr<SLE> const& sle, beast::Journal j)
-
1472{
-
1473 if (!sle)
-
1474 return tesSUCCESS;
-
1475 auto offerIndex = sle->key();
-
1476 auto owner = sle->getAccountID(sfAccount);
-
1477
-
1478 // Detect legacy directories.
-
1479 uint256 uDirectory = sle->getFieldH256(sfBookDirectory);
-
1480
-
1481 if (!view.dirRemove(
-
1482 keylet::ownerDir(owner),
-
1483 sle->getFieldU64(sfOwnerNode),
-
1484 offerIndex,
-
1485 false))
-
1486 {
-
1487 return tefBAD_LEDGER;
-
1488 }
-
1489
-
1490 if (!view.dirRemove(
-
1491 keylet::page(uDirectory),
-
1492 sle->getFieldU64(sfBookNode),
-
1493 offerIndex,
-
1494 false))
-
1495 {
-
1496 return tefBAD_LEDGER;
-
1497 }
-
1498
-
1499 if (sle->isFieldPresent(sfAdditionalBooks))
-
1500 {
-
1501 XRPL_ASSERT(
-
1502 sle->isFlag(lsfHybrid) && sle->isFieldPresent(sfDomainID),
-
1503 "ripple::offerDelete : should be a hybrid domain offer");
-
1504
-
1505 auto const& additionalBookDirs = sle->getFieldArray(sfAdditionalBooks);
-
1506
-
1507 for (auto const& bookDir : additionalBookDirs)
-
1508 {
-
1509 auto const& dirIndex = bookDir.getFieldH256(sfBookDirectory);
-
1510 auto const& dirNode = bookDir.getFieldU64(sfBookNode);
-
1511
-
1512 if (!view.dirRemove(
-
1513 keylet::page(dirIndex), dirNode, offerIndex, false))
-
1514 {
-
1515 return tefBAD_LEDGER; // LCOV_EXCL_LINE
-
1516 }
-
1517 }
-
1518 }
-
1519
-
1520 adjustOwnerCount(view, view.peek(keylet::account(owner)), -1, j);
-
1521
-
1522 view.erase(sle);
-
1523
-
1524 return tesSUCCESS;
-
1525}
-
1526
-
1527// Direct send w/o fees:
-
1528// - Redeeming IOUs and/or sending sender's own IOUs.
-
1529// - Create trust line if needed.
-
1530// --> bCheckIssuer : normally require issuer to be involved.
-
1531static TER
-
1532rippleCreditIOU(
-
1533 ApplyView& view,
-
1534 AccountID const& uSenderID,
-
1535 AccountID const& uReceiverID,
-
1536 STAmount const& saAmount,
-
1537 bool bCheckIssuer,
-
1538 beast::Journal j)
-
1539{
-
1540 AccountID const& issuer = saAmount.getIssuer();
-
1541 Currency const& currency = saAmount.getCurrency();
-
1542
-
1543 // Make sure issuer is involved.
-
1544 XRPL_ASSERT(
-
1545 !bCheckIssuer || uSenderID == issuer || uReceiverID == issuer,
-
1546 "ripple::rippleCreditIOU : matching issuer or don't care");
-
1547 (void)issuer;
-
1548
-
1549 // Disallow sending to self.
-
1550 XRPL_ASSERT(
-
1551 uSenderID != uReceiverID,
-
1552 "ripple::rippleCreditIOU : sender is not receiver");
-
1553
-
1554 bool const bSenderHigh = uSenderID > uReceiverID;
-
1555 auto const index = keylet::line(uSenderID, uReceiverID, currency);
-
1556
-
1557 XRPL_ASSERT(
-
1558 !isXRP(uSenderID) && uSenderID != noAccount(),
-
1559 "ripple::rippleCreditIOU : sender is not XRP");
-
1560 XRPL_ASSERT(
-
1561 !isXRP(uReceiverID) && uReceiverID != noAccount(),
-
1562 "ripple::rippleCreditIOU : receiver is not XRP");
-
1563
-
1564 // If the line exists, modify it accordingly.
-
1565 if (auto const sleRippleState = view.peek(index))
-
1566 {
-
1567 STAmount saBalance = sleRippleState->getFieldAmount(sfBalance);
-
1568
-
1569 if (bSenderHigh)
-
1570 saBalance.negate(); // Put balance in sender terms.
-
1571
-
1572 view.creditHook(uSenderID, uReceiverID, saAmount, saBalance);
-
1573
-
1574 STAmount const saBefore = saBalance;
-
1575
-
1576 saBalance -= saAmount;
-
1577
-
1578 JLOG(j.trace()) << "rippleCreditIOU: " << to_string(uSenderID) << " -> "
-
1579 << to_string(uReceiverID)
-
1580 << " : before=" << saBefore.getFullText()
-
1581 << " amount=" << saAmount.getFullText()
-
1582 << " after=" << saBalance.getFullText();
+
1444 return tesSUCCESS;
+
1445}
+
1446
+
1447[[nodiscard]] TER
+
1448removeEmptyHolding(
+
1449 ApplyView& view,
+
1450 AccountID const& accountID,
+
1451 Issue const& issue,
+
1452 beast::Journal journal)
+
1453{
+
1454 if (issue.native())
+
1455 {
+
1456 auto const sle = view.read(keylet::account(accountID));
+
1457 if (!sle)
+
1458 return tecINTERNAL;
+
1459 auto const balance = sle->getFieldAmount(sfBalance);
+
1460 if (balance.xrp() != 0)
+
1461 return tecHAS_OBLIGATIONS;
+
1462 return tesSUCCESS;
+
1463 }
+
1464
+
1465 // `asset` is an IOU.
+
1466 auto const line = view.peek(keylet::line(accountID, issue));
+
1467 if (!line)
+
1468 return tecOBJECT_NOT_FOUND;
+
1469 if (line->at(sfBalance)->iou() != beast::zero)
+
1470 return tecHAS_OBLIGATIONS;
+
1471
+
1472 // Adjust the owner count(s)
+
1473 if (line->isFlag(lsfLowReserve))
+
1474 {
+
1475 // Clear reserve for low account.
+
1476 auto sleLowAccount =
+
1477 view.peek(keylet::account(line->at(sfLowLimit)->getIssuer()));
+
1478 if (!sleLowAccount)
+
1479 return tecINTERNAL;
+
1480 adjustOwnerCount(view, sleLowAccount, -1, journal);
+
1481 // It's not really necessary to clear the reserve flag, since the line
+
1482 // is about to be deleted, but this will make the metadata reflect an
+
1483 // accurate state at the time of deletion.
+
1484 line->clearFlag(lsfLowReserve);
+
1485 }
+
1486
+
1487 if (line->isFlag(lsfHighReserve))
+
1488 {
+
1489 // Clear reserve for high account.
+
1490 auto sleHighAccount =
+
1491 view.peek(keylet::account(line->at(sfHighLimit)->getIssuer()));
+
1492 if (!sleHighAccount)
+
1493 return tecINTERNAL;
+
1494 adjustOwnerCount(view, sleHighAccount, -1, journal);
+
1495 // It's not really necessary to clear the reserve flag, since the line
+
1496 // is about to be deleted, but this will make the metadata reflect an
+
1497 // accurate state at the time of deletion.
+
1498 line->clearFlag(lsfHighReserve);
+
1499 }
+
1500
+
1501 return trustDelete(
+
1502 view,
+
1503 line,
+
1504 line->at(sfLowLimit)->getIssuer(),
+
1505 line->at(sfHighLimit)->getIssuer(),
+
1506 journal);
+
1507}
+
1508
+
1509[[nodiscard]] TER
+
1510removeEmptyHolding(
+
1511 ApplyView& view,
+
1512 AccountID const& accountID,
+
1513 MPTIssue const& mptIssue,
+
1514 beast::Journal journal)
+
1515{
+
1516 auto const& mptID = mptIssue.getMptID();
+
1517 auto const mptoken = view.peek(keylet::mptoken(mptID, accountID));
+
1518 if (!mptoken)
+
1519 return tecOBJECT_NOT_FOUND;
+
1520 if (mptoken->at(sfMPTAmount) != 0)
+
1521 return tecHAS_OBLIGATIONS;
+
1522
+
1523 return authorizeMPToken(
+
1524 view,
+
1525 {}, // priorBalance
+
1526 mptID,
+
1527 accountID,
+
1528 journal,
+
1529 tfMPTUnauthorize // flags
+
1530 );
+
1531}
+
1532
+
1533TER
+
1534trustDelete(
+
1535 ApplyView& view,
+
1536 std::shared_ptr<SLE> const& sleRippleState,
+
1537 AccountID const& uLowAccountID,
+
1538 AccountID const& uHighAccountID,
+
1539 beast::Journal j)
+
1540{
+
1541 // Detect legacy dirs.
+
1542 std::uint64_t uLowNode = sleRippleState->getFieldU64(sfLowNode);
+
1543 std::uint64_t uHighNode = sleRippleState->getFieldU64(sfHighNode);
+
1544
+
1545 JLOG(j.trace()) << "trustDelete: Deleting ripple line: low";
+
1546
+
1547 if (!view.dirRemove(
+
1548 keylet::ownerDir(uLowAccountID),
+
1549 uLowNode,
+
1550 sleRippleState->key(),
+
1551 false))
+
1552 {
+
1553 return tefBAD_LEDGER;
+
1554 }
+
1555
+
1556 JLOG(j.trace()) << "trustDelete: Deleting ripple line: high";
+
1557
+
1558 if (!view.dirRemove(
+
1559 keylet::ownerDir(uHighAccountID),
+
1560 uHighNode,
+
1561 sleRippleState->key(),
+
1562 false))
+
1563 {
+
1564 return tefBAD_LEDGER;
+
1565 }
+
1566
+
1567 JLOG(j.trace()) << "trustDelete: Deleting ripple line: state";
+
1568 view.erase(sleRippleState);
+
1569
+
1570 return tesSUCCESS;
+
1571}
+
1572
+
1573TER
+
1574offerDelete(ApplyView& view, std::shared_ptr<SLE> const& sle, beast::Journal j)
+
1575{
+
1576 if (!sle)
+
1577 return tesSUCCESS;
+
1578 auto offerIndex = sle->key();
+
1579 auto owner = sle->getAccountID(sfAccount);
+
1580
+
1581 // Detect legacy directories.
+
1582 uint256 uDirectory = sle->getFieldH256(sfBookDirectory);
1583
-
1584 std::uint32_t const uFlags(sleRippleState->getFieldU32(sfFlags));
-
1585 bool bDelete = false;
-
1586
-
1587 // FIXME This NEEDS to be cleaned up and simplified. It's impossible
-
1588 // for anyone to understand.
-
1589 if (saBefore > beast::zero
-
1590 // Sender balance was positive.
-
1591 && saBalance <= beast::zero
-
1592 // Sender is zero or negative.
-
1593 && (uFlags & (!bSenderHigh ? lsfLowReserve : lsfHighReserve))
-
1594 // Sender reserve is set.
-
1595 &&
-
1596 static_cast<bool>(
-
1597 uFlags & (!bSenderHigh ? lsfLowNoRipple : lsfHighNoRipple)) !=
-
1598 static_cast<bool>(
-
1599 view.read(keylet::account(uSenderID))->getFlags() &
-
1600 lsfDefaultRipple) &&
-
1601 !(uFlags & (!bSenderHigh ? lsfLowFreeze : lsfHighFreeze)) &&
-
1602 !sleRippleState->getFieldAmount(
-
1603 !bSenderHigh ? sfLowLimit : sfHighLimit)
-
1604 // Sender trust limit is 0.
-
1605 && !sleRippleState->getFieldU32(
-
1606 !bSenderHigh ? sfLowQualityIn : sfHighQualityIn)
-
1607 // Sender quality in is 0.
-
1608 && !sleRippleState->getFieldU32(
-
1609 !bSenderHigh ? sfLowQualityOut : sfHighQualityOut))
-
1610 // Sender quality out is 0.
+
1584 if (!view.dirRemove(
+
1585 keylet::ownerDir(owner),
+
1586 sle->getFieldU64(sfOwnerNode),
+
1587 offerIndex,
+
1588 false))
+
1589 {
+
1590 return tefBAD_LEDGER;
+
1591 }
+
1592
+
1593 if (!view.dirRemove(
+
1594 keylet::page(uDirectory),
+
1595 sle->getFieldU64(sfBookNode),
+
1596 offerIndex,
+
1597 false))
+
1598 {
+
1599 return tefBAD_LEDGER;
+
1600 }
+
1601
+
1602 if (sle->isFieldPresent(sfAdditionalBooks))
+
1603 {
+
1604 XRPL_ASSERT(
+
1605 sle->isFlag(lsfHybrid) && sle->isFieldPresent(sfDomainID),
+
1606 "ripple::offerDelete : should be a hybrid domain offer");
+
1607
+
1608 auto const& additionalBookDirs = sle->getFieldArray(sfAdditionalBooks);
+
1609
+
1610 for (auto const& bookDir : additionalBookDirs)
1611 {
-
1612 // Clear the reserve of the sender, possibly delete the line!
-
1613 adjustOwnerCount(
-
1614 view, view.peek(keylet::account(uSenderID)), -1, j);
-
1615
-
1616 // Clear reserve flag.
-
1617 sleRippleState->setFieldU32(
-
1618 sfFlags,
-
1619 uFlags & (!bSenderHigh ? ~lsfLowReserve : ~lsfHighReserve));
-
1620
-
1621 // Balance is zero, receiver reserve is clear.
-
1622 bDelete = !saBalance // Balance is zero.
-
1623 && !(uFlags & (bSenderHigh ? lsfLowReserve : lsfHighReserve));
-
1624 // Receiver reserve is clear.
-
1625 }
+
1612 auto const& dirIndex = bookDir.getFieldH256(sfBookDirectory);
+
1613 auto const& dirNode = bookDir.getFieldU64(sfBookNode);
+
1614
+
1615 if (!view.dirRemove(
+
1616 keylet::page(dirIndex), dirNode, offerIndex, false))
+
1617 {
+
1618 return tefBAD_LEDGER; // LCOV_EXCL_LINE
+
1619 }
+
1620 }
+
1621 }
+
1622
+
1623 adjustOwnerCount(view, view.peek(keylet::account(owner)), -1, j);
+
1624
+
1625 view.erase(sle);
1626
-
1627 if (bSenderHigh)
-
1628 saBalance.negate();
+
1627 return tesSUCCESS;
+
1628}
1629
-
1630 // Want to reflect balance to zero even if we are deleting line.
-
1631 sleRippleState->setFieldAmount(sfBalance, saBalance);
-
1632 // ONLY: Adjust ripple balance.
-
1633
-
1634 if (bDelete)
-
1635 {
-
1636 return trustDelete(
-
1637 view,
-
1638 sleRippleState,
-
1639 bSenderHigh ? uReceiverID : uSenderID,
-
1640 !bSenderHigh ? uReceiverID : uSenderID,
-
1641 j);
-
1642 }
-
1643
-
1644 view.update(sleRippleState);
-
1645 return tesSUCCESS;
-
1646 }
-
1647
-
1648 STAmount const saReceiverLimit(Issue{currency, uReceiverID});
-
1649 STAmount saBalance{saAmount};
-
1650
-
1651 saBalance.setIssuer(noAccount());
-
1652
-
1653 JLOG(j.debug()) << "rippleCreditIOU: "
-
1654 "create line: "
-
1655 << to_string(uSenderID) << " -> " << to_string(uReceiverID)
-
1656 << " : " << saAmount.getFullText();
-
1657
-
1658 auto const sleAccount = view.peek(keylet::account(uReceiverID));
-
1659 if (!sleAccount)
-
1660 return tefINTERNAL;
-
1661
-
1662 bool const noRipple = (sleAccount->getFlags() & lsfDefaultRipple) == 0;
-
1663
-
1664 return trustCreate(
-
1665 view,
-
1666 bSenderHigh,
-
1667 uSenderID,
-
1668 uReceiverID,
-
1669 index.key,
-
1670 sleAccount,
-
1671 false,
-
1672 noRipple,
-
1673 false,
-
1674 false,
-
1675 saBalance,
-
1676 saReceiverLimit,
-
1677 0,
-
1678 0,
-
1679 j);
-
1680}
-
1681
-
1682// Send regardless of limits.
-
1683// --> saAmount: Amount/currency/issuer to deliver to receiver.
-
1684// <-- saActual: Amount actually cost. Sender pays fees.
-
1685static TER
-
1686rippleSendIOU(
-
1687 ApplyView& view,
-
1688 AccountID const& uSenderID,
-
1689 AccountID const& uReceiverID,
-
1690 STAmount const& saAmount,
-
1691 STAmount& saActual,
-
1692 beast::Journal j,
-
1693 WaiveTransferFee waiveFee)
-
1694{
-
1695 auto const issuer = saAmount.getIssuer();
-
1696
-
1697 XRPL_ASSERT(
-
1698 !isXRP(uSenderID) && !isXRP(uReceiverID),
-
1699 "ripple::rippleSendIOU : neither sender nor receiver is XRP");
-
1700 XRPL_ASSERT(
-
1701 uSenderID != uReceiverID,
-
1702 "ripple::rippleSendIOU : sender is not receiver");
-
1703
-
1704 if (uSenderID == issuer || uReceiverID == issuer || issuer == noAccount())
-
1705 {
-
1706 // Direct send: redeeming IOUs and/or sending own IOUs.
-
1707 auto const ter =
-
1708 rippleCreditIOU(view, uSenderID, uReceiverID, saAmount, false, j);
-
1709 if (view.rules().enabled(featureDeletableAccounts) && ter != tesSUCCESS)
-
1710 return ter;
-
1711 saActual = saAmount;
-
1712 return tesSUCCESS;
-
1713 }
-
1714
-
1715 // Sending 3rd party IOUs: transit.
-
1716
-
1717 // Calculate the amount to transfer accounting
-
1718 // for any transfer fees if the fee is not waived:
-
1719 saActual = (waiveFee == WaiveTransferFee::Yes)
-
1720 ? saAmount
-
1721 : multiply(saAmount, transferRate(view, issuer));
-
1722
-
1723 JLOG(j.debug()) << "rippleSendIOU> " << to_string(uSenderID) << " - > "
-
1724 << to_string(uReceiverID)
-
1725 << " : deliver=" << saAmount.getFullText()
-
1726 << " cost=" << saActual.getFullText();
-
1727
-
1728 TER terResult =
-
1729 rippleCreditIOU(view, issuer, uReceiverID, saAmount, true, j);
-
1730
-
1731 if (tesSUCCESS == terResult)
-
1732 terResult = rippleCreditIOU(view, uSenderID, issuer, saActual, true, j);
-
1733
-
1734 return terResult;
-
1735}
+
1630// Direct send w/o fees:
+
1631// - Redeeming IOUs and/or sending sender's own IOUs.
+
1632// - Create trust line if needed.
+
1633// --> bCheckIssuer : normally require issuer to be involved.
+
1634static TER
+
1635rippleCreditIOU(
+
1636 ApplyView& view,
+
1637 AccountID const& uSenderID,
+
1638 AccountID const& uReceiverID,
+
1639 STAmount const& saAmount,
+
1640 bool bCheckIssuer,
+
1641 beast::Journal j)
+
1642{
+
1643 AccountID const& issuer = saAmount.getIssuer();
+
1644 Currency const& currency = saAmount.getCurrency();
+
1645
+
1646 // Make sure issuer is involved.
+
1647 XRPL_ASSERT(
+
1648 !bCheckIssuer || uSenderID == issuer || uReceiverID == issuer,
+
1649 "ripple::rippleCreditIOU : matching issuer or don't care");
+
1650 (void)issuer;
+
1651
+
1652 // Disallow sending to self.
+
1653 XRPL_ASSERT(
+
1654 uSenderID != uReceiverID,
+
1655 "ripple::rippleCreditIOU : sender is not receiver");
+
1656
+
1657 bool const bSenderHigh = uSenderID > uReceiverID;
+
1658 auto const index = keylet::line(uSenderID, uReceiverID, currency);
+
1659
+
1660 XRPL_ASSERT(
+
1661 !isXRP(uSenderID) && uSenderID != noAccount(),
+
1662 "ripple::rippleCreditIOU : sender is not XRP");
+
1663 XRPL_ASSERT(
+
1664 !isXRP(uReceiverID) && uReceiverID != noAccount(),
+
1665 "ripple::rippleCreditIOU : receiver is not XRP");
+
1666
+
1667 // If the line exists, modify it accordingly.
+
1668 if (auto const sleRippleState = view.peek(index))
+
1669 {
+
1670 STAmount saBalance = sleRippleState->getFieldAmount(sfBalance);
+
1671
+
1672 if (bSenderHigh)
+
1673 saBalance.negate(); // Put balance in sender terms.
+
1674
+
1675 view.creditHook(uSenderID, uReceiverID, saAmount, saBalance);
+
1676
+
1677 STAmount const saBefore = saBalance;
+
1678
+
1679 saBalance -= saAmount;
+
1680
+
1681 JLOG(j.trace()) << "rippleCreditIOU: " << to_string(uSenderID) << " -> "
+
1682 << to_string(uReceiverID)
+
1683 << " : before=" << saBefore.getFullText()
+
1684 << " amount=" << saAmount.getFullText()
+
1685 << " after=" << saBalance.getFullText();
+
1686
+
1687 std::uint32_t const uFlags(sleRippleState->getFieldU32(sfFlags));
+
1688 bool bDelete = false;
+
1689
+
1690 // FIXME This NEEDS to be cleaned up and simplified. It's impossible
+
1691 // for anyone to understand.
+
1692 if (saBefore > beast::zero
+
1693 // Sender balance was positive.
+
1694 && saBalance <= beast::zero
+
1695 // Sender is zero or negative.
+
1696 && (uFlags & (!bSenderHigh ? lsfLowReserve : lsfHighReserve))
+
1697 // Sender reserve is set.
+
1698 &&
+
1699 static_cast<bool>(
+
1700 uFlags & (!bSenderHigh ? lsfLowNoRipple : lsfHighNoRipple)) !=
+
1701 static_cast<bool>(
+
1702 view.read(keylet::account(uSenderID))->getFlags() &
+
1703 lsfDefaultRipple) &&
+
1704 !(uFlags & (!bSenderHigh ? lsfLowFreeze : lsfHighFreeze)) &&
+
1705 !sleRippleState->getFieldAmount(
+
1706 !bSenderHigh ? sfLowLimit : sfHighLimit)
+
1707 // Sender trust limit is 0.
+
1708 && !sleRippleState->getFieldU32(
+
1709 !bSenderHigh ? sfLowQualityIn : sfHighQualityIn)
+
1710 // Sender quality in is 0.
+
1711 && !sleRippleState->getFieldU32(
+
1712 !bSenderHigh ? sfLowQualityOut : sfHighQualityOut))
+
1713 // Sender quality out is 0.
+
1714 {
+
1715 // Clear the reserve of the sender, possibly delete the line!
+
1716 adjustOwnerCount(
+
1717 view, view.peek(keylet::account(uSenderID)), -1, j);
+
1718
+
1719 // Clear reserve flag.
+
1720 sleRippleState->setFieldU32(
+
1721 sfFlags,
+
1722 uFlags & (!bSenderHigh ? ~lsfLowReserve : ~lsfHighReserve));
+
1723
+
1724 // Balance is zero, receiver reserve is clear.
+
1725 bDelete = !saBalance // Balance is zero.
+
1726 && !(uFlags & (bSenderHigh ? lsfLowReserve : lsfHighReserve));
+
1727 // Receiver reserve is clear.
+
1728 }
+
1729
+
1730 if (bSenderHigh)
+
1731 saBalance.negate();
+
1732
+
1733 // Want to reflect balance to zero even if we are deleting line.
+
1734 sleRippleState->setFieldAmount(sfBalance, saBalance);
+
1735 // ONLY: Adjust ripple balance.
1736
-
1737static TER
-
1738accountSendIOU(
-
1739 ApplyView& view,
-
1740 AccountID const& uSenderID,
-
1741 AccountID const& uReceiverID,
-
1742 STAmount const& saAmount,
-
1743 beast::Journal j,
-
1744 WaiveTransferFee waiveFee)
-
1745{
-
1746 if (view.rules().enabled(fixAMMv1_1))
-
1747 {
-
1748 if (saAmount < beast::zero || saAmount.holds<MPTIssue>())
-
1749 {
-
1750 return tecINTERNAL;
-
1751 }
-
1752 }
-
1753 else
-
1754 {
-
1755 XRPL_ASSERT(
-
1756 saAmount >= beast::zero && !saAmount.holds<MPTIssue>(),
-
1757 "ripple::accountSendIOU : minimum amount and not MPT");
-
1758 }
-
1759
-
1760 /* If we aren't sending anything or if the sender is the same as the
-
1761 * receiver then we don't need to do anything.
-
1762 */
-
1763 if (!saAmount || (uSenderID == uReceiverID))
-
1764 return tesSUCCESS;
-
1765
-
1766 if (!saAmount.native())
-
1767 {
-
1768 STAmount saActual;
-
1769
-
1770 JLOG(j.trace()) << "accountSendIOU: " << to_string(uSenderID) << " -> "
-
1771 << to_string(uReceiverID) << " : "
-
1772 << saAmount.getFullText();
-
1773
-
1774 return rippleSendIOU(
-
1775 view, uSenderID, uReceiverID, saAmount, saActual, j, waiveFee);
-
1776 }
-
1777
-
1778 /* XRP send which does not check reserve and can do pure adjustment.
-
1779 * Note that sender or receiver may be null and this not a mistake; this
-
1780 * setup is used during pathfinding and it is carefully controlled to
-
1781 * ensure that transfers are balanced.
-
1782 */
-
1783 TER terResult(tesSUCCESS);
+
1737 if (bDelete)
+
1738 {
+
1739 return trustDelete(
+
1740 view,
+
1741 sleRippleState,
+
1742 bSenderHigh ? uReceiverID : uSenderID,
+
1743 !bSenderHigh ? uReceiverID : uSenderID,
+
1744 j);
+
1745 }
+
1746
+
1747 view.update(sleRippleState);
+
1748 return tesSUCCESS;
+
1749 }
+
1750
+
1751 STAmount const saReceiverLimit(Issue{currency, uReceiverID});
+
1752 STAmount saBalance{saAmount};
+
1753
+
1754 saBalance.setIssuer(noAccount());
+
1755
+
1756 JLOG(j.debug()) << "rippleCreditIOU: "
+
1757 "create line: "
+
1758 << to_string(uSenderID) << " -> " << to_string(uReceiverID)
+
1759 << " : " << saAmount.getFullText();
+
1760
+
1761 auto const sleAccount = view.peek(keylet::account(uReceiverID));
+
1762 if (!sleAccount)
+
1763 return tefINTERNAL;
+
1764
+
1765 bool const noRipple = (sleAccount->getFlags() & lsfDefaultRipple) == 0;
+
1766
+
1767 return trustCreate(
+
1768 view,
+
1769 bSenderHigh,
+
1770 uSenderID,
+
1771 uReceiverID,
+
1772 index.key,
+
1773 sleAccount,
+
1774 false,
+
1775 noRipple,
+
1776 false,
+
1777 false,
+
1778 saBalance,
+
1779 saReceiverLimit,
+
1780 0,
+
1781 0,
+
1782 j);
+
1783}
1784
-
1785 SLE::pointer sender = uSenderID != beast::zero
-
1786 ? view.peek(keylet::account(uSenderID))
-
1787 : SLE::pointer();
-
1788 SLE::pointer receiver = uReceiverID != beast::zero
-
1789 ? view.peek(keylet::account(uReceiverID))
-
1790 : SLE::pointer();
-
1791
-
1792 if (auto stream = j.trace())
-
1793 {
-
1794 std::string sender_bal("-");
-
1795 std::string receiver_bal("-");
-
1796
-
1797 if (sender)
-
1798 sender_bal = sender->getFieldAmount(sfBalance).getFullText();
+
1785// Send regardless of limits.
+
1786// --> saAmount: Amount/currency/issuer to deliver to receiver.
+
1787// <-- saActual: Amount actually cost. Sender pays fees.
+
1788static TER
+
1789rippleSendIOU(
+
1790 ApplyView& view,
+
1791 AccountID const& uSenderID,
+
1792 AccountID const& uReceiverID,
+
1793 STAmount const& saAmount,
+
1794 STAmount& saActual,
+
1795 beast::Journal j,
+
1796 WaiveTransferFee waiveFee)
+
1797{
+
1798 auto const issuer = saAmount.getIssuer();
1799
-
1800 if (receiver)
-
1801 receiver_bal = receiver->getFieldAmount(sfBalance).getFullText();
-
1802
-
1803 stream << "accountSendIOU> " << to_string(uSenderID) << " ("
-
1804 << sender_bal << ") -> " << to_string(uReceiverID) << " ("
-
1805 << receiver_bal << ") : " << saAmount.getFullText();
-
1806 }
-
1807
-
1808 if (sender)
-
1809 {
-
1810 if (sender->getFieldAmount(sfBalance) < saAmount)
-
1811 {
-
1812 // VFALCO Its laborious to have to mutate the
-
1813 // TER based on params everywhere
-
1814 terResult = view.open() ? TER{telFAILED_PROCESSING}
-
1815 : TER{tecFAILED_PROCESSING};
-
1816 }
-
1817 else
-
1818 {
-
1819 auto const sndBal = sender->getFieldAmount(sfBalance);
-
1820 view.creditHook(uSenderID, xrpAccount(), saAmount, sndBal);
-
1821
-
1822 // Decrement XRP balance.
-
1823 sender->setFieldAmount(sfBalance, sndBal - saAmount);
-
1824 view.update(sender);
-
1825 }
-
1826 }
-
1827
-
1828 if (tesSUCCESS == terResult && receiver)
-
1829 {
-
1830 // Increment XRP balance.
-
1831 auto const rcvBal = receiver->getFieldAmount(sfBalance);
-
1832 receiver->setFieldAmount(sfBalance, rcvBal + saAmount);
-
1833 view.creditHook(xrpAccount(), uReceiverID, saAmount, -rcvBal);
-
1834
-
1835 view.update(receiver);
-
1836 }
-
1837
-
1838 if (auto stream = j.trace())
-
1839 {
-
1840 std::string sender_bal("-");
-
1841 std::string receiver_bal("-");
-
1842
-
1843 if (sender)
-
1844 sender_bal = sender->getFieldAmount(sfBalance).getFullText();
-
1845
-
1846 if (receiver)
-
1847 receiver_bal = receiver->getFieldAmount(sfBalance).getFullText();
-
1848
-
1849 stream << "accountSendIOU< " << to_string(uSenderID) << " ("
-
1850 << sender_bal << ") -> " << to_string(uReceiverID) << " ("
-
1851 << receiver_bal << ") : " << saAmount.getFullText();
-
1852 }
-
1853
-
1854 return terResult;
-
1855}
-
1856
-
1857static TER
-
1858rippleCreditMPT(
-
1859 ApplyView& view,
-
1860 AccountID const& uSenderID,
-
1861 AccountID const& uReceiverID,
-
1862 STAmount const& saAmount,
-
1863 beast::Journal j)
-
1864{
-
1865 // Do not check MPT authorization here - it must have been checked earlier
-
1866 auto const mptID = keylet::mptIssuance(saAmount.get<MPTIssue>().getMptID());
-
1867 auto const issuer = saAmount.getIssuer();
-
1868 auto sleIssuance = view.peek(mptID);
-
1869 if (!sleIssuance)
-
1870 return tecOBJECT_NOT_FOUND;
-
1871 if (uSenderID == issuer)
-
1872 {
-
1873 (*sleIssuance)[sfOutstandingAmount] += saAmount.mpt().value();
-
1874 view.update(sleIssuance);
-
1875 }
-
1876 else
-
1877 {
-
1878 auto const mptokenID = keylet::mptoken(mptID.key, uSenderID);
-
1879 if (auto sle = view.peek(mptokenID))
-
1880 {
-
1881 auto const amt = sle->getFieldU64(sfMPTAmount);
-
1882 auto const pay = saAmount.mpt().value();
-
1883 if (amt < pay)
-
1884 return tecINSUFFICIENT_FUNDS;
-
1885 (*sle)[sfMPTAmount] = amt - pay;
-
1886 view.update(sle);
-
1887 }
-
1888 else
-
1889 return tecNO_AUTH;
-
1890 }
-
1891
-
1892 if (uReceiverID == issuer)
-
1893 {
-
1894 auto const outstanding = sleIssuance->getFieldU64(sfOutstandingAmount);
-
1895 auto const redeem = saAmount.mpt().value();
-
1896 if (outstanding >= redeem)
-
1897 {
-
1898 sleIssuance->setFieldU64(sfOutstandingAmount, outstanding - redeem);
-
1899 view.update(sleIssuance);
-
1900 }
-
1901 else
-
1902 return tecINTERNAL;
-
1903 }
-
1904 else
-
1905 {
-
1906 auto const mptokenID = keylet::mptoken(mptID.key, uReceiverID);
-
1907 if (auto sle = view.peek(mptokenID))
-
1908 {
-
1909 (*sle)[sfMPTAmount] += saAmount.mpt().value();
-
1910 view.update(sle);
-
1911 }
-
1912 else
-
1913 return tecNO_AUTH;
-
1914 }
-
1915
-
1916 return tesSUCCESS;
-
1917}
-
1918
-
1919static TER
-
1920rippleSendMPT(
-
1921 ApplyView& view,
-
1922 AccountID const& uSenderID,
-
1923 AccountID const& uReceiverID,
-
1924 STAmount const& saAmount,
-
1925 STAmount& saActual,
-
1926 beast::Journal j,
-
1927 WaiveTransferFee waiveFee)
-
1928{
-
1929 XRPL_ASSERT(
-
1930 uSenderID != uReceiverID,
-
1931 "ripple::rippleSendMPT : sender is not receiver");
-
1932
-
1933 // Safe to get MPT since rippleSendMPT is only called by accountSendMPT
-
1934 auto const issuer = saAmount.getIssuer();
-
1935
-
1936 auto const sle =
-
1937 view.read(keylet::mptIssuance(saAmount.get<MPTIssue>().getMptID()));
-
1938 if (!sle)
-
1939 return tecOBJECT_NOT_FOUND;
+
1800 XRPL_ASSERT(
+
1801 !isXRP(uSenderID) && !isXRP(uReceiverID),
+
1802 "ripple::rippleSendIOU : neither sender nor receiver is XRP");
+
1803 XRPL_ASSERT(
+
1804 uSenderID != uReceiverID,
+
1805 "ripple::rippleSendIOU : sender is not receiver");
+
1806
+
1807 if (uSenderID == issuer || uReceiverID == issuer || issuer == noAccount())
+
1808 {
+
1809 // Direct send: redeeming IOUs and/or sending own IOUs.
+
1810 auto const ter =
+
1811 rippleCreditIOU(view, uSenderID, uReceiverID, saAmount, false, j);
+
1812 if (view.rules().enabled(featureDeletableAccounts) && ter != tesSUCCESS)
+
1813 return ter;
+
1814 saActual = saAmount;
+
1815 return tesSUCCESS;
+
1816 }
+
1817
+
1818 // Sending 3rd party IOUs: transit.
+
1819
+
1820 // Calculate the amount to transfer accounting
+
1821 // for any transfer fees if the fee is not waived:
+
1822 saActual = (waiveFee == WaiveTransferFee::Yes)
+
1823 ? saAmount
+
1824 : multiply(saAmount, transferRate(view, issuer));
+
1825
+
1826 JLOG(j.debug()) << "rippleSendIOU> " << to_string(uSenderID) << " - > "
+
1827 << to_string(uReceiverID)
+
1828 << " : deliver=" << saAmount.getFullText()
+
1829 << " cost=" << saActual.getFullText();
+
1830
+
1831 TER terResult =
+
1832 rippleCreditIOU(view, issuer, uReceiverID, saAmount, true, j);
+
1833
+
1834 if (tesSUCCESS == terResult)
+
1835 terResult = rippleCreditIOU(view, uSenderID, issuer, saActual, true, j);
+
1836
+
1837 return terResult;
+
1838}
+
1839
+
1840static TER
+
1841accountSendIOU(
+
1842 ApplyView& view,
+
1843 AccountID const& uSenderID,
+
1844 AccountID const& uReceiverID,
+
1845 STAmount const& saAmount,
+
1846 beast::Journal j,
+
1847 WaiveTransferFee waiveFee)
+
1848{
+
1849 if (view.rules().enabled(fixAMMv1_1))
+
1850 {
+
1851 if (saAmount < beast::zero || saAmount.holds<MPTIssue>())
+
1852 {
+
1853 return tecINTERNAL;
+
1854 }
+
1855 }
+
1856 else
+
1857 {
+
1858 XRPL_ASSERT(
+
1859 saAmount >= beast::zero && !saAmount.holds<MPTIssue>(),
+
1860 "ripple::accountSendIOU : minimum amount and not MPT");
+
1861 }
+
1862
+
1863 /* If we aren't sending anything or if the sender is the same as the
+
1864 * receiver then we don't need to do anything.
+
1865 */
+
1866 if (!saAmount || (uSenderID == uReceiverID))
+
1867 return tesSUCCESS;
+
1868
+
1869 if (!saAmount.native())
+
1870 {
+
1871 STAmount saActual;
+
1872
+
1873 JLOG(j.trace()) << "accountSendIOU: " << to_string(uSenderID) << " -> "
+
1874 << to_string(uReceiverID) << " : "
+
1875 << saAmount.getFullText();
+
1876
+
1877 return rippleSendIOU(
+
1878 view, uSenderID, uReceiverID, saAmount, saActual, j, waiveFee);
+
1879 }
+
1880
+
1881 /* XRP send which does not check reserve and can do pure adjustment.
+
1882 * Note that sender or receiver may be null and this not a mistake; this
+
1883 * setup is used during pathfinding and it is carefully controlled to
+
1884 * ensure that transfers are balanced.
+
1885 */
+
1886 TER terResult(tesSUCCESS);
+
1887
+
1888 SLE::pointer sender = uSenderID != beast::zero
+
1889 ? view.peek(keylet::account(uSenderID))
+
1890 : SLE::pointer();
+
1891 SLE::pointer receiver = uReceiverID != beast::zero
+
1892 ? view.peek(keylet::account(uReceiverID))
+
1893 : SLE::pointer();
+
1894
+
1895 if (auto stream = j.trace())
+
1896 {
+
1897 std::string sender_bal("-");
+
1898 std::string receiver_bal("-");
+
1899
+
1900 if (sender)
+
1901 sender_bal = sender->getFieldAmount(sfBalance).getFullText();
+
1902
+
1903 if (receiver)
+
1904 receiver_bal = receiver->getFieldAmount(sfBalance).getFullText();
+
1905
+
1906 stream << "accountSendIOU> " << to_string(uSenderID) << " ("
+
1907 << sender_bal << ") -> " << to_string(uReceiverID) << " ("
+
1908 << receiver_bal << ") : " << saAmount.getFullText();
+
1909 }
+
1910
+
1911 if (sender)
+
1912 {
+
1913 if (sender->getFieldAmount(sfBalance) < saAmount)
+
1914 {
+
1915 // VFALCO Its laborious to have to mutate the
+
1916 // TER based on params everywhere
+
1917 terResult = view.open() ? TER{telFAILED_PROCESSING}
+
1918 : TER{tecFAILED_PROCESSING};
+
1919 }
+
1920 else
+
1921 {
+
1922 auto const sndBal = sender->getFieldAmount(sfBalance);
+
1923 view.creditHook(uSenderID, xrpAccount(), saAmount, sndBal);
+
1924
+
1925 // Decrement XRP balance.
+
1926 sender->setFieldAmount(sfBalance, sndBal - saAmount);
+
1927 view.update(sender);
+
1928 }
+
1929 }
+
1930
+
1931 if (tesSUCCESS == terResult && receiver)
+
1932 {
+
1933 // Increment XRP balance.
+
1934 auto const rcvBal = receiver->getFieldAmount(sfBalance);
+
1935 receiver->setFieldAmount(sfBalance, rcvBal + saAmount);
+
1936 view.creditHook(xrpAccount(), uReceiverID, saAmount, -rcvBal);
+
1937
+
1938 view.update(receiver);
+
1939 }
1940
-
1941 if (uSenderID == issuer || uReceiverID == issuer)
+
1941 if (auto stream = j.trace())
1942 {
-
1943 // if sender is issuer, check that the new OutstandingAmount will not
-
1944 // exceed MaximumAmount
-
1945 if (uSenderID == issuer)
-
1946 {
-
1947 auto const sendAmount = saAmount.mpt().value();
-
1948 auto const maximumAmount =
-
1949 sle->at(~sfMaximumAmount).value_or(maxMPTokenAmount);
-
1950 if (sendAmount > maximumAmount ||
-
1951 sle->getFieldU64(sfOutstandingAmount) >
-
1952 maximumAmount - sendAmount)
-
1953 return tecPATH_DRY;
-
1954 }
-
1955
-
1956 // Direct send: redeeming MPTs and/or sending own MPTs.
-
1957 auto const ter =
-
1958 rippleCreditMPT(view, uSenderID, uReceiverID, saAmount, j);
-
1959 if (ter != tesSUCCESS)
-
1960 return ter;
-
1961 saActual = saAmount;
-
1962 return tesSUCCESS;
-
1963 }
-
1964
-
1965 // Sending 3rd party MPTs: transit.
-
1966 saActual = (waiveFee == WaiveTransferFee::Yes)
-
1967 ? saAmount
-
1968 : multiply(
-
1969 saAmount,
-
1970 transferRate(view, saAmount.get<MPTIssue>().getMptID()));
-
1971
-
1972 JLOG(j.debug()) << "rippleSendMPT> " << to_string(uSenderID) << " - > "
-
1973 << to_string(uReceiverID)
-
1974 << " : deliver=" << saAmount.getFullText()
-
1975 << " cost=" << saActual.getFullText();
-
1976
-
1977 if (auto const terResult =
-
1978 rippleCreditMPT(view, issuer, uReceiverID, saAmount, j);
-
1979 terResult != tesSUCCESS)
-
1980 return terResult;
-
1981
-
1982 return rippleCreditMPT(view, uSenderID, issuer, saActual, j);
-
1983}
-
1984
-
1985static TER
-
1986accountSendMPT(
-
1987 ApplyView& view,
-
1988 AccountID const& uSenderID,
-
1989 AccountID const& uReceiverID,
-
1990 STAmount const& saAmount,
-
1991 beast::Journal j,
-
1992 WaiveTransferFee waiveFee)
-
1993{
-
1994 XRPL_ASSERT(
-
1995 saAmount >= beast::zero && saAmount.holds<MPTIssue>(),
-
1996 "ripple::accountSendMPT : minimum amount and MPT");
-
1997
-
1998 /* If we aren't sending anything or if the sender is the same as the
-
1999 * receiver then we don't need to do anything.
-
2000 */
-
2001 if (!saAmount || (uSenderID == uReceiverID))
-
2002 return tesSUCCESS;
-
2003
-
2004 STAmount saActual{saAmount.asset()};
-
2005
-
2006 return rippleSendMPT(
-
2007 view, uSenderID, uReceiverID, saAmount, saActual, j, waiveFee);
-
2008}
-
2009
-
2010TER
-
2011accountSend(
-
2012 ApplyView& view,
-
2013 AccountID const& uSenderID,
-
2014 AccountID const& uReceiverID,
-
2015 STAmount const& saAmount,
-
2016 beast::Journal j,
-
2017 WaiveTransferFee waiveFee)
-
2018{
-
2019 return std::visit(
-
2020 [&]<ValidIssueType TIss>(TIss const& issue) {
-
2021 if constexpr (std::is_same_v<TIss, Issue>)
-
2022 return accountSendIOU(
-
2023 view, uSenderID, uReceiverID, saAmount, j, waiveFee);
-
2024 else
-
2025 return accountSendMPT(
-
2026 view, uSenderID, uReceiverID, saAmount, j, waiveFee);
-
2027 },
-
2028 saAmount.asset().value());
-
2029}
-
2030
-
2031static bool
-
2032updateTrustLine(
-
2033 ApplyView& view,
-
2034 SLE::pointer state,
-
2035 bool bSenderHigh,
-
2036 AccountID const& sender,
-
2037 STAmount const& before,
-
2038 STAmount const& after,
-
2039 beast::Journal j)
-
2040{
-
2041 if (!state)
-
2042 return false;
-
2043 std::uint32_t const flags(state->getFieldU32(sfFlags));
-
2044
-
2045 auto sle = view.peek(keylet::account(sender));
-
2046 if (!sle)
-
2047 return false;
-
2048
-
2049 // YYY Could skip this if rippling in reverse.
-
2050 if (before > beast::zero
-
2051 // Sender balance was positive.
-
2052 && after <= beast::zero
-
2053 // Sender is zero or negative.
-
2054 && (flags & (!bSenderHigh ? lsfLowReserve : lsfHighReserve))
-
2055 // Sender reserve is set.
-
2056 && static_cast<bool>(
-
2057 flags & (!bSenderHigh ? lsfLowNoRipple : lsfHighNoRipple)) !=
-
2058 static_cast<bool>(sle->getFlags() & lsfDefaultRipple) &&
-
2059 !(flags & (!bSenderHigh ? lsfLowFreeze : lsfHighFreeze)) &&
-
2060 !state->getFieldAmount(!bSenderHigh ? sfLowLimit : sfHighLimit)
-
2061 // Sender trust limit is 0.
-
2062 && !state->getFieldU32(!bSenderHigh ? sfLowQualityIn : sfHighQualityIn)
-
2063 // Sender quality in is 0.
-
2064 &&
-
2065 !state->getFieldU32(!bSenderHigh ? sfLowQualityOut : sfHighQualityOut))
-
2066 // Sender quality out is 0.
-
2067 {
-
2068 // VFALCO Where is the line being deleted?
-
2069 // Clear the reserve of the sender, possibly delete the line!
-
2070 adjustOwnerCount(view, sle, -1, j);
-
2071
-
2072 // Clear reserve flag.
-
2073 state->setFieldU32(
-
2074 sfFlags, flags & (!bSenderHigh ? ~lsfLowReserve : ~lsfHighReserve));
-
2075
-
2076 // Balance is zero, receiver reserve is clear.
-
2077 if (!after // Balance is zero.
-
2078 && !(flags & (bSenderHigh ? lsfLowReserve : lsfHighReserve)))
-
2079 return true;
-
2080 }
-
2081 return false;
-
2082}
-
2083
-
2084TER
-
2085issueIOU(
-
2086 ApplyView& view,
-
2087 AccountID const& account,
-
2088 STAmount const& amount,
-
2089 Issue const& issue,
-
2090 beast::Journal j)
-
2091{
-
2092 XRPL_ASSERT(
-
2093 !isXRP(account) && !isXRP(issue.account),
-
2094 "ripple::issueIOU : neither account nor issuer is XRP");
-
2095
-
2096 // Consistency check
-
2097 XRPL_ASSERT(issue == amount.issue(), "ripple::issueIOU : matching issue");
-
2098
-
2099 // Can't send to self!
-
2100 XRPL_ASSERT(
-
2101 issue.account != account, "ripple::issueIOU : not issuer account");
-
2102
-
2103 JLOG(j.trace()) << "issueIOU: " << to_string(account) << ": "
-
2104 << amount.getFullText();
-
2105
-
2106 bool bSenderHigh = issue.account > account;
-
2107
-
2108 auto const index = keylet::line(issue.account, account, issue.currency);
-
2109
-
2110 if (auto state = view.peek(index))
-
2111 {
-
2112 STAmount final_balance = state->getFieldAmount(sfBalance);
-
2113
-
2114 if (bSenderHigh)
-
2115 final_balance.negate(); // Put balance in sender terms.
-
2116
-
2117 STAmount const start_balance = final_balance;
-
2118
-
2119 final_balance -= amount;
-
2120
-
2121 auto const must_delete = updateTrustLine(
-
2122 view,
-
2123 state,
-
2124 bSenderHigh,
-
2125 issue.account,
-
2126 start_balance,
-
2127 final_balance,
-
2128 j);
-
2129
-
2130 view.creditHook(issue.account, account, amount, start_balance);
-
2131
-
2132 if (bSenderHigh)
-
2133 final_balance.negate();
-
2134
-
2135 // Adjust the balance on the trust line if necessary. We do this even if
-
2136 // we are going to delete the line to reflect the correct balance at the
-
2137 // time of deletion.
-
2138 state->setFieldAmount(sfBalance, final_balance);
-
2139 if (must_delete)
-
2140 return trustDelete(
-
2141 view,
-
2142 state,
-
2143 bSenderHigh ? account : issue.account,
-
2144 bSenderHigh ? issue.account : account,
-
2145 j);
-
2146
-
2147 view.update(state);
-
2148
-
2149 return tesSUCCESS;
-
2150 }
+
1943 std::string sender_bal("-");
+
1944 std::string receiver_bal("-");
+
1945
+
1946 if (sender)
+
1947 sender_bal = sender->getFieldAmount(sfBalance).getFullText();
+
1948
+
1949 if (receiver)
+
1950 receiver_bal = receiver->getFieldAmount(sfBalance).getFullText();
+
1951
+
1952 stream << "accountSendIOU< " << to_string(uSenderID) << " ("
+
1953 << sender_bal << ") -> " << to_string(uReceiverID) << " ("
+
1954 << receiver_bal << ") : " << saAmount.getFullText();
+
1955 }
+
1956
+
1957 return terResult;
+
1958}
+
1959
+
1960static TER
+
1961rippleCreditMPT(
+
1962 ApplyView& view,
+
1963 AccountID const& uSenderID,
+
1964 AccountID const& uReceiverID,
+
1965 STAmount const& saAmount,
+
1966 beast::Journal j)
+
1967{
+
1968 // Do not check MPT authorization here - it must have been checked earlier
+
1969 auto const mptID = keylet::mptIssuance(saAmount.get<MPTIssue>().getMptID());
+
1970 auto const issuer = saAmount.getIssuer();
+
1971 auto sleIssuance = view.peek(mptID);
+
1972 if (!sleIssuance)
+
1973 return tecOBJECT_NOT_FOUND;
+
1974 if (uSenderID == issuer)
+
1975 {
+
1976 (*sleIssuance)[sfOutstandingAmount] += saAmount.mpt().value();
+
1977 view.update(sleIssuance);
+
1978 }
+
1979 else
+
1980 {
+
1981 auto const mptokenID = keylet::mptoken(mptID.key, uSenderID);
+
1982 if (auto sle = view.peek(mptokenID))
+
1983 {
+
1984 auto const amt = sle->getFieldU64(sfMPTAmount);
+
1985 auto const pay = saAmount.mpt().value();
+
1986 if (amt < pay)
+
1987 return tecINSUFFICIENT_FUNDS;
+
1988 (*sle)[sfMPTAmount] = amt - pay;
+
1989 view.update(sle);
+
1990 }
+
1991 else
+
1992 return tecNO_AUTH;
+
1993 }
+
1994
+
1995 if (uReceiverID == issuer)
+
1996 {
+
1997 auto const outstanding = sleIssuance->getFieldU64(sfOutstandingAmount);
+
1998 auto const redeem = saAmount.mpt().value();
+
1999 if (outstanding >= redeem)
+
2000 {
+
2001 sleIssuance->setFieldU64(sfOutstandingAmount, outstanding - redeem);
+
2002 view.update(sleIssuance);
+
2003 }
+
2004 else
+
2005 return tecINTERNAL;
+
2006 }
+
2007 else
+
2008 {
+
2009 auto const mptokenID = keylet::mptoken(mptID.key, uReceiverID);
+
2010 if (auto sle = view.peek(mptokenID))
+
2011 {
+
2012 (*sle)[sfMPTAmount] += saAmount.mpt().value();
+
2013 view.update(sle);
+
2014 }
+
2015 else
+
2016 return tecNO_AUTH;
+
2017 }
+
2018
+
2019 return tesSUCCESS;
+
2020}
+
2021
+
2022static TER
+
2023rippleSendMPT(
+
2024 ApplyView& view,
+
2025 AccountID const& uSenderID,
+
2026 AccountID const& uReceiverID,
+
2027 STAmount const& saAmount,
+
2028 STAmount& saActual,
+
2029 beast::Journal j,
+
2030 WaiveTransferFee waiveFee)
+
2031{
+
2032 XRPL_ASSERT(
+
2033 uSenderID != uReceiverID,
+
2034 "ripple::rippleSendMPT : sender is not receiver");
+
2035
+
2036 // Safe to get MPT since rippleSendMPT is only called by accountSendMPT
+
2037 auto const issuer = saAmount.getIssuer();
+
2038
+
2039 auto const sle =
+
2040 view.read(keylet::mptIssuance(saAmount.get<MPTIssue>().getMptID()));
+
2041 if (!sle)
+
2042 return tecOBJECT_NOT_FOUND;
+
2043
+
2044 if (uSenderID == issuer || uReceiverID == issuer)
+
2045 {
+
2046 // if sender is issuer, check that the new OutstandingAmount will not
+
2047 // exceed MaximumAmount
+
2048 if (uSenderID == issuer)
+
2049 {
+
2050 auto const sendAmount = saAmount.mpt().value();
+
2051 auto const maximumAmount =
+
2052 sle->at(~sfMaximumAmount).value_or(maxMPTokenAmount);
+
2053 if (sendAmount > maximumAmount ||
+
2054 sle->getFieldU64(sfOutstandingAmount) >
+
2055 maximumAmount - sendAmount)
+
2056 return tecPATH_DRY;
+
2057 }
+
2058
+
2059 // Direct send: redeeming MPTs and/or sending own MPTs.
+
2060 auto const ter =
+
2061 rippleCreditMPT(view, uSenderID, uReceiverID, saAmount, j);
+
2062 if (ter != tesSUCCESS)
+
2063 return ter;
+
2064 saActual = saAmount;
+
2065 return tesSUCCESS;
+
2066 }
+
2067
+
2068 // Sending 3rd party MPTs: transit.
+
2069 saActual = (waiveFee == WaiveTransferFee::Yes)
+
2070 ? saAmount
+
2071 : multiply(
+
2072 saAmount,
+
2073 transferRate(view, saAmount.get<MPTIssue>().getMptID()));
+
2074
+
2075 JLOG(j.debug()) << "rippleSendMPT> " << to_string(uSenderID) << " - > "
+
2076 << to_string(uReceiverID)
+
2077 << " : deliver=" << saAmount.getFullText()
+
2078 << " cost=" << saActual.getFullText();
+
2079
+
2080 if (auto const terResult =
+
2081 rippleCreditMPT(view, issuer, uReceiverID, saAmount, j);
+
2082 terResult != tesSUCCESS)
+
2083 return terResult;
+
2084
+
2085 return rippleCreditMPT(view, uSenderID, issuer, saActual, j);
+
2086}
+
2087
+
2088static TER
+
2089accountSendMPT(
+
2090 ApplyView& view,
+
2091 AccountID const& uSenderID,
+
2092 AccountID const& uReceiverID,
+
2093 STAmount const& saAmount,
+
2094 beast::Journal j,
+
2095 WaiveTransferFee waiveFee)
+
2096{
+
2097 XRPL_ASSERT(
+
2098 saAmount >= beast::zero && saAmount.holds<MPTIssue>(),
+
2099 "ripple::accountSendMPT : minimum amount and MPT");
+
2100
+
2101 /* If we aren't sending anything or if the sender is the same as the
+
2102 * receiver then we don't need to do anything.
+
2103 */
+
2104 if (!saAmount || (uSenderID == uReceiverID))
+
2105 return tesSUCCESS;
+
2106
+
2107 STAmount saActual{saAmount.asset()};
+
2108
+
2109 return rippleSendMPT(
+
2110 view, uSenderID, uReceiverID, saAmount, saActual, j, waiveFee);
+
2111}
+
2112
+
2113TER
+
2114accountSend(
+
2115 ApplyView& view,
+
2116 AccountID const& uSenderID,
+
2117 AccountID const& uReceiverID,
+
2118 STAmount const& saAmount,
+
2119 beast::Journal j,
+
2120 WaiveTransferFee waiveFee)
+
2121{
+
2122 return std::visit(
+
2123 [&]<ValidIssueType TIss>(TIss const& issue) {
+
2124 if constexpr (std::is_same_v<TIss, Issue>)
+
2125 return accountSendIOU(
+
2126 view, uSenderID, uReceiverID, saAmount, j, waiveFee);
+
2127 else
+
2128 return accountSendMPT(
+
2129 view, uSenderID, uReceiverID, saAmount, j, waiveFee);
+
2130 },
+
2131 saAmount.asset().value());
+
2132}
+
2133
+
2134static bool
+
2135updateTrustLine(
+
2136 ApplyView& view,
+
2137 SLE::pointer state,
+
2138 bool bSenderHigh,
+
2139 AccountID const& sender,
+
2140 STAmount const& before,
+
2141 STAmount const& after,
+
2142 beast::Journal j)
+
2143{
+
2144 if (!state)
+
2145 return false;
+
2146 std::uint32_t const flags(state->getFieldU32(sfFlags));
+
2147
+
2148 auto sle = view.peek(keylet::account(sender));
+
2149 if (!sle)
+
2150 return false;
2151
-
2152 // NIKB TODO: The limit uses the receiver's account as the issuer and
-
2153 // this is unnecessarily inefficient as copying which could be avoided
-
2154 // is now required. Consider available options.
-
2155 STAmount const limit(Issue{issue.currency, account});
-
2156 STAmount final_balance = amount;
-
2157
-
2158 final_balance.setIssuer(noAccount());
-
2159
-
2160 auto const receiverAccount = view.peek(keylet::account(account));
-
2161 if (!receiverAccount)
-
2162 return tefINTERNAL;
-
2163
-
2164 bool noRipple = (receiverAccount->getFlags() & lsfDefaultRipple) == 0;
-
2165
-
2166 return trustCreate(
-
2167 view,
-
2168 bSenderHigh,
-
2169 issue.account,
-
2170 account,
-
2171 index.key,
-
2172 receiverAccount,
-
2173 false,
-
2174 noRipple,
-
2175 false,
-
2176 false,
-
2177 final_balance,
-
2178 limit,
-
2179 0,
-
2180 0,
-
2181 j);
-
2182}
-
2183
-
2184TER
-
2185redeemIOU(
-
2186 ApplyView& view,
-
2187 AccountID const& account,
-
2188 STAmount const& amount,
-
2189 Issue const& issue,
-
2190 beast::Journal j)
-
2191{
-
2192 XRPL_ASSERT(
-
2193 !isXRP(account) && !isXRP(issue.account),
-
2194 "ripple::redeemIOU : neither account nor issuer is XRP");
-
2195
-
2196 // Consistency check
-
2197 XRPL_ASSERT(issue == amount.issue(), "ripple::redeemIOU : matching issue");
+
2152 // YYY Could skip this if rippling in reverse.
+
2153 if (before > beast::zero
+
2154 // Sender balance was positive.
+
2155 && after <= beast::zero
+
2156 // Sender is zero or negative.
+
2157 && (flags & (!bSenderHigh ? lsfLowReserve : lsfHighReserve))
+
2158 // Sender reserve is set.
+
2159 && static_cast<bool>(
+
2160 flags & (!bSenderHigh ? lsfLowNoRipple : lsfHighNoRipple)) !=
+
2161 static_cast<bool>(sle->getFlags() & lsfDefaultRipple) &&
+
2162 !(flags & (!bSenderHigh ? lsfLowFreeze : lsfHighFreeze)) &&
+
2163 !state->getFieldAmount(!bSenderHigh ? sfLowLimit : sfHighLimit)
+
2164 // Sender trust limit is 0.
+
2165 && !state->getFieldU32(!bSenderHigh ? sfLowQualityIn : sfHighQualityIn)
+
2166 // Sender quality in is 0.
+
2167 &&
+
2168 !state->getFieldU32(!bSenderHigh ? sfLowQualityOut : sfHighQualityOut))
+
2169 // Sender quality out is 0.
+
2170 {
+
2171 // VFALCO Where is the line being deleted?
+
2172 // Clear the reserve of the sender, possibly delete the line!
+
2173 adjustOwnerCount(view, sle, -1, j);
+
2174
+
2175 // Clear reserve flag.
+
2176 state->setFieldU32(
+
2177 sfFlags, flags & (!bSenderHigh ? ~lsfLowReserve : ~lsfHighReserve));
+
2178
+
2179 // Balance is zero, receiver reserve is clear.
+
2180 if (!after // Balance is zero.
+
2181 && !(flags & (bSenderHigh ? lsfLowReserve : lsfHighReserve)))
+
2182 return true;
+
2183 }
+
2184 return false;
+
2185}
+
2186
+
2187TER
+
2188issueIOU(
+
2189 ApplyView& view,
+
2190 AccountID const& account,
+
2191 STAmount const& amount,
+
2192 Issue const& issue,
+
2193 beast::Journal j)
+
2194{
+
2195 XRPL_ASSERT(
+
2196 !isXRP(account) && !isXRP(issue.account),
+
2197 "ripple::issueIOU : neither account nor issuer is XRP");
2198
-
2199 // Can't send to self!
-
2200 XRPL_ASSERT(
-
2201 issue.account != account, "ripple::redeemIOU : not issuer account");
-
2202
-
2203 JLOG(j.trace()) << "redeemIOU: " << to_string(account) << ": "
-
2204 << amount.getFullText();
+
2199 // Consistency check
+
2200 XRPL_ASSERT(issue == amount.issue(), "ripple::issueIOU : matching issue");
+
2201
+
2202 // Can't send to self!
+
2203 XRPL_ASSERT(
+
2204 issue.account != account, "ripple::issueIOU : not issuer account");
2205
-
2206 bool bSenderHigh = account > issue.account;
-
2207
-
2208 if (auto state =
-
2209 view.peek(keylet::line(account, issue.account, issue.currency)))
-
2210 {
-
2211 STAmount final_balance = state->getFieldAmount(sfBalance);
+
2206 JLOG(j.trace()) << "issueIOU: " << to_string(account) << ": "
+
2207 << amount.getFullText();
+
2208
+
2209 bool bSenderHigh = issue.account > account;
+
2210
+
2211 auto const index = keylet::line(issue.account, account, issue.currency);
2212
-
2213 if (bSenderHigh)
-
2214 final_balance.negate(); // Put balance in sender terms.
-
2215
-
2216 STAmount const start_balance = final_balance;
-
2217
-
2218 final_balance -= amount;
+
2213 if (auto state = view.peek(index))
+
2214 {
+
2215 STAmount final_balance = state->getFieldAmount(sfBalance);
+
2216
+
2217 if (bSenderHigh)
+
2218 final_balance.negate(); // Put balance in sender terms.
2219
-
2220 auto const must_delete = updateTrustLine(
-
2221 view, state, bSenderHigh, account, start_balance, final_balance, j);
-
2222
-
2223 view.creditHook(account, issue.account, amount, start_balance);
-
2224
-
2225 if (bSenderHigh)
-
2226 final_balance.negate();
-
2227
-
2228 // Adjust the balance on the trust line if necessary. We do this even if
-
2229 // we are going to delete the line to reflect the correct balance at the
-
2230 // time of deletion.
-
2231 state->setFieldAmount(sfBalance, final_balance);
+
2220 STAmount const start_balance = final_balance;
+
2221
+
2222 final_balance -= amount;
+
2223
+
2224 auto const must_delete = updateTrustLine(
+
2225 view,
+
2226 state,
+
2227 bSenderHigh,
+
2228 issue.account,
+
2229 start_balance,
+
2230 final_balance,
+
2231 j);
2232
-
2233 if (must_delete)
-
2234 {
-
2235 return trustDelete(
-
2236 view,
-
2237 state,
-
2238 bSenderHigh ? issue.account : account,
-
2239 bSenderHigh ? account : issue.account,
-
2240 j);
-
2241 }
-
2242
-
2243 view.update(state);
-
2244 return tesSUCCESS;
-
2245 }
-
2246
-
2247 // In order to hold an IOU, a trust line *MUST* exist to track the
-
2248 // balance. If it doesn't, then something is very wrong. Don't try
-
2249 // to continue.
-
2250 JLOG(j.fatal()) << "redeemIOU: " << to_string(account)
-
2251 << " attempts to redeem " << amount.getFullText()
-
2252 << " but no trust line exists!";
-
2253
-
2254 return tefINTERNAL;
-
2255}
-
2256
-
2257TER
-
2258transferXRP(
-
2259 ApplyView& view,
-
2260 AccountID const& from,
-
2261 AccountID const& to,
-
2262 STAmount const& amount,
-
2263 beast::Journal j)
-
2264{
-
2265 XRPL_ASSERT(
-
2266 from != beast::zero, "ripple::transferXRP : nonzero from account");
-
2267 XRPL_ASSERT(to != beast::zero, "ripple::transferXRP : nonzero to account");
-
2268 XRPL_ASSERT(from != to, "ripple::transferXRP : sender is not receiver");
-
2269 XRPL_ASSERT(amount.native(), "ripple::transferXRP : amount is XRP");
-
2270
-
2271 SLE::pointer const sender = view.peek(keylet::account(from));
-
2272 SLE::pointer const receiver = view.peek(keylet::account(to));
-
2273 if (!sender || !receiver)
-
2274 return tefINTERNAL;
-
2275
-
2276 JLOG(j.trace()) << "transferXRP: " << to_string(from) << " -> "
-
2277 << to_string(to) << ") : " << amount.getFullText();
-
2278
-
2279 if (sender->getFieldAmount(sfBalance) < amount)
-
2280 {
-
2281 // VFALCO Its unfortunate we have to keep
-
2282 // mutating these TER everywhere
-
2283 // FIXME: this logic should be moved to callers maybe?
-
2284 return view.open() ? TER{telFAILED_PROCESSING}
-
2285 : TER{tecFAILED_PROCESSING};
-
2286 }
-
2287
-
2288 // Decrement XRP balance.
-
2289 sender->setFieldAmount(
-
2290 sfBalance, sender->getFieldAmount(sfBalance) - amount);
-
2291 view.update(sender);
-
2292
-
2293 receiver->setFieldAmount(
-
2294 sfBalance, receiver->getFieldAmount(sfBalance) + amount);
-
2295 view.update(receiver);
-
2296
-
2297 return tesSUCCESS;
-
2298}
-
2299
-
2300TER
-
2301requireAuth(
-
2302 ReadView const& view,
-
2303 Issue const& issue,
-
2304 AccountID const& account,
-
2305 AuthType authType)
-
2306{
-
2307 if (isXRP(issue) || issue.account == account)
-
2308 return tesSUCCESS;
-
2309
-
2310 auto const trustLine =
-
2311 view.read(keylet::line(account, issue.account, issue.currency));
-
2312 // If account has no line, and this is a strong check, fail
-
2313 if (!trustLine && authType == AuthType::StrongAuth)
-
2314 return tecNO_LINE;
+
2233 view.creditHook(issue.account, account, amount, start_balance);
+
2234
+
2235 if (bSenderHigh)
+
2236 final_balance.negate();
+
2237
+
2238 // Adjust the balance on the trust line if necessary. We do this even if
+
2239 // we are going to delete the line to reflect the correct balance at the
+
2240 // time of deletion.
+
2241 state->setFieldAmount(sfBalance, final_balance);
+
2242 if (must_delete)
+
2243 return trustDelete(
+
2244 view,
+
2245 state,
+
2246 bSenderHigh ? account : issue.account,
+
2247 bSenderHigh ? issue.account : account,
+
2248 j);
+
2249
+
2250 view.update(state);
+
2251
+
2252 return tesSUCCESS;
+
2253 }
+
2254
+
2255 // NIKB TODO: The limit uses the receiver's account as the issuer and
+
2256 // this is unnecessarily inefficient as copying which could be avoided
+
2257 // is now required. Consider available options.
+
2258 STAmount const limit(Issue{issue.currency, account});
+
2259 STAmount final_balance = amount;
+
2260
+
2261 final_balance.setIssuer(noAccount());
+
2262
+
2263 auto const receiverAccount = view.peek(keylet::account(account));
+
2264 if (!receiverAccount)
+
2265 return tefINTERNAL;
+
2266
+
2267 bool noRipple = (receiverAccount->getFlags() & lsfDefaultRipple) == 0;
+
2268
+
2269 return trustCreate(
+
2270 view,
+
2271 bSenderHigh,
+
2272 issue.account,
+
2273 account,
+
2274 index.key,
+
2275 receiverAccount,
+
2276 false,
+
2277 noRipple,
+
2278 false,
+
2279 false,
+
2280 final_balance,
+
2281 limit,
+
2282 0,
+
2283 0,
+
2284 j);
+
2285}
+
2286
+
2287TER
+
2288redeemIOU(
+
2289 ApplyView& view,
+
2290 AccountID const& account,
+
2291 STAmount const& amount,
+
2292 Issue const& issue,
+
2293 beast::Journal j)
+
2294{
+
2295 XRPL_ASSERT(
+
2296 !isXRP(account) && !isXRP(issue.account),
+
2297 "ripple::redeemIOU : neither account nor issuer is XRP");
+
2298
+
2299 // Consistency check
+
2300 XRPL_ASSERT(issue == amount.issue(), "ripple::redeemIOU : matching issue");
+
2301
+
2302 // Can't send to self!
+
2303 XRPL_ASSERT(
+
2304 issue.account != account, "ripple::redeemIOU : not issuer account");
+
2305
+
2306 JLOG(j.trace()) << "redeemIOU: " << to_string(account) << ": "
+
2307 << amount.getFullText();
+
2308
+
2309 bool bSenderHigh = account > issue.account;
+
2310
+
2311 if (auto state =
+
2312 view.peek(keylet::line(account, issue.account, issue.currency)))
+
2313 {
+
2314 STAmount final_balance = state->getFieldAmount(sfBalance);
2315
-
2316 // If this is a weak or legacy check, or if the account has a line, fail if
-
2317 // auth is required and not set on the line
-
2318 if (auto const issuerAccount = view.read(keylet::account(issue.account));
-
2319 issuerAccount && (*issuerAccount)[sfFlags] & lsfRequireAuth)
-
2320 {
-
2321 if (trustLine)
-
2322 return ((*trustLine)[sfFlags] &
-
2323 ((account > issue.account) ? lsfLowAuth : lsfHighAuth))
-
2324 ? tesSUCCESS
-
2325 : TER{tecNO_AUTH};
-
2326 return TER{tecNO_LINE};
-
2327 }
-
2328
-
2329 return tesSUCCESS;
-
2330}
-
2331
-
2332TER
-
2333requireAuth(
-
2334 ReadView const& view,
-
2335 MPTIssue const& mptIssue,
-
2336 AccountID const& account,
-
2337 AuthType authType,
-
2338 int depth)
-
2339{
-
2340 auto const mptID = keylet::mptIssuance(mptIssue.getMptID());
-
2341 auto const sleIssuance = view.read(mptID);
-
2342 if (!sleIssuance)
-
2343 return tecOBJECT_NOT_FOUND;
-
2344
-
2345 auto const mptIssuer = sleIssuance->getAccountID(sfIssuer);
-
2346
-
2347 // issuer is always "authorized"
-
2348 if (mptIssuer == account) // Issuer won't have MPToken
-
2349 return tesSUCCESS;
-
2350
-
2351 if (view.rules().enabled(featureSingleAssetVault))
-
2352 {
-
2353 if (depth >= maxAssetCheckDepth)
-
2354 return tecINTERNAL; // LCOV_EXCL_LINE
-
2355
-
2356 // requireAuth is recursive if the issuer is a vault pseudo-account
-
2357 auto const sleIssuer = view.read(keylet::account(mptIssuer));
-
2358 if (!sleIssuer)
-
2359 return tefINTERNAL; // LCOV_EXCL_LINE
-
2360
-
2361 if (sleIssuer->isFieldPresent(sfVaultID))
-
2362 {
-
2363 auto const sleVault =
-
2364 view.read(keylet::vault(sleIssuer->getFieldH256(sfVaultID)));
-
2365 if (!sleVault)
-
2366 return tefINTERNAL; // LCOV_EXCL_LINE
-
2367
-
2368 auto const asset = sleVault->at(sfAsset);
-
2369 if (auto const err = std::visit(
-
2370 [&]<ValidIssueType TIss>(TIss const& issue) {
-
2371 if constexpr (std::is_same_v<TIss, Issue>)
-
2372 return requireAuth(view, issue, account, authType);
-
2373 else
-
2374 return requireAuth(
-
2375 view, issue, account, authType, depth + 1);
-
2376 },
-
2377 asset.value());
-
2378 !isTesSuccess(err))
-
2379 return err;
-
2380 }
-
2381 }
-
2382
-
2383 auto const mptokenID = keylet::mptoken(mptID.key, account);
-
2384 auto const sleToken = view.read(mptokenID);
-
2385
-
2386 // if account has no MPToken, fail
-
2387 if (!sleToken &&
-
2388 (authType == AuthType::StrongAuth || authType == AuthType::Legacy))
-
2389 return tecNO_AUTH;
+
2316 if (bSenderHigh)
+
2317 final_balance.negate(); // Put balance in sender terms.
+
2318
+
2319 STAmount const start_balance = final_balance;
+
2320
+
2321 final_balance -= amount;
+
2322
+
2323 auto const must_delete = updateTrustLine(
+
2324 view, state, bSenderHigh, account, start_balance, final_balance, j);
+
2325
+
2326 view.creditHook(account, issue.account, amount, start_balance);
+
2327
+
2328 if (bSenderHigh)
+
2329 final_balance.negate();
+
2330
+
2331 // Adjust the balance on the trust line if necessary. We do this even if
+
2332 // we are going to delete the line to reflect the correct balance at the
+
2333 // time of deletion.
+
2334 state->setFieldAmount(sfBalance, final_balance);
+
2335
+
2336 if (must_delete)
+
2337 {
+
2338 return trustDelete(
+
2339 view,
+
2340 state,
+
2341 bSenderHigh ? issue.account : account,
+
2342 bSenderHigh ? account : issue.account,
+
2343 j);
+
2344 }
+
2345
+
2346 view.update(state);
+
2347 return tesSUCCESS;
+
2348 }
+
2349
+
2350 // In order to hold an IOU, a trust line *MUST* exist to track the
+
2351 // balance. If it doesn't, then something is very wrong. Don't try
+
2352 // to continue.
+
2353 JLOG(j.fatal()) << "redeemIOU: " << to_string(account)
+
2354 << " attempts to redeem " << amount.getFullText()
+
2355 << " but no trust line exists!";
+
2356
+
2357 return tefINTERNAL;
+
2358}
+
2359
+
2360TER
+
2361transferXRP(
+
2362 ApplyView& view,
+
2363 AccountID const& from,
+
2364 AccountID const& to,
+
2365 STAmount const& amount,
+
2366 beast::Journal j)
+
2367{
+
2368 XRPL_ASSERT(
+
2369 from != beast::zero, "ripple::transferXRP : nonzero from account");
+
2370 XRPL_ASSERT(to != beast::zero, "ripple::transferXRP : nonzero to account");
+
2371 XRPL_ASSERT(from != to, "ripple::transferXRP : sender is not receiver");
+
2372 XRPL_ASSERT(amount.native(), "ripple::transferXRP : amount is XRP");
+
2373
+
2374 SLE::pointer const sender = view.peek(keylet::account(from));
+
2375 SLE::pointer const receiver = view.peek(keylet::account(to));
+
2376 if (!sender || !receiver)
+
2377 return tefINTERNAL;
+
2378
+
2379 JLOG(j.trace()) << "transferXRP: " << to_string(from) << " -> "
+
2380 << to_string(to) << ") : " << amount.getFullText();
+
2381
+
2382 if (sender->getFieldAmount(sfBalance) < amount)
+
2383 {
+
2384 // VFALCO Its unfortunate we have to keep
+
2385 // mutating these TER everywhere
+
2386 // FIXME: this logic should be moved to callers maybe?
+
2387 return view.open() ? TER{telFAILED_PROCESSING}
+
2388 : TER{tecFAILED_PROCESSING};
+
2389 }
2390
-
2391 // Note, this check is not amendment-gated because DomainID will be always
-
2392 // empty **unless** writing to it has been enabled by an amendment
-
2393 auto const maybeDomainID = sleIssuance->at(~sfDomainID);
-
2394 if (maybeDomainID)
-
2395 {
-
2396 XRPL_ASSERT(
-
2397 sleIssuance->getFieldU32(sfFlags) & lsfMPTRequireAuth,
-
2398 "ripple::requireAuth : issuance requires authorization");
-
2399 // ter = tefINTERNAL | tecOBJECT_NOT_FOUND | tecNO_AUTH | tecEXPIRED
-
2400 if (auto const ter =
-
2401 credentials::validDomain(view, *maybeDomainID, account);
-
2402 isTesSuccess(ter))
-
2403 return ter; // Note: sleToken might be null
-
2404 else if (!sleToken)
-
2405 return ter;
-
2406 // We ignore error from validDomain if we found sleToken, as it could
-
2407 // belong to someone who is explicitly authorized e.g. a vault owner.
-
2408 }
-
2409
-
2410 // mptoken must be authorized if issuance enabled requireAuth
-
2411 if (sleIssuance->isFlag(lsfMPTRequireAuth) &&
-
2412 (!sleToken || !sleToken->isFlag(lsfMPTAuthorized)))
-
2413 return tecNO_AUTH;
-
2414
-
2415 return tesSUCCESS; // Note: sleToken might be null
-
2416}
-
2417
-
2418[[nodiscard]] TER
-
2419enforceMPTokenAuthorization(
-
2420 ApplyView& view,
-
2421 MPTID const& mptIssuanceID,
-
2422 AccountID const& account,
-
2423 XRPAmount const& priorBalance, // for MPToken authorization
-
2424 beast::Journal j)
-
2425{
-
2426 auto const sleIssuance = view.read(keylet::mptIssuance(mptIssuanceID));
-
2427 if (!sleIssuance)
-
2428 return tefINTERNAL; // LCOV_EXCL_LINE
-
2429
-
2430 XRPL_ASSERT(
-
2431 sleIssuance->isFlag(lsfMPTRequireAuth),
-
2432 "ripple::enforceMPTokenAuthorization : authorization required");
-
2433
-
2434 if (account == sleIssuance->at(sfIssuer))
-
2435 return tefINTERNAL; // LCOV_EXCL_LINE
-
2436
-
2437 auto const keylet = keylet::mptoken(mptIssuanceID, account);
-
2438 auto const sleToken = view.read(keylet); // NOTE: might be null
-
2439 auto const maybeDomainID = sleIssuance->at(~sfDomainID);
-
2440 bool expired = false;
-
2441 bool const authorizedByDomain = [&]() -> bool {
-
2442 // NOTE: defensive here, shuld be checked in preclaim
-
2443 if (!maybeDomainID.has_value())
-
2444 return false; // LCOV_EXCL_LINE
-
2445
-
2446 auto const ter = verifyValidDomain(view, account, *maybeDomainID, j);
-
2447 if (isTesSuccess(ter))
-
2448 return true;
-
2449 if (ter == tecEXPIRED)
-
2450 expired = true;
-
2451 return false;
-
2452 }();
+
2391 // Decrement XRP balance.
+
2392 sender->setFieldAmount(
+
2393 sfBalance, sender->getFieldAmount(sfBalance) - amount);
+
2394 view.update(sender);
+
2395
+
2396 receiver->setFieldAmount(
+
2397 sfBalance, receiver->getFieldAmount(sfBalance) + amount);
+
2398 view.update(receiver);
+
2399
+
2400 return tesSUCCESS;
+
2401}
+
2402
+
2403TER
+
2404requireAuth(
+
2405 ReadView const& view,
+
2406 Issue const& issue,
+
2407 AccountID const& account,
+
2408 AuthType authType)
+
2409{
+
2410 if (isXRP(issue) || issue.account == account)
+
2411 return tesSUCCESS;
+
2412
+
2413 auto const trustLine =
+
2414 view.read(keylet::line(account, issue.account, issue.currency));
+
2415 // If account has no line, and this is a strong check, fail
+
2416 if (!trustLine && authType == AuthType::StrongAuth)
+
2417 return tecNO_LINE;
+
2418
+
2419 // If this is a weak or legacy check, or if the account has a line, fail if
+
2420 // auth is required and not set on the line
+
2421 if (auto const issuerAccount = view.read(keylet::account(issue.account));
+
2422 issuerAccount && (*issuerAccount)[sfFlags] & lsfRequireAuth)
+
2423 {
+
2424 if (trustLine)
+
2425 return ((*trustLine)[sfFlags] &
+
2426 ((account > issue.account) ? lsfLowAuth : lsfHighAuth))
+
2427 ? tesSUCCESS
+
2428 : TER{tecNO_AUTH};
+
2429 return TER{tecNO_LINE};
+
2430 }
+
2431
+
2432 return tesSUCCESS;
+
2433}
+
2434
+
2435TER
+
2436requireAuth(
+
2437 ReadView const& view,
+
2438 MPTIssue const& mptIssue,
+
2439 AccountID const& account,
+
2440 AuthType authType,
+
2441 int depth)
+
2442{
+
2443 auto const mptID = keylet::mptIssuance(mptIssue.getMptID());
+
2444 auto const sleIssuance = view.read(mptID);
+
2445 if (!sleIssuance)
+
2446 return tecOBJECT_NOT_FOUND;
+
2447
+
2448 auto const mptIssuer = sleIssuance->getAccountID(sfIssuer);
+
2449
+
2450 // issuer is always "authorized"
+
2451 if (mptIssuer == account) // Issuer won't have MPToken
+
2452 return tesSUCCESS;
2453
-
2454 if (!authorizedByDomain && sleToken == nullptr)
+
2454 if (view.rules().enabled(featureSingleAssetVault))
2455 {
-
2456 // Could not find MPToken and won't create one, could be either of:
-
2457 //
-
2458 // 1. Field sfDomainID not set in MPTokenIssuance or
-
2459 // 2. Account has no matching and accepted credentials or
-
2460 // 3. Account has all expired credentials (deleted in verifyValidDomain)
-
2461 //
-
2462 // Either way, return tecNO_AUTH and there is nothing else to do
-
2463 return expired ? tecEXPIRED : tecNO_AUTH;
-
2464 }
-
2465 else if (!authorizedByDomain && maybeDomainID.has_value())
-
2466 {
-
2467 // Found an MPToken but the account is not authorized and we expect
-
2468 // it to have been authorized by the domain. This could be because the
-
2469 // credentials used to create the MPToken have expired or been deleted.
-
2470 return expired ? tecEXPIRED : tecNO_AUTH;
-
2471 }
-
2472 else if (!authorizedByDomain)
-
2473 {
-
2474 // We found an MPToken, but sfDomainID is not set, so this is a classic
-
2475 // MPToken which requires authorization by the token issuer.
-
2476 XRPL_ASSERT(
-
2477 sleToken != nullptr && !maybeDomainID.has_value(),
-
2478 "ripple::enforceMPTokenAuthorization : found MPToken");
-
2479 if (sleToken->isFlag(lsfMPTAuthorized))
-
2480 return tesSUCCESS;
-
2481
-
2482 return tecNO_AUTH;
-
2483 }
-
2484 else if (authorizedByDomain && sleToken != nullptr)
-
2485 {
-
2486 // Found an MPToken, authorized by the domain. Ignore authorization flag
-
2487 // lsfMPTAuthorized because it is meaningless. Return tesSUCCESS
-
2488 XRPL_ASSERT(
-
2489 maybeDomainID.has_value(),
-
2490 "ripple::enforceMPTokenAuthorization : found MPToken for domain");
-
2491 return tesSUCCESS;
-
2492 }
-
2493 else if (authorizedByDomain)
-
2494 {
-
2495 // Could not find MPToken but there should be one because we are
-
2496 // authorized by domain. Proceed to create it, then return tesSUCCESS
-
2497 XRPL_ASSERT(
-
2498 maybeDomainID.has_value() && sleToken == nullptr,
-
2499 "ripple::enforceMPTokenAuthorization : new MPToken for domain");
-
2500 if (auto const err = MPTokenAuthorize::authorize(
-
2501 view,
-
2502 j,
-
2503 {
-
2504 .priorBalance = priorBalance,
-
2505 .mptIssuanceID = mptIssuanceID,
-
2506 .account = account,
-
2507 .flags = 0,
-
2508 });
-
2509 !isTesSuccess(err))
-
2510 return err;
-
2511
-
2512 return tesSUCCESS;
-
2513 }
-
2514
-
2515 // LCOV_EXCL_START
-
2516 UNREACHABLE(
-
2517 "ripple::enforceMPTokenAuthorization : condition list is incomplete");
-
2518 return tefINTERNAL;
-
2519} // LCOV_EXCL_STOP
+
2456 if (depth >= maxAssetCheckDepth)
+
2457 return tecINTERNAL; // LCOV_EXCL_LINE
+
2458
+
2459 // requireAuth is recursive if the issuer is a vault pseudo-account
+
2460 auto const sleIssuer = view.read(keylet::account(mptIssuer));
+
2461 if (!sleIssuer)
+
2462 return tefINTERNAL; // LCOV_EXCL_LINE
+
2463
+
2464 if (sleIssuer->isFieldPresent(sfVaultID))
+
2465 {
+
2466 auto const sleVault =
+
2467 view.read(keylet::vault(sleIssuer->getFieldH256(sfVaultID)));
+
2468 if (!sleVault)
+
2469 return tefINTERNAL; // LCOV_EXCL_LINE
+
2470
+
2471 auto const asset = sleVault->at(sfAsset);
+
2472 if (auto const err = std::visit(
+
2473 [&]<ValidIssueType TIss>(TIss const& issue) {
+
2474 if constexpr (std::is_same_v<TIss, Issue>)
+
2475 return requireAuth(view, issue, account, authType);
+
2476 else
+
2477 return requireAuth(
+
2478 view, issue, account, authType, depth + 1);
+
2479 },
+
2480 asset.value());
+
2481 !isTesSuccess(err))
+
2482 return err;
+
2483 }
+
2484 }
+
2485
+
2486 auto const mptokenID = keylet::mptoken(mptID.key, account);
+
2487 auto const sleToken = view.read(mptokenID);
+
2488
+
2489 // if account has no MPToken, fail
+
2490 if (!sleToken &&
+
2491 (authType == AuthType::StrongAuth || authType == AuthType::Legacy))
+
2492 return tecNO_AUTH;
+
2493
+
2494 // Note, this check is not amendment-gated because DomainID will be always
+
2495 // empty **unless** writing to it has been enabled by an amendment
+
2496 auto const maybeDomainID = sleIssuance->at(~sfDomainID);
+
2497 if (maybeDomainID)
+
2498 {
+
2499 XRPL_ASSERT(
+
2500 sleIssuance->getFieldU32(sfFlags) & lsfMPTRequireAuth,
+
2501 "ripple::requireAuth : issuance requires authorization");
+
2502 // ter = tefINTERNAL | tecOBJECT_NOT_FOUND | tecNO_AUTH | tecEXPIRED
+
2503 if (auto const ter =
+
2504 credentials::validDomain(view, *maybeDomainID, account);
+
2505 isTesSuccess(ter))
+
2506 return ter; // Note: sleToken might be null
+
2507 else if (!sleToken)
+
2508 return ter;
+
2509 // We ignore error from validDomain if we found sleToken, as it could
+
2510 // belong to someone who is explicitly authorized e.g. a vault owner.
+
2511 }
+
2512
+
2513 // mptoken must be authorized if issuance enabled requireAuth
+
2514 if (sleIssuance->isFlag(lsfMPTRequireAuth) &&
+
2515 (!sleToken || !sleToken->isFlag(lsfMPTAuthorized)))
+
2516 return tecNO_AUTH;
+
2517
+
2518 return tesSUCCESS; // Note: sleToken might be null
+
2519}
2520
-
2521TER
-
2522canTransfer(
-
2523 ReadView const& view,
-
2524 MPTIssue const& mptIssue,
-
2525 AccountID const& from,
-
2526 AccountID const& to)
-
2527{
-
2528 auto const mptID = keylet::mptIssuance(mptIssue.getMptID());
-
2529 auto const sleIssuance = view.read(mptID);
+
2521[[nodiscard]] TER
+
2522enforceMPTokenAuthorization(
+
2523 ApplyView& view,
+
2524 MPTID const& mptIssuanceID,
+
2525 AccountID const& account,
+
2526 XRPAmount const& priorBalance, // for MPToken authorization
+
2527 beast::Journal j)
+
2528{
+
2529 auto const sleIssuance = view.read(keylet::mptIssuance(mptIssuanceID));
2530 if (!sleIssuance)
-
2531 return tecOBJECT_NOT_FOUND;
+
2531 return tefINTERNAL; // LCOV_EXCL_LINE
2532
-
2533 if (!(sleIssuance->getFieldU32(sfFlags) & lsfMPTCanTransfer))
-
2534 {
-
2535 if (from != (*sleIssuance)[sfIssuer] && to != (*sleIssuance)[sfIssuer])
-
2536 return TER{tecNO_AUTH};
-
2537 }
-
2538 return tesSUCCESS;
-
2539}
-
2540
-
2541TER
-
2542cleanupOnAccountDelete(
-
2543 ApplyView& view,
-
2544 Keylet const& ownerDirKeylet,
-
2545 EntryDeleter const& deleter,
-
2546 beast::Journal j,
-
2547 std::optional<uint16_t> maxNodesToDelete)
-
2548{
-
2549 // Delete all the entries in the account directory.
-
2550 std::shared_ptr<SLE> sleDirNode{};
-
2551 unsigned int uDirEntry{0};
-
2552 uint256 dirEntry{beast::zero};
-
2553 std::uint32_t deleted = 0;
-
2554
-
2555 if (view.exists(ownerDirKeylet) &&
-
2556 dirFirst(view, ownerDirKeylet.key, sleDirNode, uDirEntry, dirEntry))
-
2557 {
-
2558 do
-
2559 {
-
2560 if (maxNodesToDelete && ++deleted > *maxNodesToDelete)
-
2561 return tecINCOMPLETE;
-
2562
-
2563 // Choose the right way to delete each directory node.
-
2564 auto sleItem = view.peek(keylet::child(dirEntry));
-
2565 if (!sleItem)
-
2566 {
-
2567 // Directory node has an invalid index. Bail out.
-
2568 JLOG(j.fatal())
-
2569 << "DeleteAccount: Directory node in ledger " << view.seq()
-
2570 << " has index to object that is missing: "
-
2571 << to_string(dirEntry);
-
2572 return tefBAD_LEDGER;
-
2573 }
-
2574
-
2575 LedgerEntryType const nodeType{safe_cast<LedgerEntryType>(
-
2576 sleItem->getFieldU16(sfLedgerEntryType))};
-
2577
-
2578 // Deleter handles the details of specific account-owned object
-
2579 // deletion
-
2580 auto const [ter, skipEntry] = deleter(nodeType, dirEntry, sleItem);
-
2581 if (ter != tesSUCCESS)
-
2582 return ter;
-
2583
-
2584 // dirFirst() and dirNext() are like iterators with exposed
-
2585 // internal state. We'll take advantage of that exposed state
-
2586 // to solve a common C++ problem: iterator invalidation while
-
2587 // deleting elements from a container.
-
2588 //
-
2589 // We have just deleted one directory entry, which means our
-
2590 // "iterator state" is invalid.
-
2591 //
-
2592 // 1. During the process of getting an entry from the
-
2593 // directory uDirEntry was incremented from 'it' to 'it'+1.
-
2594 //
-
2595 // 2. We then deleted the entry at index 'it', which means the
-
2596 // entry that was at 'it'+1 has now moved to 'it'.
-
2597 //
-
2598 // 3. So we verify that uDirEntry is indeed 'it'+1. Then we jam it
-
2599 // back to 'it' to "un-invalidate" the iterator.
-
2600 XRPL_ASSERT(
-
2601 uDirEntry >= 1,
-
2602 "ripple::cleanupOnAccountDelete : minimum dir entries");
-
2603 if (uDirEntry == 0)
-
2604 {
-
2605 JLOG(j.error())
-
2606 << "DeleteAccount iterator re-validation failed.";
-
2607 return tefBAD_LEDGER;
-
2608 }
-
2609 if (skipEntry == SkipEntry::No)
-
2610 uDirEntry--;
+
2533 XRPL_ASSERT(
+
2534 sleIssuance->isFlag(lsfMPTRequireAuth),
+
2535 "ripple::enforceMPTokenAuthorization : authorization required");
+
2536
+
2537 if (account == sleIssuance->at(sfIssuer))
+
2538 return tefINTERNAL; // LCOV_EXCL_LINE
+
2539
+
2540 auto const keylet = keylet::mptoken(mptIssuanceID, account);
+
2541 auto const sleToken = view.read(keylet); // NOTE: might be null
+
2542 auto const maybeDomainID = sleIssuance->at(~sfDomainID);
+
2543 bool expired = false;
+
2544 bool const authorizedByDomain = [&]() -> bool {
+
2545 // NOTE: defensive here, shuld be checked in preclaim
+
2546 if (!maybeDomainID.has_value())
+
2547 return false; // LCOV_EXCL_LINE
+
2548
+
2549 auto const ter = verifyValidDomain(view, account, *maybeDomainID, j);
+
2550 if (isTesSuccess(ter))
+
2551 return true;
+
2552 if (ter == tecEXPIRED)
+
2553 expired = true;
+
2554 return false;
+
2555 }();
+
2556
+
2557 if (!authorizedByDomain && sleToken == nullptr)
+
2558 {
+
2559 // Could not find MPToken and won't create one, could be either of:
+
2560 //
+
2561 // 1. Field sfDomainID not set in MPTokenIssuance or
+
2562 // 2. Account has no matching and accepted credentials or
+
2563 // 3. Account has all expired credentials (deleted in verifyValidDomain)
+
2564 //
+
2565 // Either way, return tecNO_AUTH and there is nothing else to do
+
2566 return expired ? tecEXPIRED : tecNO_AUTH;
+
2567 }
+
2568 else if (!authorizedByDomain && maybeDomainID.has_value())
+
2569 {
+
2570 // Found an MPToken but the account is not authorized and we expect
+
2571 // it to have been authorized by the domain. This could be because the
+
2572 // credentials used to create the MPToken have expired or been deleted.
+
2573 return expired ? tecEXPIRED : tecNO_AUTH;
+
2574 }
+
2575 else if (!authorizedByDomain)
+
2576 {
+
2577 // We found an MPToken, but sfDomainID is not set, so this is a classic
+
2578 // MPToken which requires authorization by the token issuer.
+
2579 XRPL_ASSERT(
+
2580 sleToken != nullptr && !maybeDomainID.has_value(),
+
2581 "ripple::enforceMPTokenAuthorization : found MPToken");
+
2582 if (sleToken->isFlag(lsfMPTAuthorized))
+
2583 return tesSUCCESS;
+
2584
+
2585 return tecNO_AUTH;
+
2586 }
+
2587 else if (authorizedByDomain && sleToken != nullptr)
+
2588 {
+
2589 // Found an MPToken, authorized by the domain. Ignore authorization flag
+
2590 // lsfMPTAuthorized because it is meaningless. Return tesSUCCESS
+
2591 XRPL_ASSERT(
+
2592 maybeDomainID.has_value(),
+
2593 "ripple::enforceMPTokenAuthorization : found MPToken for domain");
+
2594 return tesSUCCESS;
+
2595 }
+
2596 else if (authorizedByDomain)
+
2597 {
+
2598 // Could not find MPToken but there should be one because we are
+
2599 // authorized by domain. Proceed to create it, then return tesSUCCESS
+
2600 XRPL_ASSERT(
+
2601 maybeDomainID.has_value() && sleToken == nullptr,
+
2602 "ripple::enforceMPTokenAuthorization : new MPToken for domain");
+
2603 if (auto const err = authorizeMPToken(
+
2604 view,
+
2605 priorBalance, // priorBalance
+
2606 mptIssuanceID, // mptIssuanceID
+
2607 account, // account
+
2608 j);
+
2609 !isTesSuccess(err))
+
2610 return err;
2611
-
2612 } while (
-
2613 dirNext(view, ownerDirKeylet.key, sleDirNode, uDirEntry, dirEntry));
-
2614 }
-
2615
-
2616 return tesSUCCESS;
-
2617}
-
2618
-
2619TER
-
2620deleteAMMTrustLine(
-
2621 ApplyView& view,
-
2622 std::shared_ptr<SLE> sleState,
-
2623 std::optional<AccountID> const& ammAccountID,
-
2624 beast::Journal j)
-
2625{
-
2626 if (!sleState || sleState->getType() != ltRIPPLE_STATE)
-
2627 return tecINTERNAL;
-
2628
-
2629 auto const& [low, high] = std::minmax(
-
2630 sleState->getFieldAmount(sfLowLimit).getIssuer(),
-
2631 sleState->getFieldAmount(sfHighLimit).getIssuer());
-
2632 auto sleLow = view.peek(keylet::account(low));
-
2633 auto sleHigh = view.peek(keylet::account(high));
-
2634 if (!sleLow || !sleHigh)
-
2635 return tecINTERNAL;
-
2636 bool const ammLow = sleLow->isFieldPresent(sfAMMID);
-
2637 bool const ammHigh = sleHigh->isFieldPresent(sfAMMID);
-
2638
-
2639 // can't both be AMM
-
2640 if (ammLow && ammHigh)
-
2641 return tecINTERNAL;
-
2642
-
2643 // at least one must be
-
2644 if (!ammLow && !ammHigh)
-
2645 return terNO_AMM;
-
2646
-
2647 // one must be the target amm
-
2648 if (ammAccountID && (low != *ammAccountID && high != *ammAccountID))
-
2649 return terNO_AMM;
-
2650
-
2651 if (auto const ter = trustDelete(view, sleState, low, high, j);
-
2652 ter != tesSUCCESS)
-
2653 {
-
2654 JLOG(j.error())
-
2655 << "deleteAMMTrustLine: failed to delete the trustline.";
-
2656 return ter;
-
2657 }
-
2658
-
2659 auto const uFlags = !ammLow ? lsfLowReserve : lsfHighReserve;
-
2660 if (!(sleState->getFlags() & uFlags))
-
2661 return tecINTERNAL;
+
2612 return tesSUCCESS;
+
2613 }
+
2614
+
2615 // LCOV_EXCL_START
+
2616 UNREACHABLE(
+
2617 "ripple::enforceMPTokenAuthorization : condition list is incomplete");
+
2618 return tefINTERNAL;
+
2619} // LCOV_EXCL_STOP
+
2620
+
2621TER
+
2622canTransfer(
+
2623 ReadView const& view,
+
2624 MPTIssue const& mptIssue,
+
2625 AccountID const& from,
+
2626 AccountID const& to)
+
2627{
+
2628 auto const mptID = keylet::mptIssuance(mptIssue.getMptID());
+
2629 auto const sleIssuance = view.read(mptID);
+
2630 if (!sleIssuance)
+
2631 return tecOBJECT_NOT_FOUND;
+
2632
+
2633 if (!(sleIssuance->getFieldU32(sfFlags) & lsfMPTCanTransfer))
+
2634 {
+
2635 if (from != (*sleIssuance)[sfIssuer] && to != (*sleIssuance)[sfIssuer])
+
2636 return TER{tecNO_AUTH};
+
2637 }
+
2638 return tesSUCCESS;
+
2639}
+
2640
+
2641TER
+
2642cleanupOnAccountDelete(
+
2643 ApplyView& view,
+
2644 Keylet const& ownerDirKeylet,
+
2645 EntryDeleter const& deleter,
+
2646 beast::Journal j,
+
2647 std::optional<uint16_t> maxNodesToDelete)
+
2648{
+
2649 // Delete all the entries in the account directory.
+
2650 std::shared_ptr<SLE> sleDirNode{};
+
2651 unsigned int uDirEntry{0};
+
2652 uint256 dirEntry{beast::zero};
+
2653 std::uint32_t deleted = 0;
+
2654
+
2655 if (view.exists(ownerDirKeylet) &&
+
2656 dirFirst(view, ownerDirKeylet.key, sleDirNode, uDirEntry, dirEntry))
+
2657 {
+
2658 do
+
2659 {
+
2660 if (maxNodesToDelete && ++deleted > *maxNodesToDelete)
+
2661 return tecINCOMPLETE;
2662
-
2663 adjustOwnerCount(view, !ammLow ? sleLow : sleHigh, -1, j);
-
2664
-
2665 return tesSUCCESS;
-
2666}
-
2667
-
2668TER
-
2669rippleCredit(
-
2670 ApplyView& view,
-
2671 AccountID const& uSenderID,
-
2672 AccountID const& uReceiverID,
-
2673 STAmount const& saAmount,
-
2674 bool bCheckIssuer,
-
2675 beast::Journal j)
-
2676{
-
2677 return std::visit(
-
2678 [&]<ValidIssueType TIss>(TIss const& issue) {
-
2679 if constexpr (std::is_same_v<TIss, Issue>)
-
2680 {
-
2681 return rippleCreditIOU(
-
2682 view, uSenderID, uReceiverID, saAmount, bCheckIssuer, j);
-
2683 }
-
2684 else
-
2685 {
-
2686 XRPL_ASSERT(
-
2687 !bCheckIssuer,
-
2688 "ripple::rippleCredit : not checking issuer");
-
2689 return rippleCreditMPT(
-
2690 view, uSenderID, uReceiverID, saAmount, j);
-
2691 }
-
2692 },
-
2693 saAmount.asset().value());
-
2694}
-
2695
-
2696[[nodiscard]] STAmount
-
2697assetsToSharesDeposit(
-
2698 std::shared_ptr<SLE const> const& vault,
-
2699 std::shared_ptr<SLE const> const& issuance,
-
2700 STAmount const& assets)
-
2701{
-
2702 XRPL_ASSERT(
-
2703 assets.asset() == vault->at(sfAsset),
-
2704 "ripple::assetsToSharesDeposit : assets and vault match");
-
2705 Number assetTotal = vault->at(sfAssetsTotal);
-
2706 STAmount shares{vault->at(sfShareMPTID), static_cast<Number>(assets)};
-
2707 if (assetTotal == 0)
-
2708 return shares;
-
2709 Number shareTotal = issuance->at(sfOutstandingAmount);
-
2710 shares = shareTotal * (assets / assetTotal);
-
2711 return shares;
-
2712}
-
2713
-
2714[[nodiscard]] STAmount
-
2715assetsToSharesWithdraw(
-
2716 std::shared_ptr<SLE const> const& vault,
-
2717 std::shared_ptr<SLE const> const& issuance,
-
2718 STAmount const& assets)
-
2719{
-
2720 XRPL_ASSERT(
-
2721 assets.asset() == vault->at(sfAsset),
-
2722 "ripple::assetsToSharesWithdraw : assets and vault match");
-
2723 Number assetTotal = vault->at(sfAssetsTotal);
-
2724 assetTotal -= vault->at(sfLossUnrealized);
-
2725 STAmount shares{vault->at(sfShareMPTID)};
-
2726 if (assetTotal == 0)
-
2727 return shares;
-
2728 Number shareTotal = issuance->at(sfOutstandingAmount);
-
2729 shares = shareTotal * (assets / assetTotal);
-
2730 return shares;
-
2731}
-
2732
-
2733[[nodiscard]] STAmount
-
2734sharesToAssetsWithdraw(
-
2735 std::shared_ptr<SLE const> const& vault,
-
2736 std::shared_ptr<SLE const> const& issuance,
-
2737 STAmount const& shares)
-
2738{
-
2739 XRPL_ASSERT(
-
2740 shares.asset() == vault->at(sfShareMPTID),
-
2741 "ripple::sharesToAssetsWithdraw : shares and vault match");
-
2742 Number assetTotal = vault->at(sfAssetsTotal);
-
2743 assetTotal -= vault->at(sfLossUnrealized);
-
2744 STAmount assets{vault->at(sfAsset)};
-
2745 if (assetTotal == 0)
-
2746 return assets;
-
2747 Number shareTotal = issuance->at(sfOutstandingAmount);
-
2748 assets = assetTotal * (shares / shareTotal);
-
2749 return assets;
-
2750}
-
2751
-
2752TER
-
2753rippleLockEscrowMPT(
-
2754 ApplyView& view,
-
2755 AccountID const& sender,
-
2756 STAmount const& amount,
-
2757 beast::Journal j)
-
2758{
-
2759 auto const mptIssue = amount.get<MPTIssue>();
-
2760 auto const mptID = keylet::mptIssuance(mptIssue.getMptID());
-
2761 auto sleIssuance = view.peek(mptID);
-
2762 if (!sleIssuance)
-
2763 { // LCOV_EXCL_START
-
2764 JLOG(j.error()) << "rippleLockEscrowMPT: MPT issuance not found for "
-
2765 << mptIssue.getMptID();
-
2766 return tecOBJECT_NOT_FOUND;
-
2767 } // LCOV_EXCL_STOP
-
2768
-
2769 if (amount.getIssuer() == sender)
-
2770 { // LCOV_EXCL_START
-
2771 JLOG(j.error())
-
2772 << "rippleLockEscrowMPT: sender is the issuer, cannot lock MPTs.";
-
2773 return tecINTERNAL;
-
2774 } // LCOV_EXCL_STOP
-
2775
-
2776 // 1. Decrease the MPT Holder MPTAmount
-
2777 // 2. Increase the MPT Holder EscrowedAmount
-
2778 {
-
2779 auto const mptokenID = keylet::mptoken(mptID.key, sender);
-
2780 auto sle = view.peek(mptokenID);
-
2781 if (!sle)
-
2782 { // LCOV_EXCL_START
-
2783 JLOG(j.error())
-
2784 << "rippleLockEscrowMPT: MPToken not found for " << sender;
-
2785 return tecOBJECT_NOT_FOUND;
-
2786 } // LCOV_EXCL_STOP
-
2787
-
2788 auto const amt = sle->getFieldU64(sfMPTAmount);
-
2789 auto const pay = amount.mpt().value();
-
2790
-
2791 // Underflow check for subtraction
-
2792 if (!canSubtract(STAmount(mptIssue, amt), STAmount(mptIssue, pay)))
-
2793 { // LCOV_EXCL_START
-
2794 JLOG(j.error())
-
2795 << "rippleLockEscrowMPT: insufficient MPTAmount for "
-
2796 << to_string(sender) << ": " << amt << " < " << pay;
-
2797 return tecINTERNAL;
-
2798 } // LCOV_EXCL_STOP
-
2799
-
2800 (*sle)[sfMPTAmount] = amt - pay;
-
2801
-
2802 // Overflow check for addition
-
2803 uint64_t const locked = (*sle)[~sfLockedAmount].value_or(0);
-
2804
-
2805 if (!canAdd(STAmount(mptIssue, locked), STAmount(mptIssue, pay)))
-
2806 { // LCOV_EXCL_START
-
2807 JLOG(j.error())
-
2808 << "rippleLockEscrowMPT: overflow on locked amount for "
-
2809 << to_string(sender) << ": " << locked << " + " << pay;
-
2810 return tecINTERNAL;
-
2811 } // LCOV_EXCL_STOP
-
2812
-
2813 if (sle->isFieldPresent(sfLockedAmount))
-
2814 (*sle)[sfLockedAmount] += pay;
-
2815 else
-
2816 sle->setFieldU64(sfLockedAmount, pay);
-
2817
-
2818 view.update(sle);
-
2819 }
-
2820
-
2821 // 1. Increase the Issuance EscrowedAmount
-
2822 // 2. DO NOT change the Issuance OutstandingAmount
-
2823 {
-
2824 uint64_t const issuanceEscrowed =
-
2825 (*sleIssuance)[~sfLockedAmount].value_or(0);
-
2826 auto const pay = amount.mpt().value();
-
2827
-
2828 // Overflow check for addition
-
2829 if (!canAdd(
-
2830 STAmount(mptIssue, issuanceEscrowed), STAmount(mptIssue, pay)))
-
2831 { // LCOV_EXCL_START
-
2832 JLOG(j.error()) << "rippleLockEscrowMPT: overflow on issuance "
-
2833 "locked amount for "
-
2834 << mptIssue.getMptID() << ": " << issuanceEscrowed
-
2835 << " + " << pay;
-
2836 return tecINTERNAL;
-
2837 } // LCOV_EXCL_STOP
-
2838
-
2839 if (sleIssuance->isFieldPresent(sfLockedAmount))
-
2840 (*sleIssuance)[sfLockedAmount] += pay;
-
2841 else
-
2842 sleIssuance->setFieldU64(sfLockedAmount, pay);
-
2843
-
2844 view.update(sleIssuance);
-
2845 }
-
2846 return tesSUCCESS;
-
2847}
-
2848
-
2849TER
-
2850rippleUnlockEscrowMPT(
-
2851 ApplyView& view,
-
2852 AccountID const& sender,
-
2853 AccountID const& receiver,
-
2854 STAmount const& amount,
-
2855 beast::Journal j)
-
2856{
-
2857 auto const issuer = amount.getIssuer();
-
2858 auto const mptIssue = amount.get<MPTIssue>();
-
2859 auto const mptID = keylet::mptIssuance(mptIssue.getMptID());
-
2860 auto sleIssuance = view.peek(mptID);
-
2861 if (!sleIssuance)
-
2862 { // LCOV_EXCL_START
-
2863 JLOG(j.error()) << "rippleUnlockEscrowMPT: MPT issuance not found for "
-
2864 << mptIssue.getMptID();
-
2865 return tecOBJECT_NOT_FOUND;
-
2866 } // LCOV_EXCL_STOP
-
2867
-
2868 // Decrease the Issuance EscrowedAmount
-
2869 {
-
2870 if (!sleIssuance->isFieldPresent(sfLockedAmount))
-
2871 { // LCOV_EXCL_START
-
2872 JLOG(j.error())
-
2873 << "rippleUnlockEscrowMPT: no locked amount in issuance for "
-
2874 << mptIssue.getMptID();
-
2875 return tecINTERNAL;
-
2876 } // LCOV_EXCL_STOP
-
2877
-
2878 auto const locked = sleIssuance->getFieldU64(sfLockedAmount);
-
2879 auto const redeem = amount.mpt().value();
-
2880
-
2881 // Underflow check for subtraction
-
2882 if (!canSubtract(
-
2883 STAmount(mptIssue, locked), STAmount(mptIssue, redeem)))
-
2884 { // LCOV_EXCL_START
-
2885 JLOG(j.error())
-
2886 << "rippleUnlockEscrowMPT: insufficient locked amount for "
-
2887 << mptIssue.getMptID() << ": " << locked << " < " << redeem;
-
2888 return tecINTERNAL;
-
2889 } // LCOV_EXCL_STOP
+
2663 // Choose the right way to delete each directory node.
+
2664 auto sleItem = view.peek(keylet::child(dirEntry));
+
2665 if (!sleItem)
+
2666 {
+
2667 // Directory node has an invalid index. Bail out.
+
2668 JLOG(j.fatal())
+
2669 << "DeleteAccount: Directory node in ledger " << view.seq()
+
2670 << " has index to object that is missing: "
+
2671 << to_string(dirEntry);
+
2672 return tefBAD_LEDGER;
+
2673 }
+
2674
+
2675 LedgerEntryType const nodeType{safe_cast<LedgerEntryType>(
+
2676 sleItem->getFieldU16(sfLedgerEntryType))};
+
2677
+
2678 // Deleter handles the details of specific account-owned object
+
2679 // deletion
+
2680 auto const [ter, skipEntry] = deleter(nodeType, dirEntry, sleItem);
+
2681 if (ter != tesSUCCESS)
+
2682 return ter;
+
2683
+
2684 // dirFirst() and dirNext() are like iterators with exposed
+
2685 // internal state. We'll take advantage of that exposed state
+
2686 // to solve a common C++ problem: iterator invalidation while
+
2687 // deleting elements from a container.
+
2688 //
+
2689 // We have just deleted one directory entry, which means our
+
2690 // "iterator state" is invalid.
+
2691 //
+
2692 // 1. During the process of getting an entry from the
+
2693 // directory uDirEntry was incremented from 'it' to 'it'+1.
+
2694 //
+
2695 // 2. We then deleted the entry at index 'it', which means the
+
2696 // entry that was at 'it'+1 has now moved to 'it'.
+
2697 //
+
2698 // 3. So we verify that uDirEntry is indeed 'it'+1. Then we jam it
+
2699 // back to 'it' to "un-invalidate" the iterator.
+
2700 XRPL_ASSERT(
+
2701 uDirEntry >= 1,
+
2702 "ripple::cleanupOnAccountDelete : minimum dir entries");
+
2703 if (uDirEntry == 0)
+
2704 {
+
2705 JLOG(j.error())
+
2706 << "DeleteAccount iterator re-validation failed.";
+
2707 return tefBAD_LEDGER;
+
2708 }
+
2709 if (skipEntry == SkipEntry::No)
+
2710 uDirEntry--;
+
2711
+
2712 } while (
+
2713 dirNext(view, ownerDirKeylet.key, sleDirNode, uDirEntry, dirEntry));
+
2714 }
+
2715
+
2716 return tesSUCCESS;
+
2717}
+
2718
+
2719TER
+
2720deleteAMMTrustLine(
+
2721 ApplyView& view,
+
2722 std::shared_ptr<SLE> sleState,
+
2723 std::optional<AccountID> const& ammAccountID,
+
2724 beast::Journal j)
+
2725{
+
2726 if (!sleState || sleState->getType() != ltRIPPLE_STATE)
+
2727 return tecINTERNAL;
+
2728
+
2729 auto const& [low, high] = std::minmax(
+
2730 sleState->getFieldAmount(sfLowLimit).getIssuer(),
+
2731 sleState->getFieldAmount(sfHighLimit).getIssuer());
+
2732 auto sleLow = view.peek(keylet::account(low));
+
2733 auto sleHigh = view.peek(keylet::account(high));
+
2734 if (!sleLow || !sleHigh)
+
2735 return tecINTERNAL;
+
2736 bool const ammLow = sleLow->isFieldPresent(sfAMMID);
+
2737 bool const ammHigh = sleHigh->isFieldPresent(sfAMMID);
+
2738
+
2739 // can't both be AMM
+
2740 if (ammLow && ammHigh)
+
2741 return tecINTERNAL;
+
2742
+
2743 // at least one must be
+
2744 if (!ammLow && !ammHigh)
+
2745 return terNO_AMM;
+
2746
+
2747 // one must be the target amm
+
2748 if (ammAccountID && (low != *ammAccountID && high != *ammAccountID))
+
2749 return terNO_AMM;
+
2750
+
2751 if (auto const ter = trustDelete(view, sleState, low, high, j);
+
2752 ter != tesSUCCESS)
+
2753 {
+
2754 JLOG(j.error())
+
2755 << "deleteAMMTrustLine: failed to delete the trustline.";
+
2756 return ter;
+
2757 }
+
2758
+
2759 auto const uFlags = !ammLow ? lsfLowReserve : lsfHighReserve;
+
2760 if (!(sleState->getFlags() & uFlags))
+
2761 return tecINTERNAL;
+
2762
+
2763 adjustOwnerCount(view, !ammLow ? sleLow : sleHigh, -1, j);
+
2764
+
2765 return tesSUCCESS;
+
2766}
+
2767
+
2768TER
+
2769rippleCredit(
+
2770 ApplyView& view,
+
2771 AccountID const& uSenderID,
+
2772 AccountID const& uReceiverID,
+
2773 STAmount const& saAmount,
+
2774 bool bCheckIssuer,
+
2775 beast::Journal j)
+
2776{
+
2777 return std::visit(
+
2778 [&]<ValidIssueType TIss>(TIss const& issue) {
+
2779 if constexpr (std::is_same_v<TIss, Issue>)
+
2780 {
+
2781 return rippleCreditIOU(
+
2782 view, uSenderID, uReceiverID, saAmount, bCheckIssuer, j);
+
2783 }
+
2784 else
+
2785 {
+
2786 XRPL_ASSERT(
+
2787 !bCheckIssuer,
+
2788 "ripple::rippleCredit : not checking issuer");
+
2789 return rippleCreditMPT(
+
2790 view, uSenderID, uReceiverID, saAmount, j);
+
2791 }
+
2792 },
+
2793 saAmount.asset().value());
+
2794}
+
2795
+
2796[[nodiscard]] STAmount
+
2797assetsToSharesDeposit(
+
2798 std::shared_ptr<SLE const> const& vault,
+
2799 std::shared_ptr<SLE const> const& issuance,
+
2800 STAmount const& assets)
+
2801{
+
2802 XRPL_ASSERT(
+
2803 assets.asset() == vault->at(sfAsset),
+
2804 "ripple::assetsToSharesDeposit : assets and vault match");
+
2805 Number assetTotal = vault->at(sfAssetsTotal);
+
2806 STAmount shares{vault->at(sfShareMPTID), static_cast<Number>(assets)};
+
2807 if (assetTotal == 0)
+
2808 return shares;
+
2809 Number shareTotal = issuance->at(sfOutstandingAmount);
+
2810 shares = shareTotal * (assets / assetTotal);
+
2811 return shares;
+
2812}
+
2813
+
2814[[nodiscard]] STAmount
+
2815assetsToSharesWithdraw(
+
2816 std::shared_ptr<SLE const> const& vault,
+
2817 std::shared_ptr<SLE const> const& issuance,
+
2818 STAmount const& assets)
+
2819{
+
2820 XRPL_ASSERT(
+
2821 assets.asset() == vault->at(sfAsset),
+
2822 "ripple::assetsToSharesWithdraw : assets and vault match");
+
2823 Number assetTotal = vault->at(sfAssetsTotal);
+
2824 assetTotal -= vault->at(sfLossUnrealized);
+
2825 STAmount shares{vault->at(sfShareMPTID)};
+
2826 if (assetTotal == 0)
+
2827 return shares;
+
2828 Number shareTotal = issuance->at(sfOutstandingAmount);
+
2829 shares = shareTotal * (assets / assetTotal);
+
2830 return shares;
+
2831}
+
2832
+
2833[[nodiscard]] STAmount
+
2834sharesToAssetsWithdraw(
+
2835 std::shared_ptr<SLE const> const& vault,
+
2836 std::shared_ptr<SLE const> const& issuance,
+
2837 STAmount const& shares)
+
2838{
+
2839 XRPL_ASSERT(
+
2840 shares.asset() == vault->at(sfShareMPTID),
+
2841 "ripple::sharesToAssetsWithdraw : shares and vault match");
+
2842 Number assetTotal = vault->at(sfAssetsTotal);
+
2843 assetTotal -= vault->at(sfLossUnrealized);
+
2844 STAmount assets{vault->at(sfAsset)};
+
2845 if (assetTotal == 0)
+
2846 return assets;
+
2847 Number shareTotal = issuance->at(sfOutstandingAmount);
+
2848 assets = assetTotal * (shares / shareTotal);
+
2849 return assets;
+
2850}
+
2851
+
2852TER
+
2853rippleLockEscrowMPT(
+
2854 ApplyView& view,
+
2855 AccountID const& sender,
+
2856 STAmount const& amount,
+
2857 beast::Journal j)
+
2858{
+
2859 auto const mptIssue = amount.get<MPTIssue>();
+
2860 auto const mptID = keylet::mptIssuance(mptIssue.getMptID());
+
2861 auto sleIssuance = view.peek(mptID);
+
2862 if (!sleIssuance)
+
2863 { // LCOV_EXCL_START
+
2864 JLOG(j.error()) << "rippleLockEscrowMPT: MPT issuance not found for "
+
2865 << mptIssue.getMptID();
+
2866 return tecOBJECT_NOT_FOUND;
+
2867 } // LCOV_EXCL_STOP
+
2868
+
2869 if (amount.getIssuer() == sender)
+
2870 { // LCOV_EXCL_START
+
2871 JLOG(j.error())
+
2872 << "rippleLockEscrowMPT: sender is the issuer, cannot lock MPTs.";
+
2873 return tecINTERNAL;
+
2874 } // LCOV_EXCL_STOP
+
2875
+
2876 // 1. Decrease the MPT Holder MPTAmount
+
2877 // 2. Increase the MPT Holder EscrowedAmount
+
2878 {
+
2879 auto const mptokenID = keylet::mptoken(mptID.key, sender);
+
2880 auto sle = view.peek(mptokenID);
+
2881 if (!sle)
+
2882 { // LCOV_EXCL_START
+
2883 JLOG(j.error())
+
2884 << "rippleLockEscrowMPT: MPToken not found for " << sender;
+
2885 return tecOBJECT_NOT_FOUND;
+
2886 } // LCOV_EXCL_STOP
+
2887
+
2888 auto const amt = sle->getFieldU64(sfMPTAmount);
+
2889 auto const pay = amount.mpt().value();
2890
-
2891 auto const newLocked = locked - redeem;
-
2892 if (newLocked == 0)
-
2893 sleIssuance->makeFieldAbsent(sfLockedAmount);
-
2894 else
-
2895 sleIssuance->setFieldU64(sfLockedAmount, newLocked);
-
2896 view.update(sleIssuance);
-
2897 }
-
2898
-
2899 if (issuer != receiver)
-
2900 {
-
2901 // Increase the MPT Holder MPTAmount
-
2902 auto const mptokenID = keylet::mptoken(mptID.key, receiver);
-
2903 auto sle = view.peek(mptokenID);
-
2904 if (!sle)
-
2905 { // LCOV_EXCL_START
-
2906 JLOG(j.error())
-
2907 << "rippleUnlockEscrowMPT: MPToken not found for " << receiver;
-
2908 return tecOBJECT_NOT_FOUND; // LCOV_EXCL_LINE
-
2909 } // LCOV_EXCL_STOP
-
2910
-
2911 auto current = sle->getFieldU64(sfMPTAmount);
-
2912 auto delta = amount.mpt().value();
-
2913
-
2914 // Overflow check for addition
-
2915 if (!canAdd(STAmount(mptIssue, current), STAmount(mptIssue, delta)))
-
2916 { // LCOV_EXCL_START
-
2917 JLOG(j.error())
-
2918 << "rippleUnlockEscrowMPT: overflow on MPTAmount for "
-
2919 << to_string(receiver) << ": " << current << " + " << delta;
-
2920 return tecINTERNAL;
-
2921 } // LCOV_EXCL_STOP
-
2922
-
2923 (*sle)[sfMPTAmount] += delta;
-
2924 view.update(sle);
-
2925 }
-
2926 else
-
2927 {
-
2928 // Decrease the Issuance OutstandingAmount
-
2929 auto const outstanding = sleIssuance->getFieldU64(sfOutstandingAmount);
-
2930 auto const redeem = amount.mpt().value();
-
2931
-
2932 // Underflow check for subtraction
-
2933 if (!canSubtract(
-
2934 STAmount(mptIssue, outstanding), STAmount(mptIssue, redeem)))
-
2935 { // LCOV_EXCL_START
-
2936 JLOG(j.error())
-
2937 << "rippleUnlockEscrowMPT: insufficient outstanding amount for "
-
2938 << mptIssue.getMptID() << ": " << outstanding << " < "
-
2939 << redeem;
-
2940 return tecINTERNAL;
-
2941 } // LCOV_EXCL_STOP
-
2942
-
2943 sleIssuance->setFieldU64(sfOutstandingAmount, outstanding - redeem);
+
2891 // Underflow check for subtraction
+
2892 if (!canSubtract(STAmount(mptIssue, amt), STAmount(mptIssue, pay)))
+
2893 { // LCOV_EXCL_START
+
2894 JLOG(j.error())
+
2895 << "rippleLockEscrowMPT: insufficient MPTAmount for "
+
2896 << to_string(sender) << ": " << amt << " < " << pay;
+
2897 return tecINTERNAL;
+
2898 } // LCOV_EXCL_STOP
+
2899
+
2900 (*sle)[sfMPTAmount] = amt - pay;
+
2901
+
2902 // Overflow check for addition
+
2903 uint64_t const locked = (*sle)[~sfLockedAmount].value_or(0);
+
2904
+
2905 if (!canAdd(STAmount(mptIssue, locked), STAmount(mptIssue, pay)))
+
2906 { // LCOV_EXCL_START
+
2907 JLOG(j.error())
+
2908 << "rippleLockEscrowMPT: overflow on locked amount for "
+
2909 << to_string(sender) << ": " << locked << " + " << pay;
+
2910 return tecINTERNAL;
+
2911 } // LCOV_EXCL_STOP
+
2912
+
2913 if (sle->isFieldPresent(sfLockedAmount))
+
2914 (*sle)[sfLockedAmount] += pay;
+
2915 else
+
2916 sle->setFieldU64(sfLockedAmount, pay);
+
2917
+
2918 view.update(sle);
+
2919 }
+
2920
+
2921 // 1. Increase the Issuance EscrowedAmount
+
2922 // 2. DO NOT change the Issuance OutstandingAmount
+
2923 {
+
2924 uint64_t const issuanceEscrowed =
+
2925 (*sleIssuance)[~sfLockedAmount].value_or(0);
+
2926 auto const pay = amount.mpt().value();
+
2927
+
2928 // Overflow check for addition
+
2929 if (!canAdd(
+
2930 STAmount(mptIssue, issuanceEscrowed), STAmount(mptIssue, pay)))
+
2931 { // LCOV_EXCL_START
+
2932 JLOG(j.error()) << "rippleLockEscrowMPT: overflow on issuance "
+
2933 "locked amount for "
+
2934 << mptIssue.getMptID() << ": " << issuanceEscrowed
+
2935 << " + " << pay;
+
2936 return tecINTERNAL;
+
2937 } // LCOV_EXCL_STOP
+
2938
+
2939 if (sleIssuance->isFieldPresent(sfLockedAmount))
+
2940 (*sleIssuance)[sfLockedAmount] += pay;
+
2941 else
+
2942 sleIssuance->setFieldU64(sfLockedAmount, pay);
+
2943
2944 view.update(sleIssuance);
2945 }
-
2946
-
2947 if (issuer == sender)
-
2948 { // LCOV_EXCL_START
-
2949 JLOG(j.error()) << "rippleUnlockEscrowMPT: sender is the issuer, "
-
2950 "cannot unlock MPTs.";
-
2951 return tecINTERNAL;
-
2952 } // LCOV_EXCL_STOP
-
2953 else
-
2954 {
-
2955 // Decrease the MPT Holder EscrowedAmount
-
2956 auto const mptokenID = keylet::mptoken(mptID.key, sender);
-
2957 auto sle = view.peek(mptokenID);
-
2958 if (!sle)
-
2959 { // LCOV_EXCL_START
-
2960 JLOG(j.error())
-
2961 << "rippleUnlockEscrowMPT: MPToken not found for " << sender;
-
2962 return tecOBJECT_NOT_FOUND;
-
2963 } // LCOV_EXCL_STOP
-
2964
-
2965 if (!sle->isFieldPresent(sfLockedAmount))
-
2966 { // LCOV_EXCL_START
-
2967 JLOG(j.error())
-
2968 << "rippleUnlockEscrowMPT: no locked amount in MPToken for "
-
2969 << to_string(sender);
-
2970 return tecINTERNAL;
-
2971 } // LCOV_EXCL_STOP
-
2972
-
2973 auto const locked = sle->getFieldU64(sfLockedAmount);
-
2974 auto const delta = amount.mpt().value();
-
2975
-
2976 // Underflow check for subtraction
-
2977 // LCOV_EXCL_START
-
2978 if (!canSubtract(STAmount(mptIssue, locked), STAmount(mptIssue, delta)))
-
2979 { // LCOV_EXCL_START
-
2980 JLOG(j.error())
-
2981 << "rippleUnlockEscrowMPT: insufficient locked amount for "
-
2982 << to_string(sender) << ": " << locked << " < " << delta;
-
2983 return tecINTERNAL;
-
2984 } // LCOV_EXCL_STOP
-
2985
-
2986 auto const newLocked = locked - delta;
-
2987 if (newLocked == 0)
-
2988 sle->makeFieldAbsent(sfLockedAmount);
-
2989 else
-
2990 sle->setFieldU64(sfLockedAmount, newLocked);
-
2991 view.update(sle);
-
2992 }
-
2993 return tesSUCCESS;
-
2994}
-
2995
-
2996bool
-
2997after(NetClock::time_point now, std::uint32_t mark)
-
2998{
-
2999 return now.time_since_epoch().count() > mark;
-
3000}
-
3001
-
3002} // namespace ripple
+
2946 return tesSUCCESS;
+
2947}
+
2948
+
2949TER
+
2950rippleUnlockEscrowMPT(
+
2951 ApplyView& view,
+
2952 AccountID const& sender,
+
2953 AccountID const& receiver,
+
2954 STAmount const& amount,
+
2955 beast::Journal j)
+
2956{
+
2957 auto const issuer = amount.getIssuer();
+
2958 auto const mptIssue = amount.get<MPTIssue>();
+
2959 auto const mptID = keylet::mptIssuance(mptIssue.getMptID());
+
2960 auto sleIssuance = view.peek(mptID);
+
2961 if (!sleIssuance)
+
2962 { // LCOV_EXCL_START
+
2963 JLOG(j.error()) << "rippleUnlockEscrowMPT: MPT issuance not found for "
+
2964 << mptIssue.getMptID();
+
2965 return tecOBJECT_NOT_FOUND;
+
2966 } // LCOV_EXCL_STOP
+
2967
+
2968 // Decrease the Issuance EscrowedAmount
+
2969 {
+
2970 if (!sleIssuance->isFieldPresent(sfLockedAmount))
+
2971 { // LCOV_EXCL_START
+
2972 JLOG(j.error())
+
2973 << "rippleUnlockEscrowMPT: no locked amount in issuance for "
+
2974 << mptIssue.getMptID();
+
2975 return tecINTERNAL;
+
2976 } // LCOV_EXCL_STOP
+
2977
+
2978 auto const locked = sleIssuance->getFieldU64(sfLockedAmount);
+
2979 auto const redeem = amount.mpt().value();
+
2980
+
2981 // Underflow check for subtraction
+
2982 if (!canSubtract(
+
2983 STAmount(mptIssue, locked), STAmount(mptIssue, redeem)))
+
2984 { // LCOV_EXCL_START
+
2985 JLOG(j.error())
+
2986 << "rippleUnlockEscrowMPT: insufficient locked amount for "
+
2987 << mptIssue.getMptID() << ": " << locked << " < " << redeem;
+
2988 return tecINTERNAL;
+
2989 } // LCOV_EXCL_STOP
+
2990
+
2991 auto const newLocked = locked - redeem;
+
2992 if (newLocked == 0)
+
2993 sleIssuance->makeFieldAbsent(sfLockedAmount);
+
2994 else
+
2995 sleIssuance->setFieldU64(sfLockedAmount, newLocked);
+
2996 view.update(sleIssuance);
+
2997 }
+
2998
+
2999 if (issuer != receiver)
+
3000 {
+
3001 // Increase the MPT Holder MPTAmount
+
3002 auto const mptokenID = keylet::mptoken(mptID.key, receiver);
+
3003 auto sle = view.peek(mptokenID);
+
3004 if (!sle)
+
3005 { // LCOV_EXCL_START
+
3006 JLOG(j.error())
+
3007 << "rippleUnlockEscrowMPT: MPToken not found for " << receiver;
+
3008 return tecOBJECT_NOT_FOUND; // LCOV_EXCL_LINE
+
3009 } // LCOV_EXCL_STOP
+
3010
+
3011 auto current = sle->getFieldU64(sfMPTAmount);
+
3012 auto delta = amount.mpt().value();
+
3013
+
3014 // Overflow check for addition
+
3015 if (!canAdd(STAmount(mptIssue, current), STAmount(mptIssue, delta)))
+
3016 { // LCOV_EXCL_START
+
3017 JLOG(j.error())
+
3018 << "rippleUnlockEscrowMPT: overflow on MPTAmount for "
+
3019 << to_string(receiver) << ": " << current << " + " << delta;
+
3020 return tecINTERNAL;
+
3021 } // LCOV_EXCL_STOP
+
3022
+
3023 (*sle)[sfMPTAmount] += delta;
+
3024 view.update(sle);
+
3025 }
+
3026 else
+
3027 {
+
3028 // Decrease the Issuance OutstandingAmount
+
3029 auto const outstanding = sleIssuance->getFieldU64(sfOutstandingAmount);
+
3030 auto const redeem = amount.mpt().value();
+
3031
+
3032 // Underflow check for subtraction
+
3033 if (!canSubtract(
+
3034 STAmount(mptIssue, outstanding), STAmount(mptIssue, redeem)))
+
3035 { // LCOV_EXCL_START
+
3036 JLOG(j.error())
+
3037 << "rippleUnlockEscrowMPT: insufficient outstanding amount for "
+
3038 << mptIssue.getMptID() << ": " << outstanding << " < "
+
3039 << redeem;
+
3040 return tecINTERNAL;
+
3041 } // LCOV_EXCL_STOP
+
3042
+
3043 sleIssuance->setFieldU64(sfOutstandingAmount, outstanding - redeem);
+
3044 view.update(sleIssuance);
+
3045 }
+
3046
+
3047 if (issuer == sender)
+
3048 { // LCOV_EXCL_START
+
3049 JLOG(j.error()) << "rippleUnlockEscrowMPT: sender is the issuer, "
+
3050 "cannot unlock MPTs.";
+
3051 return tecINTERNAL;
+
3052 } // LCOV_EXCL_STOP
+
3053 else
+
3054 {
+
3055 // Decrease the MPT Holder EscrowedAmount
+
3056 auto const mptokenID = keylet::mptoken(mptID.key, sender);
+
3057 auto sle = view.peek(mptokenID);
+
3058 if (!sle)
+
3059 { // LCOV_EXCL_START
+
3060 JLOG(j.error())
+
3061 << "rippleUnlockEscrowMPT: MPToken not found for " << sender;
+
3062 return tecOBJECT_NOT_FOUND;
+
3063 } // LCOV_EXCL_STOP
+
3064
+
3065 if (!sle->isFieldPresent(sfLockedAmount))
+
3066 { // LCOV_EXCL_START
+
3067 JLOG(j.error())
+
3068 << "rippleUnlockEscrowMPT: no locked amount in MPToken for "
+
3069 << to_string(sender);
+
3070 return tecINTERNAL;
+
3071 } // LCOV_EXCL_STOP
+
3072
+
3073 auto const locked = sle->getFieldU64(sfLockedAmount);
+
3074 auto const delta = amount.mpt().value();
+
3075
+
3076 // Underflow check for subtraction
+
3077 // LCOV_EXCL_START
+
3078 if (!canSubtract(STAmount(mptIssue, locked), STAmount(mptIssue, delta)))
+
3079 { // LCOV_EXCL_START
+
3080 JLOG(j.error())
+
3081 << "rippleUnlockEscrowMPT: insufficient locked amount for "
+
3082 << to_string(sender) << ": " << locked << " < " << delta;
+
3083 return tecINTERNAL;
+
3084 } // LCOV_EXCL_STOP
+
3085
+
3086 auto const newLocked = locked - delta;
+
3087 if (newLocked == 0)
+
3088 sle->makeFieldAbsent(sfLockedAmount);
+
3089 else
+
3090 sle->setFieldU64(sfLockedAmount, newLocked);
+
3091 view.update(sle);
+
3092 }
+
3093 return tesSUCCESS;
+
3094}
+
3095
+
3096bool
+
3097after(NetClock::time_point now, std::uint32_t mark)
+
3098{
+
3099 return now.time_since_epoch().count() > mark;
+
3100}
+
3101
+
3102} // namespace ripple
std::array
std::string
beast::Journal::Stream
Provide a light-weight way to check active() before string formatting.
Definition: Journal.h:205
@@ -3156,8 +3256,8 @@ $(function() {
std::map
std::numeric_limits::max
T max(T... args)
std::minmax
T minmax(T... args)
-
ripple::detail::internalDirFirst
bool internalDirFirst(V &view, uint256 const &root, std::shared_ptr< N > &page, unsigned int &index, uint256 &entry)
Definition: View.cpp:102
-
ripple::detail::internalDirNext
bool internalDirNext(V &view, uint256 const &root, std::shared_ptr< N > &page, unsigned int &index, uint256 &entry)
Definition: View.cpp:54
+
ripple::detail::internalDirFirst
bool internalDirFirst(V &view, uint256 const &root, std::shared_ptr< N > &page, unsigned int &index, uint256 &entry)
Definition: View.cpp:101
+
ripple::detail::internalDirNext
bool internalDirNext(V &view, uint256 const &root, std::shared_ptr< N > &page, unsigned int &index, uint256 &entry)
Definition: View.cpp:53
ripple::keylet::mptoken
Keylet mptoken(MPTID const &issuanceID, AccountID const &holder) noexcept
Definition: Indexes.cpp:540
ripple::keylet::child
Keylet child(uint256 const &key) noexcept
Any item that can be in an owner dir.
Definition: Indexes.cpp:190
ripple::keylet::amm
Keylet amm(Asset const &issue1, Asset const &issue2) noexcept
AMM entry.
Definition: Indexes.cpp:446
@@ -3171,32 +3271,32 @@ $(function() {
ripple::keylet::skip
Keylet const & skip() noexcept
The index of the "short" skip list.
Definition: Indexes.cpp:196
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::AccountID
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition: AccountID.h:48
-
ripple::rippleLockEscrowMPT
TER rippleLockEscrowMPT(ApplyView &view, AccountID const &sender, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2753
+
ripple::rippleLockEscrowMPT
TER rippleLockEscrowMPT(ApplyView &view, AccountID const &sender, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2853
ripple::noAccount
AccountID const & noAccount()
A placeholder for empty accounts.
Definition: AccountID.cpp:185
-
ripple::createPseudoAccount
Expected< std::shared_ptr< SLE >, TER > createPseudoAccount(ApplyView &view, uint256 const &pseudoOwnerKey, SField const &ownerField)
Create pseudo-account, storing pseudoOwnerKey into ownerField.
Definition: View.cpp:1095
-
ripple::updateTrustLine
static bool updateTrustLine(ApplyView &view, SLE::pointer state, bool bSenderHigh, AccountID const &sender, STAmount const &before, STAmount const &after, beast::Journal j)
Definition: View.cpp:2032
+
ripple::createPseudoAccount
Expected< std::shared_ptr< SLE >, TER > createPseudoAccount(ApplyView &view, uint256 const &pseudoOwnerKey, SField const &ownerField)
Create pseudo-account, storing pseudoOwnerKey into ownerField.
Definition: View.cpp:1094
+
ripple::updateTrustLine
static bool updateTrustLine(ApplyView &view, SLE::pointer state, bool bSenderHigh, AccountID const &sender, STAmount const &before, STAmount const &after, beast::Journal j)
Definition: View.cpp:2135
ripple::maxAssetCheckDepth
std::uint8_t constexpr maxAssetCheckDepth
Maximum recursion depth for vault shares being put as an asset inside another vault; counted from 0.
Definition: Protocol.h:127
-
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:553
-
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2301
+
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:552
+
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2404
ripple::FreezeHandling
FreezeHandling
Controls the treatment of frozen account balances.
Definition: View.h:78
ripple::fhZERO_IF_FROZEN
@ fhZERO_IF_FROZEN
Definition: View.h:78
-
ripple::cdirFirst
bool cdirFirst(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the first entry in the directory, advancing the index.
Definition: View.cpp:147
+
ripple::cdirFirst
bool cdirFirst(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the first entry in the directory, advancing the index.
Definition: View.cpp:146
ripple::isXRP
bool isXRP(AccountID const &c)
Definition: AccountID.h:90
ripple::xrpAccount
AccountID const & xrpAccount()
Compute AccountID from public key.
Definition: AccountID.cpp:178
-
ripple::sharesToAssetsWithdraw
STAmount sharesToAssetsWithdraw(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &shares)
Definition: View.cpp:2734
+
ripple::sharesToAssetsWithdraw
STAmount sharesToAssetsWithdraw(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &shares)
Definition: View.cpp:2834
ripple::telFAILED_PROCESSING
@ telFAILED_PROCESSING
Definition: TER.h:56
-
ripple::isIndividualFrozen
bool isIndividualFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:215
-
ripple::deleteAMMTrustLine
TER deleteAMMTrustLine(ApplyView &view, std::shared_ptr< SLE > sleState, std::optional< AccountID > const &ammAccountID, beast::Journal j)
Delete trustline to AMM.
Definition: View.cpp:2620
+
ripple::isIndividualFrozen
bool isIndividualFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:214
+
ripple::deleteAMMTrustLine
TER deleteAMMTrustLine(ApplyView &view, std::shared_ptr< SLE > sleState, std::optional< AccountID > const &ammAccountID, beast::Journal j)
Delete trustline to AMM.
Definition: View.cpp:2720
ripple::canSubtract
bool canSubtract(STAmount const &amt1, STAmount const &amt2)
Determines if it is safe to subtract one STAmount from another.
Definition: STAmount.cpp:608
-
ripple::rippleSendMPT
static TER rippleSendMPT(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, STAmount &saActual, beast::Journal j, WaiveTransferFee waiveFee)
Definition: View.cpp:1920
-
ripple::dirFirst
bool dirFirst(ApplyView &view, uint256 const &root, std::shared_ptr< SLE > &page, unsigned int &index, uint256 &entry)
Definition: View.cpp:125
-
ripple::dirNext
bool dirNext(ApplyView &view, uint256 const &root, std::shared_ptr< SLE > &page, unsigned int &index, uint256 &entry)
Definition: View.cpp:136
+
ripple::rippleSendMPT
static TER rippleSendMPT(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, STAmount &saActual, beast::Journal j, WaiveTransferFee waiveFee)
Definition: View.cpp:2023
+
ripple::dirFirst
bool dirFirst(ApplyView &view, uint256 const &root, std::shared_ptr< SLE > &page, unsigned int &index, uint256 &entry)
Definition: View.cpp:124
+
ripple::dirNext
bool dirNext(ApplyView &view, uint256 const &root, std::shared_ptr< SLE > &page, unsigned int &index, uint256 &entry)
Definition: View.cpp:135
ripple::canAdd
bool canAdd(STAmount const &amt1, STAmount const &amt2)
Safely checks if two STAmount values can be added without overflow, underflow, or precision loss.
Definition: STAmount.cpp:528
-
ripple::isDeepFrozen
bool isDeepFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:349
-
ripple::hashOfSeq
std::optional< uint256 > hashOfSeq(ReadView const &ledger, LedgerIndex seq, beast::Journal journal)
Return the hash of a ledger by sequence.
Definition: View.cpp:960
-
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:761
+
ripple::isDeepFrozen
bool isDeepFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:348
+
ripple::hashOfSeq
std::optional< uint256 > hashOfSeq(ReadView const &ledger, LedgerIndex seq, beast::Journal journal)
Return the hash of a ledger by sequence.
Definition: View.cpp:959
+
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:760
ripple::maxMPTokenAmount
std::uint64_t constexpr maxMPTokenAmount
The maximum amount of MPTokenIssuance.
Definition: Protocol.h:117
-
ripple::redeemIOU
TER redeemIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
Definition: View.cpp:2185
+
ripple::redeemIOU
TER redeemIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
Definition: View.cpp:2288
ripple::lsfHighDeepFreeze
@ lsfHighDeepFreeze
Definition: LedgerFormats.h:168
ripple::lsfMPTCanTransfer
@ lsfMPTCanTransfer
Definition: LedgerFormats.h:188
ripple::lsfDefaultRipple
@ lsfDefaultRipple
Definition: LedgerFormats.h:134
@@ -3217,37 +3317,38 @@ $(function() {
ripple::lsfLowDeepFreeze
@ lsfLowDeepFreeze
Definition: LedgerFormats.h:167
ripple::lsfHighAuth
@ lsfHighAuth
Definition: LedgerFormats.h:162
ripple::lsfLowAuth
@ lsfLowAuth
Definition: LedgerFormats.h:161
-
ripple::AuthType
AuthType
Definition: View.h:760
+
ripple::AuthType
AuthType
Definition: View.h:770
ripple::AuthType::StrongAuth
@ StrongAuth
ripple::multiply
STAmount multiply(STAmount const &amount, Rate const &rate)
Definition: Rate2.cpp:53
ripple::AuthHandling
AuthHandling
Controls the treatment of unauthorized MPT balances.
Definition: View.h:81
ripple::ahZERO_IF_UNAUTHORIZED
@ ahZERO_IF_UNAUTHORIZED
Definition: View.h:81
-
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1049
-
ripple::transferXRP
TER transferXRP(ApplyView &view, AccountID const &from, AccountID const &to, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2258
-
ripple::enforceMPTokenAuthorization
TER enforceMPTokenAuthorization(ApplyView &view, MPTID const &mptIssuanceID, AccountID const &account, XRPAmount const &priorBalance, beast::Journal j)
Enforce account has MPToken to match its authorization.
Definition: View.cpp:2419
-
ripple::pseudoAccountOwnerFields
static std::array< SField const *, 2 > const pseudoAccountOwnerFields
Definition: View.cpp:1089
+
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1048
+
ripple::transferXRP
TER transferXRP(ApplyView &view, AccountID const &from, AccountID const &to, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2361
+
ripple::enforceMPTokenAuthorization
TER enforceMPTokenAuthorization(ApplyView &view, MPTID const &mptIssuanceID, AccountID const &account, XRPAmount const &priorBalance, beast::Journal j)
Enforce account has MPToken to match its authorization.
Definition: View.cpp:2522
+
ripple::pseudoAccountOwnerFields
static std::array< SField const *, 2 > const pseudoAccountOwnerFields
Definition: View.cpp:1088
ripple::ValStatus::current
@ current
This was a new validation and was added.
-
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1471
-
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:249
+
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1574
+
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:248
ripple::ListDisposition::expired
@ expired
List is expired, but has the largest non-pending sequence seen so far.
-
ripple::getEnabledAmendments
std::set< uint256 > getEnabledAmendments(ReadView const &view)
Definition: View.cpp:920
-
ripple::canTransfer
TER canTransfer(ReadView const &view, MPTIssue const &mptIssue, AccountID const &from, AccountID const &to)
Check if the destination account is allowed to receive MPT.
Definition: View.cpp:2522
+
ripple::getEnabledAmendments
std::set< uint256 > getEnabledAmendments(ReadView const &view)
Definition: View.cpp:919
+
ripple::canTransfer
TER canTransfer(ReadView const &view, MPTIssue const &mptIssue, AccountID const &from, AccountID const &to)
Check if the destination account is allowed to receive MPT.
Definition: View.cpp:2622
ripple::tefBAD_LEDGER
@ tefBAD_LEDGER
Definition: TER.h:170
ripple::tefINTERNAL
@ tefINTERNAL
Definition: TER.h:173
-
ripple::adjustOwnerCount
void adjustOwnerCount(ApplyView &view, std::shared_ptr< SLE > const &sle, std::int32_t amount, beast::Journal j)
Adjust the owner count up or down.
Definition: View.cpp:1031
-
ripple::rippleUnlockEscrowMPT
TER rippleUnlockEscrowMPT(ApplyView &view, AccountID const &sender, AccountID const &receiver, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2850
-
ripple::confineOwnerCount
static std::uint32_t confineOwnerCount(std::uint32_t current, std::int32_t adjustment, std::optional< AccountID > const &id=std::nullopt, beast::Journal j=beast::Journal{beast::Journal::getNullSink()})
Definition: View.cpp:579
-
ripple::rippleCreditIOU
static TER rippleCreditIOU(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Definition: View.cpp:1532
+
ripple::adjustOwnerCount
void adjustOwnerCount(ApplyView &view, std::shared_ptr< SLE > const &sle, std::int32_t amount, beast::Journal j)
Adjust the owner count up or down.
Definition: View.cpp:1030
+
ripple::authorizeMPToken
TER authorizeMPToken(ApplyView &view, XRPAmount const &priorBalance, MPTID const &mptIssuanceID, AccountID const &account, beast::Journal journal, std::uint32_t flags, std::optional< AccountID > holderID)
Definition: View.cpp:1221
+
ripple::rippleUnlockEscrowMPT
TER rippleUnlockEscrowMPT(ApplyView &view, AccountID const &sender, AccountID const &receiver, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2950
+
ripple::confineOwnerCount
static std::uint32_t confineOwnerCount(std::uint32_t current, std::int32_t adjustment, std::optional< AccountID > const &id=std::nullopt, beast::Journal j=beast::Journal{beast::Journal::getNullSink()})
Definition: View.cpp:578
+
ripple::rippleCreditIOU
static TER rippleCreditIOU(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Definition: View.cpp:1635
ripple::adjustOwnerCount
static bool adjustOwnerCount(ApplyContext &ctx, int count)
Definition: SetOracle.cpp:186
ripple::tfMPTUnauthorize
constexpr std::uint32_t const tfMPTUnauthorize
Definition: TxFlags.h:155
-
ripple::isVaultPseudoAccountFrozen
bool isVaultPseudoAccountFrozen(ReadView const &view, AccountID const &account, MPTIssue const &mptShare, int depth)
Definition: View.cpp:309
-
ripple::issueIOU
TER issueIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
Definition: View.cpp:2085
-
ripple::accountSendIOU
static TER accountSendIOU(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Definition: View.cpp:1738
+
ripple::isVaultPseudoAccountFrozen
bool isVaultPseudoAccountFrozen(ReadView const &view, AccountID const &account, MPTIssue const &mptShare, int depth)
Definition: View.cpp:308
+
ripple::issueIOU
TER issueIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
Definition: View.cpp:2188
+
ripple::accountSendIOU
static TER accountSendIOU(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Definition: View.cpp:1841
ripple::majorityAmendments_t
std::map< uint256, NetClock::time_point > majorityAmendments_t
Definition: View.h:401
-
ripple::cdirNext
bool cdirNext(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the next entry in the directory, advancing the index.
Definition: View.cpp:158
+
ripple::cdirNext
bool cdirNext(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the next entry in the directory, advancing the index.
Definition: View.cpp:157
ripple::WaiveTransferFee
WaiveTransferFee
Definition: View.h:44
-
ripple::trustCreate
TER trustCreate(ApplyView &view, bool const bSrcHigh, AccountID const &uSrcAccountID, AccountID const &uDstAccountID, uint256 const &uIndex, SLE::ref sleAccount, bool const bAuth, bool const bNoRipple, bool const bFreeze, bool bDeepFreeze, STAmount const &saBalance, STAmount const &saLimit, std::uint32_t uQualityIn, std::uint32_t uQualityOut, beast::Journal j)
Create a trust line.
Definition: View.cpp:1227
-
ripple::trustDelete
TER trustDelete(ApplyView &view, std::shared_ptr< SLE > const &sleRippleState, AccountID const &uLowAccountID, AccountID const &uHighAccountID, beast::Journal j)
Definition: View.cpp:1431
+
ripple::trustCreate
TER trustCreate(ApplyView &view, bool const bSrcHigh, AccountID const &uSrcAccountID, AccountID const &uDstAccountID, uint256 const &uIndex, SLE::ref sleAccount, bool const bAuth, bool const bNoRipple, bool const bFreeze, bool bDeepFreeze, STAmount const &saBalance, STAmount const &saLimit, std::uint32_t uQualityIn, std::uint32_t uQualityOut, beast::Journal j)
Create a trust line.
Definition: View.cpp:1329
+
ripple::trustDelete
TER trustDelete(ApplyView &view, std::shared_ptr< SLE > const &sleRippleState, AccountID const &uLowAccountID, AccountID const &uHighAccountID, beast::Journal j)
Definition: View.cpp:1534
ripple::tecOBJECT_NOT_FOUND
@ tecOBJECT_NOT_FOUND
Definition: TER.h:326
ripple::tecNO_TARGET
@ tecNO_TARGET
Definition: TER.h:304
ripple::tecDIR_FULL
@ tecDIR_FULL
Definition: TER.h:287
@@ -3259,45 +3360,46 @@ $(function() {
ripple::tecHAS_OBLIGATIONS
@ tecHAS_OBLIGATIONS
Definition: TER.h:317
ripple::tecNO_LINE
@ tecNO_LINE
Definition: TER.h:301
ripple::tecPATH_DRY
@ tecPATH_DRY
Definition: TER.h:294
+
ripple::tecINSUFFICIENT_RESERVE
@ tecINSUFFICIENT_RESERVE
Definition: TER.h:307
ripple::tecFAILED_PROCESSING
@ tecFAILED_PROCESSING
Definition: TER.h:286
ripple::tecEXPIRED
@ tecEXPIRED
Definition: TER.h:314
ripple::tecNO_AUTH
@ tecNO_AUTH
Definition: TER.h:300
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
-
ripple::addEmptyHolding
TER addEmptyHolding(ApplyView &view, AccountID const &accountID, XRPAmount priorBalance, Issue const &issue, beast::Journal journal)
Definition: View.cpp:1154
-
ripple::pseudoAccountAddress
AccountID pseudoAccountAddress(ReadView const &view, uint256 const &pseudoOwnerKey)
Definition: View.cpp:1068
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
-
ripple::isLPTokenFrozen
bool isLPTokenFrozen(ReadView const &view, AccountID const &account, Issue const &asset, Issue const &asset2)
Definition: View.cpp:375
+
ripple::addEmptyHolding
TER addEmptyHolding(ApplyView &view, AccountID const &accountID, XRPAmount priorBalance, Issue const &issue, beast::Journal journal)
Definition: View.cpp:1153
+
ripple::pseudoAccountAddress
AccountID pseudoAccountAddress(ReadView const &view, uint256 const &pseudoOwnerKey)
Definition: View.cpp:1067
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
+
ripple::isLPTokenFrozen
bool isLPTokenFrozen(ReadView const &view, AccountID const &account, Issue const &asset, Issue const &asset2)
Definition: View.cpp:374
ripple::isTesSuccess
bool isTesSuccess(TER x) noexcept
Definition: TER.h:674
-
ripple::getMajorityAmendments
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:937
+
ripple::getMajorityAmendments
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:936
ripple::SLE
STLedgerEntry SLE
Definition: STLedgerEntry.h:97
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::LedgerEntryType
LedgerEntryType
Identifiers for on-ledger objects.
Definition: LedgerFormats.h:54
-
ripple::forEachItemAfter
bool forEachItemAfter(ReadView const &view, Keylet const &root, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items after an item in the given directory.
Definition: View.cpp:683
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
-
ripple::assetsToSharesWithdraw
STAmount assetsToSharesWithdraw(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &assets)
Definition: View.cpp:2715
-
ripple::cleanupOnAccountDelete
TER cleanupOnAccountDelete(ApplyView &view, Keylet const &ownerDirKeylet, EntryDeleter const &deleter, beast::Journal j, std::optional< uint16_t > maxNodesToDelete)
Definition: View.cpp:2542
-
ripple::forEachItem
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:655
+
ripple::forEachItemAfter
bool forEachItemAfter(ReadView const &view, Keylet const &root, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items after an item in the given directory.
Definition: View.cpp:682
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
+
ripple::assetsToSharesWithdraw
STAmount assetsToSharesWithdraw(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &assets)
Definition: View.cpp:2815
+
ripple::cleanupOnAccountDelete
TER cleanupOnAccountDelete(ApplyView &view, Keylet const &ownerDirKeylet, EntryDeleter const &deleter, beast::Journal j, std::optional< uint16_t > maxNodesToDelete)
Definition: View.cpp:2642
+
ripple::forEachItem
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:654
ripple::root
Number root(Number f, unsigned d)
Definition: Number.cpp:636
ripple::verifyValidDomain
TER verifyValidDomain(ApplyView &view, AccountID const &account, uint256 domainID, beast::Journal j)
Definition: CredentialHelpers.cpp:320
-
ripple::assetsToSharesDeposit
STAmount assetsToSharesDeposit(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &assets)
Definition: View.cpp:2697
-
ripple::hasExpired
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
Definition: View.cpp:175
-
ripple::rippleSendIOU
static TER rippleSendIOU(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, STAmount &saActual, beast::Journal j, WaiveTransferFee waiveFee)
Definition: View.cpp:1686
-
ripple::rippleCredit
TER rippleCredit(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Calls static rippleCreditIOU if saAmount represents Issue.
Definition: View.cpp:2669
-
ripple::isAnyFrozen
bool isAnyFrozen(ReadView const &view, std::initializer_list< AccountID > const &accounts, MPTIssue const &mptIssue, int depth)
Definition: View.cpp:284
+
ripple::assetsToSharesDeposit
STAmount assetsToSharesDeposit(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &assets)
Definition: View.cpp:2797
+
ripple::hasExpired
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
Definition: View.cpp:174
+
ripple::rippleSendIOU
static TER rippleSendIOU(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, STAmount &saActual, beast::Journal j, WaiveTransferFee waiveFee)
Definition: View.cpp:1789
+
ripple::rippleCredit
TER rippleCredit(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Calls static rippleCreditIOU if saAmount represents Issue.
Definition: View.cpp:2769
+
ripple::isAnyFrozen
bool isAnyFrozen(ReadView const &view, std::initializer_list< AccountID > const &accounts, MPTIssue const &mptIssue, int depth)
Definition: View.cpp:283
ripple::terNO_AMM
@ terNO_AMM
Definition: TER.h:227
ripple::TER
TERSubset< CanCvtToTER > TER
Definition: TER.h:645
ripple::sha512Half
sha512_half_hasher::result_type sha512Half(Args const &... args)
Returns the SHA512-Half of a series of objects.
Definition: digest.h:224
-
ripple::removeEmptyHolding
TER removeEmptyHolding(ApplyView &view, AccountID const &accountID, Issue const &issue, beast::Journal journal)
Definition: View.cpp:1346
-
ripple::areCompatible
bool areCompatible(ReadView const &validLedger, ReadView const &testLedger, beast::Journal::Stream &s, char const *reason)
Return false if the test ledger is provably incompatible with the valid ledger, that is,...
Definition: View.cpp:798
-
ripple::rippleCreditMPT
static TER rippleCreditMPT(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j)
Definition: View.cpp:1858
-
ripple::dirIsEmpty
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
Definition: View.cpp:906
-
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1140
-
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2011
-
ripple::accountSendMPT
static TER accountSendMPT(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Definition: View.cpp:1986
-
ripple::dirLink
TER dirLink(ApplyView &view, AccountID const &owner, std::shared_ptr< SLE > &object)
Definition: View.cpp:1057
+
ripple::removeEmptyHolding
TER removeEmptyHolding(ApplyView &view, AccountID const &accountID, Issue const &issue, beast::Journal journal)
Definition: View.cpp:1448
+
ripple::areCompatible
bool areCompatible(ReadView const &validLedger, ReadView const &testLedger, beast::Journal::Stream &s, char const *reason)
Return false if the test ledger is provably incompatible with the valid ledger, that is,...
Definition: View.cpp:797
+
ripple::rippleCreditMPT
static TER rippleCreditMPT(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j)
Definition: View.cpp:1961
+
ripple::dirIsEmpty
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
Definition: View.cpp:905
+
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1139
+
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2114
+
ripple::accountSendMPT
static TER accountSendMPT(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Definition: View.cpp:2089
+
ripple::dirLink
TER dirLink(ApplyView &view, AccountID const &owner, std::shared_ptr< SLE > &object)
Definition: View.cpp:1056
ripple::parityRate
Rate const parityRate
A transfer rate signifying a 1:1 exchange.
-
ripple::xrpLiquid
XRPAmount xrpLiquid(ReadView const &view, AccountID const &id, std::int32_t ownerCountAdj, beast::Journal j)
Definition: View.cpp:617
-
ripple::isGlobalFrozen
bool isGlobalFrozen(ReadView const &view, AccountID const &issuer)
Definition: View.cpp:184
+
ripple::xrpLiquid
XRPAmount xrpLiquid(ReadView const &view, AccountID const &id, std::int32_t ownerCountAdj, beast::Journal j)
Definition: View.cpp:616
+
ripple::isGlobalFrozen
bool isGlobalFrozen(ReadView const &view, AccountID const &issuer)
Definition: View.cpp:183
std::optional
std::remove_cvref_t
std::set
diff --git a/View_8h_source.html b/View_8h_source.html index 2a148b6c9d..72e7930a9c 100644 --- a/View_8h_source.html +++ b/View_8h_source.html @@ -550,244 +550,254 @@ $(function() {
600 asset.value());
601}
602
-
603// VFALCO NOTE Both STAmount parameters should just
-
604// be "Amount", a unit-less number.
-
605//
-
610[[nodiscard]] TER
-
611trustCreate(
-
612 ApplyView& view,
-
613 bool const bSrcHigh,
-
614 AccountID const& uSrcAccountID,
-
615 AccountID const& uDstAccountID,
-
616 uint256 const& uIndex, // --> ripple state entry
-
617 SLE::ref sleAccount, // --> the account being set.
-
618 bool const bAuth, // --> authorize account.
-
619 bool const bNoRipple, // --> others cannot ripple through
-
620 bool const bFreeze, // --> funds cannot leave
-
621 bool bDeepFreeze, // --> can neither receive nor send funds
-
622 STAmount const& saBalance, // --> balance of account being set.
-
623 // Issuer should be noAccount()
-
624 STAmount const& saLimit, // --> limit for account being set.
-
625 // Issuer should be the account being set.
-
626 std::uint32_t uSrcQualityIn,
-
627 std::uint32_t uSrcQualityOut,
-
628 beast::Journal j);
-
629
-
630[[nodiscard]] TER
-
631removeEmptyHolding(
-
632 ApplyView& view,
-
633 AccountID const& accountID,
-
634 Issue const& issue,
-
635 beast::Journal journal);
-
636
-
637[[nodiscard]] TER
-
638removeEmptyHolding(
-
639 ApplyView& view,
-
640 AccountID const& accountID,
-
641 MPTIssue const& mptIssue,
-
642 beast::Journal journal);
-
643
-
644[[nodiscard]] inline TER
-
645removeEmptyHolding(
-
646 ApplyView& view,
-
647 AccountID const& accountID,
-
648 Asset const& asset,
-
649 beast::Journal journal)
-
650{
-
651 return std::visit(
-
652 [&]<ValidIssueType TIss>(TIss const& issue) -> TER {
-
653 return removeEmptyHolding(view, accountID, issue, journal);
-
654 },
-
655 asset.value());
-
656}
-
657
-
658[[nodiscard]] TER
-
659trustDelete(
-
660 ApplyView& view,
-
661 std::shared_ptr<SLE> const& sleRippleState,
-
662 AccountID const& uLowAccountID,
-
663 AccountID const& uHighAccountID,
-
664 beast::Journal j);
-
665
-
672// [[nodiscard]] // nodiscard commented out so Flow, BookTip and others compile.
-
673TER
-
674offerDelete(ApplyView& view, std::shared_ptr<SLE> const& sle, beast::Journal j);
+
603[[nodiscard]] TER
+
604authorizeMPToken(
+
605 ApplyView& view,
+
606 XRPAmount const& priorBalance,
+
607 MPTID const& mptIssuanceID,
+
608 AccountID const& account,
+
609 beast::Journal journal,
+
610 std::uint32_t flags = 0,
+
611 std::optional<AccountID> holderID = std::nullopt);
+
612
+
613// VFALCO NOTE Both STAmount parameters should just
+
614// be "Amount", a unit-less number.
+
615//
+
620[[nodiscard]] TER
+
621trustCreate(
+
622 ApplyView& view,
+
623 bool const bSrcHigh,
+
624 AccountID const& uSrcAccountID,
+
625 AccountID const& uDstAccountID,
+
626 uint256 const& uIndex, // --> ripple state entry
+
627 SLE::ref sleAccount, // --> the account being set.
+
628 bool const bAuth, // --> authorize account.
+
629 bool const bNoRipple, // --> others cannot ripple through
+
630 bool const bFreeze, // --> funds cannot leave
+
631 bool bDeepFreeze, // --> can neither receive nor send funds
+
632 STAmount const& saBalance, // --> balance of account being set.
+
633 // Issuer should be noAccount()
+
634 STAmount const& saLimit, // --> limit for account being set.
+
635 // Issuer should be the account being set.
+
636 std::uint32_t uSrcQualityIn,
+
637 std::uint32_t uSrcQualityOut,
+
638 beast::Journal j);
+
639
+
640[[nodiscard]] TER
+
641removeEmptyHolding(
+
642 ApplyView& view,
+
643 AccountID const& accountID,
+
644 Issue const& issue,
+
645 beast::Journal journal);
+
646
+
647[[nodiscard]] TER
+
648removeEmptyHolding(
+
649 ApplyView& view,
+
650 AccountID const& accountID,
+
651 MPTIssue const& mptIssue,
+
652 beast::Journal journal);
+
653
+
654[[nodiscard]] inline TER
+
655removeEmptyHolding(
+
656 ApplyView& view,
+
657 AccountID const& accountID,
+
658 Asset const& asset,
+
659 beast::Journal journal)
+
660{
+
661 return std::visit(
+
662 [&]<ValidIssueType TIss>(TIss const& issue) -> TER {
+
663 return removeEmptyHolding(view, accountID, issue, journal);
+
664 },
+
665 asset.value());
+
666}
+
667
+
668[[nodiscard]] TER
+
669trustDelete(
+
670 ApplyView& view,
+
671 std::shared_ptr<SLE> const& sleRippleState,
+
672 AccountID const& uLowAccountID,
+
673 AccountID const& uHighAccountID,
+
674 beast::Journal j);
675
-
676//------------------------------------------------------------------------------
-
677
-
678//
-
679// Money Transfers
-
680//
-
681
-
682// Direct send w/o fees:
-
683// - Redeeming IOUs and/or sending sender's own IOUs.
-
684// - Create trust line of needed.
-
685// --> bCheckIssuer : normally require issuer to be involved.
-
686// [[nodiscard]] // nodiscard commented out so DirectStep.cpp compiles.
+
682// [[nodiscard]] // nodiscard commented out so Flow, BookTip and others compile.
+
683TER
+
684offerDelete(ApplyView& view, std::shared_ptr<SLE> const& sle, beast::Journal j);
+
685
+
686//------------------------------------------------------------------------------
687
-
691TER
-
692rippleCredit(
-
693 ApplyView& view,
-
694 AccountID const& uSenderID,
-
695 AccountID const& uReceiverID,
-
696 STAmount const& saAmount,
-
697 bool bCheckIssuer,
-
698 beast::Journal j);
-
699
-
700TER
-
701rippleLockEscrowMPT(
-
702 ApplyView& view,
-
703 AccountID const& uGrantorID,
-
704 STAmount const& saAmount,
-
705 beast::Journal j);
-
706
-
707TER
-
708rippleUnlockEscrowMPT(
-
709 ApplyView& view,
-
710 AccountID const& uGrantorID,
-
711 AccountID const& uGranteeID,
-
712 STAmount const& saAmount,
-
713 beast::Journal j);
-
714
-
718[[nodiscard]] TER
-
719accountSend(
-
720 ApplyView& view,
-
721 AccountID const& from,
-
722 AccountID const& to,
-
723 STAmount const& saAmount,
-
724 beast::Journal j,
-
725 WaiveTransferFee waiveFee = WaiveTransferFee::No);
-
726
-
727[[nodiscard]] TER
-
728issueIOU(
-
729 ApplyView& view,
-
730 AccountID const& account,
-
731 STAmount const& amount,
-
732 Issue const& issue,
-
733 beast::Journal j);
-
734
-
735[[nodiscard]] TER
-
736redeemIOU(
-
737 ApplyView& view,
-
738 AccountID const& account,
-
739 STAmount const& amount,
-
740 Issue const& issue,
-
741 beast::Journal j);
-
742
-
743[[nodiscard]] TER
-
744transferXRP(
-
745 ApplyView& view,
-
746 AccountID const& from,
-
747 AccountID const& to,
-
748 STAmount const& amount,
-
749 beast::Journal j);
-
750
-
751/* Check if MPToken (for MPT) or trust line (for IOU) exists:
-
752 * - StrongAuth - before checking if authorization is required
-
753 * - WeakAuth
-
754 * for MPT - after checking lsfMPTRequireAuth flag
-
755 * for IOU - do not check if trust line exists
-
756 * - Legacy
-
757 * for MPT - before checking lsfMPTRequireAuth flag i.e. same as StrongAuth
-
758 * for IOU - do not check if trust line exists i.e. same as WeakAuth
-
759 */
-
760enum class AuthType { StrongAuth, WeakAuth, Legacy };
-
761
-
779[[nodiscard]] TER
-
780requireAuth(
-
781 ReadView const& view,
-
782 Issue const& issue,
-
783 AccountID const& account,
-
784 AuthType authType = AuthType::Legacy);
-
785
-
808[[nodiscard]] TER
-
809requireAuth(
-
810 ReadView const& view,
-
811 MPTIssue const& mptIssue,
-
812 AccountID const& account,
-
813 AuthType authType = AuthType::Legacy,
-
814 int depth = 0);
-
815
-
816[[nodiscard]] TER inline requireAuth(
-
817 ReadView const& view,
-
818 Asset const& asset,
-
819 AccountID const& account,
-
820 AuthType authType = AuthType::Legacy)
-
821{
-
822 return std::visit(
-
823 [&]<ValidIssueType TIss>(TIss const& issue_) {
-
824 return requireAuth(view, issue_, account, authType);
-
825 },
-
826 asset.value());
-
827}
-
828
-
852[[nodiscard]] TER
-
853enforceMPTokenAuthorization(
-
854 ApplyView& view,
-
855 MPTID const& mptIssuanceID,
-
856 AccountID const& account,
-
857 XRPAmount const& priorBalance,
-
858 beast::Journal j);
-
859
-
864[[nodiscard]] TER
-
865canTransfer(
-
866 ReadView const& view,
-
867 MPTIssue const& mptIssue,
-
868 AccountID const& from,
-
869 AccountID const& to);
-
870
-
875using EntryDeleter = std::function<std::pair<TER, SkipEntry>(
-
876 LedgerEntryType,
-
877 uint256 const&,
-
878 std::shared_ptr<SLE>&)>;
-
886[[nodiscard]] TER
-
887cleanupOnAccountDelete(
-
888 ApplyView& view,
-
889 Keylet const& ownerDirKeylet,
-
890 EntryDeleter const& deleter,
-
891 beast::Journal j,
-
892 std::optional<std::uint16_t> maxNodesToDelete = std::nullopt);
-
893
-
898[[nodiscard]] TER
-
899deleteAMMTrustLine(
-
900 ApplyView& view,
-
901 std::shared_ptr<SLE> sleState,
-
902 std::optional<AccountID> const& ammAccountID,
-
903 beast::Journal j);
-
904
-
905// From the perspective of a vault,
-
906// return the number of shares to give the depositor
-
907// when they deposit a fixed amount of assets.
-
908[[nodiscard]] STAmount
-
909assetsToSharesDeposit(
-
910 std::shared_ptr<SLE const> const& vault,
-
911 std::shared_ptr<SLE const> const& issuance,
-
912 STAmount const& assets);
-
913
-
914// From the perspective of a vault,
-
915// return the number of shares to demand from the depositor
-
916// when they ask to withdraw a fixed amount of assets.
-
917[[nodiscard]] STAmount
-
918assetsToSharesWithdraw(
-
919 std::shared_ptr<SLE const> const& vault,
-
920 std::shared_ptr<SLE const> const& issuance,
-
921 STAmount const& assets);
-
922
-
923// From the perspective of a vault,
-
924// return the number of assets to give the depositor
-
925// when they redeem a fixed amount of shares.
-
926[[nodiscard]] STAmount
-
927sharesToAssetsWithdraw(
-
928 std::shared_ptr<SLE const> const& vault,
-
929 std::shared_ptr<SLE const> const& issuance,
-
930 STAmount const& shares);
-
931
-
938bool
-
939after(NetClock::time_point now, std::uint32_t mark);
-
940
-
941} // namespace ripple
-
942
-
943#endif
+
688//
+
689// Money Transfers
+
690//
+
691
+
692// Direct send w/o fees:
+
693// - Redeeming IOUs and/or sending sender's own IOUs.
+
694// - Create trust line of needed.
+
695// --> bCheckIssuer : normally require issuer to be involved.
+
696// [[nodiscard]] // nodiscard commented out so DirectStep.cpp compiles.
+
697
+
701TER
+
702rippleCredit(
+
703 ApplyView& view,
+
704 AccountID const& uSenderID,
+
705 AccountID const& uReceiverID,
+
706 STAmount const& saAmount,
+
707 bool bCheckIssuer,
+
708 beast::Journal j);
+
709
+
710TER
+
711rippleLockEscrowMPT(
+
712 ApplyView& view,
+
713 AccountID const& uGrantorID,
+
714 STAmount const& saAmount,
+
715 beast::Journal j);
+
716
+
717TER
+
718rippleUnlockEscrowMPT(
+
719 ApplyView& view,
+
720 AccountID const& uGrantorID,
+
721 AccountID const& uGranteeID,
+
722 STAmount const& saAmount,
+
723 beast::Journal j);
+
724
+
728[[nodiscard]] TER
+
729accountSend(
+
730 ApplyView& view,
+
731 AccountID const& from,
+
732 AccountID const& to,
+
733 STAmount const& saAmount,
+
734 beast::Journal j,
+
735 WaiveTransferFee waiveFee = WaiveTransferFee::No);
+
736
+
737[[nodiscard]] TER
+
738issueIOU(
+
739 ApplyView& view,
+
740 AccountID const& account,
+
741 STAmount const& amount,
+
742 Issue const& issue,
+
743 beast::Journal j);
+
744
+
745[[nodiscard]] TER
+
746redeemIOU(
+
747 ApplyView& view,
+
748 AccountID const& account,
+
749 STAmount const& amount,
+
750 Issue const& issue,
+
751 beast::Journal j);
+
752
+
753[[nodiscard]] TER
+
754transferXRP(
+
755 ApplyView& view,
+
756 AccountID const& from,
+
757 AccountID const& to,
+
758 STAmount const& amount,
+
759 beast::Journal j);
+
760
+
761/* Check if MPToken (for MPT) or trust line (for IOU) exists:
+
762 * - StrongAuth - before checking if authorization is required
+
763 * - WeakAuth
+
764 * for MPT - after checking lsfMPTRequireAuth flag
+
765 * for IOU - do not check if trust line exists
+
766 * - Legacy
+
767 * for MPT - before checking lsfMPTRequireAuth flag i.e. same as StrongAuth
+
768 * for IOU - do not check if trust line exists i.e. same as WeakAuth
+
769 */
+
770enum class AuthType { StrongAuth, WeakAuth, Legacy };
+
771
+
789[[nodiscard]] TER
+
790requireAuth(
+
791 ReadView const& view,
+
792 Issue const& issue,
+
793 AccountID const& account,
+
794 AuthType authType = AuthType::Legacy);
+
795
+
818[[nodiscard]] TER
+
819requireAuth(
+
820 ReadView const& view,
+
821 MPTIssue const& mptIssue,
+
822 AccountID const& account,
+
823 AuthType authType = AuthType::Legacy,
+
824 int depth = 0);
+
825
+
826[[nodiscard]] TER inline requireAuth(
+
827 ReadView const& view,
+
828 Asset const& asset,
+
829 AccountID const& account,
+
830 AuthType authType = AuthType::Legacy)
+
831{
+
832 return std::visit(
+
833 [&]<ValidIssueType TIss>(TIss const& issue_) {
+
834 return requireAuth(view, issue_, account, authType);
+
835 },
+
836 asset.value());
+
837}
+
838
+
862[[nodiscard]] TER
+
863enforceMPTokenAuthorization(
+
864 ApplyView& view,
+
865 MPTID const& mptIssuanceID,
+
866 AccountID const& account,
+
867 XRPAmount const& priorBalance,
+
868 beast::Journal j);
+
869
+
874[[nodiscard]] TER
+
875canTransfer(
+
876 ReadView const& view,
+
877 MPTIssue const& mptIssue,
+
878 AccountID const& from,
+
879 AccountID const& to);
+
880
+
885using EntryDeleter = std::function<std::pair<TER, SkipEntry>(
+
886 LedgerEntryType,
+
887 uint256 const&,
+
888 std::shared_ptr<SLE>&)>;
+
896[[nodiscard]] TER
+
897cleanupOnAccountDelete(
+
898 ApplyView& view,
+
899 Keylet const& ownerDirKeylet,
+
900 EntryDeleter const& deleter,
+
901 beast::Journal j,
+
902 std::optional<std::uint16_t> maxNodesToDelete = std::nullopt);
+
903
+
908[[nodiscard]] TER
+
909deleteAMMTrustLine(
+
910 ApplyView& view,
+
911 std::shared_ptr<SLE> sleState,
+
912 std::optional<AccountID> const& ammAccountID,
+
913 beast::Journal j);
+
914
+
915// From the perspective of a vault,
+
916// return the number of shares to give the depositor
+
917// when they deposit a fixed amount of assets.
+
918[[nodiscard]] STAmount
+
919assetsToSharesDeposit(
+
920 std::shared_ptr<SLE const> const& vault,
+
921 std::shared_ptr<SLE const> const& issuance,
+
922 STAmount const& assets);
+
923
+
924// From the perspective of a vault,
+
925// return the number of shares to demand from the depositor
+
926// when they ask to withdraw a fixed amount of assets.
+
927[[nodiscard]] STAmount
+
928assetsToSharesWithdraw(
+
929 std::shared_ptr<SLE const> const& vault,
+
930 std::shared_ptr<SLE const> const& issuance,
+
931 STAmount const& assets);
+
932
+
933// From the perspective of a vault,
+
934// return the number of assets to give the depositor
+
935// when they redeem a fixed amount of shares.
+
936[[nodiscard]] STAmount
+
937sharesToAssetsWithdraw(
+
938 std::shared_ptr<SLE const> const& vault,
+
939 std::shared_ptr<SLE const> const& issuance,
+
940 STAmount const& shares);
+
941
+
948bool
+
949after(NetClock::time_point now, std::uint32_t mark);
+
950
+
951} // namespace ripple
+
952
+
953#endif
beast::Journal::Stream
Provide a light-weight way to check active() before string formatting.
Definition: Journal.h:205
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:60
ripple::ApplyView
Writeable view to a ledger, for applying a transaction.
Definition: ApplyView.h:144
@@ -814,83 +824,84 @@ $(function() {
ripple::keylet::ownerDir
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Definition: Indexes.cpp:374
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::AccountID
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition: AccountID.h:48
-
ripple::rippleLockEscrowMPT
TER rippleLockEscrowMPT(ApplyView &view, AccountID const &sender, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2753
-
ripple::createPseudoAccount
Expected< std::shared_ptr< SLE >, TER > createPseudoAccount(ApplyView &view, uint256 const &pseudoOwnerKey, SField const &ownerField)
Create pseudo-account, storing pseudoOwnerKey into ownerField.
Definition: View.cpp:1095
+
ripple::rippleLockEscrowMPT
TER rippleLockEscrowMPT(ApplyView &view, AccountID const &sender, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2853
+
ripple::createPseudoAccount
Expected< std::shared_ptr< SLE >, TER > createPseudoAccount(ApplyView &view, uint256 const &pseudoOwnerKey, SField const &ownerField)
Create pseudo-account, storing pseudoOwnerKey into ownerField.
Definition: View.cpp:1094
ripple::LedgerIndex
std::uint32_t LedgerIndex
A ledger index.
Definition: Protocol.h:130
ripple::checkFrozen
TER checkFrozen(ReadView const &view, AccountID const &account, Issue const &issue)
Definition: View.h:179
-
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:553
-
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2301
+
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:552
+
ripple::requireAuth
TER requireAuth(ReadView const &view, Issue const &issue, AccountID const &account, AuthType authType)
Check if the account lacks required authorization.
Definition: View.cpp:2404
ripple::FreezeHandling
FreezeHandling
Controls the treatment of frozen account balances.
Definition: View.h:78
ripple::fhZERO_IF_FROZEN
@ fhZERO_IF_FROZEN
Definition: View.h:78
ripple::fhIGNORE_FREEZE
@ fhIGNORE_FREEZE
Definition: View.h:78
-
ripple::cdirFirst
bool cdirFirst(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the first entry in the directory, advancing the index.
Definition: View.cpp:147
-
ripple::sharesToAssetsWithdraw
STAmount sharesToAssetsWithdraw(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &shares)
Definition: View.cpp:2734
+
ripple::cdirFirst
bool cdirFirst(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the first entry in the directory, advancing the index.
Definition: View.cpp:146
+
ripple::sharesToAssetsWithdraw
STAmount sharesToAssetsWithdraw(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &shares)
Definition: View.cpp:2834
ripple::getCandidateLedger
LedgerIndex getCandidateLedger(LedgerIndex requested)
Find a ledger index from which we could easily get the requested ledger.
Definition: View.h:430
-
ripple::isIndividualFrozen
bool isIndividualFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:215
-
ripple::deleteAMMTrustLine
TER deleteAMMTrustLine(ApplyView &view, std::shared_ptr< SLE > sleState, std::optional< AccountID > const &ammAccountID, beast::Journal j)
Delete trustline to AMM.
Definition: View.cpp:2620
-
ripple::dirFirst
bool dirFirst(ApplyView &view, uint256 const &root, std::shared_ptr< SLE > &page, unsigned int &index, uint256 &entry)
Definition: View.cpp:125
+
ripple::isIndividualFrozen
bool isIndividualFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:214
+
ripple::deleteAMMTrustLine
TER deleteAMMTrustLine(ApplyView &view, std::shared_ptr< SLE > sleState, std::optional< AccountID > const &ammAccountID, beast::Journal j)
Delete trustline to AMM.
Definition: View.cpp:2720
+
ripple::dirFirst
bool dirFirst(ApplyView &view, uint256 const &root, std::shared_ptr< SLE > &page, unsigned int &index, uint256 &entry)
Definition: View.cpp:124
ripple::uint256
base_uint< 256 > uint256
Definition: base_uint.h:558
-
ripple::dirNext
bool dirNext(ApplyView &view, uint256 const &root, std::shared_ptr< SLE > &page, unsigned int &index, uint256 &entry)
Definition: View.cpp:136
-
ripple::isDeepFrozen
bool isDeepFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:349
-
ripple::hashOfSeq
std::optional< uint256 > hashOfSeq(ReadView const &ledger, LedgerIndex seq, beast::Journal journal)
Return the hash of a ledger by sequence.
Definition: View.cpp:960
-
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:761
-
ripple::redeemIOU
TER redeemIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
Definition: View.cpp:2185
+
ripple::dirNext
bool dirNext(ApplyView &view, uint256 const &root, std::shared_ptr< SLE > &page, unsigned int &index, uint256 &entry)
Definition: View.cpp:135
+
ripple::isDeepFrozen
bool isDeepFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:348
+
ripple::hashOfSeq
std::optional< uint256 > hashOfSeq(ReadView const &ledger, LedgerIndex seq, beast::Journal journal)
Return the hash of a ledger by sequence.
Definition: View.cpp:959
+
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:760
+
ripple::redeemIOU
TER redeemIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
Definition: View.cpp:2288
ripple::MPTID
base_uint< 192 > MPTID
MPTID is a 192-bit value representing MPT Issuance ID, which is a concatenation of a 32-bit sequence ...
Definition: UintTypes.h:64
-
ripple::AuthType
AuthType
Definition: View.h:760
+
ripple::AuthType
AuthType
Definition: View.h:770
ripple::AuthType::Legacy
@ Legacy
ripple::AuthType::WeakAuth
@ WeakAuth
ripple::AuthType::StrongAuth
@ StrongAuth
ripple::AuthHandling
AuthHandling
Controls the treatment of unauthorized MPT balances.
Definition: View.h:81
ripple::ahZERO_IF_UNAUTHORIZED
@ ahZERO_IF_UNAUTHORIZED
Definition: View.h:81
ripple::ahIGNORE_AUTH
@ ahIGNORE_AUTH
Definition: View.h:81
-
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1049
+
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1048
ripple::SkipEntry
SkipEntry
Definition: View.h:45
-
ripple::transferXRP
TER transferXRP(ApplyView &view, AccountID const &from, AccountID const &to, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2258
-
ripple::enforceMPTokenAuthorization
TER enforceMPTokenAuthorization(ApplyView &view, MPTID const &mptIssuanceID, AccountID const &account, XRPAmount const &priorBalance, beast::Journal j)
Enforce account has MPToken to match its authorization.
Definition: View.cpp:2419
-
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1471
-
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:249
-
ripple::getEnabledAmendments
std::set< uint256 > getEnabledAmendments(ReadView const &view)
Definition: View.cpp:920
-
ripple::canTransfer
TER canTransfer(ReadView const &view, MPTIssue const &mptIssue, AccountID const &from, AccountID const &to)
Check if the destination account is allowed to receive MPT.
Definition: View.cpp:2522
-
ripple::rippleUnlockEscrowMPT
TER rippleUnlockEscrowMPT(ApplyView &view, AccountID const &sender, AccountID const &receiver, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2850
+
ripple::transferXRP
TER transferXRP(ApplyView &view, AccountID const &from, AccountID const &to, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2361
+
ripple::enforceMPTokenAuthorization
TER enforceMPTokenAuthorization(ApplyView &view, MPTID const &mptIssuanceID, AccountID const &account, XRPAmount const &priorBalance, beast::Journal j)
Enforce account has MPToken to match its authorization.
Definition: View.cpp:2522
+
ripple::offerDelete
TER offerDelete(ApplyView &view, std::shared_ptr< SLE > const &sle, beast::Journal j)
Delete an offer.
Definition: View.cpp:1574
+
ripple::isFrozen
bool isFrozen(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer)
Definition: View.cpp:248
+
ripple::getEnabledAmendments
std::set< uint256 > getEnabledAmendments(ReadView const &view)
Definition: View.cpp:919
+
ripple::canTransfer
TER canTransfer(ReadView const &view, MPTIssue const &mptIssue, AccountID const &from, AccountID const &to)
Check if the destination account is allowed to receive MPT.
Definition: View.cpp:2622
+
ripple::authorizeMPToken
TER authorizeMPToken(ApplyView &view, XRPAmount const &priorBalance, MPTID const &mptIssuanceID, AccountID const &account, beast::Journal journal, std::uint32_t flags, std::optional< AccountID > holderID)
Definition: View.cpp:1221
+
ripple::rippleUnlockEscrowMPT
TER rippleUnlockEscrowMPT(ApplyView &view, AccountID const &sender, AccountID const &receiver, STAmount const &amount, beast::Journal j)
Definition: View.cpp:2950
ripple::adjustOwnerCount
static bool adjustOwnerCount(ApplyContext &ctx, int count)
Definition: SetOracle.cpp:186
ripple::Currency
base_uint< 160, detail::CurrencyTag > Currency
Currency is a hash representing a specific currency.
Definition: UintTypes.h:56
-
ripple::isVaultPseudoAccountFrozen
bool isVaultPseudoAccountFrozen(ReadView const &view, AccountID const &account, MPTIssue const &mptShare, int depth)
Definition: View.cpp:309
-
ripple::issueIOU
TER issueIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
Definition: View.cpp:2085
-
ripple::cdirNext
bool cdirNext(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the next entry in the directory, advancing the index.
Definition: View.cpp:158
+
ripple::isVaultPseudoAccountFrozen
bool isVaultPseudoAccountFrozen(ReadView const &view, AccountID const &account, MPTIssue const &mptShare, int depth)
Definition: View.cpp:308
+
ripple::issueIOU
TER issueIOU(ApplyView &view, AccountID const &account, STAmount const &amount, Issue const &issue, beast::Journal j)
Definition: View.cpp:2188
+
ripple::cdirNext
bool cdirNext(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the next entry in the directory, advancing the index.
Definition: View.cpp:157
ripple::WaiveTransferFee
WaiveTransferFee
Definition: View.h:44
ripple::WaiveTransferFee::No
@ No
-
ripple::trustCreate
TER trustCreate(ApplyView &view, bool const bSrcHigh, AccountID const &uSrcAccountID, AccountID const &uDstAccountID, uint256 const &uIndex, SLE::ref sleAccount, bool const bAuth, bool const bNoRipple, bool const bFreeze, bool bDeepFreeze, STAmount const &saBalance, STAmount const &saLimit, std::uint32_t uQualityIn, std::uint32_t uQualityOut, beast::Journal j)
Create a trust line.
Definition: View.cpp:1227
-
ripple::trustDelete
TER trustDelete(ApplyView &view, std::shared_ptr< SLE > const &sleRippleState, AccountID const &uLowAccountID, AccountID const &uHighAccountID, beast::Journal j)
Definition: View.cpp:1431
+
ripple::trustCreate
TER trustCreate(ApplyView &view, bool const bSrcHigh, AccountID const &uSrcAccountID, AccountID const &uDstAccountID, uint256 const &uIndex, SLE::ref sleAccount, bool const bAuth, bool const bNoRipple, bool const bFreeze, bool bDeepFreeze, STAmount const &saBalance, STAmount const &saLimit, std::uint32_t uQualityIn, std::uint32_t uQualityOut, beast::Journal j)
Create a trust line.
Definition: View.cpp:1329
+
ripple::trustDelete
TER trustDelete(ApplyView &view, std::shared_ptr< SLE > const &sleRippleState, AccountID const &uLowAccountID, AccountID const &uHighAccountID, beast::Journal j)
Definition: View.cpp:1534
ripple::tecFROZEN
@ tecFROZEN
Definition: TER.h:303
ripple::tecLOCKED
@ tecLOCKED
Definition: TER.h:358
ripple::IsDeposit::Yes
@ Yes
ripple::IsDeposit::No
@ No
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:244
-
ripple::addEmptyHolding
TER addEmptyHolding(ApplyView &view, AccountID const &accountID, XRPAmount priorBalance, Issue const &issue, beast::Journal journal)
Definition: View.cpp:1154
-
ripple::pseudoAccountAddress
AccountID pseudoAccountAddress(ReadView const &view, uint256 const &pseudoOwnerKey)
Definition: View.cpp:1068
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
-
ripple::isLPTokenFrozen
bool isLPTokenFrozen(ReadView const &view, AccountID const &account, Issue const &asset, Issue const &asset2)
Definition: View.cpp:375
-
ripple::getMajorityAmendments
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:937
+
ripple::addEmptyHolding
TER addEmptyHolding(ApplyView &view, AccountID const &accountID, XRPAmount priorBalance, Issue const &issue, beast::Journal journal)
Definition: View.cpp:1153
+
ripple::pseudoAccountAddress
AccountID pseudoAccountAddress(ReadView const &view, uint256 const &pseudoOwnerKey)
Definition: View.cpp:1067
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
+
ripple::isLPTokenFrozen
bool isLPTokenFrozen(ReadView const &view, AccountID const &account, Issue const &asset, Issue const &asset2)
Definition: View.cpp:374
+
ripple::getMajorityAmendments
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:936
ripple::LedgerEntryType
LedgerEntryType
Identifiers for on-ledger objects.
Definition: LedgerFormats.h:54
-
ripple::forEachItemAfter
bool forEachItemAfter(ReadView const &view, Keylet const &root, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items after an item in the given directory.
Definition: View.cpp:683
-
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2997
-
ripple::assetsToSharesWithdraw
STAmount assetsToSharesWithdraw(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &assets)
Definition: View.cpp:2715
-
ripple::cleanupOnAccountDelete
TER cleanupOnAccountDelete(ApplyView &view, Keylet const &ownerDirKeylet, EntryDeleter const &deleter, beast::Journal j, std::optional< uint16_t > maxNodesToDelete)
Definition: View.cpp:2542
-
ripple::forEachItem
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:655
+
ripple::forEachItemAfter
bool forEachItemAfter(ReadView const &view, Keylet const &root, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items after an item in the given directory.
Definition: View.cpp:682
+
ripple::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:3097
+
ripple::assetsToSharesWithdraw
STAmount assetsToSharesWithdraw(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &assets)
Definition: View.cpp:2815
+
ripple::cleanupOnAccountDelete
TER cleanupOnAccountDelete(ApplyView &view, Keylet const &ownerDirKeylet, EntryDeleter const &deleter, beast::Journal j, std::optional< uint16_t > maxNodesToDelete)
Definition: View.cpp:2642
+
ripple::forEachItem
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Definition: View.cpp:654
ripple::root
Number root(Number f, unsigned d)
Definition: Number.cpp:636
-
ripple::assetsToSharesDeposit
STAmount assetsToSharesDeposit(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &assets)
Definition: View.cpp:2697
-
ripple::hasExpired
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
Definition: View.cpp:175
-
ripple::rippleCredit
TER rippleCredit(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Calls static rippleCreditIOU if saAmount represents Issue.
Definition: View.cpp:2669
-
ripple::isAnyFrozen
bool isAnyFrozen(ReadView const &view, std::initializer_list< AccountID > const &accounts, MPTIssue const &mptIssue, int depth)
Definition: View.cpp:284
+
ripple::assetsToSharesDeposit
STAmount assetsToSharesDeposit(std::shared_ptr< SLE const > const &vault, std::shared_ptr< SLE const > const &issuance, STAmount const &assets)
Definition: View.cpp:2797
+
ripple::hasExpired
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
Definition: View.cpp:174
+
ripple::rippleCredit
TER rippleCredit(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Calls static rippleCreditIOU if saAmount represents Issue.
Definition: View.cpp:2769
+
ripple::isAnyFrozen
bool isAnyFrozen(ReadView const &view, std::initializer_list< AccountID > const &accounts, MPTIssue const &mptIssue, int depth)
Definition: View.cpp:283
ripple::TER
TERSubset< CanCvtToTER > TER
Definition: TER.h:645
-
ripple::removeEmptyHolding
TER removeEmptyHolding(ApplyView &view, AccountID const &accountID, Issue const &issue, beast::Journal journal)
Definition: View.cpp:1346
-
ripple::areCompatible
bool areCompatible(ReadView const &validLedger, ReadView const &testLedger, beast::Journal::Stream &s, char const *reason)
Return false if the test ledger is provably incompatible with the valid ledger, that is,...
Definition: View.cpp:798
-
ripple::dirIsEmpty
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
Definition: View.cpp:906
-
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1140
-
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2011
-
ripple::dirLink
TER dirLink(ApplyView &view, AccountID const &owner, std::shared_ptr< SLE > &object)
Definition: View.cpp:1057
-
ripple::xrpLiquid
XRPAmount xrpLiquid(ReadView const &view, AccountID const &id, std::int32_t ownerCountAdj, beast::Journal j)
Definition: View.cpp:617
-
ripple::isGlobalFrozen
bool isGlobalFrozen(ReadView const &view, AccountID const &issuer)
Definition: View.cpp:184
+
ripple::removeEmptyHolding
TER removeEmptyHolding(ApplyView &view, AccountID const &accountID, Issue const &issue, beast::Journal journal)
Definition: View.cpp:1448
+
ripple::areCompatible
bool areCompatible(ReadView const &validLedger, ReadView const &testLedger, beast::Journal::Stream &s, char const *reason)
Return false if the test ledger is provably incompatible with the valid ledger, that is,...
Definition: View.cpp:797
+
ripple::dirIsEmpty
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
Definition: View.cpp:905
+
ripple::isPseudoAccount
bool isPseudoAccount(std::shared_ptr< SLE const > sleAcct)
Definition: View.cpp:1139
+
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2114
+
ripple::dirLink
TER dirLink(ApplyView &view, AccountID const &owner, std::shared_ptr< SLE > &object)
Definition: View.cpp:1056
+
ripple::xrpLiquid
XRPAmount xrpLiquid(ReadView const &view, AccountID const &id, std::int32_t ownerCountAdj, beast::Journal j)
Definition: View.cpp:616
+
ripple::isGlobalFrozen
bool isGlobalFrozen(ReadView const &view, AccountID const &issuer)
Definition: View.cpp:183
std::optional
std::set
std::shared_ptr
diff --git a/View__test_8cpp_source.html b/View__test_8cpp_source.html index 45cbc3463e..78672e0ca8 100644 --- a/View__test_8cpp_source.html +++ b/View__test_8cpp_source.html @@ -1340,25 +1340,25 @@ $(function() {
ripple::test::jtx::XRP
XRP_t const XRP
Converts to XRP Issue or STAmount.
Definition: amount.cpp:105
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25
ripple::asfGlobalFreeze
constexpr std::uint32_t asfGlobalFreeze
Definition: TxFlags.h:83
-
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:553
+
ripple::accountFunds
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
Definition: View.cpp:552
ripple::fhZERO_IF_FROZEN
@ fhZERO_IF_FROZEN
Definition: View.h:78
ripple::fhIGNORE_FREEZE
@ fhIGNORE_FREEZE
Definition: View.h:78
ripple::xrpAccount
AccountID const & xrpAccount()
Compute AccountID from public key.
Definition: AccountID.cpp:178
ripple::uint256
base_uint< 256 > uint256
Definition: base_uint.h:558
-
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:761
-
ripple::getEnabledAmendments
std::set< uint256 > getEnabledAmendments(ReadView const &view)
Definition: View.cpp:920
+
ripple::transferRate
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
Definition: View.cpp:760
+
ripple::getEnabledAmendments
std::set< uint256 > getEnabledAmendments(ReadView const &view)
Definition: View.cpp:919
ripple::ConsensusPhase::open
@ open
We haven't closed our ledger yet, but others might have.
ripple::xrpCurrency
Currency const & xrpCurrency()
XRP currency.
Definition: UintTypes.cpp:119
ripple::tfClearFreeze
constexpr std::uint32_t tfClearFreeze
Definition: TxFlags.h:119
ripple::tecFROZEN
@ tecFROZEN
Definition: TER.h:303
-
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:386
-
ripple::getMajorityAmendments
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:937
+
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:385
+
ripple::getMajorityAmendments
majorityAmendments_t getMajorityAmendments(ReadView const &view)
Definition: View.cpp:936
ripple::create_genesis
create_genesis_t const create_genesis
Definition: Ledger.cpp:51
ripple::ReleaseStrongRefAction::noop
@ noop
ripple::tapRETRY
@ tapRETRY
Definition: ApplyView.h:40
ripple::tapNONE
@ tapNONE
Definition: ApplyView.h:32
ripple::tfSetFreeze
constexpr std::uint32_t tfSetFreeze
Definition: TxFlags.h:118
-
ripple::areCompatible
bool areCompatible(ReadView const &validLedger, ReadView const &testLedger, beast::Journal::Stream &s, char const *reason)
Return false if the test ledger is provably incompatible with the valid ledger, that is,...
Definition: View.cpp:798
+
ripple::areCompatible
bool areCompatible(ReadView const &validLedger, ReadView const &testLedger, beast::Journal::Stream &s, char const *reason)
Return false if the test ledger is provably incompatible with the valid ledger, that is,...
Definition: View.cpp:797
ripple::parityRate
Rate const parityRate
A transfer rate signifying a 1:1 exchange.
std::chrono
std::optional
diff --git a/XChainBridge_8cpp_source.html b/XChainBridge_8cpp_source.html index a83f4707de..c57048e50f 100644 --- a/XChainBridge_8cpp_source.html +++ b/XChainBridge_8cpp_source.html @@ -2396,7 +2396,7 @@ $(function() {
ripple::lsfAllowTrustLineClawback
@ lsfAllowTrustLineClawback
Definition: LedgerFormats.h:150
ripple::lsfDisableMaster
@ lsfDisableMaster
Definition: LedgerFormats.h:131
ripple::lsfDepositAuth
@ lsfDepositAuth
Definition: LedgerFormats.h:136
-
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1049
+
ripple::describeOwnerDir
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Definition: View.cpp:1048
ripple::preflight1
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:91
ripple::flow
StrandResult< TInAmt, TOutAmt > flow(PaymentSandbox const &baseView, Strand const &strand, std::optional< TInAmt > const &maxIn, TOutAmt const &out, beast::Journal j)
Request out amount from a strand.
Definition: StrandFlow.h:105
ripple::calcAccountID
AccountID calcAccountID(PublicKey const &pk)
Definition: AccountID.cpp:168
diff --git a/XRPEndpointStep_8cpp_source.html b/XRPEndpointStep_8cpp_source.html index 694acad288..aa9da3b341 100644 --- a/XRPEndpointStep_8cpp_source.html +++ b/XRPEndpointStep_8cpp_source.html @@ -570,8 +570,8 @@ $(function() {
ripple::to_string
std::string to_string(base_uint< Bits, Tag > const &a)
Definition: base_uint.h:630
ripple::operator==
constexpr bool operator==(base_uint< Bits, Tag > const &lhs, base_uint< Bits, Tag > const &rhs)
Definition: base_uint.h:585
ripple::terNO_ACCOUNT
@ terNO_ACCOUNT
Definition: TER.h:217
-
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2011
-
ripple::xrpLiquid
XRPAmount xrpLiquid(ReadView const &view, AccountID const &id, std::int32_t ownerCountAdj, beast::Journal j)
Definition: View.cpp:617
+
ripple::accountSend
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
Calls static accountSendIOU if saAmount represents Issue.
Definition: View.cpp:2114
+
ripple::xrpLiquid
XRPAmount xrpLiquid(ReadView const &view, AccountID const &id, std::int32_t ownerCountAdj, beast::Journal j)
Definition: View.cpp:616
ripple::temBAD_PATH_LOOP
@ temBAD_PATH_LOOP
Definition: TER.h:97
ripple::temBAD_PATH
@ temBAD_PATH
Definition: TER.h:96
std::optional
diff --git a/classripple_1_1MPTokenAuthorize-members.html b/classripple_1_1MPTokenAuthorize-members.html index 84cc3793db..d2e99435c8 100644 --- a/classripple_1_1MPTokenAuthorize-members.html +++ b/classripple_1_1MPTokenAuthorize-members.html @@ -81,44 +81,43 @@ $(function() { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
account_ripple::Transactorprotected
apply()ripple::Transactorprotected
authorize(ApplyView &view, beast::Journal journal, MPTAuthorizeArgs const &args)ripple::MPTokenAuthorizestatic
Blocker enum valueripple::Transactor
calculateBaseFee(ReadView const &view, STTx const &tx)ripple::Transactorstatic
checkBatchSign(PreclaimContext const &ctx)ripple::Transactorstatic
checkFee(PreclaimContext const &ctx, XRPAmount baseFee)ripple::Transactorstatic
checkMultiSign(ReadView const &view, AccountID const &idAccount, STArray const &txSigners, ApplyFlags const &flags, beast::Journal j)ripple::Transactorprivatestatic
checkPermission(ReadView const &view, STTx const &tx)ripple::Transactorstatic
checkPriorTxAndLastLedger(PreclaimContext const &ctx)ripple::Transactorstatic
checkSeqProxy(ReadView const &view, STTx const &tx, beast::Journal j)ripple::Transactorstatic
checkSign(PreclaimContext const &ctx)ripple::Transactorstatic
checkSingleSign(AccountID const &idSigner, AccountID const &idAccount, std::shared_ptr< SLE const > sleAccount, Rules const &rules, beast::Journal j)ripple::Transactorprivatestatic
ConsequencesFactoryripple::MPTokenAuthorizestatic
ConsequencesFactoryType enum nameripple::Transactor
consumeSeqProxy(SLE::pointer const &sleAccount)ripple::Transactorprivate
createMPToken(ApplyView &view, MPTID const &mptIssuanceID, AccountID const &account, std::uint32_t const flags)ripple::MPTokenAuthorizestatic
ctx_ripple::Transactorprotected
Custom enum valueripple::Transactor
doApply() overrideripple::MPTokenAuthorizevirtual
j_ripple::Transactorprotected
minimumFee(Application &app, XRPAmount baseFee, Fees const &fees, ApplyFlags flags)ripple::Transactorprotectedstatic
mPriorBalanceripple::Transactorprotected
MPTokenAuthorize(ApplyContext &ctx)ripple::MPTokenAuthorizeexplicit
mSourceBalanceripple::Transactorprotected
Normal enum valueripple::Transactor
operator()()ripple::Transactor
operator=(Transactor const &)=deleteripple::Transactorprotected
payFee()ripple::Transactorprivate
preclaim(PreclaimContext const &ctx)ripple::MPTokenAuthorizestatic
preCompute()ripple::Transactorprotectedvirtual
preflight(PreflightContext const &ctx)ripple::MPTokenAuthorizestatic
reset(XRPAmount fee)ripple::Transactorprivate
ticketDelete(ApplyView &view, AccountID const &account, uint256 const &ticketIndex, beast::Journal j)ripple::Transactorstatic
Transactor(Transactor const &)=deleteripple::Transactorprotected
Transactor(ApplyContext &ctx)ripple::Transactorexplicitprotected
trapTransaction(uint256) constripple::Transactorprivate
view()ripple::Transactor
view() constripple::Transactor
~Transactor()=defaultripple::Transactorprotectedvirtual
Blocker enum valueripple::Transactor
calculateBaseFee(ReadView const &view, STTx const &tx)ripple::Transactorstatic
checkBatchSign(PreclaimContext const &ctx)ripple::Transactorstatic
checkFee(PreclaimContext const &ctx, XRPAmount baseFee)ripple::Transactorstatic
checkMultiSign(ReadView const &view, AccountID const &idAccount, STArray const &txSigners, ApplyFlags const &flags, beast::Journal j)ripple::Transactorprivatestatic
checkPermission(ReadView const &view, STTx const &tx)ripple::Transactorstatic
checkPriorTxAndLastLedger(PreclaimContext const &ctx)ripple::Transactorstatic
checkSeqProxy(ReadView const &view, STTx const &tx, beast::Journal j)ripple::Transactorstatic
checkSign(PreclaimContext const &ctx)ripple::Transactorstatic
checkSingleSign(AccountID const &idSigner, AccountID const &idAccount, std::shared_ptr< SLE const > sleAccount, Rules const &rules, beast::Journal j)ripple::Transactorprivatestatic
ConsequencesFactoryripple::MPTokenAuthorizestatic
ConsequencesFactoryType enum nameripple::Transactor
consumeSeqProxy(SLE::pointer const &sleAccount)ripple::Transactorprivate
createMPToken(ApplyView &view, MPTID const &mptIssuanceID, AccountID const &account, std::uint32_t const flags)ripple::MPTokenAuthorizestatic
ctx_ripple::Transactorprotected
Custom enum valueripple::Transactor
doApply() overrideripple::MPTokenAuthorizevirtual
j_ripple::Transactorprotected
minimumFee(Application &app, XRPAmount baseFee, Fees const &fees, ApplyFlags flags)ripple::Transactorprotectedstatic
mPriorBalanceripple::Transactorprotected
MPTokenAuthorize(ApplyContext &ctx)ripple::MPTokenAuthorizeexplicit
mSourceBalanceripple::Transactorprotected
Normal enum valueripple::Transactor
operator()()ripple::Transactor
operator=(Transactor const &)=deleteripple::Transactorprotected
payFee()ripple::Transactorprivate
preclaim(PreclaimContext const &ctx)ripple::MPTokenAuthorizestatic
preCompute()ripple::Transactorprotectedvirtual
preflight(PreflightContext const &ctx)ripple::MPTokenAuthorizestatic
reset(XRPAmount fee)ripple::Transactorprivate
ticketDelete(ApplyView &view, AccountID const &account, uint256 const &ticketIndex, beast::Journal j)ripple::Transactorstatic
Transactor(Transactor const &)=deleteripple::Transactorprotected
Transactor(ApplyContext &ctx)ripple::Transactorexplicitprotected
trapTransaction(uint256) constripple::Transactorprivate
view()ripple::Transactor
view() constripple::Transactor
~Transactor()=defaultripple::Transactorprotectedvirtual