rippled
Loading...
Searching...
No Matches
SetAccount.cpp
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2012, 2013 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 <xrpld/app/misc/DelegateUtils.h>
21#include <xrpld/app/tx/detail/SetAccount.h>
22#include <xrpld/core/Config.h>
23
24#include <xrpl/basics/Log.h>
25#include <xrpl/ledger/View.h>
26#include <xrpl/protocol/Feature.h>
27#include <xrpl/protocol/Indexes.h>
28#include <xrpl/protocol/PublicKey.h>
29#include <xrpl/protocol/Quality.h>
30#include <xrpl/protocol/st.h>
31
32namespace ripple {
33
34TxConsequences
36{
37 // The SetAccount may be a blocker, but only if it sets or clears
38 // specific account flags.
39 auto getTxConsequencesCategory = [](STTx const& tx) {
40 if (std::uint32_t const uTxFlags = tx.getFlags();
41 uTxFlags & (tfRequireAuth | tfOptionalAuth))
43
44 if (auto const uSetFlag = tx[~sfSetFlag]; uSetFlag &&
45 (*uSetFlag == asfRequireAuth || *uSetFlag == asfDisableMaster ||
46 *uSetFlag == asfAccountTxnID))
48
49 if (auto const uClearFlag = tx[~sfClearFlag]; uClearFlag &&
50 (*uClearFlag == asfRequireAuth || *uClearFlag == asfDisableMaster ||
51 *uClearFlag == asfAccountTxnID))
53
55 };
56
57 return TxConsequences{ctx.tx, getTxConsequencesCategory(ctx.tx)};
58}
59
65
68{
69 auto& tx = ctx.tx;
70 auto& j = ctx.j;
71
72 std::uint32_t const uTxFlags = tx.getFlags();
73
74 std::uint32_t const uSetFlag = tx.getFieldU32(sfSetFlag);
75 std::uint32_t const uClearFlag = tx.getFieldU32(sfClearFlag);
76
77 if ((uSetFlag != 0) && (uSetFlag == uClearFlag))
78 {
79 JLOG(j.trace()) << "Malformed transaction: Set and clear same flag.";
80 return temINVALID_FLAG;
81 }
82
83 //
84 // RequireAuth
85 //
86 bool bSetRequireAuth =
87 (uTxFlags & tfRequireAuth) || (uSetFlag == asfRequireAuth);
88 bool bClearRequireAuth =
89 (uTxFlags & tfOptionalAuth) || (uClearFlag == asfRequireAuth);
90
91 if (bSetRequireAuth && bClearRequireAuth)
92 {
93 JLOG(j.trace()) << "Malformed transaction: Contradictory flags set.";
94 return temINVALID_FLAG;
95 }
96
97 //
98 // RequireDestTag
99 //
100 bool bSetRequireDest =
101 (uTxFlags & tfRequireDestTag) || (uSetFlag == asfRequireDest);
102 bool bClearRequireDest =
103 (uTxFlags & tfOptionalDestTag) || (uClearFlag == asfRequireDest);
104
105 if (bSetRequireDest && bClearRequireDest)
106 {
107 JLOG(j.trace()) << "Malformed transaction: Contradictory flags set.";
108 return temINVALID_FLAG;
109 }
110
111 //
112 // DisallowXRP
113 //
114 bool bSetDisallowXRP =
115 (uTxFlags & tfDisallowXRP) || (uSetFlag == asfDisallowXRP);
116 bool bClearDisallowXRP =
117 (uTxFlags & tfAllowXRP) || (uClearFlag == asfDisallowXRP);
118
119 if (bSetDisallowXRP && bClearDisallowXRP)
120 {
121 JLOG(j.trace()) << "Malformed transaction: Contradictory flags set.";
122 return temINVALID_FLAG;
123 }
124
125 // TransferRate
126 if (tx.isFieldPresent(sfTransferRate))
127 {
128 std::uint32_t uRate = tx.getFieldU32(sfTransferRate);
129
130 if (uRate && (uRate < QUALITY_ONE))
131 {
132 JLOG(j.trace())
133 << "Malformed transaction: Transfer rate too small.";
135 }
136
137 if (uRate > 2 * QUALITY_ONE)
138 {
139 JLOG(j.trace())
140 << "Malformed transaction: Transfer rate too large.";
142 }
143 }
144
145 // TickSize
146 if (tx.isFieldPresent(sfTickSize))
147 {
148 auto uTickSize = tx[sfTickSize];
149 if (uTickSize &&
150 ((uTickSize < Quality::minTickSize) ||
151 (uTickSize > Quality::maxTickSize)))
152 {
153 JLOG(j.trace()) << "Malformed transaction: Bad tick size.";
154 return temBAD_TICK_SIZE;
155 }
156 }
157
158 if (auto const mk = tx[~sfMessageKey])
159 {
160 if (mk->size() && !publicKeyType({mk->data(), mk->size()}))
161 {
162 JLOG(j.trace()) << "Invalid message key specified.";
163 return telBAD_PUBLIC_KEY;
164 }
165 }
166
167 if (auto const domain = tx[~sfDomain];
168 domain && domain->size() > maxDomainLength)
169 {
170 JLOG(j.trace()) << "domain too long";
171 return telBAD_DOMAIN;
172 }
173
174 if (ctx.rules.enabled(featureNonFungibleTokensV1))
175 {
176 // Configure authorized minting account:
177 if (uSetFlag == asfAuthorizedNFTokenMinter &&
178 !tx.isFieldPresent(sfNFTokenMinter))
179 return temMALFORMED;
180
181 if (uClearFlag == asfAuthorizedNFTokenMinter &&
182 tx.isFieldPresent(sfNFTokenMinter))
183 return temMALFORMED;
184 }
185
186 return tesSUCCESS;
187}
188
189TER
191{
192 // SetAccount is prohibited to be granted on a transaction level,
193 // but some granular permissions are allowed.
194 auto const delegate = tx[~sfDelegate];
195 if (!delegate)
196 return tesSUCCESS;
197
198 auto const delegateKey = keylet::delegate(tx[sfAccount], *delegate);
199 auto const sle = view.read(delegateKey);
200
201 if (!sle)
203
205 loadGranularPermission(sle, ttACCOUNT_SET, granularPermissions);
206
207 auto const uSetFlag = tx.getFieldU32(sfSetFlag);
208 auto const uClearFlag = tx.getFieldU32(sfClearFlag);
209 auto const uTxFlags = tx.getFlags();
210 // We don't support any flag based granular permission under
211 // AccountSet transaction. If any delegated account is trying to
212 // update the flag on behalf of another account, it is not
213 // authorized.
214 if (uSetFlag != 0 || uClearFlag != 0 || uTxFlags & tfUniversalMask)
216
217 if (tx.isFieldPresent(sfEmailHash) &&
218 !granularPermissions.contains(AccountEmailHashSet))
220
221 if (tx.isFieldPresent(sfWalletLocator) ||
222 tx.isFieldPresent(sfNFTokenMinter))
224
225 if (tx.isFieldPresent(sfMessageKey) &&
226 !granularPermissions.contains(AccountMessageKeySet))
228
229 if (tx.isFieldPresent(sfDomain) &&
230 !granularPermissions.contains(AccountDomainSet))
232
233 if (tx.isFieldPresent(sfTransferRate) &&
234 !granularPermissions.contains(AccountTransferRateSet))
236
237 if (tx.isFieldPresent(sfTickSize) &&
238 !granularPermissions.contains(AccountTickSizeSet))
240
241 return tesSUCCESS;
242}
243
244TER
246{
247 auto const id = ctx.tx[sfAccount];
248
249 std::uint32_t const uTxFlags = ctx.tx.getFlags();
250
251 auto const sle = ctx.view.read(keylet::account(id));
252 if (!sle)
253 return terNO_ACCOUNT;
254
255 std::uint32_t const uFlagsIn = sle->getFieldU32(sfFlags);
256
257 std::uint32_t const uSetFlag = ctx.tx.getFieldU32(sfSetFlag);
258
259 // legacy AccountSet flags
260 bool bSetRequireAuth =
261 (uTxFlags & tfRequireAuth) || (uSetFlag == asfRequireAuth);
262
263 //
264 // RequireAuth
265 //
266 if (bSetRequireAuth && !(uFlagsIn & lsfRequireAuth))
267 {
268 if (!dirIsEmpty(ctx.view, keylet::ownerDir(id)))
269 {
270 JLOG(ctx.j.trace()) << "Retry: Owner directory not empty.";
271 return (ctx.flags & tapRETRY) ? TER{terOWNERS} : TER{tecOWNERS};
272 }
273 }
274
275 //
276 // Clawback
277 //
278 if (ctx.view.rules().enabled(featureClawback))
279 {
280 if (uSetFlag == asfAllowTrustLineClawback)
281 {
282 if (uFlagsIn & lsfNoFreeze)
283 {
284 JLOG(ctx.j.trace()) << "Can't set Clawback if NoFreeze is set";
285 return tecNO_PERMISSION;
286 }
287
288 if (!dirIsEmpty(ctx.view, keylet::ownerDir(id)))
289 {
290 JLOG(ctx.j.trace()) << "Owner directory not empty.";
291 return tecOWNERS;
292 }
293 }
294 else if (uSetFlag == asfNoFreeze)
295 {
296 // Cannot set NoFreeze if clawback is enabled
297 if (uFlagsIn & lsfAllowTrustLineClawback)
298 {
299 JLOG(ctx.j.trace())
300 << "Can't set NoFreeze if clawback is enabled";
301 return tecNO_PERMISSION;
302 }
303 }
304 }
305
306 return tesSUCCESS;
307}
308
309TER
311{
312 auto const sle = view().peek(keylet::account(account_));
313 if (!sle)
314 return tefINTERNAL;
315
316 std::uint32_t const uFlagsIn = sle->getFieldU32(sfFlags);
317 std::uint32_t uFlagsOut = uFlagsIn;
318
319 STTx const& tx{ctx_.tx};
320 std::uint32_t const uSetFlag{tx.getFieldU32(sfSetFlag)};
321 std::uint32_t const uClearFlag{tx.getFieldU32(sfClearFlag)};
322
323 // legacy AccountSet flags
324 std::uint32_t const uTxFlags{tx.getFlags()};
325 bool const bSetRequireDest{
326 (uTxFlags & tfRequireDestTag) || (uSetFlag == asfRequireDest)};
327 bool const bClearRequireDest{
328 (uTxFlags & tfOptionalDestTag) || (uClearFlag == asfRequireDest)};
329 bool const bSetRequireAuth{
330 (uTxFlags & tfRequireAuth) || (uSetFlag == asfRequireAuth)};
331 bool const bClearRequireAuth{
332 (uTxFlags & tfOptionalAuth) || (uClearFlag == asfRequireAuth)};
333 bool const bSetDisallowXRP{
334 (uTxFlags & tfDisallowXRP) || (uSetFlag == asfDisallowXRP)};
335 bool const bClearDisallowXRP{
336 (uTxFlags & tfAllowXRP) || (uClearFlag == asfDisallowXRP)};
337
338 bool const sigWithMaster{[&tx, &acct = account_]() {
339 auto const spk = tx.getSigningPubKey();
340
341 if (publicKeyType(makeSlice(spk)))
342 {
343 PublicKey const signingPubKey(makeSlice(spk));
344
345 if (calcAccountID(signingPubKey) == acct)
346 return true;
347 }
348 return false;
349 }()};
350
351 //
352 // RequireAuth
353 //
354 if (bSetRequireAuth && !(uFlagsIn & lsfRequireAuth))
355 {
356 JLOG(j_.trace()) << "Set RequireAuth.";
357 uFlagsOut |= lsfRequireAuth;
358 }
359
360 if (bClearRequireAuth && (uFlagsIn & lsfRequireAuth))
361 {
362 JLOG(j_.trace()) << "Clear RequireAuth.";
363 uFlagsOut &= ~lsfRequireAuth;
364 }
365
366 //
367 // RequireDestTag
368 //
369 if (bSetRequireDest && !(uFlagsIn & lsfRequireDestTag))
370 {
371 JLOG(j_.trace()) << "Set lsfRequireDestTag.";
372 uFlagsOut |= lsfRequireDestTag;
373 }
374
375 if (bClearRequireDest && (uFlagsIn & lsfRequireDestTag))
376 {
377 JLOG(j_.trace()) << "Clear lsfRequireDestTag.";
378 uFlagsOut &= ~lsfRequireDestTag;
379 }
380
381 //
382 // DisallowXRP
383 //
384 if (bSetDisallowXRP && !(uFlagsIn & lsfDisallowXRP))
385 {
386 JLOG(j_.trace()) << "Set lsfDisallowXRP.";
387 uFlagsOut |= lsfDisallowXRP;
388 }
389
390 if (bClearDisallowXRP && (uFlagsIn & lsfDisallowXRP))
391 {
392 JLOG(j_.trace()) << "Clear lsfDisallowXRP.";
393 uFlagsOut &= ~lsfDisallowXRP;
394 }
395
396 //
397 // DisableMaster
398 //
399 if ((uSetFlag == asfDisableMaster) && !(uFlagsIn & lsfDisableMaster))
400 {
401 if (!sigWithMaster)
402 {
403 JLOG(j_.trace()) << "Must use master key to disable master key.";
404 return tecNEED_MASTER_KEY;
405 }
406
407 if ((!sle->isFieldPresent(sfRegularKey)) &&
408 (!view().peek(keylet::signers(account_))))
409 {
410 // Account has no regular key or multi-signer signer list.
412 }
413
414 JLOG(j_.trace()) << "Set lsfDisableMaster.";
415 uFlagsOut |= lsfDisableMaster;
416 }
417
418 if ((uClearFlag == asfDisableMaster) && (uFlagsIn & lsfDisableMaster))
419 {
420 JLOG(j_.trace()) << "Clear lsfDisableMaster.";
421 uFlagsOut &= ~lsfDisableMaster;
422 }
423
424 //
425 // DefaultRipple
426 //
427 if (uSetFlag == asfDefaultRipple)
428 {
429 JLOG(j_.trace()) << "Set lsfDefaultRipple.";
430 uFlagsOut |= lsfDefaultRipple;
431 }
432 else if (uClearFlag == asfDefaultRipple)
433 {
434 JLOG(j_.trace()) << "Clear lsfDefaultRipple.";
435 uFlagsOut &= ~lsfDefaultRipple;
436 }
437
438 //
439 // NoFreeze
440 //
441 if (uSetFlag == asfNoFreeze)
442 {
443 if (!sigWithMaster && !(uFlagsIn & lsfDisableMaster))
444 {
445 JLOG(j_.trace()) << "Must use master key to set NoFreeze.";
446 return tecNEED_MASTER_KEY;
447 }
448
449 JLOG(j_.trace()) << "Set NoFreeze flag";
450 uFlagsOut |= lsfNoFreeze;
451 }
452
453 // Anyone may set global freeze
454 if (uSetFlag == asfGlobalFreeze)
455 {
456 JLOG(j_.trace()) << "Set GlobalFreeze flag";
457 uFlagsOut |= lsfGlobalFreeze;
458 }
459
460 // If you have set NoFreeze, you may not clear GlobalFreeze
461 // This prevents those who have set NoFreeze from using
462 // GlobalFreeze strategically.
463 if ((uSetFlag != asfGlobalFreeze) && (uClearFlag == asfGlobalFreeze) &&
464 ((uFlagsOut & lsfNoFreeze) == 0))
465 {
466 JLOG(j_.trace()) << "Clear GlobalFreeze flag";
467 uFlagsOut &= ~lsfGlobalFreeze;
468 }
469
470 //
471 // Track transaction IDs signed by this account in its root
472 //
473 if ((uSetFlag == asfAccountTxnID) && !sle->isFieldPresent(sfAccountTxnID))
474 {
475 JLOG(j_.trace()) << "Set AccountTxnID.";
476 sle->makeFieldPresent(sfAccountTxnID);
477 }
478
479 if ((uClearFlag == asfAccountTxnID) && sle->isFieldPresent(sfAccountTxnID))
480 {
481 JLOG(j_.trace()) << "Clear AccountTxnID.";
482 sle->makeFieldAbsent(sfAccountTxnID);
483 }
484
485 //
486 // DepositAuth
487 //
488 if (view().rules().enabled(featureDepositAuth))
489 {
490 if (uSetFlag == asfDepositAuth)
491 {
492 JLOG(j_.trace()) << "Set lsfDepositAuth.";
493 uFlagsOut |= lsfDepositAuth;
494 }
495 else if (uClearFlag == asfDepositAuth)
496 {
497 JLOG(j_.trace()) << "Clear lsfDepositAuth.";
498 uFlagsOut &= ~lsfDepositAuth;
499 }
500 }
501
502 //
503 // EmailHash
504 //
505 if (tx.isFieldPresent(sfEmailHash))
506 {
507 uint128 const uHash = tx.getFieldH128(sfEmailHash);
508
509 if (!uHash)
510 {
511 JLOG(j_.trace()) << "unset email hash";
512 sle->makeFieldAbsent(sfEmailHash);
513 }
514 else
515 {
516 JLOG(j_.trace()) << "set email hash";
517 sle->setFieldH128(sfEmailHash, uHash);
518 }
519 }
520
521 //
522 // WalletLocator
523 //
524 if (tx.isFieldPresent(sfWalletLocator))
525 {
526 uint256 const uHash = tx.getFieldH256(sfWalletLocator);
527
528 if (!uHash)
529 {
530 JLOG(j_.trace()) << "unset wallet locator";
531 sle->makeFieldAbsent(sfWalletLocator);
532 }
533 else
534 {
535 JLOG(j_.trace()) << "set wallet locator";
536 sle->setFieldH256(sfWalletLocator, uHash);
537 }
538 }
539
540 //
541 // MessageKey
542 //
543 if (tx.isFieldPresent(sfMessageKey))
544 {
545 Blob const messageKey = tx.getFieldVL(sfMessageKey);
546
547 if (messageKey.empty())
548 {
549 JLOG(j_.debug()) << "set message key";
550 sle->makeFieldAbsent(sfMessageKey);
551 }
552 else
553 {
554 JLOG(j_.debug()) << "set message key";
555 sle->setFieldVL(sfMessageKey, messageKey);
556 }
557 }
558
559 //
560 // Domain
561 //
562 if (tx.isFieldPresent(sfDomain))
563 {
564 Blob const domain = tx.getFieldVL(sfDomain);
565
566 if (domain.empty())
567 {
568 JLOG(j_.trace()) << "unset domain";
569 sle->makeFieldAbsent(sfDomain);
570 }
571 else
572 {
573 JLOG(j_.trace()) << "set domain";
574 sle->setFieldVL(sfDomain, domain);
575 }
576 }
577
578 //
579 // TransferRate
580 //
581 if (tx.isFieldPresent(sfTransferRate))
582 {
583 std::uint32_t uRate = tx.getFieldU32(sfTransferRate);
584
585 if (uRate == 0 || uRate == QUALITY_ONE)
586 {
587 JLOG(j_.trace()) << "unset transfer rate";
588 sle->makeFieldAbsent(sfTransferRate);
589 }
590 else
591 {
592 JLOG(j_.trace()) << "set transfer rate";
593 sle->setFieldU32(sfTransferRate, uRate);
594 }
595 }
596
597 //
598 // TickSize
599 //
600 if (tx.isFieldPresent(sfTickSize))
601 {
602 auto uTickSize = tx[sfTickSize];
603 if ((uTickSize == 0) || (uTickSize == Quality::maxTickSize))
604 {
605 JLOG(j_.trace()) << "unset tick size";
606 sle->makeFieldAbsent(sfTickSize);
607 }
608 else
609 {
610 JLOG(j_.trace()) << "set tick size";
611 sle->setFieldU8(sfTickSize, uTickSize);
612 }
613 }
614
615 // Configure authorized minting account:
616 if (ctx_.view().rules().enabled(featureNonFungibleTokensV1))
617 {
618 if (uSetFlag == asfAuthorizedNFTokenMinter)
619 sle->setAccountID(sfNFTokenMinter, ctx_.tx[sfNFTokenMinter]);
620
621 if (uClearFlag == asfAuthorizedNFTokenMinter &&
622 sle->isFieldPresent(sfNFTokenMinter))
623 sle->makeFieldAbsent(sfNFTokenMinter);
624 }
625
626 // Set or clear flags for disallowing various incoming instruments
627 if (ctx_.view().rules().enabled(featureDisallowIncoming))
628 {
629 if (uSetFlag == asfDisallowIncomingNFTokenOffer)
631 else if (uClearFlag == asfDisallowIncomingNFTokenOffer)
632 uFlagsOut &= ~lsfDisallowIncomingNFTokenOffer;
633
634 if (uSetFlag == asfDisallowIncomingCheck)
635 uFlagsOut |= lsfDisallowIncomingCheck;
636 else if (uClearFlag == asfDisallowIncomingCheck)
637 uFlagsOut &= ~lsfDisallowIncomingCheck;
638
639 if (uSetFlag == asfDisallowIncomingPayChan)
640 uFlagsOut |= lsfDisallowIncomingPayChan;
641 else if (uClearFlag == asfDisallowIncomingPayChan)
642 uFlagsOut &= ~lsfDisallowIncomingPayChan;
643
644 if (uSetFlag == asfDisallowIncomingTrustline)
645 uFlagsOut |= lsfDisallowIncomingTrustline;
646 else if (uClearFlag == asfDisallowIncomingTrustline)
647 uFlagsOut &= ~lsfDisallowIncomingTrustline;
648 }
649
650 // Set or clear flags for disallowing escrow
651 if (ctx_.view().rules().enabled(featureTokenEscrow))
652 {
653 if (uSetFlag == asfAllowTrustLineLocking)
654 uFlagsOut |= lsfAllowTrustLineLocking;
655 else if (uClearFlag == asfAllowTrustLineLocking)
656 uFlagsOut &= ~lsfAllowTrustLineLocking;
657 }
658
659 // Set flag for clawback
660 if (ctx_.view().rules().enabled(featureClawback) &&
661 uSetFlag == asfAllowTrustLineClawback)
662 {
663 JLOG(j_.trace()) << "set allow clawback";
664 uFlagsOut |= lsfAllowTrustLineClawback;
665 }
666
667 if (uFlagsIn != uFlagsOut)
668 sle->setFieldU32(sfFlags, uFlagsOut);
669
670 ctx_.view().update(sle);
671
672 return tesSUCCESS;
673}
674
675} // namespace ripple
Stream debug() const
Definition Journal.h:328
Stream trace() const
Severity stream access functions.
Definition Journal.h:322
ApplyView & view()
virtual void update(std::shared_ptr< SLE > const &sle)=0
Indicate changes to a peeked SLE.
virtual std::shared_ptr< SLE > peek(Keylet const &k)=0
Prepare to modify the SLE associated with key.
A public key.
Definition PublicKey.h:61
A view into a ledger.
Definition ReadView.h:51
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
virtual Rules const & rules() const =0
Returns the tx processing rules.
bool enabled(uint256 const &feature) const
Returns true if a feature is enabled.
Definition Rules.cpp:130
std::uint32_t getFieldU32(SField const &field) const
Definition STObject.cpp:615
bool isFieldPresent(SField const &field) const
Definition STObject.cpp:484
std::uint32_t getFlags() const
Definition STObject.cpp:537
static TER checkPermission(ReadView const &view, STTx const &tx)
static TER preclaim(PreclaimContext const &ctx)
static TxConsequences makeTxConsequences(PreflightContext const &ctx)
static NotTEC preflight(PreflightContext const &ctx)
TER doApply() override
static std::uint32_t getFlagsMask(PreflightContext const &ctx)
AccountID const account_
Definition Transactor.h:147
ApplyView & view()
Definition Transactor.h:163
beast::Journal const j_
Definition Transactor.h:145
ApplyContext & ctx_
Definition Transactor.h:143
Class describing the consequences to the account of applying a transaction if the transaction consume...
Definition applySteps.h:58
@ normal
Moves currency around, creates offers, etc.
Definition applySteps.h:64
@ blocker
Affects the ability of subsequent transactions to claim a fee.
Definition applySteps.h:67
Integers of any length that is a multiple of 32-bits.
Definition base_uint.h:86
T contains(T... args)
T empty(T... args)
Keylet delegate(AccountID const &account, AccountID const &authorizedAccount) noexcept
A keylet for Delegate object.
Definition Indexes.cpp:465
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition Indexes.cpp:184
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Definition Indexes.cpp:374
Keylet signers(AccountID const &account) noexcept
A SignerList.
Definition Indexes.cpp:330
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:25
constexpr std::uint32_t tfAllowXRP
Definition TxFlags.h:71
constexpr std::uint32_t asfGlobalFreeze
Definition TxFlags.h:83
constexpr std::uint32_t asfDepositAuth
Definition TxFlags.h:85
constexpr std::uint32_t asfDisallowIncomingNFTokenOffer
Definition TxFlags.h:90
@ telBAD_PUBLIC_KEY
Definition TER.h:55
@ telBAD_DOMAIN
Definition TER.h:53
constexpr std::uint32_t asfAllowTrustLineLocking
Definition TxFlags.h:95
constexpr std::uint32_t asfRequireDest
Definition TxFlags.h:77
constexpr std::uint32_t asfAuthorizedNFTokenMinter
Definition TxFlags.h:86
constexpr std::uint32_t tfOptionalDestTag
Definition TxFlags.h:67
@ lsfRequireDestTag
@ lsfDefaultRipple
@ lsfDisallowIncomingCheck
@ lsfAllowTrustLineClawback
@ lsfDisableMaster
@ lsfDisallowIncomingPayChan
@ lsfDisallowIncomingTrustline
@ lsfAllowTrustLineLocking
@ lsfDisallowIncomingNFTokenOffer
@ lsfGlobalFreeze
constexpr std::uint32_t tfAccountSetMask
Definition TxFlags.h:72
constexpr std::uint32_t tfRequireDestTag
Definition TxFlags.h:66
constexpr std::uint32_t asfNoFreeze
Definition TxFlags.h:82
AccountID calcAccountID(PublicKey const &pk)
std::size_t constexpr maxDomainLength
The maximum length of a domain.
Definition Protocol.h:97
constexpr std::uint32_t asfDisableMaster
Definition TxFlags.h:80
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
Definition View.cpp:907
constexpr std::uint32_t asfDisallowIncomingTrustline
Definition TxFlags.h:93
@ tefINTERNAL
Definition TER.h:173
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
void loadGranularPermission(std::shared_ptr< SLE const > const &delegate, TxType const &type, std::unordered_set< GranularPermissionType > &granularPermissions)
Load the granular permissions granted to the delegate account for the specified transaction type.
constexpr std::uint32_t asfAccountTxnID
Definition TxFlags.h:81
constexpr std::uint32_t asfDefaultRipple
Definition TxFlags.h:84
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition Slice.h:244
constexpr std::uint32_t asfDisallowIncomingCheck
Definition TxFlags.h:91
constexpr std::uint32_t tfRequireAuth
Definition TxFlags.h:68
@ tecNO_DELEGATE_PERMISSION
Definition TER.h:364
@ tecNEED_MASTER_KEY
Definition TER.h:308
@ tecOWNERS
Definition TER.h:298
@ tecNO_PERMISSION
Definition TER.h:305
@ tecNO_ALTERNATIVE_KEY
Definition TER.h:296
@ tesSUCCESS
Definition TER.h:244
constexpr std::uint32_t tfOptionalAuth
Definition TxFlags.h:69
constexpr std::uint32_t tfDisallowXRP
Definition TxFlags.h:70
constexpr std::uint32_t asfDisallowIncomingPayChan
Definition TxFlags.h:92
constexpr std::uint32_t tfUniversalMask
Definition TxFlags.h:63
constexpr std::uint32_t asfAllowTrustLineClawback
Definition TxFlags.h:94
@ tapRETRY
Definition ApplyView.h:39
constexpr std::uint32_t asfRequireAuth
Definition TxFlags.h:78
@ terOWNERS
Definition TER.h:220
@ terNO_ACCOUNT
Definition TER.h:217
constexpr std::uint32_t asfDisallowXRP
Definition TxFlags.h:79
@ temMALFORMED
Definition TER.h:87
@ temINVALID_FLAG
Definition TER.h:111
@ temBAD_TICK_SIZE
Definition TER.h:118
@ temBAD_TRANSFER_RATE
Definition TER.h:107
State information when determining if a tx is likely to claim a fee.
Definition Transactor.h:80
ReadView const & view
Definition Transactor.h:83
beast::Journal const j
Definition Transactor.h:88
State information when preflighting a tx.
Definition Transactor.h:35
beast::Journal const j
Definition Transactor.h:42