make updating fees safer, trash gas reports because foundry issues

Signed-off-by: AlienTornadosaurusHex <>
This commit is contained in:
AlienTornadosaurusHex 2023-06-17 20:08:51 +00:00
parent 7944afc94f
commit dd4de78165
150 changed files with 987 additions and 1026 deletions

@ -5,7 +5,6 @@ The `relayer-registry` infra repository.
* [Latest Contracts](./src/v2/)
* [Contract Tests](./test/)
* [Test Coverage](./coverage/)
* [Gas Usage](./gas/)
* [Storage Layout](./storage/)
* [Deployment Scripts](./script/)

@ -31,18 +31,18 @@
<td class="headerValue">lcov.info</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">296</td>
<td class="headerCovTableEntry">614</td>
<td class="headerCovTableEntryLo">48.2 %</td>
<td class="headerCovTableEntry">298</td>
<td class="headerCovTableEntry">616</td>
<td class="headerCovTableEntryLo">48.4 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">61</td>
<td class="headerCovTableEntry">157</td>
<td class="headerCovTableEntryLo">38.9 %</td>
<td class="headerCovTableEntry">62</td>
<td class="headerCovTableEntry">158</td>
<td class="headerCovTableEntryLo">39.2 %</td>
</tr>
<tr>
<td class="headerItem">Legend:</td>
@ -88,16 +88,6 @@
<td class="coverPerLo">0.0&nbsp;%</td>
<td class="coverNumLo">0 / 1</td>
</tr>
<tr>
<td class="coverFile"><a href="src/v1/utils/index.html">src/v1/utils</a></td>
<td class="coverBar" align="center">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="snow.png" width=100 height=10 alt="0.0%"></td></tr></table>
</td>
<td class="coverPerLo">0.0&nbsp;%</td>
<td class="coverNumLo">0 / 10</td>
<td class="coverPerLo">0.0&nbsp;%</td>
<td class="coverNumLo">0 / 3</td>
</tr>
<tr>
<td class="coverFile"><a href="src/base/index.html">src/base</a></td>
<td class="coverBar" align="center">
@ -108,6 +98,16 @@
<td class="coverPerLo">0.0&nbsp;%</td>
<td class="coverNumLo">0 / 3</td>
</tr>
<tr>
<td class="coverFile"><a href="src/v1/utils/index.html">src/v1/utils</a></td>
<td class="coverBar" align="center">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="snow.png" width=100 height=10 alt="0.0%"></td></tr></table>
</td>
<td class="coverPerLo">0.0&nbsp;%</td>
<td class="coverNumLo">0 / 10</td>
<td class="coverPerLo">0.0&nbsp;%</td>
<td class="coverNumLo">0 / 3</td>
</tr>
<tr>
<td class="coverFile"><a href="src/v1/libraries/index.html">src/v1/libraries</a></td>
<td class="coverBar" align="center">
@ -118,6 +118,16 @@
<td class="coverPerLo">0.0&nbsp;%</td>
<td class="coverNumLo">0 / 4</td>
</tr>
<tr>
<td class="coverFile"><a href="src/common/index.html">src/common</a></td>
<td class="coverBar" align="center">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="snow.png" width=100 height=10 alt="0.0%"></td></tr></table>
</td>
<td class="coverPerLo">0.0&nbsp;%</td>
<td class="coverNumLo">0 / 6</td>
<td class="coverPerLo">0.0&nbsp;%</td>
<td class="coverNumLo">0 / 6</td>
</tr>
<tr>
<td class="coverFile"><a href="test/index.html">test</a></td>
<td class="coverBar" align="center">
@ -138,16 +148,6 @@
<td class="coverPerLo">0.0&nbsp;%</td>
<td class="coverNumLo">0 / 6</td>
</tr>
<tr>
<td class="coverFile"><a href="src/common/index.html">src/common</a></td>
<td class="coverBar" align="center">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="snow.png" width=100 height=10 alt="0.0%"></td></tr></table>
</td>
<td class="coverPerLo">0.0&nbsp;%</td>
<td class="coverNumLo">0 / 6</td>
<td class="coverPerLo">0.0&nbsp;%</td>
<td class="coverNumLo">0 / 6</td>
</tr>
<tr>
<td class="coverFile"><a href="src/v1/index.html">src/v1</a></td>
<td class="coverBar" align="center">
@ -181,12 +181,12 @@
<tr>
<td class="coverFile"><a href="src/v2/index.html">src/v2</a></td>
<td class="coverBar" align="center">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="ruby.png" width=71 height=10 alt="71.0%"><img src="snow.png" width=29 height=10 alt="71.0%"></td></tr></table>
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="ruby.png" width=71 height=10 alt="71.2%"><img src="snow.png" width=29 height=10 alt="71.2%"></td></tr></table>
</td>
<td class="coverPerLo">71.0&nbsp;%</td>
<td class="coverNumLo">157 / 221</td>
<td class="coverPerMed">78.1&nbsp;%</td>
<td class="coverNumMed">50 / 64</td>
<td class="coverPerLo">71.2&nbsp;%</td>
<td class="coverNumLo">158 / 222</td>
<td class="coverPerMed">78.5&nbsp;%</td>
<td class="coverNumMed">51 / 65</td>
</tr>
<tr>
<td class="coverFile"><a href="src/proposals/index.html">src/proposals</a></td>
@ -194,7 +194,7 @@
<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 class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">107 / 107</td>
<td class="coverNumHi">108 / 108</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">6 / 6</td>
</tr>

@ -31,18 +31,18 @@
<td class="headerValue">lcov.info</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">296</td>
<td class="headerCovTableEntry">614</td>
<td class="headerCovTableEntryLo">48.2 %</td>
<td class="headerCovTableEntry">298</td>
<td class="headerCovTableEntry">616</td>
<td class="headerCovTableEntryLo">48.4 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">61</td>
<td class="headerCovTableEntry">157</td>
<td class="headerCovTableEntryLo">38.9 %</td>
<td class="headerCovTableEntry">62</td>
<td class="headerCovTableEntry">158</td>
<td class="headerCovTableEntryLo">39.2 %</td>
</tr>
<tr>
<td class="headerItem">Legend:</td>
@ -181,12 +181,12 @@
<tr>
<td class="coverFile"><a href="src/v2/index.html">src/v2</a></td>
<td class="coverBar" align="center">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="ruby.png" width=71 height=10 alt="71.0%"><img src="snow.png" width=29 height=10 alt="71.0%"></td></tr></table>
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="ruby.png" width=71 height=10 alt="71.2%"><img src="snow.png" width=29 height=10 alt="71.2%"></td></tr></table>
</td>
<td class="coverPerLo">71.0&nbsp;%</td>
<td class="coverNumLo">157 / 221</td>
<td class="coverPerMed">78.1&nbsp;%</td>
<td class="coverNumMed">50 / 64</td>
<td class="coverPerLo">71.2&nbsp;%</td>
<td class="coverNumLo">158 / 222</td>
<td class="coverPerMed">78.5&nbsp;%</td>
<td class="coverNumMed">51 / 65</td>
</tr>
<tr>
<td class="coverFile"><a href="src/proposals/index.html">src/proposals</a></td>
@ -194,7 +194,7 @@
<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 class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">107 / 107</td>
<td class="coverNumHi">108 / 108</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">6 / 6</td>
</tr>

@ -31,18 +31,18 @@
<td class="headerValue">lcov.info</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">296</td>
<td class="headerCovTableEntry">614</td>
<td class="headerCovTableEntryLo">48.2 %</td>
<td class="headerCovTableEntry">298</td>
<td class="headerCovTableEntry">616</td>
<td class="headerCovTableEntryLo">48.4 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 06:06:30</td>
<td class="headerValue">2023-06-17 06:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">61</td>
<td class="headerCovTableEntry">157</td>
<td class="headerCovTableEntryLo">38.9 %</td>
<td class="headerCovTableEntry">62</td>
<td class="headerCovTableEntry">158</td>
<td class="headerCovTableEntryLo">39.2 %</td>
</tr>
<tr>
<td class="headerItem">Legend:</td>
@ -114,7 +114,7 @@
<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 class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">107 / 107</td>
<td class="coverNumHi">108 / 108</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">6 / 6</td>
</tr>
@ -171,12 +171,12 @@
<tr>
<td class="coverFile"><a href="src/v2/index.html">src/v2</a></td>
<td class="coverBar" align="center">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="ruby.png" width=71 height=10 alt="71.0%"><img src="snow.png" width=29 height=10 alt="71.0%"></td></tr></table>
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="ruby.png" width=71 height=10 alt="71.2%"><img src="snow.png" width=29 height=10 alt="71.2%"></td></tr></table>
</td>
<td class="coverPerLo">71.0&nbsp;%</td>
<td class="coverNumLo">157 / 221</td>
<td class="coverPerMed">78.1&nbsp;%</td>
<td class="coverNumMed">50 / 64</td>
<td class="coverPerLo">71.2&nbsp;%</td>
<td class="coverNumLo">158 / 222</td>
<td class="coverPerMed">78.5&nbsp;%</td>
<td class="coverNumMed">51 / 65</td>
</tr>
<tr>
<td class="coverFile"><a href="src/v2/libraries/index.html">src/v2/libraries</a></td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">2</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">2</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">2</td>

@ -31,13 +31,13 @@
<td class="headerValue">lcov.info</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">69</td>
<td class="headerCovTableEntry">69</td>
<td class="headerCovTableEntry">70</td>
<td class="headerCovTableEntry">70</td>
<td class="headerCovTableEntryHi">100.0 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">4</td>
@ -68,11 +68,11 @@
<td width="20%" class="tableHead">Hit count <span class="tableHeadSort"><img src="../../glass.png" width=10 height=14 alt="Sort by hit count" title="Sort by hit count" border=0></span></td>
</tr>
<tr>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#201">InfrastructureUpgradeProposal._getAllInstanceFeePercents</a></td>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#205">InfrastructureUpgradeProposal._getAllInstanceFeePercents</a></td>
<td class="coverFnHi">4</td>
</tr>
<tr>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#133">InfrastructureUpgradeProposal._setAllInstancePoolFeesInOracle</a></td>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#137">InfrastructureUpgradeProposal._setAllInstancePoolFeesInOracle</a></td>
<td class="coverFnHi">4</td>
</tr>
<tr>
@ -80,7 +80,7 @@
<td class="coverFnHi">4</td>
</tr>
<tr>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#170">InfrastructureUpgradeProposal._getAllInstances</a></td>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#174">InfrastructureUpgradeProposal._getAllInstances</a></td>
<td class="coverFnHi">12</td>
</tr>
</table>

@ -31,13 +31,13 @@
<td class="headerValue">lcov.info</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">69</td>
<td class="headerCovTableEntry">69</td>
<td class="headerCovTableEntry">70</td>
<td class="headerCovTableEntry">70</td>
<td class="headerCovTableEntryHi">100.0 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">4</td>
@ -68,15 +68,15 @@
<td width="20%" class="tableHead">Hit count <span class="tableHeadSort"><a href="InfrastructureUpgradeProposal.sol.func-sort-c.html"><img src="../../updown.png" width=10 height=14 alt="Sort by hit count" title="Sort by hit count" border=0></a></span></td>
</tr>
<tr>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#201">InfrastructureUpgradeProposal._getAllInstanceFeePercents</a></td>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#205">InfrastructureUpgradeProposal._getAllInstanceFeePercents</a></td>
<td class="coverFnHi">4</td>
</tr>
<tr>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#170">InfrastructureUpgradeProposal._getAllInstances</a></td>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#174">InfrastructureUpgradeProposal._getAllInstances</a></td>
<td class="coverFnHi">12</td>
</tr>
<tr>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#133">InfrastructureUpgradeProposal._setAllInstancePoolFeesInOracle</a></td>
<td class="coverFn"><a href="InfrastructureUpgradeProposal.sol.gcov.html#137">InfrastructureUpgradeProposal._setAllInstancePoolFeesInOracle</a></td>
<td class="coverFnHi">4</td>
</tr>
<tr>

