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