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
There are many ways to contribute to RuleEngine Contracts.
4
+
5
+
## Opening an issue
6
+
7
+
You can [open an issue] to suggest a feature, a difficulty you have or report a minor bug. For serious bugs in an audited version please do not open an issue, instead refer to our [security policy] for appropriate steps. See [SECURITY.md](./SECURITY.MD) in CMTAT project.
8
+
9
+
Before opening an issue, be sure to search through the existing open and closed issues, and consider posting a comment in one of those instead.
10
+
11
+
When requesting a new feature, include as many details as you can, especially around the use cases that motivate it.
12
+
13
+
## Submitting a pull request
14
+
15
+
If you would like to contribute code or documentation you may do so by forking the repository and submitting a pull request.
16
+
17
+
Run linter and tests to make sure your pull request is good before submitting it.
18
+
19
+
20
+
21
+
## Reference
22
+
23
+
Based on the version made by [OpenZeppelin](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/CONTRIBUTING.md)
Copy file name to clipboardExpand all lines: README.md
+75-15Lines changed: 75 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,16 @@
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.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
6
9
-
The CMTAT contracts and the OpenZeppelin library are included as a submodule of the present repository.
7
+
The RuleEngine is an external contract used to apply transfer restrictions to another contract, initially the CMTAT. Acting as a controller, it can call different contract rules and apply these rules on each transfer.
8
+
9
+
## Dependencies
10
+
11
+
The toolchain includes the following components, where the versions are the latest ones that we tested:
@@ -38,11 +58,41 @@ The following rules are available:
38
58
39
59
40
60
61
+
62
+
63
+
## Functionality
64
+
65
+
### Upgradeable
66
+
67
+
The Rule Engine and the other rules are not upgradeable. The reason is the following:
68
+
If we need a new on, we just issue a new one, and set inside the CMTAT token (or the RuleEngine for the rules) to use the new.
69
+
70
+
### Urgency mechanism
71
+
72
+
- Pause
73
+
74
+
There are no functionalities to put in pause the contracts.
75
+
76
+
* Kill / Deactivate the contracts
77
+
78
+
There are no functionalities to kill/deactivate the contracts.
79
+
80
+
81
+
### Gasless support (ERC-2771)
82
+
83
+
> 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)
84
+
85
+
The RuleEngine contracts and the other rules 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` .
86
+
87
+
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.
88
+
89
+
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.
90
+
41
91
## Audit
42
92
43
93
The contracts have been audited by [ABDKConsulting](https://www.abdk.consulting/), a globally recognized firm specialized in smart contracts' security.
44
94
45
-
####First Audit - March 2022
95
+
### First Audit - March 2022
46
96
47
97
Fixed version : [v1.0.2](https://github.com/CMTA/RuleEngine/releases/tag/v1.0.2)
48
98
@@ -72,24 +122,24 @@ Here a summary of the main documentation
See also [Taurus - Token Transfer Management: How to Apply Restrictions with CMTAT and ERC-1404](https://www.taurushq.com/blog/token-transfer-management-how-to-apply-restrictions-with-cmtat-and-erc-1404/)
81
131
82
132
## Usage
83
133
84
134
*Explain how it works.*
85
135
86
136
87
-
## Toolchain installation
137
+
###Toolchain installation
88
138
The contracts are developed and tested with [Foundry](https://book.getfoundry.sh), a smart contract development toolchain.
89
139
90
140
To install the Foundry suite, please refer to the official instructions in the [Foundry book](https://book.getfoundry.sh/getting-started/installation).
91
141
92
-
## Initialization
142
+
###Initialization
93
143
94
144
You must first initialize the submodules, with
95
145
@@ -109,7 +159,7 @@ See also the command's [documentation](https://book.getfoundry.sh/reference/forg
109
159
110
160
111
161
112
-
## Compilation
162
+
###Compilation
113
163
114
164
The official documentation is available in the Foundry [website](https://book.getfoundry.sh/reference/forge/build-commands)
115
165
```
@@ -119,19 +169,25 @@ The official documentation is available in the Foundry [website](https://book.ge
119
169
forge build --contracts src/RuleWhiteList.sol
120
170
```
121
171
122
-
## Testing
172
+
###Testing
123
173
You can run the tests with
124
174
125
-
```
175
+
```bash
126
176
forge test
127
177
```
128
178
129
179
To run a specific test, use
130
180
131
-
```
181
+
```bash
132
182
forge test --match-contract <contract name> --match-test <function name>
133
183
```
134
184
185
+
Generate gas report
186
+
187
+
```bash
188
+
forge test --gas-report
189
+
```
190
+
135
191
See also the test framework's [official documentation](https://book.getfoundry.sh/forge/tests), and that of the [test commands](https://book.getfoundry.sh/reference/forge/test-commands).
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)
155
211
156
-
## Deployment
212
+
###Deployment
157
213
The official documentation is available in the Foundry [website](https://book.getfoundry.sh/reference/forge/deploy-commands)
158
-
### Script
214
+
####Script
159
215
160
216
> This documentation has been written for the version v1.0.2
The code is copyright (c) Capital Market and Technology Association, 2018-2024, and is released under [Mozilla Public License 2.0](https://github.com/CMTA/CMTAT/blob/master/LICENSE.md).
0 commit comments