also set content hash during the proposal

Signed-off-by: AlienTornadosaurusHex <>
This commit is contained in:
AlienTornadosaurusHex 2023-06-27 22:37:30 +00:00
parent b58796d892
commit c54067a13d
20 changed files with 1456 additions and 1333 deletions

@ -32,8 +32,8 @@
<td></td> <td></td>
<td class="headerItem">Lines:</td> <td class="headerItem">Lines:</td>
<td class="headerCovTableEntryLo">48.9&nbsp;%</td> <td class="headerCovTableEntryLo">48.9&nbsp;%</td>
<td class="headerCovTableEntry">843</td> <td class="headerCovTableEntry">844</td>
<td class="headerCovTableEntry">412</td> <td class="headerCovTableEntry">413</td>
</tr> </tr>
<tr> <tr>
<td class="headerItem">Test Date:</td> <td class="headerItem">Test Date:</td>
@ -238,8 +238,8 @@
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="emerald.png" width=100 height=10 alt="100.0%"></td></tr></table> <table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="emerald.png" width=100 height=10 alt="100.0%"></td></tr></table>
</td> </td>
<td class="coverPerHi">100.0&nbsp;%</td> <td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumDflt">125</td> <td class="coverNumDflt">126</td>
<td class="coverNumDflt">125</td> <td class="coverNumDflt">126</td>
<td class="coverPerHi">100.0&nbsp;%</td> <td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumDflt">6</td> <td class="coverNumDflt">6</td>
<td class="coverNumDflt">6</td> <td class="coverNumDflt">6</td>

@ -32,8 +32,8 @@
<td></td> <td></td>
<td class="headerItem">Lines:</td> <td class="headerItem">Lines:</td>
<td class="headerCovTableEntryLo">48.9&nbsp;%</td> <td class="headerCovTableEntryLo">48.9&nbsp;%</td>
<td class="headerCovTableEntry">843</td> <td class="headerCovTableEntry">844</td>
<td class="headerCovTableEntry">412</td> <td class="headerCovTableEntry">413</td>
</tr> </tr>
<tr> <tr>
<td class="headerItem">Test Date:</td> <td class="headerItem">Test Date:</td>
@ -238,8 +238,8 @@
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="emerald.png" width=100 height=10 alt="100.0%"></td></tr></table> <table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="emerald.png" width=100 height=10 alt="100.0%"></td></tr></table>
</td> </td>
<td class="coverPerHi">100.0&nbsp;%</td> <td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumDflt">125</td> <td class="coverNumDflt">126</td>
<td class="coverNumDflt">125</td> <td class="coverNumDflt">126</td>
<td class="coverPerHi">100.0&nbsp;%</td> <td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumDflt">6</td> <td class="coverNumDflt">6</td>
<td class="coverNumDflt">6</td> <td class="coverNumDflt">6</td>

@ -32,8 +32,8 @@
<td></td> <td></td>
<td class="headerItem">Lines:</td> <td class="headerItem">Lines:</td>
<td class="headerCovTableEntryLo">48.9&nbsp;%</td> <td class="headerCovTableEntryLo">48.9&nbsp;%</td>
<td class="headerCovTableEntry">843</td> <td class="headerCovTableEntry">844</td>
<td class="headerCovTableEntry">412</td> <td class="headerCovTableEntry">413</td>
</tr> </tr>
<tr> <tr>
<td class="headerItem">Test Date:</td> <td class="headerItem">Test Date:</td>
@ -130,8 +130,8 @@
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="emerald.png" width=100 height=10 alt="100.0%"></td></tr></table> <table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="emerald.png" width=100 height=10 alt="100.0%"></td></tr></table>
</td> </td>
<td class="coverPerHi">100.0&nbsp;%</td> <td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumDflt">125</td> <td class="coverNumDflt">126</td>
<td class="coverNumDflt">125</td> <td class="coverNumDflt">126</td>
<td class="coverPerHi">100.0&nbsp;%</td> <td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumDflt">6</td> <td class="coverNumDflt">6</td>
<td class="coverNumDflt">6</td> <td class="coverNumDflt">6</td>

@ -32,8 +32,8 @@
<td></td> <td></td>
<td class="headerItem">Lines:</td> <td class="headerItem">Lines:</td>
<td class="headerCovTableEntryHi">100.0&nbsp;%</td> <td class="headerCovTableEntryHi">100.0&nbsp;%</td>
<td class="headerCovTableEntry">74</td> <td class="headerCovTableEntry">75</td>
<td class="headerCovTableEntry">74</td> <td class="headerCovTableEntry">75</td>
</tr> </tr>
<tr> <tr>
<td class="headerItem">Test Date:</td> <td class="headerItem">Test Date:</td>
@ -71,28 +71,28 @@
</tr> </tr>
<tr> <tr>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#L294">InfrastructureUpgradeProposal._getAllInstanceFeePercents</a></td> <td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#L324">InfrastructureUpgradeProposal._getAllInstanceFeePercents</a></td>
<td class="coverFnHi">4</td> <td class="coverFnHi">4</td>
</tr> </tr>
<tr> <tr>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#L224">InfrastructureUpgradeProposal._setAllInstancePoolFeesInOracle</a></td> <td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#L254">InfrastructureUpgradeProposal._setAllInstancePoolFeesInOracle</a></td>
<td class="coverFnHi">4</td> <td class="coverFnHi">4</td>
</tr> </tr>
<tr> <tr>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#L106">InfrastructureUpgradeProposal.executeProposal</a></td> <td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#L129">InfrastructureUpgradeProposal.executeProposal</a></td>
<td class="coverFnHi">4</td> <td class="coverFnHi">4</td>
</tr> </tr>
<tr> <tr>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#L263">InfrastructureUpgradeProposal._getAllInstances</a></td> <td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#L293">InfrastructureUpgradeProposal._getAllInstances</a></td>
<td class="coverFnHi">12</td> <td class="coverFnHi">12</td>

@ -32,8 +32,8 @@
<td></td> <td></td>
<td class="headerItem">Lines:</td> <td class="headerItem">Lines:</td>
<td class="headerCovTableEntryHi">100.0&nbsp;%</td> <td class="headerCovTableEntryHi">100.0&nbsp;%</td>
<td class="headerCovTableEntry">74</td> <td class="headerCovTableEntry">75</td>
<td class="headerCovTableEntry">74</td> <td class="headerCovTableEntry">75</td>
</tr> </tr>
<tr> <tr>
<td class="headerItem">Test Date:</td> <td class="headerItem">Test Date:</td>
@ -71,28 +71,28 @@
</tr> </tr>
<tr> <tr>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#L294">InfrastructureUpgradeProposal._getAllInstanceFeePercents</a></td> <td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#L324">InfrastructureUpgradeProposal._getAllInstanceFeePercents</a></td>
<td class="coverFnHi">4</td> <td class="coverFnHi">4</td>
</tr> </tr>
<tr> <tr>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#L263">InfrastructureUpgradeProposal._getAllInstances</a></td> <td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#L293">InfrastructureUpgradeProposal._getAllInstances</a></td>
<td class="coverFnHi">12</td> <td class="coverFnHi">12</td>
</tr> </tr>
<tr> <tr>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#L224">InfrastructureUpgradeProposal._setAllInstancePoolFeesInOracle</a></td> <td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#L254">InfrastructureUpgradeProposal._setAllInstancePoolFeesInOracle</a></td>
<td class="coverFnHi">4</td> <td class="coverFnHi">4</td>
</tr> </tr>
<tr> <tr>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#L106">InfrastructureUpgradeProposal.executeProposal</a></td> <td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#L129">InfrastructureUpgradeProposal.executeProposal</a></td>
<td class="coverFnHi">4</td> <td class="coverFnHi">4</td>