@ -31,13 +31,13 @@
<td class="headerValue">lcov.info</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">69</td>
<td class="headerCovTableEntry">69</td>
<td class="headerCovTableEntry">70</td>
<td class="headerCovTableEntry">70</td>
<td class="headerCovTableEntryHi">100.0 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">4</td>
@ -110,7 +110,7 @@
<a name="40"><span class="lineNum"> 40 </span> : /* @dev The address of the current RelayerRegistry proxy, this won't be upgraded */</a>
<a name="41"><span class="lineNum"> 41 </span> : address payable public constant relayerRegistryProxyAddress = 0x58E8dCC13BE9780fC42E8723D8EaD4CF46943dF2;</a>
<a name="42"><span class="lineNum"> 42 </span> : </a>
<a name="43"><span class="lineNum"> 43 </span> : /* @dev This is the Uniswap V3 Oracle which we will use for all of our traditional instances, but it will</a>
<a name="43"><span class="lineNum"> 43 </span> : /* @dev This is the Uniswap Oracle which we will use for all of our traditional instances, but it will</a>
<a name="44"><span class="lineNum"> 44 </span> : also help the CurveFeeOracle, the former must have been deployed witht the address of this */</a>
<a name="45"><span class="lineNum"> 45 </span> : address public immutable deployedUniswapFeeOracleAddress;</a>
<a name="46"><span class="lineNum"> 46 </span> : </a>
@ -167,140 +167,144 @@
<a name="97"><span class="lineNum"> 97 </span> : _getAllInstanceFeePercents()</a>
<a name="98"><span class="lineNum"> 98 </span> : );</a>
<a name="99"><span class="lineNum"> 99 </span> : </a>
<a name="100"><span class="lineNum"> 100 </span> : // Upgrade InstanceRegistry (V1) Proxy to InstanceRegistry (V2)</a>
<a name="100"><span class="lineNum"> 100 </span> : // We only allow the relayer registry to touch the update function</a>
<a name="101"><span class="lineNum"> 101 </span> : </a>
<a name="102"><span class="lineNum"> 102 </span><span class="lineCov"> 4 : AdminUpgradeableProxy(instanceRegistryProxyAddress).upgradeTo(</span></a>
<a name="103"><span class="lineNum"> 103 </span> : deployedInstanceRegistryImplementationAddress</a>
<a name="104"><span class="lineNum"> 104 </span> : );</a>
<a name="102"><span class="lineNum"> 102 </span><span class="lineCov"> 4 : FeeOracleManager(feeManagerProxyAddress).setFeeUpdater(relayerRegistryProxyAddress);</span></a>
<a name="103"><span class="lineNum"> 103 </span> : </a>
<a name="104"><span class="lineNum"> 104 </span> : // Upgrade InstanceRegistry (V1) Proxy to InstanceRegistry (V2)</a>
<a name="105"><span class="lineNum"> 105 </span> : </a>
<a name="106"><span class="lineNum"> 106 </span> : // Initialize this one too, we are abandoning all of the older data here because either the data</a>
<a name="107"><span class="lineNum"> 107 </span> : // structures don't fit or we can't do a clean addition of all instances, it is better to add the</a>
<a name="108"><span class="lineNum"> 108 </span> : // instances as fresh data because it's anyways a simple contract, it just stores some basic data on</a>
<a name="109"><span class="lineNum"> 109 </span> : // instances which isn't mutable for them, instead only determined for each. The new Tornado Router is</a>
<a name="110"><span class="lineNum"> 110 </span> : // also set.</a>
<a name="111"><span class="lineNum"> 111 </span> : </a>
<a name="112"><span class="lineNum"> 112 </span><span class="lineCov"> 4 : InstanceRegistry(instanceRegistryProxyAddress).initialize(_getAllInstances(), router);</span></a>
<a name="113"><span class="lineNum"> 113 </span> : </a>
<a name="114"><span class="lineNum"> 114 </span> : // The Uniswap V3 Fee Oracle also needs global data like the old FeeManager (Uniswap V3 functionality</a>
<a name="115"><span class="lineNum"> 115 </span> : // has now been split out) did, the legacy data will be used and in this version also the minimum</a>
<a name="116"><span class="lineNum"> 116 </span> : // observation cardinality for Uniswap V3 pools is used, but we're only setting that after adding the</a>
<a name="117"><span class="lineNum"> 117 </span> : // legacy cDAI pools which are in a kind of stupid liquidity condition, in any case there is a small</a>
<a name="118"><span class="lineNum"> 118 </span> : // amount of funds in there so let's add them too</a>
<a name="119"><span class="lineNum"> 119 </span> : </a>
<a name="120"><span class="lineNum"> 120 </span><span class="lineCov"> 4 : UniswapFeeOracle uniswapFeeOracle = UniswapFeeOracle(deployedUniswapFeeOracleAddress);</span></a>
<a name="121"><span class="lineNum"> 121 </span> : </a>
<a name="122"><span class="lineNum"> 122 </span><span class="lineCov"> 4 : uniswapFeeOracle.setMinObservationCardinality(1); // Set it to minimum so cDAI passes</span></a>
<a name="106"><span class="lineNum"> 106 </span><span class="lineCov"> 4 : AdminUpgradeableProxy(instanceRegistryProxyAddress).upgradeTo(</span></a>
<a name="107"><span class="lineNum"> 107 </span> : deployedInstanceRegistryImplementationAddress</a>
<a name="108"><span class="lineNum"> 108 </span> : );</a>
<a name="109"><span class="lineNum"> 109 </span> : </a>
<a name="110"><span class="lineNum"> 110 </span> : // Initialize this one too, we are abandoning all of the older data here because either the data</a>
<a name="111"><span class="lineNum"> 111 </span> : // structures don't fit or we can't do a clean addition of all instances, it is better to add the</a>
<a name="112"><span class="lineNum"> 112 </span> : // instances as fresh data because it's anyways a simple contract, it just stores some basic data on</a>
<a name="113"><span class="lineNum"> 113 </span> : // instances which isn't mutable for them, instead only determined for each. The new Tornado Router is</a>
<a name="114"><span class="lineNum"> 114 </span> : // also set.</a>
<a name="115"><span class="lineNum"> 115 </span> : </a>
<a name="116"><span class="lineNum"> 116 </span><span class="lineCov"> 4 : InstanceRegistry(instanceRegistryProxyAddress).initialize(_getAllInstances(), router);</span></a>
<a name="117"><span class="lineNum"> 117 </span> : </a>
<a name="118"><span class="lineNum"> 118 </span> : // It's been show recently that Uniswap V2 is providing better conditions for TORN liquidity than</a>
<a name="119"><span class="lineNum"> 119 </span> : // Uniswap V3, probably due to the simplicity of managing positions and the fact that with a coming V4</a>
<a name="120"><span class="lineNum"> 120 </span> : // upgrade, Uniswap is just moving to fragment their liquidity further. Until a Curve migration is not</a>
<a name="121"><span class="lineNum"> 121 </span> : // fulfilled, we will use the Uniswap V2 pool for TORN, and if we also see that other token liquidity</a>
<a name="122"><span class="lineNum"> 122 </span> : // is becoming an issue, we will move it all to V2 until we don't move stuff over to Curve fully.</a>
<a name="123"><span class="lineNum"> 123 </span> : </a>
<a name="124"><span class="lineNum"> 124 </span> : // Each of the instances are going to require a Uniswap Pool Fee to be set such that we actually know</a>
<a name="125"><span class="lineNum"> 125 </span> : // what pools to lookup when querying for Oracle data. This data has also been read out from the</a>
<a name="126"><span class="lineNum"> 126 </span> : // instance registry and it basically has the 3000 (0.3%) and 500 (0.05%) non-stable and stable</a>
<a name="127"><span class="lineNum"> 127 </span> : // respectively &quot;default&quot; pool fees. This is not to be confused with pool protocol fees, these have</a>
<a name="128"><span class="lineNum"> 128 </span> : // been recorded in the (first) legacy initialization above</a>
<a name="129"><span class="lineNum"> 129 </span> : </a>
<a name="130"><span class="lineNum"> 130 </span><span class="lineCov"> 4 : _setAllInstancePoolFeesInOracle(uniswapFeeOracle);</span></a>
<a name="131"><span class="lineNum"> 131 </span> : </a>
<a name="132"><span class="lineNum"> 132 </span><span class="lineCov"> 4 : uniswapFeeOracle.setMinObservationCardinality(10); // Now set the cardinality to a reasonable value</span></a>
<a name="133"><span class="lineNum"> 133 </span> : }</a>
<a name="134"><span class="lineNum"> 134 </span> : </a>
<a name="135"><span class="lineNum"> 135 </span> : function _setAllInstancePoolFeesInOracle(UniswapFeeOracle _uniswapFeeOracle) internal {</a>
<a name="136"><span class="lineNum"> 136 </span><span class="lineCov"> 4 : ITornadoInstance[] memory instances = _getAllInstances();</span></a>
<a name="137"><span class="lineNum"> 137 </span> : </a>
<a name="138"><span class="lineNum"> 138 </span><span class="lineCov"> 4 : IERC20 weth = IERC20(UniswapV3OracleHelper.WETH);</span></a>
<a name="139"><span class="lineNum"> 139 </span><span class="lineCov"> 4 : IERC20 dai = IERC20(instances[4].token());</span></a>
<a name="140"><span class="lineNum"> 140 </span><span class="lineCov"> 4 : IERC20 cdai = IERC20(instances[8].token());</span></a>
<a name="141"><span class="lineNum"> 141 </span><span class="lineCov"> 4 : IERC20 usdt = IERC20(instances[12].token());</span></a>
<a name="142"><span class="lineNum"> 142 </span><span class="lineCov"> 4 : IERC20 wbtc = IERC20(instances[14].token());</span></a>
<a name="143"><span class="lineNum"> 143 </span> : </a>
<a name="144"><span class="lineNum"> 144 </span> : /* ETH instances */</a>
<a name="145"><span class="lineNum"> 145 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(weth, uint24(0x000));</span></a>
<a name="146"><span class="lineNum"> 146 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(weth, uint24(0x000));</span></a>
<a name="147"><span class="lineNum"> 147 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(weth, uint24(0x000));</span></a>
<a name="148"><span class="lineNum"> 148 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(weth, uint24(0x000));</span></a>
<a name="149"><span class="lineNum"> 149 </span> : </a>
<a name="150"><span class="lineNum"> 150 </span> : /* DAI instances */</a>
<a name="151"><span class="lineNum"> 151 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(dai, uint24(0xbb8));</span></a>
<a name="152"><span class="lineNum"> 152 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(dai, uint24(0xbb8));</span></a>
<a name="153"><span class="lineNum"> 153 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(dai, uint24(0xbb8));</span></a>
<a name="154"><span class="lineNum"> 154 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(dai, uint24(0xbb8));</span></a>
<a name="155"><span class="lineNum"> 155 </span> : </a>
<a name="156"><span class="lineNum"> 156 </span> : /* cDAI instances */</a>
<a name="157"><span class="lineNum"> 157 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(cdai, uint24(0xbb8));</span></a>
<a name="158"><span class="lineNum"> 158 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(cdai, uint24(0xbb8));</span></a>
<a name="159"><span class="lineNum"> 159 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(cdai, uint24(0xbb8));</span></a>
<a name="160"><span class="lineNum"> 160 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(cdai, uint24(0xbb8));</span></a>
<a name="161"><span class="lineNum"> 161 </span> : </a>
<a name="162"><span class="lineNum"> 162 </span> : /* USDT instances */</a>
<a name="163"><span class="lineNum"> 163 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(usdt, uint24(0x1f4));</span></a>
<a name="164"><span class="lineNum"> 164 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(usdt, uint24(0x1f4));</span></a>
<a name="124"><span class="lineNum"> 124 </span><span class="lineCov"> 4 : UniswapFeeOracle uniswapFeeOracle = UniswapFeeOracle(deployedUniswapFeeOracleAddress);</span></a>
<a name="125"><span class="lineNum"> 125 </span> : </a>
<a name="126"><span class="lineNum"> 126 </span><span class="lineCov"> 4 : uniswapFeeOracle.setMinObservationCardinality(1); // Set it to minimum so cDAI passes, see below</span></a>
<a name="127"><span class="lineNum"> 127 </span> : </a>
<a name="128"><span class="lineNum"> 128 </span> : // Each of the instances are going to require a Uniswap Pool Fee to be set such that we actually know</a>
<a name="129"><span class="lineNum"> 129 </span> : // what pools to lookup when querying for Oracle data. This data has also been read out from the</a>
<a name="130"><span class="lineNum"> 130 </span> : // instance registry and it basically has the 3000 (0.3%) and 500 (0.05%) non-stable and stable</a>
<a name="131"><span class="lineNum"> 131 </span> : // respectively &quot;default&quot; pool fees. This is not to be confused with pool protocol fees, these have</a>
<a name="132"><span class="lineNum"> 132 </span> : // been recorded in the (first) legacy initialization above</a>
<a name="133"><span class="lineNum"> 133 </span> : </a>
<a name="134"><span class="lineNum"> 134 </span><span class="lineCov"> 4 : _setAllInstancePoolFeesInOracle(uniswapFeeOracle);</span></a>
<a name="135"><span class="lineNum"> 135 </span> : </a>
<a name="136"><span class="lineNum"> 136 </span><span class="lineCov"> 4 : uniswapFeeOracle.setMinObservationCardinality(10); // Now set the cardinality to a reasonable value</span></a>
<a name="137"><span class="lineNum"> 137 </span> : }</a>
<a name="138"><span class="lineNum"> 138 </span> : </a>
<a name="139"><span class="lineNum"> 139 </span> : function _setAllInstancePoolFeesInOracle(UniswapFeeOracle _uniswapFeeOracle) internal {</a>
<a name="140"><span class="lineNum"> 140 </span><span class="lineCov"> 4 : ITornadoInstance[] memory instances = _getAllInstances();</span></a>
<a name="141"><span class="lineNum"> 141 </span> : </a>
<a name="142"><span class="lineNum"> 142 </span><span class="lineCov"> 4 : IERC20 weth = IERC20(UniswapV3OracleHelper.WETH);</span></a>
<a name="143"><span class="lineNum"> 143 </span><span class="lineCov"> 4 : IERC20 dai = IERC20(instances[4].token());</span></a>
<a name="144"><span class="lineNum"> 144 </span><span class="lineCov"> 4 : IERC20 cdai = IERC20(instances[8].token());</span></a>
<a name="145"><span class="lineNum"> 145 </span><span class="lineCov"> 4 : IERC20 usdt = IERC20(instances[12].token());</span></a>
<a name="146"><span class="lineNum"> 146 </span><span class="lineCov"> 4 : IERC20 wbtc = IERC20(instances[14].token());</span></a>
<a name="147"><span class="lineNum"> 147 </span> : </a>
<a name="148"><span class="lineNum"> 148 </span> : /* ETH instances */</a>
<a name="149"><span class="lineNum"> 149 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(weth, uint24(0x000));</span></a>
<a name="150"><span class="lineNum"> 150 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(weth, uint24(0x000));</span></a>
<a name="151"><span class="lineNum"> 151 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(weth, uint24(0x000));</span></a>
<a name="152"><span class="lineNum"> 152 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(weth, uint24(0x000));</span></a>
<a name="153"><span class="lineNum"> 153 </span> : </a>
<a name="154"><span class="lineNum"> 154 </span> : /* DAI instances */</a>
<a name="155"><span class="lineNum"> 155 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(dai, uint24(0xbb8));</span></a>
<a name="156"><span class="lineNum"> 156 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(dai, uint24(0xbb8));</span></a>
<a name="157"><span class="lineNum"> 157 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(dai, uint24(0xbb8));</span></a>
<a name="158"><span class="lineNum"> 158 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(dai, uint24(0xbb8));</span></a>
<a name="159"><span class="lineNum"> 159 </span> : </a>
<a name="160"><span class="lineNum"> 160 </span> : /* cDAI instances */</a>
<a name="161"><span class="lineNum"> 161 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(cdai, uint24(0xbb8));</span></a>
<a name="162"><span class="lineNum"> 162 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(cdai, uint24(0xbb8));</span></a>
<a name="163"><span class="lineNum"> 163 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(cdai, uint24(0xbb8));</span></a>
<a name="164"><span class="lineNum"> 164 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(cdai, uint24(0xbb8));</span></a>
<a name="165"><span class="lineNum"> 165 </span> : </a>
<a name="166"><span class="lineNum"> 166 </span> : /* WBTC instances */</a>
<a name="167"><span class="lineNum"> 167 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(wbtc, uint24(0xbb8));</span></a>
<a name="168"><span class="lineNum"> 168 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(wbtc, uint24(0xbb8));</span></a>
<a name="169"><span class="lineNum"> 169 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(wbtc, uint24(0xbb8));</span></a>
<a name="170"><span class="lineNum"> 170 </span> : }</a>
<a name="171"><span class="lineNum"> 171 </span> : </a>
<a name="172"><span class="lineNum"> 172 </span> : function _getAllInstances() internal pure returns (ITornadoInstance[] memory _addresses) {</a>
<a name="173"><span class="lineNum"> 173 </span><span class="lineCov"> 12 : _addresses = new ITornadoInstance[](17);</span></a>
<a name="174"><span class="lineNum"> 174 </span> : </a>
<a name="175"><span class="lineNum"> 175 </span> : /* ETH instances */</a>
<a name="176"><span class="lineNum"> 176 </span><span class="lineCov"> 12 : _addresses[0] = ITornadoInstance(0x12D66f87A04A9E220743712cE6d9bB1B5616B8Fc);</span></a>
<a name="177"><span class="lineNum"> 177 </span><span class="lineCov"> 12 : _addresses[1] = ITornadoInstance(0x47CE0C6eD5B0Ce3d3A51fdb1C52DC66a7c3c2936);</span></a>
<a name="178"><span class="lineNum"> 178 </span><span class="lineCov"> 12 : _addresses[2] = ITornadoInstance(0x910Cbd523D972eb0a6f4cAe4618aD62622b39DbF);</span></a>
<a name="179"><span class="lineNum"> 179 </span><span class="lineCov"> 12 : _addresses[3] = ITornadoInstance(0xA160cdAB225685dA1d56aa342Ad8841c3b53f291);</span></a>
<a name="180"><span class="lineNum"> 180 </span> : </a>
<a name="181"><span class="lineNum"> 181 </span> : /* DAI instances */</a>
<a name="182"><span class="lineNum"> 182 </span><span class="lineCov"> 12 : _addresses[4] = ITornadoInstance(0xD4B88Df4D29F5CedD6857912842cff3b20C8Cfa3);</span></a>
<a name="183"><span class="lineNum"> 183 </span><span class="lineCov"> 12 : _addresses[5] = ITornadoInstance(0xFD8610d20aA15b7B2E3Be39B396a1bC3516c7144);</span></a>
<a name="184"><span class="lineNum"> 184 </span><span class="lineCov"> 12 : _addresses[6] = ITornadoInstance(0x07687e702b410Fa43f4cB4Af7FA097918ffD2730);</span></a>
<a name="185"><span class="lineNum"> 185 </span><span class="lineCov"> 12 : _addresses[7] = ITornadoInstance(0x23773E65ed146A459791799d01336DB287f25334);</span></a>
<a name="186"><span class="lineNum"> 186 </span> : </a>
<a name="187"><span class="lineNum"> 187 </span> : /* cDAI instances */</a>
<a name="188"><span class="lineNum"> 188 </span><span class="lineCov"> 12 : _addresses[8] = ITornadoInstance(0x22aaA7720ddd5388A3c0A3333430953C68f1849b);</span></a>
<a name="189"><span class="lineNum"> 189 </span><span class="lineCov"> 12 : _addresses[9] = ITornadoInstance(0x03893a7c7463AE47D46bc7f091665f1893656003);</span></a>
<a name="190"><span class="lineNum"> 190 </span><span class="lineCov"> 12 : _addresses[10] = ITornadoInstance(0x2717c5e28cf931547B621a5dddb772Ab6A35B701);</span></a>
<a name="191"><span class="lineNum"> 191 </span><span class="lineCov"> 12 : _addresses[11] = ITornadoInstance(0xD21be7248e0197Ee08E0c20D4a96DEBdaC3D20Af);</span></a>
<a name="192"><span class="lineNum"> 192 </span> : </a>
<a name="193"><span class="lineNum"> 193 </span> : /* USDT instances */</a>
<a name="194"><span class="lineNum"> 194 </span><span class="lineCov"> 12 : _addresses[12] = ITornadoInstance(0x169AD27A470D064DEDE56a2D3ff727986b15D52B);</span></a>
<a name="195"><span class="lineNum"> 195 </span><span class="lineCov"> 12 : _addresses[13] = ITornadoInstance(0x0836222F2B2B24A3F36f98668Ed8F0B38D1a872f);</span></a>
<a name="166"><span class="lineNum"> 166 </span> : /* USDT instances */</a>
<a name="167"><span class="lineNum"> 167 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(usdt, uint24(0x1f4));</span></a>
<a name="168"><span class="lineNum"> 168 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(usdt, uint24(0x1f4));</span></a>
<a name="169"><span class="lineNum"> 169 </span> : </a>
<a name="170"><span class="lineNum"> 170 </span> : /* WBTC instances */</a>
<a name="171"><span class="lineNum"> 171 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(wbtc, uint24(0xbb8));</span></a>
<a name="172"><span class="lineNum"> 172 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(wbtc, uint24(0xbb8));</span></a>
<a name="173"><span class="lineNum"> 173 </span><span class="lineCov"> 4 : _uniswapFeeOracle.setPoolFeeForToken(wbtc, uint24(0xbb8));</span></a>
<a name="174"><span class="lineNum"> 174 </span> : }</a>
<a name="175"><span class="lineNum"> 175 </span> : </a>
<a name="176"><span class="lineNum"> 176 </span> : function _getAllInstances() internal pure returns (ITornadoInstance[] memory _addresses) {</a>
<a name="177"><span class="lineNum"> 177 </span><span class="lineCov"> 12 : _addresses = new ITornadoInstance[](17);</span></a>
<a name="178"><span class="lineNum"> 178 </span> : </a>
<a name="179"><span class="lineNum"> 179 </span> : /* ETH instances */</a>
<a name="180"><span class="lineNum"> 180 </span><span class="lineCov"> 12 : _addresses[0] = ITornadoInstance(0x12D66f87A04A9E220743712cE6d9bB1B5616B8Fc);</span></a>
<a name="181"><span class="lineNum"> 181 </span><span class="lineCov"> 12 : _addresses[1] = ITornadoInstance(0x47CE0C6eD5B0Ce3d3A51fdb1C52DC66a7c3c2936);</span></a>
<a name="182"><span class="lineNum"> 182 </span><span class="lineCov"> 12 : _addresses[2] = ITornadoInstance(0x910Cbd523D972eb0a6f4cAe4618aD62622b39DbF);</span></a>
<a name="183"><span class="lineNum"> 183 </span><span class="lineCov"> 12 : _addresses[3] = ITornadoInstance(0xA160cdAB225685dA1d56aa342Ad8841c3b53f291);</span></a>
<a name="184"><span class="lineNum"> 184 </span> : </a>
<a name="185"><span class="lineNum"> 185 </span> : /* DAI instances */</a>
<a name="186"><span class="lineNum"> 186 </span><span class="lineCov"> 12 : _addresses[4] = ITornadoInstance(0xD4B88Df4D29F5CedD6857912842cff3b20C8Cfa3);</span></a>
<a name="187"><span class="lineNum"> 187 </span><span class="lineCov"> 12 : _addresses[5] = ITornadoInstance(0xFD8610d20aA15b7B2E3Be39B396a1bC3516c7144);</span></a>
<a name="188"><span class="lineNum"> 188 </span><span class="lineCov"> 12 : _addresses[6] = ITornadoInstance(0x07687e702b410Fa43f4cB4Af7FA097918ffD2730);</span></a>
<a name="189"><span class="lineNum"> 189 </span><span class="lineCov"> 12 : _addresses[7] = ITornadoInstance(0x23773E65ed146A459791799d01336DB287f25334);</span></a>
<a name="190"><span class="lineNum"> 190 </span> : </a>
<a name="191"><span class="lineNum"> 191 </span> : /* cDAI instances */</a>
<a name="192"><span class="lineNum"> 192 </span><span class="lineCov"> 12 : _addresses[8] = ITornadoInstance(0x22aaA7720ddd5388A3c0A3333430953C68f1849b);</span></a>
<a name="193"><span class="lineNum"> 193 </span><span class="lineCov"> 12 : _addresses[9] = ITornadoInstance(0x03893a7c7463AE47D46bc7f091665f1893656003);</span></a>
<a name="194"><span class="lineNum"> 194 </span><span class="lineCov"> 12 : _addresses[10] = ITornadoInstance(0x2717c5e28cf931547B621a5dddb772Ab6A35B701);</span></a>
<a name="195"><span class="lineNum"> 195 </span><span class="lineCov"> 12 : _addresses[11] = ITornadoInstance(0xD21be7248e0197Ee08E0c20D4a96DEBdaC3D20Af);</span></a>
<a name="196"><span class="lineNum"> 196 </span> : </a>
<a name="197"><span class="lineNum"> 197 </span> : /* WBTC instances */</a>
<a name="198"><span class="lineNum"> 198 </span><span class="lineCov"> 12 : _addresses[14] = ITornadoInstance(0x178169B423a011fff22B9e3F3abeA13414dDD0F1);</span></a>
<a name="199"><span class="lineNum"> 199 </span><span class="lineCov"> 12 : _addresses[15] = ITornadoInstance(0x610B717796ad172B316836AC95a2ffad065CeaB4);</span></a>
<a name="200"><span class="lineNum"> 200 </span><span class="lineCov"> 12 : _addresses[16] = ITornadoInstance(0xbB93e510BbCD0B7beb5A853875f9eC60275CF498);</span></a>
<a name="201"><span class="lineNum"> 201 </span> : }</a>
<a name="202"><span class="lineNum"> 202 </span> : </a>
<a name="203"><span class="lineNum"> 203 </span> : function _getAllInstanceFeePercents() internal pure returns (uint256[] memory _percents) {</a>
<a name="204"><span class="lineNum"> 204 </span><span class="lineCov"> 4 : _percents = new uint256[](17);</span></a>
<a name="205"><span class="lineNum"> 205 </span> : </a>
<a name="206"><span class="lineNum"> 206 </span> : /* ETH instances */</a>
<a name="207"><span class="lineNum"> 207 </span><span class="lineCov"> 4 : _percents[0] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></a>
<a name="208"><span class="lineNum"> 208 </span><span class="lineCov"> 4 : _percents[1] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></a>
<a name="209"><span class="lineNum"> 209 </span><span class="lineCov"> 4 : _percents[2] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></a>
<a name="210"><span class="lineNum"> 210 </span><span class="lineCov"> 4 : _percents[3] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></a>
<a name="211"><span class="lineNum"> 211 </span> : </a>
<a name="212"><span class="lineNum"> 212 </span> : /* DAI instances */</a>
<a name="213"><span class="lineNum"> 213 </span><span class="lineCov"> 4 : _percents[4] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></a>
<a name="214"><span class="lineNum"> 214 </span><span class="lineCov"> 4 : _percents[5] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></a>
<a name="215"><span class="lineNum"> 215 </span><span class="lineCov"> 4 : _percents[6] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></a>
<a name="216"><span class="lineNum"> 216 </span><span class="lineCov"> 4 : _percents[7] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></a>
<a name="217"><span class="lineNum"> 217 </span> : </a>
<a name="218"><span class="lineNum"> 218 </span> : /* cDAI instances */</a>
<a name="219"><span class="lineNum"> 219 </span><span class="lineCov"> 4 : _percents[8] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></a>
<a name="220"><span class="lineNum"> 220 </span><span class="lineCov"> 4 : _percents[9] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></a>
<a name="221"><span class="lineNum"> 221 </span><span class="lineCov"> 4 : _percents[10] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></a>
<a name="222"><span class="lineNum"> 222 </span><span class="lineCov"> 4 : _percents[11] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></a>
<a name="223"><span class="lineNum"> 223 </span> : </a>
<a name="224"><span class="lineNum"> 224 </span> : /* USDT instances */</a>
<a name="225"><span class="lineNum"> 225 </span><span class="lineCov"> 4 : _percents[12] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></a>
<a name="226"><span class="lineNum"> 226 </span><span class="lineCov"> 4 : _percents[13] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></a>
<a name="197"><span class="lineNum"> 197 </span> : /* USDT instances */</a>
<a name="198"><span class="lineNum"> 198 </span><span class="lineCov"> 12 : _addresses[12] = ITornadoInstance(0x169AD27A470D064DEDE56a2D3ff727986b15D52B);</span></a>
<a name="199"><span class="lineNum"> 199 </span><span class="lineCov"> 12 : _addresses[13] = ITornadoInstance(0x0836222F2B2B24A3F36f98668Ed8F0B38D1a872f);</span></a>
<a name="200"><span class="lineNum"> 200 </span> : </a>
<a name="201"><span class="lineNum"> 201 </span> : /* WBTC instances */</a>
<a name="202"><span class="lineNum"> 202 </span><span class="lineCov"> 12 : _addresses[14] = ITornadoInstance(0x178169B423a011fff22B9e3F3abeA13414dDD0F1);</span></a>
<a name="203"><span class="lineNum"> 203 </span><span class="lineCov"> 12 : _addresses[15] = ITornadoInstance(0x610B717796ad172B316836AC95a2ffad065CeaB4);</span></a>
<a name="204"><span class="lineNum"> 204 </span><span class="lineCov"> 12 : _addresses[16] = ITornadoInstance(0xbB93e510BbCD0B7beb5A853875f9eC60275CF498);</span></a>
<a name="205"><span class="lineNum"> 205 </span> : }</a>
<a name="206"><span class="lineNum"> 206 </span> : </a>
<a name="207"><span class="lineNum"> 207 </span> : function _getAllInstanceFeePercents() internal pure returns (uint256[] memory _percents) {</a>
<a name="208"><span class="lineNum"> 208 </span><span class="lineCov"> 4 : _percents = new uint256[](17);</span></a>
<a name="209"><span class="lineNum"> 209 </span> : </a>
<a name="210"><span class="lineNum"> 210 </span> : /* ETH instances */</a>
<a name="211"><span class="lineNum"> 211 </span><span class="lineCov"> 4 : _percents[0] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></a>
<a name="212"><span class="lineNum"> 212 </span><span class="lineCov"> 4 : _percents[1] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></a>
<a name="213"><span class="lineNum"> 213 </span><span class="lineCov"> 4 : _percents[2] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></a>
<a name="214"><span class="lineNum"> 214 </span><span class="lineCov"> 4 : _percents[3] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></a>
<a name="215"><span class="lineNum"> 215 </span> : </a>
<a name="216"><span class="lineNum"> 216 </span> : /* DAI instances */</a>
<a name="217"><span class="lineNum"> 217 </span><span class="lineCov"> 4 : _percents[4] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></a>
<a name="218"><span class="lineNum"> 218 </span><span class="lineCov"> 4 : _percents[5] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></a>
<a name="219"><span class="lineNum"> 219 </span><span class="lineCov"> 4 : _percents[6] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></a>
<a name="220"><span class="lineNum"> 220 </span><span class="lineCov"> 4 : _percents[7] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></a>
<a name="221"><span class="lineNum"> 221 </span> : </a>
<a name="222"><span class="lineNum"> 222 </span> : /* cDAI instances */</a>
<a name="223"><span class="lineNum"> 223 </span><span class="lineCov"> 4 : _percents[8] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></a>
<a name="224"><span class="lineNum"> 224 </span><span class="lineCov"> 4 : _percents[9] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></a>
<a name="225"><span class="lineNum"> 225 </span><span class="lineCov"> 4 : _percents[10] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></a>
<a name="226"><span class="lineNum"> 226 </span><span class="lineCov"> 4 : _percents[11] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></a>
<a name="227"><span class="lineNum"> 227 </span> : </a>
<a name="228"><span class="lineNum"> 228 </span> : /* WBTC instances */</a>
<a name="229"><span class="lineNum"> 229 </span><span class="lineCov"> 4 : _percents[14] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></a>
<a name="230"><span class="lineNum"> 230 </span><span class="lineCov"> 4 : _percents[15] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></a>
<a name="231"><span class="lineNum"> 231 </span><span class="lineCov"> 4 : _percents[16] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></a>
<a name="232"><span class="lineNum"> 232 </span> : }</a>
<a name="233"><span class="lineNum"> 233 </span> : }</a>
<a name="228"><span class="lineNum"> 228 </span> : /* USDT instances */</a>
<a name="229"><span class="lineNum"> 229 </span><span class="lineCov"> 4 : _percents[12] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></a>
<a name="230"><span class="lineNum"> 230 </span><span class="lineCov"> 4 : _percents[13] = uint256(0x0000000000000000000000000000000000000000000000000000000000000000);</span></a>
<a name="231"><span class="lineNum"> 231 </span> : </a>
<a name="232"><span class="lineNum"> 232 </span> : /* WBTC instances */</a>
<a name="233"><span class="lineNum"> 233 </span><span class="lineCov"> 4 : _percents[14] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></a>
<a name="234"><span class="lineNum"> 234 </span><span class="lineCov"> 4 : _percents[15] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></a>
<a name="235"><span class="lineNum"> 235 </span><span class="lineCov"> 4 : _percents[16] = uint256(0x000000000000000000000000000000000000000000000000000000000000001e);</span></a>
<a name="236"><span class="lineNum"> 236 </span> : }</a>
<a name="237"><span class="lineNum"> 237 </span> : }</a>
</pre>
</td>
</tr>

