Skip to content

Commit

Permalink
Improve code + prepare doc for release
Browse files Browse the repository at this point in the history
  • Loading branch information
rya-sge committed Dec 11, 2024
1 parent e3b2b0f commit abec953
Show file tree
Hide file tree
Showing 173 changed files with 6,051 additions and 5,032 deletions.
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,32 @@

Please follow [https://changelog.md/](https://changelog.md/) conventions.

## Checklist

> Before a new release, perform the following tasks
## v2.0.3
- Code: Update the version name, variable VERSION
- Run linter

> npm run-script lint:all:prettier
- Documentation
- Perform a code coverage and update the files in the corresponding directory [./doc/coverage](./doc/coverage)
- Perform an audit with several audit tools (Mythril and Slither), update the report in the corresponding directory [./doc/security/audits/tools](./doc/security/audits/tools)
- Update surya doc by running the 3 scripts in [./doc/script](./doc/script)
- Update changelog

## v2.0.4

- Fix a bug present in the Conditional Transfer rule and the corresponding test.
- Config file:
- Set Solidity version to 0.8.27 in config file
- Set EVM version to `Cancun`
- Add events for the following rules : whitelist/blacklist and sanctionList rules
- Some improvements in testing
- Integration test with CMTAT: set the CMTAT version to [v2.5.1](https://github.com/CMTA/CMTAT/releases/tag/v2.5.1)

## v2.0.3 - 20240910

- Small optimization in WhitelistWrapper; add a break in a loop
- Set Solidity version to 0.8.26 in config file
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ The RuleEngine is an external contract used to apply transfer restrictions to an

The toolchain includes the following components, where the versions are the latest ones that we tested:

- Foundry
- Solidity 0.8.26 (via solc-js)
- OpenZeppelin Contracts (submodule) [v5.0.2](https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v5.0.2)
- Foundry [v1.9.4](https://github.com/foundry-rs/forge-std/releases/tag/v1.9.4)
- Solidity 0.8.27 (via solc-js)
- OpenZeppelin Contracts (submodule) [v5.1.0](https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v5.0.2)
- CMTAT [v2.5.1](https://github.com/CMTA/CMTAT/releases/tag/v2.5.1)

## How to include it

Expand All @@ -33,6 +34,8 @@ Before each transfer, your contract must call the function `operateOnTransfer` w
#### Global

> npm run-script uml
>
> No longer works, generate the following error: RangeError: Maximum call stack size exceeded
![uml](./doc/schema/classDiagram.svg)

Expand All @@ -41,6 +44,12 @@ Before each transfer, your contract must call the function `operateOnTransfer` w
#### RuleEngine

> npm run-script uml:ruleEngine
>
> No longer works, instead:
>
> forge flatten src/RuleEngine.sol -o RuleEngine.sol
>
> npx sol2uml class RuleEngine.sol
![uml](./doc/schema/RuleEngine.svg)

Expand Down Expand Up @@ -111,8 +120,6 @@ You will find the report performed with [Slither](https://github.com/crytic/slit
| Version | File |
| ------- | ------------------------------------------------------------ |
| latest | [slither-report.md](./doc/security/audits/tools/slither-report.md) |
| v1.0.2 | [v1.0.2-slither-report.md](./doc/security/audits/archive/v1.0.2-slither-report.md) |
| v1.0.3 | [v1.0.3-slither-report.md](./doc/security/audits/archive/v1.0.3-slither-report.md) |



Expand Down
142 changes: 77 additions & 65 deletions doc/coverage/coverage/index-sort-b.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,27 @@
<td class="headerValue">lcov.info</td>
<td></td>
<td class="headerItem">Lines:</td>
<td class="headerCovTableEntry">397</td>
<td class="headerCovTableEntry">430</td>
<td class="headerCovTableEntryHi">92.3 %</td>
<td class="headerCovTableEntry">470</td>
<td class="headerCovTableEntry">502</td>
<td class="headerCovTableEntryHi">93.6 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2024-09-09 16:58:34</td>
<td class="headerValue">2024-12-11 15:33:42</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">99</td>
<td class="headerCovTableEntry">108</td>
<td class="headerCovTableEntryHi">91.7 %</td>
<td class="headerCovTableEntry">117</td>
<td class="headerCovTableEntry">125</td>
<td class="headerCovTableEntryHi">93.6 %</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td class="headerItem">Branches:</td>
<td class="headerCovTableEntry">162</td>
<td class="headerCovTableEntry">176</td>
<td class="headerCovTableEntryHi">92.0 %</td>
<td class="headerCovTableEntry">122</td>
<td class="headerCovTableEntry">124</td>
<td class="headerCovTableEntryHi">98.4 %</td>
</tr>
<tr><td><img src="glass.png" width=3 height=3 alt=""></td></tr>
</table>
Expand Down Expand Up @@ -87,107 +87,119 @@
<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 / 27</td>
<td class="coverNumLo">0 / 26</td>
<td class="coverPerLo">0.0&nbsp;%</td>
<td class="coverNumLo">0 / 2</td>
<td class="coverPerLo">0.0&nbsp;%</td>
<td class="coverNumLo">0 / 2</td>
</tr>
<tr>
<td class="coverFile"><a href="src/rules/validation/abstract/RuleAddressList/index.html">src/rules/validation/abstract/RuleAddressList</a></td>
<td class="coverFile"><a href="test/RuleConditionalTransfer/index.html">test/RuleConditionalTransfer</a></td>
<td class="coverBar" align="center">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="emerald.png" width=97 height=10 alt="97.1%"><img src="snow.png" width=3 height=10 alt="97.1%"></td></tr></table>
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="emerald.png" width=100 height=10 alt="100.0%"></td></tr></table>
</td>
<td class="coverPerHi">97.1&nbsp;%</td>
<td class="coverNumHi">34 / 35</td>
<td class="coverPerHi">93.8&nbsp;%</td>
<td class="coverNumHi">15 / 16</td>
<td class="coverPerMed">75.0&nbsp;%</td>
<td class="coverNumMed">6 / 8</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">10 / 10</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">1 / 1</td>
<td class="coverPerHi">-</td>
<td class="coverNumHi">0 / 0</td>
</tr>
<tr>
<td class="coverFile"><a href="src/index.html">src</a></td>
<td class="coverFile"><a href="test/utils/index.html">test/utils</a></td>
<td class="coverBar" align="center">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="emerald.png" width=97 height=10 alt="96.6%"><img src="snow.png" width=3 height=10 alt="96.6%"></td></tr></table>
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="amber.png" width=86 height=10 alt="85.7%"><img src="snow.png" width=14 height=10 alt="85.7%"></td></tr></table>
</td>
<td class="coverPerHi">96.6&nbsp;%</td>
<td class="coverNumHi">28 / 29</td>
<td class="coverPerMed">85.7&nbsp;%</td>
<td class="coverNumMed">6 / 7</td>
<td class="coverPerMed">80.0&nbsp;%</td>
<td class="coverNumMed">8 / 10</td>
<td class="coverNumMed">4 / 5</td>
<td class="coverPerHi">-</td>
<td class="coverNumHi">0 / 0</td>
</tr>
<tr>
<td class="coverFile"><a href="src/rules/operation/index.html">src/rules/operation</a></td>
<td class="coverFile"><a href="src/rules/validation/abstract/index.html">src/rules/validation/abstract</a></td>
<td class="coverBar" align="center">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="emerald.png" width=99 height=10 alt="98.8%"><img src="snow.png" width=1 height=10 alt="98.8%"></td></tr></table>
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="emerald.png" width=100 height=10 alt="100.0%"></td></tr></table>
</td>
<td class="coverPerHi">98.8&nbsp;%</td>
<td class="coverNumHi">85 / 86</td>
<td class="coverPerHi">93.8&nbsp;%</td>
<td class="coverNumHi">15 / 16</td>
<td class="coverPerHi">90.5&nbsp;%</td>
<td class="coverNumHi">38 / 42</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">10 / 10</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">3 / 3</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">4 / 4</td>
</tr>
<tr>
<td class="coverFile"><a href="src/rules/validation/index.html">src/rules/validation</a></td>
<td class="coverFile"><a href="src/rules/validation/abstract/RuleAddressList/index.html">src/rules/validation/abstract/RuleAddressList</a></td>
<td class="coverBar" align="center">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="emerald.png" width=97 height=10 alt="96.6%"><img src="snow.png" width=3 height=10 alt="96.6%"></td></tr></table>
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="emerald.png" width=98 height=10 alt="97.8%"><img src="snow.png" width=2 height=10 alt="97.8%"></td></tr></table>
</td>
<td class="coverPerHi">96.6&nbsp;%</td>
<td class="coverNumHi">56 / 58</td>
<td class="coverPerMed">86.7&nbsp;%</td>
<td class="coverNumMed">13 / 15</td>
<td class="coverPerHi">93.8&nbsp;%</td>
<td class="coverNumHi">30 / 32</td>
<td class="coverPerHi">97.8&nbsp;%</td>
<td class="coverNumHi">44 / 45</td>
<td class="coverPerHi">94.4&nbsp;%</td>
<td class="coverNumHi">17 / 18</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">6 / 6</td>
</tr>
<tr>
<td class="coverFile"><a href="src/modules/index.html">src/modules</a></td>
<td class="coverFile"><a href="src/index.html">src</a></td>
<td class="coverBar" align="center">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="emerald.png" width=100 height=10 alt="100.0%"></td></tr></table>
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="emerald.png" width=97 height=10 alt="97.4%"><img src="snow.png" width=3 height=10 alt="97.4%"></td></tr></table>
</td>
<td class="coverPerHi">97.4&nbsp;%</td>
<td class="coverNumHi">38 / 39</td>
<td class="coverPerMed">88.9&nbsp;%</td>
<td class="coverNumMed">8 / 9</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">82 / 82</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">27 / 27</td>
<td class="coverPerHi">95.8&nbsp;%</td>
<td class="coverNumHi">23 / 24</td>
<td class="coverNumHi">8 / 8</td>
</tr>
<tr>
<td class="coverFile"><a href="src/rules/operation/abstract/index.html">src/rules/operation/abstract</a></td>
<td class="coverFile"><a href="src/modules/index.html">src/modules</a></td>
<td class="coverBar" align="center">
<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">99 / 99</td>
<td class="coverPerHi">94.7&nbsp;%</td>
<td class="coverNumHi">18 / 19</td>
<td class="coverPerHi">98.1&nbsp;%</td>
<td class="coverNumHi">53 / 54</td>
<td class="coverNumHi">81 / 81</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">27 / 27</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">12 / 12</td>
</tr>
<tr>
<td class="coverFile"><a href="test/utils/index.html">test/utils</a></td>
<td class="coverFile"><a href="src/rules/operation/index.html">src/rules/operation</a></td>
<td class="coverBar" align="center">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="ruby.png" width=67 height=10 alt="66.7%"><img src="snow.png" width=33 height=10 alt="66.7%"></td></tr></table>
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="emerald.png" width=99 height=10 alt="99.0%"><img src="snow.png" width=1 height=10 alt="99.0%"></td></tr></table>
</td>
<td class="coverPerLo">66.7&nbsp;%</td>
<td class="coverNumLo">2 / 3</td>
<td class="coverPerLo">66.7&nbsp;%</td>
<td class="coverNumLo">2 / 3</td>
<td class="coverPerHi">-</td>
<td class="coverNumHi">0 / 0</td>
<td class="coverPerHi">99.0&nbsp;%</td>
<td class="coverNumHi">96 / 97</td>
<td class="coverPerHi">94.4&nbsp;%</td>
<td class="coverNumHi">17 / 18</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">29 / 29</td>
</tr>
<tr>
<td class="coverFile"><a href="src/rules/validation/abstract/index.html">src/rules/validation/abstract</a></td>
<td class="coverFile"><a href="src/rules/operation/abstract/index.html">src/rules/operation/abstract</a></td>
<td class="coverBar" align="center">
<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">11 / 11</td>
<td class="coverNumHi">113 / 113</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">3 / 3</td>
<td class="coverNumHi">20 / 20</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">4 / 4</td>
<td class="coverNumHi">31 / 31</td>
</tr>
<tr>
<td class="coverFile"><a href="src/rules/validation/index.html">src/rules/validation</a></td>
<td class="coverBar" align="center">
<table border=0 cellspacing=0 cellpadding=1><tr><td class="coverBarOutline"><img src="emerald.png" width=97 height=10 alt="97.3%"><img src="snow.png" width=3 height=10 alt="97.3%"></td></tr></table>
</td>
<td class="coverPerHi">97.3&nbsp;%</td>
<td class="coverNumHi">72 / 74</td>
<td class="coverPerHi">90.9&nbsp;%</td>
<td class="coverNumHi">20 / 22</td>
<td class="coverPerHi">100.0&nbsp;%</td>
<td class="coverNumHi">32 / 32</td>
</tr>
</table>
</center>
Expand Down
Loading

0 comments on commit abec953

Please sign in to comment.