@ -32,8 +32,8 @@
<td></td> <td></td>
<td class="headerItem">Lines:</td> <td class="headerItem">Lines:</td>
<td class="headerCovTableEntryHi">100.0&nbsp;%</td> <td class="headerCovTableEntryHi">100.0&nbsp;%</td>
<td class="headerCovTableEntry">74</td> <td class="headerCovTableEntry">75</td>
<td class="headerCovTableEntry">74</td> <td class="headerCovTableEntry">75</td>
</tr> </tr>
<tr> <tr>
<td class="headerItem">Test Date:</td> <td class="headerItem">Test Date:</td>
@ -84,316 +84,346 @@
<span id="L14"><span class="lineNum"> 14</span> : </span> <span id="L14"><span class="lineNum"> 14</span> : </span>
<span id="L15"><span class="lineNum"> 15</span> : // Local imports</span> <span id="L15"><span class="lineNum"> 15</span> : // Local imports</span>
<span id="L16"><span class="lineNum"> 16</span> : </span> <span id="L16"><span class="lineNum"> 16</span> : </span>
<span id="L17"><span class="lineNum"> 17</span> : import { RelayerRegistry } from &quot;../v2/RelayerRegistry.sol&quot;;</span> <span id="L17"><span class="lineNum"> 17</span> : import { IENS } from &quot;../v2/interfaces/IENS.sol&quot;;</span>
<span id="L18"><span class="lineNum"> 18</span> : </span> <span id="L18"><span class="lineNum"> 18</span> : </span>
<span id="L19"><span class="lineNum"> 19</span> : import { FeeOracleManager } from &quot;../v2/FeeOracleManager.sol&quot;;</span> <span id="L19"><span class="lineNum"> 19</span> : import { RelayerRegistry } from &quot;../v2/RelayerRegistry.sol&quot;;</span>
<span id="L20"><span class="lineNum"> 20</span> : </span> <span id="L20"><span class="lineNum"> 20</span> : </span>
<span id="L21"><span class="lineNum"> 21</span> : import { InstanceRegistry } from &quot;../v2/InstanceRegistry.sol&quot;;</span> <span id="L21"><span class="lineNum"> 21</span> : import { FeeOracleManager } from &quot;../v2/FeeOracleManager.sol&quot;;</span>
<span id="L22"><span class="lineNum"> 22</span> : </span> <span id="L22"><span class="lineNum"> 22</span> : </span>
<span id="L23"><span class="lineNum"> 23</span> : import { UniswapFeeOracle, UniswapV3OracleHelper } from &quot;../v2/UniswapFeeOracle.sol&quot;;</span> <span id="L23"><span class="lineNum"> 23</span> : import { InstanceRegistry } from &quot;../v2/InstanceRegistry.sol&quot;;</span>
<span id="L24"><span class="lineNum"> 24</span> : </span> <span id="L24"><span class="lineNum"> 24</span> : </span>
<span id="L25"><span class="lineNum"> 25</span> : import { TornadoRouter } from &quot;../v2/TornadoRouter.sol&quot;;</span> <span id="L25"><span class="lineNum"> 25</span> : import { UniswapFeeOracle, UniswapV3OracleHelper } from &quot;../v2/UniswapFeeOracle.sol&quot;;</span>
<span id="L26"><span class="lineNum"> 26</span> : </span> <span id="L26"><span class="lineNum"> 26</span> : </span>
<span id="L27"><span class="lineNum"> 27</span> : /**</span> <span id="L27"><span class="lineNum"> 27</span> : import { TornadoRouter } from &quot;../v2/TornadoRouter.sol&quot;;</span>
<span id="L28"><span class="lineNum"> 28</span> : * @title InfrastructureUpgradeProposal</span> <span id="L28"><span class="lineNum"> 28</span> : </span>
<span id="L29"><span class="lineNum"> 29</span> : * @author AlienTornadosaurusHex</span> <span id="L29"><span class="lineNum"> 29</span> : /**</span>
<span id="L30"><span class="lineNum"> 30</span> : * @notice Proposal which will upgrade only the SURROUNDING infrastrucure in connection with the relayer</span> <span id="L30"><span class="lineNum"> 30</span> : * @title InfrastructureUpgradeProposal</span>
<span id="L31"><span class="lineNum"> 31</span> : * registry such that multiple oracles can be used and so the DAO can add more instances.</span> <span id="L31"><span class="lineNum"> 31</span> : * @author AlienTornadosaurusHex</span>
<span id="L32"><span class="lineNum"> 32</span> : */</span> <span id="L32"><span class="lineNum"> 32</span> : * @notice Proposal which will upgrade only the SURROUNDING infrastrucure in connection with the relayer</span>
<span id="L33"><span class="lineNum"> 33</span> : contract InfrastructureUpgradeProposal {</span> <span id="L33"><span class="lineNum"> 33</span> : * registry such that multiple oracles can be used and so the DAO can add more instances.</span>
<span id="L34"><span class="lineNum"> 34</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ADDRESSES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */</span> <span id="L34"><span class="lineNum"> 34</span> : */</span>
<span id="L35"><span class="lineNum"> 35</span> : </span> <span id="L35"><span class="lineNum"> 35</span> : contract InfrastructureUpgradeProposal {</span>
<span id="L36"><span class="lineNum"> 36</span> : /**</span> <span id="L36"><span class="lineNum"> 36</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOR ENS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */</span>
<span id="L37"><span class="lineNum"> 37</span> : * @notice The address of the current FeeManager proxy, future FeeOracleManager</span> <span id="L37"><span class="lineNum"> 37</span> : </span>
<span id="L38"><span class="lineNum"> 38</span> : */</span> <span id="L38"><span class="lineNum"> 38</span> : /**</span>
<span id="L39"><span class="lineNum"> 39</span> : address payable public constant feeManagerProxyAddress = 0x5f6c97C6AD7bdd0AE7E0Dd4ca33A4ED3fDabD4D7;</span> <span id="L39"><span class="lineNum"> 39</span> : * @notice Namehash of `tornadocash.eth`</span>
<span id="L40"><span class="lineNum"> 40</span> : </span> <span id="L40"><span class="lineNum"> 40</span> : */</span>
<span id="L41"><span class="lineNum"> 41</span> : /**</span> <span id="L41"><span class="lineNum"> 41</span> : bytes32 public constant ENS_PARENT_NODE =</span>
<span id="L42"><span class="lineNum"> 42</span> : * @notice The address of the current InstanceRegistry proxy, this will be upgraded</span> <span id="L42"><span class="lineNum"> 42</span> : 0xe6ae31d630cc7a8279c0f1c7cbe6e7064814c47d1785fa2703d9ae511ee2be0c;</span>
<span id="L43"><span class="lineNum"> 43</span> : */</span> <span id="L43"><span class="lineNum"> 43</span> : </span>
<span id="L44"><span class="lineNum"> 44</span> : address payable public constant instanceRegistryProxyAddress = 0xB20c66C4DE72433F3cE747b58B86830c459CA911;</span> <span id="L44"><span class="lineNum"> 44</span> : /**</span>
<span id="L45"><span class="lineNum"> 45</span> : </span> <span id="L45"><span class="lineNum"> 45</span> : * @notice This should be the content hash which is going to be set for the above node</span>
<span id="L46"><span class="lineNum"> 46</span> : /**</span> <span id="L46"><span class="lineNum"> 46</span> : * @dev Prefix is &quot;e30101701220&quot;, after this v1 CID hash should be appended, see:</span>
<span id="L47"><span class="lineNum"> 47</span> : * @notice The address of the current RelayerRegistry proxy, this will be upgraded</span> <span id="L47"><span class="lineNum"> 47</span> : * https://docs.ens.domains/contract-api-reference/publicresolver#set-content-hash</span>
<span id="L48"><span class="lineNum"> 48</span> : */</span> <span id="L48"><span class="lineNum"> 48</span> : * https://eips.ethereum.org/EIPS/eip-1577</span>
<span id="L49"><span class="lineNum"> 49</span> : address payable public constant relayerRegistryProxyAddress = 0x58E8dCC13BE9780fC42E8723D8EaD4CF46943dF2;</span> <span id="L49"><span class="lineNum"> 49</span> : */</span>
<span id="L50"><span class="lineNum"> 50</span> : </span> <span id="L50"><span class="lineNum"> 50</span> : bytes public constant NEW_CONTENT_HASH = hex&quot;e30101701220&quot;;</span>
<span id="L51"><span class="lineNum"> 51</span> : /**</span> <span id="L51"><span class="lineNum"> 51</span> : </span>
<span id="L52"><span class="lineNum"> 52</span> : * @notice The address of the current TornadoStakingRewards proxy, this will be upgraded</span> <span id="L52"><span class="lineNum"> 52</span> : /**</span>
<span id="L53"><span class="lineNum"> 53</span> : */</span> <span id="L53"><span class="lineNum"> 53</span> : * @notice ENS on Mainnet</span>
<span id="L54"><span class="lineNum"> 54</span> : address payable public constant stakingProxyAddress = 0x5B3f656C80E8ddb9ec01Dd9018815576E9238c29;</span> <span id="L54"><span class="lineNum"> 54</span> : */</span>
<span id="L55"><span class="lineNum"> 55</span> : </span> <span id="L55"><span class="lineNum"> 55</span> : IENS public constant ens = IENS(0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e);</span>
<span id="L56"><span class="lineNum"> 56</span> : /**</span> <span id="L56"><span class="lineNum"> 56</span> : </span>
<span id="L57"><span class="lineNum"> 57</span> : * @notice The address of the new, cleaner, better TornadoRouter</span> <span id="L57"><span class="lineNum"> 57</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INFRA ADDRESSES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */</span>
<span id="L58"><span class="lineNum"> 58</span> : */</span> <span id="L58"><span class="lineNum"> 58</span> : </span>
<span id="L59"><span class="lineNum"> 59</span> : address public immutable deployedTornadoRouterAddress;</span> <span id="L59"><span class="lineNum"> 59</span> : /**</span>
<span id="L60"><span class="lineNum"> 60</span> : </span> <span id="L60"><span class="lineNum"> 60</span> : * @notice The address of the current FeeManager proxy, future FeeOracleManager</span>
<span id="L61"><span class="lineNum"> 61</span> : /**</span> <span id="L61"><span class="lineNum"> 61</span> : */</span>
<span id="L62"><span class="lineNum"> 62</span> : * @notice The implementation address of the TornadoStakingRewards upgrade contract</span> <span id="L62"><span class="lineNum"> 62</span> : address payable public constant feeManagerProxyAddress = 0x5f6c97C6AD7bdd0AE7E0Dd4ca33A4ED3fDabD4D7;</span>
<span id="L63"><span class="lineNum"> 63</span> : */</span> <span id="L63"><span class="lineNum"> 63</span> : </span>
<span id="L64"><span class="lineNum"> 64</span> : address public immutable deployedStakingRewardsImplementationAddress;</span> <span id="L64"><span class="lineNum"> 64</span> : /**</span>
<span id="L65"><span class="lineNum"> 65</span> : </span> <span id="L65"><span class="lineNum"> 65</span> : * @notice The address of the current InstanceRegistry proxy, this will be upgraded</span>
<span id="L66"><span class="lineNum"> 66</span> : /**</span> <span id="L66"><span class="lineNum"> 66</span> : */</span>
<span id="L67"><span class="lineNum"> 67</span> : * @notice The implementation address of the RelayerRegistry upgrade contract</span> <span id="L67"><span class="lineNum"> 67</span> : address payable public constant instanceRegistryProxyAddress = 0xB20c66C4DE72433F3cE747b58B86830c459CA911;</span>
<span id="L68"><span class="lineNum"> 68</span> : */</span> <span id="L68"><span class="lineNum"> 68</span> : </span>
<span id="L69"><span class="lineNum"> 69</span> : address public immutable deployedRelayerRegistryImplementationAddress;</span> <span id="L69"><span class="lineNum"> 69</span> : /**</span>
<span id="L70"><span class="lineNum"> 70</span> : </span> <span id="L70"><span class="lineNum"> 70</span> : * @notice The address of the current RelayerRegistry proxy, this will be upgraded</span>
<span id="L71"><span class="lineNum"> 71</span> : /**</span> <span id="L71"><span class="lineNum"> 71</span> : */</span>
<span id="L72"><span class="lineNum"> 72</span> : * @notice The implementation address of the InstanceRegistry upgrade contract</span> <span id="L72"><span class="lineNum"> 72</span> : address payable public constant relayerRegistryProxyAddress = 0x58E8dCC13BE9780fC42E8723D8EaD4CF46943dF2;</span>
<span id="L73"><span class="lineNum"> 73</span> : */</span> <span id="L73"><span class="lineNum"> 73</span> : </span>
<span id="L74"><span class="lineNum"> 74</span> : address public immutable deployedInstanceRegistryImplementationAddress;</span> <span id="L74"><span class="lineNum"> 74</span> : /**</span>
<span id="L75"><span class="lineNum"> 75</span> : </span> <span id="L75"><span class="lineNum"> 75</span> : * @notice The address of the current TornadoStakingRewards proxy, this will be upgraded</span>
<span id="L76"><span class="lineNum"> 76</span> : /**</span> <span id="L76"><span class="lineNum"> 76</span> : */</span>
<span id="L77"><span class="lineNum"> 77</span> : * @notice The implementation address of the FeeOracleManager upgrade contract</span> <span id="L77"><span class="lineNum"> 77</span> : address payable public constant stakingProxyAddress = 0x5B3f656C80E8ddb9ec01Dd9018815576E9238c29;</span>
<span id="L78"><span class="lineNum"> 78</span> : */</span> <span id="L78"><span class="lineNum"> 78</span> : </span>
<span id="L79"><span class="lineNum"> 79</span> : address public immutable deployedFeeOracleManagerImplementationAddress;</span> <span id="L79"><span class="lineNum"> 79</span> : /**</span>
<span id="L80"><span class="lineNum"> 80</span> : </span> <span id="L80"><span class="lineNum"> 80</span> : * @notice The address of the new, cleaner, better TornadoRouter</span>
<span id="L81"><span class="lineNum"> 81</span> : /**</span> <span id="L81"><span class="lineNum"> 81</span> : */</span>
<span id="L82"><span class="lineNum"> 82</span> : * @notice This is the Uniswap Oracle which we will use for all of our traditional instances, but it will</span> <span id="L82"><span class="lineNum"> 82</span> : address public immutable deployedTornadoRouterAddress;</span>
<span id="L83"><span class="lineNum"> 83</span> : * also help the CurveFeeOracle, the former must have been deployed witht the address of this</span> <span id="L83"><span class="lineNum"> 83</span> : </span>
<span id="L84"><span class="lineNum"> 84</span> : */</span> <span id="L84"><span class="lineNum"> 84</span> : /**</span>
<span id="L85"><span class="lineNum"> 85</span> : address public immutable deployedUniswapFeeOracleAddress;</span> <span id="L85"><span class="lineNum"> 85</span> : * @notice The implementation address of the TornadoStakingRewards upgrade contract</span>
<span id="L86"><span class="lineNum"> 86</span> : </span> <span id="L86"><span class="lineNum"> 86</span> : */</span>
<span id="L87"><span class="lineNum"> 87</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LOGIC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */</span> <span id="L87"><span class="lineNum"> 87</span> : address public immutable deployedStakingRewardsImplementationAddress;</span>
<span id="L88"><span class="lineNum"> 88</span> : </span> <span id="L88"><span class="lineNum"> 88</span> : </span>
<span id="L89"><span class="lineNum"> 89</span> : constructor(</span> <span id="L89"><span class="lineNum"> 89</span> : /**</span>
<span id="L90"><span class="lineNum"> 90</span> : address _deployedTornadoRouterAddress,</span> <span id="L90"><span class="lineNum"> 90</span> : * @notice The implementation address of the RelayerRegistry upgrade contract</span>
<span id="L91"><span class="lineNum"> 91</span> : address _deployedStakingRewardsImplementationAddress,</span> <span id="L91"><span class="lineNum"> 91</span> : */</span>
<span id="L92"><span class="lineNum"> 92</span> : address _deployedRelayerRegistryImplementationAddress,</span> <span id="L92"><span class="lineNum"> 92</span> : address public immutable deployedRelayerRegistryImplementationAddress;</span>
<span id="L93"><span class="lineNum"> 93</span> : address _deployedInstanceRegistryImplementationAddress,</span> <span id="L93"><span class="lineNum"> 93</span> : </span>
<span id="L94"><span class="lineNum"> 94</span> : address _deployedFeeOracleManagerImplementationAddress,</span> <span id="L94"><span class="lineNum"> 94</span> : /**</span>
<span id="L95"><span class="lineNum"> 95</span> : address _deployedUniswapFeeOracleAddress</span> <span id="L95"><span class="lineNum"> 95</span> : * @notice The implementation address of the InstanceRegistry upgrade contract</span>
<span id="L96"><span class="lineNum"> 96</span> : ) public {</span> <span id="L96"><span class="lineNum"> 96</span> : */</span>
<span id="L97"><span class="lineNum"> 97</span> : deployedTornadoRouterAddress = _deployedTornadoRouterAddress;</span> <span id="L97"><span class="lineNum"> 97</span> : address public immutable deployedInstanceRegistryImplementationAddress;</span>
<span id="L98"><span class="lineNum"> 98</span> : deployedStakingRewardsImplementationAddress = _deployedStakingRewardsImplementationAddress;</span> <span id="L98"><span class="lineNum"> 98</span> : </span>
<span id="L99"><span class="lineNum"> 99</span> : deployedRelayerRegistryImplementationAddress = _deployedRelayerRegistryImplementationAddress;</span> <span id="L99"><span class="lineNum"> 99</span> : /**</span>
<span id="L100"><span class="lineNum"> 100</span> : deployedInstanceRegistryImplementationAddress = _deployedInstanceRegistryImplementationAddress;</span> <span id="L100"><span class="lineNum"> 100</span> : * @notice The implementation address of the FeeOracleManager upgrade contract</span>
<span id="L101"><span class="lineNum"> 101</span> : deployedFeeOracleManagerImplementationAddress = _deployedFeeOracleManagerImplementationAddress;</span> <span id="L101"><span class="lineNum"> 101</span> : */</span>
<span id="L102"><span class="lineNum"> 102</span> : deployedUniswapFeeOracleAddress = _deployedUniswapFeeOracleAddress;</span> <span id="L102"><span class="lineNum"> 102</span> : address public immutable deployedFeeOracleManagerImplementationAddress;</span>
<span id="L103"><span class="lineNum"> 103</span> : }</span> <span id="L103"><span class="lineNum"> 103</span> : </span>
<span id="L104"><span class="lineNum"> 104</span> : </span> <span id="L104"><span class="lineNum"> 104</span> : /**</span>
<span id="L105"><span class="lineNum"> 105</span> : /**</span> <span id="L105"><span class="lineNum"> 105</span> : * @notice This is the Uniswap Oracle which we will use for all of our traditional instances, but it will</span>
<span id="L106"><span class="lineNum"> 106</span> : * @dev This function also executes further internal functions inlined below.</span> <span id="L106"><span class="lineNum"> 106</span> : * also help the CurveFeeOracle, the former must have been deployed witht the address of this</span>
<span id="L107"><span class="lineNum"> 107</span> : */</span> <span id="L107"><span class="lineNum"> 107</span> : */</span>
<span id="L108"><span class="lineNum"> 108</span> <span class="tlaGNC tlaBgGNC"> 4 : function executeProposal() external {</span></span> <span id="L108"><span class="lineNum"> 108</span> : address public immutable deployedUniswapFeeOracleAddress;</span>
<span id="L109"><span class="lineNum"> 109</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ TORNADO ROUTER ~~~~~~~~~~~~~~~~~~~~~~~~~ */</span> <span id="L109"><span class="lineNum"> 109</span> : </span>
<span id="L110"><span class="lineNum"> 110</span> : </span> <span id="L110"><span class="lineNum"> 110</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LOGIC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */</span>
<span id="L111"><span class="lineNum"> 111</span> : // We need to prepare the new TornadoRouter contract by setting the instance registry and relayer</span> <span id="L111"><span class="lineNum"> 111</span> : </span>
<span id="L112"><span class="lineNum"> 112</span> : // registry addresses.</span> <span id="L112"><span class="lineNum"> 112</span> : constructor(</span>
<span id="L113"><span class="lineNum"> 113</span> : </span> <span id="L113"><span class="lineNum"> 113</span> : address _deployedTornadoRouterAddress,</span>
<span id="L114"><span class="lineNum"> 114</span> <span class="tlaGNC"> 4 : TornadoRouter router = TornadoRouter(deployedTornadoRouterAddress);</span></span> <span id="L114"><span class="lineNum"> 114</span> : address _deployedStakingRewardsImplementationAddress,</span>
<span id="L115"><span class="lineNum"> 115</span> : </span> <span id="L115"><span class="lineNum"> 115</span> : address _deployedRelayerRegistryImplementationAddress,</span>
<span id="L116"><span class="lineNum"> 116</span> <span class="tlaGNC"> 4 : router.initialize(</span></span> <span id="L116"><span class="lineNum"> 116</span> : address _deployedInstanceRegistryImplementationAddress,</span>
<span id="L117"><span class="lineNum"> 117</span> : instanceRegistryProxyAddress,</span> <span id="L117"><span class="lineNum"> 117</span> : address _deployedFeeOracleManagerImplementationAddress,</span>
<span id="L118"><span class="lineNum"> 118</span> : relayerRegistryProxyAddress,</span> <span id="L118"><span class="lineNum"> 118</span> : address _deployedUniswapFeeOracleAddress</span>
<span id="L119"><span class="lineNum"> 119</span> : feeManagerProxyAddress,</span> <span id="L119"><span class="lineNum"> 119</span> : ) public {</span>
<span id="L120"><span class="lineNum"> 120</span> : stakingProxyAddress</span> <span id="L120"><span class="lineNum"> 120</span> : deployedTornadoRouterAddress = _deployedTornadoRouterAddress;</span>
<span id="L121"><span class="lineNum"> 121</span> : );</span> <span id="L121"><span class="lineNum"> 121</span> : deployedStakingRewardsImplementationAddress = _deployedStakingRewardsImplementationAddress;</span>
<span id="L122"><span class="lineNum"> 122</span> : </span> <span id="L122"><span class="lineNum"> 122</span> : deployedRelayerRegistryImplementationAddress = _deployedRelayerRegistryImplementationAddress;</span>
<span id="L123"><span class="lineNum"> 123</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ STAKING REWARDS ~~~~~~~~~~~~~~~~~~~~~~~~~ */</span> <span id="L123"><span class="lineNum"> 123</span> : deployedInstanceRegistryImplementationAddress = _deployedInstanceRegistryImplementationAddress;</span>
<span id="L124"><span class="lineNum"> 124</span> : </span> <span id="L124"><span class="lineNum"> 124</span> : deployedFeeOracleManagerImplementationAddress = _deployedFeeOracleManagerImplementationAddress;</span>
<span id="L125"><span class="lineNum"> 125</span> : // Upgrade TornadoStakingRewards (V1) Proxy to TornadoStakingRewards (V2)</span> <span id="L125"><span class="lineNum"> 125</span> : deployedUniswapFeeOracleAddress = _deployedUniswapFeeOracleAddress;</span>
<span id="L126"><span class="lineNum"> 126</span> : // We need this to allow the router to call the staking contract instead of the registry</span> <span id="L126"><span class="lineNum"> 126</span> : }</span>
<span id="L127"><span class="lineNum"> 127</span> : </span> <span id="L127"><span class="lineNum"> 127</span> : </span>
<span id="L128"><span class="lineNum"> 128</span> <span class="tlaGNC"> 4 : AdminUpgradeableProxy(stakingProxyAddress).upgradeTo(deployedStakingRewardsImplementationAddress);</span></span> <span id="L128"><span class="lineNum"> 128</span> : /**</span>
<span id="L129"><span class="lineNum"> 129</span> : </span> <span id="L129"><span class="lineNum"> 129</span> : * @dev This function also executes further internal functions inlined below.</span>
<span id="L130"><span class="lineNum"> 130</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ RELAYER REGISTRY ~~~~~~~~~~~~~~~~~~~~~~~~~ */</span> <span id="L130"><span class="lineNum"> 130</span> : */</span>
<span id="L131"><span class="lineNum"> 131</span> : </span> <span id="L131"><span class="lineNum"> 131</span> <span class="tlaGNC tlaBgGNC"> 4 : function executeProposal() external {</span></span>
<span id="L132"><span class="lineNum"> 132</span> : // We need to upgrade and re-initialize (storage layout has been accounted for, check repository) the</span> <span id="L132"><span class="lineNum"> 132</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ TORNADO ROUTER ~~~~~~~~~~~~~~~~~~~~~~~~~ */</span>
<span id="L133"><span class="lineNum"> 133</span> : // RelayerRegistry to clean up the logic in the contract and most also modify access &amp; logic to remove</span> <span id="L133"><span class="lineNum"> 133</span> : </span>
<span id="L134"><span class="lineNum"> 134</span> : // the staking rewards call, since the router does that now</span> <span id="L134"><span class="lineNum"> 134</span> : // We need to prepare the new TornadoRouter contract by setting the instance registry and relayer</span>
<span id="L135"><span class="lineNum"> 135</span> : </span> <span id="L135"><span class="lineNum"> 135</span> : // registry addresses.</span>
<span id="L136"><span class="lineNum"> 136</span> : // Upgrade RelayerRegistry (V1) Proxy to RelayerRegistry (V2)</span> <span id="L136"><span class="lineNum"> 136</span> : </span>
<span id="L137"><span class="lineNum"> 137</span> : </span> <span id="L137"><span class="lineNum"> 137</span> <span class="tlaGNC"> 4 : TornadoRouter router = TornadoRouter(deployedTornadoRouterAddress);</span></span>
<span id="L138"><span class="lineNum"> 138</span> <span class="tlaGNC"> 4 : AdminUpgradeableProxy(relayerRegistryProxyAddress).upgradeTo(</span></span> <span id="L138"><span class="lineNum"> 138</span> : </span>
<span id="L139"><span class="lineNum"> 139</span> : deployedRelayerRegistryImplementationAddress</span> <span id="L139"><span class="lineNum"> 139</span> <span class="tlaGNC"> 4 : router.initialize(</span></span>
<span id="L140"><span class="lineNum"> 140</span> : );</span> <span id="L140"><span class="lineNum"> 140</span> : instanceRegistryProxyAddress,</span>
<span id="L141"><span class="lineNum"> 141</span> : </span> <span id="L141"><span class="lineNum"> 141</span> : relayerRegistryProxyAddress,</span>
<span id="L142"><span class="lineNum"> 142</span> : // The minimum TORN stake we will set. We will set the contract which may upgrade this to Goverannce,</span> <span id="L142"><span class="lineNum"> 142</span> : feeManagerProxyAddress,</span>
<span id="L143"><span class="lineNum"> 143</span> : // but Governance can then delegate this to another contract!</span> <span id="L143"><span class="lineNum"> 143</span> : stakingProxyAddress</span>
<span id="L144"><span class="lineNum"> 144</span> : </span> <span id="L144"><span class="lineNum"> 144</span> : );</span>
<span id="L145"><span class="lineNum"> 145</span> <span class="tlaGNC"> 4 : uint256 MINIMUM_STAKE_AMOUNT = 2000 ether;</span></span> <span id="L145"><span class="lineNum"> 145</span> : </span>
<span id="L146"><span class="lineNum"> 146</span> : </span> <span id="L146"><span class="lineNum"> 146</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ STAKING REWARDS ~~~~~~~~~~~~~~~~~~~~~~~~~ */</span>
<span id="L147"><span class="lineNum"> 147</span> : // Initialize V2 &amp; kill proxy admin slot</span> <span id="L147"><span class="lineNum"> 147</span> : </span>
<span id="L148"><span class="lineNum"> 148</span> : </span> <span id="L148"><span class="lineNum"> 148</span> : // Upgrade TornadoStakingRewards (V1) Proxy to TornadoStakingRewards (V2)</span>
<span id="L149"><span class="lineNum"> 149</span> <span class="tlaGNC"> 4 : RelayerRegistry(relayerRegistryProxyAddress).initialize(</span></span> <span id="L149"><span class="lineNum"> 149</span> : // We need this to allow the router to call the staking contract instead of the registry</span>
<span id="L150"><span class="lineNum"> 150</span> : deployedTornadoRouterAddress, // Balance deductor</span> <span id="L150"><span class="lineNum"> 150</span> : </span>
<span id="L151"><span class="lineNum"> 151</span> : address(this), // Balance nullifier</span> <span id="L151"><span class="lineNum"> 151</span> <span class="tlaGNC"> 4 : AdminUpgradeableProxy(stakingProxyAddress).upgradeTo(deployedStakingRewardsImplementationAddress);</span></span>
<span id="L152"><span class="lineNum"> 152</span> : stakingProxyAddress, // Staked tokens receiver</span> <span id="L152"><span class="lineNum"> 152</span> : </span>
<span id="L153"><span class="lineNum"> 153</span> : address(this), // Minimum stake oracle</span> <span id="L153"><span class="lineNum"> 153</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ RELAYER REGISTRY ~~~~~~~~~~~~~~~~~~~~~~~~~ */</span>
<span id="L154"><span class="lineNum"> 154</span> : MINIMUM_STAKE_AMOUNT // Initial minimum stake amount</span> <span id="L154"><span class="lineNum"> 154</span> : </span>
<span id="L155"><span class="lineNum"> 155</span> : );</span> <span id="L155"><span class="lineNum"> 155</span> : // We need to upgrade and re-initialize (storage layout has been accounted for, check repository) the</span>
<span id="L156"><span class="lineNum"> 156</span> : </span> <span id="L156"><span class="lineNum"> 156</span> : // RelayerRegistry to clean up the logic in the contract and most also modify access &amp; logic to remove</span>
<span id="L157"><span class="lineNum"> 157</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ INSTANCE REGISTRY ~~~~~~~~~~~~~~~~~~~~~~~~~ */</span> <span id="L157"><span class="lineNum"> 157</span> : // the staking rewards call, since the router does that now</span>
<span id="L158"><span class="lineNum"> 158</span> : </span> <span id="L158"><span class="lineNum"> 158</span> : </span>
<span id="L159"><span class="lineNum"> 159</span> : // Upgrade InstanceRegistry (V1) Proxy to InstanceRegistry (V2)</span> <span id="L159"><span class="lineNum"> 159</span> : // Upgrade RelayerRegistry (V1) Proxy to RelayerRegistry (V2)</span>
<span id="L160"><span class="lineNum"> 160</span> : // There is not many changes here, but we made it more logical and clear. Future developers should not</span> <span id="L160"><span class="lineNum"> 160</span> : </span>
<span id="L161"><span class="lineNum"> 161</span> : // have a problem understanding what these contracts do.</span> <span id="L161"><span class="lineNum"> 161</span> <span class="tlaGNC"> 4 : AdminUpgradeableProxy(relayerRegistryProxyAddress).upgradeTo(</span></span>
<span id="L162"><span class="lineNum"> 162</span> : </span> <span id="L162"><span class="lineNum"> 162</span> : deployedRelayerRegistryImplementationAddress</span>
<span id="L163"><span class="lineNum"> 163</span> <span class="tlaGNC"> 4 : AdminUpgradeableProxy(instanceRegistryProxyAddress).upgradeTo(</span></span> <span id="L163"><span class="lineNum"> 163</span> : );</span>
<span id="L164"><span class="lineNum"> 164</span> : deployedInstanceRegistryImplementationAddress</span> <span id="L164"><span class="lineNum"> 164</span> : </span>
<span id="L165"><span class="lineNum"> 165</span> : );</span> <span id="L165"><span class="lineNum"> 165</span> : // The minimum TORN stake we will set. We will set the contract which may upgrade this to Goverannce,</span>
<span id="L166"><span class="lineNum"> 166</span> : </span> <span id="L166"><span class="lineNum"> 166</span> : // but Governance can then delegate this to another contract!</span>
<span id="L167"><span class="lineNum"> 167</span> : // Initialize this one too, we are abandoning all of the older data here because either the data</span> <span id="L167"><span class="lineNum"> 167</span> : </span>
<span id="L168"><span class="lineNum"> 168</span> : // structures don't fit or we can't do a clean addition of all instances, it is better to add the</span> <span id="L168"><span class="lineNum"> 168</span> <span class="tlaGNC"> 4 : uint256 MINIMUM_STAKE_AMOUNT = 2000 ether;</span></span>
<span id="L169"><span class="lineNum"> 169</span> : // instances as fresh data because it's anyways a simple contract, it just stores some basic data on</span> <span id="L169"><span class="lineNum"> 169</span> : </span>
<span id="L170"><span class="lineNum"> 170</span> : // instances which isn't mutable for them, instead only determined for each. The new Tornado Router is</span> <span id="L170"><span class="lineNum"> 170</span> : // Initialize V2 &amp; kill proxy admin slot</span>
<span id="L171"><span class="lineNum"> 171</span> : // also set.</span> <span id="L171"><span class="lineNum"> 171</span> : </span>
<span id="L172"><span class="lineNum"> 172</span> : </span> <span id="L172"><span class="lineNum"> 172</span> <span class="tlaGNC"> 4 : RelayerRegistry(relayerRegistryProxyAddress).initialize(</span></span>
<span id="L173"><span class="lineNum"> 173</span> <span class="tlaGNC"> 4 : InstanceRegistry(instanceRegistryProxyAddress).initialize(_getAllInstances(), router);</span></span> <span id="L173"><span class="lineNum"> 173</span> : deployedTornadoRouterAddress, // Balance deductor</span>
<span id="L174"><span class="lineNum"> 174</span> : </span> <span id="L174"><span class="lineNum"> 174</span> : address(this), // Balance nullifier</span>
<span id="L175"><span class="lineNum"> 175</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FEE ORACLE MANAGER ~~~~~~~~~~~~~~~~~~~~~~~~~ */</span> <span id="L175"><span class="lineNum"> 175</span> : stakingProxyAddress, // Staked tokens receiver</span>
<span id="L176"><span class="lineNum"> 176</span> : </span> <span id="L176"><span class="lineNum"> 176</span> : address(this), // Minimum stake oracle</span>
<span id="L177"><span class="lineNum"> 177</span> : // Upgrade FeeManager (V1) Proxy to FeeOracleManager (V2)</span> <span id="L177"><span class="lineNum"> 177</span> : MINIMUM_STAKE_AMOUNT // Initial minimum stake amount</span>
<span id="L178"><span class="lineNum"> 178</span> : // The below is a total overhaul, layout has been accounted for</span> <span id="L178"><span class="lineNum"> 178</span> : );</span>
<span id="L179"><span class="lineNum"> 179</span> : </span> <span id="L179"><span class="lineNum"> 179</span> : </span>
<span id="L180"><span class="lineNum"> 180</span> <span class="tlaGNC"> 4 : AdminUpgradeableProxy(feeManagerProxyAddress).upgradeTo(deployedFeeOracleManagerImplementationAddress);</span></span> <span id="L180"><span class="lineNum"> 180</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ INSTANCE REGISTRY ~~~~~~~~~~~~~~~~~~~~~~~~~ */</span>
<span id="L181"><span class="lineNum"> 181</span> : </span> <span id="L181"><span class="lineNum"> 181</span> : </span>
<span id="L182"><span class="lineNum"> 182</span> : // Now initialize the FeeOracleManager immediately, this initialization will record the old legacy</span> <span id="L182"><span class="lineNum"> 182</span> : // Upgrade InstanceRegistry (V1) Proxy to InstanceRegistry (V2)</span>
<span id="L183"><span class="lineNum"> 183</span> : // data in combination with the new oracle (which returns a fee value compatible with legacy) and in</span> <span id="L183"><span class="lineNum"> 183</span> : // There is not many changes here, but we made it more logical and clear. Future developers should not</span>
<span id="L184"><span class="lineNum"> 184</span> : // accordance with the new data structures being used, which are more logical and segmented than what</span> <span id="L184"><span class="lineNum"> 184</span> : // have a problem understanding what these contracts do.</span>
<span id="L185"><span class="lineNum"> 185</span> : // the original implementation was using. The data which is used in the internal functions was read</span> <span id="L185"><span class="lineNum"> 185</span> : </span>
<span id="L186"><span class="lineNum"> 186</span> : // out from the on-chain instance registry.</span> <span id="L186"><span class="lineNum"> 186</span> <span class="tlaGNC"> 4 : AdminUpgradeableProxy(instanceRegistryProxyAddress).upgradeTo(</span></span>
<span id="L187"><span class="lineNum"> 187</span> : </span> <span id="L187"><span class="lineNum"> 187</span> : deployedInstanceRegistryImplementationAddress</span>
<span id="L188"><span class="lineNum"> 188</span> : // The TWAP update interval that we're going to be using</span> <span id="L188"><span class="lineNum"> 188</span> : );</span>
<span id="L189"><span class="lineNum"> 189</span> : </span> <span id="L189"><span class="lineNum"> 189</span> : </span>
<span id="L190"><span class="lineNum"> 190</span> <span class="tlaGNC"> 4 : uint32 TWAP_UPDATE_INTERVAL = 6 hours;</span></span> <span id="L190"><span class="lineNum"> 190</span> : // Initialize this one too, we are abandoning all of the older data here because either the data</span>
<span id="L191"><span class="lineNum"> 191</span> : </span> <span id="L191"><span class="lineNum"> 191</span> : // structures don't fit or we can't do a clean addition of all instances, it is better to add the</span>
<span id="L192"><span class="lineNum"> 192</span> <span class="tlaGNC"> 4 : FeeOracleManager(feeManagerProxyAddress).initialize(</span></span> <span id="L192"><span class="lineNum"> 192</span> : // instances as fresh data because it's anyways a simple contract, it just stores some basic data on</span>
<span id="L193"><span class="lineNum"> 193</span> : deployedUniswapFeeOracleAddress,</span> <span id="L193"><span class="lineNum"> 193</span> : // instances which isn't mutable for them, instead only determined for each. The new Tornado Router is</span>
<span id="L194"><span class="lineNum"> 194</span> : instanceRegistryProxyAddress,</span> <span id="L194"><span class="lineNum"> 194</span> : // also set.</span>
<span id="L195"><span class="lineNum"> 195</span> : deployedTornadoRouterAddress, // The feeUpdater is the router, same thing as address(router)</span> <span id="L195"><span class="lineNum"> 195</span> : </span>
<span id="L196"><span class="lineNum"> 196</span> : TWAP_UPDATE_INTERVAL,</span> <span id="L196"><span class="lineNum"> 196</span> <span class="tlaGNC"> 4 : InstanceRegistry(instanceRegistryProxyAddress).initialize(_getAllInstances(), router);</span></span>
<span id="L197"><span class="lineNum"> 197</span> : _getAllInstances(),</span> <span id="L197"><span class="lineNum"> 197</span> : </span>
<span id="L198"><span class="lineNum"> 198</span> : _getAllInstanceFeePercents()</span> <span id="L198"><span class="lineNum"> 198</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FEE ORACLE MANAGER ~~~~~~~~~~~~~~~~~~~~~~~~~ */</span>
<span id="L199"><span class="lineNum"> 199</span> : );</span> <span id="L199"><span class="lineNum"> 199</span> : </span>
<span id="L200"><span class="lineNum"> 200</span> : </span> <span id="L200"><span class="lineNum"> 200</span> : // Upgrade FeeManager (V1) Proxy to FeeOracleManager (V2)</span>
<span id="L201"><span class="lineNum"> 201</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ UNISWAP FEE ORACLE ~~~~~~~~~~~~~~~~~~~~~~~~~ */</span> <span id="L201"><span class="lineNum"> 201</span> : // The below is a total overhaul, layout has been accounted for</span>
<span id="L202"><span class="lineNum"> 202</span> : </span> <span id="L202"><span class="lineNum"> 202</span> : </span>
<span id="L203"><span class="lineNum"> 203</span> : // It's been show recently that Uniswap V2 is providing better conditions for TORN liquidity than</span> <span id="L203"><span class="lineNum"> 203</span> <span class="tlaGNC"> 4 : AdminUpgradeableProxy(feeManagerProxyAddress).upgradeTo(deployedFeeOracleManagerImplementationAddress);</span></span>
<span id="L204"><span class="lineNum"> 204</span> : // Uniswap V3, probably due to the simplicity of managing positions and the fact that with a coming V4</span> <span id="L204"><span class="lineNum"> 204</span> : </span>
<span id="L205"><span class="lineNum"> 205</span> : // upgrade, Uniswap is just moving to fragment their liquidity further. Until a Curve migration is not</span> <span id="L205"><span class="lineNum"> 205</span> : // Now initialize the FeeOracleManager immediately, this initialization will record the old legacy</span>
<span id="L206"><span class="lineNum"> 206</span> : // fulfilled, we will use the Uniswap V2 pool for TORN, and if we also see that other token liquidity</span> <span id="L206"><span class="lineNum"> 206</span> : // data in combination with the new oracle (which returns a fee value compatible with legacy) and in</span>
<span id="L207"><span class="lineNum"> 207</span> : // is becoming an issue, we will move it all to V2 until we don't move stuff over to Curve fully.</span> <span id="L207"><span class="lineNum"> 207</span> : // accordance with the new data structures being used, which are more logical and segmented than what</span>
<span id="L208"><span class="lineNum"> 208</span> : </span> <span id="L208"><span class="lineNum"> 208</span> : // the original implementation was using. The data which is used in the internal functions was read</span>
<span id="L209"><span class="lineNum"> 209</span> <span class="tlaGNC"> 4 : UniswapFeeOracle uniswapFeeOracle = UniswapFeeOracle(deployedUniswapFeeOracleAddress);</span></span> <span id="L209"><span class="lineNum"> 209</span> : // out from the on-chain instance registry.</span>
<span id="L210"><span class="lineNum"> 210</span> : </span> <span id="L210"><span class="lineNum"> 210</span> : </span>
<span id="L211"><span class="lineNum"> 211</span> <span class="tlaGNC"> 4 : uniswapFeeOracle.setMinObservationCardinality(1); // Set it to minimum so cDAI passes, see below</span></span> <span id="L211"><span class="lineNum"> 211</span> : // The TWAP update interval that we're going to be using</span>
<span id="L212"><span class="lineNum"> 212</span> : </span> <span id="L212"><span class="lineNum"> 212</span> : </span>
<span id="L213"><span class="lineNum"> 213</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ POOL FEES AND ORACLE CONFIG ~~~~~~~~~~~~~~~~~~~~~~~~~ */</span> <span id="L213"><span class="lineNum"> 213</span> <span class="tlaGNC"> 4 : uint32 TWAP_UPDATE_INTERVAL = 6 hours;</span></span>
<span id="L214"><span class="lineNum"> 214</span> : </span> <span id="L214"><span class="lineNum"> 214</span> : </span>
<span id="L215"><span class="lineNum"> 215</span> : // Each of the instances are going to require a Uniswap Pool Fee to be set such that we actually know</span> <span id="L215"><span class="lineNum"> 215</span> <span class="tlaGNC"> 4 : FeeOracleManager(feeManagerProxyAddress).initialize(</span></span>
<span id="L216"><span class="lineNum"> 216</span> : // what pools to lookup when querying for Oracle data. This data has also been read out from the</span> <span id="L216"><span class="lineNum"> 216</span> : deployedUniswapFeeOracleAddress,</span>
<span id="L217"><span class="lineNum"> 217</span> : // instance registry and it basically has the 3000 (0.3%) and 500 (0.05%) non-stable and stable</span> <span id="L217"><span class="lineNum"> 217</span> : instanceRegistryProxyAddress,</span>
<span id="L218"><span class="lineNum"> 218</span> : // respectively &quot;default&quot; pool fees. This is not to be confused with pool protocol fees, these have</span> <span id="L218"><span class="lineNum"> 218</span> : deployedTornadoRouterAddress, // The feeUpdater is the router, same thing as address(router)</span>
<span id="L219"><span class="lineNum"> 219</span> : // been recorded in the (first) legacy initialization above</span> <span id="L219"><span class="lineNum"> 219</span> : TWAP_UPDATE_INTERVAL,</span>
<span id="L220"><span class="lineNum"> 220</span> : </span> <span id="L220"><span class="lineNum"> 220</span> : _getAllInstances(),</span>
<span id="L221"><span class="lineNum"> 221</span> <span class="tlaGNC"> 4 : _setAllInstancePoolFeesInOracle(uniswapFeeOracle);</span></span> <span id="L221"><span class="lineNum"> 221</span> : _getAllInstanceFeePercents()</span>
<span id="L222"><span class="lineNum"> 222</span> : </span> <span id="L222"><span class="lineNum"> 222</span> : );</span>
<span id="L223"><span class="lineNum"> 223</span> <span class="tlaGNC"> 4 : uniswapFeeOracle.setMinObservationCardinality(10); // Now set the cardinality to a reasonable value</span></span> <span id="L223"><span class="lineNum"> 223</span> : </span>
<span id="L224"><span class="lineNum"> 224</span> : }</span> <span id="L224"><span class="lineNum"> 224</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ UNISWAP FEE ORACLE ~~~~~~~~~~~~~~~~~~~~~~~~~ */</span>
<span id="L225"><span class="lineNum"> 225</span> : </span> <span id="L225"><span class="lineNum"> 225</span> : </span>
<span id="L226"><span class="lineNum"> 226</span> <span class="tlaGNC"> 4 : function _setAllInstancePoolFeesInOracle(UniswapFeeOracle _uniswapFeeOracle) internal {</span></span> <span id="L226"><span class="lineNum"> 226</span> : // It's been show recently that Uniswap V2 is providing better conditions for TORN liquidity than</span>
<span id="L227"><span class="lineNum"> 227</span> <span class="tlaGNC"> 4 : ITornadoInstance[] memory instances = _getAllInstances();</span></span> <span id="L227"><span class="lineNum"> 227</span> : // Uniswap V3, probably due to the simplicity of managing positions and the fact that with a coming V4</span>
<span id="L228"><span class="lineNum"> 228</span> : </span> <span id="L228"><span class="lineNum"> 228</span> : // upgrade, Uniswap is just moving to fragment their liquidity further. Until a Curve migration is not</span>
<span id="L229"><span class="lineNum"> 229</span> <span class="tlaGNC"> 4 : IERC20 weth = IERC20(UniswapV3OracleHelper.WETH);</span></span> <span id="L229"><span class="lineNum"> 229</span> : // fulfilled, we will use the Uniswap V2 pool for TORN, and if we also see that other token liquidity</span>
<span id="L230"><span class="lineNum"> 230</span> <span class="tlaGNC"> 4 : IERC20 dai = IERC20(instances[4].token());</span></span> <span id="L230"><span class="lineNum"> 230</span> : // is becoming an issue, we will move it all to V2 until we don't move stuff over to Curve fully.</span>
<span id="L231"><span class="lineNum"> 231</span> <span class="tlaGNC"> 4 : IERC20 cdai = IERC20(instances[8].token());</span></span> <span id="L231"><span class="lineNum"> 231</span> : </span>
<span id="L232"><span class="lineNum"> 232</span> <span class="tlaGNC"> 4 : IERC20 usdt = IERC20(instances[12].token());</span></span> <span id="L232"><span class="lineNum"> 232</span> <span class="tlaGNC"> 4 : UniswapFeeOracle uniswapFeeOracle = UniswapFeeOracle(deployedUniswapFeeOracleAddress);</span></span>
<span id="L233"><span class="lineNum"> 233</span> <span class="tlaGNC"> 4 : IERC20 wbtc = IERC20(instances[14].token());</span></span> <span id="L233"><span class="lineNum"> 233</span> : </span>
<span id="L234"><span class="lineNum"> 234</span> : </span> <span id="L234"><span class="lineNum"> 234</span> <span class="tlaGNC"> 4 : uniswapFeeOracle.setMinObservationCardinality(1); // Set it to minimum so cDAI passes, see below</span></span>
<span id="L235"><span class="lineNum"> 235</span> : /* ETH instances */</span> <span id="L235"><span class="lineNum"> 235</span> : </span>
<span id="L236"><span class="lineNum"> 236</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(weth, uint24(0x000));</span></span> <span id="L236"><span class="lineNum"> 236</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ POOL FEES AND ORACLE CONFIG ~~~~~~~~~~~~~~~~~~~~~~~~~ */</span>
<span id="L237"><span class="lineNum"> 237</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(weth, uint24(0x000));</span></span> <span id="L237"><span class="lineNum"> 237</span> : </span>
<span id="L238"><span class="lineNum"> 238</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(weth, uint24(0x000));</span></span> <span id="L238"><span class="lineNum"> 238</span> : // Each of the instances are going to require a Uniswap Pool Fee to be set such that we actually know</span>
<span id="L239"><span class="lineNum"> 239</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(weth, uint24(0x000));</span></span> <span id="L239"><span class="lineNum"> 239</span> : // what pools to lookup when querying for Oracle data. This data has also been read out from the</span>
<span id="L240"><span class="lineNum"> 240</span> : </span> <span id="L240"><span class="lineNum"> 240</span> : // instance registry and it basically has the 3000 (0.3%) and 500 (0.05%) non-stable and stable</span>
<span id="L241"><span class="lineNum"> 241</span> : /* DAI instances */</span> <span id="L241"><span class="lineNum"> 241</span> : // respectively &quot;default&quot; pool fees. This is not to be confused with pool protocol fees, these have</span>
<span id="L242"><span class="lineNum"> 242</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(dai, uint24(0xbb8));</span></span> <span id="L242"><span class="lineNum"> 242</span> : // been recorded in the (first) legacy initialization above</span>
<span id="L243"><span class="lineNum"> 243</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(dai, uint24(0xbb8));</span></span> <span id="L243"><span class="lineNum"> 243</span> : </span>
<span id="L244"><span class="lineNum"> 244</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(dai, uint24(0xbb8));</span></span> <span id="L244"><span class="lineNum"> 244</span> <span class="tlaGNC"> 4 : _setAllInstancePoolFeesInOracle(uniswapFeeOracle);</span></span>
<span id="L245"><span class="lineNum"> 245</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(dai, uint24(0xbb8));</span></span> <span id="L245"><span class="lineNum"> 245</span> : </span>
<span id="L246"><span class="lineNum"> 246</span> : </span> <span id="L246"><span class="lineNum"> 246</span> <span class="tlaGNC"> 4 : uniswapFeeOracle.setMinObservationCardinality(10); // Now set the cardinality to a reasonable value</span></span>
<span id="L247"><span class="lineNum"> 247</span> : /* cDAI instances */</span> <span id="L247"><span class="lineNum"> 247</span> : </span>
<span id="L248"><span class="lineNum"> 248</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(cdai, uint24(0xbb8));</span></span> <span id="L248"><span class="lineNum"> 248</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ SET FRONTEND CONTENT HASH ~~~~~~~~~~~~~~~~~~~~~~~~~ */</span>
<span id="L249"><span class="lineNum"> 249</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(cdai, uint24(0xbb8));</span></span> <span id="L249"><span class="lineNum"> 249</span> : </span>
<span id="L250"><span class="lineNum"> 250</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(cdai, uint24(0xbb8));</span></span> <span id="L250"><span class="lineNum"> 250</span> : // Updating the content hash via ENS allows the users to find via stuff like IPNS CIDs of legitimate</span>
<span id="L251"><span class="lineNum"> 251</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(cdai, uint24(0xbb8));</span></span> <span id="L251"><span class="lineNum"> 251</span> : // data or apps. We are updating the frontend to support the former changes.</span>
<span id="L252"><span class="lineNum"> 252</span> : </span> <span id="L252"><span class="lineNum"> 252</span> : </span>
<span id="L253"><span class="lineNum"> 253</span> : /* USDT instances */</span> <span id="L253"><span class="lineNum"> 253</span> <span class="tlaGNC"> 4 : ens.resolver(ENS_PARENT_NODE).setContenthash(ENS_PARENT_NODE, NEW_CONTENT_HASH);</span></span>
<span id="L254"><span class="lineNum"> 254</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(usdt, uint24(0x1f4));</span></span> <span id="L254"><span class="lineNum"> 254</span> : }</span>
<span id="L255"><span class="lineNum"> 255</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(usdt, uint24(0x1f4));</span></span> <span id="L255"><span class="lineNum"> 255</span> : </span>
<span id="L256"><span class="lineNum"> 256</span> : </span> <span id="L256"><span class="lineNum"> 256</span> <span class="tlaGNC"> 4 : function _setAllInstancePoolFeesInOracle(UniswapFeeOracle _uniswapFeeOracle) internal {</span></span>
<span id="L257"><span class="lineNum"> 257</span> : /* WBTC instances */</span> <span id="L257"><span class="lineNum"> 257</span> <span class="tlaGNC"> 4 : ITornadoInstance[] memory instances = _getAllInstances();</span></span>
<span id="L258"><span class="lineNum"> 258</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(wbtc, uint24(0xbb8));</span></span> <span id="L258"><span class="lineNum"> 258</span> : </span>
<span id="L259"><span class="lineNum"> 259</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(wbtc, uint24(0xbb8));</span></span> <span id="L259"><span class="lineNum"> 259</span> <span class="tlaGNC"> 4 : IERC20 weth = IERC20(UniswapV3OracleHelper.WETH);</span></span>
<span id="L260"><span class="lineNum"> 260</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(wbtc, uint24(0xbb8));</span></span> <span id="L260"><span class="lineNum"> 260</span> <span class="tlaGNC"> 4 : IERC20 dai = IERC20(instances[4].token());</span></span>
<span id="L261"><span class="lineNum"> 261</span> : }</span> <span id="L261"><span class="lineNum"> 261</span> <span class="tlaGNC"> 4 : IERC20 cdai = IERC20(instances[8].token());</span></span>
<span id="L262"><span class="lineNum"> 262</span> : </span> <span id="L262"><span class="lineNum"> 262</span> <span class="tlaGNC"> 4 : IERC20 usdt = IERC20(instances[12].token());</span></span>
<span id="L263"><span class="lineNum"> 263</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FURTHER PARAMETERS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */</span> <span id="L263"><span class="lineNum"> 263</span> <span class="tlaGNC"> 4 : IERC20 wbtc = IERC20(instances[14].token());</span></span>
<span id="L264"><span class="lineNum"> 264</span> : </span> <span id="L264"><span class="lineNum"> 264</span> : </span>
<span id="L265"><span class="lineNum"> 265</span> <span class="tlaGNC"> 12 : function _getAllInstances() internal pure returns (ITornadoInstance[] memory _addresses) {</span></span> <span id="L265"><span class="lineNum"> 265</span> : /* ETH instances */</span>
<span id="L266"><span class="lineNum"> 266</span> <span class="tlaGNC"> 12 : _addresses = new ITornadoInstance[](17);</span></span> <span id="L266"><span class="lineNum"> 266</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(weth, uint24(0x000));</span></span>
<span id="L267"><span class="lineNum"> 267</span> : </span> <span id="L267"><span class="lineNum"> 267</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(weth, uint24(0x000));</span></span>
<span id="L268"><span class="lineNum"> 268</span> : /* ETH instances */</span> <span id="L268"><span class="lineNum"> 268</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(weth, uint24(0x000));</span></span>
<span id="L269"><span class="lineNum"> 269</span> <span class="tlaGNC"> 12 : _addresses[0] = ITornadoInstance(0x12D66f87A04A9E220743712cE6d9bB1B5616B8Fc);</span></span> <span id="L269"><span class="lineNum"> 269</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(weth, uint24(0x000));</span></span>
<span id="L270"><span class="lineNum"> 270</span> <span class="tlaGNC"> 12 : _addresses[1] = ITornadoInstance(0x47CE0C6eD5B0Ce3d3A51fdb1C52DC66a7c3c2936);</span></span> <span id="L270"><span class="lineNum"> 270</span> : </span>
<span id="L271"><span class="lineNum"> 271</span> <span class="tlaGNC"> 12 : _addresses[2] = ITornadoInstance(0x910Cbd523D972eb0a6f4cAe4618aD62622b39DbF);</span></span> <span id="L271"><span class="lineNum"> 271</span> : /* DAI instances */</span>
<span id="L272"><span class="lineNum"> 272</span> <span class="tlaGNC"> 12 : _addresses[3] = ITornadoInstance(0xA160cdAB225685dA1d56aa342Ad8841c3b53f291);</span></span> <span id="L272"><span class="lineNum"> 272</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(dai, uint24(0xbb8));</span></span>
<span id="L273"><span class="lineNum"> 273</span> : </span> <span id="L273"><span class="lineNum"> 273</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(dai, uint24(0xbb8));</span></span>
<span id="L274"><span class="lineNum"> 274</span> : /* DAI instances */</span> <span id="L274"><span class="lineNum"> 274</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(dai, uint24(0xbb8));</span></span>
<span id="L275"><span class="lineNum"> 275</span> <span class="tlaGNC"> 12 : _addresses[4] = ITornadoInstance(0xD4B88Df4D29F5CedD6857912842cff3b20C8Cfa3);</span></span> <span id="L275"><span class="lineNum"> 275</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(dai, uint24(0xbb8));</span></span>
<span id="L276"><span class="lineNum"> 276</span> <span class="tlaGNC"> 12 : _addresses[5] = ITornadoInstance(0xFD8610d20aA15b7B2E3Be39B396a1bC3516c7144);</span></span> <span id="L276"><span class="lineNum"> 276</span> : </span>
<span id="L277"><span class="lineNum"> 277</span> <span class="tlaGNC"> 12 : _addresses[6] = ITornadoInstance(0x07687e702b410Fa43f4cB4Af7FA097918ffD2730);</span></span> <span id="L277"><span class="lineNum"> 277</span> : /* cDAI instances */</span>
<span id="L278"><span class="lineNum"> 278</span> <span class="tlaGNC"> 12 : _addresses[7] = ITornadoInstance(0x23773E65ed146A459791799d01336DB287f25334);</span></span> <span id="L278"><span class="lineNum"> 278</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(cdai, uint24(0xbb8));</span></span>
<span id="L279"><span class="lineNum"> 279</span> : </span> <span id="L279"><span class="lineNum"> 279</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(cdai, uint24(0xbb8));</span></span>
<span id="L280"><span class="lineNum"> 280</span> : /* cDAI instances */</span> <span id="L280"><span class="lineNum"> 280</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(cdai, uint24(0xbb8));</span></span>
<span id="L281"><span class="lineNum"> 281</span> <span class="tlaGNC"> 12 : _addresses[8] = ITornadoInstance(0x22aaA7720ddd5388A3c0A3333430953C68f1849b);</span></span> <span id="L281"><span class="lineNum"> 281</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(cdai, uint24(0xbb8));</span></span>
<span id="L282"><span class="lineNum"> 282</span> <span class="tlaGNC"> 12 : _addresses[9] = ITornadoInstance(0x03893a7c7463AE47D46bc7f091665f1893656003);</span></span> <span id="L282"><span class="lineNum"> 282</span> : </span>
<span id="L283"><span class="lineNum"> 283</span> <span class="tlaGNC"> 12 : _addresses[10] = ITornadoInstance(0x2717c5e28cf931547B621a5dddb772Ab6A35B701);</span></span> <span id="L283"><span class="lineNum"> 283</span> : /* USDT instances */</span>
<span id="L284"><span class="lineNum"> 284</span> <span class="tlaGNC"> 12 : _addresses[11] = ITornadoInstance(0xD21be7248e0197Ee08E0c20D4a96DEBdaC3D20Af);</span></span> <span id="L284"><span class="lineNum"> 284</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(usdt, uint24(0x1f4));</span></span>
<span id="L285"><span class="lineNum"> 285</span> : </span> <span id="L285"><span class="lineNum"> 285</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(usdt, uint24(0x1f4));</span></span>
<span id="L286"><span class="lineNum"> 286</span> : /* USDT instances */</span> <span id="L286"><span class="lineNum"> 286</span> : </span>
<span id="L287"><span class="lineNum"> 287</span> <span class="tlaGNC"> 12 : _addresses[12] = ITornadoInstance(0x169AD27A470D064DEDE56a2D3ff727986b15D52B);</span></span> <span id="L287"><span class="lineNum"> 287</span> : /* WBTC instances */</span>
<span id="L288"><span class="lineNum"> 288</span> <span class="tlaGNC"> 12 : _addresses[13] = ITornadoInstance(0x0836222F2B2B24A3F36f98668Ed8F0B38D1a872f);</span></span> <span id="L288"><span class="lineNum"> 288</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(wbtc, uint24(0xbb8));</span></span>
<span id="L289"><span class="lineNum"> 289</span> : </span> <span id="L289"><span class="lineNum"> 289</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(wbtc, uint24(0xbb8));</span></span>
<span id="L290"><span class="lineNum"> 290</span> : /* WBTC instances */</span> <span id="L290"><span class="lineNum"> 290</span> <span class="tlaGNC"> 4 : _uniswapFeeOracle.setPoolFeeForToken(wbtc, uint24(0xbb8));</span></span>
<span id="L291"><span class="lineNum"> 291</span> <span class="tlaGNC"> 12 : _addresses[14] = ITornadoInstance(0x178169B423a011fff22B9e3F3abeA13414dDD0F1);</span></span> <span id="L291"><span class="lineNum"> 291</span> : }</span>
<span id="L292"><span class="lineNum"> 292</span> <span class="tlaGNC"> 12 : _addresses[15] = ITornadoInstance(0x610B717796ad172B316836AC95a2ffad065CeaB4);</span></span> <span id="L292"><span class="lineNum"> 292</span> : </span>
<span id="L293"><span class="lineNum"> 293</span> <span class="tlaGNC"> 12 : _addresses[16] = ITornadoInstance(0xbB93e510BbCD0B7beb5A853875f9eC60275CF498);</span></span> <span id="L293"><span class="lineNum"> 293</span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FURTHER PARAMETERS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */</span>
<span id="L294"><span class="lineNum"> 294</span> : }</span> <span id="L294"><span class="lineNum"> 294</span> : </span>
<span id="L295"><span class="lineNum"> 295</span> : </span> <span id="L295"><span class="lineNum"> 295</span> <span class="tlaGNC"> 12 : function _getAllInstances() internal pure returns (ITornadoInstance[] memory _addresses) {</span></span>
<span id="L296"><span class="lineNum"> 296</span> <span class="tlaGNC"> 4 : function _getAllInstanceFeePercents() internal pure returns (uint256[] memory _percents) {</span></span> <span id="L296"><span class="lineNum"> 296</span> <span class="tlaGNC"> 12 : _addresses = new ITornadoInstance[](17);</span></span>
<span id="L297"><span class="lineNum"> 297</span> <span class="tlaGNC"> 4 : _percents = new uint256[](17);</span></span> <span id="L297"><span class="lineNum"> 297</span> : </span>
<span id="L298"><span class="lineNum"> 298</span> : </span> <span id="L298"><span class="lineNum"> 298</span> : /* ETH instances */</span>
<span id="L299"><span class="lineNum"> 299</span> : /* ETH instances */</span> <span id="L299"><span class="lineNum"> 299</span> <span class="tlaGNC"> 12 : _addresses[0] = ITornadoInstance(0x12D66f87A04A9E220743712cE6d9bB1B5616B8Fc);</span></span>
<span id="L300"><span class="lineNum"> 300</span> <span class="tlaGNC"> 4 : _percents[0] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></span> <span id="L300"><span class="lineNum"> 300</span> <span class="tlaGNC"> 12 : _addresses[1] = ITornadoInstance(0x47CE0C6eD5B0Ce3d3A51fdb1C52DC66a7c3c2936);</span></span>
<span id="L301"><span class="lineNum"> 301</span> <span class="tlaGNC"> 4 : _percents[1] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></span> <span id="L301"><span class="lineNum"> 301</span> <span class="tlaGNC"> 12 : _addresses[2] = ITornadoInstance(0x910Cbd523D972eb0a6f4cAe4618aD62622b39DbF);</span></span>
<span id="L302"><span class="lineNum"> 302</span> <span class="tlaGNC"> 4 : _percents[2] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></span> <span id="L302"><span class="lineNum"> 302</span> <span class="tlaGNC"> 12 : _addresses[3] = ITornadoInstance(0xA160cdAB225685dA1d56aa342Ad8841c3b53f291);</span></span>
<span id="L303"><span class="lineNum"> 303</span> <span class="tlaGNC"> 4 : _percents[3] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></span> <span id="L303"><span class="lineNum"> 303</span> : </span>
<span id="L304"><span class="lineNum"> 304</span> : </span> <span id="L304"><span class="lineNum"> 304</span> : /* DAI instances */</span>
<span id="L305"><span class="lineNum"> 305</span> : /* DAI instances */</span> <span id="L305"><span class="lineNum"> 305</span> <span class="tlaGNC"> 12 : _addresses[4] = ITornadoInstance(0xD4B88Df4D29F5CedD6857912842cff3b20C8Cfa3);</span></span>
<span id="L306"><span class="lineNum"> 306</span> <span class="tlaGNC"> 4 : _percents[4] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></span> <span id="L306"><span class="lineNum"> 306</span> <span class="tlaGNC"> 12 : _addresses[5] = ITornadoInstance(0xFD8610d20aA15b7B2E3Be39B396a1bC3516c7144);</span></span>
<span id="L307"><span class="lineNum"> 307</span> <span class="tlaGNC"> 4 : _percents[5] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></span> <span id="L307"><span class="lineNum"> 307</span> <span class="tlaGNC"> 12 : _addresses[6] = ITornadoInstance(0x07687e702b410Fa43f4cB4Af7FA097918ffD2730);</span></span>
<span id="L308"><span class="lineNum"> 308</span> <span class="tlaGNC"> 4 : _percents[6] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></span> <span id="L308"><span class="lineNum"> 308</span> <span class="tlaGNC"> 12 : _addresses[7] = ITornadoInstance(0x23773E65ed146A459791799d01336DB287f25334);</span></span>
<span id="L309"><span class="lineNum"> 309</span> <span class="tlaGNC"> 4 : _percents[7] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></span> <span id="L309"><span class="lineNum"> 309</span> : </span>
<span id="L310"><span class="lineNum"> 310</span> : </span> <span id="L310"><span class="lineNum"> 310</span> : /* cDAI instances */</span>
<span id="L311"><span class="lineNum"> 311</span> : /* cDAI instances */</span> <span id="L311"><span class="lineNum"> 311</span> <span class="tlaGNC"> 12 : _addresses[8] = ITornadoInstance(0x22aaA7720ddd5388A3c0A3333430953C68f1849b);</span></span>
<span id="L312"><span class="lineNum"> 312</span> <span class="tlaGNC"> 4 : _percents[8] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></span> <span id="L312"><span class="lineNum"> 312</span> <span class="tlaGNC"> 12 : _addresses[9] = ITornadoInstance(0x03893a7c7463AE47D46bc7f091665f1893656003);</span></span>
<span id="L313"><span class="lineNum"> 313</span> <span class="tlaGNC"> 4 : _percents[9] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></span> <span id="L313"><span class="lineNum"> 313</span> <span class="tlaGNC"> 12 : _addresses[10] = ITornadoInstance(0x2717c5e28cf931547B621a5dddb772Ab6A35B701);</span></span>
<span id="L314"><span class="lineNum"> 314</span> <span class="tlaGNC"> 4 : _percents[10] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></span> <span id="L314"><span class="lineNum"> 314</span> <span class="tlaGNC"> 12 : _addresses[11] = ITornadoInstance(0xD21be7248e0197Ee08E0c20D4a96DEBdaC3D20Af);</span></span>
<span id="L315"><span class="lineNum"> 315</span> <span class="tlaGNC"> 4 : _percents[11] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></span> <span id="L315"><span class="lineNum"> 315</span> : </span>
<span id="L316"><span class="lineNum"> 316</span> : </span> <span id="L316"><span class="lineNum"> 316</span> : /* USDT instances */</span>
<span id="L317"><span class="lineNum"> 317</span> : /* USDT instances */</span> <span id="L317"><span class="lineNum"> 317</span> <span class="tlaGNC"> 12 : _addresses[12] = ITornadoInstance(0x169AD27A470D064DEDE56a2D3ff727986b15D52B);</span></span>
<span id="L318"><span class="lineNum"> 318</span> <span class="tlaGNC"> 4 : _percents[12] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></span> <span id="L318"><span class="lineNum"> 318</span> <span class="tlaGNC"> 12 : _addresses[13] = ITornadoInstance(0x0836222F2B2B24A3F36f98668Ed8F0B38D1a872f);</span></span>
<span id="L319"><span class="lineNum"> 319</span> <span class="tlaGNC"> 4 : _percents[13] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></span> <span id="L319"><span class="lineNum"> 319</span> : </span>
<span id="L320"><span class="lineNum"> 320</span> : </span> <span id="L320"><span class="lineNum"> 320</span> : /* WBTC instances */</span>
<span id="L321"><span class="lineNum"> 321</span> : /* WBTC instances */</span> <span id="L321"><span class="lineNum"> 321</span> <span class="tlaGNC"> 12 : _addresses[14] = ITornadoInstance(0x178169B423a011fff22B9e3F3abeA13414dDD0F1);</span></span>
<span id="L322"><span class="lineNum"> 322</span> <span class="tlaGNC"> 4 : _percents[14] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></span> <span id="L322"><span class="lineNum"> 322</span> <span class="tlaGNC"> 12 : _addresses[15] = ITornadoInstance(0x610B717796ad172B316836AC95a2ffad065CeaB4);</span></span>
<span id="L323"><span class="lineNum"> 323</span> <span class="tlaGNC"> 4 : _percents[15] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></span> <span id="L323"><span class="lineNum"> 323</span> <span class="tlaGNC"> 12 : _addresses[16] = ITornadoInstance(0xbB93e510BbCD0B7beb5A853875f9eC60275CF498);</span></span>
<span id="L324"><span class="lineNum"> 324</span> <span class="tlaGNC"> 4 : _percents[16] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></span> <span id="L324"><span class="lineNum"> 324</span> : }</span>
<span id="L325"><span class="lineNum"> 325</span> : }</span> <span id="L325"><span class="lineNum"> 325</span> : </span>
<span id="L326"><span class="lineNum"> 326</span> : }</span> <span id="L326"><span class="lineNum"> 326</span> <span class="tlaGNC"> 4 : function _getAllInstanceFeePercents() internal pure returns (uint256[] memory _percents) {</span></span>
<span id="L327"><span class="lineNum"> 327</span> <span class="tlaGNC"> 4 : _percents = new uint256[](17);</span></span>
<span id="L328"><span class="lineNum"> 328</span> : </span>
<span id="L329"><span class="lineNum"> 329</span> : /* ETH instances */</span>
<span id="L330"><span class="lineNum"> 330</span> <span class="tlaGNC"> 4 : _percents[0] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></span>
<span id="L331"><span class="lineNum"> 331</span> <span class="tlaGNC"> 4 : _percents[1] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></span>
<span id="L332"><span class="lineNum"> 332</span> <span class="tlaGNC"> 4 : _percents[2] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></span>
<span id="L333"><span class="lineNum"> 333</span> <span class="tlaGNC"> 4 : _percents[3] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></span>
<span id="L334"><span class="lineNum"> 334</span> : </span>
<span id="L335"><span class="lineNum"> 335</span> : /* DAI instances */</span>
<span id="L336"><span class="lineNum"> 336</span> <span class="tlaGNC"> 4 : _percents[4] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></span>
<span id="L337"><span class="lineNum"> 337</span> <span class="tlaGNC"> 4 : _percents[5] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></span>
<span id="L338"><span class="lineNum"> 338</span> <span class="tlaGNC"> 4 : _percents[6] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></span>
<span id="L339"><span class="lineNum"> 339</span> <span class="tlaGNC"> 4 : _percents[7] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></span>
<span id="L340"><span class="lineNum"> 340</span> : </span>
<span id="L341"><span class="lineNum"> 341</span> : /* cDAI instances */</span>
<span id="L342"><span class="lineNum"> 342</span> <span class="tlaGNC"> 4 : _percents[8] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></span>
<span id="L343"><span class="lineNum"> 343</span> <span class="tlaGNC"> 4 : _percents[9] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></span>
<span id="L344"><span class="lineNum"> 344</span> <span class="tlaGNC"> 4 : _percents[10] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></span>
<span id="L345"><span class="lineNum"> 345</span> <span class="tlaGNC"> 4 : _percents[11] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></span>
<span id="L346"><span class="lineNum"> 346</span> : </span>
<span id="L347"><span class="lineNum"> 347</span> : /* USDT instances */</span>
<span id="L348"><span class="lineNum"> 348</span> <span class="tlaGNC"> 4 : _percents[12] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></span>
<span id="L349"><span class="lineNum"> 349</span> <span class="tlaGNC"> 4 : _percents[13] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></span>
<span id="L350"><span class="lineNum"> 350</span> : </span>
<span id="L351"><span class="lineNum"> 351</span> : /* WBTC instances */</span>
<span id="L352"><span class="lineNum"> 352</span> <span class="tlaGNC"> 4 : _percents[14] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></span>
<span id="L353"><span class="lineNum"> 353</span> <span class="tlaGNC"> 4 : _percents[15] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></span>
<span id="L354"><span class="lineNum"> 354</span> <span class="tlaGNC"> 4 : _percents[16] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></span>
<span id="L355"><span class="lineNum"> 355</span> : }</span>
<span id="L356"><span class="lineNum"> 356</span> : }</span>
</pre> </pre>
</td> </td>
</tr> </tr>

