-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
779 additions
and
471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Contributing Guidelines | ||
|
||
There are many ways to contribute to CMTAT Contracts. | ||
|
||
## Opening an issue | ||
|
||
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). | ||
|
||
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. | ||
|
||
When requesting a new feature, include as many details as you can, especially around the use cases that motivate it. | ||
|
||
## Submitting a pull request | ||
|
||
If you would like to contribute code or documentation you may do so by forking the repository and submitting a pull request. | ||
|
||
Run linter and tests to make sure your pull request is good before submitting it. | ||
|
||
|
||
|
||
## Reference | ||
|
||
Based on the version made by [OpenZeppelin](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/CONTRIBUTING.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
# DocumentEngine (ERC-1643) | ||
|
||
> This project is not audited ! | ||
> This project has not been audited yet, please use at your own risk. For any questions, please contact [[email protected]](mailto:[email protected]). | ||
> | ||
> If you want to use this project, perform your own verification or send an email to [[email protected]](mailto:[email protected]). | ||
The `DocumentEngine` is an external contract to manage documents through [*ERC-1643*](https://github.com/ethereum/EIPs/issues/1643), a standard proposition to manage document on-chain. This standard is notably used by [ERC-1400](https://github.com/ethereum/eips/issues/1411) from Polymath. | ||
|
||
|
@@ -34,13 +33,13 @@ Since this engine allows to set documents for several different smart contracts, | |
|
||
IERC1643 | ||
|
||
```bash | ||
```solidity | ||
function setDocument(bytes32 _name, string _uri, bytes32 _documentHash) external; | ||
``` | ||
|
||
DocumentEngine | ||
|
||
```bash | ||
```solidity | ||
function setDocument(address smartContract,bytes32 name_,string memory uri_, bytes32 documentHash_) | ||
``` | ||
|
||
|
@@ -64,10 +63,8 @@ function setDocument(address smartContract,bytes32 name_,string memory uri_, byt | |
|
||
## Surya Description Report | ||
|
||
|
||
### Contracts Description Table | ||
|
||
|
||
| Contract | Type | Bases | | | | ||
| :----------------: | :------------------: | :----------------------------------------------: | :------------: | :-----------: | | ||
| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | | ||
|
@@ -77,16 +74,18 @@ function setDocument(address smartContract,bytes32 name_,string memory uri_, byt | |
| └ | setDocument | Public ❗️ | 🛑 | onlyRole | | ||
| └ | removeDocument | External ❗️ | 🛑 | onlyRole | | ||
| └ | batchSetDocuments | External ❗️ | 🛑 | onlyRole | | ||
| └ | batchSetDocuments | External ❗️ | 🛑 | onlyRole | | ||
| └ | batchRemoveDocuments | External ❗️ | 🛑 | onlyRole | | ||
| └ | batchRemoveDocuments | External ❗️ | 🛑 | onlyRole | | ||
| └ | getDocument | External ❗️ | | NO❗️ | | ||
| └ | getDocument | External ❗️ | | NO❗️ | | ||
| └ | getAllDocuments | External ❗️ | | NO❗️ | | ||
| └ | getAllDocuments | External ❗️ | | NO❗️ | | ||
| └ | hasRole | Public ❗️ | | NO❗️ | | ||
| └ | _getDocument | Internal 🔒 | | | | ||
| └ | _removeDocumentName | Internal 🔒 | 🛑 | | | ||
| └ | _removeDocument | Internal 🔒 | 🛑 | | | ||
| └ | _setDocument | Internal 🔒 | 🛑 | | | ||
| └ | hasRole | Public ❗️ | | NO❗️ | | ||
|
||
|
||
### Legend | ||
|
@@ -109,22 +108,12 @@ The toolchain includes the following components, where the versions are the late | |
|
||
## Tools | ||
|
||
### Forge coverage | ||
|
||
```bash | ||
forge coverage --report lcov && genhtml lcov.info --branch-coverage --output-dir coverage | ||
``` | ||
|
||
|
||
|
||
### Prettier | ||
|
||
```bash | ||
npx prettier --write --plugin=prettier-plugin-solidity 'src/**/*.sol' | ||
``` | ||
|
||
|
||
|
||
### Slither | ||
|
||
```bash | ||
|
@@ -135,8 +124,6 @@ slither . --checklist --filter-paths "openzeppelin-contracts|test|CMTAT|forge-s | |
|
||
See [./doc/script](./doc/script) | ||
|
||
|
||
|
||
### Foundry | ||
|
||
Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust. | ||
|
@@ -148,58 +135,74 @@ Foundry consists of: | |
- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network. | ||
- **Chisel**: Fast, utilitarian, and verbose solidity REPL. | ||
|
||
### Documentation | ||
#### Documentation | ||
|
||
https://book.getfoundry.sh/ | ||
|
||
### Usage | ||
#### Usage | ||
|
||
##### Coverage | ||
|
||
#### Build | ||
```bash | ||
$ forge coverage --report lcov && genhtml lcov.info --branch-coverage --output-dir coverage | ||
``` | ||
|
||
##### Gas report | ||
|
||
```bash | ||
$ forge test --gas-report | ||
``` | ||
|
||
##### Build | ||
|
||
```shell | ||
$ forge build | ||
``` | ||
|
||
#### Test | ||
##### Test | ||
|
||
```shell | ||
$ forge test | ||
``` | ||
|
||
#### Format | ||
##### Format | ||
|
||
```shell | ||
$ forge fmt | ||
``` | ||
|
||
### Gas Snapshots | ||
##### Gas Snapshots | ||
|
||
```shell | ||
$ forge snapshot | ||
``` | ||
|
||
#### Anvil | ||
##### Anvil | ||
|
||
```shell | ||
$ anvil | ||
``` | ||
|
||
#### Deploy | ||
##### Deploy | ||
|
||
```shell | ||
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key> | ||
``` | ||
|
||
#### Cast | ||
##### Cast | ||
|
||
```shell | ||
$ cast <subcommand> | ||
``` | ||
|
||
#### Help | ||
##### Help | ||
|
||
```shell | ||
$ forge --help | ||
$ anvil --help | ||
$ cast --help | ||
``` | ||
|
||
## Intellectual property | ||
|
||
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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.