Skip to content

Commit

Permalink
Update doc and lib
Browse files Browse the repository at this point in the history
  • Loading branch information
rya-sge committed May 15, 2024
1 parent c53890a commit e4d1fc5
Show file tree
Hide file tree
Showing 113 changed files with 2,391 additions and 1,664 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Please follow [https://changelog.md/](https://changelog.md/) conventions.
- Add the rule ConditionalTransfer as an Operation rule
- Add the rule Blacklist as a Validation rule
- Whitelist and blacklist rules share a part of their code.
- Upgrade the library CMTAT to the version [v2.3.1](https://github.com/CMTA/CMTAT/releases/tag/v2.3.1)
- Upgrade the library CMTAT to the version [v2.4.0](https://github.com/CMTA/CMTAT/releases/tag/v2.4.0)
- Fix a minor bug when rules are deleted with clearRules

## v1.0.3 - 20231122
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ The following rules are available:

| Rule | Type | Description | Doc |
| ------------------------------------------------------------ | -------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| [RuleWhitelist](src/rules/RuleWhitelist.sol) | RuleValidation | This rule can be used to restrict transfers from/to only addresses inside a whitelist. | [RuleWhitelist.md](./doc/technical/RuleWhitelist.md)<br />[surya-report](./doc/surya/surya_report/surya_report_RuleWhitelist.sol.md) |
| [RuleBlacklist](src/rules/RuleBlacklist.sol) | RuleValidation | This rule can be used to forbid transfer from/to addresses in the blacklist | [RuleBlacklist.md](./doc/technical/RuleBlacklist.md)<br />[surya-report](./doc/surya/surya_report/surya_report_RuleBlacklist.sol.md) |
| [RuleSanctionList](src/rules/RuleSanctionList.sol) | RuleValidation | The purpose of this contract is to use the oracle contract from Chainalysis to forbid transfer from/to an address included in a sanctions designation (US, EU, or UN). | [RuleSanctionList.md](./doc/technical/RuleSanctionList.md)<br />[surya-report](./doc/surya/surya_report/surya_report_RuleSanctionList.sol.md) |
| [RuleConditionalTransfer](src/rules/RuleConditionalTransfer.sol) | RuleOperation | This page describes a Conditional Transfer implementation. This rule requires that transfers have to be approved before being executed by the token holders. | [RuleConditionalTransfer.md](./doc/technical/RuleConditionalTransfer.md)<br />[surya-report](./doc/surya/surya_report/surya_report_RuleConditionalTransfer.sol.md) |
| [RuleWhitelist](src/rules/validation/RuleWhitelist.sol) | RuleValidation | This rule can be used to restrict transfers from/to only addresses inside a whitelist. | [RuleWhitelist.md](./doc/technical/RuleWhitelist.md)<br />[surya-report](./doc/surya/surya_report/surya_report_RuleWhitelist.sol.md) |
| [RuleBlacklist](src/rules/validation/RuleBlacklist.sol) | RuleValidation | This rule can be used to forbid transfer from/to addresses in the blacklist | [RuleBlacklist.md](./doc/technical/RuleBlacklist.md)<br />[surya-report](./doc/surya/surya_report/surya_report_RuleBlacklist.sol.md) |
| [RuleSanctionList](src/rules/validation/RuleSanctionList.sol) | RuleValidation | The purpose of this contract is to use the oracle contract from Chainalysis to forbid transfer from/to an address included in a sanctions designation (US, EU, or UN). | [RuleSanctionList.md](./doc/technical/RuleSanctionList.md)<br />[surya-report](./doc/surya/surya_report/surya_report_RuleSanctionList.sol.md) |
| [RuleConditionalTransfer](src/rules/operation/RuleConditionalTransfer.sol) | RuleOperation | This page describes a Conditional Transfer implementation. This rule requires that transfers have to be approved before being executed by the token holders. | [RuleConditionalTransfer.md](./doc/technical/RuleConditionalTransfer.md)<br />[surya-report](./doc/surya/surya_report/surya_report_RuleConditionalTransfer.sol.md) |



Expand Down
20 changes: 10 additions & 10 deletions doc/codelist.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
Here the list of codes used by the different rules

| Contract | Constant name | Value |
| ---------------- | ---------------------------------- | ----- |
| All | TRANSFER_OK (from CMTAT) | 0 |
| RuleWhitelist | CODE_ADDRESS_FROM_NOT_WHITELISTED | 21 |
| RuleWhitelist | CODE_ADDRESS_TO_NOT_WHITELISTED | 22 |
| RuleSanctionList | CODE_ADDRESS_FROM_IS_SANCTIONED | 31 |
| RuleSanctionList | CODE_ADDRESS_TO_IS_SANCTIONED | 32 |
| RuleBlacklist | CODE_ADDRESS_FROM_IS_BLACKLISTED | 41 |
| RuleBlacklist | CODE_ADDRESS_TO_IS_BLACKLISTED | 42 |
| RuleVinkulierung | CODE_TRANSFER_REQUEST_NOT_APPROVED | 51 |
| Contract | Constant name | Value |
| ----------------------- | ---------------------------------- | ----- |
| All | TRANSFER_OK (from CMTAT) | 0 |
| RuleWhitelist | CODE_ADDRESS_FROM_NOT_WHITELISTED | 21 |
| RuleWhitelist | CODE_ADDRESS_TO_NOT_WHITELISTED | 22 |
| RuleSanctionList | CODE_ADDRESS_FROM_IS_SANCTIONED | 31 |
| RuleSanctionList | CODE_ADDRESS_TO_IS_SANCTIONED | 32 |
| RuleBlacklist | CODE_ADDRESS_FROM_IS_BLACKLISTED | 41 |
| RuleBlacklist | CODE_ADDRESS_TO_IS_BLACKLISTED | 42 |
| RuleConditionalTransfer | CODE_TRANSFER_REQUEST_NOT_APPROVED | 51 |



Expand Down
Binary file modified doc/schema/rule/conditionalTransfer-Storage.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/schema/rule/conditionalTransfer-automaticTransfer.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc/schema/rule/conditionalTransfer.drawio

Large diffs are not rendered by default.

Binary file modified doc/schema/rule/conditionalTransferCMTAT.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

| File Name | SHA-1 Hash |
|-------------|--------------|
| ./rules/operation/RuleConditionalTransfer.sol | 474d9ae65276913c7b367dbf47439e3a0558cf7a |
| ./rules/operation/RuleConditionalTransfer.sol | 9e082774ea9e8c645735266d8935f0cea686ef07 |


### Contracts Description Table
Expand All @@ -18,7 +18,10 @@
| **RuleConditionalTransfer** | Implementation | RuleValidateTransfer, IRuleOperation, RuleConditionalTransferOperator, MetaTxModuleStandalone |||
|| <Constructor> | Public ❗️ | 🛑 | MetaTxModuleStandalone |
|| createTransferRequest | Public ❗️ | 🛑 |NO❗️ |
|| createTransferRequestBatch | Public ❗️ | 🛑 |NO❗️ |
|| cancelTransferRequest | Public ❗️ | 🛑 |NO❗️ |
|| cancelTransferRequestBatch | Public ❗️ | 🛑 |NO❗️ |
|| _cancelTransferRequest | Internal 🔒 | 🛑 | |
|| getRequestTrade | Public ❗️ | |NO❗️ |
|| getRequestByStatus | Public ❗️ | |NO❗️ |
|| operateOnTransfer | Public ❗️ | 🛑 | onlyRole |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

| File Name | SHA-1 Hash |
|-------------|--------------|
| ./rules/operation/abstract/RuleConditionalTransferInvariantStorage.sol | 4f6a42a549cb435d490721e8091f34f9ac55fd1c |
| ./rules/operation/abstract/RuleConditionalTransferInvariantStorage.sol | fca0008dbf1e9645944506d01fea4281a5e5208b |


### Contracts Description Table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

| File Name | SHA-1 Hash |
|-------------|--------------|
| ./rules/operation/abstract/RuleConditionalTransferOperator.sol | 76e5a428623395575861a4d45bdc3f5b6f797f7e |
| ./rules/operation/abstract/RuleConditionalTransferOperator.sol | 5e35d28ab99475759783fca1614544e132797487 |


### Contracts Description Table
Expand All @@ -16,6 +16,7 @@
|| **Function Name** | **Visibility** | **Mutability** | **Modifiers** |
||||||
| **RuleConditionalTransferOperator** | Implementation | AccessControl, RuleConditionalTransferInvariantStorage |||
|| setConditionalWhitelist | Public ❗️ | 🛑 | onlyRole |
|| setIssuanceOptions | Public ❗️ | 🛑 | onlyRole |
|| setAutomaticTransfer | Public ❗️ | 🛑 | onlyRole |
|| setTimeLimit | Public ❗️ | 🛑 | onlyRole |
Expand All @@ -24,6 +25,12 @@
|| approveTransferRequest | Public ❗️ | 🛑 | onlyRole |
|| approveTransferRequestWithId | Public ❗️ | 🛑 | onlyRole |
|| resetRequestStatus | Public ❗️ | 🛑 | onlyRole |
|| approveTransferRequestBatchWithId | Public ❗️ | 🛑 | onlyRole |
|| approveTransferRequestBatch | Public ❗️ | 🛑 | onlyRole |
|| createTransferRequestWithApprovalBatch | Public ❗️ | 🛑 | onlyRole |
|| resetRequestStatusBatch | Public ❗️ | 🛑 | onlyRole |
|| _approveTransferRequestKeyElement | Internal 🔒 | 🛑 | |
|| _createTransferRequestWithApproval | Public ❗️ | 🛑 | onlyRole |
|| _resetRequestStatus | Internal 🔒 | 🛑 | |
|| _checkRequestStatus | Internal 🔒 | | |
|| _approveRequest | Internal 🔒 | 🛑 | |
Expand Down
2 changes: 1 addition & 1 deletion doc/surya/surya_report/surya_report_RuleEngine.sol.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

| File Name | SHA-1 Hash |
|-------------|--------------|
| ./RuleEngine.sol | b1c26380badaa4dd34dd75647bb62db7e30e5e40 |
| ./RuleEngine.sol | 0fc418971885c84c32fab8ba76462a7ae5c77b77 |


### Contracts Description Table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

| File Name | SHA-1 Hash |
|-------------|--------------|
| ./modules/RuleEngineOperation.sol | d3de41695a73eb2f2cb02dbea88b72174a2a9830 |
| ./modules/RuleEngineOperation.sol | a511cf11774bebce822a8b277f0d33a71d6df492 |


### Contracts Description Table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

| File Name | SHA-1 Hash |
|-------------|--------------|
| ./modules/RuleEngineValidation.sol | 818bc0f7e4fc858d3aa6efc76811268aa81bd3ee |
| ./modules/RuleEngineValidation.sol | 389f8e6a721d981e7704f67c608138af0b3bed97 |


### Contracts Description Table
Expand Down
2 changes: 1 addition & 1 deletion doc/surya/surya_report/surya_report_RuleWhitelist.sol.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

| File Name | SHA-1 Hash |
|-------------|--------------|
| ./rules/validation/RuleWhitelist.sol | a5c81461282137d1360d7934607e6e40c0727aa4 |
| ./rules/validation/RuleWhitelist.sol | 721bc822979b9948547c0d499ccb831ee6083775 |


### Contracts Description Table
Expand Down
2 changes: 1 addition & 1 deletion doc/technical/RuleConditionalTransfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Each request has a status, which changes regarding the decision of the operator

The default status is `NONE`.


![conditionalTransfer-state machine.drawio](../schema/rule/conditionalTransfer-state machine.drawio.png)

#### With the CMTAT

Expand Down
34 changes: 17 additions & 17 deletions doc/test/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">356</td>
<td class="headerCovTableEntry">388</td>
<td class="headerCovTableEntryHi">91.8 %</td>
<td class="headerCovTableEntry">364</td>
<td class="headerCovTableEntry">396</td>
<td class="headerCovTableEntryHi">91.9 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2024-05-14 11:13:54</td>
<td class="headerValue">2024-05-15 12:20:21</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">94</td>
<td class="headerCovTableEntry">102</td>
<td class="headerCovTableEntry">95</td>
<td class="headerCovTableEntry">103</td>
<td class="headerCovTableEntryHi">92.2 %</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td class="headerItem">Branches:</td>
<td class="headerCovTableEntry">148</td>
<td class="headerCovTableEntry">158</td>
<td class="headerCovTableEntryHi">93.7 %</td>
<td class="headerCovTableEntry">154</td>
<td class="headerCovTableEntry">166</td>
<td class="headerCovTableEntryHi">92.8 %</td>
</tr>
<tr><td><img src="glass.png" width=3 height=3 alt=""></td></tr>
</table>
Expand Down Expand Up @@ -120,14 +120,14 @@
<tr>
<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="emerald.png" width=99 height=10 alt="98.7%"><img src="snow.png" width=1 height=10 alt="98.7%"></td></tr></table>
<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>
</td>
<td class="coverPerHi">98.7&nbsp;%</td>
<td class="coverNumHi">78 / 79</td>
<td class="coverPerHi">98.8&nbsp;%</td>
<td class="coverNumHi">84 / 85</td>
<td class="coverPerHi">93.8&nbsp;%</td>
<td class="coverNumHi">15 / 16</td>
<td class="coverPerHi">94.1&nbsp;%</td>
<td class="coverNumHi">32 / 34</td>
<td class="coverPerHi">90.5&nbsp;%</td>
<td class="coverNumHi">38 / 42</td>
</tr>
<tr>
<td class="coverFile"><a href="src/modules/index.html">src/modules</a></td>
Expand All @@ -147,9 +147,9 @@
<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">94 / 94</td>
<td class="coverPerHi">94.4&nbsp;%</td>
<td class="coverNumHi">17 / 18</td>
<td class="coverNumHi">96 / 96</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>
</tr>
Expand Down
34 changes: 17 additions & 17 deletions doc/test/coverage/index-sort-f.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">356</td>
<td class="headerCovTableEntry">388</td>
<td class="headerCovTableEntryHi">91.8 %</td>
<td class="headerCovTableEntry">364</td>
<td class="headerCovTableEntry">396</td>
<td class="headerCovTableEntryHi">91.9 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2024-05-14 11:13:54</td>
<td class="headerValue">2024-05-15 12:20:21</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">94</td>
<td class="headerCovTableEntry">102</td>
<td class="headerCovTableEntry">95</td>
<td class="headerCovTableEntry">103</td>
<td class="headerCovTableEntryHi">92.2 %</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td class="headerItem">Branches:</td>
<td class="headerCovTableEntry">148</td>
<td class="headerCovTableEntry">158</td>
<td class="headerCovTableEntryHi">93.7 %</td>
<td class="headerCovTableEntry">154</td>
<td class="headerCovTableEntry">166</td>
<td class="headerCovTableEntryHi">92.8 %</td>
</tr>
<tr><td><img src="glass.png" width=3 height=3 alt=""></td></tr>
</table>
Expand Down Expand Up @@ -144,24 +144,24 @@
<tr>
<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="emerald.png" width=99 height=10 alt="98.7%"><img src="snow.png" width=1 height=10 alt="98.7%"></td></tr></table>
<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>
</td>
<td class="coverPerHi">98.7&nbsp;%</td>
<td class="coverNumHi">78 / 79</td>
<td class="coverPerHi">98.8&nbsp;%</td>
<td class="coverNumHi">84 / 85</td>
<td class="coverPerHi">93.8&nbsp;%</td>
<td class="coverNumHi">15 / 16</td>
<td class="coverPerHi">94.1&nbsp;%</td>
<td class="coverNumHi">32 / 34</td>
<td class="coverPerHi">90.5&nbsp;%</td>
<td class="coverNumHi">38 / 42</td>
</tr>
<tr>
<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">94 / 94</td>
<td class="coverPerHi">94.4&nbsp;%</td>
<td class="coverNumHi">17 / 18</td>
<td class="coverNumHi">96 / 96</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>
</tr>
Expand Down
34 changes: 17 additions & 17 deletions doc/test/coverage/index-sort-l.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">356</td>
<td class="headerCovTableEntry">388</td>
<td class="headerCovTableEntryHi">91.8 %</td>
<td class="headerCovTableEntry">364</td>
<td class="headerCovTableEntry">396</td>
<td class="headerCovTableEntryHi">91.9 %</td>
</tr>
<tr>
<td class="headerItem">Date:</td>
<td class="headerValue">2024-05-14 11:13:54</td>
<td class="headerValue">2024-05-15 12:20:21</td>
<td></td>
<td class="headerItem">Functions:</td>
<td class="headerCovTableEntry">94</td>
<td class="headerCovTableEntry">102</td>
<td class="headerCovTableEntry">95</td>
<td class="headerCovTableEntry">103</td>
<td class="headerCovTableEntryHi">92.2 %</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td class="headerItem">Branches:</td>
<td class="headerCovTableEntry">148</td>
<td class="headerCovTableEntry">158</td>
<td class="headerCovTableEntryHi">93.7 %</td>
<td class="headerCovTableEntry">154</td>
<td class="headerCovTableEntry">166</td>
<td class="headerCovTableEntryHi">92.8 %</td>
</tr>
<tr><td><img src="glass.png" width=3 height=3 alt=""></td></tr>
</table>
Expand Down Expand Up @@ -144,14 +144,14 @@
<tr>
<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="emerald.png" width=99 height=10 alt="98.7%"><img src="snow.png" width=1 height=10 alt="98.7%"></td></tr></table>
<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>
</td>
<td class="coverPerHi">98.7&nbsp;%</td>
<td class="coverNumHi">78 / 79</td>
<td class="coverPerHi">98.8&nbsp;%</td>
<td class="coverNumHi">84 / 85</td>
<td class="coverPerHi">93.8&nbsp;%</td>
<td class="coverNumHi">15 / 16</td>
<td class="coverPerHi">94.1&nbsp;%</td>
<td class="coverNumHi">32 / 34</td>
<td class="coverPerHi">90.5&nbsp;%</td>
<td class="coverNumHi">38 / 42</td>
</tr>
<tr>
<td class="coverFile"><a href="src/rules/validation/abstract/index.html">src/rules/validation/abstract</a></td>
Expand Down Expand Up @@ -183,9 +183,9 @@
<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">94 / 94</td>
<td class="coverPerHi">94.4&nbsp;%</td>
<td class="coverNumHi">17 / 18</td>
<td class="coverNumHi">96 / 96</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>
</tr>
Expand Down
Loading

0 comments on commit e4d1fc5

Please sign in to comment.