@ -32,8 +32,8 @@
<td></td> <td></td>
<td class="headerItem">Lines:</td> <td class="headerItem">Lines:</td>
<td class="headerCovTableEntryHi">100.0&nbsp;%</td> <td class="headerCovTableEntryHi">100.0&nbsp;%</td>
<td class="headerCovTableEntry">125</td> <td class="headerCovTableEntry">126</td>
<td class="headerCovTableEntry">125</td> <td class="headerCovTableEntry">126</td>
</tr> </tr>
<tr> <tr>
<td class="headerItem">Test Date:</td> <td class="headerItem">Test Date:</td>
@ -106,8 +106,8 @@
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="../../../../emerald.png" width=100 height=10 alt="100.0%"></td></tr></table> <table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="../../../../emerald.png" width=100 height=10 alt="100.0%"></td></tr></table>
</td> </td>
<td class="coverPerHi">100.0&nbsp;%</td> <td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumDflt">74</td> <td class="coverNumDflt">75</td>
<td class="coverNumDflt">74</td> <td class="coverNumDflt">75</td>
<td class="coverPerHi">100.0&nbsp;%</td> <td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumDflt">4</td> <td class="coverNumDflt">4</td>
<td class="coverNumDflt">4</td> <td class="coverNumDflt">4</td>

