20 #include <ripple/app/tx/impl/NFTokenBurn.h>
21 #include <ripple/app/tx/impl/details/NFTokenUtils.h>
22 #include <ripple/ledger/Directory.h>
23 #include <ripple/ledger/View.h>
24 #include <ripple/protocol/Feature.h>
25 #include <ripple/protocol/Protocol.h>
26 #include <ripple/protocol/TxFlags.h>
27 #include <ripple/protocol/st.h>
28 #include <boost/endian/conversion.hpp>
51 auto const owner = [&ctx]() {
63 if (
auto const account = ctx.
tx[
sfAccount]; owner != account)
static NotTEC preflight(PreflightContext const &ctx)
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
std::uint16_t getFlags(uint256 const &id)
bool enabled(uint256 const &feature) const
Returns true if a feature is enabled.
constexpr std::size_t maxDeletableTokenOfferEntries
The maximum number of offers in an offer directory for NFT to be burnable.
const SF_UINT256 sfNFTokenID
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.
TER notTooManyOffers(ReadView const &view, uint256 const &nftokenID)
Returns tesSUCCESS if NFToken has few enough offers that it can be burned.
virtual void update(std::shared_ptr< SLE > const &sle)=0
Indicate changes to a peeked SLE.
std::optional< STObject > findToken(ReadView const &view, AccountID const &owner, uint256 const &nftokenID)
Finds the specified token in the owner's token directory.
TER removeToken(ApplyView &view, AccountID const &owner, uint256 const &nftokenID)
Remove the token from the owner's token directory.
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
static TER preclaim(PreclaimContext const &ctx)
AccountID getIssuer(uint256 const &id)
Keylet account(AccountID const &id) noexcept
AccountID root.
const SF_ACCOUNT sfNFTokenMinter
AccountID getAccountID(SField const &field) const
Keylet nft_sells(uint256 const &id) noexcept
The directory of sell offers for the specified NFT.
std::uint32_t getFlags() const
Keylet nft_buys(uint256 const &id) noexcept
The directory of buy offers for the specified NFT.
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
State information when determining if a tx is likely to claim a fee.
constexpr const std::uint16_t flagBurnable
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
const uint256 featureNonFungibleTokensV1
virtual Rules const & rules() const =0
Returns the tx processing rules.
bool isFieldPresent(SField const &field) const
const SF_ACCOUNT sfAccount
const uint256 fixNonFungibleTokensV1_2
State information when preflighting a tx.
const SF_UINT32 sfBurnedNFTokens
constexpr std::uint32_t tfUniversalMask
TERSubset< CanCvtToNotTEC > NotTEC