rippled
InvariantCheck.cpp
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2012-2016 Ripple Labs Inc.
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 //==============================================================================
19 
20 #include <ripple/app/tx/impl/InvariantCheck.h>
21 
22 #include <ripple/app/tx/impl/details/NFTokenUtils.h>
23 #include <ripple/basics/FeeUnits.h>
24 #include <ripple/basics/Log.h>
25 #include <ripple/ledger/ReadView.h>
26 #include <ripple/ledger/View.h>
27 #include <ripple/protocol/Feature.h>
28 #include <ripple/protocol/STArray.h>
29 #include <ripple/protocol/SystemParameters.h>
30 #include <ripple/protocol/TxFormats.h>
31 #include <ripple/protocol/nftPageMask.h>
32 
33 namespace ripple {
34 
35 void
37  bool,
40 {
41  // nothing to do
42 }
43 
44 bool
46  STTx const& tx,
47  TER const,
48  XRPAmount const fee,
49  ReadView const&,
50  beast::Journal const& j)
51 {
52  // We should never charge a negative fee
53  if (fee.drops() < 0)
54  {
55  JLOG(j.fatal()) << "Invariant failed: fee paid was negative: "
56  << fee.drops();
57  return false;
58  }
59 
60  // We should never charge a fee that's greater than or equal to the
61  // entire XRP supply.
62  if (fee >= INITIAL_XRP)
63  {
64  JLOG(j.fatal()) << "Invariant failed: fee paid exceeds system limit: "
65  << fee.drops();
66  return false;
67  }
68 
69  // We should never charge more for a transaction than the transaction
70  // authorizes. It's possible to charge less in some circumstances.
71  if (fee > tx.getFieldAmount(sfFee).xrp())
72  {
73  JLOG(j.fatal()) << "Invariant failed: fee paid is " << fee.drops()
74  << " exceeds fee specified in transaction.";
75  return false;
76  }
77 
78  return true;
79 }
80 
81 //------------------------------------------------------------------------------
82 
83 void
85  bool isDelete,
86  std::shared_ptr<SLE const> const& before,
88 {
89  /* We go through all modified ledger entries, looking only at account roots,
90  * escrow payments, and payment channels. We remove from the total any
91  * previous XRP values and add to the total any new XRP values. The net
92  * balance of a payment channel is computed from two fields (amount and
93  * balance) and deletions are ignored for paychan and escrow because the
94  * amount fields have not been adjusted for those in the case of deletion.
95  */
96  if (before)
97  {
98  switch (before->getType())
99  {
100  case ltACCOUNT_ROOT:
101  drops_ -= (*before)[sfBalance].xrp().drops();
102  break;
103  case ltPAYCHAN:
104  drops_ -=
105  ((*before)[sfAmount] - (*before)[sfBalance]).xrp().drops();
106  break;
107  case ltESCROW:
108  drops_ -= (*before)[sfAmount].xrp().drops();
109  break;
110  default:
111  break;
112  }
113  }
114 
115  if (after)
116  {
117  switch (after->getType())
118  {
119  case ltACCOUNT_ROOT:
120  drops_ += (*after)[sfBalance].xrp().drops();
121  break;
122  case ltPAYCHAN:
123  if (!isDelete)
124  drops_ += ((*after)[sfAmount] - (*after)[sfBalance])
125  .xrp()
126  .drops();
127  break;
128  case ltESCROW:
129  if (!isDelete)
130  drops_ += (*after)[sfAmount].xrp().drops();
131  break;
132  default:
133  break;
134  }
135  }
136 }
137 
138 bool
140  STTx const& tx,
141  TER const,
142  XRPAmount const fee,
143  ReadView const&,
144  beast::Journal const& j)
145 {
146  // The net change should never be positive, as this would mean that the
147  // transaction created XRP out of thin air. That's not possible.
148  if (drops_ > 0)
149  {
150  JLOG(j.fatal()) << "Invariant failed: XRP net change was positive: "
151  << drops_;
152  return false;
153  }
154 
155  // The negative of the net change should be equal to actual fee charged.
156  if (-drops_ != fee.drops())
157  {
158  JLOG(j.fatal()) << "Invariant failed: XRP net change of " << drops_
159  << " doesn't match fee " << fee.drops();
160  return false;
161  }
162 
163  return true;
164 }
165 
166 //------------------------------------------------------------------------------
167 
168 void
170  bool,
171  std::shared_ptr<SLE const> const& before,
173 {
174  auto isBad = [](STAmount const& balance) {
175  if (!balance.native())
176  return true;
177 
178  auto const drops = balance.xrp();
179 
180  // Can't have more than the number of drops instantiated
181  // in the genesis ledger.
182  if (drops > INITIAL_XRP)
183  return true;
184 
185  // Can't have a negative balance (0 is OK)
186  if (drops < XRPAmount{0})
187  return true;
188 
189  return false;
190  };
191 
192  if (before && before->getType() == ltACCOUNT_ROOT)
193  bad_ |= isBad((*before)[sfBalance]);
194 
195  if (after && after->getType() == ltACCOUNT_ROOT)
196  bad_ |= isBad((*after)[sfBalance]);
197 }
198 
199 bool
201  STTx const&,
202  TER const,
203  XRPAmount const,
204  ReadView const&,
205  beast::Journal const& j)
206 {
207  if (bad_)
208  {
209  JLOG(j.fatal()) << "Invariant failed: incorrect account XRP balance";
210  return false;
211  }
212 
213  return true;
214 }
215 
216 //------------------------------------------------------------------------------
217 
218 void
220  bool isDelete,
221  std::shared_ptr<SLE const> const& before,
223 {
224  auto isBad = [](STAmount const& pays, STAmount const& gets) {
225  // An offer should never be negative
226  if (pays < beast::zero)
227  return true;
228 
229  if (gets < beast::zero)
230  return true;
231 
232  // Can't have an XRP to XRP offer:
233  return pays.native() && gets.native();
234  };
235 
236  if (before && before->getType() == ltOFFER)
237  bad_ |= isBad((*before)[sfTakerPays], (*before)[sfTakerGets]);
238 
239  if (after && after->getType() == ltOFFER)
240  bad_ |= isBad((*after)[sfTakerPays], (*after)[sfTakerGets]);
241 }
242 
243 bool
245  STTx const&,
246  TER const,
247  XRPAmount const,
248  ReadView const&,
249  beast::Journal const& j)
250 {
251  if (bad_)
252  {
253  JLOG(j.fatal()) << "Invariant failed: offer with a bad amount";
254  return false;
255  }
256 
257  return true;
258 }
259 
260 //------------------------------------------------------------------------------
261 
262 void
264  bool isDelete,
265  std::shared_ptr<SLE const> const& before,
267 {
268  auto isBad = [](STAmount const& amount) {
269  if (!amount.native())
270  return true;
271 
272  if (amount.xrp() <= XRPAmount{0})
273  return true;
274 
275  if (amount.xrp() >= INITIAL_XRP)
276  return true;
277 
278  return false;
279  };
280 
281  if (before && before->getType() == ltESCROW)
282  bad_ |= isBad((*before)[sfAmount]);
283 
284  if (after && after->getType() == ltESCROW)
285  bad_ |= isBad((*after)[sfAmount]);
286 }
287 
288 bool
290  STTx const&,
291  TER const,
292  XRPAmount const,
293  ReadView const&,
294  beast::Journal const& j)
295 {
296  if (bad_)
297  {
298  JLOG(j.fatal()) << "Invariant failed: escrow specifies invalid amount";
299  return false;
300  }
301 
302  return true;
303 }
304 
305 //------------------------------------------------------------------------------
306 
307 void
309  bool isDelete,
310  std::shared_ptr<SLE const> const& before,
312 {
313  if (isDelete && before && before->getType() == ltACCOUNT_ROOT)
315 }
316 
317 bool
319  STTx const& tx,
320  TER const result,
321  XRPAmount const,
322  ReadView const&,
323  beast::Journal const& j)
324 {
325  // AMM account root can be deleted as the result of AMM withdraw/delete
326  // transaction when the total AMM LP Tokens balance goes to 0.
327  // A successful AccountDelete or AMMDelete MUST delete exactly
328  // one account root.
329  if ((tx.getTxnType() == ttACCOUNT_DELETE ||
330  tx.getTxnType() == ttAMM_DELETE) &&
331  result == tesSUCCESS)
332  {
333  if (accountsDeleted_ == 1)
334  return true;
335 
336  if (accountsDeleted_ == 0)
337  JLOG(j.fatal()) << "Invariant failed: account deletion "
338  "succeeded without deleting an account";
339  else
340  JLOG(j.fatal()) << "Invariant failed: account deletion "
341  "succeeded but deleted multiple accounts!";
342  return false;
343  }
344 
345  // A successful AMMWithdraw MAY delete one account root
346  // when the total AMM LP Tokens balance goes to 0. Not every AMM withdraw
347  // deletes the AMM account, accountsDeleted_ is set if it is deleted.
348  if (tx.getTxnType() == ttAMM_WITHDRAW && result == tesSUCCESS &&
349  accountsDeleted_ == 1)
350  return true;
351 
352  if (accountsDeleted_ == 0)
353  return true;
354 
355  JLOG(j.fatal()) << "Invariant failed: an account root was deleted";
356  return false;
357 }
358 
359 //------------------------------------------------------------------------------
360 
361 void
363  bool,
364  std::shared_ptr<SLE const> const& before,
366 {
367  if (before && after && before->getType() != after->getType())
368  typeMismatch_ = true;
369 
370  if (after)
371  {
372  switch (after->getType())
373  {
374  case ltACCOUNT_ROOT:
375  case ltDIR_NODE:
376  case ltRIPPLE_STATE:
377  case ltTICKET:
378  case ltSIGNER_LIST:
379  case ltOFFER:
380  case ltLEDGER_HASHES:
381  case ltAMENDMENTS:
382  case ltFEE_SETTINGS:
383  case ltESCROW:
384  case ltPAYCHAN:
385  case ltCHECK:
386  case ltDEPOSIT_PREAUTH:
387  case ltNEGATIVE_UNL:
388  case ltNFTOKEN_PAGE:
389  case ltNFTOKEN_OFFER:
390  case ltAMM:
391  case ltBRIDGE:
394  break;
395  default:
396  invalidTypeAdded_ = true;
397  break;
398  }
399  }
400 }
401 
402 bool
404  STTx const&,
405  TER const,
406  XRPAmount const,
407  ReadView const&,
408  beast::Journal const& j)
409 {
410  if ((!typeMismatch_) && (!invalidTypeAdded_))
411  return true;
412 
413  if (typeMismatch_)
414  {
415  JLOG(j.fatal()) << "Invariant failed: ledger entry type mismatch";
416  }
417 
418  if (invalidTypeAdded_)
419  {
420  JLOG(j.fatal()) << "Invariant failed: invalid ledger entry type added";
421  }
422 
423  return false;
424 }
425 
426 //------------------------------------------------------------------------------
427 
428 void
430  bool,
433 {
434  if (after && after->getType() == ltRIPPLE_STATE)
435  {
436  // checking the issue directly here instead of
437  // relying on .native() just in case native somehow
438  // were systematically incorrect
439  xrpTrustLine_ =
440  after->getFieldAmount(sfLowLimit).issue() == xrpIssue() ||
441  after->getFieldAmount(sfHighLimit).issue() == xrpIssue();
442  }
443 }
444 
445 bool
447  STTx const&,
448  TER const,
449  XRPAmount const,
450  ReadView const&,
451  beast::Journal const& j)
452 {
453  if (!xrpTrustLine_)
454  return true;
455 
456  JLOG(j.fatal()) << "Invariant failed: an XRP trust line was created";
457  return false;
458 }
459 
460 //------------------------------------------------------------------------------
461 
462 void
464  bool,
465  std::shared_ptr<SLE const> const& before,
467 {
468  if (!before && after->getType() == ltACCOUNT_ROOT)
469  {
471  accountSeq_ = (*after)[sfSequence];
472  }
473 }
474 
475 bool
477  STTx const& tx,
478  TER const result,
479  XRPAmount const,
480  ReadView const& view,
481  beast::Journal const& j)
482 {
483  if (accountsCreated_ == 0)
484  return true;
485 
486  if (accountsCreated_ > 1)
487  {
488  JLOG(j.fatal()) << "Invariant failed: multiple accounts "
489  "created in a single transaction";
490  return false;
491  }
492 
493  // From this point on we know exactly one account was created.
494  if ((tx.getTxnType() == ttPAYMENT || tx.getTxnType() == ttAMM_CREATE ||
497  result == tesSUCCESS)
498  {
499  std::uint32_t const startingSeq{
500  view.rules().enabled(featureDeletableAccounts) ? view.seq() : 1};
501 
502  if (accountSeq_ != startingSeq)
503  {
504  JLOG(j.fatal()) << "Invariant failed: account created with "
505  "wrong starting sequence number";
506  return false;
507  }
508  return true;
509  }
510 
511  JLOG(j.fatal()) << "Invariant failed: account root created "
512  "by a non-Payment, by an unsuccessful transaction, "
513  "or by AMM";
514  return false;
515 }
516 
517 //------------------------------------------------------------------------------
518 
519 void
521  bool isDelete,
522  std::shared_ptr<SLE const> const& before,
524 {
525  static constexpr uint256 const& pageBits = nft::pageMask;
526  static constexpr uint256 const accountBits = ~pageBits;
527 
528  auto check = [this, isDelete](std::shared_ptr<SLE const> const& sle) {
529  uint256 const account = sle->key() & accountBits;
530  uint256 const hiLimit = sle->key() & pageBits;
531  std::optional<uint256> const prev = (*sle)[~sfPreviousPageMin];
532 
533  // Make sure that any page links...
534  // 1. Are properly associated with the owning account and
535  // 2. The page is correctly ordered between links.
536  if (prev)
537  {
538  if (account != (*prev & accountBits))
539  badLink_ = true;
540 
541  if (hiLimit <= (*prev & pageBits))
542  badLink_ = true;
543  }
544 
545  if (auto const next = (*sle)[~sfNextPageMin])
546  {
547  if (account != (*next & accountBits))
548  badLink_ = true;
549 
550  if (hiLimit >= (*next & pageBits))
551  badLink_ = true;
552  }
553 
554  {
555  auto const& nftokens = sle->getFieldArray(sfNFTokens);
556 
557  // An NFTokenPage should never contain too many tokens or be empty.
558  if (std::size_t const nftokenCount = nftokens.size();
559  (!isDelete && nftokenCount == 0) ||
560  nftokenCount > dirMaxTokensPerPage)
561  invalidSize_ = true;
562 
563  // If prev is valid, use it to establish a lower bound for
564  // page entries. If prev is not valid the lower bound is zero.
565  uint256 const loLimit =
566  prev ? *prev & pageBits : uint256(beast::zero);
567 
568  // Also verify that all NFTokenIDs in the page are sorted.
569  uint256 loCmp = loLimit;
570  for (auto const& obj : nftokens)
571  {
572  uint256 const tokenID = obj[sfNFTokenID];
573  if (!nft::compareTokens(loCmp, tokenID))
574  badSort_ = true;
575  loCmp = tokenID;
576 
577  // None of the NFTs on this page should belong on lower or
578  // higher pages.
579  if (uint256 const tokenPageBits = tokenID & pageBits;
580  tokenPageBits < loLimit || tokenPageBits >= hiLimit)
581  badEntry_ = true;
582 
583  if (auto uri = obj[~sfURI]; uri && uri->empty())
584  badURI_ = true;
585  }
586  }
587  };
588 
589  if (before && before->getType() == ltNFTOKEN_PAGE)
590  check(before);
591 
592  if (after && after->getType() == ltNFTOKEN_PAGE)
593  check(after);
594 }
595 
596 bool
598  STTx const& tx,
599  TER const result,
600  XRPAmount const,
601  ReadView const& view,
602  beast::Journal const& j)
603 {
604  if (badLink_)
605  {
606  JLOG(j.fatal()) << "Invariant failed: NFT page is improperly linked.";
607  return false;
608  }
609 
610  if (badEntry_)
611  {
612  JLOG(j.fatal()) << "Invariant failed: NFT found in incorrect page.";
613  return false;
614  }
615 
616  if (badSort_)
617  {
618  JLOG(j.fatal()) << "Invariant failed: NFTs on page are not sorted.";
619  return false;
620  }
621 
622  if (badURI_)
623  {
624  JLOG(j.fatal()) << "Invariant failed: NFT contains empty URI.";
625  return false;
626  }
627 
628  if (invalidSize_)
629  {
630  JLOG(j.fatal()) << "Invariant failed: NFT page has invalid size.";
631  return false;
632  }
633 
634  return true;
635 }
636 
637 //------------------------------------------------------------------------------
638 void
640  bool,
641  std::shared_ptr<SLE const> const& before,
643 {
644  if (before && before->getType() == ltACCOUNT_ROOT)
645  {
646  beforeMintedTotal += (*before)[~sfMintedNFTokens].value_or(0);
647  beforeBurnedTotal += (*before)[~sfBurnedNFTokens].value_or(0);
648  }
649 
650  if (after && after->getType() == ltACCOUNT_ROOT)
651  {
652  afterMintedTotal += (*after)[~sfMintedNFTokens].value_or(0);
653  afterBurnedTotal += (*after)[~sfBurnedNFTokens].value_or(0);
654  }
655 }
656 
657 bool
659  STTx const& tx,
660  TER const result,
661  XRPAmount const,
662  ReadView const& view,
663  beast::Journal const& j)
664 {
665  if (TxType const txType = tx.getTxnType();
666  txType != ttNFTOKEN_MINT && txType != ttNFTOKEN_BURN)
667  {
669  {
670  JLOG(j.fatal()) << "Invariant failed: the number of minted tokens "
671  "changed without a mint transaction!";
672  return false;
673  }
674 
676  {
677  JLOG(j.fatal()) << "Invariant failed: the number of burned tokens "
678  "changed without a burn transaction!";
679  return false;
680  }
681 
682  return true;
683  }
684 
685  if (tx.getTxnType() == ttNFTOKEN_MINT)
686  {
687  if (result == tesSUCCESS && beforeMintedTotal >= afterMintedTotal)
688  {
689  JLOG(j.fatal())
690  << "Invariant failed: successful minting didn't increase "
691  "the number of minted tokens.";
692  return false;
693  }
694 
695  if (result != tesSUCCESS && beforeMintedTotal != afterMintedTotal)
696  {
697  JLOG(j.fatal()) << "Invariant failed: failed minting changed the "
698  "number of minted tokens.";
699  return false;
700  }
701 
703  {
704  JLOG(j.fatal())
705  << "Invariant failed: minting changed the number of "
706  "burned tokens.";
707  return false;
708  }
709  }
710 
711  if (tx.getTxnType() == ttNFTOKEN_BURN)
712  {
713  if (result == tesSUCCESS)
714  {
716  {
717  JLOG(j.fatal())
718  << "Invariant failed: successful burning didn't increase "
719  "the number of burned tokens.";
720  return false;
721  }
722  }
723 
724  if (result != tesSUCCESS && beforeBurnedTotal != afterBurnedTotal)
725  {
726  JLOG(j.fatal()) << "Invariant failed: failed burning changed the "
727  "number of burned tokens.";
728  return false;
729  }
730 
732  {
733  JLOG(j.fatal())
734  << "Invariant failed: burning changed the number of "
735  "minted tokens.";
736  return false;
737  }
738  }
739 
740  return true;
741 }
742 
743 //------------------------------------------------------------------------------
744 
745 void
747  bool,
748  std::shared_ptr<SLE const> const& before,
750 {
751  if (before && before->getType() == ltRIPPLE_STATE)
753 }
754 
755 bool
757  STTx const& tx,
758  TER const result,
759  XRPAmount const,
760  ReadView const& view,
761  beast::Journal const& j)
762 {
763  if (tx.getTxnType() != ttCLAWBACK)
764  return true;
765 
766  if (result == tesSUCCESS)
767  {
768  if (trustlinesChanged > 1)
769  {
770  JLOG(j.fatal())
771  << "Invariant failed: more than one trustline changed.";
772  return false;
773  }
774 
775  AccountID const issuer = tx.getAccountID(sfAccount);
776  STAmount const amount = tx.getFieldAmount(sfAmount);
777  AccountID const& holder = amount.getIssuer();
778  STAmount const holderBalance = accountHolds(
779  view, holder, amount.getCurrency(), issuer, fhIGNORE_FREEZE, j);
780 
781  if (holderBalance.signum() < 0)
782  {
783  JLOG(j.fatal())
784  << "Invariant failed: trustline balance is negative";
785  return false;
786  }
787  }
788  else
789  {
790  if (trustlinesChanged != 0)
791  {
792  JLOG(j.fatal()) << "Invariant failed: some trustlines were changed "
793  "despite failure of the transaction.";
794  return false;
795  }
796  }
797 
798  return true;
799 }
800 
801 } // namespace ripple
beast::Journal::fatal
Stream fatal() const
Definition: Journal.h:338
ripple::STTx::getTxnType
TxType getTxnType() const
Definition: STTx.h:179
ripple::ValidNFTokenPage::badURI_
bool badURI_
Definition: InvariantCheck.h:338
ripple::LedgerEntryTypesMatch::visitEntry
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Definition: InvariantCheck.cpp:362
ripple::ttACCOUNT_DELETE
@ ttACCOUNT_DELETE
This transaction type deletes an existing account.
Definition: TxFormats.h:122
ripple::ltTICKET
@ ltTICKET
A ledger object which describes a ticket.
Definition: LedgerFormats.h:80
ripple::NoZeroEscrow::visitEntry
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Definition: InvariantCheck.cpp:263
ripple::ttAMM_DELETE
@ ttAMM_DELETE
This transaction type deletes AMM in the empty state.
Definition: TxFormats.h:161
ripple::Rules::enabled
bool enabled(uint256 const &feature) const
Returns true if a feature is enabled.
Definition: Rules.cpp:94
std::shared_ptr
STL class.
ripple::TransactionFeeCheck::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition: InvariantCheck.cpp:45
ripple::sfAmount
const SF_AMOUNT sfAmount
ripple::ttCLAWBACK
@ ttCLAWBACK
This transaction claws back issued tokens.
Definition: TxFormats.h:143
ripple::sfNFTokenID
const SF_UINT256 sfNFTokenID
ripple::ltLEDGER_HASHES
@ ltLEDGER_HASHES
A ledger object that contains a list of ledger hashes.
Definition: LedgerFormats.h:109
ripple::XRPBalanceChecks::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition: InvariantCheck.cpp:200
ripple::XRPAmount::drops
constexpr value_type drops() const
Returns the number of drops.
Definition: XRPAmount.h:172
ripple::sfSequence
const SF_UINT32 sfSequence
ripple::NoXRPTrustLines::visitEntry
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Definition: InvariantCheck.cpp:429
ripple::accountHolds
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:226
ripple::ValidNFTokenPage::badSort_
bool badSort_
Definition: InvariantCheck.h:337
ripple::ltSIGNER_LIST
@ ltSIGNER_LIST
A ledger object which contains a signer list for an account.
Definition: LedgerFormats.h:86
ripple::sfMintedNFTokens
const SF_UINT32 sfMintedNFTokens
ripple::NoBadOffers::visitEntry
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Definition: InvariantCheck.cpp:219
ripple::NoZeroEscrow::bad_
bool bad_
Definition: InvariantCheck.h:278
ripple::ValidNFTokenPage::visitEntry
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Definition: InvariantCheck.cpp:520
ripple::dirMaxTokensPerPage
constexpr std::size_t dirMaxTokensPerPage
The maximum number of items in an NFT page.
Definition: Protocol.h:61
ripple::STAmount::signum
int signum() const noexcept
Definition: STAmount.h:368
ripple::TxType
TxType
Transaction type identifiers.
Definition: TxFormats.h:56
ripple::NoBadOffers::bad_
bool bad_
Definition: InvariantCheck.h:254
ripple::NFTokenCountTracking::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition: InvariantCheck.cpp:658
ripple::ValidNFTokenPage::invalidSize_
bool invalidSize_
Definition: InvariantCheck.h:339
ripple::NFTokenCountTracking::beforeMintedTotal
std::uint32_t beforeMintedTotal
Definition: InvariantCheck.h:372
ripple::ltCHECK
@ ltCHECK
A ledger object which describes a check.
Definition: LedgerFormats.h:155
ripple::ltFEE_SETTINGS
@ ltFEE_SETTINGS
The ledger object which lists the network's fee settings.
Definition: LedgerFormats.h:137
ripple::NFTokenCountTracking::afterMintedTotal
std::uint32_t afterMintedTotal
Definition: InvariantCheck.h:374
ripple::nft::compareTokens
bool compareTokens(uint256 const &a, uint256 const &b)
Definition: NFTokenUtils.cpp:227
ripple::STAmount::xrp
XRPAmount xrp() const
Definition: STAmount.cpp:345
ripple::INITIAL_XRP
constexpr XRPAmount INITIAL_XRP
Configure the native currency.
Definition: SystemParameters.h:43
ripple::ValidNewAccountRoot::accountSeq_
std::uint32_t accountSeq_
Definition: InvariantCheck.h:304
ripple::ltDIR_NODE
@ ltDIR_NODE
A ledger object which contains a list of object identifiers.
Definition: LedgerFormats.h:66
ripple::STAmount::getIssuer
AccountID const & getIssuer() const
Definition: STAmount.h:362
ripple::ValidNewAccountRoot::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition: InvariantCheck.cpp:476
ripple::nft::pageMask
constexpr uint256 pageMask(std::string_view("0000000000000000000000000000000000000000ffffffffffffffffffffffff"))
ripple::uint256
base_uint< 256 > uint256
Definition: base_uint.h:550
ripple::featureDeletableAccounts
const uint256 featureDeletableAccounts
ripple::ttPAYMENT
@ ttPAYMENT
This transaction type executes a payment.
Definition: TxFormats.h:59
ripple::NoXRPTrustLines::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition: InvariantCheck.cpp:446
ripple::base_uint< 256 >
ripple::sfTakerPays
const SF_AMOUNT sfTakerPays
ripple::ltAMENDMENTS
@ ltAMENDMENTS
The ledger object which lists details about amendments on the network.
Definition: LedgerFormats.h:117
ripple::sfLowLimit
const SF_AMOUNT sfLowLimit
ripple::LedgerEntryTypesMatch::typeMismatch_
bool typeMismatch_
Definition: InvariantCheck.h:200
ripple::ValidNFTokenPage::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition: InvariantCheck.cpp:597
ripple::ltOFFER
@ ltOFFER
A ledger object which describes an offer on the DEX.
Definition: LedgerFormats.h:92
ripple::NoBadOffers::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition: InvariantCheck.cpp:244
ripple::LedgerEntryTypesMatch::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition: InvariantCheck.cpp:403
ripple::NFTokenCountTracking::afterBurnedTotal
std::uint32_t afterBurnedTotal
Definition: InvariantCheck.h:375
ripple::ttAMM_CREATE
@ ttAMM_CREATE
This transaction type creates an AMM instance.
Definition: TxFormats.h:146
ripple::ltESCROW
@ ltESCROW
A ledger object describing a single escrow.
Definition: LedgerFormats.h:143
ripple::STObject::getAccountID
AccountID getAccountID(SField const &field) const
Definition: STObject.cpp:589
ripple::ltNFTOKEN_OFFER
@ ltNFTOKEN_OFFER
A ledger object which identifies an offer to buy or sell an NFT.
Definition: LedgerFormats.h:181
ripple::ValidNFTokenPage::badEntry_
bool badEntry_
Definition: InvariantCheck.h:335
ripple::TERSubset< CanCvtToTER >
ripple::ttNFTOKEN_MINT
@ ttNFTOKEN_MINT
This transaction mints a new NFT.
Definition: TxFormats.h:128
ripple::ValidNewAccountRoot::visitEntry
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Definition: InvariantCheck.cpp:463
ripple::ValidClawback::trustlinesChanged
std::uint32_t trustlinesChanged
Definition: InvariantCheck.h:403
ripple::ValidClawback::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition: InvariantCheck.cpp:756
ripple::ltDEPOSIT_PREAUTH
@ ltDEPOSIT_PREAUTH
A ledger object which describes a deposit preauthorization.
Definition: LedgerFormats.h:161
ripple::STAmount
Definition: STAmount.h:46
ripple::XRPNotCreated::visitEntry
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Definition: InvariantCheck.cpp:84
ripple::ttAMM_WITHDRAW
@ ttAMM_WITHDRAW
This transaction type withdraws from an AMM instance.
Definition: TxFormats.h:152
ripple::sfTakerGets
const SF_AMOUNT sfTakerGets
ripple::XRPNotCreated::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition: InvariantCheck.cpp:139
ripple::STTx
Definition: STTx.h:45
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:58
std::uint32_t
ripple::sfHighLimit
const SF_AMOUNT sfHighLimit
ripple::NoZeroEscrow::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition: InvariantCheck.cpp:289
ripple::AccountRootsNotDeleted::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition: InvariantCheck.cpp:318
ripple::NFTokenCountTracking::beforeBurnedTotal
std::uint32_t beforeBurnedTotal
Definition: InvariantCheck.h:373
ripple::sfNFTokens
const SField sfNFTokens
ripple::sfURI
const SF_VL sfURI
ripple::STAmount::native
bool native() const noexcept
Definition: STAmount.h:332
ripple::ReadView
A view into a ledger.
Definition: ReadView.h:54
ripple::ltNFTOKEN_PAGE
@ ltNFTOKEN_PAGE
A ledger object which contains a list of NFTs.
Definition: LedgerFormats.h:175
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID
@ ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID
A claim id for a cross chain create account transaction.
Definition: LedgerFormats.h:129
ripple::ltBRIDGE
@ ltBRIDGE
The ledger object which lists details about sidechains.
Definition: LedgerFormats.h:99
ripple::ltNEGATIVE_UNL
@ ltNEGATIVE_UNL
The ledger object which tracks the current negative UNL state.
Definition: LedgerFormats.h:169
ripple::NoXRPTrustLines::xrpTrustLine_
bool xrpTrustLine_
Definition: InvariantCheck.h:227
ripple::ReadView::seq
LedgerIndex seq() const
Returns the sequence number of the base ledger.
Definition: ReadView.h:122
ripple::ValidNewAccountRoot::accountsCreated_
std::uint32_t accountsCreated_
Definition: InvariantCheck.h:303
ripple::ReadView::rules
virtual Rules const & rules() const =0
Returns the tx processing rules.
ripple::ltACCOUNT_ROOT
@ ltACCOUNT_ROOT
A ledger object which describes an account.
Definition: LedgerFormats.h:59
ripple::TransactionFeeCheck::visitEntry
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Definition: InvariantCheck.cpp:36
ripple::sfBalance
const SF_AMOUNT sfBalance
ripple::AccountRootsNotDeleted::visitEntry
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Definition: InvariantCheck.cpp:308
ripple::sfNextPageMin
const SF_UINT256 sfNextPageMin
ripple::xrpIssue
Issue const & xrpIssue()
Returns an asset specifier that represents XRP.
Definition: Issue.h:105
ripple::fhIGNORE_FREEZE
@ fhIGNORE_FREEZE
Definition: View.h:79
ripple::ltXCHAIN_OWNED_CLAIM_ID
@ ltXCHAIN_OWNED_CLAIM_ID
A claim id for a cross chain transaction.
Definition: LedgerFormats.h:123
std::optional
ripple::sfPreviousPageMin
const SF_UINT256 sfPreviousPageMin
ripple::ttNFTOKEN_BURN
@ ttNFTOKEN_BURN
This transaction burns (i.e.
Definition: TxFormats.h:131
ripple::after
static bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: Escrow.cpp:88
std::size_t
ripple::ValidClawback::visitEntry
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Definition: InvariantCheck.cpp:746
ripple::AccountRootsNotDeleted::accountsDeleted_
std::uint32_t accountsDeleted_
Definition: InvariantCheck.h:149
ripple::sfFee
const SF_AMOUNT sfFee
ripple::XRPBalanceChecks::visitEntry
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Definition: InvariantCheck.cpp:169
ripple::sfAccount
const SF_ACCOUNT sfAccount
ripple::ltRIPPLE_STATE
@ ltRIPPLE_STATE
A ledger object which describes a bidirectional trust line.
Definition: LedgerFormats.h:74
ripple::NFTokenCountTracking::visitEntry
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Definition: InvariantCheck.cpp:639
ripple::XRPBalanceChecks::bad_
bool bad_
Definition: InvariantCheck.h:176
ripple::sfBurnedNFTokens
const SF_UINT32 sfBurnedNFTokens
ripple::LedgerEntryTypesMatch::invalidTypeAdded_
bool invalidTypeAdded_
Definition: InvariantCheck.h:201
ripple::STAmount::getCurrency
Currency const & getCurrency() const
Definition: STAmount.h:356
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:233
ripple::ttXCHAIN_ADD_ACCOUNT_CREATE_ATTESTATION
@ ttXCHAIN_ADD_ACCOUNT_CREATE_ATTESTATION
This transaction adds an attestation to a claimid.
Definition: TxFormats.h:179
ripple::XRPNotCreated::drops_
std::int64_t drops_
Definition: InvariantCheck.h:121
ripple::STObject::getFieldAmount
STAmount const & getFieldAmount(SField const &field) const
Definition: STObject.cpp:603
ripple::ltAMM
@ ltAMM
The ledger object which tracks the AMM.
Definition: LedgerFormats.h:187
ripple::ltPAYCHAN
@ ltPAYCHAN
A ledger object describing a single unidirectional XRP payment channel.
Definition: LedgerFormats.h:149
ripple::XRPAmount
Definition: XRPAmount.h:46
ripple::ValidNFTokenPage::badLink_
bool badLink_
Definition: InvariantCheck.h:336
ripple::ttXCHAIN_ADD_CLAIM_ATTESTATION
@ ttXCHAIN_ADD_CLAIM_ATTESTATION
This transaction adds an attestation to a claimid.
Definition: TxFormats.h:176