@ -32,8 +32,8 @@
<td></td> <td></td>
<td class="headerItem">Lines:</td> <td class="headerItem">Lines:</td>
<td class="headerCovTableEntryHi">100.0&nbsp;%</td> <td class="headerCovTableEntryHi">100.0&nbsp;%</td>
<td class="headerCovTableEntry">125</td> <td class="headerCovTableEntry">126</td>
<td class="headerCovTableEntry">125</td> <td class="headerCovTableEntry">126</td>
</tr> </tr>
<tr> <tr>
<td class="headerItem">Test Date:</td> <td class="headerItem">Test Date:</td>
@ -106,8 +106,8 @@
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="../../../../emerald.png" width=100 height=10 alt="100.0%"></td></tr></table> <table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="../../../../emerald.png" width=100 height=10 alt="100.0%"></td></tr></table>
</td> </td>
<td class="coverPerHi">100.0&nbsp;%</td> <td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumDflt">74</td> <td class="coverNumDflt">75</td>
<td class="coverNumDflt">74</td> <td class="coverNumDflt">75</td>
<td class="coverPerHi">100.0&nbsp;%</td> <td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumDflt">4</td> <td class="coverNumDflt">4</td>
<td class="coverNumDflt">4</td> <td class="coverNumDflt">4</td>

