Files
rippled/VaultWithdraw_8cpp_source.html
2026-01-28 10:13:01 -08:00

388 lines
76 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" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>rippled: VaultWithdraw.cpp 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 id="projectrow">
<td id="projectalign">
<div id="projectname">rippled
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @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:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
<!-- 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">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_a62226f9e3a6c7c5a3be455e2f87ae01.html">xrpld</a></li><li class="navelem"><a class="el" href="dir_c69db3203fa08a9ff994909ba6ee9783.html">app</a></li><li class="navelem"><a class="el" href="dir_4b2d6f306dc33741b6f38a59a670a446.html">tx</a></li><li class="navelem"><a class="el" href="dir_7b1ffcd2aae1e871efc2e94c72e78699.html">detail</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">VaultWithdraw.cpp</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#include &lt;xrpld/app/tx/detail/VaultWithdraw.h&gt;</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#include &lt;xrpl/ledger/CredentialHelpers.h&gt;</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="preprocessor">#include &lt;xrpl/ledger/View.h&gt;</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;xrpl/protocol/AccountID.h&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &lt;xrpl/protocol/Feature.h&gt;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &lt;xrpl/protocol/SField.h&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include &lt;xrpl/protocol/STNumber.h&gt;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;xrpl/protocol/STTakesAsset.h&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &lt;xrpl/protocol/TER.h&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &lt;xrpl/protocol/TxFlags.h&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacexrpl.html">xrpl</a> {</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><a class="code hl_typedef" href="namespacexrpl.html#aec5bc721e24f63bb2c1a542f6f456b33">NotTEC</a></div>
<div class="foldopen" id="foldopen00016" data-start="{" data-end="}">
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"><a class="line" href="classxrpl_1_1VaultWithdraw.html#adcafe6e22bc4620386997671c76f0950"> 16</a></span><a class="code hl_function" href="classxrpl_1_1VaultWithdraw.html#adcafe6e22bc4620386997671c76f0950">VaultWithdraw::preflight</a>(<a class="code hl_struct" href="structxrpl_1_1PreflightContext.html">PreflightContext</a> <span class="keyword">const</span>&amp; ctx)</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span>{</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keywordflow">if</span> (ctx.<a class="code hl_variable" href="structxrpl_1_1PreflightContext.html#ad1cfd2197bb28468799d62785e974952">tx</a>[sfVaultID] == beast::zero)</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> {</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> JLOG(ctx.<a class="code hl_variable" href="structxrpl_1_1PreflightContext.html#a770dfa68a3a044cb315aa48a21446eb0">j</a>.<a class="code hl_function" href="classbeast_1_1Journal.html#a556228cb60bcf405c225d3f64b7b01ae">debug</a>()) &lt;&lt; <span class="stringliteral">&quot;VaultWithdraw: zero/empty vault ID.&quot;</span>;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ac8c50610643a4f902b9bb9e42d0b00e6a6596ee0ec0bc3a3e73dfade1dca4fd5b">temMALFORMED</a>;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> }</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordflow">if</span> (ctx.<a class="code hl_variable" href="structxrpl_1_1PreflightContext.html#ad1cfd2197bb28468799d62785e974952">tx</a>[sfAmount] &lt;= beast::zero)</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ac8c50610643a4f902b9bb9e42d0b00e6aa9a4c76c9c7d2e1fc83581b9ce4d5152">temBAD_AMOUNT</a>;</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> <span class="keyword">const</span> destination = ctx.<a class="code hl_variable" href="structxrpl_1_1PreflightContext.html#ad1cfd2197bb28468799d62785e974952">tx</a>[~sfDestination])</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> {</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keywordflow">if</span> (*destination == beast::zero)</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> {</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ac8c50610643a4f902b9bb9e42d0b00e6a6596ee0ec0bc3a3e73dfade1dca4fd5b">temMALFORMED</a>;</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> }</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> }</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#af4adbbe94a1cecf1bd3ad2c76ff1ea3da157dace29a657c58cdeb4f7fa19be976">tesSUCCESS</a>;</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span>}</div>
</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><a class="code hl_class" href="classxrpl_1_1TERSubset.html">TER</a></div>
<div class="foldopen" id="foldopen00039" data-start="{" data-end="}">
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="classxrpl_1_1VaultWithdraw.html#acce285116bc49a3d3e9f3c55bfc13c47"> 39</a></span><a class="code hl_function" href="classxrpl_1_1VaultWithdraw.html#acce285116bc49a3d3e9f3c55bfc13c47">VaultWithdraw::preclaim</a>(<a class="code hl_struct" href="structxrpl_1_1PreclaimContext.html">PreclaimContext</a> <span class="keyword">const</span>&amp; ctx)</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span>{</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keyword">auto</span> <span class="keyword">const</span> vault = ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#a4beaff9e60360494328296c6e4367a1c">view</a>.<a class="code hl_function" href="classxrpl_1_1ReadView.html#ae7286da5df8ee36f950cc43fd3a46806">read</a>(<a class="code hl_function" href="namespacexrpl_1_1keylet.html#a9a7028770e8d9d38ca198d2096149766">keylet::vault</a>(ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#add7a860523e30f2b1caf7da6fa23ce39">tx</a>[sfVaultID]));</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keywordflow">if</span> (!vault)</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba348afbc4922cc9b29af76316d5d8a277">tecNO_ENTRY</a>;</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> </div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keyword">auto</span> <span class="keyword">const</span> assets = ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#add7a860523e30f2b1caf7da6fa23ce39">tx</a>[sfAmount];</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keyword">auto</span> <span class="keyword">const</span> vaultAsset = vault-&gt;at(sfAsset);</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keyword">auto</span> <span class="keyword">const</span> vaultShare = vault-&gt;at(sfShareMPTID);</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">if</span> (assets.asset() != vaultAsset &amp;&amp; assets.asset() != vaultShare)</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba1957d1d9fc2b8195c8717cd9b85ce5e3">tecWRONG_ASSET</a>;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> </div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keyword">auto</span> <span class="keyword">const</span>&amp; vaultAccount = vault-&gt;at(sfAccount);</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keyword">auto</span> <span class="keyword">const</span>&amp; account = ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#add7a860523e30f2b1caf7da6fa23ce39">tx</a>[sfAccount];</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keyword">auto</span> <span class="keyword">const</span>&amp; dstAcct = ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#add7a860523e30f2b1caf7da6fa23ce39">tx</a>[~sfDestination].value_or(account);</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> ter = <a class="code hl_function" href="namespacexrpl.html#aa96568644982f27b540798d8df8530e9">canTransfer</a>(ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#a4beaff9e60360494328296c6e4367a1c">view</a>, vaultAsset, vaultAccount, dstAcct); !<a class="code hl_function" href="namespacexrpl.html#aca6a81fa8cc774aae8a652406ea14c36">isTesSuccess</a>(ter))</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> {</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> JLOG(ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#ae01ea816e51566ca4c097b8e95a81070">j</a>.<a class="code hl_function" href="classbeast_1_1Journal.html#a556228cb60bcf405c225d3f64b7b01ae">debug</a>()) &lt;&lt; <span class="stringliteral">&quot;VaultWithdraw: vault assets are non-transferable.&quot;</span>;</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keywordflow">return</span> ter;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> }</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> </div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="comment">// Enforce valid withdrawal policy</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordflow">if</span> (vault-&gt;at(sfWithdrawalPolicy) != <a class="code hl_variable" href="namespacexrpl.html#a17f923de33abee7d3d3a9d3909cb2ccf">vaultStrategyFirstComeFirstServe</a>)</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> {</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="comment">// LCOV_EXCL_START</span></div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> JLOG(ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#ae01ea816e51566ca4c097b8e95a81070">j</a>.<a class="code hl_function" href="classbeast_1_1Journal.html#a49b0713e65bb8e2c51b76fbf16252afe">error</a>()) &lt;&lt; <span class="stringliteral">&quot;VaultWithdraw: invalid withdrawal policy.&quot;</span>;</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#a48cab8527194fbd1cfdacad90f977cf1ad82c16daf201b77d0d1b97acb35467da">tefINTERNAL</a>;</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="comment">// LCOV_EXCL_STOP</span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> }</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> </div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> <span class="keyword">const</span> ret = <a class="code hl_function" href="namespacexrpl.html#adc19f6ae62db94674b9461f536df4235">canWithdraw</a>(ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#a4beaff9e60360494328296c6e4367a1c">view</a>, ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#add7a860523e30f2b1caf7da6fa23ce39">tx</a>))</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordflow">return</span> ret;</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> </div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="comment">// If sending to Account (i.e. not a transfer), we will also create (only</span></div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="comment">// if authorized) a trust line or MPToken as needed, in doApply().</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="comment">// Destination MPToken or trust line must exist if _not_ sending to Account.</span></div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <a class="code hl_enumeration" href="namespacexrpl.html#a9fc0181844e951d8a012ead9fab7fbe9">AuthType</a> <span class="keyword">const</span> authType = account == dstAcct ? <a class="code hl_enumvalue" href="namespacexrpl.html#a9fc0181844e951d8a012ead9fab7fbe9a41aee20744fc47f976626aa2ade7adcb">AuthType::WeakAuth</a> : <a class="code hl_enumvalue" href="namespacexrpl.html#a9fc0181844e951d8a012ead9fab7fbe9a7559328fba92acce7308a39180e16441">AuthType::StrongAuth</a>;</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> <span class="keyword">const</span> ter = <a class="code hl_function" href="namespacexrpl.html#aa0fea82c3b688dc71571c78fe73d657a">requireAuth</a>(ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#a4beaff9e60360494328296c6e4367a1c">view</a>, vaultAsset, dstAcct, authType); !<a class="code hl_function" href="namespacexrpl.html#aca6a81fa8cc774aae8a652406ea14c36">isTesSuccess</a>(ter))</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keywordflow">return</span> ter;</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> </div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="comment">// Cannot withdraw from a Vault an Asset frozen for the destination account</span></div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> <span class="keyword">const</span> ret = <a class="code hl_function" href="namespacexrpl.html#a462cd9f4f249907986a609c11794b45f">checkFrozen</a>(ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#a4beaff9e60360494328296c6e4367a1c">view</a>, dstAcct, vaultAsset))</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keywordflow">return</span> ret;</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> </div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="comment">// Cannot return shares to the vault, if the underlying asset was frozen for</span></div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="comment">// the submitter</span></div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> <span class="keyword">const</span> ret = <a class="code hl_function" href="namespacexrpl.html#a462cd9f4f249907986a609c11794b45f">checkFrozen</a>(ctx.<a class="code hl_variable" href="structxrpl_1_1PreclaimContext.html#a4beaff9e60360494328296c6e4367a1c">view</a>, account, vaultShare))</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordflow">return</span> ret;</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> </div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#af4adbbe94a1cecf1bd3ad2c76ff1ea3da157dace29a657c58cdeb4f7fa19be976">tesSUCCESS</a>;</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span>}</div>
</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> </div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span><a class="code hl_class" href="classxrpl_1_1TERSubset.html">TER</a></div>
<div class="foldopen" id="foldopen00092" data-start="{" data-end="}">
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"><a class="line" href="classxrpl_1_1VaultWithdraw.html#aa78527bb0f9016908867e4982a2b20b8"> 92</a></span><a class="code hl_function" href="classxrpl_1_1VaultWithdraw.html#aa78527bb0f9016908867e4982a2b20b8">VaultWithdraw::doApply</a>()</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span>{</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keyword">auto</span> <span class="keyword">const</span> vault = <a class="code hl_function" href="classxrpl_1_1Transactor.html#a9d90f09b3f9c786a878f206bd10e2890">view</a>().<a class="code hl_function" href="classxrpl_1_1ApplyView.html#ae08e50d8506bc2beafd62ade8087285a">peek</a>(<a class="code hl_function" href="namespacexrpl_1_1keylet.html#a9a7028770e8d9d38ca198d2096149766">keylet::vault</a>(<a class="code hl_variable" href="classxrpl_1_1Transactor.html#ac8b61136d9ebc92db493cd79f0f0f0b5">ctx_</a>.<a class="code hl_variable" href="classxrpl_1_1ApplyContext.html#a12176434ecde09cea7688f6bdf95c17f">tx</a>[sfVaultID]));</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keywordflow">if</span> (!vault)</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#a48cab8527194fbd1cfdacad90f977cf1ad82c16daf201b77d0d1b97acb35467da">tefINTERNAL</a>; <span class="comment">// LCOV_EXCL_LINE</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> </div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="keyword">auto</span> <span class="keyword">const</span> mptIssuanceID = *((*vault)[sfShareMPTID]);</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="keyword">auto</span> <span class="keyword">const</span> sleIssuance = <a class="code hl_function" href="classxrpl_1_1Transactor.html#a9d90f09b3f9c786a878f206bd10e2890">view</a>().<a class="code hl_function" href="classxrpl_1_1ReadView.html#ae7286da5df8ee36f950cc43fd3a46806">read</a>(<a class="code hl_function" href="namespacexrpl_1_1keylet.html#a77d91a4fd20b17d44ccb32b4e9ae2d9b">keylet::mptIssuance</a>(mptIssuanceID));</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keywordflow">if</span> (!sleIssuance)</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> {</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="comment">// LCOV_EXCL_START</span></div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> JLOG(<a class="code hl_variable" href="classxrpl_1_1Transactor.html#a70d80b15016025468966dddb23ab0e8d">j_</a>.<a class="code hl_function" href="classbeast_1_1Journal.html#a49b0713e65bb8e2c51b76fbf16252afe">error</a>()) &lt;&lt; <span class="stringliteral">&quot;VaultWithdraw: missing issuance of vault shares.&quot;</span>;</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#a48cab8527194fbd1cfdacad90f977cf1ad82c16daf201b77d0d1b97acb35467da">tefINTERNAL</a>;</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="comment">// LCOV_EXCL_STOP</span></div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> }</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> </div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="comment">// Note, we intentionally do not check lsfVaultPrivate flag on the Vault. If</span></div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="comment">// you have a share in the vault, it means you were at some point authorized</span></div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="comment">// to deposit into it, and this means you are also indefinitely authorized</span></div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="comment">// to withdraw from it.</span></div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> </div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keyword">auto</span> <span class="keyword">const</span> amount = <a class="code hl_variable" href="classxrpl_1_1Transactor.html#ac8b61136d9ebc92db493cd79f0f0f0b5">ctx_</a>.<a class="code hl_variable" href="classxrpl_1_1ApplyContext.html#a12176434ecde09cea7688f6bdf95c17f">tx</a>[sfAmount];</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <a class="code hl_class" href="classxrpl_1_1Asset.html">Asset</a> <span class="keyword">const</span> vaultAsset = vault-&gt;at(sfAsset);</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> </div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <a class="code hl_class" href="classxrpl_1_1MPTIssue.html">MPTIssue</a> <span class="keyword">const</span> share{mptIssuanceID};</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <a class="code hl_class" href="classxrpl_1_1STAmount.html">STAmount</a> sharesRedeemed = {share};</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <a class="code hl_class" href="classxrpl_1_1STAmount.html">STAmount</a> assetsWithdrawn;</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordflow">try</span></div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> {</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keywordflow">if</span> (amount.asset() == vaultAsset)</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> {</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="comment">// Fixed assets, variable shares.</span></div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> {</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="keyword">auto</span> <span class="keyword">const</span> maybeShares = <a class="code hl_function" href="namespacexrpl.html#a82980e1dd14f1f8c3baee70aee59ed3a">assetsToSharesWithdraw</a>(vault, sleIssuance, amount);</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keywordflow">if</span> (!maybeShares)</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba6869daf531ae5878c65a5095f103ce62">tecINTERNAL</a>; <span class="comment">// LCOV_EXCL_LINE</span></div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> sharesRedeemed = *maybeShares;</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> }</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> </div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="keywordflow">if</span> (sharesRedeemed == beast::zero)</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556bac9a52c5d52a9c9501a3c8c37746fb509">tecPRECISION_LOSS</a>;</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <span class="keyword">auto</span> <span class="keyword">const</span> maybeAssets = <a class="code hl_function" href="namespacexrpl.html#acf72292f26f88792ef814506f7a1382c">sharesToAssetsWithdraw</a>(vault, sleIssuance, sharesRedeemed);</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keywordflow">if</span> (!maybeAssets)</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba6869daf531ae5878c65a5095f103ce62">tecINTERNAL</a>; <span class="comment">// LCOV_EXCL_LINE</span></div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> assetsWithdrawn = *maybeAssets;</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> }</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (amount.asset() == share)</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> {</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="comment">// Fixed shares, variable assets.</span></div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> sharesRedeemed = amount;</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="keyword">auto</span> <span class="keyword">const</span> maybeAssets = <a class="code hl_function" href="namespacexrpl.html#acf72292f26f88792ef814506f7a1382c">sharesToAssetsWithdraw</a>(vault, sleIssuance, sharesRedeemed);</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <span class="keywordflow">if</span> (!maybeAssets)</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba6869daf531ae5878c65a5095f103ce62">tecINTERNAL</a>; <span class="comment">// LCOV_EXCL_LINE</span></div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> assetsWithdrawn = *maybeAssets;</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> }</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keywordflow">else</span></div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#a48cab8527194fbd1cfdacad90f977cf1ad82c16daf201b77d0d1b97acb35467da">tefINTERNAL</a>; <span class="comment">// LCOV_EXCL_LINE</span></div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> }</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <span class="keywordflow">catch</span> (<a class="code hl_classRef" href="http://en.cppreference.com/w/cpp/error/overflow_error.html">std::overflow_error</a> <span class="keyword">const</span>&amp;)</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> {</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="comment">// It&#39;s easy to hit this exception from Number with large enough Scale</span></div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <span class="comment">// so we avoid spamming the log and only use debug here.</span></div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> JLOG(<a class="code hl_variable" href="classxrpl_1_1Transactor.html#a70d80b15016025468966dddb23ab0e8d">j_</a>.<a class="code hl_function" href="classbeast_1_1Journal.html#a556228cb60bcf405c225d3f64b7b01ae">debug</a>()) <span class="comment">//</span></div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> &lt;&lt; <span class="stringliteral">&quot;VaultWithdraw: overflow error with&quot;</span></div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> &lt;&lt; <span class="stringliteral">&quot; scale=&quot;</span> &lt;&lt; (int)vault-&gt;at(sfScale).value() <span class="comment">//</span></div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> &lt;&lt; <span class="stringliteral">&quot;, assetsTotal=&quot;</span> &lt;&lt; vault-&gt;at(sfAssetsTotal).value()</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> &lt;&lt; <span class="stringliteral">&quot;, sharesTotal=&quot;</span> &lt;&lt; sleIssuance-&gt;at(sfOutstandingAmount) &lt;&lt; <span class="stringliteral">&quot;, amount=&quot;</span> &lt;&lt; amount.value();</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba42408240f803abe8017433ecac4fe862">tecPATH_DRY</a>;</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> }</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> </div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="namespacexrpl.html#a4f5cf1d4503b195f0d8640b978e13edf">accountHolds</a>(<a class="code hl_function" href="classxrpl_1_1Transactor.html#a9d90f09b3f9c786a878f206bd10e2890">view</a>(), <a class="code hl_variable" href="classxrpl_1_1Transactor.html#a12241eb96da0753b499e30b3afc61774">account_</a>, share, <a class="code hl_enumvalue" href="namespacexrpl.html#a1751722455e1d7c781d2cc897403a534a3d81257538fc58ecd120b9641a1f8990">FreezeHandling::fhZERO_IF_FROZEN</a>, <a class="code hl_enumvalue" href="namespacexrpl.html#a97a9ff10fdce86ac84f6be6e23007dd4a859a6043078585553a3cf93854f29eaa">AuthHandling::ahIGNORE_AUTH</a>, <a class="code hl_variable" href="classxrpl_1_1Transactor.html#a70d80b15016025468966dddb23ab0e8d">j_</a>) &lt;</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> sharesRedeemed)</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> {</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> JLOG(<a class="code hl_variable" href="classxrpl_1_1Transactor.html#a70d80b15016025468966dddb23ab0e8d">j_</a>.<a class="code hl_function" href="classbeast_1_1Journal.html#a556228cb60bcf405c225d3f64b7b01ae">debug</a>()) &lt;&lt; <span class="stringliteral">&quot;VaultWithdraw: account doesn&#39;t hold enough shares&quot;</span>;</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba8479260fa4500bef887fa8e8c9f3c624">tecINSUFFICIENT_FUNDS</a>;</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> }</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> </div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> <span class="keyword">auto</span> assetsAvailable = vault-&gt;at(sfAssetsAvailable);</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> <span class="keyword">auto</span> assetsTotal = vault-&gt;at(sfAssetsTotal);</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> [[maybe_unused]] <span class="keyword">auto</span> <span class="keyword">const</span> lossUnrealized = vault-&gt;at(sfLossUnrealized);</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> XRPL_ASSERT(</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> lossUnrealized &lt;= (assetsTotal - assetsAvailable), <span class="stringliteral">&quot;xrpl::VaultWithdraw::doApply : loss and assets do balance&quot;</span>);</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> </div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> <span class="comment">// The vault must have enough assets on hand. The vault may hold assets</span></div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> <span class="comment">// that it has already pledged. That is why we look at AssetAvailable</span></div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <span class="comment">// instead of the pseudo-account balance.</span></div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> <span class="keywordflow">if</span> (*assetsAvailable &lt; assetsWithdrawn)</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> {</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> JLOG(<a class="code hl_variable" href="classxrpl_1_1Transactor.html#a70d80b15016025468966dddb23ab0e8d">j_</a>.<a class="code hl_function" href="classbeast_1_1Journal.html#a556228cb60bcf405c225d3f64b7b01ae">debug</a>()) &lt;&lt; <span class="stringliteral">&quot;VaultWithdraw: vault doesn&#39;t hold enough assets&quot;</span>;</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba8479260fa4500bef887fa8e8c9f3c624">tecINSUFFICIENT_FUNDS</a>;</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> }</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> </div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> assetsTotal -= assetsWithdrawn;</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> assetsAvailable -= assetsWithdrawn;</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> <a class="code hl_function" href="classxrpl_1_1Transactor.html#a9d90f09b3f9c786a878f206bd10e2890">view</a>().<a class="code hl_function" href="classxrpl_1_1ApplyView.html#a1c494e32b7dfe50416045d749ba4f560">update</a>(vault);</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> </div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> <span class="keyword">auto</span> <span class="keyword">const</span>&amp; vaultAccount = vault-&gt;at(sfAccount);</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> <span class="comment">// Transfer shares from depositor to vault.</span></div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> <span class="keyword">const</span> ter = <a class="code hl_function" href="namespacexrpl.html#a7d1fa732064ef22175aac4d8de440e6d">accountSend</a>(<a class="code hl_function" href="classxrpl_1_1Transactor.html#a9d90f09b3f9c786a878f206bd10e2890">view</a>(), <a class="code hl_variable" href="classxrpl_1_1Transactor.html#a12241eb96da0753b499e30b3afc61774">account_</a>, vaultAccount, sharesRedeemed, <a class="code hl_variable" href="classxrpl_1_1Transactor.html#a70d80b15016025468966dddb23ab0e8d">j_</a>, <a class="code hl_enumvalue" href="namespacexrpl.html#a53be00cb856ef39ec60e33cf9694b5eba93cba07454f06a4a960172bbd6e2a435">WaiveTransferFee::Yes</a>);</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> !<a class="code hl_function" href="namespacexrpl.html#aca6a81fa8cc774aae8a652406ea14c36">isTesSuccess</a>(ter))</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> <span class="keywordflow">return</span> ter;</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> </div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> <span class="comment">// Try to remove MPToken for shares, if the account balance is zero. Vault</span></div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> <span class="comment">// pseudo-account will never set lsfMPTAuthorized, so we ignore flags.</span></div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <span class="comment">// Keep MPToken if holder is the vault owner.</span></div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="classxrpl_1_1Transactor.html#a12241eb96da0753b499e30b3afc61774">account_</a> != vault-&gt;at(sfOwner))</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> {</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> <span class="keyword">const</span> ter = <a class="code hl_function" href="namespacexrpl.html#a32571d41333e8425dbd96ea54574abdc">removeEmptyHolding</a>(<a class="code hl_function" href="classxrpl_1_1Transactor.html#a9d90f09b3f9c786a878f206bd10e2890">view</a>(), <a class="code hl_variable" href="classxrpl_1_1Transactor.html#a12241eb96da0753b499e30b3afc61774">account_</a>, sharesRedeemed.<a class="code hl_function" href="classxrpl_1_1STAmount.html#abbc5a024839981076ce9c16fa19d3657">asset</a>(), <a class="code hl_variable" href="classxrpl_1_1Transactor.html#a70d80b15016025468966dddb23ab0e8d">j_</a>); <a class="code hl_function" href="namespacexrpl.html#aca6a81fa8cc774aae8a652406ea14c36">isTesSuccess</a>(ter))</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> {</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> JLOG(<a class="code hl_variable" href="classxrpl_1_1Transactor.html#a70d80b15016025468966dddb23ab0e8d">j_</a>.<a class="code hl_function" href="classbeast_1_1Journal.html#a556228cb60bcf405c225d3f64b7b01ae">debug</a>()) <span class="comment">//</span></div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> &lt;&lt; <span class="stringliteral">&quot;VaultWithdraw: removed empty MPToken for vault shares&quot;</span></div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> &lt;&lt; <span class="stringliteral">&quot; MPTID=&quot;</span> &lt;&lt; <a class="code hl_function" href="namespacexrpl.html#a35ce7572092b98720a52fa343c6f2fa9">to_string</a>(mptIssuanceID) <span class="comment">//</span></div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> &lt;&lt; <span class="stringliteral">&quot; account=&quot;</span> &lt;&lt; <a class="code hl_function" href="namespacexrpl.html#a4e17e8237bc800415c303501c667baeb">toBase58</a>(<a class="code hl_variable" href="classxrpl_1_1Transactor.html#a12241eb96da0753b499e30b3afc61774">account_</a>);</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> }</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ter != <a class="code hl_enumvalue" href="namespacexrpl.html#ad78c115958eec639754bf9227f58556baf9893323708f9529dce3dd46682f8336">tecHAS_OBLIGATIONS</a>)</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> {</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> <span class="comment">// LCOV_EXCL_START</span></div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> JLOG(<a class="code hl_variable" href="classxrpl_1_1Transactor.html#a70d80b15016025468966dddb23ab0e8d">j_</a>.<a class="code hl_function" href="classbeast_1_1Journal.html#a49b0713e65bb8e2c51b76fbf16252afe">error</a>()) <span class="comment">//</span></div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> &lt;&lt; <span class="stringliteral">&quot;VaultWithdraw: failed to remove MPToken for vault shares&quot;</span></div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> &lt;&lt; <span class="stringliteral">&quot; MPTID=&quot;</span> &lt;&lt; <a class="code hl_function" href="namespacexrpl.html#a35ce7572092b98720a52fa343c6f2fa9">to_string</a>(mptIssuanceID) <span class="comment">//</span></div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> &lt;&lt; <span class="stringliteral">&quot; account=&quot;</span> &lt;&lt; <a class="code hl_function" href="namespacexrpl.html#a4e17e8237bc800415c303501c667baeb">toBase58</a>(<a class="code hl_variable" href="classxrpl_1_1Transactor.html#a12241eb96da0753b499e30b3afc61774">account_</a>) <span class="comment">//</span></div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> &lt;&lt; <span class="stringliteral">&quot; with result: &quot;</span> &lt;&lt; <a class="code hl_function" href="namespacexrpl.html#a6b1bb3f84d51f67cf0b25e04cfda4434">transToken</a>(ter);</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> <span class="keywordflow">return</span> ter;</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> <span class="comment">// LCOV_EXCL_STOP</span></div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> }</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> <span class="comment">// else quietly ignore, account balance is not zero</span></div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> }</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> </div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> <span class="keyword">auto</span> <span class="keyword">const</span> dstAcct = <a class="code hl_variable" href="classxrpl_1_1Transactor.html#ac8b61136d9ebc92db493cd79f0f0f0b5">ctx_</a>.<a class="code hl_variable" href="classxrpl_1_1ApplyContext.html#a12176434ecde09cea7688f6bdf95c17f">tx</a>[~sfDestination].value_or(<a class="code hl_variable" href="classxrpl_1_1Transactor.html#a12241eb96da0753b499e30b3afc61774">account_</a>);</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> </div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> <a class="code hl_function" href="namespacexrpl.html#adf6a712b96f28b3109e43464dc2e22d7">associateAsset</a>(*vault, vaultAsset);</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> </div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> <span class="keywordflow">return</span> <a class="code hl_function" href="namespacexrpl.html#a3f074cfc386b5a1a52f0369c06728848">doWithdraw</a>(<a class="code hl_function" href="classxrpl_1_1Transactor.html#a9d90f09b3f9c786a878f206bd10e2890">view</a>(), <a class="code hl_variable" href="classxrpl_1_1Transactor.html#ac8b61136d9ebc92db493cd79f0f0f0b5">ctx_</a>.<a class="code hl_variable" href="classxrpl_1_1ApplyContext.html#a12176434ecde09cea7688f6bdf95c17f">tx</a>, <a class="code hl_variable" href="classxrpl_1_1Transactor.html#a12241eb96da0753b499e30b3afc61774">account_</a>, dstAcct, vaultAccount, <a class="code hl_variable" href="classxrpl_1_1Transactor.html#ab16ddaafd08019e0dbe690e6c5203572">mPriorBalance</a>, assetsWithdrawn, <a class="code hl_variable" href="classxrpl_1_1Transactor.html#a70d80b15016025468966dddb23ab0e8d">j_</a>);</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span>}</div>
</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> </div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span>} <span class="comment">// namespace xrpl</span></div>
<div class="ttc" id="aclassbeast_1_1Journal_html_a49b0713e65bb8e2c51b76fbf16252afe"><div class="ttname"><a href="classbeast_1_1Journal.html#a49b0713e65bb8e2c51b76fbf16252afe">beast::Journal::error</a></div><div class="ttdeci">Stream error() const</div><div class="ttdef"><b>Definition</b> <a href="Journal_8h_source.html#l00319">Journal.h:319</a></div></div>
<div class="ttc" id="aclassbeast_1_1Journal_html_a556228cb60bcf405c225d3f64b7b01ae"><div class="ttname"><a href="classbeast_1_1Journal.html#a556228cb60bcf405c225d3f64b7b01ae">beast::Journal::debug</a></div><div class="ttdeci">Stream debug() const</div><div class="ttdef"><b>Definition</b> <a href="Journal_8h_source.html#l00301">Journal.h:301</a></div></div>
<div class="ttc" id="aclassxrpl_1_1ApplyContext_html_a12176434ecde09cea7688f6bdf95c17f"><div class="ttname"><a href="classxrpl_1_1ApplyContext.html#a12176434ecde09cea7688f6bdf95c17f">xrpl::ApplyContext::tx</a></div><div class="ttdeci">STTx const &amp; tx</div><div class="ttdef"><b>Definition</b> <a href="ApplyContext_8h_source.html#l00044">ApplyContext.h:44</a></div></div>
<div class="ttc" id="aclassxrpl_1_1ApplyView_html_a1c494e32b7dfe50416045d749ba4f560"><div class="ttname"><a href="classxrpl_1_1ApplyView.html#a1c494e32b7dfe50416045d749ba4f560">xrpl::ApplyView::update</a></div><div class="ttdeci">virtual void update(std::shared_ptr&lt; SLE &gt; const &amp;sle)=0</div><div class="ttdoc">Indicate changes to a peeked SLE.</div></div>
<div class="ttc" id="aclassxrpl_1_1ApplyView_html_ae08e50d8506bc2beafd62ade8087285a"><div class="ttname"><a href="classxrpl_1_1ApplyView.html#ae08e50d8506bc2beafd62ade8087285a">xrpl::ApplyView::peek</a></div><div class="ttdeci">virtual std::shared_ptr&lt; SLE &gt; peek(Keylet const &amp;k)=0</div><div class="ttdoc">Prepare to modify the SLE associated with key.</div></div>
<div class="ttc" id="aclassxrpl_1_1Asset_html"><div class="ttname"><a href="classxrpl_1_1Asset.html">xrpl::Asset</a></div><div class="ttdef"><b>Definition</b> <a href="Asset_8h_source.html#l00026">Asset.h:27</a></div></div>
<div class="ttc" id="aclassxrpl_1_1MPTIssue_html"><div class="ttname"><a href="classxrpl_1_1MPTIssue.html">xrpl::MPTIssue</a></div><div class="ttdef"><b>Definition</b> <a href="MPTIssue_8h_source.html#l00013">MPTIssue.h:14</a></div></div>
<div class="ttc" id="aclassxrpl_1_1ReadView_html_ae7286da5df8ee36f950cc43fd3a46806"><div class="ttname"><a href="classxrpl_1_1ReadView.html#ae7286da5df8ee36f950cc43fd3a46806">xrpl::ReadView::read</a></div><div class="ttdeci">virtual std::shared_ptr&lt; SLE const &gt; read(Keylet const &amp;k) const =0</div><div class="ttdoc">Return the state item associated with a key.</div></div>
<div class="ttc" id="aclassxrpl_1_1STAmount_html"><div class="ttname"><a href="classxrpl_1_1STAmount.html">xrpl::STAmount</a></div><div class="ttdef"><b>Definition</b> <a href="STAmount_8h_source.html#l00030">STAmount.h:31</a></div></div>
<div class="ttc" id="aclassxrpl_1_1STAmount_html_abbc5a024839981076ce9c16fa19d3657"><div class="ttname"><a href="classxrpl_1_1STAmount.html#abbc5a024839981076ce9c16fa19d3657">xrpl::STAmount::asset</a></div><div class="ttdeci">Asset const &amp; asset() const</div><div class="ttdef"><b>Definition</b> <a href="STAmount_8h_source.html#l00442">STAmount.h:442</a></div></div>
<div class="ttc" id="aclassxrpl_1_1TERSubset_html"><div class="ttname"><a href="classxrpl_1_1TERSubset.html">xrpl::TERSubset&lt; CanCvtToTER &gt;</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Transactor_html_a12241eb96da0753b499e30b3afc61774"><div class="ttname"><a href="classxrpl_1_1Transactor.html#a12241eb96da0753b499e30b3afc61774">xrpl::Transactor::account_</a></div><div class="ttdeci">AccountID const account_</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00113">Transactor.h:113</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Transactor_html_a70d80b15016025468966dddb23ab0e8d"><div class="ttname"><a href="classxrpl_1_1Transactor.html#a70d80b15016025468966dddb23ab0e8d">xrpl::Transactor::j_</a></div><div class="ttdeci">beast::Journal const j_</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00111">Transactor.h:111</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Transactor_html_a9d90f09b3f9c786a878f206bd10e2890"><div class="ttname"><a href="classxrpl_1_1Transactor.html#a9d90f09b3f9c786a878f206bd10e2890">xrpl::Transactor::view</a></div><div class="ttdeci">ApplyView &amp; view()</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00129">Transactor.h:129</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Transactor_html_ab16ddaafd08019e0dbe690e6c5203572"><div class="ttname"><a href="classxrpl_1_1Transactor.html#ab16ddaafd08019e0dbe690e6c5203572">xrpl::Transactor::mPriorBalance</a></div><div class="ttdeci">XRPAmount mPriorBalance</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00114">Transactor.h:114</a></div></div>
<div class="ttc" id="aclassxrpl_1_1Transactor_html_ac8b61136d9ebc92db493cd79f0f0f0b5"><div class="ttname"><a href="classxrpl_1_1Transactor.html#ac8b61136d9ebc92db493cd79f0f0f0b5">xrpl::Transactor::ctx_</a></div><div class="ttdeci">ApplyContext &amp; ctx_</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00109">Transactor.h:109</a></div></div>
<div class="ttc" id="aclassxrpl_1_1VaultWithdraw_html_aa78527bb0f9016908867e4982a2b20b8"><div class="ttname"><a href="classxrpl_1_1VaultWithdraw.html#aa78527bb0f9016908867e4982a2b20b8">xrpl::VaultWithdraw::doApply</a></div><div class="ttdeci">TER doApply() override</div><div class="ttdef"><b>Definition</b> <a href="VaultWithdraw_8cpp_source.html#l00092">VaultWithdraw.cpp:92</a></div></div>
<div class="ttc" id="aclassxrpl_1_1VaultWithdraw_html_acce285116bc49a3d3e9f3c55bfc13c47"><div class="ttname"><a href="classxrpl_1_1VaultWithdraw.html#acce285116bc49a3d3e9f3c55bfc13c47">xrpl::VaultWithdraw::preclaim</a></div><div class="ttdeci">static TER preclaim(PreclaimContext const &amp;ctx)</div><div class="ttdef"><b>Definition</b> <a href="VaultWithdraw_8cpp_source.html#l00039">VaultWithdraw.cpp:39</a></div></div>
<div class="ttc" id="aclassxrpl_1_1VaultWithdraw_html_adcafe6e22bc4620386997671c76f0950"><div class="ttname"><a href="classxrpl_1_1VaultWithdraw.html#adcafe6e22bc4620386997671c76f0950">xrpl::VaultWithdraw::preflight</a></div><div class="ttdeci">static NotTEC preflight(PreflightContext const &amp;ctx)</div><div class="ttdef"><b>Definition</b> <a href="VaultWithdraw_8cpp_source.html#l00016">VaultWithdraw.cpp:16</a></div></div>
<div class="ttc" id="anamespacexrpl_1_1keylet_html_a77d91a4fd20b17d44ccb32b4e9ae2d9b"><div class="ttname"><a href="namespacexrpl_1_1keylet.html#a77d91a4fd20b17d44ccb32b4e9ae2d9b">xrpl::keylet::mptIssuance</a></div><div class="ttdeci">Keylet mptIssuance(std::uint32_t seq, AccountID const &amp;issuer) noexcept</div><div class="ttdef"><b>Definition</b> <a href="Indexes_8cpp_source.html#l00462">Indexes.cpp:462</a></div></div>
<div class="ttc" id="anamespacexrpl_1_1keylet_html_a9a7028770e8d9d38ca198d2096149766"><div class="ttname"><a href="namespacexrpl_1_1keylet.html#a9a7028770e8d9d38ca198d2096149766">xrpl::keylet::vault</a></div><div class="ttdeci">Keylet vault(AccountID const &amp;owner, std::uint32_t seq) noexcept</div><div class="ttdef"><b>Definition</b> <a href="Indexes_8cpp_source.html#l00492">Indexes.cpp:492</a></div></div>
<div class="ttc" id="anamespacexrpl_html"><div class="ttname"><a href="namespacexrpl.html">xrpl</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="algorithm_8h_source.html#l00006">algorithm.h:6</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a1751722455e1d7c781d2cc897403a534a3d81257538fc58ecd120b9641a1f8990"><div class="ttname"><a href="namespacexrpl.html#a1751722455e1d7c781d2cc897403a534a3d81257538fc58ecd120b9641a1f8990">xrpl::fhZERO_IF_FROZEN</a></div><div class="ttdeci">@ fhZERO_IF_FROZEN</div><div class="ttdef"><b>Definition</b> <a href="View_8h_source.html#l00059">View.h:59</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a17f923de33abee7d3d3a9d3909cb2ccf"><div class="ttname"><a href="namespacexrpl.html#a17f923de33abee7d3d3a9d3909cb2ccf">xrpl::vaultStrategyFirstComeFirstServe</a></div><div class="ttdeci">std::uint8_t constexpr vaultStrategyFirstComeFirstServe</div><div class="ttdoc">Vault withdrawal policies.</div><div class="ttdef"><b>Definition</b> <a href="Protocol_8h_source.html#l00241">Protocol.h:241</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a32571d41333e8425dbd96ea54574abdc"><div class="ttname"><a href="namespacexrpl.html#a32571d41333e8425dbd96ea54574abdc">xrpl::removeEmptyHolding</a></div><div class="ttdeci">TER removeEmptyHolding(ApplyView &amp;view, AccountID const &amp;accountID, Issue const &amp;issue, beast::Journal journal)</div><div class="ttdef"><b>Definition</b> <a href="View_8cpp_source.html#l01554">View.cpp:1554</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a35ce7572092b98720a52fa343c6f2fa9"><div class="ttname"><a href="namespacexrpl.html#a35ce7572092b98720a52fa343c6f2fa9">xrpl::to_string</a></div><div class="ttdeci">std::string to_string(base_uint&lt; Bits, Tag &gt; const &amp;a)</div><div class="ttdef"><b>Definition</b> <a href="base__uint_8h_source.html#l00598">base_uint.h:598</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a3f074cfc386b5a1a52f0369c06728848"><div class="ttname"><a href="namespacexrpl.html#a3f074cfc386b5a1a52f0369c06728848">xrpl::doWithdraw</a></div><div class="ttdeci">TER doWithdraw(ApplyView &amp;view, STTx const &amp;tx, AccountID const &amp;senderAcct, AccountID const &amp;dstAcct, AccountID const &amp;sourceAcct, XRPAmount priorBalance, STAmount const &amp;amount, beast::Journal j)</div><div class="ttdef"><b>Definition</b> <a href="View_8cpp_source.html#l01209">View.cpp:1209</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a462cd9f4f249907986a609c11794b45f"><div class="ttname"><a href="namespacexrpl.html#a462cd9f4f249907986a609c11794b45f">xrpl::checkFrozen</a></div><div class="ttdeci">TER checkFrozen(ReadView const &amp;view, AccountID const &amp;account, Issue const &amp;issue)</div><div class="ttdef"><b>Definition</b> <a href="View_8h_source.html#l00122">View.h:122</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a48cab8527194fbd1cfdacad90f977cf1ad82c16daf201b77d0d1b97acb35467da"><div class="ttname"><a href="namespacexrpl.html#a48cab8527194fbd1cfdacad90f977cf1ad82c16daf201b77d0d1b97acb35467da">xrpl::tefINTERNAL</a></div><div class="ttdeci">@ tefINTERNAL</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00154">TER.h:154</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a4e17e8237bc800415c303501c667baeb"><div class="ttname"><a href="namespacexrpl.html#a4e17e8237bc800415c303501c667baeb">xrpl::toBase58</a></div><div class="ttdeci">std::string toBase58(AccountID const &amp;v)</div><div class="ttdoc">Convert AccountID to base58 checked string.</div><div class="ttdef"><b>Definition</b> <a href="AccountID_8cpp_source.html#l00092">AccountID.cpp:92</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a4f5cf1d4503b195f0d8640b978e13edf"><div class="ttname"><a href="namespacexrpl.html#a4f5cf1d4503b195f0d8640b978e13edf">xrpl::accountHolds</a></div><div class="ttdeci">STAmount accountHolds(ReadView const &amp;view, AccountID const &amp;account, Currency const &amp;currency, AccountID const &amp;issuer, FreezeHandling zeroIfFrozen, beast::Journal j, SpendableHandling includeFullBalance=shSIMPLE_BALANCE)</div><div class="ttdef"><b>Definition</b> <a href="View_8cpp_source.html#l00392">View.cpp:392</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a53be00cb856ef39ec60e33cf9694b5eba93cba07454f06a4a960172bbd6e2a435"><div class="ttname"><a href="namespacexrpl.html#a53be00cb856ef39ec60e33cf9694b5eba93cba07454f06a4a960172bbd6e2a435">xrpl::WaiveTransferFee::Yes</a></div><div class="ttdeci">@ Yes</div></div>
<div class="ttc" id="anamespacexrpl_html_a6b1bb3f84d51f67cf0b25e04cfda4434"><div class="ttname"><a href="namespacexrpl.html#a6b1bb3f84d51f67cf0b25e04cfda4434">xrpl::transToken</a></div><div class="ttdeci">std::string transToken(TER code)</div><div class="ttdef"><b>Definition</b> <a href="TER_8cpp_source.html#l00243">TER.cpp:243</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a7d1fa732064ef22175aac4d8de440e6d"><div class="ttname"><a href="namespacexrpl.html#a7d1fa732064ef22175aac4d8de440e6d">xrpl::accountSend</a></div><div class="ttdeci">TER accountSend(ApplyView &amp;view, AccountID const &amp;from, AccountID const &amp;to, STAmount const &amp;saAmount, beast::Journal j, WaiveTransferFee waiveFee=WaiveTransferFee::No)</div><div class="ttdoc">Calls static accountSendIOU if saAmount represents Issue.</div><div class="ttdef"><b>Definition</b> <a href="View_8cpp_source.html#l02446">View.cpp:2446</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a82980e1dd14f1f8c3baee70aee59ed3a"><div class="ttname"><a href="namespacexrpl.html#a82980e1dd14f1f8c3baee70aee59ed3a">xrpl::assetsToSharesWithdraw</a></div><div class="ttdeci">std::optional&lt; STAmount &gt; assetsToSharesWithdraw(std::shared_ptr&lt; SLE const &gt; const &amp;vault, std::shared_ptr&lt; SLE const &gt; const &amp;issuance, STAmount const &amp;assets, TruncateShares truncate=TruncateShares::no)</div><div class="ttdef"><b>Definition</b> <a href="View_8cpp_source.html#l03149">View.cpp:3149</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a97a9ff10fdce86ac84f6be6e23007dd4a859a6043078585553a3cf93854f29eaa"><div class="ttname"><a href="namespacexrpl.html#a97a9ff10fdce86ac84f6be6e23007dd4a859a6043078585553a3cf93854f29eaa">xrpl::ahIGNORE_AUTH</a></div><div class="ttdeci">@ ahIGNORE_AUTH</div><div class="ttdef"><b>Definition</b> <a href="View_8h_source.html#l00062">View.h:62</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a9fc0181844e951d8a012ead9fab7fbe9"><div class="ttname"><a href="namespacexrpl.html#a9fc0181844e951d8a012ead9fab7fbe9">xrpl::AuthType</a></div><div class="ttdeci">AuthType</div><div class="ttdef"><b>Definition</b> <a href="View_8h_source.html#l00802">View.h:802</a></div></div>
<div class="ttc" id="anamespacexrpl_html_a9fc0181844e951d8a012ead9fab7fbe9a41aee20744fc47f976626aa2ade7adcb"><div class="ttname"><a href="namespacexrpl.html#a9fc0181844e951d8a012ead9fab7fbe9a41aee20744fc47f976626aa2ade7adcb">xrpl::AuthType::WeakAuth</a></div><div class="ttdeci">@ WeakAuth</div></div>
<div class="ttc" id="anamespacexrpl_html_a9fc0181844e951d8a012ead9fab7fbe9a7559328fba92acce7308a39180e16441"><div class="ttname"><a href="namespacexrpl.html#a9fc0181844e951d8a012ead9fab7fbe9a7559328fba92acce7308a39180e16441">xrpl::AuthType::StrongAuth</a></div><div class="ttdeci">@ StrongAuth</div></div>
<div class="ttc" id="anamespacexrpl_html_aa0fea82c3b688dc71571c78fe73d657a"><div class="ttname"><a href="namespacexrpl.html#aa0fea82c3b688dc71571c78fe73d657a">xrpl::requireAuth</a></div><div class="ttdeci">TER requireAuth(ReadView const &amp;view, Issue const &amp;issue, AccountID const &amp;account, AuthType authType=AuthType::Legacy)</div><div class="ttdoc">Check if the account lacks required authorization.</div><div class="ttdef"><b>Definition</b> <a href="View_8cpp_source.html#l02710">View.cpp:2710</a></div></div>
<div class="ttc" id="anamespacexrpl_html_aa96568644982f27b540798d8df8530e9"><div class="ttname"><a href="namespacexrpl.html#aa96568644982f27b540798d8df8530e9">xrpl::canTransfer</a></div><div class="ttdeci">TER canTransfer(ReadView const &amp;view, MPTIssue const &amp;mptIssue, AccountID const &amp;from, AccountID const &amp;to)</div><div class="ttdoc">Check if the destination account is allowed to receive MPT.</div><div class="ttdef"><b>Definition</b> <a href="View_8cpp_source.html#l02914">View.cpp:2914</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ac8c50610643a4f902b9bb9e42d0b00e6a6596ee0ec0bc3a3e73dfade1dca4fd5b"><div class="ttname"><a href="namespacexrpl.html#ac8c50610643a4f902b9bb9e42d0b00e6a6596ee0ec0bc3a3e73dfade1dca4fd5b">xrpl::temMALFORMED</a></div><div class="ttdeci">@ temMALFORMED</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00068">TER.h:68</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ac8c50610643a4f902b9bb9e42d0b00e6aa9a4c76c9c7d2e1fc83581b9ce4d5152"><div class="ttname"><a href="namespacexrpl.html#ac8c50610643a4f902b9bb9e42d0b00e6aa9a4c76c9c7d2e1fc83581b9ce4d5152">xrpl::temBAD_AMOUNT</a></div><div class="ttdeci">@ temBAD_AMOUNT</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00070">TER.h:70</a></div></div>
<div class="ttc" id="anamespacexrpl_html_aca6a81fa8cc774aae8a652406ea14c36"><div class="ttname"><a href="namespacexrpl.html#aca6a81fa8cc774aae8a652406ea14c36">xrpl::isTesSuccess</a></div><div class="ttdeci">bool isTesSuccess(TER x) noexcept</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00650">TER.h:650</a></div></div>
<div class="ttc" id="anamespacexrpl_html_acf72292f26f88792ef814506f7a1382c"><div class="ttname"><a href="namespacexrpl.html#acf72292f26f88792ef814506f7a1382c">xrpl::sharesToAssetsWithdraw</a></div><div class="ttdeci">std::optional&lt; STAmount &gt; sharesToAssetsWithdraw(std::shared_ptr&lt; SLE const &gt; const &amp;vault, std::shared_ptr&lt; SLE const &gt; const &amp;issuance, STAmount const &amp;shares)</div><div class="ttdef"><b>Definition</b> <a href="View_8cpp_source.html#l03174">View.cpp:3174</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ad78c115958eec639754bf9227f58556ba1957d1d9fc2b8195c8717cd9b85ce5e3"><div class="ttname"><a href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba1957d1d9fc2b8195c8717cd9b85ce5e3">xrpl::tecWRONG_ASSET</a></div><div class="ttdeci">@ tecWRONG_ASSET</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00342">TER.h:342</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ad78c115958eec639754bf9227f58556ba348afbc4922cc9b29af76316d5d8a277"><div class="ttname"><a href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba348afbc4922cc9b29af76316d5d8a277">xrpl::tecNO_ENTRY</a></div><div class="ttdeci">@ tecNO_ENTRY</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00288">TER.h:288</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ad78c115958eec639754bf9227f58556ba42408240f803abe8017433ecac4fe862"><div class="ttname"><a href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba42408240f803abe8017433ecac4fe862">xrpl::tecPATH_DRY</a></div><div class="ttdeci">@ tecPATH_DRY</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00276">TER.h:276</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ad78c115958eec639754bf9227f58556ba6869daf531ae5878c65a5095f103ce62"><div class="ttname"><a href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba6869daf531ae5878c65a5095f103ce62">xrpl::tecINTERNAL</a></div><div class="ttdeci">@ tecINTERNAL</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00292">TER.h:292</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ad78c115958eec639754bf9227f58556ba8479260fa4500bef887fa8e8c9f3c624"><div class="ttname"><a href="namespacexrpl.html#ad78c115958eec639754bf9227f58556ba8479260fa4500bef887fa8e8c9f3c624">xrpl::tecINSUFFICIENT_FUNDS</a></div><div class="ttdeci">@ tecINSUFFICIENT_FUNDS</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00307">TER.h:307</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ad78c115958eec639754bf9227f58556bac9a52c5d52a9c9501a3c8c37746fb509"><div class="ttname"><a href="namespacexrpl.html#ad78c115958eec639754bf9227f58556bac9a52c5d52a9c9501a3c8c37746fb509">xrpl::tecPRECISION_LOSS</a></div><div class="ttdeci">@ tecPRECISION_LOSS</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00345">TER.h:345</a></div></div>
<div class="ttc" id="anamespacexrpl_html_ad78c115958eec639754bf9227f58556baf9893323708f9529dce3dd46682f8336"><div class="ttname"><a href="namespacexrpl.html#ad78c115958eec639754bf9227f58556baf9893323708f9529dce3dd46682f8336">xrpl::tecHAS_OBLIGATIONS</a></div><div class="ttdeci">@ tecHAS_OBLIGATIONS</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00299">TER.h:299</a></div></div>
<div class="ttc" id="anamespacexrpl_html_adc19f6ae62db94674b9461f536df4235"><div class="ttname"><a href="namespacexrpl.html#adc19f6ae62db94674b9461f536df4235">xrpl::canWithdraw</a></div><div class="ttdeci">TER canWithdraw(ReadView const &amp;view, AccountID const &amp;from, AccountID const &amp;to, SLE::const_ref toSle, STAmount const &amp;amount, bool hasDestinationTag)</div><div class="ttdoc">Checks that can withdraw funds from an object to itself or a destination.</div><div class="ttdef"><b>Definition</b> <a href="View_8cpp_source.html#l01163">View.cpp:1163</a></div></div>
<div class="ttc" id="anamespacexrpl_html_adf6a712b96f28b3109e43464dc2e22d7"><div class="ttname"><a href="namespacexrpl.html#adf6a712b96f28b3109e43464dc2e22d7">xrpl::associateAsset</a></div><div class="ttdeci">void associateAsset(STLedgerEntry &amp;sle, Asset const &amp;asset)</div><div class="ttdoc">Associate an Asset with all sMD_NeedsAsset fields in a ledger entry.</div></div>
<div class="ttc" id="anamespacexrpl_html_aec5bc721e24f63bb2c1a542f6f456b33"><div class="ttname"><a href="namespacexrpl.html#aec5bc721e24f63bb2c1a542f6f456b33">xrpl::NotTEC</a></div><div class="ttdeci">TERSubset&lt; CanCvtToNotTEC &gt; NotTEC</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00581">TER.h:581</a></div></div>
<div class="ttc" id="anamespacexrpl_html_af4adbbe94a1cecf1bd3ad2c76ff1ea3da157dace29a657c58cdeb4f7fa19be976"><div class="ttname"><a href="namespacexrpl.html#af4adbbe94a1cecf1bd3ad2c76ff1ea3da157dace29a657c58cdeb4f7fa19be976">xrpl::tesSUCCESS</a></div><div class="ttdeci">@ tesSUCCESS</div><div class="ttdef"><b>Definition</b> <a href="TER_8h_source.html#l00227">TER.h:226</a></div></div>
<div class="ttc" id="aoverflow_error_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/error/overflow_error.html">std::overflow_error</a></div></div>
<div class="ttc" id="astructxrpl_1_1PreclaimContext_html"><div class="ttname"><a href="structxrpl_1_1PreclaimContext.html">xrpl::PreclaimContext</a></div><div class="ttdoc">State information when determining if a tx is likely to claim a fee.</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00053">Transactor.h:54</a></div></div>
<div class="ttc" id="astructxrpl_1_1PreclaimContext_html_a4beaff9e60360494328296c6e4367a1c"><div class="ttname"><a href="structxrpl_1_1PreclaimContext.html#a4beaff9e60360494328296c6e4367a1c">xrpl::PreclaimContext::view</a></div><div class="ttdeci">ReadView const &amp; view</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00057">Transactor.h:57</a></div></div>
<div class="ttc" id="astructxrpl_1_1PreclaimContext_html_add7a860523e30f2b1caf7da6fa23ce39"><div class="ttname"><a href="structxrpl_1_1PreclaimContext.html#add7a860523e30f2b1caf7da6fa23ce39">xrpl::PreclaimContext::tx</a></div><div class="ttdeci">STTx const &amp; tx</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00060">Transactor.h:60</a></div></div>
<div class="ttc" id="astructxrpl_1_1PreclaimContext_html_ae01ea816e51566ca4c097b8e95a81070"><div class="ttname"><a href="structxrpl_1_1PreclaimContext.html#ae01ea816e51566ca4c097b8e95a81070">xrpl::PreclaimContext::j</a></div><div class="ttdeci">beast::Journal const j</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00062">Transactor.h:62</a></div></div>
<div class="ttc" id="astructxrpl_1_1PreflightContext_html"><div class="ttname"><a href="structxrpl_1_1PreflightContext.html">xrpl::PreflightContext</a></div><div class="ttdoc">State information when preflighting a tx.</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00015">Transactor.h:16</a></div></div>
<div class="ttc" id="astructxrpl_1_1PreflightContext_html_a770dfa68a3a044cb315aa48a21446eb0"><div class="ttname"><a href="structxrpl_1_1PreflightContext.html#a770dfa68a3a044cb315aa48a21446eb0">xrpl::PreflightContext::j</a></div><div class="ttdeci">beast::Journal const j</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00023">Transactor.h:23</a></div></div>
<div class="ttc" id="astructxrpl_1_1PreflightContext_html_ad1cfd2197bb28468799d62785e974952"><div class="ttname"><a href="structxrpl_1_1PreflightContext.html#ad1cfd2197bb28468799d62785e974952">xrpl::PreflightContext::tx</a></div><div class="ttdeci">STTx const &amp; tx</div><div class="ttdef"><b>Definition</b> <a href="Transactor_8h_source.html#l00019">Transactor.h:19</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>