xrpld
Loading...
Searching...
No Matches
NFTokenAcceptOffer.cpp
1#include <xrpl/tx/transactors/nft/NFTokenAcceptOffer.h>
2
3#include <xrpl/basics/Log.h>
4#include <xrpl/basics/base_uint.h>
5#include <xrpl/beast/utility/Zero.h>
6#include <xrpl/core/ServiceRegistry.h>
7#include <xrpl/ledger/View.h>
8#include <xrpl/ledger/helpers/NFTokenHelpers.h>
9#include <xrpl/ledger/helpers/TokenHelpers.h>
10#include <xrpl/protocol/Feature.h>
11#include <xrpl/protocol/Indexes.h>
12#include <xrpl/protocol/Issue.h>
13#include <xrpl/protocol/LedgerFormats.h>
14#include <xrpl/protocol/Rate.h>
15#include <xrpl/protocol/SField.h>
16#include <xrpl/protocol/STLedgerEntry.h>
17#include <xrpl/protocol/STTx.h>
18#include <xrpl/protocol/TER.h>
19#include <xrpl/protocol/XRPAmount.h>
20#include <xrpl/protocol/nft.h>
21#include <xrpl/tx/Transactor.h>
22
23#include <cstdint>
24#include <optional>
25#include <utility>
26
27namespace xrpl {
28
31{
32 auto const bo = ctx.tx[~sfNFTokenBuyOffer];
33 auto const so = ctx.tx[~sfNFTokenSellOffer];
34
35 // At least one of these MUST be specified
36 if (!bo && !so)
37 return temMALFORMED;
38
39 // The `BrokerFee` field must not be present in direct mode but may be
40 // present and greater than zero in brokered mode.
41 if (auto const bf = ctx.tx[~sfNFTokenBrokerFee])
42 {
43 if (!bo || !so)
44 return temMALFORMED;
45
46 if (*bf <= beast::kZero)
47 return temMALFORMED;
48 }
49
50 return tesSUCCESS;
51}
52
53TER
55{
56 auto const checkOffer =
58 if (id)
59 {
60 if (id->isZero())
61 return {nullptr, tecOBJECT_NOT_FOUND};
62
63 auto offerSLE = ctx.view.read(keylet::nftokenOffer(*id));
64
65 if (!offerSLE)
66 return {nullptr, tecOBJECT_NOT_FOUND};
67
68 if (hasExpired(ctx.view, (*offerSLE)[~sfExpiration]))
69 {
70 // Before fixCleanup3_1_3 amendment, expired offers caused tecEXPIRED in preclaim,
71 // leaving them on ledger forever. After the amendment, we allow expired offers to
72 // reach doApply() where they get deleted and tecEXPIRED is returned.
73 if (!ctx.view.rules().enabled(fixCleanup3_1_3))
74 return {nullptr, tecEXPIRED};
75 // Amendment enabled: return the expired offer to be handled in doApply.
76 }
77
78 if ((*offerSLE)[sfAmount].negative())
79 return {nullptr, temBAD_OFFER};
80
81 return {std::move(offerSLE), tesSUCCESS};
82 }
83 return {nullptr, tesSUCCESS};
84 };
85
86 auto const [bo, err1] = checkOffer(ctx.tx[~sfNFTokenBuyOffer]);
87 if (!isTesSuccess(err1))
88 return err1;
89 auto const [so, err2] = checkOffer(ctx.tx[~sfNFTokenSellOffer]);
90 if (!isTesSuccess(err2))
91 return err2;
92
93 if (bo && so)
94 {
95 // Brokered mode:
96 // The two offers being brokered must be for the same token:
97 if ((*bo)[sfNFTokenID] != (*so)[sfNFTokenID])
99
100 // The two offers being brokered must be for the same asset:
101 if ((*bo)[sfAmount].asset() != (*so)[sfAmount].asset())
103
104 // The two offers may not form a loop. A broker may not sell the
105 // token to the current owner of the token.
106 if (((*bo)[sfOwner] == (*so)[sfOwner]))
108
109 // Ensure that the buyer is willing to pay at least as much as the
110 // seller is requesting:
111 if ((*so)[sfAmount] > (*bo)[sfAmount])
113
114 // The destination must be whoever is submitting the tx if the buyer
115 // specified it
116 if (auto const dest = bo->at(~sfDestination); dest && *dest != ctx.tx[sfAccount])
117 {
118 return tecNO_PERMISSION;
119 }
120
121 // The destination must be whoever is submitting the tx if the seller
122 // specified it
123 if (auto const dest = so->at(~sfDestination); dest && *dest != ctx.tx[sfAccount])
124 {
125 return tecNO_PERMISSION;
126 }
127
128 // The broker can specify an amount that represents their cut; if they
129 // have, ensure that the seller will get at least as much as they want
130 // to get *after* this fee is accounted for (but before the issuer's
131 // cut, if any).
132 if (auto const brokerFee = ctx.tx[~sfNFTokenBrokerFee])
133 {
134 if (brokerFee->asset() != (*bo)[sfAmount].asset())
136
137 if (brokerFee >= (*bo)[sfAmount])
139
140 if ((*so)[sfAmount] > (*bo)[sfAmount] - *brokerFee)
142
143 // Check if broker is allowed to receive the fee with these IOUs.
144 if (!brokerFee->native() && ctx.view.rules().enabled(fixEnforceNFTokenTrustlineV2))
145 {
147 ctx.view, ctx.tx[sfAccount], ctx.j, brokerFee->asset().get<Issue>());
148 if (!isTesSuccess(res))
149 return res;
150
152 ctx.view, ctx.tx[sfAccount], ctx.j, brokerFee->asset().get<Issue>());
153 if (!isTesSuccess(res))
154 return res;
155 }
156 }
157 }
158
159 if (bo)
160 {
161 if (bo->isFlag(lsfSellNFToken))
163
164 // An account can't accept an offer it placed:
165 if ((*bo)[sfOwner] == ctx.tx[sfAccount])
167
168 // If not in bridged mode, the account must own the token:
169 if (!so && !nft::findToken(ctx.view, ctx.tx[sfAccount], (*bo)[sfNFTokenID]))
170 return tecNO_PERMISSION;
171
172 // If not in bridged mode...
173 if (!so)
174 {
175 // If the offer has a Destination field, the acceptor must be the
176 // Destination.
177 if (auto const dest = bo->at(~sfDestination);
178 dest.has_value() && *dest != ctx.tx[sfAccount])
179 return tecNO_PERMISSION;
180 }
181
182 // The account offering to buy must have funds:
183 //
184 // After this amendment, we allow an IOU issuer to buy an NFT with their
185 // own currency
186 auto const needed = bo->at(sfAmount);
187
188 if (accountFunds(ctx.view, (*bo)[sfOwner], needed, FreezeHandling::ZeroIfFrozen, ctx.j) <
189 needed)
191
192 // Check that the account accepting the buy offer (he's selling the NFT)
193 // is allowed to receive IOUs. Also check that this offer's creator is
194 // authorized. But we need to exclude the case when the transaction is
195 // created by the broker.
196 if (ctx.view.rules().enabled(fixEnforceNFTokenTrustlineV2) && !needed.native())
197 {
199 ctx.view, bo->at(sfOwner), ctx.j, needed.asset().get<Issue>());
200 if (!isTesSuccess(res))
201 return res;
202
203 if (!so)
204 {
206 ctx.view, ctx.tx[sfAccount], ctx.j, needed.asset().get<Issue>());
207 if (!isTesSuccess(res))
208 return res;
209
211 ctx.view, ctx.tx[sfAccount], ctx.j, needed.asset().get<Issue>());
212 if (!isTesSuccess(res))
213 return res;
214 }
215 }
216 }
217
218 if (so)
219 {
220 if (!so->isFlag(lsfSellNFToken))
222
223 // An account can't accept an offer it placed:
224 if ((*so)[sfOwner] == ctx.tx[sfAccount])
226
227 // The seller must own the token.
228 if (!nft::findToken(ctx.view, (*so)[sfOwner], (*so)[sfNFTokenID]))
229 return tecNO_PERMISSION;
230
231 // If not in bridged mode...
232 if (!bo)
233 {
234 // If the offer has a Destination field, the acceptor must be the
235 // Destination.
236 if (auto const dest = so->at(~sfDestination);
237 dest.has_value() && *dest != ctx.tx[sfAccount])
238 return tecNO_PERMISSION;
239 }
240
241 // The account offering to buy must have funds:
242 auto const needed = so->at(sfAmount);
243 if (!bo)
244 {
245 // After this amendment, we allow buyers to buy with their own
246 // issued currency.
247 //
248 // In the case of brokered mode, this check is essentially
249 // redundant, since we have already confirmed that buy offer is >
250 // than the sell offer, and that the buyer can cover the buy
251 // offer.
252 //
253 // We also _must not_ check the tx submitter in brokered
254 // mode, because then we are confirming that the broker can
255 // cover what the buyer will pay, which doesn't make sense, causes
256 // an unnecessary tec, and is also resolved with this amendment.
257 if (accountFunds(
258 ctx.view, ctx.tx[sfAccount], needed, FreezeHandling::ZeroIfFrozen, ctx.j) <
259 needed)
261 }
262
263 // Make sure that we are allowed to hold what the taker will pay us.
264 if (!needed.native())
265 {
266 if (ctx.view.rules().enabled(fixEnforceNFTokenTrustlineV2))
267 {
269 ctx.view, (*so)[sfOwner], ctx.j, needed.asset().get<Issue>());
270 if (!isTesSuccess(res))
271 return res;
272
273 if (!bo)
274 {
276 ctx.view, ctx.tx[sfAccount], ctx.j, needed.asset().get<Issue>());
277 if (!isTesSuccess(res))
278 return res;
279 }
280 }
281
282 auto const res = nft::checkTrustlineDeepFrozen(
283 ctx.view, (*so)[sfOwner], ctx.j, needed.asset().get<Issue>());
284 if (!isTesSuccess(res))
285 return res;
286 }
287 }
288
289 // Additional checks are required in case a minter set a transfer fee for
290 // this nftoken
291 auto const& offer = bo ? bo : so;
292 if (!offer)
293 {
294 // Purely defensive, should be caught in preflight.
295 return tecINTERNAL; // LCOV_EXCL_LINE
296 }
297
298 auto const& tokenID = offer->at(sfNFTokenID);
299 auto const& amount = offer->at(sfAmount);
300 auto const nftMinter = nft::getIssuer(tokenID);
301
302 if (nft::getTransferFee(tokenID) != 0 && !amount.native())
303 {
304 // Fix a bug where the transfer of an NFToken with a transfer fee could
305 // give the NFToken issuer an undesired trust line.
306 // Issuer doesn't need a trust line to accept their own currency.
307 if (ctx.view.rules().enabled(fixEnforceNFTokenTrustline) &&
308 (nft::getFlags(tokenID) & nft::kFlagCreateTrustLines) == 0 &&
309 nftMinter != amount.getIssuer() &&
310 !ctx.view.read(keylet::trustLine(nftMinter, amount.get<Issue>())))
311 return tecNO_LINE;
312
313 // Check that the issuer is allowed to receive IOUs.
314 if (ctx.view.rules().enabled(fixEnforceNFTokenTrustlineV2))
315 {
317 ctx.view, nftMinter, ctx.j, amount.asset().get<Issue>());
318 if (!isTesSuccess(res))
319 return res;
320
322 ctx.view, nftMinter, ctx.j, amount.asset().get<Issue>());
323 if (!isTesSuccess(res))
324 return res;
325 }
326 }
327
328 return tesSUCCESS;
329}
330
331TER
332NFTokenAcceptOffer::pay(AccountID const& from, AccountID const& to, STAmount const& amount)
333{
334 // This should never happen, but it's easy and quick to check.
335 if (amount < beast::kZero)
336 return tecINTERNAL; // LCOV_EXCL_LINE
337
338 auto const result = accountSend(view(), from, to, amount, j_);
339
340 // If any payment causes a non-IOU-issuer to have a negative balance,
341 // or an IOU-issuer to have a positive balance in their own currency,
342 // we know that something went wrong. This was originally found in the
343 // context of IOU transfer fees. Since there are several payouts in this tx,
344 // just confirm that the end state is OK.
345 if (!isTesSuccess(result))
346 return result;
347 if (accountFunds(view(), from, amount, FreezeHandling::ZeroIfFrozen, j_).signum() < 0)
349 if (accountFunds(view(), to, amount, FreezeHandling::ZeroIfFrozen, j_).signum() < 0)
351 return tesSUCCESS;
352}
353
354TER
356 AccountID const& buyer,
357 AccountID const& seller,
358 uint256 const& nftokenID)
359{
360 auto tokenAndPage = nft::findTokenAndPage(view(), seller, nftokenID);
361
362 if (!tokenAndPage)
363 return tecINTERNAL; // LCOV_EXCL_LINE
364
365 if (auto const ret = nft::removeToken(view(), seller, nftokenID, tokenAndPage->page);
366 !isTesSuccess(ret))
367 return ret;
368
369 auto const sleBuyer = view().read(keylet::account(buyer));
370 if (!sleBuyer)
371 return tecINTERNAL; // LCOV_EXCL_LINE
372
373 std::uint32_t const buyerOwnerCountBefore = sleBuyer->getFieldU32(sfOwnerCount);
374
375 auto const insertRet = nft::insertToken(view(), buyer, std::move(tokenAndPage->token));
376
377 // There was an issue where the buyer accepts a sell offer, the ledger
378 // didn't check if the buyer has enough reserve, meaning that buyer can get
379 // NFTs free of reserve.
380 // To check if there is sufficient reserve, we cannot use preFeeBalance_
381 // because NFT is sold for a price. So we must use the balance after
382 // the deduction of the potential offer price. A small caveat here is
383 // that the balance has already deducted the transaction fee, meaning
384 // that the reserve requirement is a few drops higher.
385 auto const buyerBalance = sleBuyer->getFieldAmount(sfBalance);
386
387 auto const buyerOwnerCountAfter = sleBuyer->getFieldU32(sfOwnerCount);
388 if (buyerOwnerCountAfter > buyerOwnerCountBefore)
389 {
390 if (auto const reserve = view().fees().accountReserve(buyerOwnerCountAfter);
391 buyerBalance < reserve)
393 }
394
395 return insertRet;
396}
397
398TER
400{
401 bool const isSell = offer->isFlag(lsfSellNFToken);
402 AccountID const owner = (*offer)[sfOwner];
403 AccountID const& seller = isSell ? owner : accountID_;
404 AccountID const& buyer = isSell ? accountID_ : owner;
405
406 auto const nftokenID = (*offer)[sfNFTokenID];
407
408 if (auto amount = offer->getFieldAmount(sfAmount); amount != beast::kZero)
409 {
410 // Calculate the issuer's cut from this sale, if any:
411 if (auto const fee = nft::getTransferFee(nftokenID); fee != 0)
412 {
413 auto const cut = multiply(amount, nft::transferFeeAsRate(fee));
414
415 if (auto const issuer = nft::getIssuer(nftokenID);
416 cut != beast::kZero && seller != issuer && buyer != issuer)
417 {
418 if (auto const r = pay(buyer, issuer, cut); !isTesSuccess(r))
419 return r;
420 amount -= cut;
421 }
422 }
423
424 // Send the remaining funds to the seller of the NFT
425 if (auto const r = pay(buyer, seller, amount); !isTesSuccess(r))
426 return r;
427 }
428
429 // Now transfer the NFT:
430 return transferNFToken(buyer, seller, nftokenID);
431}
432
433TER
435{
436 auto const loadToken = [this](std::optional<uint256> const& id) {
437 SLE::pointer sle;
438 if (id)
439 sle = view().peek(keylet::nftokenOffer(*id));
440 return sle;
441 };
442
443 auto bo = loadToken(ctx_.tx[~sfNFTokenBuyOffer]);
444 auto so = loadToken(ctx_.tx[~sfNFTokenSellOffer]);
445
446 // With fixCleanup3_1_3 amendment, check for expired offers and delete them, returning
447 // tecEXPIRED. This ensures expired offers are properly cleaned up from the ledger.
448 if (view().rules().enabled(fixCleanup3_1_3))
449 {
450 bool foundExpired = false;
451
452 auto const deleteOfferIfExpired = [this, &foundExpired](SLE::ref offer) -> TER {
453 if (offer && hasExpired(view(), (*offer)[~sfExpiration]))
454 {
455 JLOG(j_.trace()) << "Offer is expired, deleting: " << offer->key();
456 if (!nft::deleteTokenOffer(view(), offer))
457 {
458 // LCOV_EXCL_START
459 JLOG(j_.fatal())
460 << "Unable to delete expired offer '" << offer->key() << "': ignoring";
461 return tecINTERNAL;
462 // LCOV_EXCL_STOP
463 }
464 JLOG(j_.trace()) << "Deleted offer " << offer->key();
465 foundExpired = true;
466 }
467 return tesSUCCESS;
468 };
469
470 if (auto const r = deleteOfferIfExpired(bo); !isTesSuccess(r))
471 return r;
472 if (auto const r = deleteOfferIfExpired(so); !isTesSuccess(r))
473 return r;
474
475 if (foundExpired)
476 return tecEXPIRED;
477 }
478
479 if (bo && !nft::deleteTokenOffer(view(), bo))
480 {
481 // LCOV_EXCL_START
482 JLOG(j_.fatal()) << "Unable to delete buy offer '" << to_string(bo->key()) << "': ignoring";
483 return tecINTERNAL;
484 // LCOV_EXCL_STOP
485 }
486
487 if (so && !nft::deleteTokenOffer(view(), so))
488 {
489 // LCOV_EXCL_START
490 JLOG(j_.fatal()) << "Unable to delete sell offer '" << to_string(so->key())
491 << "': ignoring";
492 return tecINTERNAL;
493 // LCOV_EXCL_STOP
494 }
495
496 // Bridging two different offers
497 if (bo && so)
498 {
499 AccountID const buyer = (*bo)[sfOwner];
500 AccountID const seller = (*so)[sfOwner];
501
502 auto const nftokenID = (*so)[sfNFTokenID];
503
504 // The amount is what the buyer of the NFT pays:
505 STAmount amount = (*bo)[sfAmount];
506
507 // Three different folks may be paid. The order of operations is
508 // important.
509 //
510 // o The broker is paid the cut they requested.
511 // o The issuer's cut is calculated from what remains after the
512 // broker is paid. The issuer can take up to 50% of the remainder.
513 // o Finally, the seller gets whatever is left.
514 //
515 // It is important that the issuer's cut be calculated after the
516 // broker's portion is already removed. Calculating the issuer's
517 // cut before the broker's cut is removed can result in more money
518 // being paid out than the seller authorized. That would be bad!
519
520 // Send the broker the amount they requested.
521 if (auto const cut = ctx_.tx[~sfNFTokenBrokerFee]; cut && cut.value() != beast::kZero)
522 {
523 if (auto const r = pay(buyer, accountID_, cut.value()); !isTesSuccess(r))
524 return r;
525
526 amount -= cut.value();
527 }
528
529 // Calculate the issuer's cut, if any.
530 if (auto const fee = nft::getTransferFee(nftokenID); amount != beast::kZero && fee != 0)
531 {
532 auto cut = multiply(amount, nft::transferFeeAsRate(fee));
533
534 if (auto const issuer = nft::getIssuer(nftokenID); seller != issuer && buyer != issuer)
535 {
536 if (auto const r = pay(buyer, issuer, cut); !isTesSuccess(r))
537 return r;
538
539 amount -= cut;
540 }
541 }
542
543 // And send whatever remains to the seller.
544 if (amount > beast::kZero)
545 {
546 if (auto const r = pay(buyer, seller, amount); !isTesSuccess(r))
547 return r;
548 }
549
550 // Now transfer the NFT:
551 return transferNFToken(buyer, seller, nftokenID);
552 }
553
554 if (bo)
555 return acceptOffer(bo);
556
557 if (so)
558 return acceptOffer(so);
559
560 return tecINTERNAL; // LCOV_EXCL_LINE
561}
562
563void
565{
566 // No transaction-specific invariants yet (future work).
567}
568
569bool
571 STTx const&,
572 TER,
573 XRPAmount,
574 ReadView const&,
575 beast::Journal const&)
576{
577 // No transaction-specific invariants yet (future work).
578 return true;
579}
580
581} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:38
virtual SLE::pointer peek(Keylet const &k)=0
Prepare to modify the SLE associated with key.
A currency issued by an account.
Definition Issue.h:13
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 transferNFToken(AccountID const &buyer, AccountID const &seller, uint256 const &nfTokenID)
TER pay(AccountID const &from, AccountID const &to, STAmount const &amount)
static NotTEC preflight(PreflightContext const &ctx)
static TER preclaim(PreclaimContext const &ctx)
void visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override
Inspect a single ledger entry modified by this transaction.
TER acceptOffer(SLE::ref offer)
A view into a ledger.
Definition ReadView.h:31
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.
Definition Rules.cpp:171
STAmount const & value() const noexcept
Definition STAmount.h:592
std::shared_ptr< STLedgerEntry > const & ref
std::shared_ptr< STLedgerEntry > pointer
std::shared_ptr< STLedgerEntry const > const & const_ref
beast::Journal const j_
Definition Transactor.h:118
ApplyView & view()
Definition Transactor.h:136
AccountID const accountID_
Definition Transactor.h:120
ApplyContext & ctx_
Definition Transactor.h:116
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition Indexes.cpp:186
Keylet nftokenOffer(AccountID const &owner, std::uint32_t seq)
An offer from an account to buy or sell an NFT.
Definition Indexes.cpp:407
Keylet trustLine(AccountID const &id0, AccountID const &id1, Currency const &currency) noexcept
The index of a trust line for a given currency.
Definition Indexes.cpp:241
TER insertToken(ApplyView &view, AccountID owner, STObject &&nft)
Insert the token in the owner's token directory.
constexpr std::uint16_t const kFlagCreateTrustLines
Definition nft.h:34
TER removeToken(ApplyView &view, AccountID const &owner, uint256 const &nftokenID)
Remove the token from the owner's token directory.
TER checkTrustlineDeepFrozen(ReadView const &view, AccountID const id, beast::Journal const j, Issue const &issue)
TER checkTrustlineAuthorized(ReadView const &view, AccountID const id, beast::Journal const j, Issue const &issue)
std::optional< STObject > findToken(ReadView const &view, AccountID const &owner, uint256 const &nftokenID)
Finds the specified token in the owner's token directory.
AccountID getIssuer(uint256 const &id)
Definition nft.h:99
std::uint16_t getTransferFee(uint256 const &id)
Definition nft.h:47
bool deleteTokenOffer(ApplyView &view, SLE::ref offer)
Deletes the given token offer.
std::optional< TokenAndPage > findTokenAndPage(ApplyView &view, AccountID const &owner, uint256 const &nftokenID)
Rate transferFeeAsRate(std::uint16_t fee)
Given a transfer fee (in basis points) convert it to a transfer rate.
Definition Rate2.cpp:26
std::uint16_t getFlags(uint256 const &id)
Definition nft.h:39
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
Definition View.cpp:47
std::string to_string(BaseUInt< Bits, Tag > const &a)
Definition base_uint.h:633
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
TERSubset< CanCvtToNotTEC > NotTEC
Definition TER.h:594
TER accountSend(ApplyView &view, AccountID const &from, AccountID const &to, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee=WaiveTransferFee::No, AllowMPTOverflow allowOverflow=AllowMPTOverflow::No)
Calls static accountSendIOU if saAmount represents Issue.
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:28
@ temMALFORMED
Definition TER.h:73
@ temBAD_OFFER
Definition TER.h:81
bool isTesSuccess(TER x) noexcept
Definition TER.h:663
TERSubset< CanCvtToTER > TER
Definition TER.h:634
@ tecCANT_ACCEPT_OWN_NFTOKEN_OFFER
Definition TER.h:322
@ tecOBJECT_NOT_FOUND
Definition TER.h:324
@ tecINTERNAL
Definition TER.h:308
@ tecNFTOKEN_BUY_SELL_MISMATCH
Definition TER.h:320
@ tecINSUFFICIENT_FUNDS
Definition TER.h:323
@ tecEXPIRED
Definition TER.h:312
@ tecNO_LINE
Definition TER.h:299
@ tecNFTOKEN_OFFER_TYPE_MISMATCH
Definition TER.h:321
@ tecINSUFFICIENT_RESERVE
Definition TER.h:305
@ tecNO_PERMISSION
Definition TER.h:303
@ tecINSUFFICIENT_PAYMENT
Definition TER.h:325
STAmount multiply(STAmount const &amount, Number const &frac, Number::RoundingMode rm)
BaseUInt< 256 > uint256
Definition base_uint.h:562
@ tesSUCCESS
Definition TER.h:240
uint256 key
Definition Keylet.h:20
State information when determining if a tx is likely to claim a fee.
Definition Transactor.h:61
ReadView const & view
Definition Transactor.h:64
beast::Journal const j
Definition Transactor.h:69
State information when preflighting a tx.
Definition Transactor.h:18