@ -32,8 +32,8 @@
<td></td> <td></td>
<td class="headerItem">Lines:</td> <td class="headerItem">Lines:</td>
<td class="headerCovTableEntryHi">100.0&nbsp;%</td> <td class="headerCovTableEntryHi">100.0&nbsp;%</td>
<td class="headerCovTableEntry">125</td> <td class="headerCovTableEntry">126</td>
<td class="headerCovTableEntry">125</td> <td class="headerCovTableEntry">126</td>
</tr> </tr>
<tr> <tr>
<td class="headerItem">Test Date:</td> <td class="headerItem">Test Date:</td>
@ -106,8 +106,8 @@
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="../../../../emerald.png" width=100 height=10 alt="100.0%"></td></tr></table> <table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="../../../../emerald.png" width=100 height=10 alt="100.0%"></td></tr></table>
</td> </td>
<td class="coverPerHi">100.0&nbsp;%</td> <td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumDflt">74</td> <td class="coverNumDflt">75</td>
<td class="coverNumDflt">74</td> <td class="coverNumDflt">75</td>
<td class="coverPerHi">100.0&nbsp;%</td> <td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumDflt">4</td> <td class="coverNumDflt">4</td>
<td class="coverNumDflt">4</td> <td class="coverNumDflt">4</td>

