20 #include <ripple/app/tx/impl/NFTokenMint.h>
21 #include <ripple/basics/Expected.h>
22 #include <ripple/basics/Log.h>
23 #include <ripple/ledger/View.h>
24 #include <ripple/protocol/Feature.h>
25 #include <ripple/protocol/InnerObjectFormats.h>
26 #include <ripple/protocol/Rate.h>
27 #include <ripple/protocol/TxFlags.h>
28 #include <ripple/protocol/st.h>
29 #include <boost/endian/conversion.hpp>
102 flags = boost::endian::native_to_big(flags);
103 fee = boost::endian::native_to_big(fee);
105 tokenSeq = boost::endian::native_to_big(tokenSeq);
109 auto ptr = buf.
data();
114 ptr +=
sizeof(flags);
120 ptr += issuer.
size();
123 ptr +=
sizeof(taxon);
126 ptr +=
sizeof(tokenSeq);
170 if (nextTokenSeq < tokenSeq)
220 if (tokenSeq + 1u == 0u || tokenSeq < offset)
227 if (!tokenSeq.has_value())
228 return (tokenSeq.error());
237 if (nfTokenTemplate ==
nullptr)
244 [
this, &issuer, &tokenSeq](
STObject&
object) {
255 object.setFieldVL(
sfURI, *uri);
267 if (
auto const ownerCountAfter =
269 ownerCountAfter > ownerCountBefore)
271 if (
auto const reserve =
view().fees().accountReserve(ownerCountAfter);
static TER preclaim(PreclaimContext const &ctx)
constexpr std::uint16_t maxTransferFee
The maximum token transfer fee allowed.
const SF_UINT32 sfOwnerCount
const uint256 fixRemoveNFTokenAutoTrustLine
const SF_UINT32 sfFirstNFTokenSequence
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
constexpr const std::uint32_t tfTransferable
bool enabled(uint256 const &feature) const
Returns true if a feature is enabled.
virtual std::shared_ptr< SLE > peek(Keylet const &k)=0
Prepare to modify the SLE associated with key.
const SF_UINT256 sfNFTokenID
const SF_UINT32 sfSequence
constexpr const std::uint32_t tfNFTokenMintOldMask
Unexpected(E(&)[N]) -> Unexpected< E const * >
const SF_UINT32 sfMintedNFTokens
virtual void update(std::shared_ptr< SLE > const &sle)=0
Indicate changes to a peeked SLE.
SeqProxy getSeqProxy() const
Taxon toTaxon(std::uint32_t i)
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
const SF_UINT16 sfTransferFee
constexpr static std::size_t size()
const uint256 fixNFTokenRemint
constexpr bool isTicket() const
static NotTEC preflight(PreflightContext const &ctx)
Defines the fields and their attributes within a STObject.
Keylet account(AccountID const &id) noexcept
AccountID root.
const SF_ACCOUNT sfNFTokenMinter
std::uint32_t toUInt32(Taxon t)
static uint256 createNFTokenID(std::uint16_t flags, std::uint16_t fee, AccountID const &issuer, nft::Taxon taxon, std::uint32_t tokenSeq)
std::uint32_t getFlags() const
constexpr std::size_t maxTokenURILength
The maximum length of a URI inside an 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.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
const uint256 featureNonFungibleTokensV1
const SF_ACCOUNT sfIssuer
virtual Rules const & rules() const =0
Returns the tx processing rules.
bool isFieldPresent(SField const &field) const
static base_uint fromVoid(void const *data)
@ tecMAX_SEQUENCE_REACHED
bool isFlag(std::uint32_t) const
@ tecINSUFFICIENT_RESERVE
const SF_UINT32 sfNFTokenTaxon
const SF_ACCOUNT sfAccount
A type-safe wrap around standard integral types.
State information when preflighting a tx.
Taxon cipheredTaxon(std::uint32_t tokenSeq, Taxon taxon)
@ temBAD_NFTOKEN_TRANSFER_FEE
TER insertToken(ApplyView &view, AccountID owner, STObject &&nft)
Insert the token in the owner's token directory.
TERSubset< CanCvtToNotTEC > NotTEC
Number root(Number f, unsigned d)
constexpr const std::uint32_t tfNFTokenMintMask