@ -31,13 +31,13 @@
<td class="headerValue">lcov.info</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">107</td>
<td class="headerCovTableEntry">107</td>
<td class="headerCovTableEntry">108</td>
<td class="headerCovTableEntry">108</td>
<td class="headerCovTableEntryHi">100.0 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">6</td>
@ -102,14 +102,14 @@
<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 class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">69 / 69</td>
<td class="coverNumHi">70 / 70</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">4 / 4</td>
</tr>
<tr>
<td class="testName" colspan=2><span style="font-style:italic">&lt;unnamed&gt;</span></td>
<td class="testPer">100.0&nbsp;%</td>
<td class="testNum">69&nbsp;/&nbsp;69</td>
<td class="testNum">70&nbsp;/&nbsp;70</td>
<td class="testPer">100.0&nbsp;%</td>
<td class="testNum">4&nbsp;/&nbsp;4</td>
</tr>

@ -31,13 +31,13 @@
<td class="headerValue">lcov.info</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">107</td>
<td class="headerCovTableEntry">107</td>
<td class="headerCovTableEntry">108</td>
<td class="headerCovTableEntry">108</td>
<td class="headerCovTableEntryHi">100.0 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">6</td>
@ -102,14 +102,14 @@
<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 class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">69 / 69</td>
<td class="coverNumHi">70 / 70</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">4 / 4</td>
</tr>
<tr>
<td class="testName" colspan=2><span style="font-style:italic">&lt;unnamed&gt;</span></td>
<td class="testPer">100.0&nbsp;%</td>
<td class="testNum">69&nbsp;/&nbsp;69</td>
<td class="testNum">70&nbsp;/&nbsp;70</td>
<td class="testPer">100.0&nbsp;%</td>
<td class="testNum">4&nbsp;/&nbsp;4</td>
</tr>

@ -31,13 +31,13 @@
<td class="headerValue">lcov.info</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">107</td>
<td class="headerCovTableEntry">107</td>
<td class="headerCovTableEntry">108</td>
<td class="headerCovTableEntry">108</td>
<td class="headerCovTableEntryHi">100.0 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">6</td>
@ -102,14 +102,14 @@
<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 class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">69 / 69</td>
<td class="coverNumHi">70 / 70</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">4 / 4</td>
</tr>
<tr>
<td class="testName" colspan=2><span style="font-style:italic">&lt;unnamed&gt;</span></td>
<td class="testPer">100.0&nbsp;%</td>
<td class="testNum">69&nbsp;/&nbsp;69</td>
<td class="testNum">70&nbsp;/&nbsp;70</td>
<td class="testPer">100.0&nbsp;%</td>
<td class="testNum">4&nbsp;/&nbsp;4</td>
</tr>

@ -31,13 +31,13 @@
<td class="headerValue">lcov.info</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">107</td>
<td class="headerCovTableEntry">107</td>
<td class="headerCovTableEntry">108</td>
<td class="headerCovTableEntry">108</td>
<td class="headerCovTableEntryHi">100.0 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">6</td>
@ -94,7 +94,7 @@
<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 class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">69 / 69</td>
<td class="coverNumHi">70 / 70</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">4 / 4</td>
</tr>

@ -31,13 +31,13 @@
<td class="headerValue">lcov.info</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">107</td>
<td class="headerCovTableEntry">107</td>
<td class="headerCovTableEntry">108</td>
<td class="headerCovTableEntry">108</td>
<td class="headerCovTableEntryHi">100.0 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">6</td>
@ -94,7 +94,7 @@
<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 class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">69 / 69</td>
<td class="coverNumHi">70 / 70</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">4 / 4</td>
</tr>

@ -31,13 +31,13 @@
<td class="headerValue">lcov.info</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">107</td>
<td class="headerCovTableEntry">107</td>
<td class="headerCovTableEntry">108</td>
<td class="headerCovTableEntry">108</td>
<td class="headerCovTableEntryHi">100.0 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">6</td>
@ -94,7 +94,7 @@
<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 class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">69 / 69</td>
<td class="coverNumHi">70 / 70</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">4 / 4</td>
</tr>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">0</td>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">8</td>
@ -76,27 +76,27 @@
<td class="coverFnLo">0</td>
</tr>
<tr>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#271">CurveFeeOracle.getChainedOracleHashForInstance</a></td>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#268">CurveFeeOracle.getChainedOracleHashForInstance</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#253">CurveFeeOracle.getChainedOracleNameForInstance</a></td>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#250">CurveFeeOracle.getChainedOracleNameForInstance</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#262">CurveFeeOracle.getChainedOracleNameForOracleHash</a></td>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#259">CurveFeeOracle.getChainedOracleNameForOracleHash</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#304">CurveFeeOracle.setTornOracleIsUniswap</a></td>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#301">CurveFeeOracle.setTornOracleIsUniswap</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#299">CurveFeeOracle.setUniswapFeeOracle</a></td>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#296">CurveFeeOracle.setUniswapFeeOracle</a></td>
<td class="coverFnHi">2</td>
</tr>
<tr>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#282">CurveFeeOracle.modifyChainedOracleForInstance</a></td>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#279">CurveFeeOracle.modifyChainedOracleForInstance</a></td>
<td class="coverFnHi">12</td>
</tr>
<tr>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">8</td>
@ -76,15 +76,15 @@
<td class="coverFnLo">0</td>
</tr>
<tr>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#271">CurveFeeOracle.getChainedOracleHashForInstance</a></td>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#268">CurveFeeOracle.getChainedOracleHashForInstance</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#253">CurveFeeOracle.getChainedOracleNameForInstance</a></td>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#250">CurveFeeOracle.getChainedOracleNameForInstance</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#262">CurveFeeOracle.getChainedOracleNameForOracleHash</a></td>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#259">CurveFeeOracle.getChainedOracleNameForOracleHash</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
@ -92,15 +92,15 @@
<td class="coverFnHi">26</td>
</tr>
<tr>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#282">CurveFeeOracle.modifyChainedOracleForInstance</a></td>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#279">CurveFeeOracle.modifyChainedOracleForInstance</a></td>
<td class="coverFnHi">12</td>
</tr>
<tr>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#304">CurveFeeOracle.setTornOracleIsUniswap</a></td>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#301">CurveFeeOracle.setTornOracleIsUniswap</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#299">CurveFeeOracle.setUniswapFeeOracle</a></td>
<td class="coverFn"><a href="CurveFeeOracle.sol.gcov.html#296">CurveFeeOracle.setUniswapFeeOracle</a></td>
<td class="coverFnHi">2</td>
</tr>
<tr>

