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/LedgerFormats.h>
25#include <xrpl/protocol/TxFlags.h>
55 auto const accountID = ctx.
tx[sfAccount];
56 auto const holderID = ctx.
tx[~sfHolder];
57 if (holderID && accountID == holderID)
73 auto const delegate = tx[~sfDelegate];
78 auto const sle =
view.
read(delegateKey);
97 !granularPermissions.
contains(MPTokenIssuanceLock))
101 !granularPermissions.
contains(MPTokenIssuanceUnlock))
111 auto const sleMptIssuance =
126 if ((*sleMptIssuance)[sfIssuer] != ctx.
tx[sfAccount])
129 if (
auto const holderID = ctx.
tx[~sfHolder])
141 if (
auto const domain = ctx.
tx[~sfDomainID])
146 if (*domain != beast::zero)
148 auto const sleDomain =
161 auto const mptIssuanceID =
ctx_.
tx[sfMPTokenIssuanceID];
163 auto const holderID =
ctx_.
tx[~sfHolder];
164 auto const domainID =
ctx_.
tx[~sfDomainID];
181 flagsOut &= ~lsfMPTLocked;
183 if (flagsIn != flagsOut)
184 sle->setFieldU32(sfFlags, flagsOut);
190 sle->getType() == ltMPTOKEN_ISSUANCE,
191 "MPTokenIssuanceSet::doApply : modifying MPTokenIssuance");
193 if (*domainID != beast::zero)
195 sle->setFieldH256(sfDomainID, *domainID);
199 if (sle->isFieldPresent(sfDomainID))
200 sle->makeFieldAbsent(sfDomainID);
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.
virtual Rules const & rules() const =0
Returns the tx processing rules.
bool enabled(uint256 const &feature) const
Returns true if a feature is enabled.
bool isFlag(std::uint32_t) const
bool isFieldPresent(SField const &field) const
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 permissionedDomain(AccountID const &account, std::uint32_t seq) noexcept
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.
@ tecNO_DELEGATE_PERMISSION
constexpr std::uint32_t const tfMPTLock
bool isTesSuccess(TER x) noexcept
TERSubset< CanCvtToNotTEC > NotTEC
State information when determining if a tx is likely to claim a fee.
State information when preflighting a tx.