mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-23 04:25:51 +00:00
229 lines
32 KiB
HTML
229 lines
32 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.17"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>rippled: nft.h Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">rippled
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.17 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */</script>
|
|
<div id="main-nav"></div>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_df9c78dcf3f59a33b12284f95992a64b.html">ripple</a></li><li class="navelem"><a class="el" href="dir_1e765e6a8d5970800a535eb2615ec474.html">protocol</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">nft.h</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">//------------------------------------------------------------------------------</span></div>
|
|
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">/*</span></div>
|
|
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> This file is part of rippled: https://github.com/ripple/rippled</span></div>
|
|
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> Copyright (c) 2023 Ripple Labs Inc.</span></div>
|
|
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"></span> </div>
|
|
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> Permission to use, copy, modify, and/or distribute this software for any</span></div>
|
|
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> purpose with or without fee is hereby granted, provided that the above</span></div>
|
|
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> copyright notice and this permission notice appear in all copies.</span></div>
|
|
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span> </div>
|
|
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES</span></div>
|
|
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF</span></div>
|
|
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR</span></div>
|
|
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES</span></div>
|
|
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN</span></div>
|
|
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF</span></div>
|
|
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</span></div>
|
|
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment">*/</span></div>
|
|
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment">//==============================================================================</span></div>
|
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  </div>
|
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#ifndef RIPPLE_PROTOCOL_NFT_H_INCLUDED</span></div>
|
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#define RIPPLE_PROTOCOL_NFT_H_INCLUDED</span></div>
|
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>  </div>
|
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#include <ripple/basics/base_uint.h></span></div>
|
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include <ripple/basics/tagged_integer.h></span></div>
|
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include <ripple/protocol/AccountID.h></span></div>
|
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  </div>
|
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include <boost/endian/conversion.hpp></span></div>
|
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  </div>
|
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include <<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/cstdint.html">cstdint</a>></span></div>
|
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include <<a class="codeRef" href="http://en.cppreference.com/w/cpp/header/cstring.html">cstring</a>></span></div>
|
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  </div>
|
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="keyword">namespace </span><a class="code" href="namespaceripple.html">ripple</a> {</div>
|
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="keyword">namespace </span>nft {</div>
|
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  </div>
|
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="comment">// Separate taxons from regular integers.</span></div>
|
|
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="structripple_1_1nft_1_1TaxonTag.html"> 36</a></span> <span class="keyword">struct </span><a class="code" href="structripple_1_1nft_1_1TaxonTag.html">TaxonTag</a></div>
|
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> {</div>
|
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> };</div>
|
|
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="namespaceripple_1_1nft.html#a969cfd39753b9660728a29bd15b3df45"> 39</a></span> <span class="keyword">using</span> <a class="code" href="classripple_1_1tagged__integer.html">Taxon</a> = <a class="code" href="classripple_1_1tagged__integer.html">tagged_integer<std::uint32_t, TaxonTag></a>;</div>
|
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  </div>
|
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="keyword">inline</span> <a class="code" href="classripple_1_1tagged__integer.html">Taxon</a></div>
|
|
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="namespaceripple_1_1nft.html#a8878ae3c753ff4fe6bb04e5c516ccea5"> 42</a></span> <a class="code" href="namespaceripple_1_1nft.html#a8878ae3c753ff4fe6bb04e5c516ccea5">toTaxon</a>(<a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> i)</div>
|
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> {</div>
|
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><a class="code" href="classripple_1_1tagged__integer.html">Taxon</a><span class="keyword">></span>(i);</div>
|
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> }</div>
|
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  </div>
|
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="keyword">inline</span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a></div>
|
|
<div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="namespaceripple_1_1nft.html#a208916396e6cd7c0940640fabfa7e199"> 48</a></span> <a class="code" href="namespaceripple_1_1nft.html#a208916396e6cd7c0940640fabfa7e199">toUInt32</a>(<a class="code" href="classripple_1_1tagged__integer.html">Taxon</a> t)</div>
|
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> {</div>
|
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a><span class="keyword">></span>(t);</div>
|
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> }</div>
|
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  </div>
|
|
<div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="namespaceripple_1_1nft.html#a0b631c3a663602539191da9ca75c9ac5"> 53</a></span> constexpr <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a> <span class="keyword">const</span> <a class="code" href="namespaceripple_1_1nft.html#a0b631c3a663602539191da9ca75c9ac5">flagBurnable</a> = 0x0001;</div>
|
|
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="namespaceripple_1_1nft.html#abf5771bfc2c9f62196dfe02b087b7b7c"> 54</a></span> constexpr <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a> <span class="keyword">const</span> <a class="code" href="namespaceripple_1_1nft.html#abf5771bfc2c9f62196dfe02b087b7b7c">flagOnlyXRP</a> = 0x0002;</div>
|
|
<div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="namespaceripple_1_1nft.html#afc8993c59f0cb0b829043738f91887a0"> 55</a></span> constexpr <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a> <span class="keyword">const</span> <a class="code" href="namespaceripple_1_1nft.html#afc8993c59f0cb0b829043738f91887a0">flagCreateTrustLines</a> = 0x0004;</div>
|
|
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="namespaceripple_1_1nft.html#a85206f984cd8f8255ff7e4f35a13d90e"> 56</a></span> constexpr <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a> <span class="keyword">const</span> <a class="code" href="namespaceripple_1_1nft.html#a85206f984cd8f8255ff7e4f35a13d90e">flagTransferable</a> = 0x0008;</div>
|
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  </div>
|
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="keyword">inline</span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a></div>
|
|
<div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="namespaceripple_1_1nft.html#a1a5f9170a15fd6861ab81b1d021410cc"> 59</a></span> <a class="code" href="namespaceripple_1_1nft.html#a1a5f9170a15fd6861ab81b1d021410cc">getFlags</a>(<a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>& <span class="keywordtype">id</span>)</div>
|
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> {</div>
|
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a> flags;</div>
|
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  memcpy(&flags, <span class="keywordtype">id</span>.begin(), 2);</div>
|
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="keywordflow">return</span> boost::endian::big_to_native(flags);</div>
|
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> }</div>
|
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  </div>
|
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="keyword">inline</span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a></div>
|
|
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="namespaceripple_1_1nft.html#a19ab99ac39a753e73810e317d9253f83"> 67</a></span> <a class="code" href="namespaceripple_1_1nft.html#a19ab99ac39a753e73810e317d9253f83">getTransferFee</a>(<a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>& <span class="keywordtype">id</span>)</div>
|
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> {</div>
|
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint16_t</a> fee;</div>
|
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  memcpy(&fee, <span class="keywordtype">id</span>.begin() + 2, 2);</div>
|
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <span class="keywordflow">return</span> boost::endian::big_to_native(fee);</div>
|
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> }</div>
|
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  </div>
|
|
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="keyword">inline</span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a></div>
|
|
<div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="namespaceripple_1_1nft.html#abcaadc221a478f164919335a9ebea93d"> 75</a></span> <a class="code" href="namespaceripple_1_1nft.html#abcaadc221a478f164919335a9ebea93d">getSerial</a>(<a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>& <span class="keywordtype">id</span>)</div>
|
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span> {</div>
|
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> seq;</div>
|
|
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  memcpy(&seq, <span class="keywordtype">id</span>.begin() + 28, 4);</div>
|
|
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="keywordflow">return</span> boost::endian::big_to_native(seq);</div>
|
|
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> }</div>
|
|
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  </div>
|
|
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="keyword">inline</span> <a class="code" href="namespaceripple_1_1nft.html#a969cfd39753b9660728a29bd15b3df45">Taxon</a></div>
|
|
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="namespaceripple_1_1nft.html#a6ff9377be53296a54dd73bff1a4ae934"> 83</a></span> <a class="code" href="namespaceripple_1_1nft.html#a6ff9377be53296a54dd73bff1a4ae934">cipheredTaxon</a>(<a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> tokenSeq, <a class="code" href="classripple_1_1tagged__integer.html">Taxon</a> taxon)</div>
|
|
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span> {</div>
|
|
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="comment">// An issuer may issue several NFTs with the same taxon; to ensure that NFTs</span></div>
|
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <span class="comment">// are spread across multiple pages we lightly mix the taxon up by using the</span></div>
|
|
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="comment">// sequence (which is not under the issuer's direct control) as the seed for</span></div>
|
|
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="comment">// a simple linear congruential generator.</span></div>
|
|
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="comment">// From the Hull-Dobell theorem we know that f(x)=(m*x+c) mod n will yield a</span></div>
|
|
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="comment">// permutation of [0, n) when n is a power of 2 if m is congruent to 1 mod 4</span></div>
|
|
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="comment">// and c is odd.</span></div>
|
|
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <span class="comment">// Here we use m = 384160001 and c = 2459. The modulo is implicit because we</span></div>
|
|
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  <span class="comment">// use 2^32 for n and the arithmetic gives it to us for "free".</span></div>
|
|
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="comment">// Note that the scramble value we calculate is not cryptographically secure</span></div>
|
|
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="comment">// but that's fine since all we're looking for is some dispersion.</span></div>
|
|
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="comment">// **IMPORTANT** Changing these numbers would be a breaking change requiring</span></div>
|
|
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="comment">// an amendment along with a way to distinguish token IDs that</span></div>
|
|
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="comment">// were generated with the old code.</span></div>
|
|
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="keywordflow">return</span> taxon ^ <a class="code" href="namespaceripple_1_1nft.html#a8878ae3c753ff4fe6bb04e5c516ccea5">toTaxon</a>(((384160001 * tokenSeq) + 2459));</div>
|
|
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span> }</div>
|
|
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  </div>
|
|
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span> <span class="keyword">inline</span> <a class="code" href="namespaceripple_1_1nft.html#a969cfd39753b9660728a29bd15b3df45">Taxon</a></div>
|
|
<div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="namespaceripple_1_1nft.html#a4a67928a93e3e71d20b3b47f1d1660d2"> 107</a></span> <a class="code" href="namespaceripple_1_1nft.html#a4a67928a93e3e71d20b3b47f1d1660d2">getTaxon</a>(<a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>& <span class="keywordtype">id</span>)</div>
|
|
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span> {</div>
|
|
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> taxon;</div>
|
|
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  memcpy(&taxon, <span class="keywordtype">id</span>.begin() + 24, 4);</div>
|
|
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  taxon = boost::endian::big_to_native(taxon);</div>
|
|
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  </div>
|
|
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="comment">// The taxon cipher is just an XOR, so it is reversible by applying the</span></div>
|
|
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <span class="comment">// XOR a second time.</span></div>
|
|
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="keywordflow">return</span> <a class="code" href="namespaceripple_1_1nft.html#a6ff9377be53296a54dd73bff1a4ae934">cipheredTaxon</a>(<a class="code" href="namespaceripple_1_1nft.html#abcaadc221a478f164919335a9ebea93d">getSerial</a>(<span class="keywordtype">id</span>), <a class="code" href="namespaceripple_1_1nft.html#a8878ae3c753ff4fe6bb04e5c516ccea5">toTaxon</a>(taxon));</div>
|
|
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span> }</div>
|
|
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  </div>
|
|
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <span class="keyword">inline</span> <a class="code" href="classripple_1_1base__uint.html">AccountID</a></div>
|
|
<div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="namespaceripple_1_1nft.html#a5a717e41d61c4e7c1b2636ca6c8f7c6e"> 119</a></span> <a class="code" href="namespaceripple_1_1nft.html#a5a717e41d61c4e7c1b2636ca6c8f7c6e">getIssuer</a>(<a class="code" href="classripple_1_1base__uint.html">uint256</a> <span class="keyword">const</span>& <span class="keywordtype">id</span>)</div>
|
|
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span> {</div>
|
|
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="keywordflow">return</span> <a class="code" href="classripple_1_1base__uint.html#a4e9de7a706374a3d016b89c9ecb4f80d">AccountID::fromVoid</a>(<span class="keywordtype">id</span>.data() + 4);</div>
|
|
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span> }</div>
|
|
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  </div>
|
|
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span> } <span class="comment">// namespace nft</span></div>
|
|
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> } <span class="comment">// namespace ripple</span></div>
|
|
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  </div>
|
|
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span> <span class="preprocessor">#endif</span></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
<div class="ttc" id="anamespaceripple_1_1nft_html_a1a5f9170a15fd6861ab81b1d021410cc"><div class="ttname"><a href="namespaceripple_1_1nft.html#a1a5f9170a15fd6861ab81b1d021410cc">ripple::nft::getFlags</a></div><div class="ttdeci">std::uint16_t getFlags(uint256 const &id)</div><div class="ttdef"><b>Definition:</b> <a href="nft_8h_source.html#l00059">nft.h:59</a></div></div>
|
|
<div class="ttc" id="acstring_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/header/cstring.html">cstring</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1nft_html_a85206f984cd8f8255ff7e4f35a13d90e"><div class="ttname"><a href="namespaceripple_1_1nft.html#a85206f984cd8f8255ff7e4f35a13d90e">ripple::nft::flagTransferable</a></div><div class="ttdeci">constexpr const std::uint16_t flagTransferable</div><div class="ttdef"><b>Definition:</b> <a href="nft_8h_source.html#l00056">nft.h:56</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1nft_html_abf5771bfc2c9f62196dfe02b087b7b7c"><div class="ttname"><a href="namespaceripple_1_1nft.html#abf5771bfc2c9f62196dfe02b087b7b7c">ripple::nft::flagOnlyXRP</a></div><div class="ttdeci">constexpr const std::uint16_t flagOnlyXRP</div><div class="ttdef"><b>Definition:</b> <a href="nft_8h_source.html#l00054">nft.h:54</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1nft_html_a8878ae3c753ff4fe6bb04e5c516ccea5"><div class="ttname"><a href="namespaceripple_1_1nft.html#a8878ae3c753ff4fe6bb04e5c516ccea5">ripple::nft::toTaxon</a></div><div class="ttdeci">Taxon toTaxon(std::uint32_t i)</div><div class="ttdef"><b>Definition:</b> <a href="nft_8h_source.html#l00042">nft.h:42</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1nft_html_a5a717e41d61c4e7c1b2636ca6c8f7c6e"><div class="ttname"><a href="namespaceripple_1_1nft.html#a5a717e41d61c4e7c1b2636ca6c8f7c6e">ripple::nft::getIssuer</a></div><div class="ttdeci">AccountID getIssuer(uint256 const &id)</div><div class="ttdef"><b>Definition:</b> <a href="nft_8h_source.html#l00119">nft.h:119</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1base__uint_html"><div class="ttname"><a href="classripple_1_1base__uint.html">ripple::base_uint< 256 ></a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1nft_html_a208916396e6cd7c0940640fabfa7e199"><div class="ttname"><a href="namespaceripple_1_1nft.html#a208916396e6cd7c0940640fabfa7e199">ripple::nft::toUInt32</a></div><div class="ttdeci">std::uint32_t toUInt32(Taxon t)</div><div class="ttdef"><b>Definition:</b> <a href="nft_8h_source.html#l00048">nft.h:48</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1nft_html_abcaadc221a478f164919335a9ebea93d"><div class="ttname"><a href="namespaceripple_1_1nft.html#abcaadc221a478f164919335a9ebea93d">ripple::nft::getSerial</a></div><div class="ttdeci">std::uint32_t getSerial(uint256 const &id)</div><div class="ttdef"><b>Definition:</b> <a href="nft_8h_source.html#l00075">nft.h:75</a></div></div>
|
|
<div class="ttc" id="acstdint_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/header/cstdint.html">cstdint</a></div></div>
|
|
<div class="ttc" id="ainteger_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1nft_html_a0b631c3a663602539191da9ca75c9ac5"><div class="ttname"><a href="namespaceripple_1_1nft.html#a0b631c3a663602539191da9ca75c9ac5">ripple::nft::flagBurnable</a></div><div class="ttdeci">constexpr const std::uint16_t flagBurnable</div><div class="ttdef"><b>Definition:</b> <a href="nft_8h_source.html#l00053">nft.h:53</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_html"><div class="ttname"><a href="namespaceripple.html">ripple</a></div><div class="ttdoc">Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.</div><div class="ttdef"><b>Definition:</b> <a href="RCLCensorshipDetector_8h_source.html#l00029">RCLCensorshipDetector.h:29</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1nft_html_a969cfd39753b9660728a29bd15b3df45"><div class="ttname"><a href="namespaceripple_1_1nft.html#a969cfd39753b9660728a29bd15b3df45">ripple::nft::Taxon</a></div><div class="ttdeci">tagged_integer< std::uint32_t, TaxonTag > Taxon</div><div class="ttdef"><b>Definition:</b> <a href="nft_8h_source.html#l00039">nft.h:39</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1base__uint_html_a4e9de7a706374a3d016b89c9ecb4f80d"><div class="ttname"><a href="classripple_1_1base__uint.html#a4e9de7a706374a3d016b89c9ecb4f80d">ripple::base_uint< 160, detail::AccountIDTag >::fromVoid</a></div><div class="ttdeci">static base_uint fromVoid(void const *data)</div><div class="ttdef"><b>Definition:</b> <a href="base__uint_8h_source.html#l00312">base_uint.h:312</a></div></div>
|
|
<div class="ttc" id="astructripple_1_1nft_1_1TaxonTag_html"><div class="ttname"><a href="structripple_1_1nft_1_1TaxonTag.html">ripple::nft::TaxonTag</a></div><div class="ttdef"><b>Definition:</b> <a href="nft_8h_source.html#l00036">nft.h:36</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1nft_html_afc8993c59f0cb0b829043738f91887a0"><div class="ttname"><a href="namespaceripple_1_1nft.html#afc8993c59f0cb0b829043738f91887a0">ripple::nft::flagCreateTrustLines</a></div><div class="ttdeci">constexpr const std::uint16_t flagCreateTrustLines</div><div class="ttdef"><b>Definition:</b> <a href="nft_8h_source.html#l00055">nft.h:55</a></div></div>
|
|
<div class="ttc" id="aclassripple_1_1tagged__integer_html"><div class="ttname"><a href="classripple_1_1tagged__integer.html">ripple::tagged_integer</a></div><div class="ttdoc">A type-safe wrap around standard integral types.</div><div class="ttdef"><b>Definition:</b> <a href="tagged__integer_8h_source.html#l00044">tagged_integer.h:44</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1nft_html_a19ab99ac39a753e73810e317d9253f83"><div class="ttname"><a href="namespaceripple_1_1nft.html#a19ab99ac39a753e73810e317d9253f83">ripple::nft::getTransferFee</a></div><div class="ttdeci">std::uint16_t getTransferFee(uint256 const &id)</div><div class="ttdef"><b>Definition:</b> <a href="nft_8h_source.html#l00067">nft.h:67</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1nft_html_a6ff9377be53296a54dd73bff1a4ae934"><div class="ttname"><a href="namespaceripple_1_1nft.html#a6ff9377be53296a54dd73bff1a4ae934">ripple::nft::cipheredTaxon</a></div><div class="ttdeci">Taxon cipheredTaxon(std::uint32_t tokenSeq, Taxon taxon)</div><div class="ttdef"><b>Definition:</b> <a href="nft_8h_source.html#l00083">nft.h:83</a></div></div>
|
|
<div class="ttc" id="anamespaceripple_1_1nft_html_a4a67928a93e3e71d20b3b47f1d1660d2"><div class="ttname"><a href="namespaceripple_1_1nft.html#a4a67928a93e3e71d20b3b47f1d1660d2">ripple::nft::getTaxon</a></div><div class="ttdeci">Taxon getTaxon(uint256 const &id)</div><div class="ttdef"><b>Definition:</b> <a href="nft_8h_source.html#l00107">nft.h:107</a></div></div>
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.17
|
|
</small></address>
|
|
</body>
|
|
</html>
|