@ -37,7 +37,7 @@
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">8</td>
@ -300,85 +300,82 @@
<a name="230"><span class="lineNum"> 230 </span> : // If fee is 0 return</a>
<a name="231"><span class="lineNum"> 231 </span><span class="lineCov"> 26 : if (_instance.fee.percent == 0) return 0;</span></a>
<a name="232"><span class="lineNum"> 232 </span> : </a>
<a name="233"><span class="lineNum"> 233 </span> : // Either TOKEN price in ETH or TOKEN price in TORN</a>
<a name="233"><span class="lineNum"> 233 </span> : // Either ETH PER TOKEN or TORN PER TOKEN</a>
<a name="234"><span class="lineNum"> 234 </span><span class="lineCov"> 16 : uint256 price = chainedPriceOracles[_instance.logic].price_oracle();</span></a>
<a name="235"><span class="lineNum"> 235 </span> : </a>
<a name="236"><span class="lineNum"> 236 </span> : // If the below is true, then this will finalize the price and give the TOKEN price in TORN</a>
<a name="237"><span class="lineNum"> 237 </span> : // Above MUST be TOKEN price in ETH, then (ETH/TOKEN)/(ETH/TORN)=TORN/TOKEN, meaning the TOKEN price</a>
<a name="238"><span class="lineNum"> 238 </span> : // in TORN</a>
<a name="239"><span class="lineNum"> 239 </span><span class="lineCov"> 16 : if (tornOracleIsUniswap) {</span></a>
<a name="240"><span class="lineNum"> 240 </span><span class="lineCov"> 15 : price = price</span></a>
<a name="241"><span class="lineNum"> 241 </span> : * uniswapFeeOracle.getTORNPerToken(</a>
<a name="242"><span class="lineNum"> 242 </span> : IERC20(UniswapV3OracleHelper.WETH), _instance.fee.updateInterval</a>
<a name="243"><span class="lineNum"> 243 </span> : ) / UniswapV3OracleHelper.RATIO_DIVIDER;</a>
<a name="244"><span class="lineNum"> 244 </span> : }</a>
<a name="245"><span class="lineNum"> 245 </span> : </a>
<a name="246"><span class="lineNum"> 246 </span> : // The price is now either prepared by the chained oracles or by Uniswap, in any case we do the</a>
<a name="247"><span class="lineNum"> 247 </span> : // legacy calculation and return the fee value</a>
<a name="248"><span class="lineNum"> 248 </span><span class="lineCov"> 16 : return uint160(</span></a>
<a name="249"><span class="lineNum"> 249 </span> : _instance.logic.denomination().mul(price).div(UniswapV3OracleHelper.RATIO_DIVIDER).mul(</a>
<a name="250"><span class="lineNum"> 250 </span> : uint256(_instance.fee.percent)</a>
<a name="251"><span class="lineNum"> 251 </span> : ).div(uint256(_instance.fee.divisor))</a>
<a name="252"><span class="lineNum"> 252 </span> : );</a>
<a name="253"><span class="lineNum"> 253 </span> : }</a>
<a name="254"><span class="lineNum"> 254 </span> : </a>
<a name="255"><span class="lineNum"> 255 </span> : function getChainedOracleNameForInstance(ITornadoInstance _instance)</a>
<a name="256"><span class="lineNum"> 256 </span> : public</a>
<a name="257"><span class="lineNum"> 257 </span> : view</a>
<a name="258"><span class="lineNum"> 258 </span> : virtual</a>
<a name="259"><span class="lineNum"> 259 </span> : returns (string memory)</a>
<a name="260"><span class="lineNum"> 260 </span> : {</a>
<a name="261"><span class="lineNum"> 261 </span><span class="lineCov"> 1 : return chainedPriceOracleNames[getChainedOracleHashForInstance(_instance)];</span></a>
<a name="262"><span class="lineNum"> 262 </span> : }</a>
<a name="263"><span class="lineNum"> 263 </span> : </a>
<a name="264"><span class="lineNum"> 264 </span> : function getChainedOracleNameForOracleHash(bytes32 _oracleHash)</a>
<a name="265"><span class="lineNum"> 265 </span> : public</a>
<a name="266"><span class="lineNum"> 266 </span> : view</a>
<a name="267"><span class="lineNum"> 267 </span> : virtual</a>
<a name="268"><span class="lineNum"> 268 </span> : returns (string memory)</a>
<a name="269"><span class="lineNum"> 269 </span> : {</a>
<a name="270"><span class="lineNum"> 270 </span><span class="lineCov"> 1 : return chainedPriceOracleNames[_oracleHash];</span></a>
<a name="271"><span class="lineNum"> 271 </span> : }</a>
<a name="272"><span class="lineNum"> 272 </span> : </a>
<a name="273"><span class="lineNum"> 273 </span> : function getChainedOracleHashForInstance(ITornadoInstance _instance)</a>
<a name="274"><span class="lineNum"> 274 </span> : public</a>
<a name="275"><span class="lineNum"> 275 </span> : view</a>
<a name="276"><span class="lineNum"> 276 </span> : virtual</a>
<a name="277"><span class="lineNum"> 277 </span> : returns (bytes32)</a>
<a name="278"><span class="lineNum"> 278 </span> : {</a>
<a name="279"><span class="lineNum"> 279 </span><span class="lineCov"> 2 : return keccak256(chainedPriceOracles[_instance]);</span></a>
<a name="280"><span class="lineNum"> 280 </span> : }</a>
<a name="281"><span class="lineNum"> 281 </span> : </a>
<a name="282"><span class="lineNum"> 282 </span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SETTERS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */</a>
<a name="283"><span class="lineNum"> 283 </span> : </a>
<a name="284"><span class="lineNum"> 284 </span> : function modifyChainedOracleForInstance(</a>
<a name="285"><span class="lineNum"> 285 </span> : ITornadoInstance _instance,</a>
<a name="286"><span class="lineNum"> 286 </span> : ICurvePriceOracle[] memory _oracles,</a>
<a name="287"><span class="lineNum"> 287 </span> : bytes4[] memory _selectors,</a>
<a name="288"><span class="lineNum"> 288 </span> : uint8[] memory _coins,</a>
<a name="289"><span class="lineNum"> 289 </span> : bool[] memory _invertPrice,</a>
<a name="290"><span class="lineNum"> 290 </span> : string memory _name</a>
<a name="291"><span class="lineNum"> 291 </span> : ) public virtual onlyGovernance {</a>
<a name="292"><span class="lineNum"> 292 </span><span class="lineCov"> 12 : bytes memory oracle = _oracles.createChainedOracle(_selectors, _coins, _invertPrice);</span></a>
<a name="293"><span class="lineNum"> 293 </span><span class="lineCov"> 12 : bytes32 oracleHash = keccak256(oracle);</span></a>
<a name="236"><span class="lineNum"> 236 </span> : // ETH PER TOKEN * TORN PER ETH = TORN PER TOKEN</a>
<a name="237"><span class="lineNum"> 237 </span><span class="lineCov"> 16 : if (tornOracleIsUniswap) {</span></a>
<a name="238"><span class="lineNum"> 238 </span><span class="lineCov"> 15 : price = price</span></a>
<a name="239"><span class="lineNum"> 239 </span> : * uniswapFeeOracle.getTORNPerToken(</a>
<a name="240"><span class="lineNum"> 240 </span> : IERC20(UniswapV3OracleHelper.WETH), _instance.fee.updateInterval</a>
<a name="241"><span class="lineNum"> 241 </span> : ) / UniswapV3OracleHelper.RATIO_DIVIDER;</a>
<a name="242"><span class="lineNum"> 242 </span> : }</a>
<a name="243"><span class="lineNum"> 243 </span> : </a>
<a name="244"><span class="lineNum"> 244 </span> : // DENOMINATION IN TOKEN * TORN PER TOKEN * FEE_NUMERATOR / FEE_DIVISOR = FEE IN TORN</a>
<a name="245"><span class="lineNum"> 245 </span><span class="lineCov"> 16 : return uint160(</span></a>
<a name="246"><span class="lineNum"> 246 </span> : _instance.logic.denomination().mul(price).div(UniswapV3OracleHelper.RATIO_DIVIDER).mul(</a>
<a name="247"><span class="lineNum"> 247 </span> : uint256(_instance.fee.percent)</a>
<a name="248"><span class="lineNum"> 248 </span> : ).div(uint256(_instance.fee.divisor))</a>
<a name="249"><span class="lineNum"> 249 </span> : );</a>
<a name="250"><span class="lineNum"> 250 </span> : }</a>
<a name="251"><span class="lineNum"> 251 </span> : </a>
<a name="252"><span class="lineNum"> 252 </span> : function getChainedOracleNameForInstance(ITornadoInstance _instance)</a>
<a name="253"><span class="lineNum"> 253 </span> : public</a>
<a name="254"><span class="lineNum"> 254 </span> : view</a>
<a name="255"><span class="lineNum"> 255 </span> : virtual</a>
<a name="256"><span class="lineNum"> 256 </span> : returns (string memory)</a>
<a name="257"><span class="lineNum"> 257 </span> : {</a>
<a name="258"><span class="lineNum"> 258 </span><span class="lineCov"> 1 : return chainedPriceOracleNames[getChainedOracleHashForInstance(_instance)];</span></a>
<a name="259"><span class="lineNum"> 259 </span> : }</a>
<a name="260"><span class="lineNum"> 260 </span> : </a>
<a name="261"><span class="lineNum"> 261 </span> : function getChainedOracleNameForOracleHash(bytes32 _oracleHash)</a>
<a name="262"><span class="lineNum"> 262 </span> : public</a>
<a name="263"><span class="lineNum"> 263 </span> : view</a>
<a name="264"><span class="lineNum"> 264 </span> : virtual</a>
<a name="265"><span class="lineNum"> 265 </span> : returns (string memory)</a>
<a name="266"><span class="lineNum"> 266 </span> : {</a>
<a name="267"><span class="lineNum"> 267 </span><span class="lineCov"> 1 : return chainedPriceOracleNames[_oracleHash];</span></a>
<a name="268"><span class="lineNum"> 268 </span> : }</a>
<a name="269"><span class="lineNum"> 269 </span> : </a>
<a name="270"><span class="lineNum"> 270 </span> : function getChainedOracleHashForInstance(ITornadoInstance _instance)</a>
<a name="271"><span class="lineNum"> 271 </span> : public</a>
<a name="272"><span class="lineNum"> 272 </span> : view</a>
<a name="273"><span class="lineNum"> 273 </span> : virtual</a>
<a name="274"><span class="lineNum"> 274 </span> : returns (bytes32)</a>
<a name="275"><span class="lineNum"> 275 </span> : {</a>
<a name="276"><span class="lineNum"> 276 </span><span class="lineCov"> 2 : return keccak256(chainedPriceOracles[_instance]);</span></a>
<a name="277"><span class="lineNum"> 277 </span> : }</a>
<a name="278"><span class="lineNum"> 278 </span> : </a>
<a name="279"><span class="lineNum"> 279 </span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SETTERS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */</a>
<a name="280"><span class="lineNum"> 280 </span> : </a>
<a name="281"><span class="lineNum"> 281 </span> : function modifyChainedOracleForInstance(</a>
<a name="282"><span class="lineNum"> 282 </span> : ITornadoInstance _instance,</a>
<a name="283"><span class="lineNum"> 283 </span> : ICurvePriceOracle[] memory _oracles,</a>
<a name="284"><span class="lineNum"> 284 </span> : bytes4[] memory _selectors,</a>
<a name="285"><span class="lineNum"> 285 </span> : uint8[] memory _coins,</a>
<a name="286"><span class="lineNum"> 286 </span> : bool[] memory _invertPrice,</a>
<a name="287"><span class="lineNum"> 287 </span> : string memory _name</a>
<a name="288"><span class="lineNum"> 288 </span> : ) public virtual onlyGovernance {</a>
<a name="289"><span class="lineNum"> 289 </span><span class="lineCov"> 12 : bytes memory oracle = _oracles.createChainedOracle(_selectors, _coins, _invertPrice);</span></a>
<a name="290"><span class="lineNum"> 290 </span><span class="lineCov"> 12 : bytes32 oracleHash = keccak256(oracle);</span></a>
<a name="291"><span class="lineNum"> 291 </span> : </a>
<a name="292"><span class="lineNum"> 292 </span><span class="lineCov"> 12 : chainedPriceOracles[_instance] = oracle;</span></a>
<a name="293"><span class="lineNum"> 293 </span><span class="lineCov"> 12 : chainedPriceOracleNames[oracleHash] = _name;</span></a>
<a name="294"><span class="lineNum"> 294 </span> : </a>
<a name="295"><span class="lineNum"> 295 </span><span class="lineCov"> 12 : chainedPriceOracles[_instance] = oracle;</span></a>
<a name="296"><span class="lineNum"> 296 </span><span class="lineCov"> 12 : chainedPriceOracleNames[oracleHash] = _name;</span></a>
<a name="295"><span class="lineNum"> 295 </span><span class="lineCov"> 12 : emit ChainedOracleUpdated(address(_instance), oracleHash, _name);</span></a>
<a name="296"><span class="lineNum"> 296 </span> : }</a>
<a name="297"><span class="lineNum"> 297 </span> : </a>
<a name="298"><span class="lineNum"> 298 </span><span class="lineCov"> 12 : emit ChainedOracleUpdated(address(_instance), oracleHash, _name);</span></a>
<a name="299"><span class="lineNum"> 299 </span> : }</a>
<a name="300"><span class="lineNum"> 300 </span> : </a>
<a name="301"><span class="lineNum"> 301 </span> : function setUniswapFeeOracle(UniswapFeeOracle _uniswapFeeOracle) public virtual onlyGovernance {</a>
<a name="302"><span class="lineNum"> 302 </span><span class="lineCov"> 2 : uniswapFeeOracle = _uniswapFeeOracle;</span></a>
<a name="303"><span class="lineNum"> 303 </span><span class="lineCov"> 2 : emit UniswapFeeOracleUpdated(address(_uniswapFeeOracle));</span></a>
<a name="304"><span class="lineNum"> 304 </span> : }</a>
<a name="305"><span class="lineNum"> 305 </span> : </a>
<a name="306"><span class="lineNum"> 306 </span> : function setTornOracleIsUniswap(bool _is) public virtual onlyGovernance {</a>
<a name="307"><span class="lineNum"> 307 </span><span class="lineCov"> 1 : tornOracleIsUniswap = _is;</span></a>
<a name="308"><span class="lineNum"> 308 </span><span class="lineCov"> 1 : if (_is) emit TornOracleIsUniswapV3();</span></a>
<a name="309"><span class="lineNum"> 309 </span><span class="lineNoCov"> 0 : else emit TornOracleIsCurve();</span></a>
<a name="310"><span class="lineNum"> 310 </span> : }</a>
<a name="311"><span class="lineNum"> 311 </span> : }</a>
<a name="298"><span class="lineNum"> 298 </span> : function setUniswapFeeOracle(UniswapFeeOracle _uniswapFeeOracle) public virtual onlyGovernance {</a>
<a name="299"><span class="lineNum"> 299 </span><span class="lineCov"> 2 : uniswapFeeOracle = _uniswapFeeOracle;</span></a>
<a name="300"><span class="lineNum"> 300 </span><span class="lineCov"> 2 : emit UniswapFeeOracleUpdated(address(_uniswapFeeOracle));</span></a>
<a name="301"><span class="lineNum"> 301 </span> : }</a>
<a name="302"><span class="lineNum"> 302 </span> : </a>
<a name="303"><span class="lineNum"> 303 </span> : function setTornOracleIsUniswap(bool _is) public virtual onlyGovernance {</a>
<a name="304"><span class="lineNum"> 304 </span><span class="lineCov"> 1 : tornOracleIsUniswap = _is;</span></a>
<a name="305"><span class="lineNum"> 305 </span><span class="lineCov"> 1 : if (_is) emit TornOracleIsUniswapV3();</span></a>
<a name="306"><span class="lineNum"> 306 </span><span class="lineNoCov"> 0 : else emit TornOracleIsCurve();</span></a>
<a name="307"><span class="lineNum"> 307 </span> : }</a>
<a name="308"><span class="lineNum"> 308 </span> : }</a>
</pre>
</td>
</tr>

