20#include <xrpld/app/tx/detail/NFTokenBurn.h>
21#include <xrpld/app/tx/detail/NFTokenUtils.h>
23#include <xrpl/protocol/Feature.h>
24#include <xrpl/protocol/Protocol.h>
25#include <xrpl/protocol/TxFlags.h>
47 auto const owner = [&ctx]() {
51 return ctx.
tx[sfAccount];
59 if (
auto const account = ctx.
tx[sfAccount]; owner != account)
69 if (
auto const minter = (*sle)[~sfNFTokenMinter];
103 (*issuer)[~sfBurnedNFTokens] =
104 (*issuer)[~sfBurnedNFTokens].value_or(0) + 1;
virtual void update(std::shared_ptr< SLE > const &sle)=0
Indicate changes to a peeked SLE.
static TER preclaim(PreclaimContext const &ctx)
static NotTEC preflight(PreflightContext const &ctx)
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.
AccountID getAccountID(SField const &field) const
bool isFieldPresent(SField const &field) const
std::uint32_t getFlags() const
Keylet account(AccountID const &id) noexcept
AccountID root.
Keylet nft_buys(uint256 const &id) noexcept
The directory of buy offers for the specified NFT.
Keylet nft_sells(uint256 const &id) noexcept
The directory of sell offers for the specified NFT.
constexpr std::uint16_t const flagBurnable
std::uint16_t getFlags(uint256 const &id)
TER removeToken(ApplyView &view, AccountID const &owner, uint256 const &nftokenID)
Remove the token from the owner's token directory.
AccountID getIssuer(uint256 const &id)
TER notTooManyOffers(ReadView const &view, uint256 const &nftokenID)
Returns tesSUCCESS if NFToken has few enough offers that it can be burned.
std::optional< STObject > findToken(ReadView const &view, AccountID const &owner, uint256 const &nftokenID)
Finds the specified token in the owner's token directory.
std::size_t removeTokenOffersWithLimit(ApplyView &view, Keylet const &directory, std::size_t maxDeletableOffers)
Delete up to a specified number of offers from the specified token offer directory.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::size_t constexpr maxDeletableTokenOfferEntries
The maximum number of offers in an offer directory for NFT to be burnable.
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
constexpr std::uint32_t tfUniversalMask
TERSubset< CanCvtToNotTEC > NotTEC
State information when determining if a tx is likely to claim a fee.
State information when preflighting a tx.