@ -32,8 +32,8 @@
<td></td> <td></td>
<td class="headerItem">Lines:</td> <td class="headerItem">Lines:</td>
<td class="headerCovTableEntryHi">100.0&nbsp;%</td> <td class="headerCovTableEntryHi">100.0&nbsp;%</td>
<td class="headerCovTableEntry">125</td> <td class="headerCovTableEntry">126</td>
<td class="headerCovTableEntry">125</td> <td class="headerCovTableEntry">126</td>
</tr> </tr>
<tr> <tr>
<td class="headerItem">Test Date:</td> <td class="headerItem">Test Date:</td>
@ -106,8 +106,8 @@
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="../../../../emerald.png" width=100 height=10 alt="100.0%"></td></tr></table> <table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="../../../../emerald.png" width=100 height=10 alt="100.0%"></td></tr></table>
</td> </td>
<td class="coverPerHi">100.0&nbsp;%</td> <td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumDflt">74</td> <td class="coverNumDflt">75</td>
<td class="coverNumDflt">74</td> <td class="coverNumDflt">75</td>
<td class="coverPerHi">100.0&nbsp;%</td> <td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumDflt">4</td> <td class="coverNumDflt">4</td>
<td class="coverNumDflt">4</td> <td class="coverNumDflt">4</td>