@ -31,17 +31,17 @@
<td class="headerValue">lcov.info</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">58</td>
<td class="headerCovTableEntry">58</td>
<td class="headerCovTableEntry">59</td>
<td class="headerCovTableEntry">59</td>
<td class="headerCovTableEntryHi">100.0 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">18</td>
<td class="headerCovTableEntry">18</td>
<td class="headerCovTableEntry">19</td>
<td class="headerCovTableEntry">19</td>
<td class="headerCovTableEntryHi">100.0 %</td>
</tr>
<tr>
@ -68,75 +68,79 @@
<td width="20%" class="tableHead">Hit count <span class="tableHeadSort"><img src="../../glass.png" width=10 height=14 alt="Sort by hit count" title="Sort by hit count" border=0></span></td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#331">FeeOracleManager.getAllFeeDeviations</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#348">FeeOracleManager.getAllFeeDeviations</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#335">FeeOracleManager.getFeeDeviationsForInstances</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#352">FeeOracleManager.getFeeDeviationsForInstances</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#318">FeeOracleManager.getFeePercentForInstance</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#335">FeeOracleManager.getFeePercentForInstance</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#322">FeeOracleManager.getFeeUpdateIntervalForInstance</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#339">FeeOracleManager.getFeeUpdateIntervalForInstance</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#278">FeeOracleManager.getUpdatedFeeForInstance</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#295">FeeOracleManager.getUpdatedFeeForInstance</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#274">FeeOracleManager.version</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#291">FeeOracleManager.version</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#291">FeeOracleManager.populateInstanceWithFeeData</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#308">FeeOracleManager.populateInstanceWithFeeData</a></td>
<td class="coverFnHi">2</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#212">FeeOracleManager.setInstanceRegistry</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#224">FeeOracleManager.setInstanceRegistry</a></td>
<td class="coverFnHi">2</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#157">FeeOracleManager.updateFees</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#168">FeeOracleManager.updateFees</a></td>
<td class="coverFnHi">2</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#314">FeeOracleManager.getLastUpdatedTimeForInstance</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#331">FeeOracleManager.getLastUpdatedTimeForInstance</a></td>
<td class="coverFnHi">3</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#264">FeeOracleManager.setFeeUpdateIntervalForInstance</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#276">FeeOracleManager.setFeeUpdateIntervalForInstance</a></td>
<td class="coverFnHi">3</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#149">FeeOracleManager.updateAllFees</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#160">FeeOracleManager.updateAllFees</a></td>
<td class="coverFnHi">4</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#115">FeeOracleManager.initialize</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#127">FeeOracleManager.initialize</a></td>
<td class="coverFnHi">6</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#171">FeeOracleManager.updateFee</a></td>
<td class="coverFnHi">7</td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#284">FeeOracleManager.setFeeUpdater</a></td>
<td class="coverFnHi">8</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#145">FeeOracleManager.instanceFeeWithUpdate</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#156">FeeOracleManager.instanceFeeWithUpdate</a></td>
<td class="coverFnHi">9</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#217">FeeOracleManager.setFeeOracle</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#182">FeeOracleManager.updateFee</a></td>
<td class="coverFnHi">11</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#229">FeeOracleManager.setFeeOracle</a></td>
<td class="coverFnHi">13</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#256">FeeOracleManager.setFeePercentForInstance</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#268">FeeOracleManager.setFeePercentForInstance</a></td>
<td class="coverFnHi">15</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#310">FeeOracleManager.getLastFeeForInstance</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#327">FeeOracleManager.getLastFeeForInstance</a></td>
<td class="coverFnHi">18</td>
</tr>
</table>

@ -31,17 +31,17 @@
<td class="headerValue">lcov.info</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">58</td>
<td class="headerCovTableEntry">58</td>
<td class="headerCovTableEntry">59</td>
<td class="headerCovTableEntry">59</td>
<td class="headerCovTableEntryHi">100.0 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">18</td>
<td class="headerCovTableEntry">18</td>
<td class="headerCovTableEntry">19</td>
<td class="headerCovTableEntry">19</td>
<td class="headerCovTableEntryHi">100.0 %</td>
</tr>
<tr>
@ -68,75 +68,79 @@
<td width="20%" class="tableHead">Hit count <span class="tableHeadSort"><a href="FeeOracleManager.sol.func-sort-c.html"><img src="../../updown.png" width=10 height=14 alt="Sort by hit count" title="Sort by hit count" border=0></a></span></td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#331">FeeOracleManager.getAllFeeDeviations</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#348">FeeOracleManager.getAllFeeDeviations</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#335">FeeOracleManager.getFeeDeviationsForInstances</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#352">FeeOracleManager.getFeeDeviationsForInstances</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#318">FeeOracleManager.getFeePercentForInstance</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#335">FeeOracleManager.getFeePercentForInstance</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#322">FeeOracleManager.getFeeUpdateIntervalForInstance</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#339">FeeOracleManager.getFeeUpdateIntervalForInstance</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#310">FeeOracleManager.getLastFeeForInstance</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#327">FeeOracleManager.getLastFeeForInstance</a></td>
<td class="coverFnHi">18</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#314">FeeOracleManager.getLastUpdatedTimeForInstance</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#331">FeeOracleManager.getLastUpdatedTimeForInstance</a></td>
<td class="coverFnHi">3</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#278">FeeOracleManager.getUpdatedFeeForInstance</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#295">FeeOracleManager.getUpdatedFeeForInstance</a></td>
<td class="coverFnHi">1</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#115">FeeOracleManager.initialize</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#127">FeeOracleManager.initialize</a></td>
<td class="coverFnHi">6</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#145">FeeOracleManager.instanceFeeWithUpdate</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#156">FeeOracleManager.instanceFeeWithUpdate</a></td>
<td class="coverFnHi">9</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#291">FeeOracleManager.populateInstanceWithFeeData</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#308">FeeOracleManager.populateInstanceWithFeeData</a></td>
<td class="coverFnHi">2</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#217">FeeOracleManager.setFeeOracle</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#229">FeeOracleManager.setFeeOracle</a></td>
<td class="coverFnHi">13</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#256">FeeOracleManager.setFeePercentForInstance</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#268">FeeOracleManager.setFeePercentForInstance</a></td>
<td class="coverFnHi">15</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#264">FeeOracleManager.setFeeUpdateIntervalForInstance</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#276">FeeOracleManager.setFeeUpdateIntervalForInstance</a></td>
<td class="coverFnHi">3</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#212">FeeOracleManager.setInstanceRegistry</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#284">FeeOracleManager.setFeeUpdater</a></td>
<td class="coverFnHi">8</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#224">FeeOracleManager.setInstanceRegistry</a></td>
<td class="coverFnHi">2</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#149">FeeOracleManager.updateAllFees</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#160">FeeOracleManager.updateAllFees</a></td>
<td class="coverFnHi">4</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#171">FeeOracleManager.updateFee</a></td>
<td class="coverFnHi">7</td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#182">FeeOracleManager.updateFee</a></td>
<td class="coverFnHi">11</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#157">FeeOracleManager.updateFees</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#168">FeeOracleManager.updateFees</a></td>
<td class="coverFnHi">2</td>
</tr>
<tr>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#274">FeeOracleManager.version</a></td>
<td class="coverFn"><a href="FeeOracleManager.sol.gcov.html#291">FeeOracleManager.version</a></td>
<td class="coverFnHi">1</td>
</tr>
</table>

