20#include <xrpld/app/misc/DelegateUtils.h>
21#include <xrpld/app/tx/detail/MPTokenIssuanceSet.h>
23#include <xrpl/protocol/Feature.h>
24#include <xrpl/protocol/TxFlags.h>
46 auto const accountID = ctx.
tx[sfAccount];
47 auto const holderID = ctx.
tx[~sfHolder];
48 if (holderID && accountID == holderID)
57 auto const delegate = tx[~sfDelegate];
62 auto const sle =
view.
read(delegateKey);
81 !granularPermissions.
contains(MPTokenIssuanceLock))
85 !granularPermissions.
contains(MPTokenIssuanceUnlock))
95 auto const sleMptIssuance =
105 if ((*sleMptIssuance)[sfIssuer] != ctx.
tx[sfAccount])
108 if (
auto const holderID = ctx.
tx[~sfHolder])
126 auto const mptIssuanceID =
ctx_.
tx[sfMPTokenIssuanceID];
128 auto const holderID =
ctx_.
tx[~sfHolder];
145 flagsOut &= ~lsfMPTLocked;
147 if (flagsIn != flagsOut)
148 sle->setFieldU32(sfFlags, flagsOut);
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.
static TER preclaim(PreclaimContext const &ctx)
static NotTEC preflight(PreflightContext const &ctx)
static TER checkPermission(ReadView const &view, STTx const &tx)
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
virtual bool exists(Keylet const &k) const =0
Determine if a state item exists.
bool enabled(uint256 const &feature) const
Returns true if a feature is enabled.
std::uint32_t getFlags() const
Keylet mptoken(MPTID const &issuanceID, AccountID const &holder) noexcept
Keylet delegate(AccountID const &account, AccountID const &authorizedAccount) noexcept
A keylet for Delegate object.
Keylet mptIssuance(std::uint32_t seq, AccountID const &issuer) noexcept
Keylet account(AccountID const &id) noexcept
AccountID root.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
constexpr std::uint32_t const tfMPTokenIssuanceSetMask
constexpr std::uint32_t const tfMPTokenIssuanceSetPermissionMask
constexpr std::uint32_t const tfMPTUnlock
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
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.
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
TER checkTxPermission(std::shared_ptr< SLE const > const &delegate, STTx const &tx)
Check if the delegate account has permission to execute the transaction.
constexpr std::uint32_t const tfMPTLock
TERSubset< CanCvtToNotTEC > NotTEC
State information when determining if a tx is likely to claim a fee.
State information when preflighting a tx.