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/protocol/Feature.h>
27 #include <ripple/protocol/STArray.h>
28 #include <ripple/protocol/SystemParameters.h>
29 #include <ripple/protocol/nftPageMask.h>
30 
31 namespace ripple {
32 
33 void
35  bool,
38 {
39  // nothing to do
40 }
41 
42 bool
44  STTx const& tx,
45  TER const,
46  XRPAmount const fee,
47  ReadView const&,
48  beast::Journal const& j)
49 {
50  // We should never charge a negative fee
51  if (fee.drops() < 0)
52  {
53  JLOG(j.fatal()) << "Invariant failed: fee paid was negative: "
54  << fee.drops();
55  return false;
56  }
57 
58  // We should never charge a fee that's greater than or equal to the
59  // entire XRP supply.
60  if (fee >= INITIAL_XRP)
61  {
62  JLOG(j.fatal()) << "Invariant failed: fee paid exceeds system limit: "
63  << fee.drops();
64  return false;
65  }
66 
67  // We should never charge more for a transaction than the transaction
68  // authorizes. It's possible to charge less in some circumstances.
69  if (fee > tx.getFieldAmount(sfFee).xrp())
70  {
71  JLOG(j.fatal()) << "Invariant failed: fee paid is " << fee.drops()
72  << " exceeds fee specified in transaction.";
73  return false;
74  }
75 
76  return true;
77 }
78 
79 //------------------------------------------------------------------------------
80 
81 void
83  bool isDelete,
84  std::shared_ptr<SLE const> const& before,
86 {
87  /* We go through all modified ledger entries, looking only at account roots,
88  * escrow payments, and payment channels. We remove from the total any
89  * previous XRP values and add to the total any new XRP values. The net
90  * balance of a payment channel is computed from two fields (amount and
91  * balance) and deletions are ignored for paychan and escrow because the
92  * amount fields have not been adjusted for those in the case of deletion.
93  */
94  if (before)
95  {
96  switch (before->getType())
97  {
98  case ltACCOUNT_ROOT:
99  drops_ -= (*before)[sfBalance].xrp().drops();
100  break;
101  case ltPAYCHAN:
102  drops_ -=
103  ((*before)[sfAmount] - (*before)[sfBalance]).xrp().drops();
104  break;
105  case ltESCROW:
106  drops_ -= (*before)[sfAmount].xrp().drops();
107  break;
108  default:
109  break;
110  }
111  }
112 
113  if (after)
114  {
115  switch (after->getType())
116  {
117  case ltACCOUNT_ROOT:
118  drops_ += (*after)[sfBalance].xrp().drops();
119  break;
120  case ltPAYCHAN:
121  if (!isDelete)
122  drops_ += ((*after)[sfAmount] - (*after)[sfBalance])
123  .xrp()
124  .drops();
125  break;
126  case ltESCROW:
127  if (!isDelete)
128  drops_ += (*after)[sfAmount].xrp().drops();
129  break;
130  default:
131  break;
132  }
133  }
134 }
135 
136 bool
138  STTx const&,
139  TER const,
140  XRPAmount const fee,
141  ReadView const&,
142  beast::Journal const& j)
143 {
144  // The net change should never be positive, as this would mean that the
145  // transaction created XRP out of thin air. That's not possible.
146  if (drops_ > 0)
147  {
148  JLOG(j.fatal()) << "Invariant failed: XRP net change was positive: "
149  << drops_;
150  return false;
151  }
152 
153  // The negative of the net change should be equal to actual fee charged.
154  if (-drops_ != fee.drops())
155  {
156  JLOG(j.fatal()) << "Invariant failed: XRP net change of " << drops_
157  << " doesn't match fee " << fee.drops();
158  return false;
159  }
160 
161  return true;
162 }
163 
164 //------------------------------------------------------------------------------
165 
166 void
168  bool,
169  std::shared_ptr<SLE const> const& before,
171 {
172  auto isBad = [](STAmount const& balance) {
173  if (!balance.native())
174  return true;
175 
176  auto const drops = balance.xrp();
177 
178  // Can't have more than the number of drops instantiated
179  // in the genesis ledger.
180  if (drops > INITIAL_XRP)
181  return true;
182 
183  // Can't have a negative balance (0 is OK)
184  if (drops < XRPAmount{0})
185  return true;
186 
187  return false;
188  };
189 
190  if (before && before->getType() == ltACCOUNT_ROOT)
191  bad_ |= isBad((*before)[sfBalance]);
192 
193  if (after && after->getType() == ltACCOUNT_ROOT)
194  bad_ |= isBad((*after)[sfBalance]);
195 }
196 
197 bool
199  STTx const&,
200  TER const,
201  XRPAmount const,
202  ReadView const&,
203  beast::Journal const& j)
204 {
205  if (bad_)
206  {
207  JLOG(j.fatal()) << "Invariant failed: incorrect account XRP balance";
208  return false;
209  }
210 
211  return true;
212 }
213 
214 //------------------------------------------------------------------------------
215 
216 void
218  bool isDelete,
219  std::shared_ptr<SLE const> const& before,
221 {
222  auto isBad = [](STAmount const& pays, STAmount const& gets) {
223  // An offer should never be negative
224  if (pays < beast::zero)
225  return true;
226 
227  if (gets < beast::zero)
228  return true;
229 
230  // Can't have an XRP to XRP offer:
231  return pays.native() && gets.native();
232  };
233 
234  if (before && before->getType() == ltOFFER)
235  bad_ |= isBad((*before)[sfTakerPays], (*before)[sfTakerGets]);
236 
237  if (after && after->getType() == ltOFFER)
238  bad_ |= isBad((*after)[sfTakerPays], (*after)[sfTakerGets]);
239 }
240 
241 bool
243  STTx const&,
244  TER const,
245  XRPAmount const,
246  ReadView const&,
247  beast::Journal const& j)
248 {
249  if (bad_)
250  {
251  JLOG(j.fatal()) << "Invariant failed: offer with a bad amount";
252  return false;
253  }
254 
255  return true;
256 }
257 
258 //------------------------------------------------------------------------------
259 
260 void
262  bool isDelete,
263  std::shared_ptr<SLE const> const& before,
265 {
266  auto isBad = [](STAmount const& amount) {
267  if (!amount.native())
268  return true;
269 
270  if (amount.xrp() <= XRPAmount{0})
271  return true;
272 
273  if (amount.xrp() >= INITIAL_XRP)
274  return true;
275 
276  return false;
277  };
278 
279  if (before && before->getType() == ltESCROW)
280  bad_ |= isBad((*before)[sfAmount]);
281 
282  if (after && after->getType() == ltESCROW)
283  bad_ |= isBad((*after)[sfAmount]);
284 }
285 
286 bool
288  STTx const&,
289  TER const,
290  XRPAmount const,
291  ReadView const&,
292  beast::Journal const& j)
293 {
294  if (bad_)
295  {
296  JLOG(j.fatal()) << "Invariant failed: escrow specifies invalid amount";
297  return false;
298  }
299 
300  return true;
301 }
302 
303 //------------------------------------------------------------------------------
304 
305 void
307  bool isDelete,
308  std::shared_ptr<SLE const> const& before,
310 {
311  if (isDelete && before && before->getType() == ltACCOUNT_ROOT)
313 }
314 
315 bool
317  STTx const& tx,
318  TER const result,
319  XRPAmount const,
320  ReadView const&,
321  beast::Journal const& j)
322 {
323  if (tx.getTxnType() == ttACCOUNT_DELETE && result == tesSUCCESS)
324  {
325  if (accountsDeleted_ == 1)
326  return true;
327 
328  if (accountsDeleted_ == 0)
329  JLOG(j.fatal()) << "Invariant failed: account deletion "
330  "succeeded without deleting an account";
331  else
332  JLOG(j.fatal()) << "Invariant failed: account deletion "
333  "succeeded but deleted multiple accounts!";
334  return false;
335  }
336 
337  if (accountsDeleted_ == 0)
338  return true;
339 
340  JLOG(j.fatal()) << "Invariant failed: an account root was deleted";
341  return false;
342 }
343 
344 //------------------------------------------------------------------------------
345 
346 void
348  bool,
349  std::shared_ptr<SLE const> const& before,
351 {
352  if (before && after && before->getType() != after->getType())
353  typeMismatch_ = true;
354 
355  if (after)
356  {
357  switch (after->getType())
358  {
359  case ltACCOUNT_ROOT:
360  case ltDIR_NODE:
361  case ltRIPPLE_STATE:
362  case ltTICKET:
363  case ltSIGNER_LIST:
364  case ltOFFER:
365  case ltLEDGER_HASHES:
366  case ltAMENDMENTS:
367  case ltFEE_SETTINGS:
368  case ltESCROW:
369  case ltPAYCHAN:
370  case ltCHECK:
371  case ltDEPOSIT_PREAUTH:
372  case ltNEGATIVE_UNL:
373  case ltNFTOKEN_PAGE:
374  case ltNFTOKEN_OFFER:
375  break;
376  default:
377  invalidTypeAdded_ = true;
378  break;
379  }
380  }
381 }
382 
383 bool
385  STTx const&,
386  TER const,
387  XRPAmount const,
388  ReadView const&,
389  beast::Journal const& j)
390 {
391  if ((!typeMismatch_) && (!invalidTypeAdded_))
392  return true;
393 
394  if (typeMismatch_)
395  {
396  JLOG(j.fatal()) << "Invariant failed: ledger entry type mismatch";
397  }
398 
399  if (invalidTypeAdded_)
400  {
401  JLOG(j.fatal()) << "Invariant failed: invalid ledger entry type added";
402  }
403 
404  return false;
405 }
406 
407 //------------------------------------------------------------------------------
408 
409 void
411  bool,
414 {
415  if (after && after->getType() == ltRIPPLE_STATE)
416  {
417  // checking the issue directly here instead of
418  // relying on .native() just in case native somehow
419  // were systematically incorrect
420  xrpTrustLine_ =
421  after->getFieldAmount(sfLowLimit).issue() == xrpIssue() ||
422  after->getFieldAmount(sfHighLimit).issue() == xrpIssue();
423  }
424 }
425 
426 bool
428  STTx const&,
429  TER const,
430  XRPAmount const,
431  ReadView const&,
432  beast::Journal const& j)
433 {
434  if (!xrpTrustLine_)
435  return true;
436 
437  JLOG(j.fatal()) << "Invariant failed: an XRP trust line was created";
438  return false;
439 }
440 
441 //------------------------------------------------------------------------------
442 
443 void
445  bool,
446  std::shared_ptr<SLE const> const& before,
448 {
449  if (!before && after->getType() == ltACCOUNT_ROOT)
450  {
452  accountSeq_ = (*after)[sfSequence];
453  }
454 }
455 
456 bool
458  STTx const& tx,
459  TER const result,
460  XRPAmount const,
461  ReadView const& view,
462  beast::Journal const& j)
463 {
464  if (accountsCreated_ == 0)
465  return true;
466 
467  if (accountsCreated_ > 1)
468  {
469  JLOG(j.fatal()) << "Invariant failed: multiple accounts "
470  "created in a single transaction";
471  return false;
472  }
473 
474  // From this point on we know exactly one account was created.
475  if (tx.getTxnType() == ttPAYMENT && result == tesSUCCESS)
476  {
477  std::uint32_t const startingSeq{
478  view.rules().enabled(featureDeletableAccounts) ? view.seq() : 1};
479 
480  if (accountSeq_ != startingSeq)
481  {
482  JLOG(j.fatal()) << "Invariant failed: account created with "
483  "wrong starting sequence number";
484  return false;
485  }
486  return true;
487  }
488 
489  JLOG(j.fatal()) << "Invariant failed: account root created "
490  "by a non-Payment or by an unsuccessful transaction";
491  return false;
492 }
493 
494 //------------------------------------------------------------------------------
495 
496 void
498  bool isDelete,
499  std::shared_ptr<SLE const> const& before,
501 {
502  static constexpr uint256 const& pageBits = nft::pageMask;
503  static constexpr uint256 const accountBits = ~pageBits;
504 
505  auto check = [this, isDelete](std::shared_ptr<SLE const> const& sle) {
506  uint256 const account = sle->key() & accountBits;
507  uint256 const hiLimit = sle->key() & pageBits;
508  std::optional<uint256> const prev = (*sle)[~sfPreviousPageMin];
509 
510  // Make sure that any page links...
511  // 1. Are properly associated with the owning account and
512  // 2. The page is correctly ordered between links.
513  if (prev)
514  {
515  if (account != (*prev & accountBits))
516  badLink_ = true;
517 
518  if (hiLimit <= (*prev & pageBits))
519  badLink_ = true;
520  }
521 
522  if (auto const next = (*sle)[~sfNextPageMin])
523  {
524  if (account != (*next & accountBits))
525  badLink_ = true;
526 
527  if (hiLimit >= (*next & pageBits))
528  badLink_ = true;
529  }
530 
531  {
532  auto const& nftokens = sle->getFieldArray(sfNFTokens);
533 
534  // An NFTokenPage should never contain too many tokens or be empty.
535  if (std::size_t const nftokenCount = nftokens.size();
536  (!isDelete && nftokenCount == 0) ||
537  nftokenCount > dirMaxTokensPerPage)
538  invalidSize_ = true;
539 
540  // If prev is valid, use it to establish a lower bound for
541  // page entries. If prev is not valid the lower bound is zero.
542  uint256 const loLimit =
543  prev ? *prev & pageBits : uint256(beast::zero);
544 
545  // Also verify that all NFTokenIDs in the page are sorted.
546  uint256 loCmp = loLimit;
547  for (auto const& obj : nftokens)
548  {
549  uint256 const tokenID = obj[sfNFTokenID];
550  if (!nft::compareTokens(loCmp, tokenID))
551  badSort_ = true;
552  loCmp = tokenID;
553 
554  // None of the NFTs on this page should belong on lower or
555  // higher pages.
556  if (uint256 const tokenPageBits = tokenID & pageBits;
557  tokenPageBits < loLimit || tokenPageBits >= hiLimit)
558  badEntry_ = true;
559 
560  if (auto uri = obj[~sfURI]; uri && uri->empty())
561  badURI_ = true;
562  }
563  }
564  };
565 
566  if (before && before->getType() == ltNFTOKEN_PAGE)
567  check(before);
568 
569  if (after && after->getType() == ltNFTOKEN_PAGE)
570  check(after);
571 }
572 
573 bool
575  STTx const& tx,
576  TER const result,
577  XRPAmount const,
578  ReadView const& view,
579  beast::Journal const& j)
580 {
581  if (badLink_)
582  {
583  JLOG(j.fatal()) << "Invariant failed: NFT page is improperly linked.";
584  return false;
585  }
586 
587  if (badEntry_)
588  {
589  JLOG(j.fatal()) << "Invariant failed: NFT found in incorrect page.";
590  return false;
591  }
592 
593  if (badSort_)
594  {
595  JLOG(j.fatal()) << "Invariant failed: NFTs on page are not sorted.";
596  return false;
597  }
598 
599  if (badURI_)
600  {
601  JLOG(j.fatal()) << "Invariant failed: NFT contains empty URI.";
602  return false;
603  }
604 
605  if (invalidSize_)
606  {
607  JLOG(j.fatal()) << "Invariant failed: NFT page has invalid size.";
608  return false;
609  }
610 
611  return true;
612 }
613 
614 //------------------------------------------------------------------------------
615 void
617  bool,
618  std::shared_ptr<SLE const> const& before,
620 {
621  if (before && before->getType() == ltACCOUNT_ROOT)
622  {
623  beforeMintedTotal += (*before)[~sfMintedNFTokens].value_or(0);
624  beforeBurnedTotal += (*before)[~sfBurnedNFTokens].value_or(0);
625  }
626 
627  if (after && after->getType() == ltACCOUNT_ROOT)
628  {
629  afterMintedTotal += (*after)[~sfMintedNFTokens].value_or(0);
630  afterBurnedTotal += (*after)[~sfBurnedNFTokens].value_or(0);
631  }
632 }
633 
634 bool
636  STTx const& tx,
637  TER const result,
638  XRPAmount const,
639  ReadView const& view,
640  beast::Journal const& j)
641 {
642  if (TxType const txType = tx.getTxnType();
643  txType != ttNFTOKEN_MINT && txType != ttNFTOKEN_BURN)
644  {
646  {
647  JLOG(j.fatal()) << "Invariant failed: the number of minted tokens "
648  "changed without a mint transaction!";
649  return false;
650  }
651 
653  {
654  JLOG(j.fatal()) << "Invariant failed: the number of burned tokens "
655  "changed without a burn transaction!";
656  return false;
657  }
658 
659  return true;
660  }
661 
662  if (tx.getTxnType() == ttNFTOKEN_MINT)
663  {
664  if (result == tesSUCCESS && beforeMintedTotal >= afterMintedTotal)
665  {
666  JLOG(j.fatal())
667  << "Invariant failed: successful minting didn't increase "
668  "the number of minted tokens.";
669  return false;
670  }
671 
672  if (result != tesSUCCESS && beforeMintedTotal != afterMintedTotal)
673  {
674  JLOG(j.fatal()) << "Invariant failed: failed minting changed the "
675  "number of minted tokens.";
676  return false;
677  }
678 
680  {
681  JLOG(j.fatal())
682  << "Invariant failed: minting changed the number of "
683  "burned tokens.";
684  return false;
685  }
686  }
687 
688  if (tx.getTxnType() == ttNFTOKEN_BURN)
689  {
690  if (result == tesSUCCESS)
691  {
693  {
694  JLOG(j.fatal())
695  << "Invariant failed: successful burning didn't increase "
696  "the number of burned tokens.";
697  return false;
698  }
699  }
700 
701  if (result != tesSUCCESS && beforeBurnedTotal != afterBurnedTotal)
702  {
703  JLOG(j.fatal()) << "Invariant failed: failed burning changed the "
704  "number of burned tokens.";
705  return false;
706  }
707 
709  {
710  JLOG(j.fatal())
711  << "Invariant failed: burning changed the number of "
712  "minted tokens.";
713  return false;
714  }
715  }
716 
717  return true;
718 }
719 
720 } // namespace ripple
beast::Journal::fatal
Stream fatal() const
Definition: Journal.h:339
ripple::STTx::getTxnType
TxType getTxnType() const
Definition: STTx.h:179
ripple::ValidNFTokenPage::badURI_
bool badURI_
Definition: InvariantCheck.h:326
ripple::LedgerEntryTypesMatch::visitEntry
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Definition: InvariantCheck.cpp:347
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:261
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:43
ripple::sfAmount
const SF_AMOUNT sfAmount
ripple::sfNFTokenID
const SF_UINT256 sfNFTokenID
ripple::ltLEDGER_HASHES
@ ltLEDGER_HASHES
A ledger object that contains a list of ledger hashes.
Definition: LedgerFormats.h:102
ripple::XRPBalanceChecks::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition: InvariantCheck.cpp:198
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:410
ripple::ValidNFTokenPage::badSort_
bool badSort_
Definition: InvariantCheck.h:325
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:217
ripple::NoZeroEscrow::bad_
bool bad_
Definition: InvariantCheck.h:277
ripple::ValidNFTokenPage::visitEntry
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Definition: InvariantCheck.cpp:497
ripple::dirMaxTokensPerPage
constexpr std::size_t dirMaxTokensPerPage
The maximum number of items in an NFT page.
Definition: Protocol.h:61
ripple::TxType
TxType
Transaction type identifiers.
Definition: TxFormats.h:56
ripple::NoBadOffers::bad_
bool bad_
Definition: InvariantCheck.h:253
ripple::NFTokenCountTracking::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition: InvariantCheck.cpp:635
ripple::ValidNFTokenPage::invalidSize_
bool invalidSize_
Definition: InvariantCheck.h:327
ripple::NFTokenCountTracking::beforeMintedTotal
std::uint32_t beforeMintedTotal
Definition: InvariantCheck.h:347
ripple::ltCHECK
@ ltCHECK
A ledger object which describes a check.
Definition: LedgerFormats.h:136
ripple::ltFEE_SETTINGS
@ ltFEE_SETTINGS
The ledger object which lists the network's fee settings.
Definition: LedgerFormats.h:118
ripple::NFTokenCountTracking::afterMintedTotal
std::uint32_t afterMintedTotal
Definition: InvariantCheck.h:349
ripple::nft::compareTokens
bool compareTokens(uint256 const &a, uint256 const &b)
Definition: NFTokenUtils.cpp:227
ripple::STAmount::xrp
XRPAmount xrp() const
Definition: STAmount.cpp:334
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:303
ripple::ltDIR_NODE
@ ltDIR_NODE
A ledger object which contains a list of object identifiers.
Definition: LedgerFormats.h:66
ripple::ValidNewAccountRoot::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition: InvariantCheck.cpp:457
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:427
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:110
ripple::sfLowLimit
const SF_AMOUNT sfLowLimit
ripple::LedgerEntryTypesMatch::typeMismatch_
bool typeMismatch_
Definition: InvariantCheck.h:199
ripple::ValidNFTokenPage::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition: InvariantCheck.cpp:574
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:242
ripple::LedgerEntryTypesMatch::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition: InvariantCheck.cpp:384
ripple::NFTokenCountTracking::afterBurnedTotal
std::uint32_t afterBurnedTotal
Definition: InvariantCheck.h:350
ripple::ltESCROW
@ ltESCROW
A ledger object describing a single escrow.
Definition: LedgerFormats.h:124
ripple::ltNFTOKEN_OFFER
@ ltNFTOKEN_OFFER
A ledger object which identifies an offer to buy or sell an NFT.
Definition: LedgerFormats.h:162
ripple::ValidNFTokenPage::badEntry_
bool badEntry_
Definition: InvariantCheck.h:323
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:444
ripple::ltDEPOSIT_PREAUTH
@ ltDEPOSIT_PREAUTH
A ledger object which describes a deposit preauthorization.
Definition: LedgerFormats.h:142
ripple::STAmount
Definition: STAmount.h:45
ripple::XRPNotCreated::visitEntry
void visitEntry(bool, std::shared_ptr< SLE const > const &, std::shared_ptr< SLE const > const &)
Definition: InvariantCheck.cpp:82
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:137
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:287
ripple::AccountRootsNotDeleted::finalize
bool finalize(STTx const &, TER const, XRPAmount const, ReadView const &, beast::Journal const &)
Definition: InvariantCheck.cpp:316
ripple::NFTokenCountTracking::beforeBurnedTotal
std::uint32_t beforeBurnedTotal
Definition: InvariantCheck.h:348
ripple::sfNFTokens
const SField sfNFTokens
ripple::sfURI
const SF_VL sfURI
ripple::STAmount::native
bool native() const noexcept
Definition: STAmount.h:329
ripple::ReadView
A view into a ledger.
Definition: ReadView.h:125
ripple::ltNFTOKEN_PAGE
@ ltNFTOKEN_PAGE
A ledger object which contains a list of NFTs.
Definition: LedgerFormats.h:156
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::ltNEGATIVE_UNL
@ ltNEGATIVE_UNL
The ledger object which tracks the current negative UNL state.
Definition: LedgerFormats.h:150
ripple::NoXRPTrustLines::xrpTrustLine_
bool xrpTrustLine_
Definition: InvariantCheck.h:226
ripple::ReadView::seq
LedgerIndex seq() const
Returns the sequence number of the base ledger.
Definition: ReadView.h:193
ripple::ValidNewAccountRoot::accountsCreated_
std::uint32_t accountsCreated_
Definition: InvariantCheck.h:302
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:34
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:306
ripple::sfNextPageMin
const SF_UINT256 sfNextPageMin
ripple::xrpIssue
Issue const & xrpIssue()
Returns an asset specifier that represents XRP.
Definition: Issue.h:95
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::AccountRootsNotDeleted::accountsDeleted_
std::uint32_t accountsDeleted_
Definition: InvariantCheck.h:148
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:167
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:616
ripple::XRPBalanceChecks::bad_
bool bad_
Definition: InvariantCheck.h:175
ripple::sfBurnedNFTokens
const SF_UINT32 sfBurnedNFTokens
ripple::LedgerEntryTypesMatch::invalidTypeAdded_
bool invalidTypeAdded_
Definition: InvariantCheck.h:200
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:222
ripple::XRPNotCreated::drops_
std::int64_t drops_
Definition: InvariantCheck.h:120
ripple::STObject::getFieldAmount
STAmount const & getFieldAmount(SField const &field) const
Definition: STObject.cpp:603
ripple::ltPAYCHAN
@ ltPAYCHAN
A ledger object describing a single unidirectional XRP payment channel.
Definition: LedgerFormats.h:130
ripple::XRPAmount
Definition: XRPAmount.h:46
ripple::ValidNFTokenPage::badLink_
bool badLink_
Definition: InvariantCheck.h:324