@ -31,17 +31,17 @@
<td class="headerValue">lcov.info</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">58</td>
<td class="headerCovTableEntry">58</td>
<td class="headerCovTableEntry">59</td>
<td class="headerCovTableEntry">59</td>
<td class="headerCovTableEntryHi">100.0 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2023-06-17 18:06:30</td>
<td class="headerValue">2023-06-17 20:06:59</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">18</td>
<td class="headerCovTableEntry">18</td>
<td class="headerCovTableEntry">19</td>
<td class="headerCovTableEntry">19</td>
<td class="headerCovTableEntryHi">100.0 %</td>
</tr>
<tr>
@ -106,9 +106,9 @@
<a name="36"><span class="lineNum"> 36 </span> : uint32 private _deprecatedUniswapTimePeriod;</a>
<a name="37"><span class="lineNum"> 37 </span> : </a>
<a name="38"><span class="lineNum"> 38 </span> : /**</a>
<a name="39"><span class="lineNum"> 39 </span> : * @dev From first contract, the only value we keep alive</a>
<a name="39"><span class="lineNum"> 39 </span> : * @dev From first contract</a>
<a name="40"><span class="lineNum"> 40 </span> : */</a>
<a name="41"><span class="lineNum"> 41 </span> : uint24 internal _oldFeeUpdateInterval;</a>
<a name="41"><span class="lineNum"> 41 </span> : uint24 private _deprecatedFeeUpdateInterval;</a>
<a name="42"><span class="lineNum"> 42 </span> : </a>
<a name="43"><span class="lineNum"> 43 </span> : /**</a>
<a name="44"><span class="lineNum"> 44 </span> : * @dev From first contract, only used for initialization to preserve old values</a>
@ -146,288 +146,305 @@
<a name="76"><span class="lineNum"> 76 </span> : IERC20 public immutable torn;</a>
<a name="77"><span class="lineNum"> 77 </span> : </a>
<a name="78"><span class="lineNum"> 78 </span> : /**</a>
<a name="79"><span class="lineNum"> 79 </span> : * @notice The InstanceRegistry contract</a>
<a name="79"><span class="lineNum"> 79 </span> : * @notice The contract which is allowed to update instance fees</a>
<a name="80"><span class="lineNum"> 80 </span> : */</a>
<a name="81"><span class="lineNum"> 81 </span> : InstanceRegistry public instanceRegistry;</a>
<a name="81"><span class="lineNum"> 81 </span> : address public feeUpdaterAddress;</a>
<a name="82"><span class="lineNum"> 82 </span> : </a>
<a name="83"><span class="lineNum"> 83 </span> : /**</a>
<a name="84"><span class="lineNum"> 84 </span> : * @notice Each instance has a dedicated fee oracle, these only compute the values</a>
<a name="84"><span class="lineNum"> 84 </span> : * @notice The InstanceRegistry contract</a>
<a name="85"><span class="lineNum"> 85 </span> : */</a>
<a name="86"><span class="lineNum"> 86 </span> : mapping(ITornadoInstance =&gt; IFeeOracle) public instanceFeeOracles;</a>
<a name="86"><span class="lineNum"> 86 </span> : InstanceRegistry public instanceRegistry;</a>
<a name="87"><span class="lineNum"> 87 </span> : </a>
<a name="88"><span class="lineNum"> 88 </span> : /**</a>
<a name="89"><span class="lineNum"> 89 </span> : * @notice The data for each instance will be stored in this contract</a>
<a name="89"><span class="lineNum"> 89 </span> : * @notice Each instance has a dedicated fee oracle, these only compute the values</a>
<a name="90"><span class="lineNum"> 90 </span> : */</a>
<a name="91"><span class="lineNum"> 91 </span> : mapping(ITornadoInstance =&gt; FeeData) public feesByInstance;</a>
<a name="91"><span class="lineNum"> 91 </span> : mapping(ITornadoInstance =&gt; IFeeOracle) public instanceFeeOracles;</a>
<a name="92"><span class="lineNum"> 92 </span> : </a>
<a name="93"><span class="lineNum"> 93 </span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EVENTS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */</a>
<a name="94"><span class="lineNum"> 94 </span> : </a>
<a name="95"><span class="lineNum"> 95 </span> : event FeeUpdateIntervalUpdated(uint24 newLimit);</a>
<a name="96"><span class="lineNum"> 96 </span> : event FeeUpdated(address indexed instance, uint256 newFee);</a>
<a name="97"><span class="lineNum"> 97 </span> : event OracleUpdated(address indexed instance, address oracle);</a>
<a name="98"><span class="lineNum"> 98 </span> : event InstanceFeePercentUpdated(address indexed instance, uint32 newFeePercent);</a>
<a name="99"><span class="lineNum"> 99 </span> : event InstanceRegistryUpdated(address newAddress);</a>
<a name="100"><span class="lineNum"> 100 </span> : </a>
<a name="101"><span class="lineNum"> 101 </span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LOGIC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */</a>
<a name="102"><span class="lineNum"> 102 </span> : </a>
<a name="103"><span class="lineNum"> 103 </span> : constructor(address _tornTokenAddress, address _governanceProxyAddress) public {</a>
<a name="104"><span class="lineNum"> 104 </span> : torn = IERC20(_tornTokenAddress);</a>
<a name="105"><span class="lineNum"> 105 </span> : governanceProxyAddress = _governanceProxyAddress;</a>
<a name="106"><span class="lineNum"> 106 </span> : }</a>
<a name="93"><span class="lineNum"> 93 </span> : /**</a>
<a name="94"><span class="lineNum"> 94 </span> : * @notice The data for each instance will be stored in this contract</a>
<a name="95"><span class="lineNum"> 95 </span> : */</a>
<a name="96"><span class="lineNum"> 96 </span> : mapping(ITornadoInstance =&gt; FeeData) public feesByInstance;</a>
<a name="97"><span class="lineNum"> 97 </span> : </a>
<a name="98"><span class="lineNum"> 98 </span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EVENTS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */</a>
<a name="99"><span class="lineNum"> 99 </span> : </a>
<a name="100"><span class="lineNum"> 100 </span> : event FeeUpdated(address indexed instance, uint256 newFee);</a>
<a name="101"><span class="lineNum"> 101 </span> : event FeeUpdateIntervalUpdated(uint24 newLimit);</a>
<a name="102"><span class="lineNum"> 102 </span> : event InstanceFeePercentUpdated(address indexed instance, uint32 newFeePercent);</a>
<a name="103"><span class="lineNum"> 103 </span> : </a>
<a name="104"><span class="lineNum"> 104 </span> : event OracleUpdated(address indexed instance, address oracle);</a>
<a name="105"><span class="lineNum"> 105 </span> : event InstanceRegistryUpdated(address newAddress);</a>
<a name="106"><span class="lineNum"> 106 </span> : event FeeUpdaterUpdated(address newFeeUpdaterAddress);</a>
<a name="107"><span class="lineNum"> 107 </span> : </a>
<a name="108"><span class="lineNum"> 108 </span> : modifier onlyGovernance() {</a>
<a name="109"><span class="lineNum"> 109 </span> : require(msg.sender == governanceProxyAddress, &quot;FeeOracleManager: onlyGovernance&quot;);</a>
<a name="110"><span class="lineNum"> 110 </span> : _;</a>
<a name="111"><span class="lineNum"> 111 </span> : }</a>
<a name="112"><span class="lineNum"> 112 </span> : </a>
<a name="113"><span class="lineNum"> 113 </span> : /**</a>
<a name="114"><span class="lineNum"> 114 </span> : * @dev If there will be a need to initialize the proxy again, simply pad storage and inherit again,</a>
<a name="115"><span class="lineNum"> 115 </span> : * making sure to not reference old data anywhere.</a>
<a name="116"><span class="lineNum"> 116 </span> : */</a>
<a name="117"><span class="lineNum"> 117 </span> : function initialize(</a>
<a name="118"><span class="lineNum"> 118 </span> : address _uniswapFeeOracle,</a>
<a name="119"><span class="lineNum"> 119 </span> : address _instanceRegistryAddress,</a>
<a name="120"><span class="lineNum"> 120 </span> : ITornadoInstance[] memory _instances,</a>
<a name="121"><span class="lineNum"> 121 </span> : uint256[] memory _percents</a>
<a name="122"><span class="lineNum"> 122 </span> : ) external onlyGovernance initializer {</a>
<a name="123"><span class="lineNum"> 123 </span> : // Get num of existing instances</a>
<a name="124"><span class="lineNum"> 124 </span><span class="lineCov"> 4 : uint256 numInstances = _instances.length;</span></a>
<a name="125"><span class="lineNum"> 125 </span><span class="lineCov"> 4 : uint32 feeUpdateInterval = _oldFeeUpdateInterval;</span></a>
<a name="126"><span class="lineNum"> 126 </span> : </a>
<a name="127"><span class="lineNum"> 127 </span><span class="lineCov"> 4 : for (uint256 i = 0; i &lt; numInstances; i++) {</span></a>
<a name="128"><span class="lineNum"> 128 </span> : // For each instance</a>
<a name="129"><span class="lineNum"> 129 </span><span class="lineCov"> 68 : ITornadoInstance instance = _instances[i];</span></a>
<a name="130"><span class="lineNum"> 130 </span> : </a>
<a name="131"><span class="lineNum"> 131 </span> : // Store it's old data and the percent fees which Governance will command</a>
<a name="132"><span class="lineNum"> 132 </span><span class="lineCov"> 68 : feesByInstance[instance] = FeeData({</span></a>
<a name="133"><span class="lineNum"> 133 </span> : amount: _oldFeesForInstance[instance],</a>
<a name="134"><span class="lineNum"> 134 </span> : percent: uint32(_percents[i]),</a>
<a name="135"><span class="lineNum"> 135 </span> : updateInterval: feeUpdateInterval,</a>
<a name="136"><span class="lineNum"> 136 </span> : lastUpdateTime: uint32(_oldFeesForInstanceUpdateTime[instance])</a>
<a name="137"><span class="lineNum"> 137 </span> : });</a>
<a name="138"><span class="lineNum"> 138 </span> : </a>
<a name="139"><span class="lineNum"> 139 </span> : // All old pools use the uniswap fee oracle</a>
<a name="140"><span class="lineNum"> 140 </span><span class="lineCov"> 68 : instanceFeeOracles[instance] = IFeeOracle(_uniswapFeeOracle);</span></a>
<a name="141"><span class="lineNum"> 141 </span> : }</a>
<a name="142"><span class="lineNum"> 142 </span> : </a>
<a name="143"><span class="lineNum"> 143 </span> : // Finally also store the instance registry</a>
<a name="144"><span class="lineNum"> 144 </span><span class="lineCov"> 4 : instanceRegistry = InstanceRegistry(_instanceRegistryAddress);</span></a>
<a name="145"><span class="lineNum"> 145 </span> : }</a>
<a name="146"><span class="lineNum"> 146 </span> : </a>
<a name="147"><span class="lineNum"> 147 </span> : function instanceFeeWithUpdate(ITornadoInstance _instance) public virtual returns (uint160) {</a>
<a name="148"><span class="lineNum"> 148 </span><span class="lineCov"> 9 : return updateFee(_instance, true);</span></a>
<a name="149"><span class="lineNum"> 149 </span> : }</a>
<a name="150"><span class="lineNum"> 150 </span> : </a>
<a name="151"><span class="lineNum"> 151 </span> : function updateAllFees(bool _respectFeeUpdateInterval)</a>
<a name="152"><span class="lineNum"> 152 </span> : public</a>
<a name="153"><span class="lineNum"> 153 </span> : virtual</a>
<a name="154"><span class="lineNum"> 154 </span> : returns (uint160[] memory newFees)</a>
<a name="155"><span class="lineNum"> 155 </span> : {</a>
<a name="156"><span class="lineNum"> 156 </span><span class="lineCov"> 4 : return updateFees(instanceRegistry.getAllInstances(), _respectFeeUpdateInterval);</span></a>
<a name="157"><span class="lineNum"> 157 </span> : }</a>
<a name="158"><span class="lineNum"> 158 </span> : </a>
<a name="159"><span class="lineNum"> 159 </span> : function updateFees(ITornadoInstance[] memory _instances, bool _respectFeeUpdateInterval)</a>
<a name="160"><span class="lineNum"> 160 </span> : public</a>
<a name="161"><span class="lineNum"> 161 </span> : virtual</a>
<a name="162"><span class="lineNum"> 162 </span> : returns (uint160[] memory newFees)</a>
<a name="163"><span class="lineNum"> 163 </span> : {</a>
<a name="164"><span class="lineNum"> 164 </span><span class="lineCov"> 6 : uint256 numInstances = _instances.length;</span></a>
<a name="165"><span class="lineNum"> 165 </span> : </a>
<a name="166"><span class="lineNum"> 166 </span><span class="lineCov"> 6 : newFees = new uint160[](numInstances);</span></a>
<a name="167"><span class="lineNum"> 167 </span> : </a>
<a name="168"><span class="lineNum"> 168 </span><span class="lineCov"> 6 : for (uint256 i = 0; i &lt; numInstances; i++) {</span></a>
<a name="169"><span class="lineNum"> 169 </span><span class="lineCov"> 86 : newFees[i] = updateFee(_instances[i], _respectFeeUpdateInterval);</span></a>
<a name="170"><span class="lineNum"> 170 </span> : }</a>
<a name="171"><span class="lineNum"> 171 </span> : }</a>
<a name="172"><span class="lineNum"> 172 </span> : </a>
<a name="173"><span class="lineNum"> 173 </span> : function updateFee(ITornadoInstance _instance, bool _respectFeeUpdateInterval)</a>
<a name="174"><span class="lineNum"> 174 </span> : public</a>
<a name="175"><span class="lineNum"> 175 </span> : virtual</a>
<a name="176"><span class="lineNum"> 176 </span> : returns (uint160)</a>
<a name="177"><span class="lineNum"> 177 </span> : {</a>
<a name="178"><span class="lineNum"> 178 </span> : // Get fee data &amp; oracle</a>
<a name="179"><span class="lineNum"> 179 </span><span class="lineCov"> 102 : FeeData memory fee = feesByInstance[_instance];</span></a>
<a name="180"><span class="lineNum"> 180 </span><span class="lineCov"> 102 : IFeeOracle oracle = instanceFeeOracles[_instance];</span></a>
<a name="181"><span class="lineNum"> 181 </span> : </a>
<a name="182"><span class="lineNum"> 182 </span> : // Check whether the instance is registered</a>
<a name="183"><span class="lineNum"> 183 </span><span class="lineCov"> 102 : require(address(oracle) != address(0), &quot;FeeOracleManager: instance has no oracle&quot;);</span></a>
<a name="184"><span class="lineNum"> 184 </span> : </a>
<a name="185"><span class="lineNum"> 185 </span> : // Now update if we do not respect the interval or we respect it and are in the interval</a>
<a name="186"><span class="lineNum"> 186 </span><span class="lineCov"> 102 : if (!_respectFeeUpdateInterval || (fee.updateInterval &lt;= now - fee.lastUpdateTime)) {</span></a>
<a name="187"><span class="lineNum"> 187 </span> : // Prepare data for the process</a>
<a name="188"><span class="lineNum"> 188 </span><span class="lineCov"> 94 : InstanceWithFee memory _feeInstance = populateInstanceWithFeeData(_instance, fee);</span></a>
<a name="189"><span class="lineNum"> 189 </span> : </a>
<a name="190"><span class="lineNum"> 190 </span> : // Allow oracle to gate for fee manager and implement own logic</a>
<a name="191"><span class="lineNum"> 191 </span><span class="lineCov"> 94 : oracle.update(torn, _feeInstance);</span></a>
<a name="192"><span class="lineNum"> 192 </span> : </a>
<a name="193"><span class="lineNum"> 193 </span> : // There must a be a fee set otherwise it's just 0</a>
<a name="194"><span class="lineNum"> 194 </span><span class="lineCov"> 94 : fee.amount = fee.percent != 0 ? oracle.getFee(torn, _feeInstance) : 0;</span></a>
<a name="195"><span class="lineNum"> 195 </span> : </a>
<a name="196"><span class="lineNum"> 196 </span> : // Store</a>
<a name="197"><span class="lineNum"> 197 </span><span class="lineCov"> 94 : feesByInstance[_instance] = FeeData({</span></a>
<a name="198"><span class="lineNum"> 198 </span> : amount: fee.amount,</a>
<a name="199"><span class="lineNum"> 199 </span> : percent: fee.percent,</a>
<a name="200"><span class="lineNum"> 200 </span> : updateInterval: fee.updateInterval,</a>
<a name="201"><span class="lineNum"> 201 </span> : lastUpdateTime: uint32(now)</a>
<a name="202"><span class="lineNum"> 202 </span> : });</a>
<a name="203"><span class="lineNum"> 203 </span> : </a>
<a name="204"><span class="lineNum"> 204 </span> : // Log</a>
<a name="205"><span class="lineNum"> 205 </span><span class="lineCov"> 94 : emit FeeUpdated(address(_instance), fee.amount);</span></a>
<a name="206"><span class="lineNum"> 206 </span> : }</a>
<a name="108"><span class="lineNum"> 108 </span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LOGIC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */</a>
<a name="109"><span class="lineNum"> 109 </span> : </a>
<a name="110"><span class="lineNum"> 110 </span> : constructor(address _tornTokenAddress, address _governanceProxyAddress) public {</a>
<a name="111"><span class="lineNum"> 111 </span> : torn = IERC20(_tornTokenAddress);</a>
<a name="112"><span class="lineNum"> 112 </span> : governanceProxyAddress = _governanceProxyAddress;</a>
<a name="113"><span class="lineNum"> 113 </span> : }</a>
<a name="114"><span class="lineNum"> 114 </span> : </a>
<a name="115"><span class="lineNum"> 115 </span> : modifier onlyGovernance() {</a>
<a name="116"><span class="lineNum"> 116 </span> : require(msg.sender == governanceProxyAddress, &quot;FeeOracleManager: onlyGovernance&quot;);</a>
<a name="117"><span class="lineNum"> 117 </span> : _;</a>
<a name="118"><span class="lineNum"> 118 </span> : }</a>
<a name="119"><span class="lineNum"> 119 </span> : </a>
<a name="120"><span class="lineNum"> 120 </span> : modifier onlyFeeUpdater() {</a>
<a name="121"><span class="lineNum"> 121 </span> : require(msg.sender == feeUpdaterAddress, &quot;FeeOracleManager: onlyFeeUpdater&quot;);</a>
<a name="122"><span class="lineNum"> 122 </span> : _;</a>
<a name="123"><span class="lineNum"> 123 </span> : }</a>
<a name="124"><span class="lineNum"> 124 </span> : </a>
<a name="125"><span class="lineNum"> 125 </span> : /**</a>
<a name="126"><span class="lineNum"> 126 </span> : * @dev If there will be a need to initialize the proxy again, simply pad storage and inherit again,</a>
<a name="127"><span class="lineNum"> 127 </span> : * making sure to not reference old data anywhere.</a>
<a name="128"><span class="lineNum"> 128 </span> : */</a>
<a name="129"><span class="lineNum"> 129 </span> : function initialize(</a>
<a name="130"><span class="lineNum"> 130 </span> : address _uniswapFeeOracle,</a>
<a name="131"><span class="lineNum"> 131 </span> : address _instanceRegistryAddress,</a>
<a name="132"><span class="lineNum"> 132 </span> : ITornadoInstance[] memory _instances,</a>
<a name="133"><span class="lineNum"> 133 </span> : uint256[] memory _percents</a>
<a name="134"><span class="lineNum"> 134 </span> : ) external onlyGovernance initializer {</a>
<a name="135"><span class="lineNum"> 135 </span> : // Get num of existing instances</a>
<a name="136"><span class="lineNum"> 136 </span><span class="lineCov"> 4 : uint256 numInstances = _instances.length;</span></a>
<a name="137"><span class="lineNum"> 137 </span> : </a>
<a name="138"><span class="lineNum"> 138 </span><span class="lineCov"> 4 : for (uint256 i = 0; i &lt; numInstances; i++) {</span></a>
<a name="139"><span class="lineNum"> 139 </span> : // For each instance</a>
<a name="140"><span class="lineNum"> 140 </span><span class="lineCov"> 68 : ITornadoInstance instance = _instances[i];</span></a>
<a name="141"><span class="lineNum"> 141 </span> : </a>
<a name="142"><span class="lineNum"> 142 </span> : // Store it's old data and the percent fees which Governance will command</a>
<a name="143"><span class="lineNum"> 143 </span><span class="lineCov"> 68 : feesByInstance[instance] = FeeData({</span></a>
<a name="144"><span class="lineNum"> 144 </span> : amount: _oldFeesForInstance[instance],</a>
<a name="145"><span class="lineNum"> 145 </span> : percent: uint32(_percents[i]),</a>
<a name="146"><span class="lineNum"> 146 </span> : updateInterval: 6 hours,</a>
<a name="147"><span class="lineNum"> 147 </span> : lastUpdateTime: uint32(_oldFeesForInstanceUpdateTime[instance])</a>
<a name="148"><span class="lineNum"> 148 </span> : });</a>
<a name="149"><span class="lineNum"> 149 </span> : </a>
<a name="150"><span class="lineNum"> 150 </span> : // All old pools use the uniswap fee oracle</a>
<a name="151"><span class="lineNum"> 151 </span><span class="lineCov"> 68 : instanceFeeOracles[instance] = IFeeOracle(_uniswapFeeOracle);</span></a>
<a name="152"><span class="lineNum"> 152 </span> : }</a>
<a name="153"><span class="lineNum"> 153 </span> : </a>
<a name="154"><span class="lineNum"> 154 </span> : // Finally also store the instance registry</a>
<a name="155"><span class="lineNum"> 155 </span><span class="lineCov"> 4 : instanceRegistry = InstanceRegistry(_instanceRegistryAddress);</span></a>
<a name="156"><span class="lineNum"> 156 </span> : }</a>
<a name="157"><span class="lineNum"> 157 </span> : </a>
<a name="158"><span class="lineNum"> 158 </span> : function instanceFeeWithUpdate(ITornadoInstance _instance) public virtual returns (uint160) {</a>
<a name="159"><span class="lineNum"> 159 </span><span class="lineCov"> 9 : return updateFee(_instance, true);</span></a>
<a name="160"><span class="lineNum"> 160 </span> : }</a>
<a name="161"><span class="lineNum"> 161 </span> : </a>
<a name="162"><span class="lineNum"> 162 </span> : function updateAllFees(bool _respectFeeUpdateInterval)</a>
<a name="163"><span class="lineNum"> 163 </span> : public</a>
<a name="164"><span class="lineNum"> 164 </span> : virtual</a>
<a name="165"><span class="lineNum"> 165 </span> : returns (uint160[] memory newFees)</a>
<a name="166"><span class="lineNum"> 166 </span> : {</a>
<a name="167"><span class="lineNum"> 167 </span><span class="lineCov"> 4 : return updateFees(instanceRegistry.getAllInstances(), _respectFeeUpdateInterval);</span></a>
<a name="168"><span class="lineNum"> 168 </span> : }</a>
<a name="169"><span class="lineNum"> 169 </span> : </a>
<a name="170"><span class="lineNum"> 170 </span> : function updateFees(ITornadoInstance[] memory _instances, bool _respectFeeUpdateInterval)</a>
<a name="171"><span class="lineNum"> 171 </span> : public</a>
<a name="172"><span class="lineNum"> 172 </span> : virtual</a>
<a name="173"><span class="lineNum"> 173 </span> : returns (uint160[] memory newFees)</a>
<a name="174"><span class="lineNum"> 174 </span> : {</a>
<a name="175"><span class="lineNum"> 175 </span><span class="lineCov"> 6 : uint256 numInstances = _instances.length;</span></a>
<a name="176"><span class="lineNum"> 176 </span> : </a>
<a name="177"><span class="lineNum"> 177 </span><span class="lineCov"> 6 : newFees = new uint160[](numInstances);</span></a>
<a name="178"><span class="lineNum"> 178 </span> : </a>
<a name="179"><span class="lineNum"> 179 </span><span class="lineCov"> 6 : for (uint256 i = 0; i &lt; numInstances; i++) {</span></a>
<a name="180"><span class="lineNum"> 180 </span><span class="lineCov"> 86 : newFees[i] = updateFee(_instances[i], _respectFeeUpdateInterval);</span></a>
<a name="181"><span class="lineNum"> 181 </span> : }</a>
<a name="182"><span class="lineNum"> 182 </span> : }</a>
<a name="183"><span class="lineNum"> 183 </span> : </a>
<a name="184"><span class="lineNum"> 184 </span> : function updateFee(ITornadoInstance _instance, bool _respectFeeUpdateInterval)</a>
<a name="185"><span class="lineNum"> 185 </span> : public</a>
<a name="186"><span class="lineNum"> 186 </span> : virtual</a>
<a name="187"><span class="lineNum"> 187 </span> : onlyFeeUpdater</a>
<a name="188"><span class="lineNum"> 188 </span> : returns (uint160)</a>
<a name="189"><span class="lineNum"> 189 </span> : {</a>
<a name="190"><span class="lineNum"> 190 </span> : // Get fee data &amp; oracle</a>
<a name="191"><span class="lineNum"> 191 </span><span class="lineCov"> 102 : FeeData memory fee = feesByInstance[_instance];</span></a>
<a name="192"><span class="lineNum"> 192 </span><span class="lineCov"> 102 : IFeeOracle oracle = instanceFeeOracles[_instance];</span></a>
<a name="193"><span class="lineNum"> 193 </span> : </a>
<a name="194"><span class="lineNum"> 194 </span> : // Check whether the instance is registered</a>
<a name="195"><span class="lineNum"> 195 </span><span class="lineCov"> 102 : require(address(oracle) != address(0), &quot;FeeOracleManager: instance has no oracle&quot;);</span></a>
<a name="196"><span class="lineNum"> 196 </span> : </a>
<a name="197"><span class="lineNum"> 197 </span> : // Now update if we do not respect the interval or we respect it and are in the interval</a>
<a name="198"><span class="lineNum"> 198 </span><span class="lineCov"> 102 : if (!_respectFeeUpdateInterval || (fee.updateInterval &lt;= now - fee.lastUpdateTime)) {</span></a>
<a name="199"><span class="lineNum"> 199 </span> : // Prepare data for the process</a>
<a name="200"><span class="lineNum"> 200 </span><span class="lineCov"> 94 : InstanceWithFee memory _feeInstance = populateInstanceWithFeeData(_instance, fee);</span></a>
<a name="201"><span class="lineNum"> 201 </span> : </a>
<a name="202"><span class="lineNum"> 202 </span> : // Allow oracle to gate for fee manager and implement own logic</a>
<a name="203"><span class="lineNum"> 203 </span><span class="lineCov"> 94 : oracle.update(torn, _feeInstance);</span></a>
<a name="204"><span class="lineNum"> 204 </span> : </a>
<a name="205"><span class="lineNum"> 205 </span> : // There must a be a fee set otherwise it's just 0</a>
<a name="206"><span class="lineNum"> 206 </span><span class="lineCov"> 94 : uint160 newFee = fee.percent != 0 ? oracle.getFee(torn, _feeInstance) : 0;</span></a>
<a name="207"><span class="lineNum"> 207 </span> : </a>
<a name="208"><span class="lineNum"> 208 </span> : // In any case return a value</a>
<a name="209"><span class="lineNum"> 209 </span><span class="lineCov"> 102 : return fee.amount;</span></a>
<a name="210"><span class="lineNum"> 210 </span> : }</a>
<a name="211"><span class="lineNum"> 211 </span> : </a>
<a name="212"><span class="lineNum"> 212 </span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SETTERS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */</a>
<a name="213"><span class="lineNum"> 213 </span> : </a>
<a name="214"><span class="lineNum"> 214 </span> : function setInstanceRegistry(address _newInstanceRegistryProxyAddress) external onlyGovernance {</a>
<a name="215"><span class="lineNum"> 215 </span><span class="lineCov"> 1 : instanceRegistry = InstanceRegistry(_newInstanceRegistryProxyAddress);</span></a>
<a name="216"><span class="lineNum"> 216 </span><span class="lineCov"> 1 : emit InstanceRegistryUpdated(_newInstanceRegistryProxyAddress);</span></a>
<a name="217"><span class="lineNum"> 217 </span> : }</a>
<a name="218"><span class="lineNum"> 218 </span> : </a>
<a name="219"><span class="lineNum"> 219 </span> : function setFeeOracle(address _instanceAddress, address _oracleAddress) external onlyGovernance {</a>
<a name="220"><span class="lineNum"> 220 </span> : // Prepare all contracts</a>
<a name="221"><span class="lineNum"> 221 </span><span class="lineCov"> 12 : ITornadoInstance instance = ITornadoInstance(_instanceAddress);</span></a>
<a name="222"><span class="lineNum"> 222 </span><span class="lineCov"> 12 : IFeeOracle oracle = IFeeOracle(_oracleAddress);</span></a>
<a name="208"><span class="lineNum"> 208 </span> : // Store</a>
<a name="209"><span class="lineNum"> 209 </span><span class="lineCov"> 94 : feesByInstance[_instance] = FeeData({</span></a>
<a name="210"><span class="lineNum"> 210 </span> : amount: newFee,</a>
<a name="211"><span class="lineNum"> 211 </span> : percent: fee.percent,</a>
<a name="212"><span class="lineNum"> 212 </span> : updateInterval: fee.updateInterval,</a>
<a name="213"><span class="lineNum"> 213 </span> : lastUpdateTime: uint32(now)</a>
<a name="214"><span class="lineNum"> 214 </span> : });</a>
<a name="215"><span class="lineNum"> 215 </span> : </a>
<a name="216"><span class="lineNum"> 216 </span> : // Log</a>
<a name="217"><span class="lineNum"> 217 </span><span class="lineCov"> 94 : emit FeeUpdated(address(_instance), fee.amount);</span></a>
<a name="218"><span class="lineNum"> 218 </span> : }</a>
<a name="219"><span class="lineNum"> 219 </span> : </a>
<a name="220"><span class="lineNum"> 220 </span> : // On update, we still return out the old amount to avoid sandwiching shenanigans</a>
<a name="221"><span class="lineNum"> 221 </span><span class="lineCov"> 102 : return fee.amount;</span></a>
<a name="222"><span class="lineNum"> 222 </span> : }</a>
<a name="223"><span class="lineNum"> 223 </span> : </a>
<a name="224"><span class="lineNum"> 224 </span> : // Nominally fee percent should be set first for an instance, but we cannot be sure</a>
<a name="225"><span class="lineNum"> 225 </span> : // whether fee percent 0 is intentional, so we don't check</a>
<a name="226"><span class="lineNum"> 226 </span><span class="lineCov"> 12 : FeeData memory fee = feesByInstance[instance];</span></a>
<a name="227"><span class="lineNum"> 227 </span> : </a>
<a name="228"><span class="lineNum"> 228 </span> : // An address(0) oracle means we're removing an oracle for an instance</a>
<a name="229"><span class="lineNum"> 229 </span><span class="lineCov"> 12 : if (_oracleAddress != address(0)) {</span></a>
<a name="230"><span class="lineNum"> 230 </span> : // Prepare data for the process</a>
<a name="231"><span class="lineNum"> 231 </span><span class="lineCov"> 11 : InstanceWithFee memory _feeInstance = populateInstanceWithFeeData(instance, fee);</span></a>
<a name="232"><span class="lineNum"> 232 </span> : </a>
<a name="233"><span class="lineNum"> 233 </span> : // Reverts if oracle doesn't implement</a>
<a name="234"><span class="lineNum"> 234 </span><span class="lineCov"> 11 : oracle.update(torn, _feeInstance);</span></a>
<a name="224"><span class="lineNum"> 224 </span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SETTERS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */</a>
<a name="225"><span class="lineNum"> 225 </span> : </a>
<a name="226"><span class="lineNum"> 226 </span> : function setInstanceRegistry(address _newInstanceRegistryProxyAddress) external onlyGovernance {</a>
<a name="227"><span class="lineNum"> 227 </span><span class="lineCov"> 1 : instanceRegistry = InstanceRegistry(_newInstanceRegistryProxyAddress);</span></a>
<a name="228"><span class="lineNum"> 228 </span><span class="lineCov"> 1 : emit InstanceRegistryUpdated(_newInstanceRegistryProxyAddress);</span></a>
<a name="229"><span class="lineNum"> 229 </span> : }</a>
<a name="230"><span class="lineNum"> 230 </span> : </a>
<a name="231"><span class="lineNum"> 231 </span> : function setFeeOracle(address _instanceAddress, address _oracleAddress) external onlyGovernance {</a>
<a name="232"><span class="lineNum"> 232 </span> : // Prepare all contracts</a>
<a name="233"><span class="lineNum"> 233 </span><span class="lineCov"> 12 : ITornadoInstance instance = ITornadoInstance(_instanceAddress);</span></a>
<a name="234"><span class="lineNum"> 234 </span><span class="lineCov"> 12 : IFeeOracle oracle = IFeeOracle(_oracleAddress);</span></a>
<a name="235"><span class="lineNum"> 235 </span> : </a>
<a name="236"><span class="lineNum"> 236 </span> : // Reverts if oracle doesn't implement</a>
<a name="237"><span class="lineNum"> 237 </span><span class="lineCov"> 11 : fee.amount = oracle.getFee(torn, _feeInstance);</span></a>
<a name="238"><span class="lineNum"> 238 </span> : </a>
<a name="239"><span class="lineNum"> 239 </span> : // Note down updated fee</a>
<a name="240"><span class="lineNum"> 240 </span><span class="lineCov"> 11 : feesByInstance[instance] = FeeData({</span></a>
<a name="241"><span class="lineNum"> 241 </span> : amount: fee.amount,</a>
<a name="242"><span class="lineNum"> 242 </span> : percent: fee.percent,</a>
<a name="243"><span class="lineNum"> 243 </span> : updateInterval: fee.updateInterval,</a>
<a name="244"><span class="lineNum"> 244 </span> : lastUpdateTime: uint32(now)</a>
<a name="245"><span class="lineNum"> 245 </span> : });</a>
<a name="246"><span class="lineNum"> 246 </span> : </a>
<a name="247"><span class="lineNum"> 247 </span> : // Log fee update</a>
<a name="248"><span class="lineNum"> 248 </span><span class="lineCov"> 11 : emit FeeUpdated(_instanceAddress, fee.amount);</span></a>
<a name="249"><span class="lineNum"> 249 </span> : }</a>
<a name="236"><span class="lineNum"> 236 </span> : // Nominally fee percent should be set first for an instance, but we cannot be sure</a>
<a name="237"><span class="lineNum"> 237 </span> : // whether fee percent 0 is intentional, so we don't check</a>
<a name="238"><span class="lineNum"> 238 </span><span class="lineCov"> 12 : FeeData memory fee = feesByInstance[instance];</span></a>
<a name="239"><span class="lineNum"> 239 </span> : </a>
<a name="240"><span class="lineNum"> 240 </span> : // An address(0) oracle means we're removing an oracle for an instance</a>
<a name="241"><span class="lineNum"> 241 </span><span class="lineCov"> 12 : if (_oracleAddress != address(0)) {</span></a>
<a name="242"><span class="lineNum"> 242 </span> : // Prepare data for the process</a>
<a name="243"><span class="lineNum"> 243 </span><span class="lineCov"> 11 : InstanceWithFee memory _feeInstance = populateInstanceWithFeeData(instance, fee);</span></a>
<a name="244"><span class="lineNum"> 244 </span> : </a>
<a name="245"><span class="lineNum"> 245 </span> : // Reverts if oracle doesn't implement</a>
<a name="246"><span class="lineNum"> 246 </span><span class="lineCov"> 11 : oracle.update(torn, _feeInstance);</span></a>
<a name="247"><span class="lineNum"> 247 </span> : </a>
<a name="248"><span class="lineNum"> 248 </span> : // Reverts if oracle doesn't implement</a>
<a name="249"><span class="lineNum"> 249 </span><span class="lineCov"> 11 : fee.amount = oracle.getFee(torn, _feeInstance);</span></a>
<a name="250"><span class="lineNum"> 250 </span> : </a>
<a name="251"><span class="lineNum"> 251 </span> : // Ok, set the oracle</a>
<a name="252"><span class="lineNum"> 252 </span><span class="lineCov"> 12 : instanceFeeOracles[instance] = oracle;</span></a>
<a name="253"><span class="lineNum"> 253 </span> : </a>
<a name="254"><span class="lineNum"> 254 </span> : // Log oracle update</a>
<a name="255"><span class="lineNum"> 255 </span><span class="lineCov"> 12 : emit OracleUpdated(_instanceAddress, _oracleAddress);</span></a>
<a name="256"><span class="lineNum"> 256 </span> : }</a>
<a name="257"><span class="lineNum"> 257 </span> : </a>
<a name="258"><span class="lineNum"> 258 </span> : function setFeePercentForInstance(ITornadoInstance _instance, uint32 _newFeePercent)</a>
<a name="259"><span class="lineNum"> 259 </span> : external</a>
<a name="260"><span class="lineNum"> 260 </span> : onlyGovernance</a>
<a name="261"><span class="lineNum"> 261 </span> : {</a>
<a name="262"><span class="lineNum"> 262 </span><span class="lineCov"> 14 : feesByInstance[_instance].percent = _newFeePercent;</span></a>
<a name="263"><span class="lineNum"> 263 </span><span class="lineCov"> 14 : emit InstanceFeePercentUpdated(address(_instance), _newFeePercent);</span></a>
<a name="264"><span class="lineNum"> 264 </span> : }</a>
<a name="251"><span class="lineNum"> 251 </span> : // Note down updated fee</a>
<a name="252"><span class="lineNum"> 252 </span><span class="lineCov"> 11 : feesByInstance[instance] = FeeData({</span></a>
<a name="253"><span class="lineNum"> 253 </span> : amount: fee.amount,</a>
<a name="254"><span class="lineNum"> 254 </span> : percent: fee.percent,</a>
<a name="255"><span class="lineNum"> 255 </span> : updateInterval: fee.updateInterval,</a>
<a name="256"><span class="lineNum"> 256 </span> : lastUpdateTime: uint32(now)</a>
<a name="257"><span class="lineNum"> 257 </span> : });</a>
<a name="258"><span class="lineNum"> 258 </span> : </a>
<a name="259"><span class="lineNum"> 259 </span> : // Log fee update</a>
<a name="260"><span class="lineNum"> 260 </span><span class="lineCov"> 11 : emit FeeUpdated(_instanceAddress, fee.amount);</span></a>
<a name="261"><span class="lineNum"> 261 </span> : }</a>
<a name="262"><span class="lineNum"> 262 </span> : </a>
<a name="263"><span class="lineNum"> 263 </span> : // Ok, set the oracle</a>
<a name="264"><span class="lineNum"> 264 </span><span class="lineCov"> 12 : instanceFeeOracles[instance] = oracle;</span></a>
<a name="265"><span class="lineNum"> 265 </span> : </a>
<a name="266"><span class="lineNum"> 266 </span> : function setFeeUpdateIntervalForInstance(ITornadoInstance _instance, uint24 newLimit)</a>
<a name="267"><span class="lineNum"> 267 </span> : external</a>
<a name="268"><span class="lineNum"> 268 </span> : onlyGovernance</a>
<a name="269"><span class="lineNum"> 269 </span> : {</a>
<a name="270"><span class="lineNum"> 270 </span><span class="lineCov"> 2 : feesByInstance[_instance].updateInterval = newLimit;</span></a>
<a name="271"><span class="lineNum"> 271 </span><span class="lineCov"> 2 : emit FeeUpdateIntervalUpdated(newLimit);</span></a>
<a name="272"><span class="lineNum"> 272 </span> : }</a>
<a name="273"><span class="lineNum"> 273 </span> : </a>
<a name="274"><span class="lineNum"> 274 </span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GETTERS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */</a>
<a name="275"><span class="lineNum"> 275 </span> : </a>
<a name="276"><span class="lineNum"> 276 </span> : function version() public pure virtual returns (string memory) {</a>
<a name="277"><span class="lineNum"> 277 </span><span class="lineCov"> 1 : return &quot;v2-oracle-manager&quot;;</span></a>
<a name="278"><span class="lineNum"> 278 </span> : }</a>
<a name="279"><span class="lineNum"> 279 </span> : </a>
<a name="280"><span class="lineNum"> 280 </span> : function getUpdatedFeeForInstance(ITornadoInstance instance) public view virtual returns (uint160) {</a>
<a name="281"><span class="lineNum"> 281 </span><span class="lineCov"> 1 : return instanceFeeOracles[instance].getFee(torn, populateInstanceWithFeeData(instance));</span></a>
<a name="282"><span class="lineNum"> 282 </span> : }</a>
<a name="283"><span class="lineNum"> 283 </span> : </a>
<a name="284"><span class="lineNum"> 284 </span> : function populateInstanceWithFeeData(ITornadoInstance _regularInstance)</a>
<a name="285"><span class="lineNum"> 285 </span> : public</a>
<a name="286"><span class="lineNum"> 286 </span> : view</a>
<a name="287"><span class="lineNum"> 287 </span> : virtual</a>
<a name="288"><span class="lineNum"> 288 </span> : returns (InstanceWithFee memory)</a>
<a name="289"><span class="lineNum"> 289 </span> : {</a>
<a name="290"><span class="lineNum"> 290 </span><span class="lineCov"> 3 : return populateInstanceWithFeeData(_regularInstance, feesByInstance[_regularInstance]);</span></a>
<a name="291"><span class="lineNum"> 291 </span> : }</a>
<a name="266"><span class="lineNum"> 266 </span> : // Log oracle update</a>
<a name="267"><span class="lineNum"> 267 </span><span class="lineCov"> 12 : emit OracleUpdated(_instanceAddress, _oracleAddress);</span></a>
<a name="268"><span class="lineNum"> 268 </span> : }</a>
<a name="269"><span class="lineNum"> 269 </span> : </a>
<a name="270"><span class="lineNum"> 270 </span> : function setFeePercentForInstance(ITornadoInstance _instance, uint32 _newFeePercent)</a>
<a name="271"><span class="lineNum"> 271 </span> : external</a>
<a name="272"><span class="lineNum"> 272 </span> : onlyGovernance</a>
<a name="273"><span class="lineNum"> 273 </span> : {</a>
<a name="274"><span class="lineNum"> 274 </span><span class="lineCov"> 14 : feesByInstance[_instance].percent = _newFeePercent;</span></a>
<a name="275"><span class="lineNum"> 275 </span><span class="lineCov"> 14 : emit InstanceFeePercentUpdated(address(_instance), _newFeePercent);</span></a>
<a name="276"><span class="lineNum"> 276 </span> : }</a>
<a name="277"><span class="lineNum"> 277 </span> : </a>
<a name="278"><span class="lineNum"> 278 </span> : function setFeeUpdateIntervalForInstance(ITornadoInstance _instance, uint24 newLimit)</a>
<a name="279"><span class="lineNum"> 279 </span> : external</a>
<a name="280"><span class="lineNum"> 280 </span> : onlyGovernance</a>
<a name="281"><span class="lineNum"> 281 </span> : {</a>
<a name="282"><span class="lineNum"> 282 </span><span class="lineCov"> 2 : feesByInstance[_instance].updateInterval = newLimit;</span></a>
<a name="283"><span class="lineNum"> 283 </span><span class="lineCov"> 2 : emit FeeUpdateIntervalUpdated(newLimit);</span></a>
<a name="284"><span class="lineNum"> 284 </span> : }</a>
<a name="285"><span class="lineNum"> 285 </span> : </a>
<a name="286"><span class="lineNum"> 286 </span> : function setFeeUpdater(address _newFeeUpdaterAddress) external onlyGovernance {</a>
<a name="287"><span class="lineNum"> 287 </span><span class="lineCov"> 8 : feeUpdaterAddress = _newFeeUpdaterAddress;</span></a>
<a name="288"><span class="lineNum"> 288 </span><span class="lineCov"> 8 : emit FeeUpdaterUpdated(_newFeeUpdaterAddress);</span></a>
<a name="289"><span class="lineNum"> 289 </span> : }</a>
<a name="290"><span class="lineNum"> 290 </span> : </a>
<a name="291"><span class="lineNum"> 291 </span> : /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GETTERS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */</a>
<a name="292"><span class="lineNum"> 292 </span> : </a>
<a name="293"><span class="lineNum"> 293 </span> : function populateInstanceWithFeeData(ITornadoInstance _regularInstance, FeeData memory _fee)</a>
<a name="294"><span class="lineNum"> 294 </span> : public</a>
<a name="295"><span class="lineNum"> 295 </span> : view</a>
<a name="296"><span class="lineNum"> 296 </span> : virtual</a>
<a name="297"><span class="lineNum"> 297 </span> : returns (InstanceWithFee memory)</a>
<a name="298"><span class="lineNum"> 298 </span> : {</a>
<a name="299"><span class="lineNum"> 299 </span><span class="lineCov"> 126 : return InstanceWithFee({</span></a>
<a name="300"><span class="lineNum"> 300 </span> : logic: _regularInstance,</a>
<a name="301"><span class="lineNum"> 301 </span> : state: instanceRegistry.getInstanceState(_regularInstance),</a>
<a name="302"><span class="lineNum"> 302 </span> : fee: FeeDataForOracle({</a>
<a name="303"><span class="lineNum"> 303 </span> : amount: _fee.amount,</a>
<a name="304"><span class="lineNum"> 304 </span> : percent: _fee.percent,</a>
<a name="305"><span class="lineNum"> 305 </span> : divisor: FEE_PERCENT_DIVISOR,</a>
<a name="306"><span class="lineNum"> 306 </span> : updateInterval: _fee.updateInterval,</a>
<a name="307"><span class="lineNum"> 307 </span> : lastUpdateTime: _fee.lastUpdateTime</a>
<a name="308"><span class="lineNum"> 308 </span> : })</a>
<a name="309"><span class="lineNum"> 309 </span> : });</a>
<a name="310"><span class="lineNum"> 310 </span> : }</a>
<a name="311"><span class="lineNum"> 311 </span> : </a>
<a name="312"><span class="lineNum"> 312 </span> : function getLastFeeForInstance(ITornadoInstance instance) public view virtual returns (uint160) {</a>
<a name="313"><span class="lineNum"> 313 </span><span class="lineCov"> 18 : return feesByInstance[instance].amount;</span></a>
<a name="314"><span class="lineNum"> 314 </span> : }</a>
<a name="315"><span class="lineNum"> 315 </span> : </a>
<a name="316"><span class="lineNum"> 316 </span> : function getLastUpdatedTimeForInstance(ITornadoInstance instance) public view virtual returns (uint32) {</a>
<a name="317"><span class="lineNum"> 317 </span><span class="lineCov"> 3 : return feesByInstance[instance].lastUpdateTime;</span></a>
<a name="318"><span class="lineNum"> 318 </span> : }</a>
<a name="319"><span class="lineNum"> 319 </span> : </a>
<a name="320"><span class="lineNum"> 320 </span> : function getFeePercentForInstance(ITornadoInstance instance) public view virtual returns (uint32) {</a>
<a name="321"><span class="lineNum"> 321 </span><span class="lineCov"> 1 : return feesByInstance[instance].percent;</span></a>
<a name="322"><span class="lineNum"> 322 </span> : }</a>
<a name="323"><span class="lineNum"> 323 </span> : </a>
<a name="324"><span class="lineNum"> 324 </span> : function getFeeUpdateIntervalForInstance(ITornadoInstance instance)</a>
<a name="325"><span class="lineNum"> 325 </span> : public</a>
<a name="326"><span class="lineNum"> 326 </span> : view</a>
<a name="327"><span class="lineNum"> 327 </span> : virtual</a>
<a name="328"><span class="lineNum"> 328 </span> : returns (uint32)</a>
<a name="329"><span class="lineNum"> 329 </span> : {</a>
<a name="330"><span class="lineNum"> 330 </span><span class="lineCov"> 1 : return feesByInstance[instance].updateInterval;</span></a>
<a name="293"><span class="lineNum"> 293 </span> : function version() public pure virtual returns (string memory) {</a>
<a name="294"><span class="lineNum"> 294 </span><span class="lineCov"> 1 : return &quot;v2-oracle-manager&quot;;</span></a>
<a name="295"><span class="lineNum"> 295 </span> : }</a>
<a name="296"><span class="lineNum"> 296 </span> : </a>
<a name="297"><span class="lineNum"> 297 </span> : function getUpdatedFeeForInstance(ITornadoInstance instance) public view virtual returns (uint160) {</a>
<a name="298"><span class="lineNum"> 298 </span><span class="lineCov"> 1 : return instanceFeeOracles[instance].getFee(torn, populateInstanceWithFeeData(instance));</span></a>
<a name="299"><span class="lineNum"> 299 </span> : }</a>
<a name="300"><span class="lineNum"> 300 </span> : </a>
<a name="301"><span class="lineNum"> 301 </span> : function populateInstanceWithFeeData(ITornadoInstance _regularInstance)</a>
<a name="302"><span class="lineNum"> 302 </span> : public</a>
<a name="303"><span class="lineNum"> 303 </span> : view</a>
<a name="304"><span class="lineNum"> 304 </span> : virtual</a>
<a name="305"><span class="lineNum"> 305 </span> : returns (InstanceWithFee memory)</a>
<a name="306"><span class="lineNum"> 306 </span> : {</a>
<a name="307"><span class="lineNum"> 307 </span><span class="lineCov"> 3 : return populateInstanceWithFeeData(_regularInstance, feesByInstance[_regularInstance]);</span></a>
<a name="308"><span class="lineNum"> 308 </span> : }</a>
<a name="309"><span class="lineNum"> 309 </span> : </a>
<a name="310"><span class="lineNum"> 310 </span> : function populateInstanceWithFeeData(ITornadoInstance _regularInstance, FeeData memory _fee)</a>
<a name="311"><span class="lineNum"> 311 </span> : public</a>
<a name="312"><span class="lineNum"> 312 </span> : view</a>
<a name="313"><span class="lineNum"> 313 </span> : virtual</a>
<a name="314"><span class="lineNum"> 314 </span> : returns (InstanceWithFee memory)</a>
<a name="315"><span class="lineNum"> 315 </span> : {</a>
<a name="316"><span class="lineNum"> 316 </span><span class="lineCov"> 126 : return InstanceWithFee({</span></a>
<a name="317"><span class="lineNum"> 317 </span> : logic: _regularInstance,</a>
<a name="318"><span class="lineNum"> 318 </span> : state: instanceRegistry.getInstanceState(_regularInstance),</a>
<a name="319"><span class="lineNum"> 319 </span> : fee: FeeDataForOracle({</a>
<a name="320"><span class="lineNum"> 320 </span> : amount: _fee.amount,</a>
<a name="321"><span class="lineNum"> 321 </span> : percent: _fee.percent,</a>
<a name="322"><span class="lineNum"> 322 </span> : divisor: FEE_PERCENT_DIVISOR,</a>
<a name="323"><span class="lineNum"> 323 </span> : updateInterval: _fee.updateInterval,</a>
<a name="324"><span class="lineNum"> 324 </span> : lastUpdateTime: _fee.lastUpdateTime</a>
<a name="325"><span class="lineNum"> 325 </span> : })</a>
<a name="326"><span class="lineNum"> 326 </span> : });</a>
<a name="327"><span class="lineNum"> 327 </span> : }</a>
<a name="328"><span class="lineNum"> 328 </span> : </a>
<a name="329"><span class="lineNum"> 329 </span> : function getLastFeeForInstance(ITornadoInstance instance) public view virtual returns (uint160) {</a>
<a name="330"><span class="lineNum"> 330 </span><span class="lineCov"> 18 : return feesByInstance[instance].amount;</span></a>
<a name="331"><span class="lineNum"> 331 </span> : }</a>
<a name="332"><span class="lineNum"> 332 </span> : </a>
<a name="333"><span class="lineNum"> 333 </span> : function getAllFeeDeviations() public view virtual returns (int256[] memory) {</a>
<a name="334"><span class="lineNum"> 334 </span><span class="lineCov"> 1 : return getFeeDeviationsForInstances(instanceRegistry.getAllInstances());</span></a>
<a name="333"><span class="lineNum"> 333 </span> : function getLastUpdatedTimeForInstance(ITornadoInstance instance) public view virtual returns (uint32) {</a>
<a name="334"><span class="lineNum"> 334 </span><span class="lineCov"> 3 : return feesByInstance[instance].lastUpdateTime;</span></a>
<a name="335"><span class="lineNum"> 335 </span> : }</a>
<a name="336"><span class="lineNum"> 336 </span> : </a>
<a name="337"><span class="lineNum"> 337 </span> : function getFeeDeviationsForInstances(ITornadoInstance[] memory _instances)</a>
<a name="338"><span class="lineNum"> 338 </span> : public</a>
<a name="339"><span class="lineNum"> 339 </span> : view</a>
<a name="340"><span class="lineNum"> 340 </span> : virtual</a>
<a name="341"><span class="lineNum"> 341 </span> : returns (int256[] memory deviations)</a>
<a name="342"><span class="lineNum"> 342 </span> : {</a>
<a name="343"><span class="lineNum"> 343 </span><span class="lineCov"> 2 : uint256 numInstances = _instances.length;</span></a>
<a name="344"><span class="lineNum"> 344 </span> : </a>
<a name="345"><span class="lineNum"> 345 </span><span class="lineCov"> 2 : deviations = new int256[](numInstances);</span></a>
<a name="346"><span class="lineNum"> 346 </span> : </a>
<a name="347"><span class="lineNum"> 347 </span><span class="lineCov"> 2 : for (uint256 i = 0; i &lt; numInstances; i++) {</span></a>
<a name="348"><span class="lineNum"> 348 </span><span class="lineCov"> 18 : ITornadoInstance instance = _instances[i];</span></a>
<a name="337"><span class="lineNum"> 337 </span> : function getFeePercentForInstance(ITornadoInstance instance) public view virtual returns (uint32) {</a>
<a name="338"><span class="lineNum"> 338 </span><span class="lineCov"> 1 : return feesByInstance[instance].percent;</span></a>
<a name="339"><span class="lineNum"> 339 </span> : }</a>
<a name="340"><span class="lineNum"> 340 </span> : </a>
<a name="341"><span class="lineNum"> 341 </span> : function getFeeUpdateIntervalForInstance(ITornadoInstance instance)</a>
<a name="342"><span class="lineNum"> 342 </span> : public</a>
<a name="343"><span class="lineNum"> 343 </span> : view</a>
<a name="344"><span class="lineNum"> 344 </span> : virtual</a>
<a name="345"><span class="lineNum"> 345 </span> : returns (uint32)</a>
<a name="346"><span class="lineNum"> 346 </span> : {</a>
<a name="347"><span class="lineNum"> 347 </span><span class="lineCov"> 1 : return feesByInstance[instance].updateInterval;</span></a>
<a name="348"><span class="lineNum"> 348 </span> : }</a>
<a name="349"><span class="lineNum"> 349 </span> : </a>
<a name="350"><span class="lineNum"> 350 </span><span class="lineCov"> 18 : FeeData memory fee = feesByInstance[instance];</span></a>
<a name="351"><span class="lineNum"> 351 </span> : </a>
<a name="352"><span class="lineNum"> 352 </span><span class="lineCov"> 18 : uint256 marketFee =</span></a>
<a name="353"><span class="lineNum"> 353 </span><span class="lineCov"> 18 : instanceFeeOracles[instance].getFee(torn, populateInstanceWithFeeData(instance, fee));</span></a>
<a name="354"><span class="lineNum"> 354 </span> : </a>
<a name="355"><span class="lineNum"> 355 </span><span class="lineCov"> 18 : if (marketFee != 0) {</span></a>
<a name="356"><span class="lineNum"> 356 </span><span class="lineCov"> 9 : deviations[i] = int256((fee.amount * 1000) / marketFee) - 1000;</span></a>
<a name="357"><span class="lineNum"> 357 </span> : }</a>
<a name="358"><span class="lineNum"> 358 </span> : }</a>
<a name="359"><span class="lineNum"> 359 </span> : }</a>
<a name="360"><span class="lineNum"> 360 </span> : }</a>
<a name="350"><span class="lineNum"> 350 </span> : function getAllFeeDeviations() public view virtual returns (int256[] memory) {</a>
<a name="351"><span class="lineNum"> 351 </span><span class="lineCov"> 1 : return getFeeDeviationsForInstances(instanceRegistry.getAllInstances());</span></a>
<a name="352"><span class="lineNum"> 352 </span> : }</a>
<a name="353"><span class="lineNum"> 353 </span> : </a>
<a name="354"><span class="lineNum"> 354 </span> : function getFeeDeviationsForInstances(ITornadoInstance[] memory _instances)</a>
<a name="355"><span class="lineNum"> 355 </span> : public</a>
<a name="356"><span class="lineNum"> 356 </span> : view</a>
<a name="357"><span class="lineNum"> 357 </span> : virtual</a>
<a name="358"><span class="lineNum"> 358 </span> : returns (int256[] memory deviations)</a>
<a name="359"><span class="lineNum"> 359 </span> : {</a>
<a name="360"><span class="lineNum"> 360 </span><span class="lineCov"> 2 : uint256 numInstances = _instances.length;</span></a>
<a name="361"><span class="lineNum"> 361 </span> : </a>
<a name="362"><span class="lineNum"> 362 </span><span class="lineCov"> 2 : deviations = new int256[](numInstances);</span></a>
<a name="363"><span class="lineNum"> 363 </span> : </a>
<a name="364"><span class="lineNum"> 364 </span><span class="lineCov"> 2 : for (uint256 i = 0; i &lt; numInstances; i++) {</span></a>
<a name="365"><span class="lineNum"> 365 </span><span class="lineCov"> 18 : ITornadoInstance instance = _instances[i];</span></a>
<a name="366"><span class="lineNum"> 366 </span> : </a>
<a name="367"><span class="lineNum"> 367 </span><span class="lineCov"> 18 : FeeData memory fee = feesByInstance[instance];</span></a>
<a name="368"><span class="lineNum"> 368 </span> : </a>
<a name="369"><span class="lineNum"> 369 </span><span class="lineCov"> 18 : uint256 marketFee =</span></a>
<a name="370"><span class="lineNum"> 370 </span><span class="lineCov"> 18 : instanceFeeOracles[instance].getFee(torn, populateInstanceWithFeeData(instance, fee));</span></a>
<a name="371"><span class="lineNum"> 371 </span> : </a>
<a name="372"><span class="lineNum"> 372 </span><span class="lineCov"> 18 : if (marketFee != 0) {</span></a>
<a name="373"><span class="lineNum"> 373 </span><span class="lineCov"> 9 : deviations[i] = int256((fee.amount * 1000) / marketFee) - 1000;</span></a>
<a name="374"><span class="lineNum"> 374 </span> : }</a>
<a name="375"><span class="lineNum"> 375 </span> : }</a>
<a name="376"><span class="lineNum"> 376 </span> : }</a>
<a name="377"><span class="lineNum"> 377 </span> : }</a>
</pre>
</td>
</tr>

Some files were not shown because too many files have changed in this diff Show More