1#include <xrpl/tx/transactors/dex/OfferCreate.h>
3#include <xrpl/basics/Log.h>
4#include <xrpl/basics/base_uint.h>
5#include <xrpl/beast/utility/Zero.h>
6#include <xrpl/beast/utility/instrumentation.h>
7#include <xrpl/core/ServiceRegistry.h>
8#include <xrpl/ledger/ApplyView.h>
9#include <xrpl/ledger/PaymentSandbox.h>
10#include <xrpl/ledger/Sandbox.h>
11#include <xrpl/ledger/View.h>
12#include <xrpl/ledger/helpers/AccountRootHelpers.h>
13#include <xrpl/ledger/helpers/CredentialHelpers.h>
14#include <xrpl/ledger/helpers/DirectoryHelpers.h>
15#include <xrpl/ledger/helpers/MPTokenHelpers.h>
16#include <xrpl/ledger/helpers/OfferHelpers.h>
17#include <xrpl/ledger/helpers/PermissionedDEXHelpers.h>
18#include <xrpl/ledger/helpers/TokenHelpers.h>
19#include <xrpl/protocol/AccountID.h>
20#include <xrpl/protocol/Asset.h>
21#include <xrpl/protocol/Book.h>
22#include <xrpl/protocol/Feature.h>
23#include <xrpl/protocol/Indexes.h>
24#include <xrpl/protocol/Issue.h>
25#include <xrpl/protocol/Keylet.h>
26#include <xrpl/protocol/LedgerFormats.h>
27#include <xrpl/protocol/MPTAmount.h>
28#include <xrpl/protocol/MPTIssue.h>
29#include <xrpl/protocol/Protocol.h>
30#include <xrpl/protocol/Quality.h>
31#include <xrpl/protocol/Rate.h>
32#include <xrpl/protocol/SField.h>
33#include <xrpl/protocol/STAmount.h>
34#include <xrpl/protocol/STArray.h>
35#include <xrpl/protocol/STLedgerEntry.h>
36#include <xrpl/protocol/STPathSet.h>
37#include <xrpl/protocol/STTx.h>
38#include <xrpl/protocol/SeqProxy.h>
39#include <xrpl/protocol/TER.h>
40#include <xrpl/protocol/TxFlags.h>
41#include <xrpl/protocol/UintTypes.h>
42#include <xrpl/protocol/XRPAmount.h>
43#include <xrpl/tx/Transactor.h>
44#include <xrpl/tx/applySteps.h>
45#include <xrpl/tx/paths/Flow.h>
46#include <xrpl/tx/paths/detail/Steps.h>
62 auto const calculateMaxXRPSpend = [](
STTx const& tx) ->
XRPAmount {
63 auto const& amount{tx[sfTakerGets]};
86 return tfOfferCreateMask;
89 return tfOfferCreateMask | tfHybrid;
98 if (tx.isFlag(tfHybrid) && !tx.isFieldPresent(sfDomainID))
103 if (
auto const domainID = tx[~sfDomainID];
107 bool const bImmediateOrCancel(tx.isFlag(tfImmediateOrCancel));
108 bool const bFillOrKill(tx.isFlag(tfFillOrKill));
110 if (bImmediateOrCancel && bFillOrKill)
112 JLOG(j.debug()) <<
"Malformed transaction: both IoC and FoK set.";
116 bool const bHaveExpiration(tx.isFieldPresent(sfExpiration));
118 if (bHaveExpiration && (tx.getFieldU32(sfExpiration) == 0))
120 JLOG(j.debug()) <<
"Malformed offer: bad expiration";
124 if (
auto const cancelSequence = tx[~sfOfferSequence]; cancelSequence && *cancelSequence == 0)
126 JLOG(j.debug()) <<
"Malformed offer: bad cancel sequence";
130 STAmount const saTakerPays = tx[sfTakerPays];
131 STAmount const saTakerGets = tx[sfTakerGets];
138 JLOG(j.debug()) <<
"Malformed offer: redundant (XRP for XRP)";
143 JLOG(j.debug()) <<
"Malformed offer: bad amount";
147 auto const& uPaysIssuerID = saTakerPays.
getIssuer();
148 auto const& uPaysAsset = saTakerPays.
asset();
150 auto const& uGetsIssuerID = saTakerGets.
getIssuer();
151 auto const& uGetsAsset = saTakerGets.
asset();
153 if (uPaysAsset == uGetsAsset)
155 JLOG(j.debug()) <<
"Malformed offer: redundant (IOU for IOU)";
161 JLOG(j.debug()) <<
"Malformed offer: bad currency";
165 if (saTakerPays.
native() != !uPaysIssuerID || saTakerGets.
native() != !uGetsIssuerID)
167 JLOG(j.debug()) <<
"Malformed offer: bad issuer";
177 auto const id = ctx.
tx[sfAccount];
179 auto const saTakerPays = ctx.
tx[sfTakerPays];
180 auto const saTakerGets = ctx.
tx[sfTakerGets];
182 auto const& uPaysAsset = saTakerPays.asset();
184 auto const cancelSequence = ctx.
tx[~sfOfferSequence];
190 std::uint32_t const uAccountSequence = sleCreator->getFieldU32(sfSequence);
192 auto const viewJ = ctx.
registry.get().getJournal(
"View");
196 JLOG(ctx.
j.
debug()) <<
"Offer involves frozen or locked asset";
201 JLOG(ctx.
j.
debug()) <<
"Offer involves frozen or locked asset";
215 JLOG(ctx.
j.
debug()) <<
"delay: Offers must be at least partially funded.";
221 if (cancelSequence && (uAccountSequence <= *cancelSequence))
223 JLOG(ctx.
j.
debug()) <<
"uAccountSequenceNext=" << uAccountSequence
224 <<
" uOfferSequence=" << *cancelSequence;
236 if (!saTakerPays.native())
249 auto const domainID = ctx.
tx[sfDomainID];
258 if (sleDomain->getAccountID(sfOwner) !=
id)
291 XRPL_ASSERT(!
isXRP(asset),
"xrpl::OfferCreate::checkAcceptAsset : input is not XRP");
297 JLOG(j.
debug()) <<
"delay: can't receive IOUs from non-existent issuer: "
316 if (
view.rules().enabled(fixCleanup3_4_0) &&
317 issuerAccount->isFlag(lsfDisallowIncomingTrustline))
321 JLOG(j.
debug()) <<
"delay: can't receive IOUs from issuer with "
322 "DisallowIncomingTrustline set";
327 if (issuerAccount->isFlag(lsfRequireAuth))
338 bool const canonicalGt(
id > issuer);
340 bool const isAuthorized(trustLine->isFlag(canonicalGt ? lsfLowAuth : lsfHighAuth));
344 JLOG(j.
debug()) <<
"delay: can't receive IOUs from "
345 "issuer without auth.";
358 bool const deepFrozen =
359 ((*trustLine)[sfFlags] & (lsfLowDeepFreeze | lsfHighDeepFreeze)) != 0u;
404 auto const disallowUnfunded =
409 JLOG(
j_.debug()) <<
"Not crossing: taker is unfunded.";
416 Rate gatewayXferRate{QUALITY_ONE};
424 if (gatewayXferRate.
value != QUALITY_ONE)
429 takerAmount.
in, gatewayXferRate, takerAmount.
in.
asset(),
true);
430 thresholdIn = sendMax;
448 sendMax = inStartBalance;
458 Quality threshold{takerAmount.
out, thresholdIn};
462 if (
ctx_.tx.isFlag(tfPassive))
466 if (sendMax > inStartBalance)
467 sendMax = inStartBalance;
482 auto const& deliverAsset = deliver.
asset();
484 if (
ctx_.tx.isFlag(tfSell))
491 [&](
Issue const& issue) {
510 auto const result =
flow(
517 !
ctx_.tx.isFlag(tfFillOrKill),
526 for (
auto const& toRemove : result.removableOffers)
535 auto afterCross = takerAmount;
550 afterCross.in.clear();
551 afterCross.out.clear();
557 if (
ctx_.tx.isFlag(tfSell))
567 STAmount nonGatewayAmountIn = result.actualAmountIn;
568 if (gatewayXferRate.
value != QUALITY_ONE)
571 result.actualAmountIn, gatewayXferRate, takerAmount.
in.
asset(),
true);
574 afterCross.in -= nonGatewayAmountIn;
582 afterCross.in.clear();
593 afterCross.out -= result.actualAmountOut;
596 "xrpl::OfferCreate::flowCross : minimum offer");
598 afterCross.out.clear();
599 afterCross.in =
mulRound(afterCross.out, rate, takerAmount.
in.
asset(),
true);
609 JLOG(
j_.error()) <<
"Exception during offer crossing: " << e.
what();
635 if (!sleOffer->isFieldPresent(sfDomainID))
639 sleOffer->setFlag(lsfHybrid);
642 Book const book{saTakerPays.
asset(), saTakerGets.
asset(), std::nullopt};
645 bool const bookExists = sb.
exists(dir);
650 setDir(sle, std::nullopt);
655 JLOG(
j_.debug()) <<
"final result: failed to add hybrid offer to open book";
659 STArray bookArr(sfAdditionalBooks, 1);
661 bookInfo.setFieldH256(sfBookDirectory, dir.key);
662 bookInfo.setFieldU64(sfBookNode, *bookNode);
663 bookArr.
pushBack(std::move(bookInfo));
666 ctx_.addOrderBook(book);
668 sleOffer->setFieldArray(sfAdditionalBooks, bookArr);
677 bool const bPassive(
ctx_.tx.isFlag(tfPassive));
678 bool const bImmediateOrCancel(
ctx_.tx.isFlag(tfImmediateOrCancel));
679 bool const bFillOrKill(
ctx_.tx.isFlag(tfFillOrKill));
680 bool const bSell(
ctx_.tx.isFlag(tfSell));
681 bool const bHybrid(
ctx_.tx.isFlag(tfHybrid));
683 auto saTakerPays =
ctx_.tx[sfTakerPays];
684 auto saTakerGets =
ctx_.tx[sfTakerGets];
685 auto const domainID =
ctx_.tx[~sfDomainID];
687 auto const cancelSequence =
ctx_.tx[~sfOfferSequence];
691 auto const offerSequence =
ctx_.tx.getSeqProxy();
696 auto uRate =
getRate(saTakerGets, saTakerPays);
698 auto const viewJ =
ctx_.registry.get().getJournal(
"View");
713 JLOG(
j_.debug()) <<
"Create cancels order " << *cancelSequence;
718 auto const expiration =
ctx_.tx[~sfExpiration];
727 bool crossed =
false;
728 bool const mptV2 =
ctx_.view().rules().enabled(featureMPTokensV2);
733 auto const& uPaysIssuerID = saTakerPays.
getIssuer();
734 auto const& uGetsIssuerID = saTakerGets.
getIssuer();
741 if (sle && sle->isFieldPresent(sfTickSize))
742 uTickSize =
std::min(uTickSize, (*sle)[sfTickSize]);
748 if (sle && sle->isFieldPresent(sfTickSize))
749 uTickSize =
std::min(uTickSize, (*sle)[sfTickSize]);
755 bool const unrepresentableRate = mptV2 && uRate == 0;
758 auto const rate =
Quality{saTakerGets, saTakerPays}.
round(uTickSize).
rate();
767 saTakerPays =
multiply(saTakerGets, rate, saTakerPays.
asset());
772 saTakerGets =
divide(saTakerPays, rate, saTakerGets.
asset());
774 if (!saTakerGets || !saTakerPays)
776 JLOG(
j_.debug()) <<
"Offer rounded to zero";
777 return {result,
true};
780 uRate =
getRate(saTakerGets, saTakerPays);
784 Amounts const takerAmount(saTakerGets, saTakerPays);
786 JLOG(
j_.debug()) <<
"Attempting cross: " <<
to_string(takerAmount.
in.
asset()) <<
" -> "
789 if (
auto const stream =
j_.trace())
791 stream <<
" mode: " << (bPassive ?
"passive " :
"") << (bSell ?
"sell" :
"buy");
803 std::tie(result, placeOffer) =
flowCross(psbFlow, psbCancelFlow, takerAmount, domainID);
805 psbCancelFlow.
apply(sbCancel);
811 "xrpl::OfferCreate::applyGuts : result is tesSUCCESS or "
814 if (
auto const stream =
j_.trace())
816 stream <<
"Cross result: " <<
transToken(result);
826 JLOG(
j_.debug()) <<
"final result: " <<
transToken(result);
827 return {result,
true};
832 "xrpl::OfferCreate::applyGuts : taker gets issue match");
835 "xrpl::OfferCreate::applyGuts : taker pays issue match");
837 if (takerAmount != placeOffer)
842 if (placeOffer.
in < kZero || placeOffer.
out < kZero)
844 JLOG(
j_.fatal()) <<
"Cross left offer negative!"
850 if (placeOffer.
in == kZero || placeOffer.
out == kZero)
852 JLOG(
j_.debug()) <<
"Offer fully crossed!";
853 return {result,
true};
859 saTakerPays = placeOffer.
out;
860 saTakerGets = placeOffer.
in;
865 "xrpl::OfferCreate::applyGuts : taker pays and gets positive");
869 JLOG(
j_.debug()) <<
"final result: " <<
transToken(result);
870 return {result,
true};
873 if (
auto const stream =
j_.trace())
875 stream <<
"Place" << (crossed ?
" remaining " :
" ") <<
"offer:";
884 JLOG(
j_.trace()) <<
"Fill or Kill: offer killed";
890 if (bImmediateOrCancel)
892 JLOG(
j_.trace()) <<
"Immediate or cancel: offer canceled";
910 bool cannotRest =
false;
926 if ((mptV2 && uRate == 0) || cannotRest)
928 JLOG(
j_.debug()) <<
"Unrepresentable quality or fee: remainder not placed";
950 JLOG(
j_.debug()) <<
"final result: " <<
transToken(result);
953 return {result,
true};
961 auto const ownerNode =
967 JLOG(
j_.debug()) <<
"final result: failed to add offer to owner's directory";
975 JLOG(
j_.trace()) <<
"adding to book: " <<
to_string(saTakerPays.
asset()) <<
" : "
977 << (domainID ? (
" : " +
to_string(*domainID)) :
"");
979 Book const book{saTakerPays.
asset(), saTakerGets.
asset(), domainID};
993 bool const bookExisted =
static_cast<bool>(sb.
peek(dir));
997 [&](
Issue const& issue) {
998 sle->setFieldH160(sfTakerPaysCurrency, issue.
currency);
999 sle->setFieldH160(sfTakerPaysIssuer, issue.
account);
1001 [&](
MPTIssue const& issue) { sle->setFieldH192(sfTakerPaysMPT, issue.getMptID()); });
1003 [&](
Issue const& issue) {
1004 sle->setFieldH160(sfTakerGetsCurrency, issue.
currency);
1005 sle->setFieldH160(sfTakerGetsIssuer, issue.
account);
1007 [&](
MPTIssue const& issue) { sle->setFieldH192(sfTakerGetsMPT, issue.getMptID()); });
1008 sle->setFieldU64(sfExchangeRate, uRate);
1010 sle->setFieldH256(sfDomainID, *maybeDomain);
1015 setBookDir(sle, domainID);
1021 JLOG(
j_.debug()) <<
"final result: failed to add offer to book";
1027 sleOffer->setAccountID(sfAccount,
accountID_);
1028 sleOffer->setFieldU32(sfSequence, offerSequence.value());
1029 sleOffer->setFieldH256(sfBookDirectory, dir.key);
1030 sleOffer->setFieldAmount(sfTakerPays, saTakerPays);
1031 sleOffer->setFieldAmount(sfTakerGets, saTakerGets);
1032 sleOffer->setFieldU64(sfOwnerNode, *ownerNode);
1033 sleOffer->setFieldU64(sfBookNode, *bookNode);
1035 sleOffer->setFieldU32(sfExpiration, *expiration);
1037 sleOffer->setFlag(lsfPassive);
1039 sleOffer->setFlag(lsfSell);
1041 sleOffer->setFieldH256(sfDomainID, *domainID);
1051 auto const openRate =
ctx_.view().rules().enabled(fixCleanup3_2_0)
1053 :
getRate(saTakerGets, saTakerPays);
1055 applyHybrid(sb, sleOffer, offerIndex, saTakerPays, saTakerGets, openRate, setBookDir);
1063 ctx_.addOrderBook(book);
1065 JLOG(
j_.debug()) <<
"final result: success";
1079 if (
ctx_.tx.isFieldPresent(sfDomainID) &&
ctx_.view().rules().enabled(fixCleanup3_4_0))
1081 auto const domainID =
ctx_.tx[sfDomainID];
1086 if (sleDomain->getAccountID(sfOwner) !=
accountID_)
1103 auto const result =
applyGuts(sb, sbCancel);
1112 return result.first;
A generic endpoint for log messages.
std::optional< std::uint64_t > dirInsert(Keylet const &directory, UInt256 const &key, std::function< void(SLE::Ref)> const &describe)
Insert an entry to a directory.
std::optional< std::uint64_t > dirAppend(Keylet const &directory, Keylet const &key, std::function< void(SLE::Ref)> const &describe)
Append an entry to a directory.
constexpr auto visit(Visitors &&... visitors) const -> decltype(auto)
AccountID const & getIssuer() const
A currency issued by an account.
AccountID const & getIssuer() const
AccountID const & getIssuer() const
static TER preclaim(PreclaimContext const &ctx)
Enforce constraints beyond those of the Transactor base class.
static TER checkAcceptAsset(ReadView const &view, ApplyFlags const flags, AccountID const id, beast::Journal const j, Asset const &asset)
bool finalizeInvariants(STTx const &tx, TER result, XRPAmount fee, ReadView const &view, beast::Journal const &j) override
Check transaction-specific post-conditions after all entries have been visited.
TER doApply() override
Precondition: fee collection is likely.
static TxConsequences makeTxConsequences(PreflightContext const &ctx)
static bool checkExtraFeatures(PreflightContext const &ctx)
void visitInvariantEntry(bool isDelete, SLE::ConstRef before, SLE::ConstRef after) override
Inspect a single ledger entry modified by this transaction.
static NotTEC preflight(PreflightContext const &ctx)
Enforce constraints beyond those of the Transactor base class.
std::pair< TER, bool > applyGuts(Sandbox &view, Sandbox &viewCancel)
std::pair< TER, Amounts > flowCross(PaymentSandbox &psb, PaymentSandbox &psbCancel, Amounts const &takerAmount, std::optional< UInt256 > const &domainID)
static std::string formatAmount(STAmount const &amount)
static std::uint32_t getFlagsMask(PreflightContext const &ctx)
TER applyHybrid(Sandbox &sb, STLedgerEntry::pointer sleOffer, Keylet const &offerIndex, STAmount const &saTakerPays, STAmount const &saTakerGets, std::uint64_t openRate, std::function< void(SLE::Ref, std::optional< UInt256 >)> const &setDir)
A wrapper which makes credits unavailable to balances.
void apply(RawView &to)
Apply changes to base view.
Represents the logical ratio of output currency to input currency.
static int const kMaxTickSize
STAmount rate() const
Returns the quality as STAmount.
Quality round(int tickSize) const
Returns the quality rounded up to the specified number of decimal digits.
virtual Rules const & rules() const =0
Returns the tx processing rules.
virtual SLE::const_pointer read(Keylet const &k) const =0
Return the state item associated with a key.
bool enabled(UInt256 const &feature) const
Returns true if a feature is enabled.
constexpr bool holds() const noexcept
std::string getFullText() const override
std::uint64_t mantissa() const noexcept
std::string getText() const override
bool integral() const noexcept
bool native() const noexcept
Asset const & asset() const
AccountID const & getIssuer() const
static constexpr std::uint64_t kMaxValue
static constexpr std::uint64_t kMaxNative
static constexpr int kMaxOffset
void pushBack(STObject const &object)
std::shared_ptr< STLedgerEntry > pointer
std::shared_ptr< STLedgerEntry const > const & ConstRef
std::shared_ptr< STLedgerEntry > const & Ref
bool isFieldPresent(SField const &field) const
static STObject makeInnerObject(SField const &name)
bool emplaceBack(Args &&... args)
emplaceBack adds a path to the set.
Discardable, editable view to a ledger.
static constexpr SeqProxy rawSequence(std::uint32_t v)
Factory function to return a sequence-based SeqProxy.
AccountID const accountID_
Class describing the consequences to the account of applying a transaction if the transaction consume...
void insert(SLE::Ref sle) override
Insert a new state SLE.
SLE::pointer peek(Keylet const &k) override
Prepare to modify the SLE associated with key.
bool open() const override
Returns true if this reflects an open ledger.
SLE::const_pointer read(Keylet const &k) const override
Return the state item associated with a key.
Rules const & rules() const override
Returns the tx processing rules.
bool exists(Keylet const &k) const override
Determine if a state item exists.
TER validDomain(ReadView const &view, UInt256 domainID, AccountID const &subject)
Keylet quality(Keylet const &k, std::uint64_t const q) noexcept
The initial directory page for a specific quality.
Keylet offer(AccountID const &id, SeqProxy const &seq) noexcept
An offer from an account.
Keylet book(Book const &b)
The beginning of an order book.
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Keylet permissionedDomain(AccountID const &account, SeqProxy const &seq) noexcept
Keylet account(AccountID const &id) noexcept
AccountID root.
Keylet trustLine(AccountID const &id0, AccountID const &id1, Currency const ¤cy) noexcept
The index of a trust line for a given currency.
bool accountInDomain(ReadView const &view, AccountID const &account, Domain const &domainID)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
STAmount divide(STAmount const &amount, Rate const &rate)
TER offerDelete(ApplyView &view, SLE::Ref sle, beast::Journal j)
Delete an offer.
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp, ExpiryComparison comparison=ExpiryComparison::Inclusive)
Determines whether the given expiration time has passed.
bool isXRP(AccountID const &c)
TAmounts< STAmount, STAmount > Amounts
TER checkFrozen(ReadView const &view, AccountID const &account, Issue const &issue)
bool isLegalNet(STAmount const &value)
void increaseOwnerCount(ApplyView &view, SLE::Ref accountSle, SLE::Ref sponsorSle, std::uint32_t count, beast::Journal j)
Increase owner-count fields when the caller supplies the sponsor.
std::string transToken(TER code)
Currency const & xrpCurrency()
XRP currency.
std::string to_string(BaseUInt< Bits, Tag > const &a)
TER canTrade(ReadView const &view, Asset const &asset, std::uint8_t depth=0)
Check whether asset may be traded on the DEX.
std::optional< MPTAmount > tryMulRatio(MPTAmount const &amt, std::uint32_t num, std::uint32_t den, bool roundUp)
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
TERSubset< CanCvtToNotTEC > NotTEC
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.
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
TER verifyValidDomain(ApplyView &view, AccountID const &account, UInt256 domainID, beast::Journal j)
STAmount multiplyRound(STAmount const &amount, Rate const &rate, bool roundUp)
Rate const kParityRate
A transfer rate signifying a 1:1 exchange.
std::uint64_t getRate(STAmount const &offerOut, STAmount const &offerIn)
TER checkGlobalFrozen(ReadView const &view, Asset const &asset)
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
STAmount mulRound(STAmount const &v1, STAmount const &v2, Asset const &asset, bool roundUp)
bool isTesSuccess(TER x) noexcept
STAmount divRoundStrict(STAmount const &v1, STAmount const &v2, Asset const &asset, bool roundUp)
TERSubset< CanCvtToTER > TER
XRPAmount accountReserve(ReadView const &view, SLE::ConstRef sle, beast::Journal j, Adjustment adj={})
Returns the account reserve, in drops.
TER requireAuth(ReadView const &view, MPTIssue const &mptIssue, AccountID const &account, AuthType authType=AuthType::Legacy, std::uint8_t depth=0)
Check if the account lacks required authorization for MPT.
Issue const & noIssue()
Returns an asset specifier that represents no account and currency.
STAmount multiply(STAmount const &amount, Number const &frac, Number::RoundingMode rm)
bool isTecClaim(TER x) noexcept
BadAsset const & badAsset()
std::function< void(SLE::Ref)> describeOwnerDir(AccountID const &account)
Returns a function that sets the owner on a directory SLE.
constexpr std::uint64_t kMaxMpTokenAmount
The maximum amount of MPTokenIssuance.
STAmount divideRound(STAmount const &amount, Rate const &rate, bool roundUp)
A pair of SHAMap key and LedgerEntryType.
State information when determining if a tx is likely to claim a fee.
std::reference_wrapper< ServiceRegistry > registry
State information when preflighting a tx.
Represents a transfer rate.