rework URIToken amendment to use 5 different explicit transactors rather than inferred operations

This commit is contained in:
Richard Holland
2023-02-09 10:17:31 +00:00
parent 2916b7e692
commit 69327445e9
10 changed files with 370 additions and 289 deletions

View File

@@ -129,9 +129,6 @@ constexpr std::uint32_t const tfStrongTSH = 0x00008000;
constexpr std::uint32_t const tfNFTokenMintOldMask =
~(tfUniversal | tfBurnable | tfOnlyXRP | tfTrustLine | tfTransferable | tfStrongTSH);
// URIToken flags:
constexpr std::uint32_t const tfBurn = 0x00000002;
// Prior to fixRemoveNFTokenAutoTrustLine, transfer of an NFToken between
// accounts allowed a TrustLine to be added to the issuer of that token
// without explicit permission from that issuer. This was enabled by
@@ -160,6 +157,10 @@ constexpr std::uint32_t const tfNFTokenCancelOfferMask = ~(tfUniversal);
// NFTokenAcceptOffer flags:
constexpr std::uint32_t const tfNFTokenAcceptOfferMask = ~tfUniversal;
// URIToken mask
constexpr std::uint32_t const tfURITokenMintMask = ~(tfUniversal | tfBurnable);
constexpr std::uint32_t const tfURITokenNonMintMask = ~tfUniversal;
// clang-format on
} // namespace ripple

View File

@@ -140,7 +140,11 @@ enum TxType : std::uint16_t
ttNFTOKEN_ACCEPT_OFFER = 29,
/** This transaction mints/burns/buys/sells a URI TOKEN */
ttURI_TOKEN = 45,
ttURITOKEN_MINT = 45,
ttURITOKEN_BURN = 46,
ttURITOKEN_BUY = 47,
ttURITOKEN_CREATE_SELL_OFFER = 48,
ttURITOKEN_CANCEL_SELL_OFFER = 49,
/** This transaction resets accumulator/counters and claims a reward for holding an average balance
* from a specified hook */

View File

@@ -361,14 +361,44 @@ TxFormats::TxFormats()
{sfInvoiceID, soeOPTIONAL},
},
commonFields);
add(jss::URITokenMint,
ttURITOKEN_MINT,
{
{sfURI, soeREQUIRED},
{sfDigest, soeOPTIONAL},
},
commonFields);
add(jss::URIToken,
ttURI_TOKEN,
{{sfURI, soeOPTIONAL},
{sfURITokenID, soeOPTIONAL},
{sfAmount, soeOPTIONAL},
{sfDigest, soeOPTIONAL},
{sfDestination, soeOPTIONAL}},
add(jss::URITokenBurn,
ttURITOKEN_BURN,
{
{sfURITokenID, soeREQUIRED},
},
commonFields);
add(jss::URITokenBuy,
ttURITOKEN_BUY,
{
{sfURITokenID, soeREQUIRED},
{sfAmount, soeREQUIRED},
},
commonFields);
add(jss::URITokenCreateSellOffer,
ttURITOKEN_CREATE_SELL_OFFER,
{
{sfURITokenID, soeREQUIRED},
{sfAmount, soeREQUIRED},
{sfDestination, soeOPTIONAL},
},
commonFields);
add(jss::URITokenCancelSellOffer,
ttURITOKEN_CANCEL_SELL_OFFER,
{
{sfURITokenID, soeREQUIRED},
},
commonFields);
}

View File

@@ -665,6 +665,11 @@ JSS(unlimited); // out: Connection.h
JSS(uptime); // out: GetCounts
JSS(uri); // out: ValidatorSites
JSS(URIToken); // LedgerEntry
JSS(URITokenMint); // tx type
JSS(URITokenBurn); // tx type
JSS(URITokenBuy); // tx type
JSS(URITokenCreateSellOffer); // tx type
JSS(URITokenCancelSellOffer); // tx type
JSS(url); // in/out: Subscribe, Unsubscribe
JSS(url_password); // in: Subscribe
JSS(url_username); // in: Subscribe