You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-30Lines changed: 42 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,40 @@
3
3
# RuleEngine
4
4
5
5
This repository includes the RuleEngine contract for the [CMTAT](https://github.com/CMTA/CMTAT) token.
6
-
- The CMTAT version used is the version [v2.3.1](https://github.com/CMTA/CMTAT/releases/tag/v2.3.1)
7
-
- The OpenZeppelin version used is the version [v5.0.0](https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v5.0.0)
6
+
- The CMTAT version used is the version [v2.4.0](https://github.com/CMTA/CMTAT/releases/tag/v2.4.0)
7
+
- The OpenZeppelin version used is the version [v5.0.2](https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v5.0.2)
8
8
9
9
The CMTAT contracts and the OpenZeppelin library are included as a submodule of the present repository.
10
10
11
+
## How to include it
12
+
13
+
While it has been designed for the CMTAT, the ruleEngine can be used with others contracts to apply restriction on transfer.
14
+
15
+
For that, the only thing to do is to import in your contract the interface `IRuleEngine` which declares the function `operateOnTransfer`
16
+
17
+
This interface can be found in [CMTAT/contracts/interfaces/engine/IRuleEngine.sol](https://github.com/CMTA/CMTAT/blob/23a1e59f913d079d0c09d32fafbd95ab2d426093/contracts/interfaces/engine/IRuleEngine.sol)
18
+
19
+
Before each transfer, your contract must call the function `operateOnTransfer` which is the entrypoint for the RuleEngine.
|[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)|
34
+
|[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)|
35
+
|[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)|
36
+
|[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)|
37
+
38
+
39
+
11
40
## Audit
12
41
13
42
The contracts have been audited by [ABDKConsulting](https://www.abdk.consulting/), a globally recognized firm specialized in smart contracts' security.
@@ -30,21 +59,22 @@ You will find the report performed with [Slither](https://github.com/crytic/slit
> This documentation has been written for the version v1.0.2
157
-
158
-
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.
159
-
160
-
On Linux, using the default RPC URL, and Anvil's test private key, run:
0 commit comments