@ -32,8 +32,8 @@
<td></td> <td></td>
<td class="headerItem">Lines:</td> <td class="headerItem">Lines:</td>
<td class="headerCovTableEntryHi">100.0&nbsp;%</td> <td class="headerCovTableEntryHi">100.0&nbsp;%</td>
<td class="headerCovTableEntry">125</td> <td class="headerCovTableEntry">126</td>
<td class="headerCovTableEntry">125</td> <td class="headerCovTableEntry">126</td>
</tr> </tr>
<tr> <tr>
<td class="headerItem">Test Date:</td> <td class="headerItem">Test Date:</td>
@ -106,8 +106,8 @@
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="../../../../emerald.png" width=100 height=10 alt="100.0%"></td></tr></table> <table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="../../../../emerald.png" width=100 height=10 alt="100.0%"></td></tr></table>
</td> </td>
<td class="coverPerHi">100.0&nbsp;%</td> <td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumDflt">74</td> <td class="coverNumDflt">75</td>
<td class="coverNumDflt">74</td> <td class="coverNumDflt">75</td>
<td class="coverPerHi">100.0&nbsp;%</td> <td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumDflt">4</td> <td class="coverNumDflt">4</td>
<td class="coverNumDflt">4</td> <td class="coverNumDflt">4</td>

@ -32,8 +32,8 @@
<td></td> <td></td>
<td class="headerItem">Lines:</td> <td class="headerItem">Lines:</td>
<td class="headerCovTableEntryHi">100.0&nbsp;%</td> <td class="headerCovTableEntryHi">100.0&nbsp;%</td>
<td class="headerCovTableEntry">125</td> <td class="headerCovTableEntry">126</td>
<td class="headerCovTableEntry">125</td> <td class="headerCovTableEntry">126</td>
</tr> </tr>
<tr> <tr>
<td class="headerItem">Test Date:</td> <td class="headerItem">Test Date:</td>
@ -106,8 +106,8 @@
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="../../../../emerald.png" width=100 height=10 alt="100.0%"></td></tr></table> <table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="../../../../emerald.png" width=100 height=10 alt="100.0%"></td></tr></table>
</td> </td>
<td class="coverPerHi">100.0&nbsp;%</td> <td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumDflt">74</td> <td class="coverNumDflt">75</td>
<td class="coverNumDflt">74</td> <td class="coverNumDflt">75</td>
<td class="coverPerHi">100.0&nbsp;%</td> <td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumDflt">4</td> <td class="coverNumDflt">4</td>
<td class="coverNumDflt">4</td> <td class="coverNumDflt">4</td>

@ -71,7 +71,7 @@
</tr> </tr>
<tr> <tr>
<td class="coverFn"><a href="ProposalTests.sol.gcov.html#L1135">MinimumStakeOracle.setAmount</a></td> <td class="coverFn"><a href="ProposalTests.sol.gcov.html#L1157">MinimumStakeOracle.setAmount</a></td>
<td class="coverFnHi">1</td> <td class="coverFnHi">1</td>

@ -71,7 +71,7 @@
</tr> </tr>
<tr> <tr>
<td class="coverFn"><a href="ProposalTests.sol.gcov.html#L1135">MinimumStakeOracle.setAmount</a></td> <td class="coverFn"><a href="ProposalTests.sol.gcov.html#L1157">MinimumStakeOracle.setAmount</a></td>
<td class="coverFnHi">1</td> <td class="coverFnHi">1</td>

File diff suppressed because it is too large Load Diff

