diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..ecebbd0
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,28 @@
+name: Foundry CI
+
+on:
+ push:
+ branches: [dev, master, main]
+ pull_request:
+ branches: [dev, master, main]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Install Foundry
+ uses: foundry-rs/foundry-toolchain@v1
+ with:
+ version: nightly
+
+ - name: Run Forge install
+ run: forge install
+
+ - name: Run Forge build
+ run: forge build --sizes
+
+ - name: Run Forge tests
+ run: forge test -vvv
diff --git a/.gitignore b/.gitignore
index 8211401..603dabe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,4 +9,7 @@ cache/
nethereum-gen.settings
#hardhat
artifacts/
-cache_hardhat/
\ No newline at end of file
+cache_hardhat/
+#drawio
+*.bkp
+*.dtmp
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3fb0250..4173bff 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,7 +2,14 @@
Please follow [https://changelog.md/](https://changelog.md/) conventions.
-## v1.0.2 - 10120609
+## v1.0.3 - 20231122
+
+- Upgrade the library CMTAT to the version [v2.3.1](https://github.com/CMTA/CMTAT/releases/tag/v2.3.1)
+- Use custom errors instead of revert message (gas optimization)
+- Add the rule `SanctionList`
+- Upgrade OpenZeppelin to the version [v5.0.0](https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v5.0.0)
+
+## v1.0.2 - 20230609
- Upgrade the library CMTAT to the vesion [v2.3.0](https://github.com/CMTA/CMTAT/releases/tag/v2.3.0)
- Set the number of runs for the optimizer to 200 for Hardhat and Foundry, see [https://docs.soliditylang.org/en/v0.8.17/using-the-compiler.html#optimizer-options](https://docs.soliditylang.org/en/v0.8.17/using-the-compiler.html#optimizer-options)
diff --git a/README.md b/README.md
index 29ac8d1..6896844 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,10 @@
+> To use the ruleEngine and the different rules, we recommend the latest audited version, from the [Releases](https://github.com/CMTA/CMTAT/releases) page. Currently, it is the version [v1.0.2](https://github.com/CMTA/RuleEngine/releases/tag/v1.0.2)
+
# RuleEngine
This repository includes the RuleEngine contract for the [CMTAT](https://github.com/CMTA/CMTAT) token.
-- The CMTAT version used is the version [v2.3.0](https://github.com/CMTA/CMTAT/releases/tag/v2.3.0)
-- The OpenZeppelin version used is the version [4.8.1](https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v4.8.1)
+- The CMTAT version used is the version [v2.3.1](https://github.com/CMTA/CMTAT/releases/tag/v2.3.1)
+- The OpenZeppelin version used is the version [v5.0.0](https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v5.0.0)
The CMTAT contracts and the OpenZeppelin library are included as a submodule of the present repository.
@@ -12,28 +14,37 @@ The contracts have been audited by [ABDKConsulting](https://www.abdk.consulting/
#### First Audit - March 2022
+Fixed version : [v1.0.2](https://github.com/CMTA/RuleEngine/releases/tag/v1.0.2)
+
The first audit was performed by ABDK on the version [1.0.1](https://github.com/CMTA/RuleEngine/releases/tag/1.0.1).
-The release 1.1 contains the different fixes and improvements related to this audit.
+The release [v1.0.2](https://github.com/CMTA/RuleEngine/releases/tag/v1.0.2) contains the different fixes and improvements related to this audit.
The temporary report is available in [Taurus. Audit 3.3.CollectedIssues.ods](doc/audits/Taurus.Audit3.3.CollectedIssues.ods)
+The final report is available in [ABDK_CMTA_CMTATRuleEngine_v_1_0.pdf](https://github.com/CMTA/CMTAT/blob/master/doc/audits/ABDK_CMTA_CMTATRuleEngine_v_1_0/ABDK_CMTA_CMTATRuleEngine_v_1_0.pdf).
+
### Tools
-You will find the report performed with [Slither](https://github.com/crytic/slither) in [slither-report.md](doc/audits/tools/slither-report.md)
+You will find the report performed with [Slither](https://github.com/crytic/slither) in
+
+| Version | File |
+| ------- | ------------------------------------------------------------ |
+| v1.0.2 | [v1.0.2-slither-report.md](./doc/audits/tools/v1.0.2-slither-report.md) |
+| v1.0.3 | [v1.0.3-slither-report.md](./doc/audits/tools/v1.0.3-slither-report.md) |
## Documentation
Here a summary of the main documentation
-| Document | Link/Files |
-| ----------------------------------- | ---------------------------------------------------- |
-| Solidity API Documentation (docgen) | [doc/solidityAPI](./doc/solidityAPI) |
-| Technical documentation | [doc/technical.md](./doc/technical.md) |
-| Toolchain | [doc/TOOLCHAIN.md](./doc/TOOLCHAIN.md) |
-| Functionalities | [doc/functionalities.pdf](./doc/functionalities.pdf) |
-| Surya report | [doc/surya](./doc/surya) |
-| Test | [doc/test/test.pdf](./doc/test/test.pdf) |
+| Document | Link/Files |
+| ----------------------------------- | ------------------------------------------------------ |
+| Solidity API Documentation (docgen) | [doc/solidityAPI](./doc/solidityAPI) |
+| Technical documentation | [doc/technical](./doc/technical) |
+| Toolchain | [doc/TOOLCHAIN.md](./doc/TOOLCHAIN.md) |
+| Functionalities | [doc/functionalities.pdf](./doc/functionalities.pdf) |
+| Surya report | [doc/surya](./doc/surya) |
+| Test (v1.0.2) | [doc/test/v1.0.2/test.pdf](./doc/test/v1.0.2/test.pdf) |
@@ -66,7 +77,9 @@ forge update
See also the command's [documentation](https://book.getfoundry.sh/reference/forge/forge-update).
+
## Compilation
+
The official documentation is available in the Foundry [website](https://book.getfoundry.sh/reference/forge/build-commands)
```
forge build --contracts src/RuleEngine.sol
@@ -101,11 +114,20 @@ forge coverage
forge coverage --report lcov
```
-See [Solidity Coverage in VS Code with Foundry](https://mirror.xyz/devanon.eth/RrDvKPnlD-pmpuW7hQeR5wWdVjklrpOgPCOA-PJkWFU)
+- Generate `index.html`
+
+```bash
+forge coverage --report lcov && genhtml lcov.info --branch-coverage --output-dir coverage
+```
+
+See [Solidity Coverage in VS Code with Foundry](https://mirror.xyz/devanon.eth/RrDvKPnlD-pmpuW7hQeR5wWdVjklrpOgPCOA-PJkWFU) & [Foundry forge coverage](https://www.rareskills.io/post/foundry-forge-coverage)
## Deployment
The official documentation is available in the Foundry [website](https://book.getfoundry.sh/reference/forge/deploy-commands)
### Script
+
+> This documentation has been written for the version v1.0.2
+
To run the script for deployment, you need to create a .env file. The value for CMTAT.ADDRESS is require only to use the script **RuleEngine.s.sol**
Warning : put your private key in a .env file is not the best secure way.
@@ -130,6 +152,9 @@ forge script script/RuleEngineScript.s.sol:RuleEngineScript --rpc-url=$RPC_URL
```
### Local
+
+> This documentation has been written for the version v1.0.2
+
With Foundry, you [can create a local testnet](https://book.getfoundry.sh/reference/anvil/) node for deploying and testing smart contracts, based on the [Anvil](https://anvil.works/) framework.
On Linux, using the default RPC URL, and Anvil's test private key, run:
@@ -143,6 +168,3 @@ forge create CMTAT_BASE --rpc-url=$RPC_URL --private-key=$PRIVATE_KEY --construc
```
See also the command's [documentation](https://book.getfoundry.sh/reference/forge/deploy-command).
-
-
-
diff --git a/doc/accessControl/.$access-control.drawio.bkp b/doc/accessControl/.$access-control.drawio.bkp
index a0d667c..0a8339b 100644
--- a/doc/accessControl/.$access-control.drawio.bkp
+++ b/doc/accessControl/.$access-control.drawio.bkp
@@ -1 +1 @@
-3Zlbc6IwFMc/jY/tcBHQRyu02xnb7uh2un3qpBA1s0CYEKv2028i4ZbY9bIq7D5BDsmB/M8vyUnomMNodUdAMn/AAQw7hhasOqbbMQzdtDR24ZZ1Zun3e5lhRlAgKpWGCfqEwijazRYogGmtIsU4pCipG30cx9CnNRsgBC/r1aY4rL81ATOoGCY+CFXrCwroPLP28m5x+zeIZvP8zbomnkQgrywM6RwEeFkxmV7HHBKMaXYXrYYw5OLlumTtbr94WnwYgTHdp8GVNp1MwPsQPyUGWnrJ2AXOlfDyAcKF6LDr3Q6eRz/eBu7D/ePb+Gnkic+n61wT5pfJzwo3yzmicJIAnz9ZMgKYbU6jkJV0djvFMRUh1W1WFi+DhMLVl73QC20YVBBHkJI1qyIa5GoKnGxRXJaxKdCZV+OStwOCh1nhuZSM3QjVDlDQUBT8hXgrSTOCF3EAuSOtEd1sq6ab4ajCFR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4WlkBe6B8FwFxKOvQ3yxcgOAAIt5HEEkQWXK5pwSYTVhlguhhnH+1p3TpRmlX4DqJjGmLMM7pNZWrbp5okkpB3Zsl3V8RLI8LjbRW+RpGxd5q6chAtp5gXGOpqx3mA+epgu5rOp9/Cf+Gr3TMXWrm6r1W+y1byWrW3N1hRzDyU+JzSZkZQvGPLBz7q1jG6TAIvM5j9kb0el1jEbsLUb/O1cy96eZq8OaRIMxGsZIj9CaUp81TzVabCHZU8iuHGL8Pl4bLxXokxGzS3AgfauP6cB8Pvplvn49OPKEVvj9/K1mxt61DC3oV+FxnCEOHlVa2hqolzhCyVQXcmL01YfR7v+9srLlHcdbwX1RH01kdWtJcp90BIdmCrL/n3MLH3b+SBndV7wnvAnOVNcP1cIQlRBJ4JMY1UhtQL3F6xem037TDadv8lmfavQkDqbTaeWqA75tdnUd+4YJeKQqREKHZ+hJZyXFTBRRNaJoBa6jxkIYuMgcCAdyIGYBIHIMWQ4JW9oecgnQNqImg5VukPDHV+yE8nTs0xmlG+G0xDa725R5o3V7fU/RkjWeANdrWDrvqyDEFbH7Xx69afFmfwE
\ No newline at end of file
diff --git a/doc/accessControl/access-control-RuleSanctionList.drawio.png b/doc/accessControl/access-control-RuleSanctionList.drawio.png
new file mode 100644
index 0000000..056590f
Binary files /dev/null and b/doc/accessControl/access-control-RuleSanctionList.drawio.png differ
diff --git a/doc/accessControl/access-control.drawio b/doc/accessControl/access-control.drawio
index 42f2a74..e200a74 100644
--- a/doc/accessControl/access-control.drawio
+++ b/doc/accessControl/access-control.drawio
@@ -1 +1 @@
-3ZjbcpswEIafhstkOBiwLx2bpJlxko7dTJurjAKy0QwgRsixydNXCuIgidZOEze0V2ZX0gr9+xmtZDizdH9FQB7f4Agmhm1Ge8OZG7Ztu2OX/XBPWXks05tUng1BkfC1jhV6gXVH4d2iCBZSR4pxQlEuO0OcZTCkkg8QgndytzVO5FlzsIGaYxWCRPd+RxGNK+/YNVv/F4g2cT2zZYqWFNSdhaOIQYR3H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t9XSSfvd+4FXe+5wF42WvJLs6ZUudAsMp/7PUdkn9jOKt1Gs2vxrfL+6exrPbm+XT19ViLrPnRSUp8EL1IJjsIsKxlyFfzOzAQIBFPIkhsmC4oSmXjrD6EMvDMON436rOG6lZtd5gVEwTzFkB+yRLzzbdkkia9FKWbNdUvDZkdFztqrZIuiysuRslYSDFPEFYRxPWGy+ndzer5eLGu/tPdLWHpiLrQJfVGnXJap5L1r4ma465h1KfE5ouSM5XDPmgZ1taRrdpgAWz+Q/Je6m61jE7bGt36Ht5LnmHmry6SdNgLK5liPwY5TnxVfFUpUEeVjyI4MKtwsfjudleiQoZdZcAB9pd/54CwPenW+bjt3+uHLEQv8bX7y7oUcHcjnpVGMMx4uRZzaGriPKEL5RAdrVfnL76c7Tbt1eZptx13AraRCOVyBq0iEodNKKDp+q0f99mlt52Puiztl/wnvAHuVKMHxsLQtSYTgSF5lXFqY1xf+HVc3vTfqc3nb/pzXar0Cz1bm86LaK2yc/tTb1zJygVj0zNoVDxBVrDe1kxJopJmArXQvUxA0A0DgIP0rGcSEgQCI4Jwzl5QesDnzBSJnI6ZOlODHd2SieSr2dJZtQ3w9smtF9tUeaFNRiOPuaQonMD3WygdZ9WQQib53a5vPnT4sx/Ag==
\ No newline at end of file
diff --git a/doc/audits/tools/slither-report.md b/doc/audits/tools/v1.0.2-slither-report.md
similarity index 98%
rename from doc/audits/tools/slither-report.md
rename to doc/audits/tools/v1.0.2-slither-report.md
index 8d90d62..74c91fd 100644
--- a/doc/audits/tools/slither-report.md
+++ b/doc/audits/tools/v1.0.2-slither-report.md
@@ -73,7 +73,7 @@ Confidence: High
> Remark:
>
> Not necessary, the latest solidity version at the time of this release is the version 0.8.20.
-> The comment is good but we think three versions backwards is enough.
+> The comment is good but we think that three versions backwards is enough.
> It is not the best practice to use an outdated version because each version
> fixes some bugs.
diff --git a/doc/audits/tools/v1.0.3-slither-report.md b/doc/audits/tools/v1.0.3-slither-report.md
new file mode 100644
index 0000000..dc5009e
--- /dev/null
+++ b/doc/audits/tools/v1.0.3-slither-report.md
@@ -0,0 +1,18 @@
+**THIS CHECKLIST IS NOT COMPLETE**. Use `--show-ignored-findings` to show all the results.
+Summary
+ - [solc-version](#solc-version) (1 results) (Informational)
+## solc-version
+
+> Remark:
+>
+> Not necessary, the latest solidity version at the time of this release is the version 0.8.23.
+> The comment is good but we think that three versions backwards is enough.
+> It is not the best practice to use an outdated version because each version
+> fixes some bugs.
+
+Impact: Informational
+Confidence: High
+
+ - [ ] ID-0
+solc-0.8.20 is not recommended for deployment
+
diff --git a/doc/codelist.md b/doc/codelist.md
index b5a2624..26abf32 100644
--- a/doc/codelist.md
+++ b/doc/codelist.md
@@ -4,11 +4,13 @@
Here the list of codes used by the different rules
-| Contract | Constant name | Value |
-| ------------- | --------------------------------- | ----- |
-| All | NO_ERROR | 0 |
-| RuleWhitelist | CODE_ADDRESS_FROM_NOT_WHITELISTED | 20 |
-| RuleWhitelist | CODE_ADDRESS_TO_NOT_WHITELISTED | 30 |
+| Contract | Constant name | Value |
+| ---------------- | --------------------------------- | ----- |
+| All | NO_ERROR | 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 |
diff --git a/doc/functionalities.odt b/doc/functionalities.odt
index 13ca866..320a983 100644
Binary files a/doc/functionalities.odt and b/doc/functionalities.odt differ
diff --git a/doc/functionalities.pdf b/doc/functionalities.pdf
index 4a296df..7c5cf1c 100644
Binary files a/doc/functionalities.pdf and b/doc/functionalities.pdf differ
diff --git a/doc/schema/RuleEngine b/doc/schema/RuleEngine
new file mode 100644
index 0000000..a10c47c
--- /dev/null
+++ b/doc/schema/RuleEngine
@@ -0,0 +1 @@
+1VpRc+I2EP41zLQPx1iSbfBjgPT60JtmLvRS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pKigOUIxZ1rJ1J2VfI0IFhm8DuZsq+9CbtDLCPIpSxQOeMBZ2acua21rJ77RvzXntFDuwUNw3Mvt+9sNsbmN2ed2M2etuBQcKSrEyJcLo8QAHoGMnkD1jIIic5SKCDpFRijr2U58rQxpLKhSprtpwNQeN02C3IBY6rIQUV3dNbIReYhbVvLNQ25Or7VCmxSemjOR25H87pdS2qH8ttR89ysMgGpL/oS5WnzDwxTTNf84NFcz25b6lqWVgaRuhmzMN1zOLs6LWI+DmNY0PUvKup85vu2Su4DjjgfPHi1riuvc8oH56O+/CSPgS0xLyNibdbJ7sD30rR1+hDAvMDj/tqe9MyKUO7DuBHdI5ZVHPYcZuDsbI6qNYG6rY2ygPYEKXdBinwr9IsBwanAvMr5AlYSmDgfUVNnWOdfHyrKR9oH/nlIF/xupi3U2tLmK/CfFaNgTdgvi1WblwPdwvwFn36V2Fli+wD2G9WHp+G/NW52j6abour+w7wdL4GLmqDsN/2W47zoHY+J6jBpwH1CR6HZhp6F4/L6fGHY7n68fd36P5/
\ No newline at end of file
diff --git a/doc/schema/RuleEngine.png b/doc/schema/RuleEngine.png
new file mode 100644
index 0000000..3e891c6
Binary files /dev/null and b/doc/schema/RuleEngine.png differ
diff --git a/doc/schema/uml.svg b/doc/schema/classDiagram1.0.2.svg
similarity index 100%
rename from doc/schema/uml.svg
rename to doc/schema/classDiagram1.0.2.svg
diff --git a/doc/schema/classDiagram1.0.3.svg b/doc/schema/classDiagram1.0.3.svg
new file mode 100644
index 0000000..910e7dd
--- /dev/null
+++ b/doc/schema/classDiagram1.0.3.svg
@@ -0,0 +1,212 @@
+
+
+
+
+
diff --git a/doc/schema/surya/surya_graph_RuleEngine.png b/doc/schema/surya/surya_graph_RuleEngine.png
index c705340..52773b7 100644
Binary files a/doc/schema/surya/surya_graph_RuleEngine.png and b/doc/schema/surya/surya_graph_RuleEngine.png differ
diff --git a/doc/schema/surya/surya_graph_SanctionList.png b/doc/schema/surya/surya_graph_SanctionList.png
new file mode 100644
index 0000000..aa8e88a
Binary files /dev/null and b/doc/schema/surya/surya_graph_SanctionList.png differ
diff --git a/doc/schema/surya/surya_graph_Whitelist.png b/doc/schema/surya/surya_graph_Whitelist.png
index ef933e5..a0c904e 100644
Binary files a/doc/schema/surya/surya_graph_Whitelist.png and b/doc/schema/surya/surya_graph_Whitelist.png differ
diff --git a/doc/schema/surya1.0.2/surya_graph_RuleEngine.png b/doc/schema/surya1.0.2/surya_graph_RuleEngine.png
new file mode 100644
index 0000000..c705340
Binary files /dev/null and b/doc/schema/surya1.0.2/surya_graph_RuleEngine.png differ
diff --git a/doc/schema/surya1.0.2/surya_graph_Whitelist.png b/doc/schema/surya1.0.2/surya_graph_Whitelist.png
new file mode 100644
index 0000000..ef933e5
Binary files /dev/null and b/doc/schema/surya1.0.2/surya_graph_Whitelist.png differ
diff --git a/doc/solidityAPI/MetaTxStandalone.md b/doc/solidityAPI/MetaTxStandalone.md
index 3d2a349..cc5f318 100644
--- a/doc/solidityAPI/MetaTxStandalone.md
+++ b/doc/solidityAPI/MetaTxStandalone.md
@@ -1,4 +1,4 @@
-# MetaTxModuleStandalone - Solidity API
+# MetaTxModuleStandalone
[TOC]
@@ -10,15 +10,22 @@ _Meta transaction (gasless) module._
constructor(address trustedForwarder) internal
```
-#### _msgSender
+### _msgSender
```solidity
function _msgSender() internal view virtual returns (address sender)
```
-#### _msgData
+_Override for `msg.sender`. Defaults to the original `msg.sender` whenever
+a call is not performed by the trusted forwarder or the calldata length is less than
+20 bytes (an address length)._
+
+### _msgData
```solidity
function _msgData() internal view virtual returns (bytes)
```
+_Override for `msg.data`. Defaults to the original `msg.data` whenever
+a call is not performed by the trusted forwarder or the calldata length is less than
+20 bytes (an address length)._
diff --git a/doc/solidityAPI/RuleEngine.md b/doc/solidityAPI/RuleEngine.md
index e4b77c0..6bb6559 100644
--- a/doc/solidityAPI/RuleEngine.md
+++ b/doc/solidityAPI/RuleEngine.md
@@ -1,10 +1,38 @@
-# RuleEngine - Solidity API
+# RuleEngine
[TOC]
-## Constants/Variables
+### RuleEngine_RuleAddressZeroNotAllowed
+
+```solidity
+error RuleEngine_RuleAddressZeroNotAllowed()
+```
+
+### RuleEngine_RuleAlreadyExists
+
+```solidity
+error RuleEngine_RuleAlreadyExists()
+```
+
+### RuleEngine_RuleDoNotMatch
+
+```solidity
+error RuleEngine_RuleDoNotMatch()
+```
+
+### RuleEngine_AdminWithAddressZeroNotAllowed
+
+```solidity
+error RuleEngine_AdminWithAddressZeroNotAllowed()
+```
+
+### RuleEngine_ArrayIsEmpty
+
+```solidity
+error RuleEngine_ArrayIsEmpty()
+```
### RULE_ENGINE_ROLE
@@ -12,9 +40,9 @@
bytes32 RULE_ENGINE_ROLE
```
-*Role to manage the ruleEngine*
+_Role to manage the ruleEngine_
-### ruleIsPresent
+### _ruleIsPresent
```solidity
mapping(contract IRule => bool) _ruleIsPresent
@@ -28,9 +56,7 @@ _Indicate if a rule already exists_
contract IRule[] _rules
```
-*Array of rules*
-
-## Events
+_Array of rules_
### AddRule
@@ -56,8 +82,6 @@ event ClearRules(contract IRule[] rulesRemoved)
Generate when all the rules are cleared
-## Functions
-
### constructor
```solidity
@@ -71,9 +95,7 @@ constructor(address admin, address forwarderIrrevocable) public
| admin | address | Address of the contract (Access Control) |
| forwarderIrrevocable | address | Address of the forwarder, required for the gasless support |
-### Public/external
-
-#### setRules
+### setRules
```solidity
function setRules(contract IRule[] rules_) external
@@ -82,7 +104,7 @@ function setRules(contract IRule[] rules_) external
Set all the rules, will overwrite all the previous rules. \n
Revert if one rule is a zero address or if the rule is already present
-#### clearRules
+### clearRules
```solidity
function clearRules() public
@@ -90,7 +112,7 @@ function clearRules() public
Clear all the rules of the array of rules
-#### addRule
+### addRule
```solidity
function addRule(contract IRule rule_) public
@@ -99,7 +121,7 @@ function addRule(contract IRule rule_) public
Add a rule to the array of rules
Revert if one rule is a zero address or if the rule is already present
-#### removeRule
+### removeRule
```solidity
function removeRule(contract IRule rule_, uint256 index) public
@@ -111,26 +133,26 @@ Revert if the rule found at the specified index does not match the rule in argum
_To reduce the array size, the last rule is moved to the location occupied
by the rule to remove_
-##### Parameters
+#### Parameters
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| rule_ | contract IRule | address of the target rule |
-| index | uint256 | the position inside the array of rule |
+| Name | Type | Description |
+| ----- | -------------- | ------------------------------------- |
+| rule_ | contract IRule | address of the target rule |
+| index | uint256 | the position inside the array of rule |
-#### rulesCount
+### rulesCount
```solidity
function rulesCount() external view returns (uint256)
```
-##### Return Values
+#### Return Values
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| [0] | uint256 | The number of rules inside the array |
+| Name | Type | Description |
+| ---- | ------- | ------------------------------------ |
+| [0] | uint256 | The number of rules inside the array |
-#### getRuleIndex
+### getRuleIndex
```solidity
function getRuleIndex(contract IRule rule_) external view returns (uint256 index)
@@ -138,13 +160,13 @@ function getRuleIndex(contract IRule rule_) external view returns (uint256 index
Get the index of a rule inside the list
-##### Return Values
+#### Return Values
-| Name | Type | Description |
-| ---- | ---- | ----------- |
+| Name | Type | Description |
+| ----- | ------- | --------------------------------------------- |
| index | uint256 | if the rule is found, _rules.length otherwise |
-#### rule
+### rule
```solidity
function rule(uint256 ruleId) external view returns (contract IRule)
@@ -152,19 +174,19 @@ function rule(uint256 ruleId) external view returns (contract IRule)
Get the rule at the position specified by ruleId
-##### Parameters
+#### Parameters
-| Name | Type | Description |
-| ---- | ---- | ----------- |
+| Name | Type | Description |
+| ------ | ------- | ----------------- |
| ruleId | uint256 | index of the rule |
-##### Return Values
+#### Return Values
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| [0] | contract IRule | a rule address |
+| Name | Type | Description |
+| ---- | -------------- | -------------- |
+| [0] | contract IRule | a rule address |
-#### rules
+### rules
```solidity
function rules() external view returns (contract IRule[])
@@ -172,13 +194,13 @@ function rules() external view returns (contract IRule[])
Get all the rules
-##### Return Values
+#### Return Values
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| [0] | contract IRule[] | An array of rules |
+| Name | Type | Description |
+| ---- | ---------------- | ----------------- |
+| [0] | contract IRule[] | An array of rules |
-#### detectTransferRestriction
+### detectTransferRestriction
```solidity
function detectTransferRestriction(address _from, address _to, uint256 _amount) public view returns (uint8)
@@ -186,21 +208,21 @@ function detectTransferRestriction(address _from, address _to, uint256 _amount)
Go through all the rule to know if a restriction exists on the transfer
-##### Parameters
+#### Parameters
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| _from | address | the origin address |
-| _to | address | the destination address |
-| _amount | uint256 | to transfer |
+| Name | Type | Description |
+| ------- | ------- | ----------------------- |
+| _from | address | the origin address |
+| _to | address | the destination address |
+| _amount | uint256 | to transfer |
-##### Return Values
+#### Return Values
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| [0] | uint8 | The restricion code or REJECTED_CODE_BASE.TRANSFER_OK |
+| Name | Type | Description |
+| ---- | ----- | ----------------------------------------------------- |
+| [0] | uint8 | The restricion code or REJECTED_CODE_BASE.TRANSFER_OK |
-#### validateTransfer
+### validateTransfer
```solidity
function validateTransfer(address _from, address _to, uint256 _amount) public view returns (bool)
@@ -208,21 +230,21 @@ function validateTransfer(address _from, address _to, uint256 _amount) public vi
Validate a transfer
-##### Parameters
+#### Parameters
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| _from | address | the origin address |
-| _to | address | the destination address |
-| _amount | uint256 | to transfer |
+| Name | Type | Description |
+| ------- | ------- | ----------------------- |
+| _from | address | the origin address |
+| _to | address | the destination address |
+| _amount | uint256 | to transfer |
-##### Return Values
+#### Return Values
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| [0] | bool | True if the transfer is valid, false otherwise |
+| Name | Type | Description |
+| ---- | ---- | ---------------------------------------------- |
+| [0] | bool | True if the transfer is valid, false otherwise |
-#### messageForTransferRestriction
+### messageForTransferRestriction
```solidity
function messageForTransferRestriction(uint8 _restrictionCode) external view returns (string)
@@ -230,32 +252,32 @@ function messageForTransferRestriction(uint8 _restrictionCode) external view ret
Return the message corresponding to the code
-##### Parameters
+#### Parameters
-| Name | Type | Description |
-| ---- | ---- | ----------- |
+| Name | Type | Description |
+| ---------------- | ----- | --------------------------- |
| _restrictionCode | uint8 | The target restriction code |
-##### Return Values
-
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| [0] | string | True if the transfer is valid, false otherwise |
+#### Return Values
-### Internal
+| Name | Type | Description |
+| ---- | ------ | ---------------------------------------------- |
+| [0] | string | True if the transfer is valid, false otherwise |
-#### _msgSender
+### _msgSender
```solidity
function _msgSender() internal view returns (address sender)
```
-_This surcharge is not necessary if you do not use the MetaTxModule_.
+_This surcharge is not necessary if you do not use the MetaTxModule_
-#### _msgData
+### _msgData
```solidity
function _msgData() internal view returns (bytes)
```
-_This surcharge is not necessary if you do not use the MetaTxModule.
+_This surcharge is not necessary if you do not use the MetaTxModule_
+
+##
diff --git a/doc/solidityAPI/RuleSanctionList.md b/doc/solidityAPI/RuleSanctionList.md
new file mode 100644
index 0000000..65bcadd
--- /dev/null
+++ b/doc/solidityAPI/RuleSanctionList.md
@@ -0,0 +1,152 @@
+# RuleSanctionList
+
+[TOC]
+
+
+
+## SanctionsList
+
+### isSanctioned
+
+```solidity
+function isSanctioned(address addr) external view returns (bool)
+```
+
+## RuleSanctionList
+
+### sanctionsList
+
+```solidity
+contract SanctionsList sanctionsList
+```
+
+### constructor
+
+```solidity
+constructor(address admin, address forwarderIrrevocable) public
+```
+
+#### Parameters
+
+| Name | Type | Description |
+| -------------------- | ------- | ---------------------------------------------------------- |
+| admin | address | Address of the contract (Access Control) |
+| forwarderIrrevocable | address | Address of the forwarder, required for the gasless support |
+
+### setSanctionListOracle
+
+```solidity
+function setSanctionListOracle(address sanctionContractOracle_) public
+```
+
+Set the oracle contract
+
+_zero address is authorized to authorize all transfers_
+
+#### Parameters
+
+| Name | Type | Description |
+| ----------------------- | ------- | ------------------------------- |
+| sanctionContractOracle_ | address | address of your oracle contract |
+
+### validateTransfer
+
+```solidity
+function validateTransfer(address _from, address _to, uint256 _amount) public view returns (bool isValid)
+```
+
+Validate a transfer
+
+#### Parameters
+
+| Name | Type | Description |
+| ------- | ------- | ----------------------- |
+| _from | address | the origin address |
+| _to | address | the destination address |
+| _amount | uint256 | to transfer |
+
+#### Return Values
+
+| Name | Type | Description |
+| ------- | ---- | ------------------------------------------------- |
+| isValid | bool | => true if the transfer is valid, false otherwise |
+
+### detectTransferRestriction
+
+```solidity
+function detectTransferRestriction(address _from, address _to, uint256) public view returns (uint8)
+```
+
+Check if an addres is in the whitelist or not
+
+#### Parameters
+
+| Name | Type | Description |
+| ----- | ------- | ----------------------- |
+| _from | address | the origin address |
+| _to | address | the destination address |
+| | uint256 | |
+
+#### Return Values
+
+| Name | Type | Description |
+| ---- | ----- | ----------------------------------------------------- |
+| [0] | uint8 | The restricion code or REJECTED_CODE_BASE.TRANSFER_OK |
+
+### canReturnTransferRestrictionCode
+
+```solidity
+function canReturnTransferRestrictionCode(uint8 _restrictionCode) external pure returns (bool)
+```
+
+To know if the restriction code is valid for this rule or not.
+
+#### Parameters
+
+| Name | Type | Description |
+| ---------------- | ----- | --------------------------- |
+| _restrictionCode | uint8 | The target restriction code |
+
+#### Return Values
+
+| Name | Type | Description |
+| ---- | ---- | ------------------------------------------------------ |
+| [0] | bool | true if the restriction code is known, false otherwise |
+
+### messageForTransferRestriction
+
+```solidity
+function messageForTransferRestriction(uint8 _restrictionCode) external pure returns (string)
+```
+
+Return the corresponding message
+
+#### Parameters
+
+| Name | Type | Description |
+| ---------------- | ----- | --------------------------- |
+| _restrictionCode | uint8 | The target restriction code |
+
+#### Return Values
+
+| Name | Type | Description |
+| ---- | ------ | ---------------------------------------------- |
+| [0] | string | true if the transfer is valid, false otherwise |
+
+### _msgSender
+
+```solidity
+function _msgSender() internal view returns (address sender)
+```
+
+_This surcharge is not necessary if you do not use the MetaTxModule_
+
+### _msgData
+
+```solidity
+function _msgData() internal view returns (bytes)
+```
+
+_This surcharge is not necessary if you do not use the MetaTxModule_
+
+##
diff --git a/doc/solidityAPI/RuleWhitelist.md b/doc/solidityAPI/RuleWhitelist.md
index 50cebd9..7367f8a 100644
--- a/doc/solidityAPI/RuleWhitelist.md
+++ b/doc/solidityAPI/RuleWhitelist.md
@@ -1,55 +1,15 @@
-# RuleWhitelist - Solidity API
+# RuleWhitelist
[TOC]
-## Constants / Variables
-
-### WHITELIST_ROLE
-
-```solidity
-bytes32 WHITELIST_ROLE
-```
-
-### TEXT_CODE_NOT_FOUND
-
-```solidity
-string TEXT_CODE_NOT_FOUND
-```
-
-### TEXT_ADDRESS_FROM_NOT_WHITELISTED
-
-```solidity
-string TEXT_ADDRESS_FROM_NOT_WHITELISTED
-```
-
-### TEXT_ADDRESS_TO_NOT_WHITELISTED
-
-```solidity
-string TEXT_ADDRESS_TO_NOT_WHITELISTED
-```
-
-### CODE_ADDRESS_FROM_NOT_WHITELISTED
-
-```solidity
-uint8 CODE_ADDRESS_FROM_NOT_WHITELISTED
-```
-
-### CODE_ADDRESS_TO_NOT_WHITELISTED
-
-```solidity
-uint8 CODE_ADDRESS_TO_NOT_WHITELISTED
-```
-
### whitelist
```solidity
mapping(address => bool) whitelist
```
-## Functions
-
### constructor
```solidity
@@ -58,14 +18,12 @@ constructor(address admin, address forwarderIrrevocable) public
#### Parameters
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| admin | address | Address of the contract (Access Control) |
+| Name | Type | Description |
+| -------------------- | ------- | ---------------------------------------------------------- |
+| admin | address | Address of the contract (Access Control) |
| forwarderIrrevocable | address | Address of the forwarder, required for the gasless support |
-### Public / External
-
-#### addAddressesToTheWhitelist
+### addAddressesToTheWhitelist
```solidity
function addAddressesToTheWhitelist(address[] listWhitelistedAddress) public
@@ -74,13 +32,13 @@ function addAddressesToTheWhitelist(address[] listWhitelistedAddress) public
Add addresses to the whitelist
If one of addresses already exist, there is no change for this address. The transaction remains valid (no revert).
-##### Parameters
+#### Parameters
-| Name | Type | Description |
-| ---- | ---- | ----------- |
+| Name | Type | Description |
+| ---------------------- | --------- | ---------------------------------------- |
| listWhitelistedAddress | address[] | an array with the addresses to whitelist |
-#### removeAddressesFromTheWhitelist
+### removeAddressesFromTheWhitelist
```solidity
function removeAddressesFromTheWhitelist(address[] listWhitelistedAddress) public
@@ -90,13 +48,13 @@ Remove addresses from the whitelist
If the address does not exist in the whitelist, there is no change for this address.
The transaction remains valid (no revert).
-##### Parameters
+#### Parameters
-| Name | Type | Description |
-| ---- | ---- | ----------- |
+| Name | Type | Description |
+| ---------------------- | --------- | ------------------------------------- |
| listWhitelistedAddress | address[] | an array with the addresses to remove |
-#### addAddressToTheWhitelist
+### addAddressToTheWhitelist
```solidity
function addAddressToTheWhitelist(address _newWhitelistAddress) public
@@ -105,13 +63,13 @@ function addAddressToTheWhitelist(address _newWhitelistAddress) public
Add one address to the whitelist
If the address already exists, the transaction is reverted to save gas.
-##### Parameters
+#### Parameters
-| Name | Type | Description |
-| ---- | ---- | ----------- |
+| Name | Type | Description |
+| -------------------- | ------- | ------------------------ |
| _newWhitelistAddress | address | The address to whitelist |
-#### removeAddressFromTheWhitelist
+### removeAddressFromTheWhitelist
```solidity
function removeAddressFromTheWhitelist(address _removeWhitelistAddress) public
@@ -120,13 +78,13 @@ function removeAddressFromTheWhitelist(address _removeWhitelistAddress) public
Remove one address from the whitelist
If the address does not exist in the whitelist, the transaction is reverted to save gas.
-##### Parameters
+#### Parameters
-| Name | Type | Description |
-| ---- | ---- | ----------- |
+| Name | Type | Description |
+| ----------------------- | ------- | --------------------- |
| _removeWhitelistAddress | address | The address to remove |
-#### numberWhitelistedAddress
+### numberWhitelistedAddress
```solidity
function numberWhitelistedAddress() external view returns (uint256)
@@ -134,13 +92,13 @@ function numberWhitelistedAddress() external view returns (uint256)
Get the number of whitelisted addresses
-##### Return Values
+#### Return Values
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| [0] | uint256 | Number of whitelisted addresses |
+| Name | Type | Description |
+| ---- | ------- | ------------------------------- |
+| [0] | uint256 | Number of whitelisted addresses |
-#### addressIsWhitelisted
+### addressIsWhitelisted
```solidity
function addressIsWhitelisted(address _targetAddress) external view returns (bool)
@@ -148,19 +106,19 @@ function addressIsWhitelisted(address _targetAddress) external view returns (boo
Know if an address is whitelisted or not
-##### Parameters
+#### Parameters
-| Name | Type | Description |
-| ---- | ---- | ----------- |
+| Name | Type | Description |
+| -------------- | ------- | --------------------- |
| _targetAddress | address | The concerned address |
-##### Return Values
+#### Return Values
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| [0] | bool | True if the address is whitelisted, false otherwise |
+| Name | Type | Description |
+| ---- | ---- | --------------------------------------------------- |
+| [0] | bool | True if the address is whitelisted, false otherwise |
-#### validateTransfer
+### validateTransfer
```solidity
function validateTransfer(address _from, address _to, uint256 _amount) public view returns (bool isValid)
@@ -168,21 +126,21 @@ function validateTransfer(address _from, address _to, uint256 _amount) public vi
Validate a transfer
-##### Parameters
+#### Parameters
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| _from | address | the origin address |
-| _to | address | the destination address |
-| _amount | uint256 | to transfer |
+| Name | Type | Description |
+| ------- | ------- | ----------------------- |
+| _from | address | the origin address |
+| _to | address | the destination address |
+| _amount | uint256 | to transfer |
-##### Return Values
+#### Return Values
-| Name | Type | Description |
-| ---- | ---- | ----------- |
+| Name | Type | Description |
+| ------- | ---- | ------------------------------------------------- |
| isValid | bool | => true if the transfer is valid, false otherwise |
-#### detectTransferRestriction
+### detectTransferRestriction
```solidity
function detectTransferRestriction(address _from, address _to, uint256) public view returns (uint8)
@@ -190,21 +148,21 @@ function detectTransferRestriction(address _from, address _to, uint256) public v
Check if an addres is in the whitelist or not
-##### Parameters
+#### Parameters
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| _from | address | the origin address |
-| _to | address | the destination address |
-| | uint256 | |
+| Name | Type | Description |
+| ----- | ------- | ----------------------- |
+| _from | address | the origin address |
+| _to | address | the destination address |
+| | uint256 | |
-##### Return Values
+#### Return Values
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| [0] | uint8 | The restricion code or REJECTED_CODE_BASE.TRANSFER_OK |
+| Name | Type | Description |
+| ---- | ----- | ----------------------------------------------------- |
+| [0] | uint8 | The restricion code or REJECTED_CODE_BASE.TRANSFER_OK |
-#### canReturnTransferRestrictionCode
+### canReturnTransferRestrictionCode
```solidity
function canReturnTransferRestrictionCode(uint8 _restrictionCode) external pure returns (bool)
@@ -212,19 +170,19 @@ function canReturnTransferRestrictionCode(uint8 _restrictionCode) external pure
To know if the restriction code is valid for this rule or not.
-##### Parameters
+#### Parameters
-| Name | Type | Description |
-| ---- | ---- | ----------- |
+| Name | Type | Description |
+| ---------------- | ----- | --------------------------- |
| _restrictionCode | uint8 | The target restriction code |
-##### Return Values
+#### Return Values
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| [0] | bool | true if the restriction code is known, false otherwise |
+| Name | Type | Description |
+| ---- | ---- | ------------------------------------------------------ |
+| [0] | bool | true if the restriction code is known, false otherwise |
-#### messageForTransferRestriction
+### messageForTransferRestriction
```solidity
function messageForTransferRestriction(uint8 _restrictionCode) external pure returns (string)
@@ -232,21 +190,19 @@ function messageForTransferRestriction(uint8 _restrictionCode) external pure ret
Return the corresponding message
-##### Parameters
+#### Parameters
-| Name | Type | Description |
-| ---- | ---- | ----------- |
+| Name | Type | Description |
+| ---------------- | ----- | --------------------------- |
| _restrictionCode | uint8 | The target restriction code |
-##### Return Values
-
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| [0] | string | true if the transfer is valid, false otherwise |
+#### Return Values
-#### Internal
+| Name | Type | Description |
+| ---- | ------ | ---------------------------------------------- |
+| [0] | string | true if the transfer is valid, false otherwise |
-#### _msgSender
+### _msgSender
```solidity
function _msgSender() internal view returns (address sender)
@@ -254,33 +210,10 @@ function _msgSender() internal view returns (address sender)
_This surcharge is not necessary if you do not use the MetaTxModule_
-#### _msgData
+### _msgData
```solidity
function _msgData() internal view returns (bytes)
```
_This surcharge is not necessary if you do not use the MetaTxModule_
-
-## MetaTxModuleStandalone
-
-_Meta transaction (gasless) module._
-
-### constructor
-
-```solidity
-constructor(address trustedForwarder) internal
-```
-
-#### _msgSender
-
-```solidity
-function _msgSender() internal view virtual returns (address sender)
-```
-
-#### _msgData
-
-```solidity
-function _msgData() internal view virtual returns (bytes)
-```
-
diff --git a/doc/technical.md b/doc/technical.md
deleted file mode 100644
index a99cd04..0000000
--- a/doc/technical.md
+++ /dev/null
@@ -1,130 +0,0 @@
-# Technical choice
-
-[TOC]
-
-## Schema
-
-### UML
-
-![uml](./schema/uml.svg)
-
-## Graph
-
-### RuleEngine
-
-![surya_graph_RuleEngine](./schema/surya/surya_graph_RuleEngine.png)
-
-### Whitelist
-
-![surya_graph_Whitelist](./schema/surya/surya_graph_Whitelist.png)
-
-## Access Control
-
-### Admin
-
-### Whitelist
-
-The default admin is the address put in argument(`admin`) inside the constructor. It is set in the constructor when the contract is deployed.
-
-### RuleEngine
-
-The default admin is the address put in argument(`admin`) inside the constructor. It is set in the constructor when the contract is deployed.
-
-### Schema
-
-Here a schema of the Access Control.
-
-**RuleEngine**
-![alt text](./accessControl/access-control-RuleEngine.png)
-
-**RuleWhitelist**
-![alt text](./accessControl/access-control-RuleWhitelist.png)
-
-
-
-## Functionality
-
-### Upgradeable
-
-The Rule Engine and the Whitelist contracts are not upgradeable. The reason is the following:
-If we need a new on, we just issue a new one, and tell the token to use the new. This would happen if we need more than just whitelisting, for ex.
-
-### Urgency mechanism
-* Pause
- There are no functionalities to put in pause the contracts.
-
-* We have removed the possibility to Kill the contracts, to destroy the bytecode, from
- The whitelist and the RuleEngine contracts for the following reasons:
-
- * The opcode SELFDESTRUCT which the property of destroying the contract (= deletion of any storage keys or code) will be remove with the Cancun Upgrade, an upgrade of the Ethereum network.
-
- Therefore, when the Ethereum Network will integrate this upgrade, this functionality will no longer be available.
-
- See https://eips.ethereum.org/EIPS/eip-6780 & https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md
-
- * It was recommended by the audit team
-
- > Implementing an ability to destroy a contract is a bad practice, as it cause more risks than benefits.
-
-
-### Gasless support
-
-> The gasless integration was not part of the audit performed by ABDK on the version [1.0.1](https://github.com/CMTA/RuleEngine/releases/tag/1.0.1)
-
-The RuleEngine and the Whitelist contracts support client-side gasless transactions using the [Gas Station Network](https://docs.opengsn.org/#the-problem) (GSN) pattern, the main open standard for transfering fee payment to another account than that of the transaction issuer. The contract uses the OpenZeppelin contract `ERC2771Context`, which allows a contract to get the original client with `_msgSender()` instead of the fee payer given by `msg.sender` .
-
-At deployment, the parameter `forwarder` inside the contract constructor has to be set with the defined address of the forwarder. Please note that the forwarder can not be changed after deployment.
-
-Please see the OpenGSN [documentation](https://docs.opengsn.org/contracts/#receiving-a-relayed-call) for more details on what is done to support GSN in the contract.
-
-## RuleEngine
-
-### Duplicate rules
-
-**setRules**
-
-If one rule is already present, the function is reverted
-
-**addRule**
-
-If one rule is already present, the function is reverted
-
-### Null address
-
-**setRules**
-
-The function is reverted if one rule is the zero address
-
-**addRule**
-
-The function is reverted if one rule is the zero address
-
-## Whitelist
-
-### Null address
-It is possible to add the null address (0x0) to the whitelist. It is a requirement from the CMTAT to be able to mint tokens.
-
-It is not a security problem because OpenZeppelin doesn't authorize the transfer of tokens to the zero address.
-
-### Duplicate address
-
-**addAddress**
-If the address already exists, the transaction is reverted to save gas.
-**addAddresses**
-If one of addresses already exist, there is no change for this address. The transaction remains valid (no revert).
-
-### NonExistent Address
-**removeAddress**
-If the address does not exist in the whitelist, the transaction is reverted to save gas.
-**removeAddresses**
-If the address does not exist in the whitelist, there is no change for this address. The transaction remains valid (no revert).
-
-## Other
-
-### Gas Optimization
-
-Inside a loop, we use `uncheck` to increment to save gas because an array has a length of < 2\**256.
-```
- unchecked { ++i; }
-```
-See [hackmd.io - gas-optimization-loops](https://hackmd.io/@totomanov/gas-optimization-loops) and [https://github.com/ethereum/solidity/issues/10698](https://github.com/ethereum/solidity/issues/10698)
diff --git a/doc/technical/RuleEngine.md b/doc/technical/RuleEngine.md
new file mode 100644
index 0000000..7c378f6
--- /dev/null
+++ b/doc/technical/RuleEngine.md
@@ -0,0 +1,60 @@
+# RuleEngine
+
+[TOC]
+
+The RuleEngine is an external contract used to apply transfer restriction to the CMTAT.
+
+This contract acts as a controller and can call different contract rule to apply rule on each transfer.
+
+A possible rule is a whitelist rule where only the address inside the whitelist can perform a transfer
+
+## Schema
+
+![RuleEngine](../schema/RuleEngine.png)
+
+### Graph
+
+
+
+![surya_graph_RuleEngine](../schema/surya/surya_graph_RuleEngine.png)
+
+
+
+## Access Control
+
+### Admin
+
+The default admin is the address put in argument(`admin`) inside the constructor. It is set in the constructor when the contract is deployed.
+
+### Schema
+
+Here a schema of the Access Control.
+![alt text](../accessControl/access-control-RuleEngine.png)
+
+
+
+
+
+## Methods
+
+### Duplicate rules
+
+**setRules**
+
+If one rule is already present, the function is reverted
+
+**addRule**
+
+If one rule is already present, the function is reverted
+
+### Null address
+
+**setRules**
+
+The function is reverted if one rule is the zero address
+
+**addRule**
+
+The function is reverted if one rule is the zero address
+
+https://github.com/ethereum/solidity/issues/10698)
diff --git a/doc/technical/RuleSanctionList.md b/doc/technical/RuleSanctionList.md
new file mode 100644
index 0000000..1191d18
--- /dev/null
+++ b/doc/technical/RuleSanctionList.md
@@ -0,0 +1,34 @@
+# Rule SanctionList
+
+[TOC]
+
+This document defines the rule SanctionList
+
+## How to use
+
+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).
+
+The documentation and the contracts addresses are available here: [Chainalysis oracle for sanctions screening](https://go.chainalysis.com/chainalysis-oracle-docs.html)
+
+## Schema
+
+### Graph
+
+### SanctionList
+
+![surya_graph_Whitelist](../schema/surya/surya_graph_SanctionList.png)
+
+## Access Control
+
+### Admin
+
+The default admin is the address put in argument(`admin`) inside the constructor. It is set in the constructor when the contract is deployed.
+
+### Schema
+
+Here a schema of the Access Control.
+
+**RuleSanctionList**
+
+![alt text](../accessControl/access-control-RuleSanctionList.drawio.png)
+
diff --git a/doc/technical/RuleWhitelist.md b/doc/technical/RuleWhitelist.md
new file mode 100644
index 0000000..ce64a68
--- /dev/null
+++ b/doc/technical/RuleWhitelist.md
@@ -0,0 +1,48 @@
+# Rule Whitelist
+
+[TOC]
+
+This rule can be used to restrict transfers from/to only addresses inside a whitelist.
+
+## Schema
+
+### Graph
+
+![surya_graph_Whitelist](../schema/surya/surya_graph_Whitelist.png)
+
+
+
+## Access Control
+
+### Admin
+
+The default admin is the address put in argument(`admin`) inside the constructor. It is set in the constructor when the contract is deployed.
+
+### Schema
+
+Here a schema of the Access Control.
+![alt text](../accessControl/access-control-RuleWhitelist.png)
+
+
+
+
+
+## Methods
+
+### Null address
+It is possible to add the null address (0x0) to the whitelist. It is a requirement from the CMTAT to be able to mint tokens.
+
+It is not a security problem because OpenZeppelin doesn't authorize the transfer of tokens to the zero address.
+
+### Duplicate address
+
+**addAddress**
+If the address already exists, the transaction is reverted to save gas.
+**addAddresses**
+If one of addresses already exist, there is no change for this address. The transaction remains valid (no revert).
+
+### NonExistent Address
+**removeAddress**
+If the address does not exist in the whitelist, the transaction is reverted to save gas.
+**removeAddresses**
+If the address does not exist in the whitelist, there is no change for this address. The transaction remains valid (no revert).
diff --git a/doc/technical/general.md b/doc/technical/general.md
new file mode 100644
index 0000000..b0479ec
--- /dev/null
+++ b/doc/technical/general.md
@@ -0,0 +1,56 @@
+# Technical choice
+
+[TOC]
+
+## Schema
+
+### UML
+
+![uml](../schema/classDiagram1.0.3.svg)
+
+
+
+## Functionality
+
+### Upgradeable
+
+The Rule Engine, the Rule Whitelist and the Rule SanctionList contracts are not upgradeable. The reason is the following:
+If we need a new on, we just issue a new one, and tell the CMTAT token (or the RuleEngine for the rules) to use the new. This would happen if we need more than just whitelisting, for ex.
+
+### Urgency mechanism
+* Pause
+ There are no functionalities to put in pause the contracts.
+
+* We have removed the possibility to Kill the contracts, to destroy the bytecode, from
+ the different contracts (RuleEngine and Rule) for the following reasons:
+
+ * The opcode SELFDESTRUCT which the property of destroying the contract (= deletion of any storage keys or code) will be remove with the Cancun Upgrade, an upgrade of the Ethereum network.
+
+ Therefore, when the Ethereum Network will integrate this upgrade, this functionality will no longer be available.
+
+ See [https://eips.ethereum.org/EIPS/eip-6780](https://eips.ethereum.org/EIPS/eip-6780) & [https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md](https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md)
+
+ * It was recommended by the audit team
+
+ > Implementing an ability to destroy a contract is a bad practice, as it cause more risks than benefits.
+
+
+### Gasless support
+
+> The gasless integration was not part of the audit performed by ABDK on the version [1.0.1](https://github.com/CMTA/RuleEngine/releases/tag/1.0.1)
+
+The RuleEngine, the Whitelist and SanctionList contracts support client-side gasless transactions using the [Gas Station Network](https://docs.opengsn.org/#the-problem) (GSN) pattern, the main open standard for transfering fee payment to another account than that of the transaction issuer. The contract uses the OpenZeppelin contract `ERC2771Context`, which allows a contract to get the original client with `_msgSender()` instead of the fee payer given by `msg.sender` .
+
+At deployment, the parameter `forwarder` inside the contract constructor has to be set with the defined address of the forwarder. Please note that the forwarder can not be changed after deployment.
+
+Please see the OpenGSN [documentation](https://docs.opengsn.org/contracts/#receiving-a-relayed-call) for more details on what is done to support GSN in the contract.
+
+## Other
+
+### Gas Optimization
+
+Inside a loop, we use `uncheck` to increment to save gas because an array has a length of < 2\**256.
+```
+ unchecked { ++i; }
+```
+See [hackmd.io - gas-optimization-loops](https://hackmd.io/@totomanov/gas-optimization-loops) and [https://github.com/ethereum/solidity/issues/10698](https://github.com/ethereum/solidity/issues/10698)
diff --git a/doc/test/coverage/amber.png b/doc/test/coverage/amber.png
new file mode 100644
index 0000000..2cab170
Binary files /dev/null and b/doc/test/coverage/amber.png differ
diff --git a/doc/test/coverage/emerald.png b/doc/test/coverage/emerald.png
new file mode 100644
index 0000000..38ad4f4
Binary files /dev/null and b/doc/test/coverage/emerald.png differ
diff --git a/doc/test/coverage/gcov.css b/doc/test/coverage/gcov.css
new file mode 100644
index 0000000..0fcdff1
--- /dev/null
+++ b/doc/test/coverage/gcov.css
@@ -0,0 +1,519 @@
+/* All views: initial background and text color */
+body
+{
+ color: #000000;
+ background-color: #ffffff;
+}
+
+/* All views: standard link format*/
+a:link
+{
+ color: #284fa8;
+ text-decoration: underline;
+}
+
+/* All views: standard link - visited format */
+a:visited
+{
+ color: #00cb40;
+ text-decoration: underline;
+}
+
+/* All views: standard link - activated format */
+a:active
+{
+ color: #ff0040;
+ text-decoration: underline;
+}
+
+/* All views: main title format */
+td.title
+{
+ text-align: center;
+ padding-bottom: 10px;
+ font-family: sans-serif;
+ font-size: 20pt;
+ font-style: italic;
+ font-weight: bold;
+}
+
+/* All views: header item format */
+td.headerItem
+{
+ text-align: right;
+ padding-right: 6px;
+ font-family: sans-serif;
+ font-weight: bold;
+ vertical-align: top;
+ white-space: nowrap;
+}
+
+/* All views: header item value format */
+td.headerValue
+{
+ text-align: left;
+ color: #284fa8;
+ font-family: sans-serif;
+ font-weight: bold;
+ white-space: nowrap;
+}
+
+/* All views: header item coverage table heading */
+td.headerCovTableHead
+{
+ text-align: center;
+ padding-right: 6px;
+ padding-left: 6px;
+ padding-bottom: 0px;
+ font-family: sans-serif;
+ font-size: 80%;
+ white-space: nowrap;
+}
+
+/* All views: header item coverage table entry */
+td.headerCovTableEntry
+{
+ text-align: right;
+ color: #284fa8;
+ font-family: sans-serif;
+ font-weight: bold;
+ white-space: nowrap;
+ padding-left: 12px;
+ padding-right: 4px;
+ background-color: #dae7fe;
+}
+
+/* All views: header item coverage table entry for high coverage rate */
+td.headerCovTableEntryHi
+{
+ text-align: right;
+ color: #000000;
+ font-family: sans-serif;
+ font-weight: bold;
+ white-space: nowrap;
+ padding-left: 12px;
+ padding-right: 4px;
+ background-color: #a7fc9d;
+}
+
+/* All views: header item coverage table entry for medium coverage rate */
+td.headerCovTableEntryMed
+{
+ text-align: right;
+ color: #000000;
+ font-family: sans-serif;
+ font-weight: bold;
+ white-space: nowrap;
+ padding-left: 12px;
+ padding-right: 4px;
+ background-color: #ffea20;
+}
+
+/* All views: header item coverage table entry for ow coverage rate */
+td.headerCovTableEntryLo
+{
+ text-align: right;
+ color: #000000;
+ font-family: sans-serif;
+ font-weight: bold;
+ white-space: nowrap;
+ padding-left: 12px;
+ padding-right: 4px;
+ background-color: #ff0000;
+}
+
+/* All views: header legend value for legend entry */
+td.headerValueLeg
+{
+ text-align: left;
+ color: #000000;
+ font-family: sans-serif;
+ font-size: 80%;
+ white-space: nowrap;
+ padding-top: 4px;
+}
+
+/* All views: color of horizontal ruler */
+td.ruler
+{
+ background-color: #6688d4;
+}
+
+/* All views: version string format */
+td.versionInfo
+{
+ text-align: center;
+ padding-top: 2px;
+ font-family: sans-serif;
+ font-style: italic;
+}
+
+/* Directory view/File view (all)/Test case descriptions:
+ table headline format */
+td.tableHead
+{
+ text-align: center;
+ color: #ffffff;
+ background-color: #6688d4;
+ font-family: sans-serif;
+ font-size: 120%;
+ font-weight: bold;
+ white-space: nowrap;
+ padding-left: 4px;
+ padding-right: 4px;
+}
+
+span.tableHeadSort
+{
+ padding-right: 4px;
+}
+
+/* Directory view/File view (all): filename entry format */
+td.coverFile
+{
+ text-align: left;
+ padding-left: 10px;
+ padding-right: 20px;
+ color: #284fa8;
+ background-color: #dae7fe;
+ font-family: monospace;
+}
+
+/* Directory view/File view (all): bar-graph entry format*/
+td.coverBar
+{
+ padding-left: 10px;
+ padding-right: 10px;
+ background-color: #dae7fe;
+}
+
+/* Directory view/File view (all): bar-graph outline color */
+td.coverBarOutline
+{
+ background-color: #000000;
+}
+
+/* Directory view/File view (all): percentage entry for files with
+ high coverage rate */
+td.coverPerHi
+{
+ text-align: right;
+ padding-left: 10px;
+ padding-right: 10px;
+ background-color: #a7fc9d;
+ font-weight: bold;
+ font-family: sans-serif;
+}
+
+/* Directory view/File view (all): line count entry for files with
+ high coverage rate */
+td.coverNumHi
+{
+ text-align: right;
+ padding-left: 10px;
+ padding-right: 10px;
+ background-color: #a7fc9d;
+ white-space: nowrap;
+ font-family: sans-serif;
+}
+
+/* Directory view/File view (all): percentage entry for files with
+ medium coverage rate */
+td.coverPerMed
+{
+ text-align: right;
+ padding-left: 10px;
+ padding-right: 10px;
+ background-color: #ffea20;
+ font-weight: bold;
+ font-family: sans-serif;
+}
+
+/* Directory view/File view (all): line count entry for files with
+ medium coverage rate */
+td.coverNumMed
+{
+ text-align: right;
+ padding-left: 10px;
+ padding-right: 10px;
+ background-color: #ffea20;
+ white-space: nowrap;
+ font-family: sans-serif;
+}
+
+/* Directory view/File view (all): percentage entry for files with
+ low coverage rate */
+td.coverPerLo
+{
+ text-align: right;
+ padding-left: 10px;
+ padding-right: 10px;
+ background-color: #ff0000;
+ font-weight: bold;
+ font-family: sans-serif;
+}
+
+/* Directory view/File view (all): line count entry for files with
+ low coverage rate */
+td.coverNumLo
+{
+ text-align: right;
+ padding-left: 10px;
+ padding-right: 10px;
+ background-color: #ff0000;
+ white-space: nowrap;
+ font-family: sans-serif;
+}
+
+/* File view (all): "show/hide details" link format */
+a.detail:link
+{
+ color: #B8D0FF;
+ font-size:80%;
+}
+
+/* File view (all): "show/hide details" link - visited format */
+a.detail:visited
+{
+ color: #B8D0FF;
+ font-size:80%;
+}
+
+/* File view (all): "show/hide details" link - activated format */
+a.detail:active
+{
+ color: #ffffff;
+ font-size:80%;
+}
+
+/* File view (detail): test name entry */
+td.testName
+{
+ text-align: right;
+ padding-right: 10px;
+ background-color: #dae7fe;
+ font-family: sans-serif;
+}
+
+/* File view (detail): test percentage entry */
+td.testPer
+{
+ text-align: right;
+ padding-left: 10px;
+ padding-right: 10px;
+ background-color: #dae7fe;
+ font-family: sans-serif;
+}
+
+/* File view (detail): test lines count entry */
+td.testNum
+{
+ text-align: right;
+ padding-left: 10px;
+ padding-right: 10px;
+ background-color: #dae7fe;
+ font-family: sans-serif;
+}
+
+/* Test case descriptions: test name format*/
+dt
+{
+ font-family: sans-serif;
+ font-weight: bold;
+}
+
+/* Test case descriptions: description table body */
+td.testDescription
+{
+ padding-top: 10px;
+ padding-left: 30px;
+ padding-bottom: 10px;
+ padding-right: 30px;
+ background-color: #dae7fe;
+}
+
+/* Source code view: function entry */
+td.coverFn
+{
+ text-align: left;
+ padding-left: 10px;
+ padding-right: 20px;
+ color: #284fa8;
+ background-color: #dae7fe;
+ font-family: monospace;
+}
+
+/* Source code view: function entry zero count*/
+td.coverFnLo
+{
+ text-align: right;
+ padding-left: 10px;
+ padding-right: 10px;
+ background-color: #ff0000;
+ font-weight: bold;
+ font-family: sans-serif;
+}
+
+/* Source code view: function entry nonzero count*/
+td.coverFnHi
+{
+ text-align: right;
+ padding-left: 10px;
+ padding-right: 10px;
+ background-color: #dae7fe;
+ font-weight: bold;
+ font-family: sans-serif;
+}
+
+/* Source code view: source code format */
+pre.source
+{
+ font-family: monospace;
+ white-space: pre;
+ margin-top: 2px;
+}
+
+/* Source code view: line number format */
+span.lineNum
+{
+ background-color: #efe383;
+}
+
+/* Source code view: format for lines which were executed */
+td.lineCov,
+span.lineCov
+{
+ background-color: #cad7fe;
+}
+
+/* Source code view: format for Cov legend */
+span.coverLegendCov
+{
+ padding-left: 10px;
+ padding-right: 10px;
+ padding-bottom: 2px;
+ background-color: #cad7fe;
+}
+
+/* Source code view: format for lines which were not executed */
+td.lineNoCov,
+span.lineNoCov
+{
+ background-color: #ff6230;
+}
+
+/* Source code view: format for NoCov legend */
+span.coverLegendNoCov
+{
+ padding-left: 10px;
+ padding-right: 10px;
+ padding-bottom: 2px;
+ background-color: #ff6230;
+}
+
+/* Source code view (function table): standard link - visited format */
+td.lineNoCov > a:visited,
+td.lineCov > a:visited
+{
+ color: #000000;
+ text-decoration: underline;
+}
+
+/* Source code view: format for lines which were executed only in a
+ previous version */
+span.lineDiffCov
+{
+ background-color: #b5f7af;
+}
+
+/* Source code view: format for branches which were executed
+ * and taken */
+span.branchCov
+{
+ background-color: #cad7fe;
+}
+
+/* Source code view: format for branches which were executed
+ * but not taken */
+span.branchNoCov
+{
+ background-color: #ff6230;
+}
+
+/* Source code view: format for branches which were not executed */
+span.branchNoExec
+{
+ background-color: #ff6230;
+}
+
+/* Source code view: format for the source code heading line */
+pre.sourceHeading
+{
+ white-space: pre;
+ font-family: monospace;
+ font-weight: bold;
+ margin: 0px;
+}
+
+/* All views: header legend value for low rate */
+td.headerValueLegL
+{
+ font-family: sans-serif;
+ text-align: center;
+ white-space: nowrap;
+ padding-left: 4px;
+ padding-right: 2px;
+ background-color: #ff0000;
+ font-size: 80%;
+}
+
+/* All views: header legend value for med rate */
+td.headerValueLegM
+{
+ font-family: sans-serif;
+ text-align: center;
+ white-space: nowrap;
+ padding-left: 2px;
+ padding-right: 2px;
+ background-color: #ffea20;
+ font-size: 80%;
+}
+
+/* All views: header legend value for hi rate */
+td.headerValueLegH
+{
+ font-family: sans-serif;
+ text-align: center;
+ white-space: nowrap;
+ padding-left: 2px;
+ padding-right: 4px;
+ background-color: #a7fc9d;
+ font-size: 80%;
+}
+
+/* All views except source code view: legend format for low coverage */
+span.coverLegendCovLo
+{
+ padding-left: 10px;
+ padding-right: 10px;
+ padding-top: 2px;
+ background-color: #ff0000;
+}
+
+/* All views except source code view: legend format for med coverage */
+span.coverLegendCovMed
+{
+ padding-left: 10px;
+ padding-right: 10px;
+ padding-top: 2px;
+ background-color: #ffea20;
+}
+
+/* All views except source code view: legend format for hi coverage */
+span.coverLegendCovHi
+{
+ padding-left: 10px;
+ padding-right: 10px;
+ padding-top: 2px;
+ background-color: #a7fc9d;
+}
diff --git a/doc/test/coverage/glass.png b/doc/test/coverage/glass.png
new file mode 100644
index 0000000..e1abc00
Binary files /dev/null and b/doc/test/coverage/glass.png differ
diff --git a/doc/test/coverage/index-sort-b.html b/doc/test/coverage/index-sort-b.html
new file mode 100644
index 0000000..ddbe342
--- /dev/null
+++ b/doc/test/coverage/index-sort-b.html
@@ -0,0 +1,155 @@
+
+
+
+
+