@ -1,50 +1,51 @@
| src/proposals/InfrastructureUpgradeProposal.sol:InfrastructureUpgradeProposal contract | | | | | | | src/proposals/InfrastructureUpgradeProposal.sol:InfrastructureUpgradeProposal contract | | | | | |
| -------------------------------------------------------------------------------------- | --------------- | ------- | ------- | ------- | ------- | | -------------------------------------------------------------------------------------- | --------------- | ------- | ------- | ------- | ------- |
| Deployment Cost | Deployment Size | | | | | | Deployment Cost | Deployment Size | | | | |
| 1306271 | 7130 | | | | | | 1429801 | 7747 | | | | |
| Function Name | min | avg | median | max | # calls | | Function Name | min | avg | median | max | # calls |
| executeProposal | 2828741 | 2828741 | 2828741 | 2828741 | 4 | | NEW_CONTENT_HASH | 799 | 799 | 799 | 799 | 4 |
| executeProposal | 2853026 | 2853026 | 2853026 | 2853026 | 4 |
| src/v2/CurveFeeOracle.sol:CurveFeeOracle contract | | | | | | | src/v2/CurveFeeOracle.sol:CurveFeeOracle contract | | | | | |
| ------------------------------------------------- | --------------- | ----- | ------ | ------ | ------- | | ------------------------------------------------- | --------------- | ----- | ------ | ------ | ------- |
| Deployment Cost | Deployment Size | | | | | | Deployment Cost | Deployment Size | | | | |
| 1206832 | 6127 | | | | | | 1208839 | 6137 | | | | |
| Function Name | min | avg | median | max | # calls | | Function Name | min | avg | median | max | # calls |
| getChainedOracleHashForInstance | 1332 | 1332 | 1332 | 1332 | 1 | | getChainedOracleHashForInstance | 1332 | 1332 | 1332 | 1332 | 1 |
| getChainedOracleNameForInstance | 2308 | 2308 | 2308 | 2308 | 1 | | getChainedOracleNameForInstance | 2308 | 2308 | 2308 | 2308 | 1 |
| getChainedOracleNameForOracleHash | 1324 | 1324 | 1324 | 1324 | 1 | | getChainedOracleNameForOracleHash | 1324 | 1324 | 1324 | 1324 | 1 |
| getFee | 1949 | 14611 | 15583 | 24038 | 26 | | getFee | 1978 | 14640 | 15612 | 24067 | 26 |
| modifyChainedOracleForInstance | 74546 | 95310 | 83150 | 133973 | 12 | | modifyChainedOracleForInstance | 74546 | 95310 | 83150 | 133973 | 12 |
| setTornOracleIsUniswap | 1122 | 2394 | 1122 | 6212 | 4 | | setTornOracleIsUniswap | 1122 | 2394 | 1122 | 6212 | 4 |
| setUniswapFeeOracle | 1841 | 8918 | 3841 | 21741 | 9 | | setUniswapFeeOracle | 1841 | 8918 | 3841 | 21741 | 9 |
| update | 1885 | 1885 | 1885 | 1885 | 32 | | update | 1914 | 1914 | 1914 | 1914 | 32 |
| src/v2/FeeOracleManager.sol:FeeOracleManager contract | | | | | | | src/v2/FeeOracleManager.sol:FeeOracleManager contract | | | | | |
| ----------------------------------------------------- | --------------- | ------ | ------ | ------ | ------- | | ----------------------------------------------------- | --------------- | ------ | ------ | ------ | ------- |
| Deployment Cost | Deployment Size | | | | | | Deployment Cost | Deployment Size | | | | |
| 1672077 | 8685 | | | | | | 1668677 | 8668 | | | | |
| Function Name | min | avg | median | max | # calls | | Function Name | min | avg | median | max | # calls |
| feeUpdaterAddress | 535 | 535 | 535 | 535 | 2 | | feeUpdaterAddress | 535 | 535 | 535 | 535 | 2 |
| getAllFeeDeviations | 240834 | 240834 | 240834 | 240834 | 1 | | getAllFeeDeviations | 241327 | 241327 | 241327 | 241327 | 1 |
| getFeeDeviationsForInstances | 13431 | 13431 | 13431 | 13431 | 1 | | getFeeDeviationsForInstances | 13460 | 13460 | 13460 | 13460 | 1 |
| getFeePercentForInstance | 1127 | 1127 | 1127 | 1127 | 1 | | getFeePercentForInstance | 1127 | 1127 | 1127 | 1127 | 1 |
| getFeeUpdateIntervalForInstance | 1083 | 1083 | 1083 | 1083 | 1 | | getFeeUpdateIntervalForInstance | 1083 | 1083 | 1083 | 1083 | 1 |
| getLastFeeForInstance | 1103 | 1103 | 1103 | 1103 | 18 | | getLastFeeForInstance | 1103 | 1103 | 1103 | 1103 | 18 |
| getLastUpdatedTimeForInstance | 599 | 599 | 599 | 599 | 3 | | getLastUpdatedTimeForInstance | 599 | 599 | 599 | 599 | 3 |
| getUpdatedFeeForInstance | 12536 | 12536 | 12536 | 12536 | 1 | | getUpdatedFeeForInstance | 12565 | 12565 | 12565 | 12565 | 1 |
| initialize | 2783 | 594459 | 890194 | 890194 | 6 | | initialize | 2783 | 594459 | 890194 | 890194 | 6 |
| instanceFeeOracles | 852 | 852 | 852 | 852 | 1 | | instanceFeeOracles | 852 | 852 | 852 | 852 | 1 |
| populateInstanceWithFeeData | 6363 | 6363 | 6363 | 6363 | 7 | | populateInstanceWithFeeData | 6363 | 6363 | 6363 | 6363 | 7 |
| setFeeOracle | 919 | 42914 | 42340 | 62458 | 13 | | setFeeOracle | 919 | 42963 | 42398 | 62516 | 13 |
| setFeePercentForInstance | 979 | 11832 | 4651 | 24551 | 15 | | setFeePercentForInstance | 944 | 11797 | 4616 | 24516 | 15 |
| setFeeUpdateIntervalForInstance | 570 | 7890 | 1867 | 21767 | 13 | | setFeeUpdateIntervalForInstance | 570 | 7890 | 1867 | 21767 | 13 |
| setFeeUpdater | 1937 | 1937 | 1937 | 1937 | 8 | | setFeeUpdater | 1937 | 1937 | 1937 | 1937 | 8 |
| setInstanceRegistry | 928 | 1538 | 1538 | 2149 | 2 | | setInstanceRegistry | 928 | 1538 | 1538 | 2149 | 2 |
| updateAllFees | 249090 | 340270 | 320748 | 450973 | 3 | | updateAllFees | 249612 | 341005 | 321473 | 451930 | 3 |
| updateFee | 672 | 21023 | 20343 | 84449 | 25 | | updateFee | 672 | 21061 | 20401 | 84507 | 25 |
| updateFees | 62279 | 84912 | 84912 | 107546 | 2 | | updateFees | 62424 | 85101 | 85101 | 107778 | 2 |
| version | 694 | 694 | 694 | 694 | 1 | | version | 694 | 694 | 694 | 694 | 1 |
@ -56,7 +57,7 @@
| addInstance | 44266 | 81412 | 84867 | 89867 | 12 | | addInstance | 44266 | 81412 | 84867 | 89867 | 12 |
| getAllInstanceStates | 29407 | 29407 | 29407 | 29407 | 1 | | getAllInstanceStates | 29407 | 29407 | 29407 | 29407 | 1 |
| getAllInstances | 10916 | 11649 | 10916 | 13848 | 4 | | getAllInstances | 10916 | 11649 | 10916 | 13848 | 4 |
| getInstanceByENSName | 23933 | 23933 | 23933 | 23933 | 1 | | getInstanceByENSName | 18933 | 18933 | 18933 | 18933 | 1 |
| getInstanceIndex | 689 | 689 | 689 | 689 | 1 | | getInstanceIndex | 689 | 689 | 689 | 689 | 1 |
| getInstanceState | 1689 | 1689 | 1689 | 1689 | 126 | | getInstanceState | 1689 | 1689 | 1689 | 1689 | 126 |
| getInstanceStateByIndex | 1824 | 1824 | 1824 | 1824 | 2 | | getInstanceStateByIndex | 1824 | 1824 | 1824 | 1824 | 2 |
@ -117,7 +118,7 @@
| setInstanceRegistry | 728 | 1354 | 1354 | 1981 | 2 | | setInstanceRegistry | 728 | 1354 | 1354 | 1981 | 2 |
| setStakingRewards | 684 | 1306 | 1306 | 1929 | 2 | | setStakingRewards | 684 | 1306 | 1306 | 1929 | 2 |
| version | 670 | 670 | 670 | 670 | 2 | | version | 670 | 670 | 670 | 670 | 2 |
| withdraw | 96306 | 261993 | 261993 | 427681 | 2 | | withdraw | 96364 | 262051 | 262051 | 427739 | 2 |
| src/v2/TornadoStakingRewards.sol:TornadoStakingRewards contract | | | | | | | src/v2/TornadoStakingRewards.sol:TornadoStakingRewards contract | | | | | |
@ -132,17 +133,17 @@
| src/v2/UniswapFeeOracle.sol:UniswapFeeOracle contract | | | | | | | src/v2/UniswapFeeOracle.sol:UniswapFeeOracle contract | | | | | |
| ----------------------------------------------------- | --------------- | ----- | ------ | ----- | ------- | | ----------------------------------------------------- | --------------- | ----- | ------ | ----- | ------- |
| Deployment Cost | Deployment Size | | | | | | Deployment Cost | Deployment Size | | | | |
| 1591572 | 8800 | | | | | | 1593572 | 8810 | | | | |
| Function Name | min | avg | median | max | # calls | | Function Name | min | avg | median | max | # calls |
| getAverageTORNPerETH | 754 | 754 | 754 | 754 | 1 | | getAverageTORNPerETH | 754 | 754 | 754 | 754 | 1 |
| getFee | 1971 | 10379 | 7508 | 24829 | 51 | | getFee | 2000 | 10408 | 7537 | 24858 | 51 |
| getLastUpdatedTime | 544 | 544 | 544 | 544 | 1 | | getLastUpdatedTime | 544 | 544 | 544 | 544 | 1 |
| getTORNPerToken | 2248 | 3057 | 2248 | 8748 | 21 | | getTORNPerToken | 2248 | 3057 | 2248 | 8748 | 21 |
| getTWAPData | 745 | 745 | 745 | 745 | 1 | | getTWAPData | 745 | 745 | 745 | 745 | 1 |
| setFeeOracleManagerAddress | 466 | 1076 | 1076 | 1687 | 2 | | setFeeOracleManagerAddress | 466 | 1076 | 1076 | 1687 | 2 |
| setMinObservationCardinality | 740 | 14601 | 23825 | 23825 | 12 | | setMinObservationCardinality | 740 | 14601 | 23825 | 23825 | 12 |
| setPoolFeeForToken | 768 | 11497 | 5795 | 36695 | 72 | | setPoolFeeForToken | 768 | 11497 | 5795 | 36695 | 72 |
| update | 2214 | 5695 | 2297 | 49033 | 67 | | update | 2243 | 5724 | 2326 | 49062 | 67 |
| test/ProposalTests.sol:MinimumStakeOracle contract | | | | | | | test/ProposalTests.sol:MinimumStakeOracle contract | | | | | |

@ -14,6 +14,8 @@ import { ITornadoInstance } from "tornado-anonymity-mining/contracts/interfaces/
// Local imports // Local imports
import { IENS } from "../v2/interfaces/IENS.sol";
import { RelayerRegistry } from "../v2/RelayerRegistry.sol"; import { RelayerRegistry } from "../v2/RelayerRegistry.sol";
import { FeeOracleManager } from "../v2/FeeOracleManager.sol"; import { FeeOracleManager } from "../v2/FeeOracleManager.sol";
@ -31,7 +33,28 @@ import { TornadoRouter } from "../v2/TornadoRouter.sol";
* registry such that multiple oracles can be used and so the DAO can add more instances. * registry such that multiple oracles can be used and so the DAO can add more instances.
*/ */
contract InfrastructureUpgradeProposal { contract InfrastructureUpgradeProposal {
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ADDRESSES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOR ENS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/**
* @notice Namehash of `tornadocash.eth`
*/
bytes32 public constant ENS_PARENT_NODE =
0xe6ae31d630cc7a8279c0f1c7cbe6e7064814c47d1785fa2703d9ae511ee2be0c;
/**
* @notice This should be the content hash which is going to be set for the above node
* @dev Prefix is "e30101701220", after this v1 CID hash should be appended, see:
* https://docs.ens.domains/contract-api-reference/publicresolver#set-content-hash
* https://eips.ethereum.org/EIPS/eip-1577
*/
bytes public constant NEW_CONTENT_HASH = hex"e30101701220";
/**
* @notice ENS on Mainnet
*/
IENS public constant ens = IENS(0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e);
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INFRA ADDRESSES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/** /**
* @notice The address of the current FeeManager proxy, future FeeOracleManager * @notice The address of the current FeeManager proxy, future FeeOracleManager
@ -221,6 +244,13 @@ contract InfrastructureUpgradeProposal {
_setAllInstancePoolFeesInOracle(uniswapFeeOracle); _setAllInstancePoolFeesInOracle(uniswapFeeOracle);
uniswapFeeOracle.setMinObservationCardinality(10); // Now set the cardinality to a reasonable value uniswapFeeOracle.setMinObservationCardinality(10); // Now set the cardinality to a reasonable value
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ SET FRONTEND CONTENT HASH ~~~~~~~~~~~~~~~~~~~~~~~~~ */
// Updating the content hash via ENS allows the users to find via stuff like IPNS CIDs of legitimate
// data or apps. We are updating the frontend to support the former changes.
ens.resolver(ENS_PARENT_NODE).setContenthash(ENS_PARENT_NODE, NEW_CONTENT_HASH);
} }
function _setAllInstancePoolFeesInOracle(UniswapFeeOracle _uniswapFeeOracle) internal { function _setAllInstancePoolFeesInOracle(UniswapFeeOracle _uniswapFeeOracle) internal {

@ -3,6 +3,12 @@
pragma solidity ^0.6.12; pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
// Local imports
import { IENSResolver } from "./IENSResolver.sol";
interface IENS { interface IENS {
function setOwner(bytes32 node, address owner) external;
function owner(bytes32 node) external view returns (address); function owner(bytes32 node) external view returns (address);
function resolver(bytes32 node) external view returns (IENSResolver);
} }

@ -0,0 +1,12 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
// Local imports
interface IENSResolver {
function setContenthash(bytes32 node, bytes calldata hash) external;
function addr(bytes32 node) external view returns (address);
function contenthash(bytes32 node) external view returns (bytes memory);
}

@ -17,6 +17,8 @@ import { ITornadoInstance } from "tornado-anonymity-mining/contracts/interfaces/
// Local imports // Local imports
import { IENS } from "src/v2/interfaces/IENS.sol";
import { IUniswapV2Pair } from "src/v2/interfaces/IUniswapV2Pair.sol"; import { IUniswapV2Pair } from "src/v2/interfaces/IUniswapV2Pair.sol";
import { UniswapFeeOracle } from "src/v2/UniswapFeeOracle.sol"; import { UniswapFeeOracle } from "src/v2/UniswapFeeOracle.sol";
@ -43,11 +45,6 @@ interface IWethDepositable {
function deposit() external payable; function deposit() external payable;
} }
interface IENS {
function setOwner(bytes32 node, address owner) external;
function owner(bytes32 node) external view returns (address);
}
contract Instances { contract Instances {
/* ETH instances */ /* ETH instances */
ITornadoInstance public constant eth01 = ITornadoInstance(0x12D66f87A04A9E220743712cE6d9bB1B5616B8Fc); ITornadoInstance public constant eth01 = ITornadoInstance(0x12D66f87A04A9E220743712cE6d9bB1B5616B8Fc);
@ -92,6 +89,9 @@ contract ProposalTests is Instances, TornadoProposalTest {
// Constant vars // Constant vars
bytes32 public constant ENS_PARENT_NODE =
0xe6ae31d630cc7a8279c0f1c7cbe6e7064814c47d1785fa2703d9ae511ee2be0c;
IENS public constant ENS = IENS(0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e); IENS public constant ENS = IENS(0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e);
FeeOracleManager public constant feeOracleManager = FeeOracleManager public constant feeOracleManager =
@ -109,6 +109,10 @@ contract ProposalTests is Instances, TornadoProposalTest {
address payable public constant relayerRegistryProxyAddress = 0x58E8dCC13BE9780fC42E8723D8EaD4CF46943dF2; address payable public constant relayerRegistryProxyAddress = 0x58E8dCC13BE9780fC42E8723D8EaD4CF46943dF2;
// Assigned
bytes assignedContentHash;
// Implementations // Implementations
InstanceRegistry implInstanceRegistry; InstanceRegistry implInstanceRegistry;
@ -171,6 +175,9 @@ contract ProposalTests is Instances, TornadoProposalTest {
// Registry should be able to resolve wrapped names // Registry should be able to resolve wrapped names
_registryShouldResolveWrappedENSNames(); _registryShouldResolveWrappedENSNames();
// The new content hash should be set properly
_newContentHashShouldBeSet();
// Test router deposits and withdrawals // Test router deposits and withdrawals
_shouldBeAbleToDepositAndWithdrawFromRouter(); _shouldBeAbleToDepositAndWithdrawFromRouter();
@ -458,6 +465,9 @@ contract ProposalTests is Instances, TornadoProposalTest {
// Exec // Exec
governance.execute(id); governance.execute(id);
// Store value
assignedContentHash = InfrastructureUpgradeProposal(proposal).NEW_CONTENT_HASH();
} }
function _contractsNotReinitializable() internal { function _contractsNotReinitializable() internal {
@ -589,6 +599,18 @@ contract ProposalTests is Instances, TornadoProposalTest {
); );
} }
function _newContentHashShouldBeSet() internal view {
bytes memory _hash = assignedContentHash;
bytes memory _assigned = ENS.resolver(ENS_PARENT_NODE).contenthash(ENS_PARENT_NODE);
for (uint256 i = 0; i < _hash.length; i++) {
if (_assigned[i] != _hash[i]) {
console2.log("\n Content hash failed at: ", i, "\n");
require(false, "content hash");
}
}
}
function _relayerRegistyProxyAdminSlotShouldBeDead() internal view { function _relayerRegistyProxyAdminSlotShouldBeDead() internal view {
require( require(
address( address(