diff --git a/CHANGELOG.md b/CHANGELOG.md index 55abf03d..dd0ee63e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,26 @@ Please follow conventions. + + +## 2.5.0-rc.0 - 20240809 + +**Features** + +- Add ERC-1643 (part of ERC-1400) for document management through an optional external contract called DocumentEngine (not yet available) [Add ERC-1643 support #267](https://github.com/CMTA/CMTAT/issues/267) +- Externalize the Debt and CreditEvent module to an optional external contract called DebtEngine (not yet available) [Add DebtEngine #271](https://github.com/CMTA/CMTAT/issues/271) +- CMTAT version compatible with UUPS proxy : more gas efficient than Transparent Proxy + no need of a proxy admin contract. See Upgradable Smart Contracts | What is a Smart Contract Proxy Pattern? [Add UUPS proxy support #270](https://github.com/CMTA/CMTAT/issues/270) +- Remove [flag](https://github.com/CMTA/CMTAT/blob/master/contracts/modules/wrapper/core/BaseModule.sol#L29) attribute, present since v2.3.0, which was not really used. [ #266](https://github.com/CMTA/CMTAT/issues/266) + +**Technical** + +- Change Solidity version to 0.8.26 (latest) +- Change EVM version to Cancun +- Remove truffle from dependencies, replaced by Hardhat. See [Consensys Announces the Sunset of Truffle and Ganache and New Hardhat Partnership](https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat) +- Proxy Factory + - use create2 with the library [Create2](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Create2.sol) from OpenZeppelin: +- Implement [ERC-7201](https://eips.ethereum.org/EIPS/eip-7201) to manage memory to reduce memory collision when upgrading a proxy to a new implementation. [Use erc-7201 for namespace #272](https://github.com/CMTA/CMTAT/issues/272) + ## 2.4.0 The modifications between the version v2.3.0 and this version are not audited !!! diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..a037f332 --- /dev/null +++ b/CONTRIBUTING.md @@ -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) diff --git a/FAQ.md b/FAQ.md index 0bc33b66..c93cef1b 100644 --- a/FAQ.md +++ b/FAQ.md @@ -7,32 +7,22 @@ development. > Which is the main development tool you use ? -Until the version v.2.3.1, we used `Truffle` with `web3js` as our main development tool and testing library. Since this version, we use *custom errors* to generate errors inside our smart contracts and this type of errors are not supported by `Truffle` for testing. - -Therefore, we use `Hardhat` with `web3js` to run our tests, but you can compile the contracts with Truffle or Hardhat. +Since the sunset of Truffle by Consensys, we use Hardhat Regarding [Foundry](https://book.getfoundry.sh/): -- The plugin "upgrades plugin" by OpenZeppelin is not available with Foundry and it is a very good tool to check the proxy implementation and perform automatic tests. See [https://docs.openzeppelin.com/upgrades-plugins/1.x/](https://docs.openzeppelin.com/upgrades-plugins/1.x/) -- The tests for the gasless module (MetaTx) would be difficult to write - in Solidity, as Foundry requires, see [https://github.com/CMTA/CMTAT/blob/master/test/common/MetaTxModuleCommon.js](https://github.com/CMTA/CMTAT/blob/master/test/common/MetaTxModuleCommon.js) -- The OpenZeppelin libraries that we use have their tests mainly written in JavaScript, which provides a good basis for our tests -- We have a repository [CMTA/CMTAT-Foundry](https://github.com/CMTA/CMTAT-foundry) that provides experimental support for Foundry, but it does not provide complete support and testing for the latest CMTAT version. +- All our tests are written in Javascript and migrating them to Foundry will require a lot of work +- The tests for the gasless module (MetaTx) would be difficult to write + in Solidity, as Foundry requires, see [https://github.com/CMTA/CMTAT/blob/master/test/common/MetaTxModuleCommon.js](https://github.com/CMTA/CMTAT/blob/master/test/common/MetaTxModuleCommon.js) + +- The OpenZeppelin libraries that we use have their tests mainly written in JavaScript, which provides a good basis for our tests > Do you plan to fully support Foundry in the near future? -For the foreseeable future, we plan to keep Hardhat/Truffle as the main +For the foreseeable future, we plan to keep Hardhat as the main development and testing suite. -We have not planned to export all the tests from the Truffle/Hardhat suite to -their Solidity version equivalent suitable to Foundry, though some tests -are already available. - -The CMTAT-Foundry repository uses CMTAT as a submodule, whose version is -documented in its -[README](https://github.com/CMTA/CMTAT-Foundry/blob/main/README.md#cmtat---using-the-foundry-suite). - > Can Truffle be used to run tests? @@ -45,29 +35,18 @@ You can only run the tests with `Hardhat`. > What is the reason the Snapshot module wasn't audited in version v2.3.0? -This module was left out of scope because it is not used yet (and not -included in a default deployment) and will be -subject to changes soon. +This module was left out of scope because it is not used yet (and not included in a default deployment) and will be subject to changes soon. > What is the status of [ERC1404](https://erc1404) compatibility? -We have not planned to be fully compatible with ERC1404 (which, in fact, -is only an EIP at the time of writing). -CMTAT includes the two functions defind by ERC1404, namely -`detectTransferRestriction` and `messageForTransferRestriction`. +We have not planned to be fully compatible with ERC1404 (which, in fact, is only an EIP at the time of writing). +CMTAT includes the two functions defind by ERC1404, namely `detectTransferRestriction` and `messageForTransferRestriction`. Thus CMTAT can provide the same functionality as ERC1404. However, from a pure technical perspective, CMTAT is not fully compliant with the ERC1404 specification, due the way it inherits the ERC20 interface. -> What is the purpose of the flag parameter in the Base module? - -It is just a variable to include some additional information under the form of bit fields. -It is not used inside the code because it is destined to provide more -information on the tokens to the "outside", for example for the token -owners. - > Is the Validation module optional? @@ -75,30 +54,20 @@ Generally, for a CMTAT token, the Validation functionality is optional from the legal perspective (please contact admin@cmta.ch for detailed information). -However, in order to use the functions from the Pause and Enforcement -modules, our CMTAT implementation requires the Validation module -Therefore, the Validation module is effectively required *in this -implementation*. +However, in order to use the functions from the Pause and Enforcement modules, our CMTAT implementation requires the Validation module. Therefore, the Validation module is effectively required *in this implementation*. If you remove the Validation module and want to use the Pause or the -Enforcement module, you have to call the functions of modules inside the -main contracts. It was initially the case but we have changed this -behavior when addressing an issue reported by a security audit. +Enforcement module, you have to call the functions of modules inside the main contracts. It was initially the case but we have changed this behavior when addressing an issue reported by a security audit. Here is an old version: -[https://github.com/CMTA/CMTAT/blob/ed23bfc69cfacc932945da751485c6472705c975/contracts/CMTAT.sol#L205](https://github.com/CMTA/CMTAT/blob/ed23bfc69cfacc932945da751485c6472705c975/contracts/CMTAT.sol#L205), -and the relevant Pull [Request](https://github.com/CMTA/CMTAT/pull/153). +[https://github.com/CMTA/CMTAT/blob/ed23bfc69cfacc932945da751485c6472705c975/contracts/CMTAT.sol#L205](https://github.com/CMTA/CMTAT/blob/ed23bfc69cfacc932945da751485c6472705c975/contracts/CMTAT.sol#L205), and the relevant Pull [Request](https://github.com/CMTA/CMTAT/pull/153). ## Documentation > What is the code coverage of the test suite? -A [code coverage report](https://github.com/CMTA/CMTAT/blob/master/doc/general/test/coverage/index.html) -is available. +A [code coverage report](https://github.com/CMTA/CMTAT/blob/master/doc/general/test/coverage/index.html) is available. Normally, you can run the test suite and generate a code coverage report with `npx hardhat coverage`. Please clone the repository and open the file inside your browser. - -You will find a list of automatic tests in -[test.pdf](https://github.com/CMTA/CMTAT/blob/master/doc/general/test/test.pdf). diff --git a/README.md b/README.md index 4b43fe90..f08fd925 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ + + # CMTA Token + > To use the CMTAT, we recommend the latest audited version, from the [Releases](https://github.com/CMTA/CMTAT/releases) page. Currently, it is the version [v2.3.0](https://github.com/CMTA/CMTAT/releases/tag/v2.3.0) ## Introduction @@ -33,42 +36,21 @@ It can however also be used for other forms of financial instruments such as deb You may modify the token code by adding, removing, or modifying features. However, the core modules must remain in place for compliance with Swiss law. -### Deployment model - -#### Standalone - -To deploy CMTAT without a proxy, in standalone mode, you need to use the contract version `CMTAT_STANDALONE`. - -#### With a proxy - -The CMTAT supports deployment via a proxy contract. Furthermore, using a proxy permits to upgrade the contract, using a standard proxy upgrade pattern. - -The contract version to use as an implementation is the `CMTAT_PROXY`. - -Please see the OpenZeppelin [upgradeable contracts documentation](https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable) for more information about the proxy requirements applied to the contract. - -Please see the OpenZeppelin [Upgrades plugins](https://docs.openzeppelin.com/upgrades-plugins/1.x/) for more information about plugin upgrades in general. - -Note that deployment via a proxy is not mandatory, but is recommended by CMTA. - - - -#### Factory - -Factory contracts are available to deploy the CMTAT with a beacon proxy or a transparent proxy. - -[CMTAT_BEACON_FACTORY.sol](./contracts/deployment/CMTAT_BEACON_FACTORY.sol) - -[CMTAT_TRANSPARENT_FACTORY.sol](./contracts/deployment/CMTAT_TRANSPARENT_FACTORY.sol) +### Kill switch -Beacon Proxy factory: the factory will use the same beacon for each beacon proxy. This beacon provides the address of the implementation contract, a CMTAT_PROXY contract. If you upgrade the beacon to point to a new implementation, it will change the implementation contract for all beacon proxy. +CMTAT initially supported a `kill()` function relying on the SELFDESTRUCT opcode (which effectively destroyed the contract's storage and code). +However, Ethereum's [Cancun upgrate](https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md) (rolled out in Q1 of 2024) has removed support for SELFDESTRUCT (see [EIP-6780](https://eips.ethereum.org/EIPS/eip-6780)). -![factory-Beacon Factory.drawio](./doc/schema/drawio/factory-BeaconFactory.drawio.png) +The `kill()` function will therefore not behave as it was used -Transparent Proxy factory: the factory will use the same implementation for each transparent proxy deployed. Each transparent proxy has its owned proxy admin, deployed inside the constructor of the transparent proxy. Each transparent proxy can upgrade their implementation to a new one independently and without impact on other proxies. +We have replaced this function by a new function `deactivateContract`, introduced in the version v2.3.1 inside the PauseModule, to deactivate the contract. +This function set a boolean state variable `isDeactivated` to true and puts the contract in the pause state. +The function `unpause`is updated to revert if the previous variable is set to true, thus the contract is in the pause state "forever". -![factory-Transparent Factory.drawio](./doc/schema/drawio/factory-TransparentFactory.drawio.png) +The consequences are the following: +- In standalone mode, this operation is irreversible, it is not possible to rollback. +- With a proxy, it is still possible to rollback by deploying a new implementation. ### Gasless support @@ -78,36 +60,40 @@ At deployment, the parameter `forwarder` inside the CMTAT contract constructor 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. -### Kill switch +## Architecture -CMTAT initially supported a `kill()` function relying on the SELFDESTRUCT opcode (which effectively destroyed the contract's storage and code). -However, Ethereum's [Cancun upgrate](https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md) (rolled out in Q1 of 2024) will remove support for SELFDESTRUCT (see -[EIP-6780](https://eips.ethereum.org/EIPS/eip-6780)). +CMTAT architecture is divided in two main componentes: module and engines -The `kill()` function will therefore not behave as it used to once Cancun is deployed. +### Module -The alternative function is the function `deactivateContract`, introduced in the version v2.3.1 inside the PauseModule, to deactivate the contract. -This function set a boolean state variable `isDeactivated` to true and puts the contract in the pause state. -The function `unpause`is updated to revert if the previous variable is set to true, thus the contract is in the pause state "forever". +Modules describe a logical code separation inside CMTAT. They are defined as abstract contracts. +Their code and functionalities are part of the CMTAT and therefore are also included in the calculation of the contract size and the maximum size limit of 24 kB. -The consequences are the following: +It is always possible to delete a module but this requires modifying the code and compiling it again, which require to perform a security audit on these modifications. -- In standalone mode, this operation is irreversible, it is not possible to rollback. -- With a proxy, it is still possible to rollback by deploying a new implementation. - +Modules are also separated in different categories. + +- Internal modules: implementation for a module when OpenZeppelin does not provide a library to use. For example, this is the case for the SnapshotModule. + +- Wrapper modules: abstract contract around OpenZeppelin contracts or internal module. + For example, the wrapper PauseModule provides public functions to call the internal functions from OpenZeppelin. + - Core (Wrapper sub-category): Contains the modules required to be CMTA compliant + - Extension (Wrapper sub-category): not required to be CMTA compliant, "bonus features" (snapshotModule, debtModule) -## Modules + + +#### List -Here the list of the differents modules with the links towards the documentation and the main file. +Here the list of the different modules with the links towards the documentation and the main file. -### Controller +##### Controller | Name | Documentation | Main File | | ---------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | | ValidationModule | [validation.md](doc/modules/presentation/controllers/validation.md) | [ValidationModule.sol](./contracts/modules/wrapper/controllers/ValidationModule.sol) | -### Core +##### Core Generally, these modules are required to be compliant with the CMTA specification. @@ -120,26 +106,34 @@ Generally, these modules are required to be compliant with the CMTA specificatio | MintModule | [ERC20Mint.md](doc/modules/presentation/core/ERC20Mint.md) | [ERC20MintModule.sol](./contracts/modules/wrapper/core/ERC20MintModule.sol) | | PauseModule | [pause.md](doc/modules/presentation/core/pause.md) | [PauseModule.sol](./contracts/modules/wrapper/core/PauseModule.sol) | -### Extensions +##### Extensions Generally, these modules are not required to be compliant with the CMTA specification. -| Name | Documentation | Main File | -| ----------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| MetaTxModule | [metatx.md](doc/modules/presentation/extensions/metatx.md) | [MetaTxModule.sol](./contracts/modules/wrapper/extensions/MetaTxModule.sol) | -| SnapshotModule | [snapshot.md](doc/modules/presentation/extensions/snapshot.md) | [SnapshotModule.sol](./contracts/modules/wrapper/extensions/SnapshotModule.sol) | -| creditEventModule | [creditEvents.md](doc/modules/presentation/extensions/Debt/creditEvents.md) | [CreditEventsModule.sol](./contracts/modules/wrapper/extensions/DebtModule/CreditEventsModule.sol) | -| DebtBaseModule | [debtBase.md](doc/modules/presentation/extensions/Debt/debtBase.md) | [DebtBaseModule.sol](./contracts/modules/wrapper/extensions/DebtModule/DebtBaseModule.sol) | +| Name | Documentation | Main File | +| -------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| MetaTxModule | [metatx.md](doc/modules/presentation/extensions/metatx.md) | [MetaTxModule.sol](./contracts/modules/wrapper/extensions/MetaTxModule.sol) | +| SnapshotModule | [snapshot.md](doc/modules/presentation/extensions/snapshot.md) | [SnapshotModule.sol](./contracts/modules/wrapper/extensions/SnapshotModule.sol) | +| DebtModule | | [DebtModule.sol](./contracts/modules/wrapper/extensions/DebtModule.sol) | +| DocumentModue | | [Document.sol](./contracts/modules/wrapper/extensions/DocumentModule.sol) | -### Security +##### Security | Name | Documentation | Main File | | ------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | | AuthorizationModule | [authorization.md](./doc/modules/presentation/security/authorization.md) | [AuthorizationModule.sol](./contracts/modules/security/AuthorizationModule.sol) | -## Engine +### Engines + +Engines are external smart contracts called by CMTAT modules. + +These engines are **optional** and their addresses can be left to zero. -### RuleEngine +More details are available in [./doc/general/Engine.md](./doc/general/Engine.md) + +![Engine-Engine.drawio](./doc/schema/drawio/Engine-Engine.drawio.png) + +#### RuleEngine (IERC-1404) The `RuleEngine` is an external contract used to apply transfer restriction to the CMTAT through whitelisting, blacklisting,... @@ -162,21 +156,127 @@ A possible rule is a whitelist rule where only the address inside the whitelist Since the version 2.4.0, the requirement to use a RuleEngine are the following: -The `RuleEngine` has to import an implement the interface `IRuleEngine` which declares the function `operateOnTransfer`. +> The `RuleEngine` has to import an implement the interface `IRuleEngine` which declares the function `operateOnTransfer`. This interface can be found in [./contracts/interfaces/engine/IRuleEngine.sol](./contracts/interfaces/engine/IRuleEngine.sol). Before each transfer, the CMTAT calls the function `operateOnTransfer` which is the entrypoint for the RuleEngine. -### AuthorizationEngine +#### AuthorizationEngine The `AuthorizationEngine` is an external contract to add supplementary check on the functions `grantRole` and `revokeRole`from the CMTAT. This contract is managed in the `AuthorizationModule`. -The `AuthorizationEngine` has to import an implement the interface `IAuthorizationEngine` which declares the functions `operateOnGrantRole` and `operateOnRevokeRole` +The `AuthorizationEngine` has to import an implement the interface [IAuthorizationEngine.sol](./contracts/interfaces/engine/IAuthorizationEngine.sol) which declares the functions `operateOnGrantRole` and `operateOnRevokeRole` + +Currently, there is only a prototype available: [CMTA/AuthorizationEngine](https://github.com/CMTA/AuthorizationEngine) + +#### DebtEngine + +This engine replaces the modules Debt and Credit included since CMTAT version. + +CMTAT only implements two functions , available in the interface [IDebtEngine](./contracts/interfaces/engine/IDebtEngine.sol) to get information from the debtEngine. + +```solidity +interface IDebtEngine is IDebtGlobal { + function debt() external view returns(IDebtGlobal.DebtBase memory); + function creditEvents() external view returns(IDebtGlobal.CreditEvents memory); +} +``` + +Use an external contract provides two advantages: + +- Reduce code size of CMTAT, which is near of the maximal size limit +- Allow to manage this information for several different tokens (CMTAT or not). + +Currently, there is no implementation of a DebtEngine available + +#### DocumentEngine (IERC-1643) + +The `DocumentEngine` is an external contract to support [*ERC-1643*](https://github.com/ethereum/EIPs/issues/1643) inside CMTAT, 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. + +This EIP defines a document with three attributes: + +- A short name (represented as a `bytes32`) +- A generic URI (represented as a `string`) that could point to a website or other document portal. +- The hash of the document contents associated with it on-chain. + +CMTAT only implements two functions from this standard, available in the interface [IERC1643](./contracts/interfaces/engined/draft-IERC1643.sol) to get the documents from the documentEngine. + +```solidity +interface IERC1643 { +function getDocument(bytes32 _name) external view returns (string memory , bytes32, uint256); +function getAllDocuments() external view returns (bytes32[] memory); +} +``` + +The `DocumentEngine` has to import an implement this interface. To manage the documents, the engine is completely free on how to do it. + +Use an external contract provides two advantages: + +- Reduce code size of CMTAT, which is near of the maximal size limit +- Allow to manage documents for several different tokens (CMTAT or not). + +Currently, there is no implementation of a DocumentEngine available + +## Deployment model + +| Model | Contract | +| --------------------------- | ---------------------------------------------------- | +| Standalone | [CMTAT_STANDALONE](./contracts/CMTAT_STANDALONE.sol) | +| Transparent ou Beacon Proxy | [CMTAT_PROXY](./contracts/CMTAT_PROXY.sol) | +| UUPS Proxy | [CMTAT_PROXY_UUPS](./contracts/CMTAT_PROXY_UUPS.sol) | + + + +### Standalone + +To deploy CMTAT without a proxy, in standalone mode, you need to use the contract version `CMTAT_STANDALONE`. + +### With a proxy + +The CMTAT supports deployment via a proxy contract. Furthermore, using a proxy permits to upgrade the contract, using a standard proxy upgrade pattern. + +- The implementation contract to use with a TransparentProxy is the `CMTAT_PROXY`. +- The implementation contract to use with a UUPSProxy is the `CMTAT_PROXY_UUPS`. + +Please see the OpenZeppelin [upgradeable contracts documentation](https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable) for more information about the proxy requirements applied to the contract. + +Please see the OpenZeppelin [Upgrades plugins](https://docs.openzeppelin.com/upgrades-plugins/1.x/) for more information about plugin upgrades in general. + +Note that deployment via a proxy is not mandatory, but is recommended by CMTA. + + + +### Factory + +Factory contracts are available to deploy the CMTAT with a beacon proxy, a transparent proxy or an UUPS proxy. + +- [CMTAT_BEACON_FACTORY.sol](./contracts/deployment/CMTAT_BEACON_FACTORY.sol) + +- [CMTAT_TRANSPARENT_FACTORY.sol](./contracts/deployment/CMTAT_TP_FACTORY.sol) +- [CMTAT_UUPS_FACTORY.sol](./contracts/deployment/CMTAT_UUPS_FACTORY.sol) + +#### Beacon Proxy Factory + +The factory will use the same beacon for each beacon proxy. This beacon provides the address of the implementation contract, a CMTAT_PROXY contract. If you upgrade the beacon to point to a new implementation, it will change the implementation contract for all beacon proxy. + +![factory-Beacon Factory.drawio](./doc/schema/drawio/factory-BeaconFactory.drawio.png) + +#### Transparent Proxy Factory + +The factory will use the same implementation for each transparent proxy deployed. Each transparent proxy has its owned proxy admin, deployed inside the constructor of the transparent proxy. Each transparent proxy can upgrade their implementation to a new one independently and without impact on other proxies. + +![factory-Transparent Factory.drawio](./doc/schema/drawio/factory-TransparentFactory.drawio.png) + +#### UUPS ProxyFactory + +The factory will use the same implementation for each UUPS proxy deployed. Each UUPS proxy can upgrade their implementation to a new one independently and without impact on other proxies. + +Contrary to the Transparent Proxy, the logic to upgrade the proxy is situated in the implementation and not in the proxy. -This interface can be found in [./contracts/interfaces/engine/IAuthorizationEngine.sol](./contracts/interfaces/engine/IAuthorizationEngine.sol). +This is the reason whey there is a specific CMTAT contract which includes this logic to use: [CMTAT_PROXY_UUPS.sol](./contracts/CMTAT_PROXY_UUPS.sol) ## Security @@ -224,6 +324,7 @@ You will find the report produced by [Slither](https://github.com/crytic/slither | Last version | [slither-report.md](doc/audits/tools/slither-report.md) | | v2.3.0 | [v2.3.0-slither-report.md](doc/audits/tools/v2.3.0-slither-report.md) | | v2.3.1 | [v2.3.1-slither-report.md](doc/audits/tools/v2.3.1-slither-report.md) | +| v2.4.0 | [v2.4.0-slither-report.md](doc/audits/tools/v2.4.0-slither-report.md) | ### Test @@ -252,11 +353,11 @@ CMTA providers further documentation describing the CMTAT framework in a platfor - [CMTA Token (CMTAT)](https://cmta.ch/standards/cmta-token-cmtat) - [Standard for the tokenization of shares of Swiss corporations using the distributed ledger technology](https://cmta.ch/standards/standard-for-the-tokenization-of-shares-of-swiss-corporations-using-the-distributed-ledger-technology) -## Further reading +### Further reading - [CMTA - A comparison of different security token standards](https://cmta.ch/news-articles/a-comparison-of-different-security-token-standards) - [Taurus - Security Token Standards: A Closer Look at CMTAT](https://www.taurushq.com/blog/security-token-standards-a-closer-look-at-cmtat/) - [Taurus - Equity Tokenization: How to Pay Dividend On-Chain Using CMTAT](https://www.taurushq.com/blog/equity-tokenization-how-to-pay-dividend-on-chain-using-cmtat/) -- [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/)$ +- [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/) ## Others implementations Two versions are available for the blockchain [Tezos](https://tezos.com) diff --git a/contracts/CMTAT_PROXY_UUPS.sol b/contracts/CMTAT_PROXY_UUPS.sol index f3673880..fc2d330e 100644 --- a/contracts/CMTAT_PROXY_UUPS.sol +++ b/contracts/CMTAT_PROXY_UUPS.sol @@ -1,9 +1,8 @@ //SPDX-License-Identifier: MPL-2.0 pragma solidity ^0.8.20; -import "../openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import "./modules/CMTAT_BASE.sol"; -import "./interfaces/engine/IEngine.sol"; contract CMTAT_PROXY_UUPS is CMTAT_BASE, UUPSUpgradeable { bytes32 public constant PROXY_UPGRADE_ROLE = keccak256("PROXY_UPGRADE_ROLE"); /** @@ -17,38 +16,34 @@ contract CMTAT_PROXY_UUPS is CMTAT_BASE, UUPSUpgradeable { // Disable the possibility to initialize the implementation _disableInitializers(); } + + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @notice * initialize the proxy contract * The calls to this function will revert if the contract was deployed without a proxy * @param admin address of the admin of contract (Access Control) - * @param nameIrrevocable name of the token - * @param symbolIrrevocable name of the symbol - * @param decimalsIrrevocable number of decimals of the token, must be 0 to be compliant with Swiss law as per CMTAT specifications (non-zero decimal number may be needed for other use cases) - * @param tokenId_ name of the tokenId - * @param terms_ terms associated with the token - * @param information_ additional information to describe the token - * @param engines list of engines + * @param ERC20Attributes_ ERC20 name, symbol and decimals + * @param baseModuleAttributes_ tokenId, terms, information + * @param engines_ external contract */ function initialize( address admin, - string memory nameIrrevocable, - string memory symbolIrrevocable, - uint8 decimalsIrrevocable, - string memory tokenId_, - string memory terms_, - string memory information_, - IEngine.Engine memory engines) public override initializer { + ICMTATConstructor.ERC20Attributes memory ERC20Attributes_, + ICMTATConstructor.BaseModuleAttributes memory baseModuleAttributes_, + ICMTATConstructor.Engine memory engines_ ) public override initializer { CMTAT_BASE.initialize( admin, - nameIrrevocable, - symbolIrrevocable, - decimalsIrrevocable, - tokenId_, - terms_, - information_, - engines); + ERC20Attributes_, + baseModuleAttributes_, + engines_); __UUPSUpgradeable_init_unchained(); } + + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ function _authorizeUpgrade(address) internal override onlyRole(PROXY_UPGRADE_ROLE) {} } diff --git a/contracts/CMTAT_STANDALONE.sol b/contracts/CMTAT_STANDALONE.sol index 0e2d7e83..3f427f3f 100644 --- a/contracts/CMTAT_STANDALONE.sol +++ b/contracts/CMTAT_STANDALONE.sol @@ -9,37 +9,25 @@ contract CMTAT_STANDALONE is CMTAT_BASE { * @notice Contract version for standalone deployment * @param forwarderIrrevocable address of the forwarder, required for the gasless support * @param admin address of the admin of contract (Access Control) - * @param authorizationEngineIrrevocable - * @param nameIrrevocable name of the token - * @param symbolIrrevocable name of the symbol - * @param decimalsIrrevocable number of decimals used to get its user representation, should be 0 to be compliant with the CMTAT specifications. - * @param tokenId_ name of the tokenId - * @param terms_ terms associated with the token - * @param information_ additional information to describe the token + * @param ERC20Attributes_ ERC20 name, symbol and decimals + * @param baseModuleAttributes_ tokenId, terms, information + * @param engines_ external contract */ /// @custom:oz-upgrades-unsafe-allow constructor constructor( address forwarderIrrevocable, address admin, - string memory nameIrrevocable, - string memory symbolIrrevocable, - uint8 decimalsIrrevocable, - string memory tokenId_, - string memory terms_, - string memory information_, - IEngine.Engine memory engine_ + ICMTATConstructor.ERC20Attributes memory ERC20Attributes_, + ICMTATConstructor.BaseModuleAttributes memory baseModuleAttributes_, + ICMTATConstructor.Engine memory engines_ ) MetaTxModule(forwarderIrrevocable) { // Initialize the contract to avoid front-running // Warning : do not initialize the proxy initialize( admin, - nameIrrevocable, - symbolIrrevocable, - decimalsIrrevocable, - tokenId_, - terms_, - information_, - engine_ + ERC20Attributes_, + baseModuleAttributes_, + engines_ ); } } diff --git a/contracts/deployment/CMTAT_BEACON_FACTORY.sol b/contracts/deployment/CMTAT_BEACON_FACTORY.sol index 3f436a6f..abcb941b 100644 --- a/contracts/deployment/CMTAT_BEACON_FACTORY.sol +++ b/contracts/deployment/CMTAT_BEACON_FACTORY.sol @@ -6,34 +6,22 @@ import "@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol"; import '@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol'; import "../CMTAT_PROXY.sol"; import "../modules/CMTAT_BASE.sol"; -import "../libraries/FactoryErrors.sol"; -import '@openzeppelin/contracts/access/AccessControl.sol'; -import "../interfaces/engine/IEngine.sol"; +import "./libraries/CMTATFactoryRoot.sol"; + /** * @notice Factory to deploy beacon proxy * */ -contract CMTAT_BEACON_FACTORY is AccessControl { - // Private - mapping(uint256 => address) private cmtats; - uint256 private cmtatCounterId; +contract CMTAT_BEACON_FACTORY is AccessControl, CMTATFactoryRoot { // public - /// @dev Role to deploy CMTAT - bytes32 public constant CMTAT_DEPLOYER_ROLE = keccak256("CMTAT_DEPLOYER_ROLE"); UpgradeableBeacon public immutable beacon; - address[] public cmtatsList; - event CMTAT(address indexed CMTAT, uint256 id); - /** * @param implementation_ contract implementation * @param factoryAdmin admin * @param beaconOwner owner */ - constructor(address implementation_, address factoryAdmin, address beaconOwner) { - if(factoryAdmin == address(0)){ - revert FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForFactoryAdmin(); - } + constructor(address implementation_, address factoryAdmin, address beaconOwner, bool useCustomSalt_)CMTATFactoryRoot(factoryAdmin, useCustomSalt_) { if(beaconOwner == address(0)){ revert FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForBeaconOwner(); } @@ -41,8 +29,6 @@ contract CMTAT_BEACON_FACTORY is AccessControl { revert FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForLogicContract(); } beacon = new UpgradeableBeacon(implementation_, beaconOwner); - _grantRole(DEFAULT_ADMIN_ROLE, factoryAdmin); - _grantRole(CMTAT_DEPLOYER_ROLE, factoryAdmin); } /** @@ -50,45 +36,63 @@ contract CMTAT_BEACON_FACTORY is AccessControl { * */ function deployCMTAT( + bytes32 deploymentSaltInput, // CMTAT function initialize - address admin, - string memory nameIrrevocable, - string memory symbolIrrevocable, - uint8 decimalsIrrevocable, - string memory tokenId_, - string memory terms_, - string memory information_, - IEngine.Engine memory engines + CMTAT_ARGUMENT calldata cmtatArgument ) public onlyRole(CMTAT_DEPLOYER_ROLE) returns(BeaconProxy cmtat) { - cmtat = new BeaconProxy( - address(beacon), - abi.encodeWithSelector( - CMTAT_PROXY(address(0)).initialize.selector, - admin, - nameIrrevocable, - symbolIrrevocable, - decimalsIrrevocable, - tokenId_, - terms_, - information_, - engines - ) - ); - cmtats[cmtatCounterId] = address(cmtat); - emit CMTAT(address(cmtat), cmtatCounterId); - cmtatCounterId++; - cmtatsList.push(address(cmtat)); + bytes32 deploymentSalt = _checkAndDetermineDeploymentSalt(deploymentSaltInput); + bytes memory bytecode = _getBytecode( + // CMTAT function initialize + cmtatArgument); + cmtat = _deployBytecode(bytecode, deploymentSalt); return cmtat; } /** - * @notice get CMTAT proxy address - * + * @param deploymentSalt salt for the deployment + * @param cmtatArgument argument for the function initialize + * @notice get the proxy address depending on a particular salt */ - function getCMTATAddress(uint256 cmtatID_) external view returns (address) { - return cmtats[cmtatID_]; + function computedProxyAddress( + bytes32 deploymentSalt, + // CMTAT function initialize + CMTAT_ARGUMENT calldata cmtatArgument) public view returns (address) { + bytes memory bytecode = _getBytecode( + // CMTAT function initialize + cmtatArgument); + return Create2.computeAddress(deploymentSalt, keccak256(bytecode), address(this) ); } + /** + * @notice Deploy CMTAT and push the created CMTAT in the list + */ + function _deployBytecode(bytes memory bytecode, bytes32 deploymentSalt) internal returns (BeaconProxy cmtat) { + address cmtatAddress = Create2.deploy(0, deploymentSalt, bytecode); + cmtat = BeaconProxy(payable(cmtatAddress)); + cmtats[cmtatCounterId] = address(cmtat); + emit CMTAT(address(cmtat), cmtatCounterId); + ++cmtatCounterId; + cmtatsList.push(address(cmtat)); + return cmtat; + } + + + /** + * @notice return the smart contract bytecode + */ + function _getBytecode( + // CMTAT function initialize + CMTAT_ARGUMENT calldata cmtatArgument) internal view returns(bytes memory bytecode) { + bytes memory _implementation = abi.encodeWithSelector( + CMTAT_PROXY(address(0)).initialize.selector, + cmtatArgument.CMTATAdmin, + cmtatArgument.ERC20Attributes, + cmtatArgument.baseModuleAttributes, + cmtatArgument.engines + ); + bytecode = abi.encodePacked(type(BeaconProxy).creationCode, abi.encode(address(beacon), _implementation)); + } + /** * @notice get the implementation address from the beacon * @return implementation address diff --git a/contracts/deployment/CMTAT_TP_FACTORY.sol b/contracts/deployment/CMTAT_TP_FACTORY.sol index c9262e61..78ab2af6 100644 --- a/contracts/deployment/CMTAT_TP_FACTORY.sol +++ b/contracts/deployment/CMTAT_TP_FACTORY.sol @@ -5,57 +5,15 @@ import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.so import "../CMTAT_PROXY.sol"; import "../libraries/FactoryErrors.sol"; import '@openzeppelin/contracts/utils/Create2.sol'; -import '@openzeppelin/contracts/access/AccessControl.sol'; -import "../interfaces/engine/IEngine.sol"; - +import "./libraries/CMTATFactoryInvariant.sol"; +import "./libraries/CMTATFactoryBase.sol"; /** * @notice Factory to deploy CMTAT with a transparent proxy * */ -contract CMTAT_TP_FACTORY is AccessControl { - // Public - /// @dev Role to deploy CMTAT - bytes32 public constant CMTAT_DEPLOYER_ROLE = keccak256("CMTAT_DEPLOYER_ROLE"); - address public immutable logic; - address[] public cmtatsList; - bool public useCustomSalt; - uint256 public cmtatID; - /// mapping - mapping(uint256 => address) private cmtats; - mapping(bytes32 => bool) private customSaltUsed; - - struct CMTAT_ARGUMENT{ - address CMTATAdmin; - string nameIrrevocable; - string symbolIrrevocable; - uint8 decimalsIrrevocable; - string tokenId; - string terms; - string information; - IEngine.Engine engines; - } - event CMTAT(address indexed CMTAT, uint256 id); +contract CMTAT_TP_FACTORY is CMTATFactoryInvariant, CMTATFactoryBase { - - /** - * @param logic_ contract implementation - * @param factoryAdmin admin - */ - constructor(address logic_, address factoryAdmin, bool useCustomSalt_) { - if(logic_ == address(0)){ - revert FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForLogicContract(); - } - if(factoryAdmin == address(0)){ - revert FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForFactoryAdmin(); - } - if(useCustomSalt_){ - useCustomSalt = useCustomSalt_; - } - logic = logic_; - _grantRole(DEFAULT_ADMIN_ROLE, factoryAdmin); - _grantRole(CMTAT_DEPLOYER_ROLE, factoryAdmin); - } - + constructor(address logic_, address factoryAdmin, bool useCustomSalt_) CMTATFactoryBase(logic_, factoryAdmin,useCustomSalt_){} /** * @notice deploy a transparent proxy with a proxy admin contract */ @@ -90,32 +48,6 @@ contract CMTAT_TP_FACTORY is AccessControl { cmtatArgument); return Create2.computeAddress(deploymentSalt, keccak256(bytecode), address(this) ); } - - /** - * @notice get CMTAT proxy address - * - */ - function CMTATProxyAddress(uint256 cmtatID_) external view returns (address) { - return cmtats[cmtatID_]; - } - - /** - * @param deploymentSalt salt for deployment - * @dev - * if useCustomSalt is at false, the salt used is the current value of cmtatId - */ - function _checkAndDetermineDeploymentSalt(bytes32 deploymentSalt) internal returns(bytes32 saltBytes){ - if(useCustomSalt){ - if(customSaltUsed[deploymentSalt]){ - revert FactoryErrors.CMTAT_Factory_SaltAlreadyUsed(); - }else { - customSaltUsed[deploymentSalt] = true; - saltBytes = deploymentSalt; - } - }else{ - saltBytes = bytes32(keccak256(abi.encodePacked(cmtatID))); - } - } /** * @notice Deploy CMTAT and push the created CMTAT in the list @@ -123,9 +55,9 @@ contract CMTAT_TP_FACTORY is AccessControl { function _deployBytecode(bytes memory bytecode, bytes32 deploymentSalt) internal returns (TransparentUpgradeableProxy cmtat) { address cmtatAddress = Create2.deploy(0, deploymentSalt, bytecode); cmtat = TransparentUpgradeableProxy(payable(cmtatAddress)); - cmtats[cmtatID] = address(cmtat); - emit CMTAT(address(cmtat), cmtatID); - ++cmtatID; + cmtats[cmtatCounterId] = address(cmtat); + emit CMTAT(address(cmtat), cmtatCounterId); + ++cmtatCounterId; cmtatsList.push(address(cmtat)); return cmtat; } @@ -137,38 +69,13 @@ contract CMTAT_TP_FACTORY is AccessControl { function _getBytecode( address proxyAdminOwner, // CMTAT function initialize CMTAT_ARGUMENT calldata cmtatArgument) internal view returns(bytes memory bytecode) { - bytes memory implementation = _encodeImplementationArgument( - cmtatArgument.CMTATAdmin, - cmtatArgument.nameIrrevocable, - cmtatArgument.symbolIrrevocable, - cmtatArgument.decimalsIrrevocable, - cmtatArgument.tokenId, - cmtatArgument.terms, - cmtatArgument.information, - cmtatArgument.engines - ); - bytecode = abi.encodePacked(type(TransparentUpgradeableProxy).creationCode, abi.encode(logic, proxyAdminOwner, implementation)); - } - - - function _encodeImplementationArgument( address admin, - string memory nameIrrevocable, - string memory symbolIrrevocable, - uint8 decimalsIrrevocable, - string memory tokenId_, - string memory terms_, - string memory information_, - IEngine.Engine memory engines) internal pure returns(bytes memory){ - return abi.encodeWithSelector( + bytes memory implementation = abi.encodeWithSelector( CMTAT_PROXY(address(0)).initialize.selector, - admin, - nameIrrevocable, - symbolIrrevocable, - decimalsIrrevocable, - tokenId_, - terms_, - information_, - engines + cmtatArgument.CMTATAdmin, + cmtatArgument.ERC20Attributes, + cmtatArgument.baseModuleAttributes, + cmtatArgument.engines ); - } + bytecode = abi.encodePacked(type(TransparentUpgradeableProxy).creationCode, abi.encode(logic, proxyAdminOwner, implementation)); + } } \ No newline at end of file diff --git a/contracts/deployment/CMTAT_UUPS_FACTORY.sol b/contracts/deployment/CMTAT_UUPS_FACTORY.sol new file mode 100644 index 00000000..f5d80384 --- /dev/null +++ b/contracts/deployment/CMTAT_UUPS_FACTORY.sol @@ -0,0 +1,88 @@ +//SPDX-License-Identifier: MPL-2.0 +pragma solidity ^0.8.20; + +import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; +import "../CMTAT_PROXY_UUPS.sol"; +import "../libraries/FactoryErrors.sol"; +import '@openzeppelin/contracts/utils/Create2.sol'; +import '@openzeppelin/contracts/access/AccessControl.sol'; +import "./libraries/CMTATFactoryInvariant.sol"; +import "./libraries/CMTATFactoryBase.sol"; +/** +* @notice Factory to deploy CMTAT with a UUPS proxy +* +*/ +contract CMTAT_UUPS_FACTORY is CMTATFactoryInvariant, CMTATFactoryBase { + /** + * @param logic_ contract implementation + * @param factoryAdmin admin + */ + constructor(address logic_, address factoryAdmin, bool useCustomSalt_) CMTATFactoryBase(logic_, factoryAdmin,useCustomSalt_){} + + + /** + * @notice deploy a transparent proxy with a proxy admin contract + */ + function deployCMTAT( + bytes32 deploymentSaltInput, + // CMTAT function initialize + CMTAT_ARGUMENT calldata cmtatArgument + ) public onlyRole(CMTAT_DEPLOYER_ROLE) returns(ERC1967Proxy cmtat) { + bytes32 deploymentSalt = _checkAndDetermineDeploymentSalt(deploymentSaltInput); + bytes memory bytecode = _getBytecode( + // CMTAT function initialize + cmtatArgument); + cmtat = _deployBytecode(bytecode, deploymentSalt); + + return cmtat; + } + + /** + * @param deploymentSalt salt for the deployment + * @param cmtatArgument argument for the function initialize + * @notice get the proxy address depending on a particular salt + */ + function computedProxyAddress( + bytes32 deploymentSalt, + // CMTAT function initialize + CMTAT_ARGUMENT calldata cmtatArgument) public view returns (address) { + bytes memory bytecode = _getBytecode( + // CMTAT function initialize + cmtatArgument); + return Create2.computeAddress(deploymentSalt, keccak256(bytecode), address(this) ); + } + + /*////////////////////////////////////////////////////////////// + INTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ + + /** + * @notice Deploy CMTAT and push the created CMTAT in the list + */ + function _deployBytecode(bytes memory bytecode, bytes32 deploymentSalt) internal returns (ERC1967Proxy cmtat) { + address cmtatAddress = Create2.deploy(0, deploymentSalt, bytecode); + cmtat = ERC1967Proxy(payable(cmtatAddress)); + cmtats[cmtatCounterId] = address(cmtat); + emit CMTAT(address(cmtat), cmtatCounterId); + ++cmtatCounterId; + cmtatsList.push(address(cmtat)); + return cmtat; + } + + + /** + * @notice return the smart contract bytecode + */ + function _getBytecode( + // CMTAT function initialize + CMTAT_ARGUMENT calldata cmtatArgument) internal view returns(bytes memory bytecode) { + bytes memory implementation = abi.encodeWithSelector( + CMTAT_PROXY_UUPS(address(0)).initialize.selector, + cmtatArgument.CMTATAdmin, + cmtatArgument.ERC20Attributes, + cmtatArgument.baseModuleAttributes, + cmtatArgument.engines + ); + bytecode = abi.encodePacked(type(ERC1967Proxy).creationCode, abi.encode(logic, implementation)); + } +} \ No newline at end of file diff --git a/contracts/deployment/libraries/CMTATFactoryBase.sol b/contracts/deployment/libraries/CMTATFactoryBase.sol new file mode 100644 index 00000000..6c33a6cb --- /dev/null +++ b/contracts/deployment/libraries/CMTATFactoryBase.sol @@ -0,0 +1,24 @@ +//SPDX-License-Identifier: MPL-2.0 +pragma solidity ^0.8.20; + +import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import "./CMTATFactoryRoot.sol"; + +/** +* @notice Code common to TP and UUPS Factory +* +*/ +abstract contract CMTATFactoryBase is CMTATFactoryRoot { + // Public + address public immutable logic; + /** + * @param logic_ contract implementation + * @param factoryAdmin admin + */ + constructor(address logic_, address factoryAdmin, bool useCustomSalt_)CMTATFactoryRoot( factoryAdmin, useCustomSalt_) { + if(logic_ == address(0)){ + revert FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForLogicContract(); + } + logic = logic_; + } +} \ No newline at end of file diff --git a/contracts/deployment/libraries/CMTATFactoryInvariant.sol b/contracts/deployment/libraries/CMTATFactoryInvariant.sol new file mode 100644 index 00000000..322d3655 --- /dev/null +++ b/contracts/deployment/libraries/CMTATFactoryInvariant.sol @@ -0,0 +1,22 @@ +//SPDX-License-Identifier: MPL-2.0 +pragma solidity ^0.8.20; + + +import "../../interfaces/ICMTATConstructor.sol"; + +/** +* @notice Factory to deploy CMTAT with a transparent proxy +* +*/ +abstract contract CMTATFactoryInvariant { + /// @dev Role to deploy CMTAT + bytes32 public constant CMTAT_DEPLOYER_ROLE = keccak256("CMTAT_DEPLOYER_ROLE"); + struct CMTAT_ARGUMENT{ + address CMTATAdmin; + ICMTATConstructor.ERC20Attributes ERC20Attributes; + ICMTATConstructor.BaseModuleAttributes baseModuleAttributes; + ICMTATConstructor.Engine engines; + } + /* ============ Events ============ */ + event CMTAT(address indexed CMTAT, uint256 id); +} \ No newline at end of file diff --git a/contracts/deployment/libraries/CMTATFactoryRoot.sol b/contracts/deployment/libraries/CMTATFactoryRoot.sol new file mode 100644 index 00000000..bc7a1481 --- /dev/null +++ b/contracts/deployment/libraries/CMTATFactoryRoot.sol @@ -0,0 +1,61 @@ +//SPDX-License-Identifier: MPL-2.0 +pragma solidity ^0.8.20; + +import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; +import "../../CMTAT_PROXY.sol"; +import "../../libraries/FactoryErrors.sol"; +import '@openzeppelin/contracts/utils/Create2.sol'; +import '@openzeppelin/contracts/access/AccessControl.sol'; +import "./CMTATFactoryInvariant.sol"; +/** +* @notice Code common to Beacon, TP and UUPS factory +* +*/ +abstract contract CMTATFactoryRoot is AccessControl, CMTATFactoryInvariant { + // Public + address[] public cmtatsList; + bool public useCustomSalt; + uint256 public cmtatCounterId; + /// mapping + mapping(uint256 => address) internal cmtats; + mapping(bytes32 => bool) internal customSaltUsed; + /** + * @param factoryAdmin admin + */ + constructor(address factoryAdmin, bool useCustomSalt_) { + if(factoryAdmin == address(0)){ + revert FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForFactoryAdmin(); + } + if(useCustomSalt_){ + useCustomSalt = useCustomSalt_; + } + _grantRole(DEFAULT_ADMIN_ROLE, factoryAdmin); + _grantRole(CMTAT_DEPLOYER_ROLE, factoryAdmin); + } + + /** + * @notice get CMTAT proxy address + * + */ + function CMTATProxyAddress(uint256 cmtatCounterId_) external view returns (address) { + return cmtats[cmtatCounterId_]; + } + + /** + * @param deploymentSalt salt for deployment + * @dev + * if useCustomSalt is at false, the salt used is the current value of cmtatCounterId + */ + function _checkAndDetermineDeploymentSalt(bytes32 deploymentSalt) internal returns(bytes32 saltBytes){ + if(useCustomSalt){ + if(customSaltUsed[deploymentSalt]){ + revert FactoryErrors.CMTAT_Factory_SaltAlreadyUsed(); + }else { + customSaltUsed[deploymentSalt] = true; + saltBytes = deploymentSalt; + } + }else{ + saltBytes = bytes32(keccak256(abi.encodePacked(cmtatCounterId))); + } + } +} \ No newline at end of file diff --git a/contracts/interfaces/ICMTATConstructor.sol b/contracts/interfaces/ICMTATConstructor.sol new file mode 100644 index 00000000..919aa476 --- /dev/null +++ b/contracts/interfaces/ICMTATConstructor.sol @@ -0,0 +1,35 @@ +//SPDX-License-Identifier: MPL-2.0 +import "./engine/IDebtEngine.sol"; +import "./engine/IRuleEngine.sol"; +import "./engine/IAuthorizationEngine.sol"; +import "./engine/draft-IERC1643.sol"; + +pragma solidity ^0.8.20; + +/** +* @notice interface to represent arguments used for CMTAT constructor / initialize +*/ +interface ICMTATConstructor { + struct Engine { + IRuleEngine ruleEngine; + IDebtEngine debtEngine; + IAuthorizationEngine authorizationEngine; + IERC1643 documentEngine; + } + struct ERC20Attributes { + // name of the token, + string nameIrrevocable; + // name of the symbol + string symbolIrrevocable; + // number of decimals of the token, must be 0 to be compliant with Swiss law as per CMTAT specifications (non-zero decimal number may be needed for other use cases) + uint8 decimalsIrrevocable; + } + struct BaseModuleAttributes { + // name of the tokenId + string tokenId; + // terms associated with the token + string terms; + // additional information to describe the token + string information; + } +} diff --git a/contracts/interfaces/engine/IDebtEngine.sol b/contracts/interfaces/engine/IDebtEngine.sol index 863ccda2..0b21894a 100644 --- a/contracts/interfaces/engine/IDebtEngine.sol +++ b/contracts/interfaces/engine/IDebtEngine.sol @@ -5,11 +5,11 @@ import "../IDebtGlobal.sol"; interface IDebtEngine is IDebtGlobal { /** - * @dev Returns true if the operation is authorized, and false otherwise. + * @dev Returns debt information */ function debt() external view returns(IDebtGlobal.DebtBase memory); /** - * @dev Returns true if the operation is authorized, and false otherwise. + * @dev Returns credit events */ function creditEvents() external view returns(IDebtGlobal.CreditEvents memory); diff --git a/contracts/interfaces/engine/IEngine.sol b/contracts/interfaces/engine/IEngine.sol deleted file mode 100644 index 251e42cb..00000000 --- a/contracts/interfaces/engine/IEngine.sol +++ /dev/null @@ -1,21 +0,0 @@ -//SPDX-License-Identifier: MPL-2.0 -import "./IDebtEngine.sol"; -import "./IRuleEngine.sol"; -import "./IAuthorizationEngine.sol"; -import "./draft-IERC1643.sol"; - -pragma solidity ^0.8.20; - -/** -* @notice interface to represent debt tokens -*/ -interface IEngine { - struct Engine { - IRuleEngine ruleEngine; - IDebtEngine debtEngine; - IAuthorizationEngine authorizationEngine; - IERC1643 documentEngine; - } - - -} diff --git a/contracts/mocks/DebtEngineMock.sol b/contracts/mocks/DebtEngineMock.sol index a63b69a3..4028e508 100644 --- a/contracts/mocks/DebtEngineMock.sol +++ b/contracts/mocks/DebtEngineMock.sol @@ -1,15 +1,13 @@ // SPDX-License-Identifier: MPL-2.0 pragma solidity ^0.8.20; -import "../interfaces/IDebtGlobal.sol"; -interface IDebtEngine is IDebtGlobal { - function debt() external view returns (DebtBase memory); - function creditEvents() external view returns (CreditEvents memory); +import "../interfaces/engine/IDebtEngine.sol"; +interface IDebtEngineMock is IDebtEngine { function setDebt(DebtBase calldata debt_) external; function setCreditEvents(CreditEvents calldata creditEvents) external; } -contract DebtEngineMock is IDebtEngine { +contract DebtEngineMock is IDebtEngineMock { DebtBase private _debt; CreditEvents private _creditEvents; diff --git a/contracts/mocks/MinimalForwarderMock.sol b/contracts/mocks/MinimalForwarderMock.sol index 3dd609d6..74f8a6e5 100644 --- a/contracts/mocks/MinimalForwarderMock.sol +++ b/contracts/mocks/MinimalForwarderMock.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.20; -import "../../openzeppelin-contracts-upgradeable/contracts/metatx/ERC2771ForwarderUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/metatx/ERC2771ForwarderUpgradeable.sol"; contract MinimalForwarderMock is ERC2771ForwarderUpgradeable { function initialize(string memory name) public initializer { diff --git a/contracts/modules/CMTAT_BASE.sol b/contracts/modules/CMTAT_BASE.sol index 6a02b9a4..dfe445cf 100644 --- a/contracts/modules/CMTAT_BASE.sol +++ b/contracts/modules/CMTAT_BASE.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.20; // required OZ imports here -import "../../openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol"; -import "../../openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "./wrapper/core/BaseModule.sol"; import "./wrapper/core/ERC20BurnModule.sol"; @@ -23,7 +23,7 @@ import "./wrapper/extensions/MetaTxModule.sol"; import "./wrapper/extensions/DebtModule.sol"; import "./wrapper/extensions/DocumentModule.sol"; import "./security/AuthorizationModule.sol"; -import "../interfaces/engine/IEngine.sol"; +import "../interfaces/ICMTATConstructor.sol"; import "../libraries/Errors.sol"; abstract contract CMTAT_BASE is @@ -42,58 +42,48 @@ abstract contract CMTAT_BASE is ERC20SnapshotModule, DebtModule, DocumentModule -{ +{ + + /*////////////////////////////////////////////////////////////// + INITIALIZER FUNCTION + //////////////////////////////////////////////////////////////*/ /** * @notice * initialize the proxy contract * The calls to this function will revert if the contract was deployed without a proxy * @param admin address of the admin of contract (Access Control) - * @param nameIrrevocable name of the token - * @param symbolIrrevocable name of the symbol - * @param decimalsIrrevocable number of decimals of the token, must be 0 to be compliant with Swiss law as per CMTAT specifications (non-zero decimal number may be needed for other use cases) - * @param tokenId_ name of the tokenId - * @param terms_ terms associated with the token - * @param information_ additional information to describe the token + * @param ERC20Attributes_ ERC20 name, symbol and decimals + * @param baseModuleAttributes_ tokenId, terms, information + * @param engines_ external contract */ function initialize( address admin, - string memory nameIrrevocable, - string memory symbolIrrevocable, - uint8 decimalsIrrevocable, - string memory tokenId_, - string memory terms_, - string memory information_, - IEngine.Engine memory engines + ICMTATConstructor.ERC20Attributes memory ERC20Attributes_, + ICMTATConstructor.BaseModuleAttributes memory baseModuleAttributes_, + ICMTATConstructor.Engine memory engines_ ) public virtual initializer { __CMTAT_init( admin, - nameIrrevocable, - symbolIrrevocable, - decimalsIrrevocable, - tokenId_, - terms_, - information_, - engines + ERC20Attributes_, + baseModuleAttributes_, + engines_ ); } + /** * @dev calls the different initialize functions from the different modules */ function __CMTAT_init( address admin, - string memory nameIrrevocable, - string memory symbolIrrevocable, - uint8 decimalsIrrevocable, - string memory tokenId_, - string memory terms_, - string memory information_, - IEngine.Engine memory engines + ICMTATConstructor.ERC20Attributes memory ERC20Attributes_, + ICMTATConstructor.BaseModuleAttributes memory baseModuleAttributes_, + ICMTATConstructor.Engine memory engines_ ) internal onlyInitializing { /* OpenZeppelin library */ // OZ init_unchained functions are called firstly due to inheritance __Context_init_unchained(); - __ERC20_init_unchained(nameIrrevocable, symbolIrrevocable); + __ERC20_init_unchained(ERC20Attributes_.nameIrrevocable, ERC20Attributes_.symbolIrrevocable); // AccessControlUpgradeable inherits from ERC165Upgradeable __ERC165_init_unchained(); // AuthorizationModule inherits from AccessControlUpgradeable @@ -109,16 +99,16 @@ abstract contract CMTAT_BASE is __SnapshotModuleBase_init_unchained(); __ERC20Snapshot_init_unchained(); - __Validation_init_unchained(engines.ruleEngine); + __Validation_init_unchained(engines_ .ruleEngine); /* Wrapper */ // AuthorizationModule_init_unchained is called firstly due to inheritance - __AuthorizationModule_init_unchained(admin, engines.authorizationEngine); + __AuthorizationModule_init_unchained(admin, engines_ .authorizationEngine); __ERC20BurnModule_init_unchained(); __ERC20MintModule_init_unchained(); // EnforcementModule_init_unchained is called before ValidationModule_init_unchained due to inheritance __EnforcementModule_init_unchained(); - __ERC20BaseModule_init_unchained(decimalsIrrevocable); + __ERC20BaseModule_init_unchained(ERC20Attributes_.decimalsIrrevocable); // PauseModule_init_unchained is called before ValidationModule_init_unchained due to inheritance __PauseModule_init_unchained(); __ValidationModule_init_unchained(); @@ -128,11 +118,11 @@ abstract contract CMTAT_BASE is Add this call in case you add the SnapshotModule */ __ERC20SnasphotModule_init_unchained(); - __DocumentModule_init_unchained(engines.documentEngine); - __DebtModule_init_unchained(engines.debtEngine); + __DocumentModule_init_unchained(engines_ .documentEngine); + __DebtModule_init_unchained(engines_ .debtEngine); /* Other modules */ - __Base_init_unchained(tokenId_, terms_, information_); + __Base_init_unchained(baseModuleAttributes_.tokenId, baseModuleAttributes_.terms, baseModuleAttributes_.information); /* own function */ __CMTAT_init_unchained(); @@ -142,6 +132,11 @@ abstract contract CMTAT_BASE is // no variable to initialize } + + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ + /** * @notice Returns the number of decimals used to get its user representation. */ @@ -184,6 +179,9 @@ abstract contract CMTAT_BASE is mint(to, amountToMint); } + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @dev * @@ -204,8 +202,9 @@ abstract contract CMTAT_BASE is ERC20SnapshotModuleInternal._snapshotUpdate(from, to); ERC20Upgradeable._update(from, to, amount); } - - /************* MetaTx Module *************/ + /*////////////////////////////////////////////////////////////// + METAXTX MODULE + //////////////////////////////////////////////////////////////*/ /** * @dev This surcharge is not necessary if you do not use the MetaTxModule */ diff --git a/contracts/modules/internal/ERC20SnapshotModuleInternal.sol b/contracts/modules/internal/ERC20SnapshotModuleInternal.sol index d727aa4a..654b7186 100644 --- a/contracts/modules/internal/ERC20SnapshotModuleInternal.sol +++ b/contracts/modules/internal/ERC20SnapshotModuleInternal.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.20; -import "../../../openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import {Arrays} from '@openzeppelin/contracts/utils/Arrays.sol'; import "./base/SnapshotModuleBase.sol"; import "../../interfaces/ICMTATSnapshot.sol"; @@ -17,19 +17,16 @@ import "../../interfaces/ICMTATSnapshot.sol"; abstract contract ERC20SnapshotModuleInternal is ICMTATSnapshot, SnapshotModuleBase, ERC20Upgradeable { using Arrays for uint256[]; - - /** - * @dev - * list of scheduled snapshot (time) - * This list is sorted in ascending order - */ - uint256[] private _scheduledSnapshots; - + /* ============ Initializer Function ============ */ function __ERC20Snapshot_init_unchained() internal onlyInitializing { // Nothing to do // _currentSnapshotTime & _currentSnapshotIndex are initialized to zero } + + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @notice Return snapshotBalanceOf and snapshotTotalSupply to avoid multiple calls * @return ownerBalance , totalSupply - see snapshotBalanceOf and snapshotTotalSupply @@ -71,9 +68,10 @@ abstract contract ERC20SnapshotModuleInternal is ICMTATSnapshot, SnapshotModuleB uint256 time, address owner ) public view returns (uint256) { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); (bool snapshotted, uint256 value) = _valueAt( time, - _accountBalanceSnapshots[owner] + $._accountBalanceSnapshots[owner] ); return snapshotted ? value : balanceOf(owner); @@ -85,13 +83,17 @@ abstract contract ERC20SnapshotModuleInternal is ICMTATSnapshot, SnapshotModuleB * @return value stored in the snapshot, or the actual totalSupply if no snapshot */ function snapshotTotalSupply(uint256 time) public view returns (uint256) { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); (bool snapshotted, uint256 value) = _valueAt( time, - _totalSupplySnapshots + $._totalSupplySnapshots ); return snapshotted ? value : totalSupply(); } + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @dev Update balance and/or total supply snapshots before the values are modified. This is implemented @@ -123,15 +125,15 @@ abstract contract ERC20SnapshotModuleInternal is ICMTATSnapshot, SnapshotModuleB * @dev See {OpenZeppelin - ERC20Snapshot} */ function _updateAccountSnapshot(address account) private { - _updateSnapshot(_accountBalanceSnapshots[account], balanceOf(account)); + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); + _updateSnapshot($._accountBalanceSnapshots[account], balanceOf(account)); } /** * @dev See {OpenZeppelin - ERC20Snapshot} */ function _updateTotalSupplySnapshot() private { - _updateSnapshot(_totalSupplySnapshots, totalSupply()); + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); + _updateSnapshot($._totalSupplySnapshots, totalSupply()); } - - uint256[50] private __gap; } diff --git a/contracts/modules/internal/EnforcementModuleInternal.sol b/contracts/modules/internal/EnforcementModuleInternal.sol index 3f862e47..a7c0b4c4 100644 --- a/contracts/modules/internal/EnforcementModuleInternal.sol +++ b/contracts/modules/internal/EnforcementModuleInternal.sol @@ -2,9 +2,9 @@ pragma solidity ^0.8.20; -import "../../../openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol"; -import "../../../openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol"; -import "../../../openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; /** * @dev Enforcement module. @@ -15,9 +15,7 @@ abstract contract EnforcementModuleInternal is Initializable, ContextUpgradeable { - // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.EnforcementModuleInternal")) - 1)) & ~bytes32(uint256(0xff)) - bytes32 private constant EnforcementModuleInternalStorageLocation = 0x0c7bc8a17be064111d299d7669f49519cb26c58611b72d9f6ccc40a1e1184e00; - + /* ============ Events ============ */ /** * @notice Emitted when an address is frozen. */ @@ -38,16 +36,28 @@ abstract contract EnforcementModuleInternal is string reason ); - /* Variables */ + /* ============ ERC-7201 ============ */ + // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.EnforcementModuleInternal")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant EnforcementModuleInternalStorageLocation = 0x0c7bc8a17be064111d299d7669f49519cb26c58611b72d9f6ccc40a1e1184e00; + + + /* ==== ERC-7201 State Variables === */ struct EnforcementModuleInternalStorage { mapping(address => bool) _frozen; } + /*////////////////////////////////////////////////////////////// + INITIALIZER FUNCTION + //////////////////////////////////////////////////////////////*/ function __Enforcement_init_unchained() internal onlyInitializing { // no variable to initialize } + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ + /** * @dev Returns true if the account is frozen, and false otherwise. */ @@ -56,6 +66,10 @@ abstract contract EnforcementModuleInternal is return $._frozen[account]; } + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ + /** * @dev Freezes an address. * @param account the account to freeze @@ -94,6 +108,7 @@ abstract contract EnforcementModuleInternal is return true; } + /* ============ ERC-7201 ============ */ function _getEnforcementModuleInternalStorage() private pure returns (EnforcementModuleInternalStorage storage $) { assembly { $.slot := EnforcementModuleInternalStorageLocation diff --git a/contracts/modules/internal/ValidationModuleInternal.sol b/contracts/modules/internal/ValidationModuleInternal.sol index 7f1a29e1..7ec094f5 100644 --- a/contracts/modules/internal/ValidationModuleInternal.sol +++ b/contracts/modules/internal/ValidationModuleInternal.sol @@ -2,8 +2,8 @@ pragma solidity ^0.8.20; -import "../../../openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol"; -import "../../../openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "../../interfaces/engine/IRuleEngine.sol"; /** * @dev Validation module. @@ -14,24 +14,19 @@ abstract contract ValidationModuleInternal is Initializable, ContextUpgradeable { - // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.ValidationModuleInternal")) - 1)) & ~bytes32(uint256(0xff)) - bytes32 private constant ValidationModuleInternalStorageLocation = 0xb3e8f29e401cfa802cad91001b5f9eb50decccdb111d80cb07177ab650b04700; - /* Variables */ - struct ValidationModuleInternalStorage { - IRuleEngine _ruleEngine; - } - /* - + /* ============ Events ============ */ /** * @dev Emitted when a rule engine is set. */ event RuleEngine(IRuleEngine indexed newRuleEngine); - - function ruleEngine() public view returns(IRuleEngine){ - ValidationModuleInternalStorage storage $ = _getValidationModuleInternalStorage(); - return $._ruleEngine; + /* ============ ERC-7201 ============ */ + // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.ValidationModuleInternal")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant ValidationModuleInternalStorageLocation = 0xb3e8f29e401cfa802cad91001b5f9eb50decccdb111d80cb07177ab650b04700; + /* ==== ERC-7201 State Variables === */ + struct ValidationModuleInternalStorage { + IRuleEngine _ruleEngine; } - + /* ============ Initializer Function ============ */ function __Validation_init_unchained( IRuleEngine ruleEngine_ ) internal onlyInitializing { @@ -42,6 +37,21 @@ abstract contract ValidationModuleInternal is } } + + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ + + function ruleEngine() public view returns(IRuleEngine){ + ValidationModuleInternalStorage storage $ = _getValidationModuleInternalStorage(); + return $._ruleEngine; + } + + + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ + /** * @dev before making a call to this function, you have to check if a ruleEngine is set. */ @@ -81,6 +91,8 @@ abstract contract ValidationModuleInternal is return $._ruleEngine.operateOnTransfer(from, to, amount); } + + /* ============ ERC-7201 ============ */ function _getValidationModuleInternalStorage() internal pure returns (ValidationModuleInternalStorage storage $) { assembly { $.slot := ValidationModuleInternalStorageLocation diff --git a/contracts/modules/internal/base/SnapshotModuleBase.sol b/contracts/modules/internal/base/SnapshotModuleBase.sol index 2862f1ac..f29f822c 100644 --- a/contracts/modules/internal/base/SnapshotModuleBase.sol +++ b/contracts/modules/internal/base/SnapshotModuleBase.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.20; -import "../../../../openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import {Arrays} from '@openzeppelin/contracts/utils/Arrays.sol'; import "../../../libraries/Errors.sol"; @@ -18,17 +18,7 @@ import "../../../libraries/Errors.sol"; abstract contract SnapshotModuleBase is Initializable { using Arrays for uint256[]; - - /** - @notice Emitted when the snapshot with the specified oldTime was scheduled or rescheduled at the specified newTime. - */ - event SnapshotSchedule(uint256 indexed oldTime, uint256 indexed newTime); - - /** - * @notice Emitted when the scheduled snapshot with the specified time was cancelled. - */ - event SnapshotUnschedule(uint256 indexed time); - + /* ============ Structs ============ * /** * @dev See {OpenZeppelin - ERC20Snapshot} * Snapshotted values have arrays of ids (time) and the value corresponding to that id. @@ -39,68 +29,88 @@ abstract contract SnapshotModuleBase is Initializable { uint256[] ids; uint256[] values; } - + /* ============ Events ============ */ /** - * @dev See {OpenZeppelin - ERC20Snapshot} - */ - mapping(address => Snapshots) internal _accountBalanceSnapshots; - Snapshots internal _totalSupplySnapshots; - - /** - * @dev time instead of a counter for OpenZeppelin + @notice Emitted when the snapshot with the specified oldTime was scheduled or rescheduled at the specified newTime. */ - // Initialized to zero - uint256 private _currentSnapshotTime; - // Initialized to zero - uint256 private _currentSnapshotIndex; + event SnapshotSchedule(uint256 indexed oldTime, uint256 indexed newTime); /** - * @dev - * list of scheduled snapshot (time) - * This list is sorted in ascending order + * @notice Emitted when the scheduled snapshot with the specified time was cancelled. */ - uint256[] private _scheduledSnapshots; + event SnapshotUnschedule(uint256 indexed time); + /* ============ ERC-7201 ============ */ + // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.SnapshotModuleBase")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant SnapshotModuleBaseStorageLocation = 0x649d9af4a0486294740af60c5e3bf61210e7b49108a80b1f369042ea9fd02000; + /* ==== ERC-7201 State Variables === */ + struct SnapshotModuleBaseStorage { + /** + * @dev See {OpenZeppelin - ERC20Snapshot} + */ + mapping(address => Snapshots) _accountBalanceSnapshots; + Snapshots _totalSupplySnapshots; + /** + * @dev time instead of a counter for OpenZeppelin + */ + // Initialized to zero + uint256 _currentSnapshotTime; + // Initialized to zero + uint256 _currentSnapshotIndex; + /** + * @dev + * list of scheduled snapshot (time) + * This list is sorted in ascending order + */ + uint256[] _scheduledSnapshots; + } + /*////////////////////////////////////////////////////////////// + INITIALIZER FUNCTION + //////////////////////////////////////////////////////////////*/ function __SnapshotModuleBase_init_unchained() internal onlyInitializing { // Nothing to do // _currentSnapshotTime & _currentSnapshotIndex are initialized to zero } - + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * * @notice Get all snapshots */ function getAllSnapshots() public view returns (uint256[] memory) { - return _scheduledSnapshots; + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); + return $._scheduledSnapshots; } - /** + /** * @dev * Get the next scheduled snapshots */ function getNextSnapshots() public view returns (uint256[] memory) { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); uint256[] memory nextScheduledSnapshot = new uint256[](0); // no snapshot were planned - if (_scheduledSnapshots.length > 0) { + if ($._scheduledSnapshots.length > 0) { ( uint256 timeLowerBound, uint256 indexLowerBound ) = _findScheduledMostRecentPastSnapshot(); // All snapshots are situated in the futur - if ((timeLowerBound == 0) && (_currentSnapshotTime == 0)) { - return _scheduledSnapshots; + if ((timeLowerBound == 0) && ($._currentSnapshotTime == 0)) { + return $._scheduledSnapshots; } else { // There are snapshots situated in the futur - if (indexLowerBound + 1 != _scheduledSnapshots.length) { + if (indexLowerBound + 1 != $._scheduledSnapshots.length) { // All next snapshots are located after the snapshot specified by indexLowerBound - uint256 arraySize = _scheduledSnapshots.length - + uint256 arraySize = $._scheduledSnapshots.length - indexLowerBound - 1; nextScheduledSnapshot = new uint256[](arraySize); // No need of unchecked block since Soliditiy 0.8.22 for (uint256 i; i < arraySize; ++i) { - nextScheduledSnapshot[i] = _scheduledSnapshots[ + nextScheduledSnapshot[i] = $._scheduledSnapshots[ indexLowerBound + 1 + i ]; } @@ -110,19 +120,23 @@ abstract contract SnapshotModuleBase is Initializable { return nextScheduledSnapshot; } + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @dev schedule a snapshot at the specified time * You can only add a snapshot after the last previous */ function _scheduleSnapshot(uint256 time) internal { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); // Check the time firstly to avoid an useless read of storage _checkTimeInThePast(time); - if (_scheduledSnapshots.length > 0) { + if ($._scheduledSnapshots.length > 0) { // We check the last snapshot on the list - uint256 nextSnapshotTime = _scheduledSnapshots[ - _scheduledSnapshots.length - 1 + uint256 nextSnapshotTime = $._scheduledSnapshots[ + $._scheduledSnapshots.length - 1 ]; if (time < nextSnapshotTime) { revert Errors @@ -134,28 +148,15 @@ abstract contract SnapshotModuleBase is Initializable { revert Errors.CMTAT_SnapshotModule_SnapshotAlreadyExists(); } } - _scheduledSnapshots.push(time); + $._scheduledSnapshots.push(time); emit SnapshotSchedule(0, time); } - function _checkTimeInThePast(uint256 time) internal view{ - if (time <= block.timestamp) { - revert Errors.CMTAT_SnapshotModule_SnapshotScheduledInThePast( - time, - block.timestamp - ); - } - } - function _checkTimeSnapshotAlreadyDone(uint256 time) internal view{ - if (time <= block.timestamp) { - revert Errors.CMTAT_SnapshotModule_SnapshotAlreadyDone(); - } - } - /** * @dev schedule a snapshot at the specified time */ function _scheduleSnapshotNotOptimized(uint256 time) internal { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); _checkTimeInThePast(time); (bool isFound, uint256 index) = _findScheduledSnapshotIndex(time); // Perfect match @@ -163,19 +164,19 @@ abstract contract SnapshotModuleBase is Initializable { revert Errors.CMTAT_SnapshotModule_SnapshotAlreadyExists(); } // if no upper bound match found, we push the snapshot at the end of the list - if (index == _scheduledSnapshots.length) { - _scheduledSnapshots.push(time); + if (index == $._scheduledSnapshots.length) { + $._scheduledSnapshots.push(time); } else { - _scheduledSnapshots.push( - _scheduledSnapshots[_scheduledSnapshots.length - 1] + $._scheduledSnapshots.push( + $._scheduledSnapshots[$._scheduledSnapshots.length - 1] ); - for (uint256 i = _scheduledSnapshots.length - 2; i > index; ) { - _scheduledSnapshots[i] = _scheduledSnapshots[i - 1]; + for (uint256 i = $._scheduledSnapshots.length - 2; i > index; ) { + $._scheduledSnapshots[i] = $._scheduledSnapshots[i - 1]; unchecked { --i; } } - _scheduledSnapshots[index] = time; + $._scheduledSnapshots[index] = time; } emit SnapshotSchedule(0, time); } @@ -184,18 +185,16 @@ abstract contract SnapshotModuleBase is Initializable { * @dev reschedule a scheduled snapshot at the specified newTime */ function _rescheduleSnapshot(uint256 oldTime, uint256 newTime) internal { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); // Check the time firstly to avoid an useless read of storage _checkTimeSnapshotAlreadyDone(oldTime); _checkTimeInThePast(newTime); - if (_scheduledSnapshots.length == 0) { + if ($._scheduledSnapshots.length == 0) { revert Errors.CMTAT_SnapshotModule_NoSnapshotScheduled(); } - (bool foundOld, uint256 index) = _findScheduledSnapshotIndex(oldTime); - if (!foundOld) { - revert Errors.CMTAT_SnapshotModule_SnapshotNotFound(); - } - if (index + 1 < _scheduledSnapshots.length) { - uint256 nextSnapshotTime = _scheduledSnapshots[index + 1]; + uint256 index = _findAndRevertScheduledSnapshotIndex(oldTime); + if (index + 1 < $._scheduledSnapshots.length) { + uint256 nextSnapshotTime = $._scheduledSnapshots[index + 1]; if (newTime > nextSnapshotTime) { revert Errors .CMTAT_SnapshotModule_SnapshotTimestampAfterNextSnapshot( @@ -207,14 +206,14 @@ abstract contract SnapshotModuleBase is Initializable { } } if (index > 0) { - if (newTime <= _scheduledSnapshots[index - 1]) + if (newTime <= $._scheduledSnapshots[index - 1]) revert Errors .CMTAT_SnapshotModule_SnapshotTimestampBeforePreviousSnapshot( newTime, - _scheduledSnapshots[index - 1] + $._scheduledSnapshots[index - 1] ); } - _scheduledSnapshots[index] = newTime; + $._scheduledSnapshots[index] = newTime; emit SnapshotSchedule(oldTime, newTime); } @@ -223,16 +222,17 @@ abstract contract SnapshotModuleBase is Initializable { * @dev unschedule the last scheduled snapshot */ function _unscheduleLastSnapshot(uint256 time) internal { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); // Check the time firstly to avoid an useless read of storage _checkTimeSnapshotAlreadyDone(time); - if (_scheduledSnapshots.length == 0) { + if ($._scheduledSnapshots.length == 0) { revert Errors.CMTAT_SnapshotModule_NoSnapshotScheduled(); } // All snapshot time are unique, so we do not check the indice - if (time != _scheduledSnapshots[_scheduledSnapshots.length - 1]) { + if (time !=$._scheduledSnapshots[$._scheduledSnapshots.length - 1]) { revert Errors.CMTAT_SnapshotModule_SnapshotNotFound(); } - _scheduledSnapshots.pop(); + $._scheduledSnapshots.pop(); emit SnapshotUnschedule(time); } @@ -243,16 +243,15 @@ abstract contract SnapshotModuleBase is Initializable { * - Reduce the array size by deleting the last snapshot */ function _unscheduleSnapshotNotOptimized(uint256 time) internal { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); _checkTimeSnapshotAlreadyDone(time); - (bool isFound, uint256 index) = _findScheduledSnapshotIndex(time); - if (!isFound) { - revert Errors.CMTAT_SnapshotModule_SnapshotNotFound(); - } + + uint256 index = _findAndRevertScheduledSnapshotIndex(time); // No need of unchecked block since Soliditiy 0.8.22 - for (uint256 i = index; i + 1 < _scheduledSnapshots.length; ++i ) { - _scheduledSnapshots[i] = _scheduledSnapshots[i + 1]; + for (uint256 i = index; i + 1 < $._scheduledSnapshots.length; ++i ) { + $._scheduledSnapshots[i] = $._scheduledSnapshots[i + 1]; } - _scheduledSnapshots.pop(); + $._scheduledSnapshots.pop(); } /** @@ -299,7 +298,8 @@ abstract contract SnapshotModuleBase is Initializable { Snapshots storage snapshots, uint256 currentValue ) internal { - uint256 current = _currentSnapshotTime; + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); + uint256 current = $._currentSnapshotTime; if (_lastSnapshot(snapshots.ids) < current) { snapshots.ids.push(current); snapshots.values.push(currentValue); @@ -312,13 +312,14 @@ abstract contract SnapshotModuleBase is Initializable { * if a snapshot exists, clear all past scheduled snapshot */ function _setCurrentSnapshot() internal { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); ( uint256 scheduleSnapshotTime, uint256 scheduleSnapshotIndex ) = _findScheduledMostRecentPastSnapshot(); if (scheduleSnapshotTime > 0) { - _currentSnapshotTime = scheduleSnapshotTime; - _currentSnapshotIndex = scheduleSnapshotIndex; + $._currentSnapshotTime = scheduleSnapshotTime; + $._currentSnapshotIndex = scheduleSnapshotIndex; } } @@ -342,12 +343,13 @@ abstract contract SnapshotModuleBase is Initializable { function _findScheduledSnapshotIndex( uint256 time ) private view returns (bool, uint256) { - uint256 indexFound = _scheduledSnapshots.findUpperBound(time); - uint256 _scheduledSnapshotsLength = _scheduledSnapshots.length; + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); + uint256 indexFound = $._scheduledSnapshots.findUpperBound(time); + uint256 _scheduledSnapshotsLength = $._scheduledSnapshots.length; // Exact match if ( indexFound != _scheduledSnapshotsLength && - _scheduledSnapshots[indexFound] == time + $._scheduledSnapshots[indexFound] == time ) { return (true, indexFound); } @@ -370,11 +372,12 @@ abstract contract SnapshotModuleBase is Initializable { view returns (uint256 time, uint256 index) { - uint256 currentArraySize = _scheduledSnapshots.length; + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); + uint256 currentArraySize = $._scheduledSnapshots.length; // no snapshot or the current snapshot already points on the last snapshot if ( currentArraySize == 0 || - ((_currentSnapshotIndex + 1 == currentArraySize) && (time != 0)) + (($._currentSnapshotIndex + 1 == currentArraySize) && (time != 0)) ) { return (0, currentArraySize); } @@ -382,9 +385,9 @@ abstract contract SnapshotModuleBase is Initializable { uint256 mostRecent; index = currentArraySize; // No need of unchecked block since Soliditiy 0.8.22 - for (uint256 i = _currentSnapshotIndex; i < currentArraySize; ++i ) { - if (_scheduledSnapshots[i] <= block.timestamp) { - mostRecent = _scheduledSnapshots[i]; + for (uint256 i = $._currentSnapshotIndex; i < currentArraySize; ++i ) { + if ($._scheduledSnapshots[i] <= block.timestamp) { + mostRecent = $._scheduledSnapshots[i]; index = i; } else { // All snapshot are planned in the futur @@ -394,5 +397,36 @@ abstract contract SnapshotModuleBase is Initializable { return (mostRecent, index); } - uint256[50] private __gap; + /* ============ Utility functions ============ */ + + + function _findAndRevertScheduledSnapshotIndex( + uint256 time + ) private view returns (uint256){ + (bool isFound, uint256 index) = _findScheduledSnapshotIndex(time); + if (!isFound) { + revert Errors.CMTAT_SnapshotModule_SnapshotNotFound(); + } + return index; + } + function _checkTimeInThePast(uint256 time) internal view{ + if (time <= block.timestamp) { + revert Errors.CMTAT_SnapshotModule_SnapshotScheduledInThePast( + time, + block.timestamp + ); + } + } + function _checkTimeSnapshotAlreadyDone(uint256 time) internal view{ + if (time <= block.timestamp) { + revert Errors.CMTAT_SnapshotModule_SnapshotAlreadyDone(); + } + } + + /* ============ ERC-7201 ============ */ + function _getSnapshotModuleBaseStorage() internal pure returns (SnapshotModuleBaseStorage storage $) { + assembly { + $.slot := SnapshotModuleBaseStorageLocation + } + } } diff --git a/contracts/modules/security/AuthorizationModule.sol b/contracts/modules/security/AuthorizationModule.sol index 7da1381a..fea79fd9 100644 --- a/contracts/modules/security/AuthorizationModule.sol +++ b/contracts/modules/security/AuthorizationModule.sol @@ -2,21 +2,24 @@ pragma solidity ^0.8.20; -import "../../../openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "../../libraries/Errors.sol"; import "../../interfaces/engine/IAuthorizationEngine.sol"; abstract contract AuthorizationModule is AccessControlUpgradeable { + /* ============ Events ============ */ + /** + * @dev Emitted when a rule engine is set. + */ + event AuthorizationEngine(IAuthorizationEngine indexed newAuthorizationEngine); + /* ============ ERC-7201 ============ */ // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.AuthorizationModule")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant AuthorizationModuleStorageLocation = 0x59b7f077fa4ad020f9053fd2197fef0113b19f0b11dcfe516e88cbc0e9226d00; - /* Variables */ + /* ==== ERC-7201 State Variables === */ struct AuthorizationModuleStorage { IAuthorizationEngine _authorizationEngine; } - /** - * @dev Emitted when a rule engine is set. - */ - event AuthorizationEngine(IAuthorizationEngine indexed newAuthorizationEngine); + /* ============ Initializer Function ============ */ /** * @dev * @@ -37,6 +40,11 @@ abstract contract AuthorizationModule is AccessControlUpgradeable { } } + + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ + function authorizationEngine() public view virtual returns (IAuthorizationEngine) { AuthorizationModuleStorage storage $ = _getAuthorizationModuleStorage(); return $._authorizationEngine; @@ -96,6 +104,13 @@ abstract contract AuthorizationModule is AccessControlUpgradeable { return AccessControlUpgradeable.hasRole(role, account); } + + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ + + + /* ============ ERC-7201 ============ */ function _getAuthorizationModuleStorage() private pure returns (AuthorizationModuleStorage storage $) { assembly { $.slot := AuthorizationModuleStorageLocation diff --git a/contracts/modules/wrapper/controllers/ValidationModule.sol b/contracts/modules/wrapper/controllers/ValidationModule.sol index c777c53c..45426f98 100644 --- a/contracts/modules/wrapper/controllers/ValidationModule.sol +++ b/contracts/modules/wrapper/controllers/ValidationModule.sol @@ -20,13 +20,20 @@ abstract contract ValidationModule is EnforcementModule, IERC1404Wrapper { + /* ============ State Variables ============ */ string constant TEXT_TRANSFER_OK = "No restriction"; string constant TEXT_UNKNOWN_CODE = "Unknown code"; + /* ============ Initializer Function ============ */ function __ValidationModule_init_unchained() internal onlyInitializing { // no variable to initialize } + + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ + /* * @notice set a RuleEngine * @param ruleEngine_ the call will be reverted if the new value of ruleEngine is the same as the current one @@ -116,6 +123,10 @@ abstract contract ValidationModule is return true; } + + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ function _validateTransferByModule( address from, address to, diff --git a/contracts/modules/wrapper/core/BaseModule.sol b/contracts/modules/wrapper/core/BaseModule.sol index 11f48590..08cc5e87 100644 --- a/contracts/modules/wrapper/core/BaseModule.sol +++ b/contracts/modules/wrapper/core/BaseModule.sol @@ -6,22 +6,14 @@ pragma solidity ^0.8.20; import "../../security/AuthorizationModule.sol"; import "../../../libraries/Errors.sol"; abstract contract BaseModule is AuthorizationModule { - // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.BaseModule")) - 1)) & ~bytes32(uint256(0xff)) - bytes32 private constant BaseModuleStorageLocation = 0xa98e72f7f70574363edb12c42a03ac1feb8cc898a6e0a30f6eefbab7093e0d00; - - /* Variables */ - struct BaseModuleStorage { - string _tokenId; - string _terms; - string _information; - } + /* ============ State Variables ============ */ /** * @notice * Get the current version of the smart contract */ - string public constant VERSION = "2.4.1"; + string public constant VERSION = "2.5.0"; - /* Events */ + /* ============ Events ============ */ event Term(string indexed newTermIndexed, string newTerm); event TokenId(string indexed newTokenIdIndexed, string newTokenId); event Information( @@ -29,10 +21,17 @@ abstract contract BaseModule is AuthorizationModule { string newInformation ); event Flag(uint256 indexed newFlag); + /* ============ ERC-7201 ============ */ + // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.BaseModule")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant BaseModuleStorageLocation = 0xa98e72f7f70574363edb12c42a03ac1feb8cc898a6e0a30f6eefbab7093e0d00; - - - /* Initializers */ + /* ==== ERC-7201 State Variables === */ + struct BaseModuleStorage { + string _tokenId; + string _terms; + string _information; + } + /* ============ Initializer Function ============ */ /** * @dev Sets the values for {name} and {symbol}. * @@ -50,7 +49,9 @@ abstract contract BaseModule is AuthorizationModule { $._information = information_; } - /* Methods */ + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ function tokenId() public view virtual returns (string memory) { BaseModuleStorage storage $ = _getBaseModuleStorage(); @@ -100,6 +101,11 @@ abstract contract BaseModule is AuthorizationModule { } + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ + + /* ============ ERC-7201 ============ */ function _getBaseModuleStorage() private pure returns (BaseModuleStorage storage $) { assembly { $.slot := BaseModuleStorageLocation diff --git a/contracts/modules/wrapper/core/ERC20BaseModule.sol b/contracts/modules/wrapper/core/ERC20BaseModule.sol index 183e7562..5eeb4e1d 100644 --- a/contracts/modules/wrapper/core/ERC20BaseModule.sol +++ b/contracts/modules/wrapper/core/ERC20BaseModule.sol @@ -3,28 +3,27 @@ pragma solidity ^0.8.20; // required OZ imports here -import "../../../../openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "../../../libraries/Errors.sol"; abstract contract ERC20BaseModule is ERC20Upgradeable { - // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.ERC20BaseModule")) - 1)) & ~bytes32(uint256(0xff)) - bytes32 private constant ERC20BaseModuleStorageLocation = 0x9bd8d607565c0370ae5f91651ca67fd26d4438022bf72037316600e29e6a3a00; - - struct ERC20BaseModuleStorage { - uint8 _decimals; - } - - /* Events */ + /* ============ Events ============ */ /** * @notice Emitted when the specified `spender` spends the specified `value` tokens owned by the specified `owner` reducing the corresponding allowance. * @dev The allowance can be also "spend" with the function BurnFrom, but in this case, the emitted event is BurnFrom. */ event Spend(address indexed owner, address indexed spender, uint256 value); + /* ============ ERC-7201 ============ */ + // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.ERC20BaseModule")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant ERC20BaseModuleStorageLocation = 0x9bd8d607565c0370ae5f91651ca67fd26d4438022bf72037316600e29e6a3a00; + /* ==== ERC-7201 State Variables === */ + struct ERC20BaseModuleStorage { + uint8 _decimals; + } - /* Initializers */ - + /* ============ Initializer Function ============ */ /** - * @dev Sets the values for decimals. + * @dev Initializers: Sets the values for decimals. * * this value is immutable: it can only be set once during * construction/initialization. @@ -35,8 +34,9 @@ abstract contract ERC20BaseModule is ERC20Upgradeable { ERC20BaseModuleStorage storage $ = _getERC20BaseModuleStorage(); $._decimals = decimals_; } - - /* Methods */ + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * * @notice Returns the number of decimals used to get its user representation. @@ -116,6 +116,13 @@ abstract contract ERC20BaseModule is ERC20Upgradeable { totalSupply = ERC20Upgradeable.totalSupply(); } + + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ + + + /* ============ ERC-7201 ============ */ function _getERC20BaseModuleStorage() private pure returns (ERC20BaseModuleStorage storage $) { assembly { $.slot := ERC20BaseModuleStorageLocation diff --git a/contracts/modules/wrapper/core/ERC20BurnModule.sol b/contracts/modules/wrapper/core/ERC20BurnModule.sol index 02c951fe..f3db15d2 100644 --- a/contracts/modules/wrapper/core/ERC20BurnModule.sol +++ b/contracts/modules/wrapper/core/ERC20BurnModule.sol @@ -2,12 +2,15 @@ pragma solidity ^0.8.20; -import "../../../../openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "../../security/AuthorizationModule.sol"; import "../../../interfaces/ICCIPToken.sol"; abstract contract ERC20BurnModule is ERC20Upgradeable, ICCIPBurnFromERC20, AuthorizationModule { + /* ============ State Variables ============ */ bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE"); bytes32 public constant BURNER_FROM_ROLE = keccak256("BURNER_FROM_ROLE"); + + /* ============ Events ============ */ /** * @notice Emitted when the specified `value` amount of tokens owned by `owner`are destroyed with the given `reason` */ @@ -16,10 +19,17 @@ abstract contract ERC20BurnModule is ERC20Upgradeable, ICCIPBurnFromERC20, Autho * @notice Emitted when the specified `spender` burns the specified `value` tokens owned by the specified `owner` reducing the corresponding allowance. */ event BurnFrom(address indexed owner, address indexed spender, uint256 value); + + + /* ============ Initializer Function ============ */ function __ERC20BurnModule_init_unchained() internal onlyInitializing { // no variable to initialize } + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ + /** * @notice Destroys a `value` amount of tokens from `account`, by transferring it to address(0). * @dev diff --git a/contracts/modules/wrapper/core/ERC20MintModule.sol b/contracts/modules/wrapper/core/ERC20MintModule.sol index 3e94861c..9e872c1e 100644 --- a/contracts/modules/wrapper/core/ERC20MintModule.sol +++ b/contracts/modules/wrapper/core/ERC20MintModule.sol @@ -2,22 +2,28 @@ pragma solidity ^0.8.20; -import "../../../../openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "../../security/AuthorizationModule.sol"; import "../../../interfaces/ICCIPToken.sol"; abstract contract ERC20MintModule is ERC20Upgradeable, ICCIPMintERC20, AuthorizationModule { - // MintModule + /* ============ State Variables ============ */ bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); + /* ============ Events ============ */ /** * @notice Emitted when the specified `value` amount of new tokens are created and * allocated to the specified `account`. */ event Mint(address indexed account, uint256 value); + + /* ============ Initializer Function ============ */ function __ERC20MintModule_init_unchained() internal onlyInitializing { // no variable to initialize } + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @notice Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0) * @param account token receiver diff --git a/contracts/modules/wrapper/core/EnforcementModule.sol b/contracts/modules/wrapper/core/EnforcementModule.sol index aff0d705..89c446b3 100644 --- a/contracts/modules/wrapper/core/EnforcementModule.sol +++ b/contracts/modules/wrapper/core/EnforcementModule.sol @@ -14,7 +14,7 @@ abstract contract EnforcementModule is EnforcementModuleInternal, AuthorizationModule { - // EnforcementModule + /* ============ State Variables ============ */ bytes32 public constant ENFORCER_ROLE = keccak256("ENFORCER_ROLE"); string internal constant TEXT_TRANSFER_REJECTED_FROM_FROZEN = "Address FROM is frozen"; @@ -22,10 +22,14 @@ abstract contract EnforcementModule is string internal constant TEXT_TRANSFER_REJECTED_TO_FROZEN = "Address TO is frozen"; + /* ============ Initializer Function ============ */ function __EnforcementModule_init_unchained() internal onlyInitializing { // no variable to initialize } + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @notice Freezes an address. * @param account the account to freeze diff --git a/contracts/modules/wrapper/core/PauseModule.sol b/contracts/modules/wrapper/core/PauseModule.sol index edaa7c49..746af11a 100644 --- a/contracts/modules/wrapper/core/PauseModule.sol +++ b/contracts/modules/wrapper/core/PauseModule.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.20; -import "../../../../openzeppelin-contracts-upgradeable/contracts/utils/PausableUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; import "../../security/AuthorizationModule.sol"; /** @@ -16,28 +16,27 @@ import "../../security/AuthorizationModule.sol"; * event of a large bug. */ abstract contract PauseModule is PausableUpgradeable, AuthorizationModule { + /* ============ State Variables ============ */ + bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); + string internal constant TEXT_TRANSFER_REJECTED_PAUSED = + "All transfers paused"; + /* ============ Events ============ */ + event Deactivated(address account); + /* ============ ERC-7201 ============ */ // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.ERC20BaseModule")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant PauseModuleStorageLocation = 0x9bd8d607565c0370ae5f91651ca67fd26d4438022bf72037316600e29e6a3a00; + /* ==== ERC-7201 State Variables === */ struct PauseModuleStorage { bool _isDeactivated; } - - function _getPauseModuleStorage() private pure returns (PauseModuleStorage storage $) { - assembly { - $.slot := PauseModuleStorageLocation - } - } - - // PauseModule - bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); - string internal constant TEXT_TRANSFER_REJECTED_PAUSED = - "All transfers paused"; - event Deactivated(address account); - + /* ============ Initializer Function ============ */ function __PauseModule_init_unchained() internal onlyInitializing { // no variable to initialize } - + + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @notice Pauses all token transfers. * @dev See {ERC20Pausable} and {Pausable-_pause}. @@ -93,4 +92,17 @@ abstract contract PauseModule is PausableUpgradeable, AuthorizationModule { PauseModuleStorage storage $ = _getPauseModuleStorage(); return $._isDeactivated; } + + + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ + + + /* ============ ERC-7201 ============ */ + function _getPauseModuleStorage() private pure returns (PauseModuleStorage storage $) { + assembly { + $.slot := PauseModuleStorageLocation + } + } } diff --git a/contracts/modules/wrapper/extensions/DebtModule.sol b/contracts/modules/wrapper/extensions/DebtModule.sol index 90217304..eb67dce2 100644 --- a/contracts/modules/wrapper/extensions/DebtModule.sol +++ b/contracts/modules/wrapper/extensions/DebtModule.sol @@ -7,18 +7,24 @@ import "../../../libraries/Errors.sol"; import "../../../interfaces/engine/IDebtEngine.sol"; abstract contract DebtModule is AuthorizationModule, IDebtEngine { + /* ============ State Variables ============ */ bytes32 public constant DEBT_ROLE = keccak256("DEBT_ROLE"); + /* ============ ERC-7201 ============ */ // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.DebtModule")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant DebtModuleStorageLocation = 0xf8a315cc5f2213f6481729acd86e55db7ccc930120ccf9fb78b53dcce75f7c00; - /* Variables */ + /* ==== ERC-7201 State Variables === */ struct DebtModuleStorage { IDebtEngine _debtEngine; } + /* ============ Events ============ */ /** * @dev Emitted when a rule engine is set. */ event DebtEngine(IDebtEngine indexed newDebtEngine); + + + /* ============ Initializer Function ============ */ /** * @dev * @@ -36,7 +42,9 @@ abstract contract DebtModule is AuthorizationModule, IDebtEngine { } - + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ function debtEngine() public view virtual returns (IDebtEngine) { DebtModuleStorage storage $ = _getDebtModuleStorage(); return $._debtEngine; @@ -71,6 +79,12 @@ abstract contract DebtModule is AuthorizationModule, IDebtEngine { } } + + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ + + /* ============ ERC-7201 ============ */ function _getDebtModuleStorage() private pure returns (DebtModuleStorage storage $) { assembly { $.slot := DebtModuleStorageLocation diff --git a/contracts/modules/wrapper/extensions/DocumentModule.sol b/contracts/modules/wrapper/extensions/DocumentModule.sol index a42eec09..a66c5b6c 100644 --- a/contracts/modules/wrapper/extensions/DocumentModule.sol +++ b/contracts/modules/wrapper/extensions/DocumentModule.sol @@ -6,27 +6,22 @@ import "../../security/AuthorizationModule.sol"; import "../../../libraries/Errors.sol"; import "../../../interfaces/engine/draft-IERC1643.sol"; abstract contract DocumentModule is AuthorizationModule, IERC1643 { + /* ============ Events ============ */ + /** + * @dev Emitted when a rule engine is set. + */ + event DocumentEngine(IERC1643 indexed newDocumentEngine); + + /* ============ ERC-7201 ============ */ bytes32 public constant DOCUMENT_ROLE = keccak256("DOCUMENT_ROLE"); // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.DocumentModule")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant DocumentModuleStorageLocation = 0x5edcb2767f407e647b6a4171ef53e8015a3eff0bb2b6e7765b1a26332bc43000; + /* ==== ERC-7201 State Variables === */ struct DocumentModuleStorage { IERC1643 _documentEngine; } - function documentEngine() public view virtual returns (IERC1643) { - DocumentModuleStorage storage $ = _getDocumentModuleStorage(); - return $._documentEngine; - } - - function _getDocumentModuleStorage() private pure returns (DocumentModuleStorage storage $) { - assembly { - $.slot := DocumentModuleStorageLocation - } - } - /** - * @dev Emitted when a rule engine is set. - */ - event DocumentEngine(IERC1643 indexed newDocumentEngine); + /* ============ Initializer Function ============ */ /** * @dev * @@ -43,6 +38,14 @@ abstract contract DocumentModule is AuthorizationModule, IERC1643 { } } + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ + function documentEngine() public view virtual returns (IERC1643) { + DocumentModuleStorage storage $ = _getDocumentModuleStorage(); + return $._documentEngine; + } + /* * @notice set an authorizationEngine if not already set * @@ -74,4 +77,16 @@ abstract contract DocumentModule is AuthorizationModule, IERC1643 { documents = $._documentEngine.getAllDocuments(); } } + + + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ + + /* ============ ERC-7201 ============ */ + function _getDocumentModuleStorage() private pure returns (DocumentModuleStorage storage $) { + assembly { + $.slot := DocumentModuleStorageLocation + } + } } diff --git a/contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol b/contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol index 4a079607..ae618eb5 100644 --- a/contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol +++ b/contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol @@ -15,12 +15,15 @@ abstract contract ERC20SnapshotModule is ERC20SnapshotModuleInternal, AuthorizationModule { - // SnapshotModule + /* ============ State Variables ============ */ bytes32 public constant SNAPSHOOTER_ROLE = keccak256("SNAPSHOOTER_ROLE"); + /* ============ Initializer Function ============ */ function __ERC20SnasphotModule_init_unchained() internal onlyInitializing { // no variable to initialize } - + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @notice * Schedule a snapshot at the given time specified as a number of seconds since epoch. diff --git a/contracts/modules/wrapper/extensions/MetaTxModule.sol b/contracts/modules/wrapper/extensions/MetaTxModule.sol index 0e7e6279..1fb09868 100644 --- a/contracts/modules/wrapper/extensions/MetaTxModule.sol +++ b/contracts/modules/wrapper/extensions/MetaTxModule.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.20; -import "../../../../openzeppelin-contracts-upgradeable/contracts/metatx/ERC2771ContextUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/metatx/ERC2771ContextUpgradeable.sol"; /** * @dev Meta transaction (gasless) module. diff --git a/doc/TOOLCHAIN.md b/doc/TOOLCHAIN.md index 0bc5b122..03b64792 100644 --- a/doc/TOOLCHAIN.md +++ b/doc/TOOLCHAIN.md @@ -101,9 +101,6 @@ Use by `openzeppelin-contracts-upgradeable/test/helpers/eip712`imported in `Meta **[solc](https://github.com/ethereum/solc-js)** JavaScript bindings for the Solidity compiler. -**[Web3](https://github.com/web3/web3.js)** -Ethereum JavaScript API. - #### Documentation **[sol2uml](https://github.com/naddison36/sol2uml)** @@ -133,8 +130,7 @@ Loads environment variables from a .env file This section concerns the packages installed in the section `dependencies` of package.json -**[ethereumjs-wallet](https://www.npmjs.com/package/ethereumjs-wallet)** -A wallet implementation + ## Submodule diff --git a/doc/USAGE.md b/doc/USAGE.md index e8383c2c..4b36c3fb 100644 --- a/doc/USAGE.md +++ b/doc/USAGE.md @@ -8,10 +8,9 @@ The toolchain includes the following components, where the versions are the latest ones that we tested: - npm 10.2.5 -- Hardhat-web3 2.0.0 -- Solidity 0.8.22 (via solc-js) +- Hardhat ^2.22.7 +- Solidity 0.8.26 (via solc-js) - Node 20.5.0 -- Web3.js 1.9.0 - OpenZeppelin - OpenZeppelin Contracts Upgradeable (submodule) [v5.0.2](https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/releases/tag/v5.0.2) - OpenZeppelin Contracts (Node.js module) [v5.0.2](https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v5.0.2) @@ -43,14 +42,14 @@ To install the node modules required by CMTAT, run the following command at the ### Hardhat -> Since the version v2.3.1, Hardhat is our main development tool and replace Truffle. The reason behind this change is the fact that Truffle does not support custom errors for testing. +> Since the [sunset of Truffle](https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat) by Consensys ,Hardhat is our main development tool and replace Truffle. To use Hardhat, the recommended way is to use the version installed as part of the node modules, via the `npx` command: `npx hardhat` -Alternatively, you can install Truffle [globally](https://trufflesuite.com/docs/truffle/getting-started/installation/): +Alternatively, you can install Hardhat [globally](https://hardhat.org/hardhat-runner/docs/getting-started): `npm install -g hardhat` @@ -86,7 +85,7 @@ Tests are written in JavaScript by using [web3js](https://web3js.readthedocs.io/ To use the global hardhat install, use instead `hardhat test`. -Please see the Truffle [JavaScript tests documentation](https://www.trufflesuite.com/docs/truffle/testing/writing-tests-in-javascript) for more information about the writing and running of Truffle tests since the tests were originally written for Truffle. +Please see the Hardhat [documentation](https://hardhat.org/tutorial/testing-contracts) for more information about the writing and running of Hardhat. ## Code style guidelines diff --git a/doc/audits/tools/slither-report-v2.4.0.md b/doc/audits/tools/slither-report-v2.4.0.md new file mode 100644 index 00000000..414e0e42 --- /dev/null +++ b/doc/audits/tools/slither-report-v2.4.0.md @@ -0,0 +1,710 @@ +**THIS CHECKLIST IS NOT COMPLETE**. Use `--show-ignored-findings` to show all the results. +Summary + - [shadowing-state](#shadowing-state) (1 results) (High) + - [reentrancy-no-eth](#reentrancy-no-eth) (1 results) (Medium) + - [uninitialized-local](#uninitialized-local) (1 results) (Medium) + - [missing-zero-check](#missing-zero-check) (2 results) (Low) + - [calls-loop](#calls-loop) (4 results) (Low) + - [reentrancy-benign](#reentrancy-benign) (3 results) (Low) + - [reentrancy-events](#reentrancy-events) (2 results) (Low) + - [timestamp](#timestamp) (6 results) (Low) + - [costly-loop](#costly-loop) (2 results) (Informational) + - [dead-code](#dead-code) (1 results) (Informational) + - [solc-version](#solc-version) (1 results) (Informational) + - [naming-convention](#naming-convention) (57 results) (Informational) +## shadowing-state + +> Forgot to set this but only one module modifies the variable + +Impact: High +Confidence: High + - [ ] ID-0 + [ERC20SnapshotModuleInternal._scheduledSnapshots](contracts/modules/internal/ERC20SnapshotModuleInternal.sol#L25) shadows: + - [SnapshotModuleBase._scheduledSnapshots](contracts/modules/internal/base/SnapshotModuleBase.sol#L62) + +contracts/modules/internal/ERC20SnapshotModuleInternal.sol#L25 + + +## reentrancy-no-eth +Impact: Medium +Confidence: Medium + - [ ] ID-1 + Reentrancy in [CMTAT_BASE.burnAndMint(address,address,uint256,uint256,string)](contracts/modules/CMTAT_BASE.sol#L189-L192): + External calls: + - [burn(from,amountToBurn,reason)](contracts/modules/CMTAT_BASE.sol#L190) + - [ruleEngine.operateOnTransfer(from,to,amount)](contracts/modules/internal/ValidationModuleInternal.sol#L65) + - [mint(to,amountToMint)](contracts/modules/CMTAT_BASE.sol#L191) + - [ruleEngine.operateOnTransfer(from,to,amount)](contracts/modules/internal/ValidationModuleInternal.sol#L65) + State variables written after the call(s): + - [mint(to,amountToMint)](contracts/modules/CMTAT_BASE.sol#L191) + - [_currentSnapshotIndex = scheduleSnapshotIndex](contracts/modules/internal/base/SnapshotModuleBase.sol#L328) + [SnapshotModuleBase._currentSnapshotIndex](contracts/modules/internal/base/SnapshotModuleBase.sol#L55) can be used in cross function reentrancies: + - [SnapshotModuleBase._findScheduledMostRecentPastSnapshot()](contracts/modules/internal/base/SnapshotModuleBase.sol#L375-L402) + - [SnapshotModuleBase._setCurrentSnapshot()](contracts/modules/internal/base/SnapshotModuleBase.sol#L321-L330) + - [mint(to,amountToMint)](contracts/modules/CMTAT_BASE.sol#L191) + - [_currentSnapshotTime = scheduleSnapshotTime](contracts/modules/internal/base/SnapshotModuleBase.sol#L327) + [SnapshotModuleBase._currentSnapshotTime](contracts/modules/internal/base/SnapshotModuleBase.sol#L53) can be used in cross function reentrancies: + - [SnapshotModuleBase._setCurrentSnapshot()](contracts/modules/internal/base/SnapshotModuleBase.sol#L321-L330) + - [SnapshotModuleBase._updateSnapshot(SnapshotModuleBase.Snapshots,uint256)](contracts/modules/internal/base/SnapshotModuleBase.sol#L305-L314) + - [SnapshotModuleBase.getNextSnapshots()](contracts/modules/internal/base/SnapshotModuleBase.sol#L82-L111) + +contracts/modules/CMTAT_BASE.sol#L189-L192 + +## uninitialized-local + +> The concerned variable local `mostRecent` is initialized in the loop + +Impact: Medium +Confidence: Medium + + - [ ] ID-2 +[SnapshotModuleBase._findScheduledMostRecentPastSnapshot().mostRecent](contracts/modules/internal/base/SnapshotModuleBase.sol#L389) is a local variable never initialized + +contracts/modules/internal/base/SnapshotModuleBase.sol#L389 + +## missing-zero-check + +> Mock: not intended to be used in production + +Impact: Low +Confidence: Medium + + + - [ ] ID-4 + [AuthorizationEngineMock.authorizeAdminChange(address).newAdmin](contracts/mocks/AuthorizationEngineMock.sol#L21) lacks a zero-check on : + - [nextAdmin = newAdmin](contracts/mocks/AuthorizationEngineMock.sol#L22) + +contracts/mocks/AuthorizationEngineMock.sol#L21 + +## calls-loop + +>Mock: not intended to be used in production +>ValidationModuleInternal: the loop happens only for batch function. A relevant alternative could be the creation of a batch function for the RuleEngine, but for the moment we don't have an implemented solution. + +Impact: Low +Confidence: Medium + + - [ ] ID-5 +[RuleEngineMock.messageForTransferRestriction(uint8)](contracts/mocks/RuleEngine/RuleEngineMock.sol#L83-L97) has external calls inside a loop: [_rules[i].canReturnTransferRestrictionCode(_restrictionCode)](contracts/mocks/RuleEngine/RuleEngineMock.sol#L88) + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L83-L97 + + + - [ ] ID-6 +[RuleEngineMock.messageForTransferRestriction(uint8)](contracts/mocks/RuleEngine/RuleEngineMock.sol#L83-L97) has external calls inside a loop: [_rules[i].messageForTransferRestriction(_restrictionCode)](contracts/mocks/RuleEngine/RuleEngineMock.sol#L89-L90) + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L83-L97 + + + - [ ] ID-7 +[ValidationModuleInternal._operateOnTransfer(address,address,uint256)](contracts/modules/internal/ValidationModuleInternal.sol#L64-L66) has external calls inside a loop: [ruleEngine.operateOnTransfer(from,to,amount)](contracts/modules/internal/ValidationModuleInternal.sol#L65) + +contracts/modules/internal/ValidationModuleInternal.sol#L64-L66 + + + - [ ] ID-8 +[RuleEngineMock.detectTransferRestriction(address,address,uint256)](contracts/mocks/RuleEngine/RuleEngineMock.sol#L39-L59) has external calls inside a loop: [restriction = _rules[i].detectTransferRestriction(_from,_to,_amount)](contracts/mocks/RuleEngine/RuleEngineMock.sol#L46-L50) + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L39-L59 + +## reentrancy-benign + +> Factory contract : It is not a security issue since only authorized user can call the function +> CMTAT_BASE._update: the contract called is a trusted contract (RuleEngine) + +Impact: Low +Confidence: Medium + - [ ] ID-9 + Reentrancy in [CMTAT_BEACON_FACTORY.deployCMTAT(address,IAuthorizationEngine,string,string,uint8,string,string,IRuleEngine,string,uint256)](contracts/deployment/CMTAT_BEACON_FACTORY.sol#L41-L75): + External calls: + - [cmtat = new BeaconProxy(address(beacon),abi.encodeWithSelector(CMTAT_PROXY(address(0)).initialize.selector,admin,authorizationEngineIrrevocable,nameIrrevocable,symbolIrrevocable,decimalsIrrevocable,tokenId_,terms_,ruleEngine_,information_,flag_))](contracts/deployment/CMTAT_BEACON_FACTORY.sol#L54-L69) + State variables written after the call(s): + - [cmtatCounterId ++](contracts/deployment/CMTAT_BEACON_FACTORY.sol#L72) + - [cmtats[cmtatCounterId] = address(cmtat)](contracts/deployment/CMTAT_BEACON_FACTORY.sol#L70) + - [cmtatsList.push(address(cmtat))](contracts/deployment/CMTAT_BEACON_FACTORY.sol#L73) + +contracts/deployment/CMTAT_BEACON_FACTORY.sol#L41-L75 + + + - [ ] ID-10 + Reentrancy in [CMTAT_TP_FACTORY.deployCMTAT(address,address,IAuthorizationEngine,string,string,uint8,string,string,IRuleEngine,string,uint256)](contracts/deployment/CMTAT_TP_FACTORY.sol#L32-L68): + External calls: + - [cmtat = new TransparentUpgradeableProxy(logic,proxyAdminOwner,abi.encodeWithSelector(CMTAT_PROXY(address(0)).initialize.selector,admin,authorizationEngineIrrevocable,nameIrrevocable,symbolIrrevocable,decimalsIrrevocable,tokenId_,terms_,ruleEngine_,information_,flag_))](contracts/deployment/CMTAT_TP_FACTORY.sol#L46-L62) + State variables written after the call(s): + - [cmtatID ++](contracts/deployment/CMTAT_TP_FACTORY.sol#L65) + - [cmtats[cmtatID] = address(cmtat)](contracts/deployment/CMTAT_TP_FACTORY.sol#L63) + - [cmtatsList.push(address(cmtat))](contracts/deployment/CMTAT_TP_FACTORY.sol#L66) + +contracts/deployment/CMTAT_TP_FACTORY.sol#L32-L68 + + + - [ ] ID-11 + Reentrancy in [CMTAT_BASE._update(address,address,uint256)](contracts/modules/CMTAT_BASE.sol#L198-L213): + External calls: + - [! ValidationModule._operateOnTransfer(from,to,amount)](contracts/modules/CMTAT_BASE.sol#L203) + - [ruleEngine.operateOnTransfer(from,to,amount)](contracts/modules/internal/ValidationModuleInternal.sol#L65) + State variables written after the call(s): + - [ERC20SnapshotModuleInternal._snapshotUpdate(from,to)](contracts/modules/CMTAT_BASE.sol#L211) + - [_currentSnapshotIndex = scheduleSnapshotIndex](contracts/modules/internal/base/SnapshotModuleBase.sol#L328) + - [ERC20SnapshotModuleInternal._snapshotUpdate(from,to)](contracts/modules/CMTAT_BASE.sol#L211) + - [_currentSnapshotTime = scheduleSnapshotTime](contracts/modules/internal/base/SnapshotModuleBase.sol#L327) + +contracts/modules/CMTAT_BASE.sol#L198-L213 + +## reentrancy-events + +> It is not a security issue since only authorized user can call the function + +Impact: Low +Confidence: Medium + - [ ] ID-12 + Reentrancy in [CMTAT_TP_FACTORY.deployCMTAT(address,address,IAuthorizationEngine,string,string,uint8,string,string,IRuleEngine,string,uint256)](contracts/deployment/CMTAT_TP_FACTORY.sol#L32-L68): + External calls: + - [cmtat = new TransparentUpgradeableProxy(logic,proxyAdminOwner,abi.encodeWithSelector(CMTAT_PROXY(address(0)).initialize.selector,admin,authorizationEngineIrrevocable,nameIrrevocable,symbolIrrevocable,decimalsIrrevocable,tokenId_,terms_,ruleEngine_,information_,flag_))](contracts/deployment/CMTAT_TP_FACTORY.sol#L46-L62) + Event emitted after the call(s): + - [CMTAT(address(cmtat),cmtatID)](contracts/deployment/CMTAT_TP_FACTORY.sol#L64) + +contracts/deployment/CMTAT_TP_FACTORY.sol#L32-L68 + + + - [ ] ID-13 + Reentrancy in [CMTAT_BEACON_FACTORY.deployCMTAT(address,IAuthorizationEngine,string,string,uint8,string,string,IRuleEngine,string,uint256)](contracts/deployment/CMTAT_BEACON_FACTORY.sol#L41-L75): + External calls: + - [cmtat = new BeaconProxy(address(beacon),abi.encodeWithSelector(CMTAT_PROXY(address(0)).initialize.selector,admin,authorizationEngineIrrevocable,nameIrrevocable,symbolIrrevocable,decimalsIrrevocable,tokenId_,terms_,ruleEngine_,information_,flag_))](contracts/deployment/CMTAT_BEACON_FACTORY.sol#L54-L69) + Event emitted after the call(s): + - [CMTAT(address(cmtat),cmtatCounterId)](contracts/deployment/CMTAT_BEACON_FACTORY.sol#L71) + +contracts/deployment/CMTAT_BEACON_FACTORY.sol#L41-L75 + +## timestamp + +> With the Proof of Work, it was possible for a miner to modify the timestamp in a range of about 15 seconds +> +> With the Proof Of Stake, a new block is created every 12 seconds +> +> In all cases, we are not looking for such precision + +Impact: Low +Confidence: Medium + - [ ] ID-14 + [SnapshotModuleBase._scheduleSnapshotNotOptimized(uint256)](contracts/modules/internal/base/SnapshotModuleBase.sol#L149-L177) uses timestamp for comparisons + Dangerous comparisons: + - [time <= block.timestamp](contracts/modules/internal/base/SnapshotModuleBase.sol#L150) + +contracts/modules/internal/base/SnapshotModuleBase.sol#L149-L177 + + + - [ ] ID-15 + [SnapshotModuleBase._rescheduleSnapshot(uint256,uint256)](contracts/modules/internal/base/SnapshotModuleBase.sol#L182-L223) uses timestamp for comparisons + Dangerous comparisons: + - [oldTime <= block.timestamp](contracts/modules/internal/base/SnapshotModuleBase.sol#L184) + - [newTime <= block.timestamp](contracts/modules/internal/base/SnapshotModuleBase.sol#L187) + +contracts/modules/internal/base/SnapshotModuleBase.sol#L182-L223 + + + - [ ] ID-16 + [SnapshotModuleBase._unscheduleSnapshotNotOptimized(uint256)](contracts/modules/internal/base/SnapshotModuleBase.sol#L250-L263) uses timestamp for comparisons + Dangerous comparisons: + - [time <= block.timestamp](contracts/modules/internal/base/SnapshotModuleBase.sol#L251) + +contracts/modules/internal/base/SnapshotModuleBase.sol#L250-L263 + + + - [ ] ID-17 + [SnapshotModuleBase._scheduleSnapshot(uint256)](contracts/modules/internal/base/SnapshotModuleBase.sol#L118-L144) uses timestamp for comparisons + Dangerous comparisons: + - [time <= block.timestamp](contracts/modules/internal/base/SnapshotModuleBase.sol#L120) + +contracts/modules/internal/base/SnapshotModuleBase.sol#L118-L144 + + + - [ ] ID-18 + [SnapshotModuleBase._unscheduleLastSnapshot(uint256)](contracts/modules/internal/base/SnapshotModuleBase.sol#L228-L242) uses timestamp for comparisons + Dangerous comparisons: + - [time <= block.timestamp](contracts/modules/internal/base/SnapshotModuleBase.sol#L230) + +contracts/modules/internal/base/SnapshotModuleBase.sol#L228-L242 + + + - [ ] ID-19 + [SnapshotModuleBase._findScheduledMostRecentPastSnapshot()](contracts/modules/internal/base/SnapshotModuleBase.sol#L375-L402) uses timestamp for comparisons + Dangerous comparisons: + - [_scheduledSnapshots[i] <= block.timestamp](contracts/modules/internal/base/SnapshotModuleBase.sol#L393) + +contracts/modules/internal/base/SnapshotModuleBase.sol#L375-L402 + +## costly-loop + +> Inside the function, these two operations are not performed inside a loop. +> +> It seems that the only loops which calls`setCurrentSnapshot`are inside the batch functions(mintBatch, burnBatch, ...) through a call to the function update. +> At the moment, there is no trivial solution to resolve this. + +Impact: Informational +Confidence: Medium + - [ ] ID-20 + [SnapshotModuleBase._setCurrentSnapshot()](contracts/modules/internal/base/SnapshotModuleBase.sol#L321-L330) has costly operations inside a loop: + - [_currentSnapshotTime = scheduleSnapshotTime](contracts/modules/internal/base/SnapshotModuleBase.sol#L327) + +contracts/modules/internal/base/SnapshotModuleBase.sol#L321-L330 + + + - [ ] ID-21 + [SnapshotModuleBase._setCurrentSnapshot()](contracts/modules/internal/base/SnapshotModuleBase.sol#L321-L330) has costly operations inside a loop: + - [_currentSnapshotIndex = scheduleSnapshotIndex](contracts/modules/internal/base/SnapshotModuleBase.sol#L328) + +contracts/modules/internal/base/SnapshotModuleBase.sol#L321-L330 + +## dead-code + +> - Implemented to be gasless compatible (see MetaTxModule) +> +> - If we remove this function, we will have the following error: +> +> "Derived contract must override function "_msgData". Two or more base classes define function with same name and parameter types." + +Impact: Informational +Confidence: Medium + + - [ ] ID-22 +[CMTAT_BASE._msgData()](contracts/modules/CMTAT_BASE.sol#L240-L247) is never used and should be removed + +contracts/modules/CMTAT_BASE.sol#L240-L247 + +## solc-version + +> The version set in the config file is 0.8.22 + +Impact: Informational +Confidence: High + - [ ] ID-23 + Version constraint ^0.8.20 contains known severe issues (https://solidity.readthedocs.io/en/latest/bugs.html) + - VerbatimInvalidDeduplication + - FullInlinerNonExpressionSplitArgumentEvaluationOrder + - MissingSideEffectsOnSelectorAccess. + It is used by: + - node_modules/@openzeppelin/contracts/access/AccessControl.sol#4 + - node_modules/@openzeppelin/contracts/access/IAccessControl.sol#4 + - node_modules/@openzeppelin/contracts/access/Ownable.sol#4 + - node_modules/@openzeppelin/contracts/interfaces/IERC1967.sol#4 + - node_modules/@openzeppelin/contracts/interfaces/IERC5267.sol#4 + - node_modules/@openzeppelin/contracts/interfaces/draft-IERC6093.sol#3 + - node_modules/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol#4 + - node_modules/@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol#4 + - node_modules/@openzeppelin/contracts/proxy/Proxy.sol#4 + - node_modules/@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol#4 + - node_modules/@openzeppelin/contracts/proxy/beacon/IBeacon.sol#4 + - node_modules/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol#4 + - node_modules/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol#4 + - node_modules/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol#4 + - node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol#4 + - node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol#4 + - node_modules/@openzeppelin/contracts/utils/Address.sol#4 + - node_modules/@openzeppelin/contracts/utils/Arrays.sol#4 + - node_modules/@openzeppelin/contracts/utils/Context.sol#4 + - node_modules/@openzeppelin/contracts/utils/StorageSlot.sol#5 + - node_modules/@openzeppelin/contracts/utils/Strings.sol#4 + - node_modules/@openzeppelin/contracts/utils/cryptography/ECDSA.sol#4 + - node_modules/@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol#4 + - node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol#4 + - node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol#4 + - node_modules/@openzeppelin/contracts/utils/math/Math.sol#4 + - node_modules/@openzeppelin/contracts/utils/math/SignedMath.sol#4 + - contracts/CMTAT_PROXY.sol#3 + - contracts/CMTAT_STANDALONE.sol#3 + - contracts/deployment/CMTAT_BEACON_FACTORY.sol#2 + - contracts/deployment/CMTAT_TP_FACTORY.sol#2 + - contracts/interfaces/ICCIPToken.sol#3 + - contracts/interfaces/ICMTATSnapshot.sol#3 + - contracts/interfaces/IDebtGlobal.sol#3 + - contracts/interfaces/draft-IERC1404/draft-IERC1404.sol#3 + - contracts/interfaces/draft-IERC1404/draft-IERC1404EnumCode.sol#3 + - contracts/interfaces/draft-IERC1404/draft-IERC1404Wrapper.sol#3 + - contracts/interfaces/engine/IAuthorizationEngine.sol#3 + - contracts/interfaces/engine/IRuleEngine.sol#3 + - contracts/libraries/Errors.sol#3 + - contracts/mocks/AuthorizationEngineMock.sol#3 + - contracts/mocks/MinimalForwarderMock.sol#3 + - contracts/mocks/RuleEngine/CodeList.sol#3 + - contracts/mocks/RuleEngine/RuleEngineMock.sol#3 + - contracts/mocks/RuleEngine/RuleMock.sol#3 + - contracts/mocks/RuleEngine/interfaces/IRule.sol#3 + - contracts/mocks/RuleEngine/interfaces/IRuleEngineMock.sol#3 + - contracts/modules/CMTAT_BASE.sol#3 + - contracts/modules/internal/ERC20SnapshotModuleInternal.sol#3 + - contracts/modules/internal/EnforcementModuleInternal.sol#3 + - contracts/modules/internal/ValidationModuleInternal.sol#3 + - contracts/modules/internal/base/SnapshotModuleBase.sol#3 + - contracts/modules/security/AuthorizationModule.sol#3 + - contracts/modules/wrapper/controllers/ValidationModule.sol#3 + - contracts/modules/wrapper/core/BaseModule.sol#3 + - contracts/modules/wrapper/core/ERC20BaseModule.sol#3 + - contracts/modules/wrapper/core/ERC20BurnModule.sol#3 + - contracts/modules/wrapper/core/ERC20MintModule.sol#3 + - contracts/modules/wrapper/core/EnforcementModule.sol#3 + - contracts/modules/wrapper/core/PauseModule.sol#3 + - contracts/modules/wrapper/extensions/DebtModule/CreditEventsModule.sol#3 + - contracts/modules/wrapper/extensions/DebtModule/DebtBaseModule.sol#3 + - contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol#3 + - contracts/modules/wrapper/extensions/MetaTxModule.sol#3 + - contracts/test/proxy/CMTAT_PROXY.sol#3 + - openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol#4 + - openzeppelin-contracts-upgradeable/contracts/metatx/ERC2771ContextUpgradeable.sol#4 + - openzeppelin-contracts-upgradeable/contracts/metatx/ERC2771ForwarderUpgradeable.sol#4 + - openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol#4 + - openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol#4 + - openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol#4 + - openzeppelin-contracts-upgradeable/contracts/utils/NoncesUpgradeable.sol#3 + - openzeppelin-contracts-upgradeable/contracts/utils/PausableUpgradeable.sol#4 + - openzeppelin-contracts-upgradeable/contracts/utils/cryptography/EIP712Upgradeable.sol#4 + - openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165Upgradeable.sol#4 + +## naming-convention + +> It is not really necessary to rename all the variables. It will generate a lot of work for a minor improvement. + +Impact: Informational +Confidence: High + + - [ ] ID-24 +Enum [IERC1404EnumCode.REJECTED_CODE_BASE](contracts/interfaces/draft-IERC1404/draft-IERC1404EnumCode.sol#L9-L14) is not in CapWords + +contracts/interfaces/draft-IERC1404/draft-IERC1404EnumCode.sol#L9-L14 + + + - [ ] ID-25 +Variable [CreditEventsModule.__gap](contracts/modules/wrapper/extensions/DebtModule/CreditEventsModule.sol#L83) is not in mixedCase + +contracts/modules/wrapper/extensions/DebtModule/CreditEventsModule.sol#L83 + + + - [ ] ID-26 +Parameter [RuleEngineMock.detectTransferRestriction(address,address,uint256)._amount](contracts/mocks/RuleEngine/RuleEngineMock.sol#L42) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L42 + + + - [ ] ID-27 +Contract [CMTAT_PROXY](contracts/CMTAT_PROXY.sol#L7-L21) is not in CapWords + +contracts/CMTAT_PROXY.sol#L7-L21 + + + - [ ] ID-28 +Function [PauseModule.__PauseModule_init_unchained()](contracts/modules/wrapper/core/PauseModule.sol#L26-L28) is not in mixedCase + +contracts/modules/wrapper/core/PauseModule.sol#L26-L28 + + + - [ ] ID-29 +Function [CreditEventsModule.__CreditEvents_init_unchained()](contracts/modules/wrapper/extensions/DebtModule/CreditEventsModule.sol#L28-L30) is not in mixedCase + +contracts/modules/wrapper/extensions/DebtModule/CreditEventsModule.sol#L28-L30 + + + - [ ] ID-30 +Variable [CMTAT_BASE.__gap](contracts/modules/CMTAT_BASE.sol#L249) is not in mixedCase + +contracts/modules/CMTAT_BASE.sol#L249 + + + - [ ] ID-31 +Function [EnforcementModuleInternal.__Enforcement_init_unchained()](contracts/modules/internal/EnforcementModuleInternal.sol#L40-L42) is not in mixedCase + +contracts/modules/internal/EnforcementModuleInternal.sol#L40-L42 + + + - [ ] ID-32 +Variable [ValidationModuleInternal.__gap](contracts/modules/internal/ValidationModuleInternal.sol#L68) is not in mixedCase + +contracts/modules/internal/ValidationModuleInternal.sol#L68 + + + - [ ] ID-33 +Function [ERC20BurnModule.__ERC20BurnModule_init_unchained()](contracts/modules/wrapper/core/ERC20BurnModule.sol#L19-L21) is not in mixedCase + +contracts/modules/wrapper/core/ERC20BurnModule.sol#L19-L21 + + + - [ ] ID-34 +Function [ValidationModuleInternal.__Validation_init_unchained(IRuleEngine)](contracts/modules/internal/ValidationModuleInternal.sol#L24-L31) is not in mixedCase + +contracts/modules/internal/ValidationModuleInternal.sol#L24-L31 + + + - [ ] ID-35 +Variable [BaseModule.__gap](contracts/modules/wrapper/core/BaseModule.sol#L94) is not in mixedCase + +contracts/modules/wrapper/core/BaseModule.sol#L94 + + + - [ ] ID-36 +Variable [ValidationModule.__gap](contracts/modules/wrapper/controllers/ValidationModule.sol#L136) is not in mixedCase + +contracts/modules/wrapper/controllers/ValidationModule.sol#L136 + + + - [ ] ID-37 +Variable [EnforcementModule.__gap](contracts/modules/wrapper/core/EnforcementModule.sol#L55) is not in mixedCase + +contracts/modules/wrapper/core/EnforcementModule.sol#L55 + + + - [ ] ID-38 +Contract [CMTAT_STANDALONE](contracts/CMTAT_STANDALONE.sol#L7-L53) is not in CapWords + +contracts/CMTAT_STANDALONE.sol#L7-L53 + + + - [ ] ID-39 +Variable [DebtBaseModule.__gap](contracts/modules/wrapper/extensions/DebtModule/DebtBaseModule.sol#L232) is not in mixedCase + +contracts/modules/wrapper/extensions/DebtModule/DebtBaseModule.sol#L232 + + + - [ ] ID-40 +Variable [AuthorizationModule.__gap](contracts/modules/security/AuthorizationModule.sol#L85) is not in mixedCase + +contracts/modules/security/AuthorizationModule.sol#L85 + + + - [ ] ID-41 +Parameter [RuleEngineMock.operateOnTransfer(address,address,uint256)._to](contracts/mocks/RuleEngine/RuleEngineMock.sol#L74) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L74 + + + - [ ] ID-42 +Parameter [RuleEngineMock.validateTransfer(address,address,uint256)._amount](contracts/mocks/RuleEngine/RuleEngineMock.sol#L64) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L64 + + + - [ ] ID-43 +Parameter [RuleEngineMock.operateOnTransfer(address,address,uint256)._from](contracts/mocks/RuleEngine/RuleEngineMock.sol#L73) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L73 + + + - [ ] ID-44 +Parameter [RuleMock.validateTransfer(address,address,uint256)._to](contracts/mocks/RuleEngine/RuleMock.sol#L14) is not in mixedCase + +contracts/mocks/RuleEngine/RuleMock.sol#L14 + + + - [ ] ID-45 +Parameter [RuleEngineMock.operateOnTransfer(address,address,uint256)._amount](contracts/mocks/RuleEngine/RuleEngineMock.sol#L75) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L75 + + + - [ ] ID-46 +Variable [EnforcementModuleInternal.__gap](contracts/modules/internal/EnforcementModuleInternal.sol#L87) is not in mixedCase + +contracts/modules/internal/EnforcementModuleInternal.sol#L87 + + + - [ ] ID-47 +Parameter [RuleMock.canReturnTransferRestrictionCode(uint8)._restrictionCode](contracts/mocks/RuleEngine/RuleMock.sol#L35) is not in mixedCase + +contracts/mocks/RuleEngine/RuleMock.sol#L35 + + + - [ ] ID-48 +Variable [SnapshotModuleBase.__gap](contracts/modules/internal/base/SnapshotModuleBase.sol#L404) is not in mixedCase + +contracts/modules/internal/base/SnapshotModuleBase.sol#L404 + + + - [ ] ID-49 +Parameter [RuleEngineMock.validateTransfer(address,address,uint256)._to](contracts/mocks/RuleEngine/RuleEngineMock.sol#L63) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L63 + + + - [ ] ID-50 +Function [BaseModule.__Base_init_unchained(string,string,string,uint256)](contracts/modules/wrapper/core/BaseModule.sol#L40-L50) is not in mixedCase + +contracts/modules/wrapper/core/BaseModule.sol#L40-L50 + + + - [ ] ID-51 +Function [AuthorizationModule.__AuthorizationModule_init_unchained(address,IAuthorizationEngine)](contracts/modules/security/AuthorizationModule.sol#L22-L33) is not in mixedCase + +contracts/modules/security/AuthorizationModule.sol#L22-L33 + + + - [ ] ID-52 +Parameter [RuleEngineMock.validateTransfer(address,address,uint256)._from](contracts/mocks/RuleEngine/RuleEngineMock.sol#L62) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L62 + + + - [ ] ID-53 +Parameter [RuleMock.validateTransfer(address,address,uint256)._amount](contracts/mocks/RuleEngine/RuleMock.sol#L15) is not in mixedCase + +contracts/mocks/RuleEngine/RuleMock.sol#L15 + + + - [ ] ID-54 +Variable [PauseModule.__gap](contracts/modules/wrapper/core/PauseModule.sol#L83) is not in mixedCase + +contracts/modules/wrapper/core/PauseModule.sol#L83 + + + - [ ] ID-55 +Function [CMTAT_BASE.__CMTAT_init_unchained()](contracts/modules/CMTAT_BASE.sol#L148-L150) is not in mixedCase + +contracts/modules/CMTAT_BASE.sol#L148-L150 + + + - [ ] ID-56 +Variable [ERC20SnapshotModule.__gap](contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol#L77) is not in mixedCase + +contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol#L77 + + + - [ ] ID-57 +Parameter [RuleMock.detectTransferRestriction(address,address,uint256)._amount](contracts/mocks/RuleEngine/RuleMock.sol#L26) is not in mixedCase + +contracts/mocks/RuleEngine/RuleMock.sol#L26 + + + - [ ] ID-58 +Function [ERC20BaseModule.__ERC20BaseModule_init_unchained(uint8)](contracts/modules/wrapper/core/ERC20BaseModule.sol#L28-L32) is not in mixedCase + +contracts/modules/wrapper/core/ERC20BaseModule.sol#L28-L32 + + + - [ ] ID-59 +Parameter [RuleMock.messageForTransferRestriction(uint8)._restrictionCode](contracts/mocks/RuleEngine/RuleMock.sol#L41) is not in mixedCase + +contracts/mocks/RuleEngine/RuleMock.sol#L41 + + + - [ ] ID-60 +Function [CMTAT_BASE.__CMTAT_init(address,IAuthorizationEngine,string,string,uint8,string,string,IRuleEngine,string,uint256)](contracts/modules/CMTAT_BASE.sol#L87-L146) is not in mixedCase + +contracts/modules/CMTAT_BASE.sol#L87-L146 + + + - [ ] ID-61 +Function [ERC20MintModule.__ERC20MintModule_init_unchained()](contracts/modules/wrapper/core/ERC20MintModule.sol#L17-L19) is not in mixedCase + +contracts/modules/wrapper/core/ERC20MintModule.sol#L17-L19 + + + - [ ] ID-62 +Parameter [RuleEngineMock.detectTransferRestriction(address,address,uint256)._to](contracts/mocks/RuleEngine/RuleEngineMock.sol#L41) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L41 + + + - [ ] ID-63 +Variable [MetaTxModule.__gap](contracts/modules/wrapper/extensions/MetaTxModule.sol#L22) is not in mixedCase + +contracts/modules/wrapper/extensions/MetaTxModule.sol#L22 + + + - [ ] ID-64 +Function [SnapshotModuleBase.__SnapshotModuleBase_init_unchained()](contracts/modules/internal/base/SnapshotModuleBase.sol#L64-L67) is not in mixedCase + +contracts/modules/internal/base/SnapshotModuleBase.sol#L64-L67 + + + - [ ] ID-65 +Variable [ERC20BurnModule.__gap](contracts/modules/wrapper/core/ERC20BurnModule.sol#L113) is not in mixedCase + +contracts/modules/wrapper/core/ERC20BurnModule.sol#L113 + + + - [ ] ID-66 +Variable [ERC20BaseModule.__gap](contracts/modules/wrapper/core/ERC20BaseModule.sol#L113) is not in mixedCase + +contracts/modules/wrapper/core/ERC20BaseModule.sol#L113 + + + - [ ] ID-67 +Contract [CMTAT_BEACON_FACTORY](contracts/deployment/CMTAT_BEACON_FACTORY.sol#L15-L93) is not in CapWords + +contracts/deployment/CMTAT_BEACON_FACTORY.sol#L15-L93 + + + - [ ] ID-68 +Contract [CMTAT_BASE](contracts/modules/CMTAT_BASE.sol#L29-L250) is not in CapWords + +contracts/modules/CMTAT_BASE.sol#L29-L250 + + + - [ ] ID-69 +Parameter [RuleEngineMock.messageForTransferRestriction(uint8)._restrictionCode](contracts/mocks/RuleEngine/RuleEngineMock.sol#L84) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L84 + + + - [ ] ID-70 +Variable [ERC20MintModule.__gap](contracts/modules/wrapper/core/ERC20MintModule.sol#L73) is not in mixedCase + +contracts/modules/wrapper/core/ERC20MintModule.sol#L73 + + + - [ ] ID-71 +Function [ValidationModule.__ValidationModule_init_unchained()](contracts/modules/wrapper/controllers/ValidationModule.sol#L26-L28) is not in mixedCase + +contracts/modules/wrapper/controllers/ValidationModule.sol#L26-L28 + + + - [ ] ID-72 +Function [DebtBaseModule.__DebtBaseModule_init_unchained()](contracts/modules/wrapper/extensions/DebtModule/DebtBaseModule.sol#L60-L62) is not in mixedCase + +contracts/modules/wrapper/extensions/DebtModule/DebtBaseModule.sol#L60-L62 + + + - [ ] ID-73 +Parameter [RuleEngineMock.detectTransferRestriction(address,address,uint256)._from](contracts/mocks/RuleEngine/RuleEngineMock.sol#L40) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L40 + + + - [ ] ID-74 +Function [ERC20SnapshotModule.__ERC20SnasphotModule_init_unchained()](contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol#L20-L22) is not in mixedCase + +contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol#L20-L22 + + + - [ ] ID-75 +Variable [ERC20SnapshotModuleInternal.__gap](contracts/modules/internal/ERC20SnapshotModuleInternal.sol#L140) is not in mixedCase + +contracts/modules/internal/ERC20SnapshotModuleInternal.sol#L140 + + + - [ ] ID-76 +Function [EnforcementModule.__EnforcementModule_init_unchained()](contracts/modules/wrapper/core/EnforcementModule.sol#L25-L27) is not in mixedCase + +contracts/modules/wrapper/core/EnforcementModule.sol#L25-L27 + + + - [ ] ID-77 +Function [ERC20SnapshotModuleInternal.__ERC20Snapshot_init_unchained()](contracts/modules/internal/ERC20SnapshotModuleInternal.sol#L27-L30) is not in mixedCase + +contracts/modules/internal/ERC20SnapshotModuleInternal.sol#L27-L30 + + + - [ ] ID-78 +Contract [CMTAT_TP_FACTORY](contracts/deployment/CMTAT_TP_FACTORY.sol#L11-L78) is not in CapWords + +contracts/deployment/CMTAT_TP_FACTORY.sol#L11-L78 + + + - [ ] ID-79 +Parameter [RuleMock.validateTransfer(address,address,uint256)._from](contracts/mocks/RuleEngine/RuleMock.sol#L13) is not in mixedCase + +contracts/mocks/RuleEngine/RuleMock.sol#L13 + + + - [ ] ID-80 +Variable [CMTAT_PROXY.__gap](contracts/CMTAT_PROXY.sol#L20) is not in mixedCase + +contracts/CMTAT_PROXY.sol#L20 + diff --git a/doc/general/Engine.md b/doc/general/Engine.md index 2f1ef62f..eb7134e2 100644 --- a/doc/general/Engine.md +++ b/doc/general/Engine.md @@ -1,6 +1,11 @@ # Engine -It is possible to add supplementary controls on the CMTAT through two Engines: the `RuleEngine`and the `AuthorizationEngine` +It is possible to add supplementary controls on the CMTAT through four Engines: + +- The `RuleEngine` +- The `AuthorizationEngine` +- The DocumentEngine +- The DebtEngine ## RuleEngine @@ -18,10 +23,6 @@ In this example, the token holder calls the function `transfer` which triggers a - - - - ### Implementation A **ruleEngine** contract has to implement the interface `IRuleEngine`, which inherits from the `IERC1404Wrapper`. These two interfaces defines mainly two functions. diff --git a/doc/general/Proxy.md b/doc/general/Proxy.md index 68e720aa..2a1ed347 100644 --- a/doc/general/Proxy.md +++ b/doc/general/Proxy.md @@ -15,6 +15,12 @@ As indicated in the [OpenZeppelin documentation](https://docs.openzeppelin.com/c > > The function `__{ContractName}_init_unchained` found in every contract is the initializer function minus the calls to parent initializers, and can be used to avoid the double initialization problem, but doing this manually is not recommended. We hope to be able to implement safety checks for this in future versions of the Upgrades Plugins. +## ERC-7201 + +To manage memory and avoid storage collisions, CMTAT implements, like OpenZeppelin, the [ERC-7201](https://eips.ethereum.org/EIPS/eip-7201) + +More information on a [RareSkills article](https://www.rareskills.io/post/erc-7201) + ## Deployment with a proxy The CMTAT supports deployment via a proxy contract. Furthermore, using a proxy permits to upgrade the contract, using a standard proxy upgrade pattern. @@ -26,6 +32,3 @@ Please see the OpenZeppelin [upgradeable contracts documentation](https://docs.o Please see the OpenZeppelin [Upgrades plugins](https://docs.openzeppelin.com/upgrades-plugins/1.x/) for more information about plugin upgrades in general. Note that deployment via a proxy is not mandatory, but is recommended by CMTA. - - -### diff --git a/doc/general/contract-size.png b/doc/general/contract-size.png index 7f1d997a..80fd05d3 100644 Binary files a/doc/general/contract-size.png and b/doc/general/contract-size.png differ diff --git a/doc/general/test/archive/test.odt b/doc/general/test/archive/test.odt deleted file mode 100644 index 8a51c6a0..00000000 Binary files a/doc/general/test/archive/test.odt and /dev/null differ diff --git a/doc/general/test/archive/test.pdf b/doc/general/test/archive/test.pdf deleted file mode 100644 index 2c854383..00000000 Binary files a/doc/general/test/archive/test.pdf and /dev/null differ diff --git a/doc/general/test/coverage/contracts/CMTAT_PROXY.sol.html b/doc/general/test/coverage/contracts/CMTAT_PROXY.sol.html index 3d3cdbd9..18655b87 100644 --- a/doc/general/test/coverage/contracts/CMTAT_PROXY.sol.html +++ b/doc/general/test/coverage/contracts/CMTAT_PROXY.sol.html @@ -78,7 +78,7 @@

      -194× +197×      
//SPDX-License-Identifier: MPL-2.0
@@ -106,7 +106,7 @@ 

diff --git a/doc/general/test/coverage/contracts/CMTAT_PROXY_UUPS.sol.html b/doc/general/test/coverage/contracts/CMTAT_PROXY_UUPS.sol.html index e03ce88e..a46ce9f7 100644 --- a/doc/general/test/coverage/contracts/CMTAT_PROXY_UUPS.sol.html +++ b/doc/general/test/coverage/contracts/CMTAT_PROXY_UUPS.sol.html @@ -92,12 +92,7 @@

47 48 49 -50 -51 -52 -53 -54 -55  +50        @@ -113,8 +108,8 @@

      +   -       @@ -133,30 +128,24 @@

      +       +     -             -  - -  -  -  -   
//SPDX-License-Identifier: MPL-2.0
  
 pragma solidity ^0.8.20;
-import "../openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol";
+import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
 import "./modules/CMTAT_BASE.sol";
-import "./interfaces/engine/IEngine.sol";
 contract CMTAT_PROXY_UUPS is CMTAT_BASE, UUPSUpgradeable {
     bytes32 public constant PROXY_UPGRADE_ROLE = keccak256("PROXY_UPGRADE_ROLE");
     /**
@@ -170,39 +159,35 @@ 

// Disable the possibility to initialize the implementation _disableInitializers(); } +  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @notice * initialize the proxy contract * The calls to this function will revert if the contract was deployed without a proxy * @param admin address of the admin of contract (Access Control) - * @param nameIrrevocable name of the token - * @param symbolIrrevocable name of the symbol - * @param decimalsIrrevocable number of decimals of the token, must be 0 to be compliant with Swiss law as per CMTAT specifications (non-zero decimal number may be needed for other use cases) - * @param tokenId_ name of the tokenId - * @param terms_ terms associated with the token - * @param information_ additional information to describe the token - * @param engines list of engines + * @param ERC20Attributes_ ERC20 name, symbol and decimals + * @param baseModuleAttributes_ tokenId, terms, information + * @param engines_ external contract */ function initialize( address admin, - string memory nameIrrevocable, - string memory symbolIrrevocable, - uint8 decimalsIrrevocable, - string memory tokenId_, - string memory terms_, - string memory information_, - IEngine.Engine memory engines) public override Einitializer { + ICMTATConstructor.ERC20Attributes memory ERC20Attributes_, + ICMTATConstructor.BaseModuleAttributes memory baseModuleAttributes_, + ICMTATConstructor.Engine memory engines_ ) public override Einitializer { CMTAT_BASE.initialize( admin, - nameIrrevocable, - symbolIrrevocable, - decimalsIrrevocable, - tokenId_, - terms_, - information_, - engines); + ERC20Attributes_, + baseModuleAttributes_, + engines_); __UUPSUpgradeable_init_unchained(); }   +  + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ function _authorizeUpgrade(address) internal override onlyRole(PROXY_UPGRADE_ROLE) {} }  

@@ -211,7 +196,7 @@

diff --git a/doc/general/test/coverage/contracts/CMTAT_STANDALONE.sol.html b/doc/general/test/coverage/contracts/CMTAT_STANDALONE.sol.html index 7480fbc7..016d674d 100644 --- a/doc/general/test/coverage/contracts/CMTAT_STANDALONE.sol.html +++ b/doc/general/test/coverage/contracts/CMTAT_STANDALONE.sol.html @@ -76,27 +76,7 @@

31 32 33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46  -  -  -  -  -  -  -  -  +34        @@ -129,10 +109,6 @@

      -  -  -  -   
//SPDX-License-Identifier: MPL-2.0
  
 pragma solidity ^0.8.20;
@@ -144,37 +120,25 @@ 

* @notice Contract version for standalone deployment * @param forwarderIrrevocable address of the forwarder, required for the gasless support * @param admin address of the admin of contract (Access Control) - * @param authorizationEngineIrrevocable - * @param nameIrrevocable name of the token - * @param symbolIrrevocable name of the symbol - * @param decimalsIrrevocable number of decimals used to get its user representation, should be 0 to be compliant with the CMTAT specifications. - * @param tokenId_ name of the tokenId - * @param terms_ terms associated with the token - * @param information_ additional information to describe the token + * @param ERC20Attributes_ ERC20 name, symbol and decimals + * @param baseModuleAttributes_ tokenId, terms, information + * @param engines_ external contract */ /// @custom:oz-upgrades-unsafe-allow constructor constructor( address forwarderIrrevocable, address admin, - string memory nameIrrevocable, - string memory symbolIrrevocable, - uint8 decimalsIrrevocable, - string memory tokenId_, - string memory terms_, - string memory information_, - IEngine.Engine memory engine_ + ICMTATConstructor.ERC20Attributes memory ERC20Attributes_, + ICMTATConstructor.BaseModuleAttributes memory baseModuleAttributes_, + ICMTATConstructor.Engine memory engines_ ) MetaTxModule(forwarderIrrevocable) { // Initialize the contract to avoid front-running // Warning : do not initialize the proxy initialize( admin, - nameIrrevocable, - symbolIrrevocable, - decimalsIrrevocable, - tokenId_, - terms_, - information_, - engine_ + ERC20Attributes_, + baseModuleAttributes_, + engines_ ); } } @@ -184,7 +148,7 @@

diff --git a/doc/general/test/coverage/contracts/deployment/CMTAT_BEACON_FACTORY.sol.html b/doc/general/test/coverage/contracts/deployment/CMTAT_BEACON_FACTORY.sol.html index 2c7a0047..a9f007e0 100644 --- a/doc/general/test/coverage/contracts/deployment/CMTAT_BEACON_FACTORY.sol.html +++ b/doc/general/test/coverage/contracts/deployment/CMTAT_BEACON_FACTORY.sol.html @@ -22,22 +22,22 @@

100% Statements - 10/10 + 13/13
100% Branches - 8/8 + 6/6
100% Functions - 4/4 + 6/6
100% Lines - 17/17 + 21/21
@@ -141,8 +141,11 @@

96 97 98 -99  -  +99 +100 +101 +102 +103        @@ -166,30 +169,30 @@

      + +   + +   +             - -   - -   - -   - - -     + +     + +       @@ -201,6 +204,7 @@

      +     @@ -210,6 +214,13 @@

      + + + + + + +       @@ -217,19 +228,16 @@

      - - - - -     +           - +  +       @@ -247,34 +255,22 @@

import '@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol'; import "../CMTAT_PROXY.sol"; import "../modules/CMTAT_BASE.sol"; -import "../libraries/FactoryErrors.sol"; -import '@openzeppelin/contracts/access/AccessControl.sol'; -import "../interfaces/engine/IEngine.sol"; +import "./libraries/CMTATFactoryRoot.sol"; +    /** * @notice Factory to deploy beacon proxy * */ -contract CMTAT_BEACON_FACTORY is AccessControl { - // Private - mapping(uint256 => address) private cmtats; - uint256 private cmtatCounterId; +contract CMTAT_BEACON_FACTORY is AccessControl, CMTATFactoryRoot { // public - /// @dev Role to deploy CMTAT - bytes32 public constant CMTAT_DEPLOYER_ROLE = keccak256("CMTAT_DEPLOYER_ROLE"); UpgradeableBeacon public immutable beacon; - address[] public cmtatsList; - event CMTAT(address indexed CMTAT, uint256 id); -  /** * @param implementation_ contract implementation * @param factoryAdmin admin * @param beaconOwner owner */ - constructor(address implementation_, address factoryAdmin, address beaconOwner) { - if(factoryAdmin == address(0)){ - revert FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForFactoryAdmin(); - } + constructor(address implementation_, address factoryAdmin, address beaconOwner, bool useCustomSalt_)CMTATFactoryRoot(factoryAdmin, useCustomSalt_) { if(beaconOwner == address(0)){ revert FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForBeaconOwner(); } @@ -282,8 +278,6 @@

revert FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForLogicContract(); } beacon = new UpgradeableBeacon(implementation_, beaconOwner); - _grantRole(DEFAULT_ADMIN_ROLE, factoryAdmin); - _grantRole(CMTAT_DEPLOYER_ROLE, factoryAdmin); }   /** @@ -291,44 +285,62 @@

* */ function deployCMTAT( + bytes32 deploymentSaltInput, // CMTAT function initialize - address admin, - string memory nameIrrevocable, - string memory symbolIrrevocable, - uint8 decimalsIrrevocable, - string memory tokenId_, - string memory terms_, - string memory information_, - IEngine.Engine memory engines + CMTAT_ARGUMENT calldata cmtatArgument ) public onlyRole(CMTAT_DEPLOYER_ROLE) returns(BeaconProxy cmtat) { - cmtat = new BeaconProxy( - address(beacon), - abi.encodeWithSelector( - CMTAT_PROXY(address(0)).initialize.selector, - admin, - nameIrrevocable, - symbolIrrevocable, - decimalsIrrevocable, - tokenId_, - terms_, - information_, - engines - ) - ); - cmtats[cmtatCounterId] = address(cmtat); - emit CMTAT(address(cmtat), cmtatCounterId); - cmtatCounterId++; - cmtatsList.push(address(cmtat)); + bytes32 deploymentSalt = _checkAndDetermineDeploymentSalt(deploymentSaltInput); + bytes memory bytecode = _getBytecode( + // CMTAT function initialize + cmtatArgument); + cmtat = _deployBytecode(bytecode, deploymentSalt); return cmtat; }   /** - * @notice get CMTAT proxy address - * + * @param deploymentSalt salt for the deployment + * @param cmtatArgument argument for the function initialize + * @notice get the proxy address depending on a particular salt */ - function getCMTATAddress(uint256 cmtatID_) external view returns (address) { - return cmtats[cmtatID_]; + function computedProxyAddress( + bytes32 deploymentSalt, + // CMTAT function initialize + CMTAT_ARGUMENT calldata cmtatArgument) public view returns (address) { + bytes memory bytecode = _getBytecode( + // CMTAT function initialize + cmtatArgument); + return Create2.computeAddress(deploymentSalt, keccak256(bytecode), address(this) ); } +  + /** + * @notice Deploy CMTAT and push the created CMTAT in the list + */ + function _deployBytecode(bytes memory bytecode, bytes32 deploymentSalt) internal returns (BeaconProxy cmtat) { + address cmtatAddress = Create2.deploy(0, deploymentSalt, bytecode); + cmtat = BeaconProxy(payable(cmtatAddress)); + cmtats[cmtatCounterId] = address(cmtat); + emit CMTAT(address(cmtat), cmtatCounterId); + ++cmtatCounterId; + cmtatsList.push(address(cmtat)); + return cmtat; + } +  + + /** + * @notice return the smart contract bytecode + */ + function _getBytecode( + // CMTAT function initialize + CMTAT_ARGUMENT calldata cmtatArgument) internal view returns(bytes memory bytecode) { + bytes memory _implementation = abi.encodeWithSelector( + CMTAT_PROXY(address(0)).initialize.selector, + cmtatArgument.CMTATAdmin, + cmtatArgument.ERC20Attributes, + cmtatArgument.baseModuleAttributes, + cmtatArgument.engines + ); + bytecode = abi.encodePacked(type(BeaconProxy).creationCode, abi.encode(address(beacon), _implementation)); + }   /** * @notice get the implementation address from the beacon @@ -343,7 +355,7 @@

diff --git a/doc/general/test/coverage/contracts/deployment/CMTAT_TP_FACTORY.sol.html b/doc/general/test/coverage/contracts/deployment/CMTAT_TP_FACTORY.sol.html index 8962d89e..0508c5a1 100644 --- a/doc/general/test/coverage/contracts/deployment/CMTAT_TP_FACTORY.sol.html +++ b/doc/general/test/coverage/contracts/deployment/CMTAT_TP_FACTORY.sol.html @@ -22,22 +22,22 @@

100% Statements - 19/19 + 10/10
100% Branches - 12/12 + 2/2
100% Functions - 8/8 + 5/5
100% Lines - 32/32 + 15/15
@@ -123,100 +123,7 @@

78 79 80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174  +81        @@ -241,48 +148,6 @@

      -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  - - -  - - -  - - - -  -  -  -  -  -  -  -  -  -  -    @@ -313,32 +178,6 @@

      -  - -  -  -  -  -  -  -  -  - - - -  - - -  -  - -  -  -  -  -  -  -  @@ -362,33 +201,8 @@

      -  -  -  - -  -  -  -  -  -  -  -  -  -  -    -  -  -  -  -  -  -  -  -  -   
//SPDX-License-Identifier: MPL-2.0
 pragma solidity ^0.8.20;
  
@@ -396,57 +210,15 @@ 

import "../CMTAT_PROXY.sol"; import "../libraries/FactoryErrors.sol"; import '@openzeppelin/contracts/utils/Create2.sol'; -import '@openzeppelin/contracts/access/AccessControl.sol'; -import "../interfaces/engine/IEngine.sol"; -  +import "./libraries/CMTATFactoryInvariant.sol"; +import "./libraries/CMTATFactoryBase.sol"; /** * @notice Factory to deploy CMTAT with a transparent proxy * */ -contract CMTAT_TP_FACTORY is AccessControl { - // Public - /// @dev Role to deploy CMTAT - bytes32 public constant CMTAT_DEPLOYER_ROLE = keccak256("CMTAT_DEPLOYER_ROLE"); - address public immutable logic; - address[] public cmtatsList; - bool public useCustomSalt; - uint256 public cmtatID; - /// mapping - mapping(uint256 => address) private cmtats; - mapping(bytes32 => bool) private customSaltUsed; - - struct CMTAT_ARGUMENT{ - address CMTATAdmin; - string nameIrrevocable; - string symbolIrrevocable; - uint8 decimalsIrrevocable; - string tokenId; - string terms; - string information; - IEngine.Engine engines; - } - event CMTAT(address indexed CMTAT, uint256 id); +contract CMTAT_TP_FACTORY is CMTATFactoryInvariant, CMTATFactoryBase {   - - /** - * @param logic_ contract implementation - * @param factoryAdmin admin - */ - constructor(address logic_, address factoryAdmin, bool useCustomSalt_) { - if(logic_ == address(0)){ - revert FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForLogicContract(); - } - if(factoryAdmin == address(0)){ - revert FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForFactoryAdmin(); - } - if(useCustomSalt_){ - useCustomSalt = useCustomSalt_; - } - logic = logic_; - _grantRole(DEFAULT_ADMIN_ROLE, factoryAdmin); - _grantRole(CMTAT_DEPLOYER_ROLE, factoryAdmin); - } - + constructor(address logic_, address factoryAdmin, bool useCustomSalt_) CMTATFactoryBase(logic_, factoryAdmin,useCustomSalt_){} /** * @notice deploy a transparent proxy with a proxy admin contract */ @@ -481,32 +253,6 @@

cmtatArgument); return Create2.computeAddress(deploymentSalt, keccak256(bytecode), address(this) ); } - - /** - * @notice get CMTAT proxy address - * - */ - function CMTATProxyAddress(uint256 cmtatID_) external view returns (address) { - return cmtats[cmtatID_]; - } - - /** - * @param deploymentSalt salt for deployment - * @dev - * if useCustomSalt is at false, the salt used is the current value of cmtatId - */ - function _checkAndDetermineDeploymentSalt(bytes32 deploymentSalt) internal returns(bytes32 saltBytes){ - if(useCustomSalt){ - if(customSaltUsed[deploymentSalt]){ - revert FactoryErrors.CMTAT_Factory_SaltAlreadyUsed(); - }else { - customSaltUsed[deploymentSalt] = true; - saltBytes = deploymentSalt; - } - }else{ - saltBytes = bytes32(keccak256(abi.encodePacked(cmtatID))); - } - }   /** * @notice Deploy CMTAT and push the created CMTAT in the list @@ -514,9 +260,9 @@

function _deployBytecode(bytes memory bytecode, bytes32 deploymentSalt) internal returns (TransparentUpgradeableProxy cmtat) { address cmtatAddress = Create2.deploy(0, deploymentSalt, bytecode); cmtat = TransparentUpgradeableProxy(payable(cmtatAddress)); - cmtats[cmtatID] = address(cmtat); - emit CMTAT(address(cmtat), cmtatID); - ++cmtatID; + cmtats[cmtatCounterId] = address(cmtat); + emit CMTAT(address(cmtat), cmtatCounterId); + ++cmtatCounterId; cmtatsList.push(address(cmtat)); return cmtat; } @@ -528,47 +274,22 @@

function _getBytecode( address proxyAdminOwner, // CMTAT function initialize CMTAT_ARGUMENT calldata cmtatArgument) internal view returns(bytes memory bytecode) { - bytes memory implementation = _encodeImplementationArgument( - cmtatArgument.CMTATAdmin, - cmtatArgument.nameIrrevocable, - cmtatArgument.symbolIrrevocable, - cmtatArgument.decimalsIrrevocable, - cmtatArgument.tokenId, - cmtatArgument.terms, - cmtatArgument.information, - cmtatArgument.engines - ); - bytecode = abi.encodePacked(type(TransparentUpgradeableProxy).creationCode, abi.encode(logic, proxyAdminOwner, implementation)); - } -  -  - function _encodeImplementationArgument( address admin, - string memory nameIrrevocable, - string memory symbolIrrevocable, - uint8 decimalsIrrevocable, - string memory tokenId_, - string memory terms_, - string memory information_, - IEngine.Engine memory engines) internal pure returns(bytes memory){ - return abi.encodeWithSelector( + bytes memory implementation = abi.encodeWithSelector( CMTAT_PROXY(address(0)).initialize.selector, - admin, - nameIrrevocable, - symbolIrrevocable, - decimalsIrrevocable, - tokenId_, - terms_, - information_, - engines + cmtatArgument.CMTATAdmin, + cmtatArgument.ERC20Attributes, + cmtatArgument.baseModuleAttributes, + cmtatArgument.engines ); - } + bytecode = abi.encodePacked(type(TransparentUpgradeableProxy).creationCode, abi.encode(logic, proxyAdminOwner, implementation)); + } }

diff --git a/doc/general/test/coverage/contracts/modules/wrapper/extensions/DebtModule/CreditEventsModule.sol.html b/doc/general/test/coverage/contracts/deployment/CMTAT_UUPS_FACTORY.sol.html similarity index 50% rename from doc/general/test/coverage/contracts/modules/wrapper/extensions/DebtModule/CreditEventsModule.sol.html rename to doc/general/test/coverage/contracts/deployment/CMTAT_UUPS_FACTORY.sol.html index 9fc63921..33a52f20 100644 --- a/doc/general/test/coverage/contracts/modules/wrapper/extensions/DebtModule/CreditEventsModule.sol.html +++ b/doc/general/test/coverage/contracts/deployment/CMTAT_UUPS_FACTORY.sol.html @@ -1,14 +1,14 @@ - Code coverage report for contracts/modules/wrapper/extensions/DebtModule/CreditEventsModule.sol + Code coverage report for contracts/deployment/CMTAT_UUPS_FACTORY.sol - - + + @@ -16,32 +16,32 @@

- all files / contracts/modules/wrapper/extensions/DebtModule/ CreditEventsModule.sol + all files / contracts/deployment/ CMTAT_UUPS_FACTORY.sol

- 0% + 100% Statements - 0/8 + 10/10
- 0% + 100% Branches - 0/14 + 2/2
- 0% + 100% Functions - 0/5 + 5/5
- 0% + 100% Lines - 0/14 + 15/15
-
+

+    
+    /**
+    * @notice return the smart contract bytecode
+    */
+     function _getBytecode( 
+        // CMTAT function initialize
+        CMTAT_ARGUMENT calldata cmtatArgument) internal view returns(bytes memory bytecode) {
+        bytes memory implementation = abi.encodeWithSelector(
+            CMTAT_PROXY_UUPS(address(0)).initialize.selector,
+                  cmtatArgument.CMTATAdmin,
+                    cmtatArgument.ERC20Attributes,
+                cmtatArgument.baseModuleAttributes,
+                cmtatArgument.engines
+        );
+        bytecode = abi.encodePacked(type(ERC1967Proxy).creationCode,  abi.encode(logic, implementation));
+     }
+}
1 2 @@ -127,7 +127,10 @@

82 83 84 -85

  +85 +86 +87 +88        @@ -157,9 +160,13 @@

      + +     +   +       @@ -167,23 +174,17 @@

      -  -  -  -          +     +     -  -    -  -        @@ -191,12 +192,15 @@

      + + + + + + +   -  -    -  -        @@ -204,107 +208,112 @@

      +   -  -          +  + +   

//SPDX-License-Identifier: MPL-2.0
- 
 pragma solidity ^0.8.20;
  
-import "../../../../../openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol";
-import "../../../../../openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol";
-import "../../../../interfaces/IDebtGlobal.sol";
-import "../../../security/AuthorizationModule.sol";
- 
-import "../../../../libraries/Errors.sol";
- 
-abstract contract CreditEventsModule is
-    IDebtGlobal,
-    Initializable,
-    ContextUpgradeable,
-    AuthorizationModule
-{
-    // CreditEvents
-    bytes32 public constant DEBT_CREDIT_EVENT_ROLE =
-    keccak256("DEBT_CREDIT_EVENT_ROLE");
-    CreditEvents public creditEvents;
- 
-    /* Events */
-    event FlagDefault(bool indexed newFlagDefault);
-    event FlagRedeemed(bool indexed newFlagRedeemed);
-    event Rating(string indexed newRatingIndexed, string newRating);
- 
-    function __CreditEvents_init_unchained() internal onlyInitializing {
-        // no variable to initialize
-    }
- 
-    /** 
-    * @notice Set all attributes of creditEvents
-    * The values of all attributes will be changed even if the new values are the same as the current ones
+import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
+import "../CMTAT_PROXY_UUPS.sol";
+import "../libraries/FactoryErrors.sol";
+import '@openzeppelin/contracts/utils/Create2.sol';
+import '@openzeppelin/contracts/access/AccessControl.sol';
+import "./libraries/CMTATFactoryInvariant.sol";
+import "./libraries/CMTATFactoryBase.sol";
+/**
+* @notice Factory to deploy CMTAT with a UUPS proxy
+* 
+*/
+contract CMTAT_UUPS_FACTORY is CMTATFactoryInvariant, CMTATFactoryBase {
+    /**
+    * @param logic_ contract implementation
+    * @param factoryAdmin admin
     */
-    function setCreditEvents(
-        bool flagDefault_,
-        bool flagRedeemed_,
-        string calldata rating_
-    ) public onlyRole(DEBT_CREDIT_EVENT_ROLE) {
-        creditEvents = (CreditEvents(flagDefault_, flagRedeemed_, rating_));
-        emit FlagDefault(flagDefault_);
-        emit FlagRedeemed(flagRedeemed_);
-        emit Rating(rating_, rating_);
-    }
- 
-    /** 
-    * @notice The call will be reverted if the new value of flagDefault is the same as the current one
+    constructor(address logic_, address factoryAdmin, bool useCustomSalt_) CMTATFactoryBase(logic_, factoryAdmin,useCustomSalt_){}
+       
+    
+    /**
+    * @notice deploy a transparent proxy with a proxy admin contract
     */
-    function setFlagDefault(
-        bool flagDefault_
-    ) public onlyRole(DEBT_CREDIT_EVENT_ROLE) {
-        if (flagDefault_ == creditEvents.flagDefault) {
-            revert Errors.CMTAT_DebtModule_SameValue();
-        }
-        creditEvents.flagDefault = flagDefault_;
-        emit FlagDefault(flagDefault_);
+    function deployCMTAT(
+        bytes32 deploymentSaltInput,
+        // CMTAT function initialize
+        CMTAT_ARGUMENT calldata cmtatArgument
+    ) public onlyRole(CMTAT_DEPLOYER_ROLE) returns(ERC1967Proxy cmtat)   {
+        bytes32 deploymentSalt = _checkAndDetermineDeploymentSalt(deploymentSaltInput);
+        bytes memory bytecode = _getBytecode(
+        // CMTAT function initialize
+        cmtatArgument);
+        cmtat = _deployBytecode(bytecode,  deploymentSalt);
+        
+        return cmtat;
     }
  
-    /** 
-    * @notice The call will be reverted if the new value of flagRedeemed is the same as the current one
+    /**
+    * @param deploymentSalt salt for the deployment
+    * @param cmtatArgument argument for the function initialize
+    * @notice get the proxy address depending on a particular salt
     */
-    function setFlagRedeemed(
-        bool flagRedeemed_
-    ) public onlyRole(DEBT_CREDIT_EVENT_ROLE) {
-        if (flagRedeemed_ == creditEvents.flagRedeemed) {
-            revert Errors.CMTAT_DebtModule_SameValue();
-        }
-        creditEvents.flagRedeemed = flagRedeemed_;
-        emit FlagRedeemed(flagRedeemed_);
+    function computedProxyAddress( 
+        bytes32 deploymentSalt,
+        // CMTAT function initialize
+        CMTAT_ARGUMENT calldata cmtatArgument) public view returns (address) {
+        bytes memory bytecode =  _getBytecode(
+        // CMTAT function initialize
+        cmtatArgument);
+        return Create2.computeAddress(deploymentSalt,  keccak256(bytecode), address(this) );
     }
  
-    /** 
-    * @notice The rating will be changed even if the new value is the same as the current one
+    /*//////////////////////////////////////////////////////////////
+                            INTERNAL FUNCTIONS
+    //////////////////////////////////////////////////////////////*/
+ 
+    /**
+    * @notice Deploy CMTAT and push the created CMTAT in the list
     */
-    function setRating(
-        string calldata rating_
-    ) public onlyRole(DEBT_CREDIT_EVENT_ROLE) {
-        creditEvents.rating = rating_;
-        emit Rating(rating_, rating_);
-    }
+    function _deployBytecode(bytes memory bytecode, bytes32  deploymentSalt) internal returns (ERC1967Proxy cmtat) {
+                    address cmtatAddress = Create2.deploy(0, deploymentSalt, bytecode);
+                    cmtat = ERC1967Proxy(payable(cmtatAddress));
+                    cmtats[cmtatCounterId] = address(cmtat);
+                    emit CMTAT(address(cmtat), cmtatCounterId);
+                    ++cmtatCounterId;
+                    cmtatsList.push(address(cmtat));
+                    return cmtat;
+     }
  
-    uint256[50] private __gap;
-}
- 
- + - + diff --git a/doc/general/test/coverage/contracts/deployment/index.html b/doc/general/test/coverage/contracts/deployment/index.html index 36e590b9..b4c7db02 100644 --- a/doc/general/test/coverage/contracts/deployment/index.html +++ b/doc/general/test/coverage/contracts/deployment/index.html @@ -22,22 +22,22 @@

100% Statements - 29/29 + 33/33
100% Branches - 20/20 + 10/10
100% Functions - 12/12 + 16/16
100% Lines - 49/49 + 51/51
@@ -62,26 +62,39 @@

CMTAT_BEACON_FACTORY.sol
100% - 10/10 + 13/13 100% - 8/8 + 6/6 100% - 4/4 + 6/6 100% - 17/17 + 21/21 CMTAT_TP_FACTORY.sol
100% - 19/19 + 10/10 + 100% + 2/2 + 100% + 5/5 + 100% + 15/15 + + + + CMTAT_UUPS_FACTORY.sol +
+ 100% + 10/10 100% - 12/12 + 2/2 100% - 8/8 + 5/5 100% - 32/32 + 15/15 @@ -90,7 +103,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/test/proxy/CMTAT_PROXY.sol.html b/doc/general/test/coverage/contracts/deployment/libraries/CMTATFactoryBase.sol.html similarity index 73% rename from doc/general/test/coverage/lcov-report/contracts/test/proxy/CMTAT_PROXY.sol.html rename to doc/general/test/coverage/contracts/deployment/libraries/CMTATFactoryBase.sol.html index bc1d9738..1402b62c 100644 --- a/doc/general/test/coverage/lcov-report/contracts/test/proxy/CMTAT_PROXY.sol.html +++ b/doc/general/test/coverage/contracts/deployment/libraries/CMTATFactoryBase.sol.html @@ -1,7 +1,7 @@ - Code coverage report for contracts/test/proxy/CMTAT_PROXY.sol + Code coverage report for contracts/deployment/libraries/CMTATFactoryBase.sol @@ -16,18 +16,18 @@

- all files / contracts/test/proxy/ CMTAT_PROXY.sol + all files / contracts/deployment/libraries/ CMTATFactoryBase.sol

100% Statements - 0/0 + 1/1
100% Branches - 0/0 + 2/2
100% @@ -37,7 +37,7 @@

100% Lines - 0/0 + 3/3

@@ -84,41 +84,41 @@

      +16× +   -  -  -  +14×    
//SPDX-License-Identifier: MPL-2.0
- 
 pragma solidity ^0.8.20;
  
-import "../../CMTAT_PROXY.sol";
+import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
+import "./CMTATFactoryRoot.sol";
  
 /**
- * @title a contrat used to test the proxy upgrade functionality
- */
-contract CMTAT_PROXY_TEST is CMTAT_PROXY {
+* @notice Code common to TP and UUPS Factory
+* 
+*/
+abstract contract CMTATFactoryBase is CMTATFactoryRoot {
+    // Public
+    address public immutable logic;
     /**
-     * @notice Contract version for the deployment with a proxy
-     * @param forwarderIrrevocable address of the forwarder, required for the gasless support
-     */
-    /// @custom:oz-upgrades-unsafe-allow constructor
-    constructor(
-        address forwarderIrrevocable
-    ) CMTAT_PROXY(forwarderIrrevocable) {
-        // Nothing to do
+    * @param logic_ contract implementation
+    * @param factoryAdmin admin
+    */
+    constructor(address logic_, address factoryAdmin, bool useCustomSalt_)CMTATFactoryRoot( factoryAdmin, useCustomSalt_) {
+        if(logic_ == address(0)){
+            revert  FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForLogicContract();
+        }
+        logic = logic_;
     }
- 
-    uint256[50] private __gap;
-}
- 
+}

diff --git a/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/IEngine.sol.html b/doc/general/test/coverage/contracts/deployment/libraries/CMTATFactoryInvariant.sol.html similarity index 79% rename from doc/general/test/coverage/lcov-report/contracts/interfaces/engine/IEngine.sol.html rename to doc/general/test/coverage/contracts/deployment/libraries/CMTATFactoryInvariant.sol.html index 86048200..90b86137 100644 --- a/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/IEngine.sol.html +++ b/doc/general/test/coverage/contracts/deployment/libraries/CMTATFactoryInvariant.sol.html @@ -1,7 +1,7 @@ - Code coverage report for contracts/interfaces/engine/IEngine.sol + Code coverage report for contracts/deployment/libraries/CMTATFactoryInvariant.sol @@ -16,7 +16,7 @@

- all files / contracts/interfaces/engine/ IEngine.sol + all files / contracts/deployment/libraries/ CMTATFactoryInvariant.sol

@@ -86,33 +86,33 @@

     
//SPDX-License-Identifier: MPL-2.0
-import "./IDebtEngine.sol";
-import "./IRuleEngine.sol";
-import "./IAuthorizationEngine.sol";
-import "./draft-IERC1643.sol";
- 
 pragma solidity ^0.8.20;
  
+ 
+import "../../interfaces/ICMTATConstructor.sol";
+ 
 /**
-* @notice interface to represent debt tokens
+* @notice Factory to deploy CMTAT with a transparent proxy
+* 
 */
-interface IEngine {
-    struct Engine {
-        IRuleEngine ruleEngine;
-        IDebtEngine debtEngine;
-        IAuthorizationEngine authorizationEngine;
-        IERC1643 documentEngine;
+abstract contract CMTATFactoryInvariant {
+    /// @dev Role to deploy CMTAT
+    bytes32 public constant CMTAT_DEPLOYER_ROLE = keccak256("CMTAT_DEPLOYER_ROLE");
+    struct CMTAT_ARGUMENT{
+        address CMTATAdmin;
+        ICMTATConstructor.ERC20Attributes ERC20Attributes;
+        ICMTATConstructor.BaseModuleAttributes baseModuleAttributes;
+        ICMTATConstructor.Engine engines;
     }
- 
- 
-}
- 
+ /* ============ Events ============ */ + event CMTAT(address indexed CMTAT, uint256 id); +}

diff --git a/doc/general/test/coverage/contracts/deployment/libraries/CMTATFactoryRoot.sol.html b/doc/general/test/coverage/contracts/deployment/libraries/CMTATFactoryRoot.sol.html new file mode 100644 index 00000000..c882bef0 --- /dev/null +++ b/doc/general/test/coverage/contracts/deployment/libraries/CMTATFactoryRoot.sol.html @@ -0,0 +1,245 @@ + + + + Code coverage report for contracts/deployment/libraries/CMTATFactoryRoot.sol + + + + + + + +
+
+

+ all files / contracts/deployment/libraries/ CMTATFactoryRoot.sol +

+
+
+ 100% + Statements + 7/7 +
+
+ 100% + Branches + 8/8 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 13/13 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× + +  +24× +15× +  +24× +24× +  +  +  +  +  +  +  +13× +  +  +  +  +  +  +  +  +11× + + +  + + +  +  + +  +  + 
//SPDX-License-Identifier: MPL-2.0
+pragma solidity ^0.8.20;
+ 
+import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
+import "../../CMTAT_PROXY.sol";
+import "../../libraries/FactoryErrors.sol";
+import '@openzeppelin/contracts/utils/Create2.sol';
+import '@openzeppelin/contracts/access/AccessControl.sol';
+import "./CMTATFactoryInvariant.sol";
+/**
+* @notice Code common to Beacon, TP and UUPS factory
+* 
+*/
+abstract contract CMTATFactoryRoot is AccessControl, CMTATFactoryInvariant {
+    // Public
+    address[] public cmtatsList;
+    bool public useCustomSalt;
+    uint256 public cmtatCounterId;
+    /// mapping
+    mapping(uint256 => address) internal cmtats;
+    mapping(bytes32 => bool) internal customSaltUsed;
+    /**
+    * @param factoryAdmin admin
+    */
+    constructor(address factoryAdmin, bool useCustomSalt_) {
+        if(factoryAdmin == address(0)){
+            revert  FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForFactoryAdmin();
+        }
+        if(useCustomSalt_){
+            useCustomSalt = useCustomSalt_;
+        }
+        _grantRole(DEFAULT_ADMIN_ROLE, factoryAdmin);
+        _grantRole(CMTAT_DEPLOYER_ROLE, factoryAdmin);
+    }
+ 
+    /**
+    * @notice get CMTAT proxy address
+    *
+    */
+    function CMTATProxyAddress(uint256 cmtatCounterId_) external view returns (address) {
+        return cmtats[cmtatCounterId_];
+    }
+    
+    /**
+    * @param deploymentSalt salt for deployment
+    * @dev 
+    * if useCustomSalt is at false, the salt used is the current value of cmtatCounterId
+    */
+    function _checkAndDetermineDeploymentSalt(bytes32 deploymentSalt) internal returns(bytes32 saltBytes){
+       if(useCustomSalt){
+            if(customSaltUsed[deploymentSalt]){
+                revert FactoryErrors.CMTAT_Factory_SaltAlreadyUsed();
+            }else {
+                customSaltUsed[deploymentSalt] = true;
+                saltBytes = deploymentSalt;
+            }
+        }else{
+            saltBytes = bytes32(keccak256(abi.encodePacked(cmtatCounterId)));
+        }
+    }
+}
+
+
+ +
+ + + + + diff --git a/doc/general/test/coverage/contracts/deployment/libraries/index.html b/doc/general/test/coverage/contracts/deployment/libraries/index.html new file mode 100644 index 00000000..1536542b --- /dev/null +++ b/doc/general/test/coverage/contracts/deployment/libraries/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for contracts/deployment/libraries/ + + + + + + + +
+
+

+ all files contracts/deployment/libraries/ +

+
+
+ 100% + Statements + 8/8 +
+
+ 100% + Branches + 10/10 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 16/16 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
CMTATFactoryBase.sol
100%1/1100%2/2100%1/1100%3/3
CMTATFactoryInvariant.sol
100%0/0100%0/0100%0/0100%0/0
CMTATFactoryRoot.sol
100%7/7100%8/8100%3/3100%13/13
+
+
+ +
+ + + + + diff --git a/doc/general/test/coverage/contracts/index.html b/doc/general/test/coverage/contracts/index.html index 11aec3ce..2399575b 100644 --- a/doc/general/test/coverage/contracts/index.html +++ b/doc/general/test/coverage/contracts/index.html @@ -103,7 +103,7 @@

diff --git a/doc/general/test/coverage/contracts/interfaces/ICCIPToken.sol.html b/doc/general/test/coverage/contracts/interfaces/ICCIPToken.sol.html index 4729389d..34fd651f 100644 --- a/doc/general/test/coverage/contracts/interfaces/ICCIPToken.sol.html +++ b/doc/general/test/coverage/contracts/interfaces/ICCIPToken.sol.html @@ -121,7 +121,7 @@

diff --git a/doc/general/test/coverage/contracts/interfaces/ICMTATConstructor.sol.html b/doc/general/test/coverage/contracts/interfaces/ICMTATConstructor.sol.html new file mode 100644 index 00000000..85ad78c9 --- /dev/null +++ b/doc/general/test/coverage/contracts/interfaces/ICMTATConstructor.sol.html @@ -0,0 +1,170 @@ + + + + Code coverage report for contracts/interfaces/ICMTATConstructor.sol + + + + + + + +
+
+

+ all files / contracts/interfaces/ ICMTATConstructor.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
//SPDX-License-Identifier: MPL-2.0
+import "./engine/IDebtEngine.sol";
+import "./engine/IRuleEngine.sol";
+import "./engine/IAuthorizationEngine.sol";
+import "./engine/draft-IERC1643.sol";
+ 
+pragma solidity ^0.8.20;
+ 
+/**
+* @notice interface to represent arguments used for CMTAT constructor / initialize
+*/
+interface ICMTATConstructor {
+    struct Engine {
+        IRuleEngine ruleEngine;
+        IDebtEngine debtEngine;
+        IAuthorizationEngine authorizationEngine;
+        IERC1643 documentEngine;
+    }
+    struct ERC20Attributes {
+        // name of the token,
+        string nameIrrevocable;
+        // name of the symbol
+        string symbolIrrevocable;
+        // number of decimals of the token, must be 0 to be compliant with Swiss law as per CMTAT specifications (non-zero decimal number may be needed for other use cases)
+        uint8 decimalsIrrevocable;
+    }
+    struct BaseModuleAttributes {
+        // name of the tokenId
+        string tokenId;
+        // terms associated with the token
+        string terms;
+        // additional information to describe the token
+        string information;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/doc/general/test/coverage/contracts/interfaces/ICMTATSnapshot.sol.html b/doc/general/test/coverage/contracts/interfaces/ICMTATSnapshot.sol.html index b89864ba..4b4c5842 100644 --- a/doc/general/test/coverage/contracts/interfaces/ICMTATSnapshot.sol.html +++ b/doc/general/test/coverage/contracts/interfaces/ICMTATSnapshot.sol.html @@ -163,7 +163,7 @@

diff --git a/doc/general/test/coverage/contracts/interfaces/IDebtGlobal.sol.html b/doc/general/test/coverage/contracts/interfaces/IDebtGlobal.sol.html index 2a46dbad..55c69a84 100644 --- a/doc/general/test/coverage/contracts/interfaces/IDebtGlobal.sol.html +++ b/doc/general/test/coverage/contracts/interfaces/IDebtGlobal.sol.html @@ -136,7 +136,7 @@

diff --git a/doc/general/test/coverage/contracts/interfaces/draft-IERC1404/draft-IERC1404.sol.html b/doc/general/test/coverage/contracts/interfaces/draft-IERC1404/draft-IERC1404.sol.html index 1570c292..a9f17adb 100644 --- a/doc/general/test/coverage/contracts/interfaces/draft-IERC1404/draft-IERC1404.sol.html +++ b/doc/general/test/coverage/contracts/interfaces/draft-IERC1404/draft-IERC1404.sol.html @@ -127,7 +127,7 @@

diff --git a/doc/general/test/coverage/contracts/interfaces/draft-IERC1404/draft-IERC1404EnumCode.sol.html b/doc/general/test/coverage/contracts/interfaces/draft-IERC1404/draft-IERC1404EnumCode.sol.html index 141e5c93..0bb7499a 100644 --- a/doc/general/test/coverage/contracts/interfaces/draft-IERC1404/draft-IERC1404EnumCode.sol.html +++ b/doc/general/test/coverage/contracts/interfaces/draft-IERC1404/draft-IERC1404EnumCode.sol.html @@ -94,7 +94,7 @@

diff --git a/doc/general/test/coverage/contracts/interfaces/draft-IERC1404/draft-IERC1404Wrapper.sol.html b/doc/general/test/coverage/contracts/interfaces/draft-IERC1404/draft-IERC1404Wrapper.sol.html index d650211d..a9b84efa 100644 --- a/doc/general/test/coverage/contracts/interfaces/draft-IERC1404/draft-IERC1404Wrapper.sol.html +++ b/doc/general/test/coverage/contracts/interfaces/draft-IERC1404/draft-IERC1404Wrapper.sol.html @@ -103,7 +103,7 @@

diff --git a/doc/general/test/coverage/contracts/interfaces/draft-IERC1404/index.html b/doc/general/test/coverage/contracts/interfaces/draft-IERC1404/index.html index af8d247d..b3b35735 100644 --- a/doc/general/test/coverage/contracts/interfaces/draft-IERC1404/index.html +++ b/doc/general/test/coverage/contracts/interfaces/draft-IERC1404/index.html @@ -103,7 +103,7 @@

diff --git a/doc/general/test/coverage/contracts/interfaces/engine/IAuthorizationEngine.sol.html b/doc/general/test/coverage/contracts/interfaces/engine/IAuthorizationEngine.sol.html index 5b38cdde..3b0babb7 100644 --- a/doc/general/test/coverage/contracts/interfaces/engine/IAuthorizationEngine.sol.html +++ b/doc/general/test/coverage/contracts/interfaces/engine/IAuthorizationEngine.sol.html @@ -109,7 +109,7 @@

diff --git a/doc/general/test/coverage/contracts/interfaces/engine/IDebtEngine.sol.html b/doc/general/test/coverage/contracts/interfaces/engine/IDebtEngine.sol.html index 50a785dc..9fab0048 100644 --- a/doc/general/test/coverage/contracts/interfaces/engine/IDebtEngine.sol.html +++ b/doc/general/test/coverage/contracts/interfaces/engine/IDebtEngine.sol.html @@ -82,11 +82,11 @@

  interface IDebtEngine is IDebtGlobal { /** - * @dev Returns true if the operation is authorized, and false otherwise. + * @dev Returns debt information */ function debt() external view returns(IDebtGlobal.DebtBase memory); /** - * @dev Returns true if the operation is authorized, and false otherwise. + * @dev Returns credit events */ function creditEvents() external view returns(IDebtGlobal.CreditEvents memory); @@ -97,7 +97,7 @@

diff --git a/doc/general/test/coverage/contracts/interfaces/engine/IRuleEngine.sol.html b/doc/general/test/coverage/contracts/interfaces/engine/IRuleEngine.sol.html index d829cb9b..35bf495c 100644 --- a/doc/general/test/coverage/contracts/interfaces/engine/IRuleEngine.sol.html +++ b/doc/general/test/coverage/contracts/interfaces/engine/IRuleEngine.sol.html @@ -100,7 +100,7 @@

diff --git a/doc/general/test/coverage/contracts/interfaces/engine/draft-IERC1643.sol.html b/doc/general/test/coverage/contracts/interfaces/engine/draft-IERC1643.sol.html index 4c195ec7..b0586cc6 100644 --- a/doc/general/test/coverage/contracts/interfaces/engine/draft-IERC1643.sol.html +++ b/doc/general/test/coverage/contracts/interfaces/engine/draft-IERC1643.sol.html @@ -79,7 +79,7 @@

diff --git a/doc/general/test/coverage/contracts/interfaces/engine/index.html b/doc/general/test/coverage/contracts/interfaces/engine/index.html index 394530be..be4b8cc1 100644 --- a/doc/general/test/coverage/contracts/interfaces/engine/index.html +++ b/doc/general/test/coverage/contracts/interfaces/engine/index.html @@ -84,19 +84,6 @@

0/0 - - IEngine.sol -
- 100% - 0/0 - 100% - 0/0 - 100% - 0/0 - 100% - 0/0 - - IRuleEngine.sol
@@ -129,7 +116,7 @@

diff --git a/doc/general/test/coverage/contracts/interfaces/index.html b/doc/general/test/coverage/contracts/interfaces/index.html index 88d4e165..0dc4c554 100644 --- a/doc/general/test/coverage/contracts/interfaces/index.html +++ b/doc/general/test/coverage/contracts/interfaces/index.html @@ -71,6 +71,19 @@

0/0 + + ICMTATConstructor.sol +
+ 100% + 0/0 + 100% + 0/0 + 100% + 0/0 + 100% + 0/0 + + ICMTATSnapshot.sol
@@ -103,7 +116,7 @@

diff --git a/doc/general/test/coverage/contracts/libraries/Errors.sol.html b/doc/general/test/coverage/contracts/libraries/Errors.sol.html index 47797d09..3df6d18f 100644 --- a/doc/general/test/coverage/contracts/libraries/Errors.sol.html +++ b/doc/general/test/coverage/contracts/libraries/Errors.sol.html @@ -256,7 +256,7 @@

diff --git a/doc/general/test/coverage/contracts/libraries/FactoryErrors.sol.html b/doc/general/test/coverage/contracts/libraries/FactoryErrors.sol.html index 50f6a676..818589f8 100644 --- a/doc/general/test/coverage/contracts/libraries/FactoryErrors.sol.html +++ b/doc/general/test/coverage/contracts/libraries/FactoryErrors.sol.html @@ -79,7 +79,7 @@

diff --git a/doc/general/test/coverage/contracts/libraries/index.html b/doc/general/test/coverage/contracts/libraries/index.html index d272ea9a..4604548c 100644 --- a/doc/general/test/coverage/contracts/libraries/index.html +++ b/doc/general/test/coverage/contracts/libraries/index.html @@ -90,7 +90,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/CMTAT_BASE.sol.html b/doc/general/test/coverage/contracts/modules/CMTAT_BASE.sol.html index 691297a5..fbbcd8b4 100644 --- a/doc/general/test/coverage/contracts/modules/CMTAT_BASE.sol.html +++ b/doc/general/test/coverage/contracts/modules/CMTAT_BASE.sol.html @@ -283,8 +283,7 @@

238 239 240 -241 -242  +241        @@ -348,10 +347,10 @@

      +381×       -377×       @@ -368,61 +367,56 @@

      +381× +381×   +381×   +381× +381×     +381×         +381× +381×   +381×   -377× -377×   -377×   -377× -377× +381× +379× +379×   +379× +379×   -377× +379× +379×         -377× -377×   -377× +379× +379× +379×     +379×   -377× -375× -375×   -375× -375× +379×   -375× -375×           -375× -375× -375× -  -  -375× -  -  -375× -        @@ -479,7 +473,10 @@

      -437× +  +  +  +438× 17×     @@ -487,8 +484,9 @@

      -420× -420× +421× +421× +        @@ -501,7 +499,7 @@

      -1381× +1386×       @@ -510,7 +508,7 @@

      -1381× +1386×       @@ -530,8 +528,8 @@

pragma solidity ^0.8.20;   // required OZ imports here -import "../../openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol"; -import "../../openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";   import "./wrapper/core/BaseModule.sol"; import "./wrapper/core/ERC20BurnModule.sol"; @@ -550,7 +548,7 @@

import "./wrapper/extensions/DebtModule.sol"; import "./wrapper/extensions/DocumentModule.sol"; import "./security/AuthorizationModule.sol"; -import "../interfaces/engine/IEngine.sol"; +import "../interfaces/ICMTATConstructor.sol"; import "../libraries/Errors.sol";   abstract contract CMTAT_BASE is @@ -569,58 +567,48 @@

ERC20SnapshotModule, DebtModule, DocumentModule -{ +{ +  + /*////////////////////////////////////////////////////////////// + INITIALIZER FUNCTION + //////////////////////////////////////////////////////////////*/ /** * @notice * initialize the proxy contract * The calls to this function will revert if the contract was deployed without a proxy * @param admin address of the admin of contract (Access Control) - * @param nameIrrevocable name of the token - * @param symbolIrrevocable name of the symbol - * @param decimalsIrrevocable number of decimals of the token, must be 0 to be compliant with Swiss law as per CMTAT specifications (non-zero decimal number may be needed for other use cases) - * @param tokenId_ name of the tokenId - * @param terms_ terms associated with the token - * @param information_ additional information to describe the token + * @param ERC20Attributes_ ERC20 name, symbol and decimals + * @param baseModuleAttributes_ tokenId, terms, information + * @param engines_ external contract */ function initialize( address admin, - string memory nameIrrevocable, - string memory symbolIrrevocable, - uint8 decimalsIrrevocable, - string memory tokenId_, - string memory terms_, - string memory information_, - IEngine.Engine memory engines + ICMTATConstructor.ERC20Attributes memory ERC20Attributes_, + ICMTATConstructor.BaseModuleAttributes memory baseModuleAttributes_, + ICMTATConstructor.Engine memory engines_ ) public virtual initializer { __CMTAT_init( admin, - nameIrrevocable, - symbolIrrevocable, - decimalsIrrevocable, - tokenId_, - terms_, - information_, - engines + ERC20Attributes_, + baseModuleAttributes_, + engines_ ); } +    /** * @dev calls the different initialize functions from the different modules */ function __CMTAT_init( address admin, - string memory nameIrrevocable, - string memory symbolIrrevocable, - uint8 decimalsIrrevocable, - string memory tokenId_, - string memory terms_, - string memory information_, - IEngine.Engine memory engines + ICMTATConstructor.ERC20Attributes memory ERC20Attributes_, + ICMTATConstructor.BaseModuleAttributes memory baseModuleAttributes_, + ICMTATConstructor.Engine memory engines_ ) internal EonlyInitializing { /* OpenZeppelin library */ // OZ init_unchained functions are called firstly due to inheritance __Context_init_unchained(); - __ERC20_init_unchained(nameIrrevocable, symbolIrrevocable); + __ERC20_init_unchained(ERC20Attributes_.nameIrrevocable, ERC20Attributes_.symbolIrrevocable); // AccessControlUpgradeable inherits from ERC165Upgradeable __ERC165_init_unchained(); // AuthorizationModule inherits from AccessControlUpgradeable @@ -636,16 +624,16 @@

__SnapshotModuleBase_init_unchained(); __ERC20Snapshot_init_unchained(); - __Validation_init_unchained(engines.ruleEngine); + __Validation_init_unchained(engines_ .ruleEngine);   /* Wrapper */ // AuthorizationModule_init_unchained is called firstly due to inheritance - __AuthorizationModule_init_unchained(admin, engines.authorizationEngine); + __AuthorizationModule_init_unchained(admin, engines_ .authorizationEngine); __ERC20BurnModule_init_unchained(); __ERC20MintModule_init_unchained(); // EnforcementModule_init_unchained is called before ValidationModule_init_unchained due to inheritance __EnforcementModule_init_unchained(); - __ERC20BaseModule_init_unchained(decimalsIrrevocable); + __ERC20BaseModule_init_unchained(ERC20Attributes_.decimalsIrrevocable); // PauseModule_init_unchained is called before ValidationModule_init_unchained due to inheritance __PauseModule_init_unchained(); __ValidationModule_init_unchained(); @@ -655,11 +643,11 @@

Add this call in case you add the SnapshotModule */ __ERC20SnasphotModule_init_unchained(); - __DocumentModule_init_unchained(engines.documentEngine); - __DebtModule_init_unchained(engines.debtEngine); + __DocumentModule_init_unchained(engines_ .documentEngine); + __DebtModule_init_unchained(engines_ .debtEngine);   /* Other modules */ - __Base_init_unchained(tokenId_, terms_, information_); + __Base_init_unchained(baseModuleAttributes_.tokenId, baseModuleAttributes_.terms, baseModuleAttributes_.information);   /* own function */ __CMTAT_init_unchained(); @@ -668,6 +656,11 @@

function __CMTAT_init_unchained() internal EonlyInitializing { // no variable to initialize } +  +  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/   /** * @notice Returns the number of decimals used to get its user representation. @@ -711,6 +704,9 @@

mint(to, amountToMint); }   + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @dev * @@ -731,8 +727,9 @@

ERC20SnapshotModuleInternal._snapshotUpdate(from, to); ERC20Upgradeable._update(from, to, amount); } -  - /************* MetaTx Module *************/ + /*////////////////////////////////////////////////////////////// + METAXTX MODULE + //////////////////////////////////////////////////////////////*/ /** * @dev This surcharge is not necessary if you do not use the MetaTxModule */ @@ -772,7 +769,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/index.html b/doc/general/test/coverage/contracts/modules/index.html index d122d295..62d133df 100644 --- a/doc/general/test/coverage/contracts/modules/index.html +++ b/doc/general/test/coverage/contracts/modules/index.html @@ -77,7 +77,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/internal/ERC20SnapshotModuleInternal.sol.html b/doc/general/test/coverage/contracts/modules/internal/ERC20SnapshotModuleInternal.sol.html index bc712d86..e9ec8a55 100644 --- a/doc/general/test/coverage/contracts/modules/internal/ERC20SnapshotModuleInternal.sol.html +++ b/doc/general/test/coverage/contracts/modules/internal/ERC20SnapshotModuleInternal.sol.html @@ -22,7 +22,7 @@

100% Statements - 16/16 + 20/20
90% @@ -37,7 +37,7 @@

100% Lines - 24/24 + 28/28

@@ -180,10 +180,9 @@

135 136 137 -138  -  -  -  +138 +139 +140        @@ -254,6 +253,7 @@

    1200× +1200×       @@ -268,6 +268,7 @@

    720× +720×       @@ -283,8 +284,11 @@

      -420× -420× +  +  +  +421× +421×   77× 77× @@ -296,8 +300,8 @@

      -343× -343× +344× +344×       @@ -305,23 +309,23 @@

      -463× +464× +464×             -377× -  -  +378× +378×      
//SPDX-License-Identifier: MPL-2.0
  
 pragma solidity ^0.8.20;
  
-import "../../../openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol";
+import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
 import {Arrays} from '@openzeppelin/contracts/utils/Arrays.sol';
 import "./base/SnapshotModuleBase.sol";
 import "../../interfaces/ICMTATSnapshot.sol";
@@ -336,19 +340,16 @@ 

  abstract contract ERC20SnapshotModuleInternal is ICMTATSnapshot, SnapshotModuleBase, ERC20Upgradeable { using Arrays for uint256[]; -  - /** - * @dev - * list of scheduled snapshot (time) - * This list is sorted in ascending order - */ - uint256[] private _scheduledSnapshots; -  + /* ============ Initializer Function ============ */ function __ERC20Snapshot_init_unchained() internal EonlyInitializing { // Nothing to do // _currentSnapshotTime & _currentSnapshotIndex are initialized to zero }   +  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @notice Return snapshotBalanceOf and snapshotTotalSupply to avoid multiple calls * @return ownerBalance , totalSupply - see snapshotBalanceOf and snapshotTotalSupply @@ -390,9 +391,10 @@

uint256 time, address owner ) public view returns (uint256) { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); (bool snapshotted, uint256 value) = _valueAt( time, - _accountBalanceSnapshots[owner] + $._accountBalanceSnapshots[owner] );   return snapshotted ? value : balanceOf(owner); @@ -404,13 +406,17 @@

* @return value stored in the snapshot, or the actual totalSupply if no snapshot */ function snapshotTotalSupply(uint256 time) public view returns (uint256) { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); (bool snapshotted, uint256 value) = _valueAt( time, - _totalSupplySnapshots + $._totalSupplySnapshots ); return snapshotted ? value : totalSupply(); }   + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/   /** * @dev Update balance and/or total supply snapshots before the values are modified. This is implemented @@ -442,17 +448,17 @@

* @dev See {OpenZeppelin - ERC20Snapshot} */ function _updateAccountSnapshot(address account) private { - _updateSnapshot(_accountBalanceSnapshots[account], balanceOf(account)); + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); + _updateSnapshot($._accountBalanceSnapshots[account], balanceOf(account)); }   /** * @dev See {OpenZeppelin - ERC20Snapshot} */ function _updateTotalSupplySnapshot() private { - _updateSnapshot(_totalSupplySnapshots, totalSupply()); + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); + _updateSnapshot($._totalSupplySnapshots, totalSupply()); } -  - uint256[50] private __gap; }  

@@ -460,7 +466,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/internal/EnforcementModuleInternal.sol.html b/doc/general/test/coverage/contracts/modules/internal/EnforcementModuleInternal.sol.html index 0051a21e..8ed2e7e5 100644 --- a/doc/general/test/coverage/contracts/modules/internal/EnforcementModuleInternal.sol.html +++ b/doc/general/test/coverage/contracts/modules/internal/EnforcementModuleInternal.sol.html @@ -145,7 +145,22 @@

100 101 102 -103  +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118        @@ -199,8 +214,22 @@

      -942× -942× +  +  +  +  +  +  +  +  +  +  +944× +944× +  +  +  +        @@ -242,7 +271,8 @@

      -972× +  +974×       @@ -251,9 +281,9 @@

  pragma solidity ^0.8.20;   -import "../../../openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol"; -import "../../../openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol"; -import "../../../openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";   /** * @dev Enforcement module. @@ -264,9 +294,7 @@

Initializable, ContextUpgradeable { - // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.EnforcementModuleInternal")) - 1)) & ~bytes32(uint256(0xff)) - bytes32 private constant EnforcementModuleInternalStorageLocation = 0x0c7bc8a17be064111d299d7669f49519cb26c58611b72d9f6ccc40a1e1184e00; - + /* ============ Events ============ */ /** * @notice Emitted when an address is frozen. */ @@ -287,15 +315,27 @@

string reason );   - /* Variables */ + /* ============ ERC-7201 ============ */ + // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.EnforcementModuleInternal")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant EnforcementModuleInternalStorageLocation = 0x0c7bc8a17be064111d299d7669f49519cb26c58611b72d9f6ccc40a1e1184e00; + +  + /* ==== ERC-7201 State Variables === */ struct EnforcementModuleInternalStorage { mapping(address => bool) _frozen; }     + /*////////////////////////////////////////////////////////////// + INITIALIZER FUNCTION + //////////////////////////////////////////////////////////////*/ function __Enforcement_init_unchained() internal EonlyInitializing { // no variable to initialize } +  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/   /** * @dev Returns true if the account is frozen, and false otherwise. @@ -304,6 +344,10 @@

EnforcementModuleInternalStorage storage $ = _getEnforcementModuleInternalStorage(); return $._frozen[account]; } +  + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/   /** * @dev Freezes an address. @@ -343,6 +387,7 @@

return true; }   + /* ============ ERC-7201 ============ */ function _getEnforcementModuleInternalStorage() private pure returns (EnforcementModuleInternalStorage storage $) { assembly { $.slot := EnforcementModuleInternalStorageLocation @@ -355,7 +400,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/internal/ValidationModuleInternal.sol.html b/doc/general/test/coverage/contracts/modules/internal/ValidationModuleInternal.sol.html index 34e55910..313ade69 100644 --- a/doc/general/test/coverage/contracts/modules/internal/ValidationModuleInternal.sol.html +++ b/doc/general/test/coverage/contracts/modules/internal/ValidationModuleInternal.sol.html @@ -132,7 +132,19 @@

87 88 89 -90  +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102        @@ -162,6 +174,21 @@

      +  +  +381× +18× +18× +18× +  +  +  +  +  +  +  +  +  32× 32×   @@ -169,11 +196,6 @@

      -377× -18× -18× -18× -        @@ -216,7 +238,9 @@

      -627× +  +  +628×       @@ -225,8 +249,8 @@

  pragma solidity ^0.8.20;   -import "../../../openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol"; -import "../../../openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "../../interfaces/engine/IRuleEngine.sol"; /** * @dev Validation module. @@ -237,24 +261,19 @@

Initializable, ContextUpgradeable { - // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.ValidationModuleInternal")) - 1)) & ~bytes32(uint256(0xff)) - bytes32 private constant ValidationModuleInternalStorageLocation = 0xb3e8f29e401cfa802cad91001b5f9eb50decccdb111d80cb07177ab650b04700; - /* Variables */ - struct ValidationModuleInternalStorage { - IRuleEngine _ruleEngine; - } - /* - + /* ============ Events ============ */ /** * @dev Emitted when a rule engine is set. */ event RuleEngine(IRuleEngine indexed newRuleEngine); -  - function ruleEngine() public view returns(IRuleEngine){ - ValidationModuleInternalStorage storage $ = _getValidationModuleInternalStorage(); - return $._ruleEngine; + /* ============ ERC-7201 ============ */ + // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.ValidationModuleInternal")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant ValidationModuleInternalStorageLocation = 0xb3e8f29e401cfa802cad91001b5f9eb50decccdb111d80cb07177ab650b04700; + /* ==== ERC-7201 State Variables === */ + struct ValidationModuleInternalStorage { + IRuleEngine _ruleEngine; } -  + /* ============ Initializer Function ============ */ function __Validation_init_unchained( IRuleEngine ruleEngine_ ) internal EonlyInitializing { @@ -264,6 +283,21 @@

emit RuleEngine(ruleEngine_); } } +  +  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ + + function ruleEngine() public view returns(IRuleEngine){ + ValidationModuleInternalStorage storage $ = _getValidationModuleInternalStorage(); + return $._ruleEngine; + } +  +  + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/   /** * @dev before making a call to this function, you have to check if a ruleEngine is set. @@ -304,6 +338,8 @@

return $._ruleEngine.operateOnTransfer(from, to, amount); }   +  + /* ============ ERC-7201 ============ */ function _getValidationModuleInternalStorage() internal pure returns (ValidationModuleInternalStorage storage $) { assembly { $.slot := ValidationModuleInternalStorageLocation @@ -316,7 +352,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/internal/base/SnapshotModuleBase.sol.html b/doc/general/test/coverage/contracts/modules/internal/base/SnapshotModuleBase.sol.html index bce34257..27216dd9 100644 --- a/doc/general/test/coverage/contracts/modules/internal/base/SnapshotModuleBase.sol.html +++ b/doc/general/test/coverage/contracts/modules/internal/base/SnapshotModuleBase.sol.html @@ -22,22 +22,22 @@

100% Statements - 76/76 + 88/88
- 96.67% + 96.55% Branches - 58/60 + 56/58
100% Functions - 16/16 + 18/18
100% Lines - 100/100 + 112/112
@@ -441,7 +441,41 @@

396 397 398 -399  +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433        @@ -515,6 +549,15 @@

      +  +  +  +  +  +  +  +  +     @@ -524,6 +567,7 @@

    76× +76×   76× 68× @@ -560,6 +604,10 @@

      +  +  +170× +  170×   168× @@ -582,24 +630,11 @@

      -202× - -  -  -  -  -  -  -46× - -  -  -  -        12× +12× 10×   10× @@ -627,6 +662,7 @@

      +22×   22× 20× @@ -634,9 +670,6 @@

  16× -16× - -  12× @@ -666,8 +699,9 @@

      +14×   -12× +14× 10×   @@ -686,11 +720,10 @@

      -12× 10× 10× -   +10×   16× @@ -742,8 +775,9 @@

      -840× -840× +842× +842× +842× 36× 36×   @@ -755,11 +789,12 @@

      -420× +421× +421×       -420× +421× 18× 18×   @@ -771,8 +806,8 @@

      -840× -832× +842× +834×     @@ -787,6 +822,7 @@

  36× 36× +36×   36×   @@ -813,13 +849,14 @@

      -488× +489× +489×   -488× +489×       -402× +403×     86× @@ -839,11 +876,42 @@

      +  +  +  +  +26× +26× + +  +20× +  +  +202× + +  +  +  +  +  +  +46× + +  +  +  +  +  +4856× +  +  +  +   
//SPDX-License-Identifier: MPL-2.0
  
 pragma solidity ^0.8.20;
  
-import "../../../../openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol";
+import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
 import {Arrays} from '@openzeppelin/contracts/utils/Arrays.sol';
  
 import "../../../libraries/Errors.sol";
@@ -859,17 +927,7 @@ 

  abstract contract SnapshotModuleBase is Initializable { using Arrays for uint256[]; -  - /** - @notice Emitted when the snapshot with the specified oldTime was scheduled or rescheduled at the specified newTime. - */ - event SnapshotSchedule(uint256 indexed oldTime, uint256 indexed newTime); -  - /** - * @notice Emitted when the scheduled snapshot with the specified time was cancelled. - */ - event SnapshotUnschedule(uint256 indexed time); -  + /* ============ Structs ============ * /** * @dev See {OpenZeppelin - ERC20Snapshot} * Snapshotted values have arrays of ids (time) and the value corresponding to that id. @@ -880,68 +938,88 @@

uint256[] ids; uint256[] values; } -  - /** - * @dev See {OpenZeppelin - ERC20Snapshot} - */ - mapping(address => Snapshots) internal _accountBalanceSnapshots; - Snapshots internal _totalSupplySnapshots; -  + /* ============ Events ============ */ /** - * @dev time instead of a counter for OpenZeppelin + @notice Emitted when the snapshot with the specified oldTime was scheduled or rescheduled at the specified newTime. */ - // Initialized to zero - uint256 private _currentSnapshotTime; - // Initialized to zero - uint256 private _currentSnapshotIndex; + event SnapshotSchedule(uint256 indexed oldTime, uint256 indexed newTime);   /** - * @dev - * list of scheduled snapshot (time) - * This list is sorted in ascending order + * @notice Emitted when the scheduled snapshot with the specified time was cancelled. */ - uint256[] private _scheduledSnapshots; + event SnapshotUnschedule(uint256 indexed time);   + /* ============ ERC-7201 ============ */ + // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.SnapshotModuleBase")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant SnapshotModuleBaseStorageLocation = 0x649d9af4a0486294740af60c5e3bf61210e7b49108a80b1f369042ea9fd02000; + /* ==== ERC-7201 State Variables === */ + struct SnapshotModuleBaseStorage { + /** + * @dev See {OpenZeppelin - ERC20Snapshot} + */ + mapping(address => Snapshots) _accountBalanceSnapshots; + Snapshots _totalSupplySnapshots; + /** + * @dev time instead of a counter for OpenZeppelin + */ + // Initialized to zero + uint256 _currentSnapshotTime; + // Initialized to zero + uint256 _currentSnapshotIndex; + /** + * @dev + * list of scheduled snapshot (time) + * This list is sorted in ascending order + */ + uint256[] _scheduledSnapshots; + } + /*////////////////////////////////////////////////////////////// + INITIALIZER FUNCTION + //////////////////////////////////////////////////////////////*/ function __SnapshotModuleBase_init_unchained() internal EonlyInitializing { // Nothing to do // _currentSnapshotTime & _currentSnapshotIndex are initialized to zero }   -  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * * @notice Get all snapshots */ function getAllSnapshots() public view returns (uint256[] memory) { - return _scheduledSnapshots; + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); + return $._scheduledSnapshots; }   - /** + /** * @dev * Get the next scheduled snapshots */ function getNextSnapshots() public view returns (uint256[] memory) { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); uint256[] memory nextScheduledSnapshot = new uint256[](0); // no snapshot were planned - if (_scheduledSnapshots.length > 0) { + if ($._scheduledSnapshots.length > 0) { ( uint256 timeLowerBound, uint256 indexLowerBound ) = _findScheduledMostRecentPastSnapshot(); // All snapshots are situated in the futur - if ((timeLowerBound == 0) && (_currentSnapshotTime == 0)) { - return _scheduledSnapshots; + if ((timeLowerBound == 0) && ($._currentSnapshotTime == 0)) { + return $._scheduledSnapshots; } else { // There are snapshots situated in the futur - if (indexLowerBound + 1 != _scheduledSnapshots.length) { + if (indexLowerBound + 1 != $._scheduledSnapshots.length) { // All next snapshots are located after the snapshot specified by indexLowerBound - uint256 arraySize = _scheduledSnapshots.length - + uint256 arraySize = $._scheduledSnapshots.length - indexLowerBound - 1; nextScheduledSnapshot = new uint256[](arraySize); // No need of unchecked block since Soliditiy 0.8.22 for (uint256 i; i < arraySize; ++i) { - nextScheduledSnapshot[i] = _scheduledSnapshots[ + nextScheduledSnapshot[i] = $._scheduledSnapshots[ indexLowerBound + 1 + i ]; } @@ -951,19 +1029,23 @@

return nextScheduledSnapshot; }   + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/   /** * @dev schedule a snapshot at the specified time * You can only add a snapshot after the last previous */ function _scheduleSnapshot(uint256 time) internal { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); // Check the time firstly to avoid an useless read of storage _checkTimeInThePast(time);   - if (_scheduledSnapshots.length > 0) { + if ($._scheduledSnapshots.length > 0) { // We check the last snapshot on the list - uint256 nextSnapshotTime = _scheduledSnapshots[ - _scheduledSnapshots.length - 1 + uint256 nextSnapshotTime = $._scheduledSnapshots[ + $._scheduledSnapshots.length - 1 ]; if (time < nextSnapshotTime) { revert Errors @@ -975,28 +1057,15 @@

revert Errors.CMTAT_SnapshotModule_SnapshotAlreadyExists(); } } - _scheduledSnapshots.push(time); + $._scheduledSnapshots.push(time); emit SnapshotSchedule(0, time); } -  - function _checkTimeInThePast(uint256 time) internal view{ - if (time <= block.timestamp) { - revert Errors.CMTAT_SnapshotModule_SnapshotScheduledInThePast( - time, - block.timestamp - ); - } - } - function _checkTimeSnapshotAlreadyDone(uint256 time) internal view{ - if (time <= block.timestamp) { - revert Errors.CMTAT_SnapshotModule_SnapshotAlreadyDone(); - } - }   /** * @dev schedule a snapshot at the specified time */ function _scheduleSnapshotNotOptimized(uint256 time) internal { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); _checkTimeInThePast(time); (bool isFound, uint256 index) = _findScheduledSnapshotIndex(time); // Perfect match @@ -1004,19 +1073,19 @@

revert Errors.CMTAT_SnapshotModule_SnapshotAlreadyExists(); } // if no upper bound match found, we push the snapshot at the end of the list - if (index == _scheduledSnapshots.length) { - _scheduledSnapshots.push(time); + if (index == $._scheduledSnapshots.length) { + $._scheduledSnapshots.push(time); } else { - _scheduledSnapshots.push( - _scheduledSnapshots[_scheduledSnapshots.length - 1] + $._scheduledSnapshots.push( + $._scheduledSnapshots[$._scheduledSnapshots.length - 1] ); - for (uint256 i = _scheduledSnapshots.length - 2; i > index; ) { - _scheduledSnapshots[i] = _scheduledSnapshots[i - 1]; + for (uint256 i = $._scheduledSnapshots.length - 2; i > index; ) { + $._scheduledSnapshots[i] = $._scheduledSnapshots[i - 1]; unchecked { --i; } } - _scheduledSnapshots[index] = time; + $._scheduledSnapshots[index] = time; } emit SnapshotSchedule(0, time); } @@ -1025,18 +1094,16 @@

* @dev reschedule a scheduled snapshot at the specified newTime */ function _rescheduleSnapshot(uint256 oldTime, uint256 newTime) internal { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); // Check the time firstly to avoid an useless read of storage _checkTimeSnapshotAlreadyDone(oldTime); _checkTimeInThePast(newTime); - if (_scheduledSnapshots.length == 0) { + if ($._scheduledSnapshots.length == 0) { revert Errors.CMTAT_SnapshotModule_NoSnapshotScheduled(); } - (bool foundOld, uint256 index) = _findScheduledSnapshotIndex(oldTime); - if (!foundOld) { - revert Errors.CMTAT_SnapshotModule_SnapshotNotFound(); - } - if (index + 1 < _scheduledSnapshots.length) { - uint256 nextSnapshotTime = _scheduledSnapshots[index + 1]; + uint256 index = _findAndRevertScheduledSnapshotIndex(oldTime); + if (index + 1 < $._scheduledSnapshots.length) { + uint256 nextSnapshotTime = $._scheduledSnapshots[index + 1]; if (newTime > nextSnapshotTime) { revert Errors .CMTAT_SnapshotModule_SnapshotTimestampAfterNextSnapshot( @@ -1048,14 +1115,14 @@

} } if (index > 0) { - if (newTime <= _scheduledSnapshots[index - 1]) + if (newTime <= $._scheduledSnapshots[index - 1]) revert Errors .CMTAT_SnapshotModule_SnapshotTimestampBeforePreviousSnapshot( newTime, - _scheduledSnapshots[index - 1] + $._scheduledSnapshots[index - 1] ); } - _scheduledSnapshots[index] = newTime; + $._scheduledSnapshots[index] = newTime;   emit SnapshotSchedule(oldTime, newTime); } @@ -1064,16 +1131,17 @@

* @dev unschedule the last scheduled snapshot */ function _unscheduleLastSnapshot(uint256 time) internal { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); // Check the time firstly to avoid an useless read of storage _checkTimeSnapshotAlreadyDone(time); - if (_scheduledSnapshots.length == 0) { + if ($._scheduledSnapshots.length == 0) { revert Errors.CMTAT_SnapshotModule_NoSnapshotScheduled(); } // All snapshot time are unique, so we do not check the indice - if (time != _scheduledSnapshots[_scheduledSnapshots.length - 1]) { + if (time !=$._scheduledSnapshots[$._scheduledSnapshots.length - 1]) { revert Errors.CMTAT_SnapshotModule_SnapshotNotFound(); } - _scheduledSnapshots.pop(); + $._scheduledSnapshots.pop(); emit SnapshotUnschedule(time); }   @@ -1084,16 +1152,15 @@

* - Reduce the array size by deleting the last snapshot */ function _unscheduleSnapshotNotOptimized(uint256 time) internal { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); _checkTimeSnapshotAlreadyDone(time); - (bool isFound, uint256 index) = _findScheduledSnapshotIndex(time); - if (!isFound) { - revert Errors.CMTAT_SnapshotModule_SnapshotNotFound(); - } + + uint256 index = _findAndRevertScheduledSnapshotIndex(time); // No need of unchecked block since Soliditiy 0.8.22 - for (uint256 i = index; i + 1 < _scheduledSnapshots.length; ++i ) { - _scheduledSnapshots[i] = _scheduledSnapshots[i + 1]; + for (uint256 i = index; i + 1 < $._scheduledSnapshots.length; ++i ) { + $._scheduledSnapshots[i] = $._scheduledSnapshots[i + 1]; } - _scheduledSnapshots.pop(); + $._scheduledSnapshots.pop(); }   /** @@ -1140,7 +1207,8 @@

Snapshots storage snapshots, uint256 currentValue ) internal { - uint256 current = _currentSnapshotTime; + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); + uint256 current = $._currentSnapshotTime; if (_lastSnapshot(snapshots.ids) < current) { snapshots.ids.push(current); snapshots.values.push(currentValue); @@ -1153,13 +1221,14 @@

* if a snapshot exists, clear all past scheduled snapshot */ function _setCurrentSnapshot() internal { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); ( uint256 scheduleSnapshotTime, uint256 scheduleSnapshotIndex ) = _findScheduledMostRecentPastSnapshot(); if (scheduleSnapshotTime > 0) { - _currentSnapshotTime = scheduleSnapshotTime; - _currentSnapshotIndex = scheduleSnapshotIndex; + $._currentSnapshotTime = scheduleSnapshotTime; + $._currentSnapshotIndex = scheduleSnapshotIndex; } }   @@ -1183,12 +1252,13 @@

function _findScheduledSnapshotIndex( uint256 time ) private view returns (bool, uint256) { - uint256 indexFound = _scheduledSnapshots.findUpperBound(time); - uint256 _scheduledSnapshotsLength = _scheduledSnapshots.length; + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); + uint256 indexFound = $._scheduledSnapshots.findUpperBound(time); + uint256 _scheduledSnapshotsLength = $._scheduledSnapshots.length; // Exact match if ( indexFound != _scheduledSnapshotsLength && - _scheduledSnapshots[indexFound] == time + $._scheduledSnapshots[indexFound] == time ) { return (true, indexFound); } @@ -1211,11 +1281,12 @@

view returns (uint256 time, uint256 index) { - uint256 currentArraySize = _scheduledSnapshots.length; + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); + uint256 currentArraySize = $._scheduledSnapshots.length; // no snapshot or the current snapshot already points on the last snapshot if ( currentArraySize == 0 || - ((_currentSnapshotIndex + 1 == currentArraySize) && (time != 0)) + (($._currentSnapshotIndex + 1 == currentArraySize) && (time != 0)) ) { return (0, currentArraySize); } @@ -1223,9 +1294,9 @@

uint256 mostRecent; index = currentArraySize; // No need of unchecked block since Soliditiy 0.8.22 - for (uint256 i = _currentSnapshotIndex; i < currentArraySize; ++i ) { - if (_scheduledSnapshots[i] <= block.timestamp) { - mostRecent = _scheduledSnapshots[i]; + for (uint256 i = $._currentSnapshotIndex; i < currentArraySize; ++i ) { + if ($._scheduledSnapshots[i] <= block.timestamp) { + mostRecent = $._scheduledSnapshots[i]; index = i; } else { // All snapshot are planned in the futur @@ -1235,7 +1306,38 @@

return (mostRecent, index); }   - uint256[50] private __gap; + /* ============ Utility functions ============ */ +  +  + function _findAndRevertScheduledSnapshotIndex( + uint256 time + ) private view returns (uint256){ + (bool isFound, uint256 index) = _findScheduledSnapshotIndex(time); + if (!isFound) { + revert Errors.CMTAT_SnapshotModule_SnapshotNotFound(); + } + return index; + } + function _checkTimeInThePast(uint256 time) internal view{ + if (time <= block.timestamp) { + revert Errors.CMTAT_SnapshotModule_SnapshotScheduledInThePast( + time, + block.timestamp + ); + } + } + function _checkTimeSnapshotAlreadyDone(uint256 time) internal view{ + if (time <= block.timestamp) { + revert Errors.CMTAT_SnapshotModule_SnapshotAlreadyDone(); + } + } +  + /* ============ ERC-7201 ============ */ + function _getSnapshotModuleBaseStorage() internal pure returns (SnapshotModuleBaseStorage storage $) { + assembly { + $.slot := SnapshotModuleBaseStorageLocation + } + } }  

@@ -1243,7 +1345,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/internal/base/index.html b/doc/general/test/coverage/contracts/modules/internal/base/index.html index c6e17589..2b828b8e 100644 --- a/doc/general/test/coverage/contracts/modules/internal/base/index.html +++ b/doc/general/test/coverage/contracts/modules/internal/base/index.html @@ -22,22 +22,22 @@

100% Statements - 76/76 + 88/88
- 96.67% + 96.55% Branches - 58/60 + 56/58
100% Functions - 16/16 + 18/18
100% Lines - 100/100 + 112/112
@@ -62,13 +62,13 @@

SnapshotModuleBase.sol
100% - 76/76 - 96.67% - 58/60 + 88/88 + 96.55% + 56/58 100% - 16/16 + 18/18 100% - 100/100 + 112/112 @@ -77,7 +77,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/internal/index.html b/doc/general/test/coverage/contracts/modules/internal/index.html index b91dca9e..9f473b7d 100644 --- a/doc/general/test/coverage/contracts/modules/internal/index.html +++ b/doc/general/test/coverage/contracts/modules/internal/index.html @@ -22,7 +22,7 @@

100% Statements - 41/41 + 45/45
85% @@ -37,7 +37,7 @@

100% Lines - 54/54 + 58/58

@@ -62,13 +62,13 @@

ERC20SnapshotModuleInternal.sol
100% - 16/16 + 20/20 90% 9/10 100% 9/9 100% - 24/24 + 28/28 @@ -103,7 +103,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/security/AuthorizationModule.sol.html b/doc/general/test/coverage/contracts/modules/security/AuthorizationModule.sol.html index 63eebbda..7d849acf 100644 --- a/doc/general/test/coverage/contracts/modules/security/AuthorizationModule.sol.html +++ b/doc/general/test/coverage/contracts/modules/security/AuthorizationModule.sol.html @@ -147,7 +147,22 @@

102 103 104 -105  +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120        @@ -175,11 +190,14 @@

      -377× +  +  +  +381×   -375× -375× +379× +379× 16× 16× 16× @@ -187,6 +205,11 @@

      +  +  +  +  +    @@ -239,10 +262,17 @@

      -1275× -758× +1280× +759× +  +521× +  +  +  +  +  +    -517×       @@ -255,21 +285,24 @@

  pragma solidity ^0.8.20;   -import "../../../openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "../../libraries/Errors.sol"; import "../../interfaces/engine/IAuthorizationEngine.sol";   abstract contract AuthorizationModule is AccessControlUpgradeable { + /* ============ Events ============ */ + /** + * @dev Emitted when a rule engine is set. + */ + event AuthorizationEngine(IAuthorizationEngine indexed newAuthorizationEngine); + /* ============ ERC-7201 ============ */ // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.AuthorizationModule")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant AuthorizationModuleStorageLocation = 0x59b7f077fa4ad020f9053fd2197fef0113b19f0b11dcfe516e88cbc0e9226d00; - /* Variables */ + /* ==== ERC-7201 State Variables === */ struct AuthorizationModuleStorage { IAuthorizationEngine _authorizationEngine; } - /** - * @dev Emitted when a rule engine is set. - */ - event AuthorizationEngine(IAuthorizationEngine indexed newAuthorizationEngine); + /* ============ Initializer Function ============ */ /** * @dev * @@ -289,6 +322,11 @@

emit AuthorizationEngine(authorizationEngine_); } } +  +  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/   function authorizationEngine() public view virtual returns (IAuthorizationEngine) { AuthorizationModuleStorage storage $ = _getAuthorizationModuleStorage(); @@ -349,6 +387,13 @@

return AccessControlUpgradeable.hasRole(role, account); }   +  + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ +  +  + /* ============ ERC-7201 ============ */ function _getAuthorizationModuleStorage() private pure returns (AuthorizationModuleStorage storage $) { assembly { $.slot := AuthorizationModuleStorageLocation @@ -361,7 +406,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/security/index.html b/doc/general/test/coverage/contracts/modules/security/index.html index 0747fc04..83fe875c 100644 --- a/doc/general/test/coverage/contracts/modules/security/index.html +++ b/doc/general/test/coverage/contracts/modules/security/index.html @@ -77,7 +77,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/wrapper/controllers/ValidationModule.sol.html b/doc/general/test/coverage/contracts/modules/wrapper/controllers/ValidationModule.sol.html index 2a461400..56eaa88f 100644 --- a/doc/general/test/coverage/contracts/modules/wrapper/controllers/ValidationModule.sol.html +++ b/doc/general/test/coverage/contracts/modules/wrapper/controllers/ValidationModule.sol.html @@ -183,7 +183,25 @@

138 139 140 -141  +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152  +  +  +  +  +  +  +        @@ -306,21 +324,25 @@

      -456× +  +  +  +  +457× 18×   -438× +439×       -437× +438× 14×   -423× -423× +424× +424× 60×   -363× +364×      
//SPDX-License-Identifier: MPL-2.0
@@ -345,12 +367,19 @@ 

EnforcementModule, IERC1404Wrapper { + /* ============ State Variables ============ */ string constant TEXT_TRANSFER_OK = "No restriction"; string constant TEXT_UNKNOWN_CODE = "Unknown code";   + /* ============ Initializer Function ============ */ function __ValidationModule_init_unchained() internal EonlyInitializing { // no variable to initialize } +  +  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/   /* * @notice set a RuleEngine @@ -441,6 +470,10 @@

return true; }   +  + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ function _validateTransferByModule( address from, address to, @@ -469,7 +502,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/wrapper/controllers/index.html b/doc/general/test/coverage/contracts/modules/wrapper/controllers/index.html index e16131f1..3b3d4fcc 100644 --- a/doc/general/test/coverage/contracts/modules/wrapper/controllers/index.html +++ b/doc/general/test/coverage/contracts/modules/wrapper/controllers/index.html @@ -77,7 +77,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/wrapper/core/BaseModule.sol.html b/doc/general/test/coverage/contracts/modules/wrapper/core/BaseModule.sol.html index 012a34d3..fb309d22 100644 --- a/doc/general/test/coverage/contracts/modules/wrapper/core/BaseModule.sol.html +++ b/doc/general/test/coverage/contracts/modules/wrapper/core/BaseModule.sol.html @@ -152,7 +152,13 @@

107 108 109 -110  +110 +111 +112 +113 +114 +115 +116        @@ -197,11 +203,12 @@

      +379× +379× +379× +379× +    -375× -375× -375× -375×       @@ -255,7 +262,12 @@

      -409× +  +  +  +  +  +413×       @@ -269,22 +281,14 @@

import "../../security/AuthorizationModule.sol"; import "../../../libraries/Errors.sol"; abstract contract BaseModule is AuthorizationModule { - // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.BaseModule")) - 1)) & ~bytes32(uint256(0xff)) - bytes32 private constant BaseModuleStorageLocation = 0xa98e72f7f70574363edb12c42a03ac1feb8cc898a6e0a30f6eefbab7093e0d00; -  - /* Variables */ - struct BaseModuleStorage { - string _tokenId; - string _terms; - string _information; - } + /* ============ State Variables ============ */ /** * @notice * Get the current version of the smart contract */ - string public constant VERSION = "2.4.1"; + string public constant VERSION = "2.5.0"; - /* Events */ + /* ============ Events ============ */ event Term(string indexed newTermIndexed, string newTerm); event TokenId(string indexed newTokenIdIndexed, string newTokenId); event Information( @@ -292,10 +296,17 @@

string newInformation ); event Flag(uint256 indexed newFlag); + /* ============ ERC-7201 ============ */ + // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.BaseModule")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant BaseModuleStorageLocation = 0xa98e72f7f70574363edb12c42a03ac1feb8cc898a6e0a30f6eefbab7093e0d00;   -  -  - /* Initializers */ + /* ==== ERC-7201 State Variables === */ + struct BaseModuleStorage { + string _tokenId; + string _terms; + string _information; + } + /* ============ Initializer Function ============ */ /** * @dev Sets the values for {name} and {symbol}. * @@ -313,7 +324,9 @@

$._information = information_; }   - /* Methods */ + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/   function tokenId() public view virtual returns (string memory) { BaseModuleStorage storage $ = _getBaseModuleStorage(); @@ -363,6 +376,11 @@

}     + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ +  + /* ============ ERC-7201 ============ */ function _getBaseModuleStorage() private pure returns (BaseModuleStorage storage $) { assembly { $.slot := BaseModuleStorageLocation @@ -376,7 +394,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/wrapper/core/ERC20BaseModule.sol.html b/doc/general/test/coverage/contracts/modules/wrapper/core/ERC20BaseModule.sol.html index e295ae7c..3c458492 100644 --- a/doc/general/test/coverage/contracts/modules/wrapper/core/ERC20BaseModule.sol.html +++ b/doc/general/test/coverage/contracts/modules/wrapper/core/ERC20BaseModule.sol.html @@ -167,7 +167,14 @@

122 123 124 -125  +125 +126 +127 +128 +129 +130 +131 +132        @@ -200,9 +207,9 @@

      +379× +379×   -375× -375×       @@ -286,7 +293,14 @@

      -377× +  +  +  +  +  +  +  +381×       @@ -296,28 +310,27 @@

pragma solidity ^0.8.20;   // required OZ imports here -import "../../../../openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "../../../libraries/Errors.sol";   abstract contract ERC20BaseModule is ERC20Upgradeable { - // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.ERC20BaseModule")) - 1)) & ~bytes32(uint256(0xff)) - bytes32 private constant ERC20BaseModuleStorageLocation = 0x9bd8d607565c0370ae5f91651ca67fd26d4438022bf72037316600e29e6a3a00; - - struct ERC20BaseModuleStorage { - uint8 _decimals; - } -  - /* Events */ + /* ============ Events ============ */ /** * @notice Emitted when the specified `spender` spends the specified `value` tokens owned by the specified `owner` reducing the corresponding allowance. * @dev The allowance can be also "spend" with the function BurnFrom, but in this case, the emitted event is BurnFrom. */ event Spend(address indexed owner, address indexed spender, uint256 value); + /* ============ ERC-7201 ============ */ + // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.ERC20BaseModule")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant ERC20BaseModuleStorageLocation = 0x9bd8d607565c0370ae5f91651ca67fd26d4438022bf72037316600e29e6a3a00; + /* ==== ERC-7201 State Variables === */ + struct ERC20BaseModuleStorage { + uint8 _decimals; + }   - /* Initializers */ -  + /* ============ Initializer Function ============ */ /** - * @dev Sets the values for decimals. + * @dev Initializers: Sets the values for decimals. * * this value is immutable: it can only be set once during * construction/initialization. @@ -328,8 +341,9 @@

ERC20BaseModuleStorage storage $ = _getERC20BaseModuleStorage(); $._decimals = decimals_; } -  - /* Methods */ + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * * @notice Returns the number of decimals used to get its user representation. @@ -409,6 +423,13 @@

totalSupply = ERC20Upgradeable.totalSupply(); }   +  + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ +  +  + /* ============ ERC-7201 ============ */ function _getERC20BaseModuleStorage() private pure returns (ERC20BaseModuleStorage storage $) { assembly { $.slot := ERC20BaseModuleStorageLocation @@ -421,7 +442,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/wrapper/core/ERC20BurnModule.sol.html b/doc/general/test/coverage/contracts/modules/wrapper/core/ERC20BurnModule.sol.html index 3659b140..525d94ca 100644 --- a/doc/general/test/coverage/contracts/modules/wrapper/core/ERC20BurnModule.sol.html +++ b/doc/general/test/coverage/contracts/modules/wrapper/core/ERC20BurnModule.sol.html @@ -155,7 +155,27 @@

110 111 112 -113  +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123  +  +  +  +  +  +  +  +  +  +        @@ -271,12 +291,15 @@

  pragma solidity ^0.8.20;   -import "../../../../openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "../../security/AuthorizationModule.sol"; import "../../../interfaces/ICCIPToken.sol"; abstract contract ERC20BurnModule is ERC20Upgradeable, ICCIPBurnFromERC20, AuthorizationModule { + /* ============ State Variables ============ */ bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE"); bytes32 public constant BURNER_FROM_ROLE = keccak256("BURNER_FROM_ROLE"); + + /* ============ Events ============ */ /** * @notice Emitted when the specified `value` amount of tokens owned by `owner`are destroyed with the given `reason` */ @@ -285,9 +308,16 @@

* @notice Emitted when the specified `spender` burns the specified `value` tokens owned by the specified `owner` reducing the corresponding allowance. */ event BurnFrom(address indexed owner, address indexed spender, uint256 value); +  +  + /* ============ Initializer Function ============ */ function __ERC20BurnModule_init_unchained() internal EonlyInitializing { // no variable to initialize } +  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/   /** * @notice Destroys a `value` amount of tokens from `account`, by transferring it to address(0). @@ -385,7 +415,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/wrapper/core/ERC20MintModule.sol.html b/doc/general/test/coverage/contracts/modules/wrapper/core/ERC20MintModule.sol.html index 2b289f4b..0af0174d 100644 --- a/doc/general/test/coverage/contracts/modules/wrapper/core/ERC20MintModule.sol.html +++ b/doc/general/test/coverage/contracts/modules/wrapper/core/ERC20MintModule.sol.html @@ -115,7 +115,13 @@

70 71 72 -73  +73 +74 +75 +76 +77 +78 +79        @@ -149,8 +155,14 @@

      -289× -289× +  +  +  +  +  +  +290× +290×       @@ -191,22 +203,28 @@

  pragma solidity ^0.8.20;   -import "../../../../openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "../../security/AuthorizationModule.sol"; import "../../../interfaces/ICCIPToken.sol"; abstract contract ERC20MintModule is ERC20Upgradeable, ICCIPMintERC20, AuthorizationModule { - // MintModule + /* ============ State Variables ============ */ bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); + /* ============ Events ============ */ /** * @notice Emitted when the specified `value` amount of new tokens are created and * allocated to the specified `account`. */ event Mint(address indexed account, uint256 value);   +  + /* ============ Initializer Function ============ */ function __ERC20MintModule_init_unchained() internal EonlyInitializing { // no variable to initialize }   + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @notice Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0) * @param account token receiver @@ -265,7 +283,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/wrapper/core/EnforcementModule.sol.html b/doc/general/test/coverage/contracts/modules/wrapper/core/EnforcementModule.sol.html index a835965a..b1722a25 100644 --- a/doc/general/test/coverage/contracts/modules/wrapper/core/EnforcementModule.sol.html +++ b/doc/general/test/coverage/contracts/modules/wrapper/core/EnforcementModule.sol.html @@ -97,7 +97,15 @@

52 53 54 -55  +55 +56 +57 +58 +59  +  +  +  +        @@ -167,7 +175,7 @@

EnforcementModuleInternal, AuthorizationModule { - // EnforcementModule + /* ============ State Variables ============ */ bytes32 public constant ENFORCER_ROLE = keccak256("ENFORCER_ROLE"); string internal constant TEXT_TRANSFER_REJECTED_FROM_FROZEN = "Address FROM is frozen"; @@ -175,10 +183,14 @@

string internal constant TEXT_TRANSFER_REJECTED_TO_FROZEN = "Address TO is frozen";   + /* ============ Initializer Function ============ */ function __EnforcementModule_init_unchained() internal EonlyInitializing { // no variable to initialize }   + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @notice Freezes an address. * @param account the account to freeze @@ -211,7 +223,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/wrapper/core/PauseModule.sol.html b/doc/general/test/coverage/contracts/modules/wrapper/core/PauseModule.sol.html index 54925f87..9cccc67c 100644 --- a/doc/general/test/coverage/contracts/modules/wrapper/core/PauseModule.sol.html +++ b/doc/general/test/coverage/contracts/modules/wrapper/core/PauseModule.sol.html @@ -139,7 +139,19 @@

94 95 96 -97  +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109        @@ -164,7 +176,6 @@

      -12×       @@ -235,11 +246,24 @@

    +  +  +  +  +  +  +  +  +12× +  +  +  +   
//SPDX-License-Identifier: MPL-2.0
  
 pragma solidity ^0.8.20;
  
-import "../../../../openzeppelin-contracts-upgradeable/contracts/utils/PausableUpgradeable.sol";
+import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol";
 import "../../security/AuthorizationModule.sol";
  
 /**
@@ -253,28 +277,27 @@ 

* event of a large bug. */ abstract contract PauseModule is PausableUpgradeable, AuthorizationModule { + /* ============ State Variables ============ */ + bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); + string internal constant TEXT_TRANSFER_REJECTED_PAUSED = + "All transfers paused"; + /* ============ Events ============ */ + event Deactivated(address account); + /* ============ ERC-7201 ============ */ // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.ERC20BaseModule")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant PauseModuleStorageLocation = 0x9bd8d607565c0370ae5f91651ca67fd26d4438022bf72037316600e29e6a3a00; + /* ==== ERC-7201 State Variables === */ struct PauseModuleStorage { bool _isDeactivated; } -  - function _getPauseModuleStorage() private pure returns (PauseModuleStorage storage $) { - assembly { - $.slot := PauseModuleStorageLocation - } - } -  - // PauseModule - bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); - string internal constant TEXT_TRANSFER_REJECTED_PAUSED = - "All transfers paused"; - event Deactivated(address account); -  + /* ============ Initializer Function ============ */ function __PauseModule_init_unchained() internal EonlyInitializing { // no variable to initialize } -  + + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @notice Pauses all token transfers. * @dev See {ERC20Pausable} and {Pausable-_pause}. @@ -330,6 +353,19 @@

PauseModuleStorage storage $ = _getPauseModuleStorage(); return $._isDeactivated; } +  +  + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ +  +  + /* ============ ERC-7201 ============ */ + function _getPauseModuleStorage() private pure returns (PauseModuleStorage storage $) { + assembly { + $.slot := PauseModuleStorageLocation + } + } }  

@@ -337,7 +373,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/wrapper/core/index.html b/doc/general/test/coverage/contracts/modules/wrapper/core/index.html index 58824a37..4fa59c60 100644 --- a/doc/general/test/coverage/contracts/modules/wrapper/core/index.html +++ b/doc/general/test/coverage/contracts/modules/wrapper/core/index.html @@ -142,7 +142,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/wrapper/extensions/DebtModule.sol.html b/doc/general/test/coverage/contracts/modules/wrapper/extensions/DebtModule.sol.html index 25ac2161..ae910c4e 100644 --- a/doc/general/test/coverage/contracts/modules/wrapper/extensions/DebtModule.sol.html +++ b/doc/general/test/coverage/contracts/modules/wrapper/extensions/DebtModule.sol.html @@ -123,7 +123,21 @@

78 79 80 -81  +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95        @@ -153,7 +167,13 @@

      -375× +  +  +  +  +  +  +379× @@ -163,6 +183,8 @@

      +  +    @@ -197,6 +219,12 @@

      +  +  +  +  +  +  20×     @@ -212,18 +240,24 @@

import "../../../interfaces/engine/IDebtEngine.sol";   abstract contract DebtModule is AuthorizationModule, IDebtEngine { + /* ============ State Variables ============ */ bytes32 public constant DEBT_ROLE = keccak256("DEBT_ROLE"); + /* ============ ERC-7201 ============ */ // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.DebtModule")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant DebtModuleStorageLocation = 0xf8a315cc5f2213f6481729acd86e55db7ccc930120ccf9fb78b53dcce75f7c00; - /* Variables */ + /* ==== ERC-7201 State Variables === */ struct DebtModuleStorage { IDebtEngine _debtEngine; } + /* ============ Events ============ */ /** * @dev Emitted when a rule engine is set. */ event DebtEngine(IDebtEngine indexed newDebtEngine); +  +  + /* ============ Initializer Function ============ */ /** * @dev * @@ -241,7 +275,9 @@

  } -  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ function debtEngine() public view virtual returns (IDebtEngine) { DebtModuleStorage storage $ = _getDebtModuleStorage(); return $._debtEngine; @@ -276,6 +312,12 @@

} }   +  + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ + + /* ============ ERC-7201 ============ */ function _getDebtModuleStorage() private pure returns (DebtModuleStorage storage $) { assembly { $.slot := DebtModuleStorageLocation @@ -289,7 +331,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/wrapper/extensions/DebtModule/DebtBaseModule.sol.html b/doc/general/test/coverage/contracts/modules/wrapper/extensions/DebtModule/DebtBaseModule.sol.html deleted file mode 100644 index e09ebdad..00000000 --- a/doc/general/test/coverage/contracts/modules/wrapper/extensions/DebtModule/DebtBaseModule.sol.html +++ /dev/null @@ -1,764 +0,0 @@ - - - - Code coverage report for contracts/modules/wrapper/extensions/DebtModule/DebtBaseModule.sol - - - - - - - -
-
-

- all files / contracts/modules/wrapper/extensions/DebtModule/ DebtBaseModule.sol -

-
-
- 0% - Statements - 0/26 -
-
- 0% - Branches - 0/32 -
-
- 0% - Functions - 0/14 -
-
- 0% - Lines - 0/41 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
//SPDX-License-Identifier: MPL-2.0
- 
-pragma solidity ^0.8.20;
- 
-import "../../../../../openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol";
-import "../../../../../openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol";
-import "../../../../interfaces/IDebtGlobal.sol";
-import "../../../security/AuthorizationModule.sol";
- 
-import "../../../../libraries/Errors.sol";
- 
-abstract contract DebtBaseModule is
-    IDebtGlobal,
-    Initializable,
-    ContextUpgradeable,
-    AuthorizationModule
-{
-    // DebtModule
-    bytes32 public constant DEBT_ROLE = keccak256("DEBT_ROLE");
-    DebtBase public debt;
- 
-    /* Events */
-    event InterestRate(uint256 newInterestRate);
-    event ParValue(uint256 newParValue);
-    event Guarantor(string indexed newGuarantorIndexed, string newGuarantor);
-    event BondHolder(string indexed newBondHolderIndexed, string newBondHolder);
-    event MaturityDate(
-        string indexed newMaturityDateIndexed,
-        string newMaturityDate
-    );
-    event InterestScheduleFormat(
-        string indexed newInterestScheduleFormatIndexed,
-        string newInterestScheduleFormat
-    );
-    event InterestPaymentDate(
-        string indexed newInterestPaymentDateIndexed,
-        string newInterestPaymentDate
-    );
-    event DayCountConvention(
-        string indexed newDayCountConventionIndexed,
-        string newDayCountConvention
-    );
-    event BusinessDayConvention(
-        string indexed newBusinessDayConventionIndexed,
-        string newBusinessDayConvention
-    );
-    event PublicHolidaysCalendar(
-        string indexed newPublicHolidaysCalendarIndexed,
-        string newPublicHolidaysCalendar
-    );
-    event IssuanceDate(
-        string indexed newIssuanceDateIndexed,
-        string newIssuanceDate
-    );
-    event CouponFrequency(
-        string indexed newCouponFrequencyIndexed,
-        string newCouponFrequency
-    );
- 
-    function __DebtBaseModule_init_unchained() internal onlyInitializing {
-        // no variable to initialize
-    }
- 
-    /** 
-    * @notice Set all attributes of debt
-    * The values of all attributes will be changed even if the new values are the same as the current ones
-    */
-    function setDebt(DebtBase calldata debt_) public onlyRole(DEBT_ROLE) {
-        debt = debt_;
-        emit InterestRate(debt_.interestRate);
-        emit ParValue(debt_.parValue);
-        emit Guarantor(debt_.guarantor, debt_.guarantor);
-        emit BondHolder(debt_.bondHolder, debt_.bondHolder);
-        emit MaturityDate(debt_.maturityDate, debt_.maturityDate);
-        emit InterestScheduleFormat(
-            debt_.interestScheduleFormat,
-            debt_.interestScheduleFormat
-        );
-        emit InterestPaymentDate(
-            debt_.interestPaymentDate,
-            debt_.interestPaymentDate
-        );
-        emit DayCountConvention(
-            debt_.dayCountConvention,
-            debt_.dayCountConvention
-        );
-        emit BusinessDayConvention(
-            debt_.businessDayConvention,
-            debt_.businessDayConvention
-        );
-        emit PublicHolidaysCalendar(
-            debt_.publicHolidaysCalendar,
-            debt_.publicHolidaysCalendar
-        );
- 
-        emit IssuanceDate(debt_.issuanceDate, debt_.issuanceDate);
- 
-        emit CouponFrequency(debt_.couponFrequency, debt_.couponFrequency);
-    }
- 
-    /** 
-    * @notice The call will be reverted if the new value of interestRate is the same as the current one
-    */
-    function setInterestRate(uint256 interestRate_) public onlyRole(DEBT_ROLE) {
-        if (interestRate_ == debt.interestRate) {
-            revert Errors.CMTAT_DebtModule_SameValue();
-        }
-        debt.interestRate = interestRate_;
-        emit InterestRate(interestRate_);
-    }
- 
-    /**
-    * @notice The call will be reverted if the new value of parValue is the same as the current one
-    */
-    function setParValue(uint256 parValue_) public onlyRole(DEBT_ROLE) {
-        if (parValue_ == debt.parValue) {
-            revert Errors.CMTAT_DebtModule_SameValue();
-        }
-        debt.parValue = parValue_;
-        emit ParValue(parValue_);
-    }
- 
-    /** 
-    * @notice The Guarantor will be changed even if the new value is the same as the current one
-    */
-    function setGuarantor(
-        string calldata guarantor_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.guarantor = guarantor_;
-        emit Guarantor(guarantor_, guarantor_);
-    }
- 
-    /** 
-    * @notice The bonHolder will be changed even if the new value is the same as the current one
-    */
-    function setBondHolder(
-        string calldata bondHolder_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.bondHolder = bondHolder_;
-        emit BondHolder(bondHolder_, bondHolder_);
-    }
- 
-    /** 
-    * @notice The maturityDate will be changed even if the new value is the same as the current one
-    */
-    function setMaturityDate(
-        string calldata maturityDate_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.maturityDate = maturityDate_;
-        emit MaturityDate(maturityDate_, maturityDate_);
-    }
- 
-    /** 
-    * @notice The interestScheduleFormat will be changed even if the new value is the same as the current one
-    */
-    function setInterestScheduleFormat(
-        string calldata interestScheduleFormat_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.interestScheduleFormat = interestScheduleFormat_;
-        emit InterestScheduleFormat(
-            interestScheduleFormat_,
-            interestScheduleFormat_
-        );
-    }
- 
-    /** 
-    * @notice The interestPaymentDate will be changed even if the new value is the same as the current one
-    */
-    function setInterestPaymentDate(
-        string calldata interestPaymentDate_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.interestPaymentDate = interestPaymentDate_;
-        emit InterestPaymentDate(interestPaymentDate_, interestPaymentDate_);
-    }
- 
-    /**
-    * @notice The dayCountConvention will be changed even if the new value is the same as the current one
-    */
-    function setDayCountConvention(
-        string calldata dayCountConvention_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.dayCountConvention = dayCountConvention_;
-        emit DayCountConvention(dayCountConvention_, dayCountConvention_);
-    }
- 
-    /** 
-    * @notice The businessDayConvention will be changed even if the new value is the same as the current one
-    */
-    function setBusinessDayConvention(
-        string calldata businessDayConvention_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.businessDayConvention = businessDayConvention_;
-        emit BusinessDayConvention(
-            businessDayConvention_,
-            businessDayConvention_
-        );
-    }
- 
-    /** 
-    * @notice The publicHolidayCalendar will be changed even if the new value is the same as the current one
-    */
-    function setPublicHolidaysCalendar(
-        string calldata publicHolidaysCalendar_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.publicHolidaysCalendar = publicHolidaysCalendar_;
-        emit PublicHolidaysCalendar(
-            publicHolidaysCalendar_,
-            publicHolidaysCalendar_
-        );
-    }
- 
-    /**
-    * @notice The issuanceDate will be changed even if the new value is the same as the current one
-    */
-    function setIssuanceDate(
-        string calldata issuanceDate_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.issuanceDate = issuanceDate_;
-        emit IssuanceDate(issuanceDate_, issuanceDate_);
-    }
- 
-    /** 
-    * @notice The couponFrequency will be changed even if the new value is the same as the current one
-    */
-    function setCouponFrequency(
-        string calldata couponFrequency_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.couponFrequency = couponFrequency_;
-        emit CouponFrequency(couponFrequency_, couponFrequency_);
-    }
- 
-    uint256[50] private __gap;
-}
- 
-
-
- - - - - - - diff --git a/doc/general/test/coverage/contracts/modules/wrapper/extensions/DebtModule/index.html b/doc/general/test/coverage/contracts/modules/wrapper/extensions/DebtModule/index.html deleted file mode 100644 index 45ad1a64..00000000 --- a/doc/general/test/coverage/contracts/modules/wrapper/extensions/DebtModule/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for contracts/modules/wrapper/extensions/DebtModule/ - - - - - - - -
-
-

- all files contracts/modules/wrapper/extensions/DebtModule/ -

-
-
- 0% - Statements - 0/34 -
-
- 0% - Branches - 0/46 -
-
- 0% - Functions - 0/19 -
-
- 0% - Lines - 0/55 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
CreditEventsModule.sol
0%0/80%0/140%0/50%0/14
DebtBaseModule.sol
0%0/260%0/320%0/140%0/41
-
-
- - - - - - - diff --git a/doc/general/test/coverage/contracts/modules/wrapper/extensions/DocumentModule.sol.html b/doc/general/test/coverage/contracts/modules/wrapper/extensions/DocumentModule.sol.html index 019c0c7e..2640e420 100644 --- a/doc/general/test/coverage/contracts/modules/wrapper/extensions/DocumentModule.sol.html +++ b/doc/general/test/coverage/contracts/modules/wrapper/extensions/DocumentModule.sol.html @@ -120,7 +120,22 @@

75 76 77 -78  +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93        @@ -136,13 +151,9 @@

      -28× -28×       -76× -        @@ -157,8 +168,7 @@

      -  -375× +379× 12× 12× 12× @@ -169,6 +179,14 @@

      +28× +28× +  +  +  +  +  +        @@ -197,6 +215,18 @@

      +  +  +  +  +  +  +  +76× +  +  +  +   
//SPDX-License-Identifier: MPL-2.0
  
 pragma solidity ^0.8.20;
@@ -205,27 +235,22 @@ 

import "../../../libraries/Errors.sol"; import "../../../interfaces/engine/draft-IERC1643.sol"; abstract contract DocumentModule is AuthorizationModule, IERC1643 { + /* ============ Events ============ */ + /** + * @dev Emitted when a rule engine is set. + */ + event DocumentEngine(IERC1643 indexed newDocumentEngine); + + /* ============ ERC-7201 ============ */ bytes32 public constant DOCUMENT_ROLE = keccak256("DOCUMENT_ROLE"); // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.DocumentModule")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant DocumentModuleStorageLocation = 0x5edcb2767f407e647b6a4171ef53e8015a3eff0bb2b6e7765b1a26332bc43000; + /* ==== ERC-7201 State Variables === */ struct DocumentModuleStorage { IERC1643 _documentEngine; }   - function documentEngine() public view virtual returns (IERC1643) { - DocumentModuleStorage storage $ = _getDocumentModuleStorage(); - return $._documentEngine; - } -  - function _getDocumentModuleStorage() private pure returns (DocumentModuleStorage storage $) { - assembly { - $.slot := DocumentModuleStorageLocation - } - } - /** - * @dev Emitted when a rule engine is set. - */ - event DocumentEngine(IERC1643 indexed newDocumentEngine); + /* ============ Initializer Function ============ */ /** * @dev * @@ -241,6 +266,14 @@

emit DocumentEngine(documentEngine_); } } +  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ + function documentEngine() public view virtual returns (IERC1643) { + DocumentModuleStorage storage $ = _getDocumentModuleStorage(); + return $._documentEngine; + }   /* * @notice set an authorizationEngine if not already set @@ -273,6 +306,18 @@

documents = $._documentEngine.getAllDocuments(); } } +  +  + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ +  + /* ============ ERC-7201 ============ */ + function _getDocumentModuleStorage() private pure returns (DocumentModuleStorage storage $) { + assembly { + $.slot := DocumentModuleStorageLocation + } + } }  

@@ -280,7 +325,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol.html b/doc/general/test/coverage/contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol.html index 410d02e3..1b44a9d6 100644 --- a/doc/general/test/coverage/contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol.html +++ b/doc/general/test/coverage/contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol.html @@ -25,9 +25,9 @@

5/5
- 91.67% + 83.33% Branches - 11/12 + 10/12
100% @@ -119,7 +119,13 @@

74 75 76 -77  +77 +78 +79 +80  +  +  +        @@ -182,7 +188,7 @@

      -12× +14×       @@ -192,7 +198,7 @@

      -12× +10×      
//SPDX-License-Identifier: MPL-2.0
@@ -212,12 +218,15 @@ 

ERC20SnapshotModuleInternal, AuthorizationModule { - // SnapshotModule + /* ============ State Variables ============ */ bytes32 public constant SNAPSHOOTER_ROLE = keccak256("SNAPSHOOTER_ROLE"); + /* ============ Initializer Function ============ */ function __ERC20SnasphotModule_init_unchained() internal EonlyInitializing { // no variable to initialize } -  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @notice * Schedule a snapshot at the given time specified as a number of seconds since epoch. @@ -267,7 +276,7 @@

*/ function unscheduleSnapshotNotOptimized( uint256 time - ) public onlyRole(SNAPSHOOTER_ROLE) { + ) public EonlyRole(SNAPSHOOTER_ROLE) { _unscheduleSnapshotNotOptimized(time); } } @@ -277,7 +286,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/wrapper/extensions/MetaTxModule.sol.html b/doc/general/test/coverage/contracts/modules/wrapper/extensions/MetaTxModule.sol.html index d9002c2f..6e186086 100644 --- a/doc/general/test/coverage/contracts/modules/wrapper/extensions/MetaTxModule.sol.html +++ b/doc/general/test/coverage/contracts/modules/wrapper/extensions/MetaTxModule.sol.html @@ -89,7 +89,7 @@

  pragma solidity ^0.8.20;   -import "../../../../openzeppelin-contracts-upgradeable/contracts/metatx/ERC2771ContextUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/metatx/ERC2771ContextUpgradeable.sol";   /** * @dev Meta transaction (gasless) module. @@ -112,7 +112,7 @@

diff --git a/doc/general/test/coverage/contracts/modules/wrapper/extensions/index.html b/doc/general/test/coverage/contracts/modules/wrapper/extensions/index.html index 4ab46148..d00598d6 100644 --- a/doc/general/test/coverage/contracts/modules/wrapper/extensions/index.html +++ b/doc/general/test/coverage/contracts/modules/wrapper/extensions/index.html @@ -25,9 +25,9 @@

30/31
- 80.56% + 77.78% Branches - 29/36 + 28/36
100% @@ -89,8 +89,8 @@

100% 5/5 - 91.67% - 11/12 + 83.33% + 10/12 100% 6/6 100% @@ -116,7 +116,7 @@

diff --git a/doc/general/test/coverage/contracts/test/proxy/CMTAT_PROXY_TEST.sol.html b/doc/general/test/coverage/contracts/test/proxy/CMTAT_PROXY_TEST.sol.html index 877bdbe9..643ed222 100644 --- a/doc/general/test/coverage/contracts/test/proxy/CMTAT_PROXY_TEST.sol.html +++ b/doc/general/test/coverage/contracts/test/proxy/CMTAT_PROXY_TEST.sol.html @@ -112,7 +112,7 @@

diff --git a/doc/general/test/coverage/contracts/test/proxy/CMTAT_PROXY_TEST_UUPS.sol.html b/doc/general/test/coverage/contracts/test/proxy/CMTAT_PROXY_TEST_UUPS.sol.html index 35d655bb..e70a37ac 100644 --- a/doc/general/test/coverage/contracts/test/proxy/CMTAT_PROXY_TEST_UUPS.sol.html +++ b/doc/general/test/coverage/contracts/test/proxy/CMTAT_PROXY_TEST_UUPS.sol.html @@ -112,7 +112,7 @@

diff --git a/doc/general/test/coverage/contracts/test/proxy/index.html b/doc/general/test/coverage/contracts/test/proxy/index.html index 78dc763f..666beb15 100644 --- a/doc/general/test/coverage/contracts/test/proxy/index.html +++ b/doc/general/test/coverage/contracts/test/proxy/index.html @@ -90,7 +90,7 @@

diff --git a/doc/general/test/coverage/coverage-final.json b/doc/general/test/coverage/coverage-final.json index 4d7fe551..33bfe67c 100644 --- a/doc/general/test/coverage/coverage-final.json +++ b/doc/general/test/coverage/coverage-final.json @@ -1,38 +1,42 @@ { -"contracts/CMTAT_PROXY_UUPS.sol":{"l":{"18":6,"42":3,"50":3},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/CMTAT_PROXY_UUPS.sol","s":{"1":6,"2":3,"3":3},"b":{"1":[3,0],"2":[2,1]},"f":{"1":6,"2":3,"3":2},"fnMap":{"1":{"name":"constructor","line":16,"loc":{"start":{"line":14,"column":4},"end":{"line":19,"column":4}}},"2":{"name":"initialize","line":41,"loc":{"start":{"line":34,"column":4},"end":{"line":51,"column":4}}},"3":{"name":"_authorizeUpgrade","line":53,"loc":{"start":{"line":53,"column":4},"end":{"line":53,"column":88}}}},"statementMap":{"1":{"start":{"line":18,"column":8},"end":{"line":18,"column":29}},"2":{"start":{"line":42,"column":8},"end":{"line":42,"column":1893}},"3":{"start":{"line":50,"column":8},"end":{"line":50,"column":41}}},"branchMap":{"1":{"line":41,"type":"if","locations":[{"start":{"line":41,"column":55},"end":{"line":41,"column":55}},{"start":{"line":41,"column":55},"end":{"line":41,"column":55}}]},"2":{"line":53,"type":"if","locations":[{"start":{"line":53,"column":58},"end":{"line":53,"column":58}},{"start":{"line":53,"column":58},"end":{"line":53,"column":58}}]}}}, -"contracts/CMTAT_PROXY.sol":{"l":{"17":194},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/CMTAT_PROXY.sol","s":{"1":194},"b":{},"f":{"1":194},"fnMap":{"1":{"name":"constructor","line":15,"loc":{"start":{"line":13,"column":4},"end":{"line":18,"column":4}}}},"statementMap":{"1":{"start":{"line":17,"column":8},"end":{"line":17,"column":29}}},"branchMap":{}}, -"contracts/CMTAT_STANDALONE.sol":{"l":{"34":189},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/CMTAT_STANDALONE.sol","s":{"1":189},"b":{},"f":{"1":189},"fnMap":{"1":{"name":"constructor","line":31,"loc":{"start":{"line":21,"column":4},"end":{"line":44,"column":4}}}},"statementMap":{"1":{"start":{"line":34,"column":8},"end":{"line":34,"column":1389}}},"branchMap":{}}, -"contracts/deployment/CMTAT_BEACON_FACTORY.sol":{"l":{"34":6,"35":1,"37":5,"38":1,"40":4,"41":1,"43":3,"44":3,"45":3,"63":2,"77":2,"78":2,"79":2,"80":2,"81":2,"89":1,"97":1},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/deployment/CMTAT_BEACON_FACTORY.sol","s":{"1":6,"2":5,"3":4,"4":3,"5":3,"6":2,"7":2,"8":2,"9":1,"10":1},"b":{"1":[1,5],"2":[1,4],"3":[1,3],"4":[2,1]},"f":{"1":6,"2":2,"3":1,"4":1},"fnMap":{"1":{"name":"constructor","line":33,"loc":{"start":{"line":33,"column":4},"end":{"line":46,"column":4}}},"2":{"name":"deployCMTAT","line":62,"loc":{"start":{"line":52,"column":4},"end":{"line":82,"column":4}}},"3":{"name":"getCMTATAddress","line":88,"loc":{"start":{"line":88,"column":4},"end":{"line":90,"column":4}}},"4":{"name":"implementation","line":96,"loc":{"start":{"line":96,"column":4},"end":{"line":98,"column":4}}}},"statementMap":{"1":{"start":{"line":34,"column":8},"end":{"line":34,"column":1101}},"2":{"start":{"line":37,"column":8},"end":{"line":37,"column":1239}},"3":{"start":{"line":40,"column":8},"end":{"line":40,"column":1375}},"4":{"start":{"line":44,"column":8},"end":{"line":44,"column":51}},"5":{"start":{"line":45,"column":8},"end":{"line":45,"column":52}},"6":{"start":{"line":78,"column":8},"end":{"line":78,"column":50}},"7":{"start":{"line":80,"column":8},"end":{"line":80,"column":38}},"8":{"start":{"line":81,"column":8},"end":{"line":81,"column":20}},"9":{"start":{"line":89,"column":8},"end":{"line":89,"column":31}},"10":{"start":{"line":97,"column":8},"end":{"line":97,"column":38}}},"branchMap":{"1":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":8},"end":{"line":34,"column":8}},{"start":{"line":34,"column":8},"end":{"line":34,"column":8}}]},"2":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":8},"end":{"line":37,"column":8}},{"start":{"line":37,"column":8},"end":{"line":37,"column":8}}]},"3":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":8},"end":{"line":40,"column":8}},{"start":{"line":40,"column":8},"end":{"line":40,"column":8}}]},"4":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":13},"end":{"line":62,"column":13}},{"start":{"line":62,"column":13},"end":{"line":62,"column":13}}]}}}, -"contracts/deployment/CMTAT_TP_FACTORY.sol":{"l":{"45":9,"46":1,"48":8,"49":1,"51":7,"52":4,"54":7,"55":7,"56":7,"68":7,"69":5,"72":5,"74":5,"88":2,"91":2,"99":5,"108":7,"109":5,"110":2,"112":3,"113":3,"116":2,"124":5,"125":5,"126":5,"127":5,"128":5,"129":5,"130":5,"140":7,"150":7,"162":7},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/deployment/CMTAT_TP_FACTORY.sol","s":{"1":9,"2":8,"3":7,"4":7,"5":7,"6":7,"7":5,"8":5,"9":2,"10":2,"11":5,"12":7,"13":5,"14":5,"15":5,"16":5,"17":5,"18":7,"19":7},"b":{"1":[1,8],"2":[1,7],"3":[4,3],"4":[7,2],"5":[5,2],"6":[2,3]},"f":{"1":9,"2":7,"3":2,"4":5,"5":7,"6":5,"7":7,"8":7},"fnMap":{"1":{"name":"constructor","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":57,"column":4}}},"2":{"name":"deployCMTAT","line":67,"loc":{"start":{"line":62,"column":4},"end":{"line":75,"column":4}}},"3":{"name":"computedProxyAddress","line":83,"loc":{"start":{"line":83,"column":4},"end":{"line":92,"column":4}}},"4":{"name":"CMTATProxyAddress","line":98,"loc":{"start":{"line":98,"column":4},"end":{"line":100,"column":4}}},"5":{"name":"_checkAndDetermineDeploymentSalt","line":107,"loc":{"start":{"line":107,"column":4},"end":{"line":118,"column":4}}},"6":{"name":"_deployBytecode","line":123,"loc":{"start":{"line":123,"column":4},"end":{"line":131,"column":5}}},"7":{"name":"_getBytecode","line":137,"loc":{"start":{"line":137,"column":5},"end":{"line":151,"column":5}}},"8":{"name":"_encodeImplementationArgument","line":154,"loc":{"start":{"line":154,"column":4},"end":{"line":173,"column":4}}}},"statementMap":{"1":{"start":{"line":45,"column":8},"end":{"line":45,"column":1375}},"2":{"start":{"line":48,"column":8},"end":{"line":48,"column":1508}},"3":{"start":{"line":51,"column":8},"end":{"line":51,"column":1646}},"4":{"start":{"line":55,"column":8},"end":{"line":55,"column":51}},"5":{"start":{"line":56,"column":8},"end":{"line":56,"column":52}},"6":{"start":{"line":68,"column":8},"end":{"line":68,"column":86}},"7":{"start":{"line":69,"column":8},"end":{"line":69,"column":2327}},"8":{"start":{"line":74,"column":8},"end":{"line":74,"column":20}},"9":{"start":{"line":88,"column":8},"end":{"line":88,"column":3011}},"10":{"start":{"line":91,"column":8},"end":{"line":91,"column":91}},"11":{"start":{"line":99,"column":8},"end":{"line":99,"column":31}},"12":{"start":{"line":108,"column":7},"end":{"line":108,"column":3674}},"13":{"start":{"line":109,"column":12},"end":{"line":109,"column":3709}},"14":{"start":{"line":124,"column":20},"end":{"line":124,"column":86}},"15":{"start":{"line":127,"column":20},"end":{"line":127,"column":55}},"16":{"start":{"line":129,"column":20},"end":{"line":129,"column":50}},"17":{"start":{"line":130,"column":20},"end":{"line":130,"column":32}},"18":{"start":{"line":140,"column":8},"end":{"line":140,"column":4931}},"19":{"start":{"line":162,"column":8},"end":{"line":162,"column":5822}}},"branchMap":{"1":{"line":45,"type":"if","locations":[{"start":{"line":45,"column":8},"end":{"line":45,"column":8}},{"start":{"line":45,"column":8},"end":{"line":45,"column":8}}]},"2":{"line":48,"type":"if","locations":[{"start":{"line":48,"column":8},"end":{"line":48,"column":8}},{"start":{"line":48,"column":8},"end":{"line":48,"column":8}}]},"3":{"line":51,"type":"if","locations":[{"start":{"line":51,"column":8},"end":{"line":51,"column":8}},{"start":{"line":51,"column":8},"end":{"line":51,"column":8}}]},"4":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":13},"end":{"line":67,"column":13}},{"start":{"line":67,"column":13},"end":{"line":67,"column":13}}]},"5":{"line":108,"type":"if","locations":[{"start":{"line":108,"column":7},"end":{"line":108,"column":7}},{"start":{"line":108,"column":7},"end":{"line":108,"column":7}}]},"6":{"line":109,"type":"if","locations":[{"start":{"line":109,"column":12},"end":{"line":109,"column":12}},{"start":{"line":109,"column":12},"end":{"line":109,"column":12}}]}}}, +"contracts/CMTAT_PROXY_UUPS.sol":{"l":{"17":9,"37":5,"41":5},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/CMTAT_PROXY_UUPS.sol","s":{"1":9,"2":5,"3":5},"b":{"1":[5,0],"2":[2,1]},"f":{"1":9,"2":5,"3":2},"fnMap":{"1":{"name":"constructor","line":15,"loc":{"start":{"line":13,"column":4},"end":{"line":18,"column":4}}},"2":{"name":"initialize","line":36,"loc":{"start":{"line":33,"column":4},"end":{"line":42,"column":4}}},"3":{"name":"_authorizeUpgrade","line":48,"loc":{"start":{"line":48,"column":4},"end":{"line":48,"column":88}}}},"statementMap":{"1":{"start":{"line":17,"column":8},"end":{"line":17,"column":29}},"2":{"start":{"line":37,"column":8},"end":{"line":37,"column":1635}},"3":{"start":{"line":41,"column":8},"end":{"line":41,"column":41}}},"branchMap":{"1":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":67},"end":{"line":36,"column":67}},{"start":{"line":36,"column":67},"end":{"line":36,"column":67}}]},"2":{"line":48,"type":"if","locations":[{"start":{"line":48,"column":58},"end":{"line":48,"column":58}},{"start":{"line":48,"column":58},"end":{"line":48,"column":58}}]}}}, +"contracts/CMTAT_PROXY.sol":{"l":{"17":197},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/CMTAT_PROXY.sol","s":{"1":197},"b":{},"f":{"1":197},"fnMap":{"1":{"name":"constructor","line":15,"loc":{"start":{"line":13,"column":4},"end":{"line":18,"column":4}}}},"statementMap":{"1":{"start":{"line":17,"column":8},"end":{"line":17,"column":29}}},"branchMap":{}}, +"contracts/CMTAT_STANDALONE.sol":{"l":{"26":189},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/CMTAT_STANDALONE.sol","s":{"1":189},"b":{},"f":{"1":189},"fnMap":{"1":{"name":"constructor","line":23,"loc":{"start":{"line":17,"column":4},"end":{"line":32,"column":4}}}},"statementMap":{"1":{"start":{"line":26,"column":8},"end":{"line":26,"column":1038}}},"branchMap":{}}, +"contracts/deployment/CMTAT_BEACON_FACTORY.sol":{"l":{"25":8,"26":1,"28":7,"29":1,"31":6,"43":2,"44":2,"47":2,"48":2,"60":2,"63":2,"70":2,"71":2,"72":2,"73":2,"74":2,"75":2,"76":2,"86":4,"93":4,"101":1},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/deployment/CMTAT_BEACON_FACTORY.sol","s":{"1":8,"2":7,"3":2,"4":2,"5":2,"6":2,"7":2,"8":2,"9":2,"10":2,"11":2,"12":4,"13":1},"b":{"1":[1,7],"2":[1,6],"3":[2,1]},"f":{"1":8,"2":2,"3":2,"4":2,"5":4,"6":1},"fnMap":{"1":{"name":"constructor","line":24,"loc":{"start":{"line":24,"column":4},"end":{"line":32,"column":4}}},"2":{"name":"deployCMTAT","line":42,"loc":{"start":{"line":38,"column":4},"end":{"line":49,"column":4}}},"3":{"name":"computedProxyAddress","line":56,"loc":{"start":{"line":56,"column":4},"end":{"line":64,"column":4}}},"4":{"name":"_deployBytecode","line":69,"loc":{"start":{"line":69,"column":4},"end":{"line":77,"column":5}}},"5":{"name":"_getBytecode","line":83,"loc":{"start":{"line":83,"column":5},"end":{"line":94,"column":5}}},"6":{"name":"implementation","line":100,"loc":{"start":{"line":100,"column":4},"end":{"line":102,"column":4}}}},"statementMap":{"1":{"start":{"line":25,"column":8},"end":{"line":25,"column":784}},"2":{"start":{"line":28,"column":8},"end":{"line":28,"column":920}},"3":{"start":{"line":43,"column":8},"end":{"line":43,"column":86}},"4":{"start":{"line":44,"column":8},"end":{"line":44,"column":1531}},"5":{"start":{"line":48,"column":8},"end":{"line":48,"column":20}},"6":{"start":{"line":60,"column":8},"end":{"line":60,"column":2109}},"7":{"start":{"line":63,"column":8},"end":{"line":63,"column":91}},"8":{"start":{"line":70,"column":20},"end":{"line":70,"column":86}},"9":{"start":{"line":73,"column":20},"end":{"line":73,"column":62}},"10":{"start":{"line":75,"column":20},"end":{"line":75,"column":50}},"11":{"start":{"line":76,"column":20},"end":{"line":76,"column":32}},"12":{"start":{"line":86,"column":8},"end":{"line":86,"column":3140}},"13":{"start":{"line":101,"column":8},"end":{"line":101,"column":38}}},"branchMap":{"1":{"line":25,"type":"if","locations":[{"start":{"line":25,"column":8},"end":{"line":25,"column":8}},{"start":{"line":25,"column":8},"end":{"line":25,"column":8}}]},"2":{"line":28,"type":"if","locations":[{"start":{"line":28,"column":8},"end":{"line":28,"column":8}},{"start":{"line":28,"column":8},"end":{"line":28,"column":8}}]},"3":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":13},"end":{"line":42,"column":13}},{"start":{"line":42,"column":13},"end":{"line":42,"column":13}}]}}}, +"contracts/deployment/CMTAT_TP_FACTORY.sol":{"l":{"26":7,"27":5,"30":5,"32":5,"46":2,"49":2,"56":5,"57":5,"58":5,"59":5,"60":5,"61":5,"62":5,"72":7,"79":7},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/deployment/CMTAT_TP_FACTORY.sol","s":{"1":7,"2":5,"3":5,"4":2,"5":2,"6":5,"7":5,"8":5,"9":5,"10":7},"b":{"1":[7,2]},"f":{"1":9,"2":7,"3":2,"4":5,"5":7},"fnMap":{"1":{"name":"constructor","line":16,"loc":{"start":{"line":16,"column":4},"end":{"line":16,"column":129}}},"2":{"name":"deployCMTAT","line":25,"loc":{"start":{"line":20,"column":4},"end":{"line":33,"column":4}}},"3":{"name":"computedProxyAddress","line":41,"loc":{"start":{"line":41,"column":4},"end":{"line":50,"column":4}}},"4":{"name":"_deployBytecode","line":55,"loc":{"start":{"line":55,"column":4},"end":{"line":63,"column":5}}},"5":{"name":"_getBytecode","line":69,"loc":{"start":{"line":69,"column":5},"end":{"line":80,"column":5}}}},"statementMap":{"1":{"start":{"line":26,"column":8},"end":{"line":26,"column":86}},"2":{"start":{"line":27,"column":8},"end":{"line":27,"column":1102}},"3":{"start":{"line":32,"column":8},"end":{"line":32,"column":20}},"4":{"start":{"line":46,"column":8},"end":{"line":46,"column":1786}},"5":{"start":{"line":49,"column":8},"end":{"line":49,"column":91}},"6":{"start":{"line":56,"column":20},"end":{"line":56,"column":86}},"7":{"start":{"line":59,"column":20},"end":{"line":59,"column":62}},"8":{"start":{"line":61,"column":20},"end":{"line":61,"column":50}},"9":{"start":{"line":62,"column":20},"end":{"line":62,"column":32}},"10":{"start":{"line":72,"column":8},"end":{"line":72,"column":2889}}},"branchMap":{"1":{"line":25,"type":"if","locations":[{"start":{"line":25,"column":13},"end":{"line":25,"column":13}},{"start":{"line":25,"column":13},"end":{"line":25,"column":13}}]}}}, +"contracts/deployment/CMTAT_UUPS_FACTORY.sol":{"l":{"31":2,"32":2,"35":2,"37":2,"49":2,"52":2,"63":2,"64":2,"65":2,"66":2,"67":2,"68":2,"69":2,"79":4,"86":4},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/deployment/CMTAT_UUPS_FACTORY.sol","s":{"1":2,"2":2,"3":2,"4":2,"5":2,"6":2,"7":2,"8":2,"9":2,"10":4},"b":{"1":[2,1]},"f":{"1":5,"2":2,"3":2,"4":2,"5":4},"fnMap":{"1":{"name":"constructor","line":20,"loc":{"start":{"line":20,"column":4},"end":{"line":20,"column":129}}},"2":{"name":"deployCMTAT","line":30,"loc":{"start":{"line":26,"column":4},"end":{"line":38,"column":4}}},"3":{"name":"computedProxyAddress","line":45,"loc":{"start":{"line":45,"column":4},"end":{"line":53,"column":4}}},"4":{"name":"_deployBytecode","line":62,"loc":{"start":{"line":62,"column":4},"end":{"line":70,"column":5}}},"5":{"name":"_getBytecode","line":76,"loc":{"start":{"line":76,"column":5},"end":{"line":87,"column":5}}}},"statementMap":{"1":{"start":{"line":31,"column":8},"end":{"line":31,"column":86}},"2":{"start":{"line":32,"column":8},"end":{"line":32,"column":1197}},"3":{"start":{"line":37,"column":8},"end":{"line":37,"column":20}},"4":{"start":{"line":49,"column":8},"end":{"line":49,"column":1784}},"5":{"start":{"line":52,"column":8},"end":{"line":52,"column":91}},"6":{"start":{"line":63,"column":20},"end":{"line":63,"column":86}},"7":{"start":{"line":66,"column":20},"end":{"line":66,"column":62}},"8":{"start":{"line":68,"column":20},"end":{"line":68,"column":50}},"9":{"start":{"line":69,"column":20},"end":{"line":69,"column":32}},"10":{"start":{"line":79,"column":8},"end":{"line":79,"column":3003}}},"branchMap":{"1":{"line":30,"type":"if","locations":[{"start":{"line":30,"column":13},"end":{"line":30,"column":13}},{"start":{"line":30,"column":13},"end":{"line":30,"column":13}}]}}}, +"contracts/deployment/libraries/CMTATFactoryBase.sol":{"l":{"19":16,"20":2,"22":14},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/deployment/libraries/CMTATFactoryBase.sol","s":{"1":16},"b":{"1":[2,14]},"f":{"1":16},"fnMap":{"1":{"name":"constructor","line":18,"loc":{"start":{"line":18,"column":4},"end":{"line":23,"column":4}}}},"statementMap":{"1":{"start":{"line":19,"column":8},"end":{"line":19,"column":573}}},"branchMap":{"1":{"line":19,"type":"if","locations":[{"start":{"line":19,"column":8},"end":{"line":19,"column":8}},{"start":{"line":19,"column":8},"end":{"line":19,"column":8}}]}}}, +"contracts/deployment/libraries/CMTATFactoryInvariant.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/deployment/libraries/CMTATFactoryInvariant.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/deployment/libraries/CMTATFactoryRoot.sol":{"l":{"26":27,"27":3,"29":24,"30":15,"32":24,"33":24,"41":13,"50":11,"51":5,"52":2,"54":3,"55":3,"58":6},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/deployment/libraries/CMTATFactoryRoot.sol","s":{"1":27,"2":24,"3":24,"4":24,"5":13,"6":11,"7":5},"b":{"1":[3,24],"2":[15,9],"3":[5,6],"4":[2,3]},"f":{"1":27,"2":13,"3":11},"fnMap":{"1":{"name":"constructor","line":25,"loc":{"start":{"line":25,"column":4},"end":{"line":34,"column":4}}},"2":{"name":"CMTATProxyAddress","line":40,"loc":{"start":{"line":40,"column":4},"end":{"line":42,"column":4}}},"3":{"name":"_checkAndDetermineDeploymentSalt","line":49,"loc":{"start":{"line":49,"column":4},"end":{"line":60,"column":4}}}},"statementMap":{"1":{"start":{"line":26,"column":8},"end":{"line":26,"column":867}},"2":{"start":{"line":29,"column":8},"end":{"line":29,"column":1005}},"3":{"start":{"line":32,"column":8},"end":{"line":32,"column":51}},"4":{"start":{"line":33,"column":8},"end":{"line":33,"column":52}},"5":{"start":{"line":41,"column":8},"end":{"line":41,"column":38}},"6":{"start":{"line":50,"column":7},"end":{"line":50,"column":1673}},"7":{"start":{"line":51,"column":12},"end":{"line":51,"column":1708}}},"branchMap":{"1":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":8},"end":{"line":26,"column":8}},{"start":{"line":26,"column":8},"end":{"line":26,"column":8}}]},"2":{"line":29,"type":"if","locations":[{"start":{"line":29,"column":8},"end":{"line":29,"column":8}},{"start":{"line":29,"column":8},"end":{"line":29,"column":8}}]},"3":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":7},"end":{"line":50,"column":7}},{"start":{"line":50,"column":7},"end":{"line":50,"column":7}}]},"4":{"line":51,"type":"if","locations":[{"start":{"line":51,"column":12},"end":{"line":51,"column":12}},{"start":{"line":51,"column":12},"end":{"line":51,"column":12}}]}}}, "contracts/interfaces/draft-IERC1404/draft-IERC1404.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/draft-IERC1404/draft-IERC1404.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, "contracts/interfaces/draft-IERC1404/draft-IERC1404EnumCode.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/draft-IERC1404/draft-IERC1404EnumCode.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, "contracts/interfaces/draft-IERC1404/draft-IERC1404Wrapper.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/draft-IERC1404/draft-IERC1404Wrapper.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, "contracts/interfaces/engine/draft-IERC1643.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/engine/draft-IERC1643.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, "contracts/interfaces/engine/IAuthorizationEngine.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/engine/IAuthorizationEngine.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, "contracts/interfaces/engine/IDebtEngine.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/engine/IDebtEngine.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/interfaces/engine/IEngine.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/engine/IEngine.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, "contracts/interfaces/engine/IRuleEngine.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/engine/IRuleEngine.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, "contracts/interfaces/ICCIPToken.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/ICCIPToken.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, +"contracts/interfaces/ICMTATConstructor.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/ICMTATConstructor.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, "contracts/interfaces/ICMTATSnapshot.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/ICMTATSnapshot.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, "contracts/interfaces/IDebtGlobal.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/IDebtGlobal.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, "contracts/libraries/Errors.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/libraries/Errors.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, "contracts/libraries/FactoryErrors.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/libraries/FactoryErrors.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}}, -"contracts/modules/CMTAT_BASE.sol":{"l":{"68":377,"95":377,"96":377,"98":377,"100":377,"101":377,"104":377,"109":377,"110":377,"112":377,"116":377,"117":375,"118":375,"120":375,"121":375,"123":375,"124":375,"130":375,"131":375,"132":375,"135":375,"138":375,"155":2,"168":10,"183":6,"184":4,"196":437,"197":17,"204":420,"205":420,"218":1381,"227":1381,"239":0},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/CMTAT_BASE.sol","s":{"1":377,"2":377,"3":377,"4":377,"5":377,"6":377,"7":377,"8":377,"9":377,"10":377,"11":377,"12":375,"13":375,"14":375,"15":375,"16":375,"17":375,"18":375,"19":375,"20":375,"21":375,"22":375,"23":2,"24":10,"25":6,"26":4,"27":437,"28":420,"29":420,"30":1381,"31":1381,"32":0},"b":{"1":[377,1],"2":[377,0],"3":[375,0],"4":[17,420]},"f":{"1":377,"2":377,"3":375,"4":2,"5":10,"6":6,"7":437,"8":1381,"9":1381,"10":0},"fnMap":{"1":{"name":"initialize","line":67,"loc":{"start":{"line":58,"column":4},"end":{"line":78,"column":4}}},"2":{"name":"__CMTAT_init","line":92,"loc":{"start":{"line":83,"column":4},"end":{"line":139,"column":4}}},"3":{"name":"__CMTAT_init_unchained","line":141,"loc":{"start":{"line":141,"column":4},"end":{"line":143,"column":4}}},"4":{"name":"decimals","line":148,"loc":{"start":{"line":148,"column":4},"end":{"line":156,"column":4}}},"5":{"name":"transferFrom","line":158,"loc":{"start":{"line":158,"column":4},"end":{"line":169,"column":4}}},"6":{"name":"burnAndMint","line":182,"loc":{"start":{"line":182,"column":4},"end":{"line":185,"column":4}}},"7":{"name":"_update","line":191,"loc":{"start":{"line":191,"column":4},"end":{"line":206,"column":4}}},"8":{"name":"_msgSender","line":212,"loc":{"start":{"line":212,"column":4},"end":{"line":219,"column":4}}},"9":{"name":"_contextSuffixLength","line":224,"loc":{"start":{"line":224,"column":4},"end":{"line":228,"column":4}}},"10":{"name":"_msgData","line":233,"loc":{"start":{"line":233,"column":4},"end":{"line":240,"column":4}}}},"statementMap":{"1":{"start":{"line":68,"column":8},"end":{"line":68,"column":2356}},"2":{"start":{"line":95,"column":8},"end":{"line":95,"column":33}},"3":{"start":{"line":96,"column":8},"end":{"line":96,"column":65}},"4":{"start":{"line":98,"column":8},"end":{"line":98,"column":32}},"5":{"start":{"line":100,"column":8},"end":{"line":100,"column":39}},"6":{"start":{"line":101,"column":8},"end":{"line":101,"column":34}},"7":{"start":{"line":104,"column":8},"end":{"line":104,"column":37}},"8":{"start":{"line":109,"column":8},"end":{"line":109,"column":44}},"9":{"start":{"line":110,"column":8},"end":{"line":110,"column":39}},"10":{"start":{"line":112,"column":8},"end":{"line":112,"column":54}},"11":{"start":{"line":116,"column":8},"end":{"line":116,"column":79}},"12":{"start":{"line":117,"column":8},"end":{"line":117,"column":41}},"13":{"start":{"line":118,"column":8},"end":{"line":118,"column":41}},"14":{"start":{"line":120,"column":8},"end":{"line":120,"column":43}},"15":{"start":{"line":121,"column":8},"end":{"line":121,"column":60}},"16":{"start":{"line":123,"column":8},"end":{"line":123,"column":37}},"17":{"start":{"line":124,"column":8},"end":{"line":124,"column":42}},"18":{"start":{"line":130,"column":8},"end":{"line":130,"column":45}},"19":{"start":{"line":131,"column":8},"end":{"line":131,"column":62}},"20":{"start":{"line":132,"column":8},"end":{"line":132,"column":54}},"21":{"start":{"line":135,"column":8},"end":{"line":135,"column":60}},"22":{"start":{"line":138,"column":8},"end":{"line":138,"column":31}},"23":{"start":{"line":155,"column":8},"end":{"line":155,"column":41}},"24":{"start":{"line":168,"column":8},"end":{"line":168,"column":70}},"25":{"start":{"line":183,"column":8},"end":{"line":183,"column":39}},"26":{"start":{"line":184,"column":8},"end":{"line":184,"column":29}},"27":{"start":{"line":196,"column":8},"end":{"line":196,"column":6535}},"28":{"start":{"line":204,"column":8},"end":{"line":204,"column":60}},"29":{"start":{"line":205,"column":8},"end":{"line":205,"column":49}},"30":{"start":{"line":218,"column":8},"end":{"line":218,"column":53}},"31":{"start":{"line":227,"column":9},"end":{"line":227,"column":64}},"32":{"start":{"line":239,"column":8},"end":{"line":239,"column":51}}},"branchMap":{"1":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":21},"end":{"line":67,"column":21}},{"start":{"line":67,"column":21},"end":{"line":67,"column":21}}]},"2":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":15},"end":{"line":92,"column":15}},{"start":{"line":92,"column":15},"end":{"line":92,"column":15}}]},"3":{"line":141,"type":"if","locations":[{"start":{"line":141,"column":47},"end":{"line":141,"column":47}},{"start":{"line":141,"column":47},"end":{"line":141,"column":47}}]},"4":{"line":196,"type":"if","locations":[{"start":{"line":196,"column":8},"end":{"line":196,"column":8}},{"start":{"line":196,"column":8},"end":{"line":196,"column":8}}]}}}, -"contracts/modules/internal/base/SnapshotModuleBase.sol":{"l":{"75":2,"83":76,"85":76,"86":68,"91":68,"92":48,"95":20,"97":8,"100":8,"102":8,"103":12,"110":28,"120":170,"122":168,"124":94,"127":94,"128":2,"134":2,"137":164,"138":164,"142":202,"143":6,"150":46,"151":6,"159":12,"160":10,"162":10,"163":2,"166":8,"167":2,"169":6,"172":6,"173":10,"174":10,"175":10,"178":6,"180":8,"188":22,"189":20,"190":18,"191":2,"193":16,"194":16,"195":4,"197":12,"198":8,"199":8,"200":2,"206":2,"209":8,"210":4,"211":2,"217":6,"219":6,"227":12,"228":10,"229":2,"232":8,"233":2,"235":6,"236":6,"246":12,"247":10,"248":10,"249":2,"252":8,"253":16,"255":8,"283":1920,"285":1920,"286":1484,"288":436,"302":840,"303":840,"304":36,"305":36,"315":420,"319":420,"320":18,"321":18,"331":840,"332":832,"334":8,"345":36,"346":36,"348":36,"352":22,"356":8,"360":6,"373":488,"375":488,"379":402,"382":86,"383":86,"385":86,"386":116,"387":52,"388":52,"391":64,"394":86},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/internal/base/SnapshotModuleBase.sol","s":{"1":2,"2":76,"3":76,"4":68,"5":68,"6":48,"7":20,"8":8,"9":8,"10":28,"11":170,"12":168,"13":94,"14":94,"15":92,"16":164,"17":164,"18":202,"19":46,"20":12,"21":10,"22":10,"23":8,"24":2,"25":6,"26":6,"27":8,"28":22,"29":20,"30":18,"31":16,"32":16,"33":12,"34":8,"35":8,"36":6,"37":8,"38":4,"39":6,"40":12,"41":10,"42":8,"43":6,"44":6,"45":12,"46":10,"47":10,"48":8,"49":8,"50":1920,"51":1920,"52":1484,"53":436,"54":840,"55":840,"56":36,"57":36,"58":420,"59":420,"60":840,"61":832,"62":8,"63":36,"64":36,"65":36,"66":22,"67":14,"68":8,"69":6,"70":488,"71":488,"72":402,"73":86,"74":86,"75":116,"76":86},"b":{"1":[377,0],"2":[68,8],"3":[48,20],"4":[8,12],"5":[94,74],"6":[2,92],"7":[2,90],"8":[6,196],"9":[6,40],"10":[2,8],"11":[2,6],"12":[2,16],"13":[4,12],"14":[8,4],"15":[2,6],"16":[2,4],"17":[4,4],"18":[2,2],"19":[2,8],"20":[2,6],"21":[2,8],"22":[1484,436],"23":[36,804],"24":[18,402],"25":[832,8],"26":[22,14],"27":[8,6],"28":[402,86],"29":[402,0],"30":[52,64]},"f":{"1":377,"2":2,"3":76,"4":170,"5":202,"6":46,"7":12,"8":22,"9":12,"10":12,"11":1920,"12":840,"13":420,"14":840,"15":36,"16":488},"fnMap":{"1":{"name":"__SnapshotModuleBase_init_unchained","line":64,"loc":{"start":{"line":64,"column":4},"end":{"line":67,"column":4}}},"2":{"name":"getAllSnapshots","line":74,"loc":{"start":{"line":74,"column":4},"end":{"line":76,"column":4}}},"3":{"name":"getNextSnapshots","line":82,"loc":{"start":{"line":82,"column":4},"end":{"line":111,"column":4}}},"4":{"name":"_scheduleSnapshot","line":118,"loc":{"start":{"line":118,"column":4},"end":{"line":139,"column":4}}},"5":{"name":"_checkTimeInThePast","line":141,"loc":{"start":{"line":141,"column":4},"end":{"line":148,"column":4}}},"6":{"name":"_checkTimeSnapshotAlreadyDone","line":149,"loc":{"start":{"line":149,"column":4},"end":{"line":153,"column":4}}},"7":{"name":"_scheduleSnapshotNotOptimized","line":158,"loc":{"start":{"line":158,"column":4},"end":{"line":181,"column":4}}},"8":{"name":"_rescheduleSnapshot","line":186,"loc":{"start":{"line":186,"column":4},"end":{"line":220,"column":4}}},"9":{"name":"_unscheduleLastSnapshot","line":225,"loc":{"start":{"line":225,"column":4},"end":{"line":237,"column":4}}},"10":{"name":"_unscheduleSnapshotNotOptimized","line":245,"loc":{"start":{"line":245,"column":4},"end":{"line":256,"column":4}}},"11":{"name":"_valueAt","line":265,"loc":{"start":{"line":265,"column":4},"end":{"line":290,"column":4}}},"12":{"name":"_updateSnapshot","line":298,"loc":{"start":{"line":298,"column":4},"end":{"line":307,"column":4}}},"13":{"name":"_setCurrentSnapshot","line":314,"loc":{"start":{"line":314,"column":4},"end":{"line":323,"column":4}}},"14":{"name":"_lastSnapshot","line":328,"loc":{"start":{"line":328,"column":4},"end":{"line":336,"column":4}}},"15":{"name":"_findScheduledSnapshotIndex","line":342,"loc":{"start":{"line":342,"column":4},"end":{"line":362,"column":4}}},"16":{"name":"_findScheduledMostRecentPastSnapshot","line":368,"loc":{"start":{"line":368,"column":4},"end":{"line":395,"column":4}}}},"statementMap":{"1":{"start":{"line":75,"column":8},"end":{"line":75,"column":34}},"2":{"start":{"line":83,"column":8},"end":{"line":83,"column":65}},"3":{"start":{"line":85,"column":8},"end":{"line":85,"column":2651}},"4":{"start":{"line":86,"column":12},"end":{"line":86,"column":2747}},"5":{"start":{"line":91,"column":12},"end":{"line":91,"column":2910}},"6":{"start":{"line":92,"column":16},"end":{"line":92,"column":42}},"7":{"start":{"line":95,"column":16},"end":{"line":95,"column":3116}},"8":{"start":{"line":97,"column":20},"end":{"line":97,"column":3304}},"9":{"start":{"line":102,"column":20},"end":{"line":102,"column":3580}},"10":{"start":{"line":110,"column":8},"end":{"line":110,"column":36}},"11":{"start":{"line":120,"column":7},"end":{"line":120,"column":31}},"12":{"start":{"line":122,"column":8},"end":{"line":122,"column":4163}},"13":{"start":{"line":124,"column":12},"end":{"line":124,"column":4272}},"14":{"start":{"line":127,"column":12},"end":{"line":127,"column":4393}},"15":{"start":{"line":133,"column":19},"end":{"line":133,"column":4646}},"16":{"start":{"line":137,"column":8},"end":{"line":137,"column":37}},"17":{"start":{"line":138,"column":8},"end":{"line":138,"column":38}},"18":{"start":{"line":142,"column":8},"end":{"line":142,"column":4939}},"19":{"start":{"line":150,"column":8},"end":{"line":150,"column":5242}},"20":{"start":{"line":159,"column":8},"end":{"line":159,"column":32}},"21":{"start":{"line":160,"column":8},"end":{"line":160,"column":73}},"22":{"start":{"line":162,"column":8},"end":{"line":162,"column":5640}},"23":{"start":{"line":166,"column":8},"end":{"line":166,"column":5831}},"24":{"start":{"line":167,"column":12},"end":{"line":167,"column":41}},"25":{"start":{"line":169,"column":12},"end":{"line":169,"column":5951}},"26":{"start":{"line":172,"column":12},"end":{"line":172,"column":6072}},"27":{"start":{"line":180,"column":8},"end":{"line":180,"column":38}},"28":{"start":{"line":188,"column":8},"end":{"line":188,"column":45}},"29":{"start":{"line":189,"column":8},"end":{"line":189,"column":35}},"30":{"start":{"line":190,"column":8},"end":{"line":190,"column":6716}},"31":{"start":{"line":193,"column":8},"end":{"line":193,"column":77}},"32":{"start":{"line":194,"column":8},"end":{"line":194,"column":6922}},"33":{"start":{"line":197,"column":8},"end":{"line":197,"column":7024}},"34":{"start":{"line":198,"column":12},"end":{"line":198,"column":69}},"35":{"start":{"line":199,"column":12},"end":{"line":199,"column":7157}},"36":{"start":{"line":205,"column":19},"end":{"line":205,"column":7415}},"37":{"start":{"line":209,"column":8},"end":{"line":209,"column":7554}},"38":{"start":{"line":210,"column":12},"end":{"line":210,"column":7596}},"39":{"start":{"line":219,"column":8},"end":{"line":219,"column":47}},"40":{"start":{"line":227,"column":8},"end":{"line":227,"column":42}},"41":{"start":{"line":228,"column":8},"end":{"line":228,"column":8217}},"42":{"start":{"line":232,"column":8},"end":{"line":232,"column":8415}},"43":{"start":{"line":235,"column":8},"end":{"line":235,"column":32}},"44":{"start":{"line":236,"column":8},"end":{"line":236,"column":37}},"45":{"start":{"line":246,"column":8},"end":{"line":246,"column":42}},"46":{"start":{"line":247,"column":8},"end":{"line":247,"column":73}},"47":{"start":{"line":248,"column":8},"end":{"line":248,"column":9089}},"48":{"start":{"line":252,"column":8},"end":{"line":252,"column":9251}},"49":{"start":{"line":255,"column":8},"end":{"line":255,"column":32}},"50":{"start":{"line":283,"column":8},"end":{"line":283,"column":58}},"51":{"start":{"line":285,"column":8},"end":{"line":285,"column":11072}},"52":{"start":{"line":286,"column":12},"end":{"line":286,"column":29}},"53":{"start":{"line":288,"column":12},"end":{"line":288,"column":50}},"54":{"start":{"line":302,"column":8},"end":{"line":302,"column":46}},"55":{"start":{"line":303,"column":8},"end":{"line":303,"column":11629}},"56":{"start":{"line":304,"column":12},"end":{"line":304,"column":38}},"57":{"start":{"line":305,"column":12},"end":{"line":305,"column":46}},"58":{"start":{"line":315,"column":8},"end":{"line":315,"column":12040}},"59":{"start":{"line":319,"column":8},"end":{"line":319,"column":12144}},"60":{"start":{"line":331,"column":8},"end":{"line":331,"column":12494}},"61":{"start":{"line":332,"column":12},"end":{"line":332,"column":20}},"62":{"start":{"line":334,"column":12},"end":{"line":334,"column":38}},"63":{"start":{"line":345,"column":8},"end":{"line":345,"column":69}},"64":{"start":{"line":346,"column":8},"end":{"line":346,"column":70}},"65":{"start":{"line":348,"column":8},"end":{"line":348,"column":13041}},"66":{"start":{"line":352,"column":12},"end":{"line":352,"column":37}},"67":{"start":{"line":355,"column":13},"end":{"line":355,"column":13256}},"68":{"start":{"line":356,"column":12},"end":{"line":356,"column":38}},"69":{"start":{"line":360,"column":12},"end":{"line":360,"column":53}},"70":{"start":{"line":373,"column":8},"end":{"line":373,"column":61}},"71":{"start":{"line":375,"column":8},"end":{"line":375,"column":13892}},"72":{"start":{"line":379,"column":12},"end":{"line":379,"column":40}},"73":{"start":{"line":382,"column":8},"end":{"line":382,"column":26}},"74":{"start":{"line":385,"column":8},"end":{"line":385,"column":14255}},"75":{"start":{"line":386,"column":12},"end":{"line":386,"column":14341}},"76":{"start":{"line":394,"column":8},"end":{"line":394,"column":34}}},"branchMap":{"1":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":60},"end":{"line":64,"column":60}},{"start":{"line":64,"column":60},"end":{"line":64,"column":60}}]},"2":{"line":85,"type":"if","locations":[{"start":{"line":85,"column":8},"end":{"line":85,"column":8}},{"start":{"line":85,"column":8},"end":{"line":85,"column":8}}]},"3":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":12},"end":{"line":91,"column":12}},{"start":{"line":91,"column":12},"end":{"line":91,"column":12}}]},"4":{"line":95,"type":"if","locations":[{"start":{"line":95,"column":16},"end":{"line":95,"column":16}},{"start":{"line":95,"column":16},"end":{"line":95,"column":16}}]},"5":{"line":122,"type":"if","locations":[{"start":{"line":122,"column":8},"end":{"line":122,"column":8}},{"start":{"line":122,"column":8},"end":{"line":122,"column":8}}]},"6":{"line":127,"type":"if","locations":[{"start":{"line":127,"column":12},"end":{"line":127,"column":12}},{"start":{"line":127,"column":12},"end":{"line":127,"column":12}}]},"7":{"line":133,"type":"if","locations":[{"start":{"line":133,"column":19},"end":{"line":133,"column":19}},{"start":{"line":133,"column":19},"end":{"line":133,"column":19}}]},"8":{"line":142,"type":"if","locations":[{"start":{"line":142,"column":8},"end":{"line":142,"column":8}},{"start":{"line":142,"column":8},"end":{"line":142,"column":8}}]},"9":{"line":150,"type":"if","locations":[{"start":{"line":150,"column":8},"end":{"line":150,"column":8}},{"start":{"line":150,"column":8},"end":{"line":150,"column":8}}]},"10":{"line":162,"type":"if","locations":[{"start":{"line":162,"column":8},"end":{"line":162,"column":8}},{"start":{"line":162,"column":8},"end":{"line":162,"column":8}}]},"11":{"line":166,"type":"if","locations":[{"start":{"line":166,"column":8},"end":{"line":166,"column":8}},{"start":{"line":166,"column":8},"end":{"line":166,"column":8}}]},"12":{"line":190,"type":"if","locations":[{"start":{"line":190,"column":8},"end":{"line":190,"column":8}},{"start":{"line":190,"column":8},"end":{"line":190,"column":8}}]},"13":{"line":194,"type":"if","locations":[{"start":{"line":194,"column":8},"end":{"line":194,"column":8}},{"start":{"line":194,"column":8},"end":{"line":194,"column":8}}]},"14":{"line":197,"type":"if","locations":[{"start":{"line":197,"column":8},"end":{"line":197,"column":8}},{"start":{"line":197,"column":8},"end":{"line":197,"column":8}}]},"15":{"line":199,"type":"if","locations":[{"start":{"line":199,"column":12},"end":{"line":199,"column":12}},{"start":{"line":199,"column":12},"end":{"line":199,"column":12}}]},"16":{"line":205,"type":"if","locations":[{"start":{"line":205,"column":19},"end":{"line":205,"column":19}},{"start":{"line":205,"column":19},"end":{"line":205,"column":19}}]},"17":{"line":209,"type":"if","locations":[{"start":{"line":209,"column":8},"end":{"line":209,"column":8}},{"start":{"line":209,"column":8},"end":{"line":209,"column":8}}]},"18":{"line":210,"type":"if","locations":[{"start":{"line":210,"column":12},"end":{"line":210,"column":12}},{"start":{"line":210,"column":12},"end":{"line":210,"column":12}}]},"19":{"line":228,"type":"if","locations":[{"start":{"line":228,"column":8},"end":{"line":228,"column":8}},{"start":{"line":228,"column":8},"end":{"line":228,"column":8}}]},"20":{"line":232,"type":"if","locations":[{"start":{"line":232,"column":8},"end":{"line":232,"column":8}},{"start":{"line":232,"column":8},"end":{"line":232,"column":8}}]},"21":{"line":248,"type":"if","locations":[{"start":{"line":248,"column":8},"end":{"line":248,"column":8}},{"start":{"line":248,"column":8},"end":{"line":248,"column":8}}]},"22":{"line":285,"type":"if","locations":[{"start":{"line":285,"column":8},"end":{"line":285,"column":8}},{"start":{"line":285,"column":8},"end":{"line":285,"column":8}}]},"23":{"line":303,"type":"if","locations":[{"start":{"line":303,"column":8},"end":{"line":303,"column":8}},{"start":{"line":303,"column":8},"end":{"line":303,"column":8}}]},"24":{"line":319,"type":"if","locations":[{"start":{"line":319,"column":8},"end":{"line":319,"column":8}},{"start":{"line":319,"column":8},"end":{"line":319,"column":8}}]},"25":{"line":331,"type":"if","locations":[{"start":{"line":331,"column":8},"end":{"line":331,"column":8}},{"start":{"line":331,"column":8},"end":{"line":331,"column":8}}]},"26":{"line":348,"type":"if","locations":[{"start":{"line":348,"column":8},"end":{"line":348,"column":8}},{"start":{"line":348,"column":8},"end":{"line":348,"column":8}}]},"27":{"line":355,"type":"if","locations":[{"start":{"line":355,"column":13},"end":{"line":355,"column":13}},{"start":{"line":355,"column":13},"end":{"line":355,"column":13}}]},"28":{"line":375,"type":"if","locations":[{"start":{"line":375,"column":8},"end":{"line":375,"column":8}},{"start":{"line":375,"column":8},"end":{"line":375,"column":8}}]},"29":{"line":376,"type":"cond-expr","locations":[{"start":{"line":376,"column":12},"end":{"line":376,"column":32}},{"start":{"line":377,"column":12},"end":{"line":377,"column":75}}]},"30":{"line":386,"type":"if","locations":[{"start":{"line":386,"column":12},"end":{"line":386,"column":12}},{"start":{"line":386,"column":12},"end":{"line":386,"column":12}}]}}}, -"contracts/modules/internal/EnforcementModuleInternal.sol":{"l":{"55":942,"56":942,"69":22,"70":22,"71":2,"73":20,"74":20,"75":20,"87":8,"88":8,"89":2,"91":6,"92":6,"94":6,"98":972},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/internal/EnforcementModuleInternal.sol","s":{"1":942,"2":942,"3":22,"4":22,"5":2,"6":20,"7":20,"8":8,"9":8,"10":2,"11":6,"12":6},"b":{"1":[377,0],"2":[2,20],"3":[2,6]},"f":{"1":377,"2":942,"3":22,"4":8,"5":972},"fnMap":{"1":{"name":"__Enforcement_init_unchained","line":47,"loc":{"start":{"line":47,"column":4},"end":{"line":49,"column":4}}},"2":{"name":"frozen","line":54,"loc":{"start":{"line":54,"column":4},"end":{"line":57,"column":4}}},"3":{"name":"_freeze","line":65,"loc":{"start":{"line":65,"column":4},"end":{"line":76,"column":4}}},"4":{"name":"_unfreeze","line":83,"loc":{"start":{"line":83,"column":4},"end":{"line":95,"column":4}}},"5":{"name":"_getEnforcementModuleInternalStorage","line":97,"loc":{"start":{"line":97,"column":4},"end":{"line":101,"column":4}}}},"statementMap":{"1":{"start":{"line":55,"column":8},"end":{"line":55,"column":91}},"2":{"start":{"line":56,"column":8},"end":{"line":56,"column":33}},"3":{"start":{"line":69,"column":8},"end":{"line":69,"column":91}},"4":{"start":{"line":70,"column":8},"end":{"line":70,"column":2158}},"5":{"start":{"line":71,"column":12},"end":{"line":71,"column":24}},"6":{"start":{"line":74,"column":8},"end":{"line":74,"column":58}},"7":{"start":{"line":75,"column":8},"end":{"line":75,"column":19}},"8":{"start":{"line":87,"column":8},"end":{"line":87,"column":91}},"9":{"start":{"line":88,"column":8},"end":{"line":88,"column":2720}},"10":{"start":{"line":89,"column":12},"end":{"line":89,"column":24}},"11":{"start":{"line":92,"column":8},"end":{"line":92,"column":60}},"12":{"start":{"line":94,"column":8},"end":{"line":94,"column":19}}},"branchMap":{"1":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":53},"end":{"line":47,"column":53}},{"start":{"line":47,"column":53},"end":{"line":47,"column":53}}]},"2":{"line":70,"type":"if","locations":[{"start":{"line":70,"column":8},"end":{"line":70,"column":8}},{"start":{"line":70,"column":8},"end":{"line":70,"column":8}}]},"3":{"line":88,"type":"if","locations":[{"start":{"line":88,"column":8},"end":{"line":88,"column":8}},{"start":{"line":88,"column":8},"end":{"line":88,"column":8}}]}}}, -"contracts/modules/internal/ERC20SnapshotModuleInternal.sol":{"l":{"38":480,"39":480,"47":160,"48":160,"49":480,"51":160,"59":80,"60":80,"61":80,"62":80,"74":1200,"79":1200,"88":720,"92":720,"104":420,"105":420,"107":77,"108":77,"110":43,"113":34,"117":343,"118":343,"126":463,"133":377},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/internal/ERC20SnapshotModuleInternal.sol","s":{"1":160,"2":80,"3":1200,"4":1200,"5":720,"6":720,"7":420,"8":420,"9":77,"10":77,"11":43,"12":34,"13":343,"14":343,"15":463,"16":377},"b":{"1":[377,0],"2":[400,800],"3":[36,684],"4":[77,343],"5":[43,34]},"f":{"1":377,"2":480,"3":160,"4":80,"5":1200,"6":720,"7":420,"8":463,"9":377},"fnMap":{"1":{"name":"__ERC20Snapshot_init_unchained","line":28,"loc":{"start":{"line":28,"column":4},"end":{"line":31,"column":4}}},"2":{"name":"snapshotInfo","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":40,"column":4}}},"3":{"name":"snapshotInfoBatch","line":46,"loc":{"start":{"line":46,"column":4},"end":{"line":52,"column":4}}},"4":{"name":"snapshotInfoBatch","line":58,"loc":{"start":{"line":58,"column":4},"end":{"line":64,"column":4}}},"5":{"name":"snapshotBalanceOf","line":70,"loc":{"start":{"line":70,"column":4},"end":{"line":80,"column":4}}},"6":{"name":"snapshotTotalSupply","line":87,"loc":{"start":{"line":87,"column":4},"end":{"line":93,"column":4}}},"7":{"name":"_snapshotUpdate","line":100,"loc":{"start":{"line":100,"column":4},"end":{"line":120,"column":4}}},"8":{"name":"_updateAccountSnapshot","line":125,"loc":{"start":{"line":125,"column":4},"end":{"line":127,"column":4}}},"9":{"name":"_updateTotalSupplySnapshot","line":132,"loc":{"start":{"line":132,"column":4},"end":{"line":134,"column":4}}}},"statementMap":{"1":{"start":{"line":48,"column":8},"end":{"line":48,"column":1995}},"2":{"start":{"line":61,"column":8},"end":{"line":61,"column":2658}},"3":{"start":{"line":74,"column":8},"end":{"line":74,"column":3162}},"4":{"start":{"line":79,"column":8},"end":{"line":79,"column":53}},"5":{"start":{"line":88,"column":8},"end":{"line":88,"column":3633}},"6":{"start":{"line":92,"column":8},"end":{"line":92,"column":50}},"7":{"start":{"line":104,"column":8},"end":{"line":104,"column":28}},"8":{"start":{"line":105,"column":8},"end":{"line":105,"column":4163}},"9":{"start":{"line":107,"column":12},"end":{"line":107,"column":39}},"10":{"start":{"line":108,"column":12},"end":{"line":108,"column":4289}},"11":{"start":{"line":110,"column":16},"end":{"line":110,"column":41}},"12":{"start":{"line":113,"column":16},"end":{"line":113,"column":43}},"13":{"start":{"line":117,"column":12},"end":{"line":117,"column":37}},"14":{"start":{"line":118,"column":12},"end":{"line":118,"column":39}},"15":{"start":{"line":126,"column":8},"end":{"line":126,"column":77}},"16":{"start":{"line":133,"column":8},"end":{"line":133,"column":60}}},"branchMap":{"1":{"line":28,"type":"if","locations":[{"start":{"line":28,"column":55},"end":{"line":28,"column":55}},{"start":{"line":28,"column":55},"end":{"line":28,"column":55}}]},"2":{"line":79,"type":"if","locations":[{"start":{"line":79,"column":29},"end":{"line":79,"column":33}},{"start":{"line":79,"column":37},"end":{"line":79,"column":52}}]},"3":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":29},"end":{"line":92,"column":33}},{"start":{"line":92,"column":37},"end":{"line":92,"column":49}}]},"4":{"line":105,"type":"if","locations":[{"start":{"line":105,"column":8},"end":{"line":105,"column":8}},{"start":{"line":105,"column":8},"end":{"line":105,"column":8}}]},"5":{"line":108,"type":"if","locations":[{"start":{"line":108,"column":12},"end":{"line":108,"column":12}},{"start":{"line":108,"column":12},"end":{"line":108,"column":12}}]}}}, -"contracts/modules/internal/ValidationModuleInternal.sol":{"l":{"31":32,"32":32,"38":377,"39":18,"40":18,"41":18,"53":12,"54":12,"63":6,"64":6,"75":6,"76":6,"80":60,"81":60,"85":627},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/internal/ValidationModuleInternal.sol","s":{"1":32,"2":32,"3":377,"4":18,"5":18,"6":12,"7":12,"8":6,"9":6,"10":6,"11":6,"12":60,"13":60},"b":{"1":[377,0],"2":[18,359]},"f":{"1":32,"2":377,"3":12,"4":6,"5":6,"6":60,"7":627},"fnMap":{"1":{"name":"ruleEngine","line":30,"loc":{"start":{"line":30,"column":4},"end":{"line":33,"column":4}}},"2":{"name":"__Validation_init_unchained","line":37,"loc":{"start":{"line":35,"column":4},"end":{"line":43,"column":4}}},"3":{"name":"_validateTransfer","line":48,"loc":{"start":{"line":48,"column":4},"end":{"line":55,"column":4}}},"4":{"name":"_messageForTransferRestriction","line":60,"loc":{"start":{"line":60,"column":4},"end":{"line":65,"column":4}}},"5":{"name":"_detectTransferRestriction","line":70,"loc":{"start":{"line":70,"column":4},"end":{"line":77,"column":4}}},"6":{"name":"_operateOnTransfer","line":79,"loc":{"start":{"line":79,"column":4},"end":{"line":82,"column":4}}},"7":{"name":"_getValidationModuleInternalStorage","line":84,"loc":{"start":{"line":84,"column":4},"end":{"line":88,"column":4}}}},"statementMap":{"1":{"start":{"line":31,"column":8},"end":{"line":31,"column":89}},"2":{"start":{"line":32,"column":8},"end":{"line":32,"column":28}},"3":{"start":{"line":38,"column":8},"end":{"line":38,"column":1286}},"4":{"start":{"line":39,"column":12},"end":{"line":39,"column":93}},"5":{"start":{"line":41,"column":12},"end":{"line":41,"column":40}},"6":{"start":{"line":53,"column":8},"end":{"line":53,"column":89}},"7":{"start":{"line":54,"column":8},"end":{"line":54,"column":63}},"8":{"start":{"line":63,"column":8},"end":{"line":63,"column":89}},"9":{"start":{"line":64,"column":8},"end":{"line":64,"column":75}},"10":{"start":{"line":75,"column":8},"end":{"line":75,"column":89}},"11":{"start":{"line":76,"column":8},"end":{"line":76,"column":72}},"12":{"start":{"line":80,"column":8},"end":{"line":80,"column":89}},"13":{"start":{"line":81,"column":8},"end":{"line":81,"column":64}}},"branchMap":{"1":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":15},"end":{"line":37,"column":15}},{"start":{"line":37,"column":15},"end":{"line":37,"column":15}}]},"2":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":8},"end":{"line":38,"column":8}},{"start":{"line":38,"column":8},"end":{"line":38,"column":8}}]}}}, -"contracts/modules/security/AuthorizationModule.sol":{"l":{"29":377,"30":2,"32":375,"33":375,"34":16,"35":16,"36":16,"41":2,"42":2,"53":16,"54":16,"55":4,"57":12,"58":12,"62":40,"63":40,"64":8,"65":8,"67":4,"70":36,"74":10,"75":10,"76":8,"77":8,"79":4,"82":6,"93":1275,"94":758,"96":517,"100":84},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/security/AuthorizationModule.sol","s":{"1":377,"2":375,"3":375,"4":16,"5":16,"6":2,"7":2,"8":16,"9":16,"10":12,"11":40,"12":40,"13":8,"14":8,"15":36,"16":10,"17":10,"18":8,"19":8,"20":6,"21":1275,"22":758,"23":517},"b":{"1":[377,0],"2":[2,375],"3":[16,359],"4":[16,4],"5":[4,12],"6":[40,2],"7":[8,32],"8":[4,4],"9":[10,2],"10":[8,2],"11":[4,4],"12":[758,517]},"f":{"1":377,"2":2,"3":16,"4":40,"5":10,"6":1275,"7":84},"fnMap":{"1":{"name":"__AuthorizationModule_init_unchained","line":28,"loc":{"start":{"line":27,"column":4},"end":{"line":38,"column":4}}},"2":{"name":"authorizationEngine","line":40,"loc":{"start":{"line":40,"column":4},"end":{"line":43,"column":4}}},"3":{"name":"setAuthorizationEngine","line":52,"loc":{"start":{"line":50,"column":4},"end":{"line":59,"column":4}}},"4":{"name":"grantRole","line":61,"loc":{"start":{"line":61,"column":4},"end":{"line":71,"column":4}}},"5":{"name":"revokeRole","line":73,"loc":{"start":{"line":73,"column":4},"end":{"line":83,"column":4}}},"6":{"name":"hasRole","line":88,"loc":{"start":{"line":88,"column":4},"end":{"line":97,"column":4}}},"7":{"name":"_getAuthorizationModuleStorage","line":99,"loc":{"start":{"line":99,"column":4},"end":{"line":103,"column":4}}}},"statementMap":{"1":{"start":{"line":29,"column":8},"end":{"line":29,"column":1202}},"2":{"start":{"line":32,"column":8},"end":{"line":32,"column":44}},"3":{"start":{"line":33,"column":8},"end":{"line":33,"column":1369}},"4":{"start":{"line":34,"column":12},"end":{"line":34,"column":83}},"5":{"start":{"line":36,"column":12},"end":{"line":36,"column":58}},"6":{"start":{"line":41,"column":8},"end":{"line":41,"column":79}},"7":{"start":{"line":42,"column":8},"end":{"line":42,"column":37}},"8":{"start":{"line":53,"column":8},"end":{"line":53,"column":79}},"9":{"start":{"line":54,"column":8},"end":{"line":54,"column":2232}},"10":{"start":{"line":58,"column":8},"end":{"line":58,"column":54}},"11":{"start":{"line":62,"column":8},"end":{"line":62,"column":79}},"12":{"start":{"line":63,"column":8},"end":{"line":63,"column":2688}},"13":{"start":{"line":64,"column":12},"end":{"line":64,"column":82}},"14":{"start":{"line":65,"column":12},"end":{"line":65,"column":2842}},"15":{"start":{"line":70,"column":8},"end":{"line":70,"column":64}},"16":{"start":{"line":74,"column":8},"end":{"line":74,"column":79}},"17":{"start":{"line":75,"column":8},"end":{"line":75,"column":3284}},"18":{"start":{"line":76,"column":12},"end":{"line":76,"column":83}},"19":{"start":{"line":77,"column":12},"end":{"line":77,"column":3439}},"20":{"start":{"line":82,"column":8},"end":{"line":82,"column":65}},"21":{"start":{"line":93,"column":8},"end":{"line":93,"column":3970}},"22":{"start":{"line":94,"column":12},"end":{"line":94,"column":23}},"23":{"start":{"line":96,"column":8},"end":{"line":96,"column":62}}},"branchMap":{"1":{"line":28,"type":"if","locations":[{"start":{"line":28,"column":13},"end":{"line":28,"column":13}},{"start":{"line":28,"column":13},"end":{"line":28,"column":13}}]},"2":{"line":29,"type":"if","locations":[{"start":{"line":29,"column":8},"end":{"line":29,"column":8}},{"start":{"line":29,"column":8},"end":{"line":29,"column":8}}]},"3":{"line":33,"type":"if","locations":[{"start":{"line":33,"column":8},"end":{"line":33,"column":8}},{"start":{"line":33,"column":8},"end":{"line":33,"column":8}}]},"4":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":15},"end":{"line":52,"column":15}},{"start":{"line":52,"column":15},"end":{"line":52,"column":15}}]},"5":{"line":54,"type":"if","locations":[{"start":{"line":54,"column":8},"end":{"line":54,"column":8}},{"start":{"line":54,"column":8},"end":{"line":54,"column":8}}]},"6":{"line":61,"type":"if","locations":[{"start":{"line":61,"column":70},"end":{"line":61,"column":70}},{"start":{"line":61,"column":70},"end":{"line":61,"column":70}}]},"7":{"line":63,"type":"if","locations":[{"start":{"line":63,"column":8},"end":{"line":63,"column":8}},{"start":{"line":63,"column":8},"end":{"line":63,"column":8}}]},"8":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":12},"end":{"line":65,"column":12}},{"start":{"line":65,"column":12},"end":{"line":65,"column":12}}]},"9":{"line":73,"type":"if","locations":[{"start":{"line":73,"column":71},"end":{"line":73,"column":71}},{"start":{"line":73,"column":71},"end":{"line":73,"column":71}}]},"10":{"line":75,"type":"if","locations":[{"start":{"line":75,"column":8},"end":{"line":75,"column":8}},{"start":{"line":75,"column":8},"end":{"line":75,"column":8}}]},"11":{"line":77,"type":"if","locations":[{"start":{"line":77,"column":12},"end":{"line":77,"column":12}},{"start":{"line":77,"column":12},"end":{"line":77,"column":12}}]},"12":{"line":93,"type":"if","locations":[{"start":{"line":93,"column":8},"end":{"line":93,"column":8}},{"start":{"line":93,"column":8},"end":{"line":93,"column":8}}]}}}, -"contracts/modules/wrapper/controllers/ValidationModule.sol":{"l":{"37":18,"38":18,"39":3,"41":15,"42":15,"53":20,"54":20,"55":3,"60":4,"65":2,"70":2,"72":6,"74":3,"90":17,"91":17,"92":4,"94":2,"96":2,"98":6,"100":3,"109":19,"110":4,"112":15,"113":15,"114":12,"116":3,"124":456,"125":18,"127":438,"131":437,"132":14,"134":423,"135":423,"136":60,"138":363},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/controllers/ValidationModule.sol","s":{"1":18,"2":18,"3":15,"4":20,"5":20,"6":3,"7":17,"8":4,"9":13,"10":2,"11":11,"12":2,"13":9,"14":6,"15":3,"16":17,"17":17,"18":4,"19":13,"20":2,"21":11,"22":2,"23":9,"24":6,"25":3,"26":19,"27":4,"28":15,"29":15,"30":12,"31":3,"32":456,"33":18,"34":438,"35":437,"36":14,"37":423,"38":423,"39":60,"40":363},"b":{"1":[375,0],"2":[18,3],"3":[3,15],"4":[3,17],"5":[4,13],"6":[2,11],"7":[2,9],"8":[6,3],"9":[4,13],"10":[2,11],"11":[2,9],"12":[6,3],"13":[4,15],"14":[12,3],"15":[18,438],"16":[12,4],"17":[4,2],"18":[14,423],"19":[60,363]},"f":{"1":375,"2":18,"3":20,"4":17,"5":19,"6":456,"7":437},"fnMap":{"1":{"name":"__ValidationModule_init_unchained","line":26,"loc":{"start":{"line":26,"column":4},"end":{"line":28,"column":4}}},"2":{"name":"setRuleEngine","line":36,"loc":{"start":{"line":34,"column":4},"end":{"line":43,"column":4}}},"3":{"name":"messageForTransferRestriction","line":50,"loc":{"start":{"line":50,"column":4},"end":{"line":76,"column":4}}},"4":{"name":"detectTransferRestriction","line":85,"loc":{"start":{"line":85,"column":4},"end":{"line":102,"column":4}}},"5":{"name":"validateTransfer","line":104,"loc":{"start":{"line":104,"column":4},"end":{"line":117,"column":4}}},"6":{"name":"_validateTransferByModule","line":119,"loc":{"start":{"line":119,"column":4},"end":{"line":128,"column":4}}},"7":{"name":"_operateOnTransfer","line":130,"loc":{"start":{"line":130,"column":4},"end":{"line":139,"column":4}}}},"statementMap":{"1":{"start":{"line":37,"column":8},"end":{"line":37,"column":89}},"2":{"start":{"line":38,"column":8},"end":{"line":38,"column":1105}},"3":{"start":{"line":42,"column":8},"end":{"line":42,"column":36}},"4":{"start":{"line":53,"column":10},"end":{"line":53,"column":91}},"5":{"start":{"line":54,"column":8},"end":{"line":54,"column":1887}},"6":{"start":{"line":55,"column":12},"end":{"line":55,"column":35}},"7":{"start":{"line":56,"column":15},"end":{"line":56,"column":2003}},"8":{"start":{"line":60,"column":12},"end":{"line":60,"column":48}},"9":{"start":{"line":61,"column":15},"end":{"line":61,"column":2179}},"10":{"start":{"line":65,"column":12},"end":{"line":65,"column":53}},"11":{"start":{"line":66,"column":15},"end":{"line":66,"column":2365}},"12":{"start":{"line":70,"column":12},"end":{"line":70,"column":51}},"13":{"start":{"line":71,"column":15},"end":{"line":71,"column":2547}},"14":{"start":{"line":72,"column":12},"end":{"line":72,"column":66}},"15":{"start":{"line":74,"column":12},"end":{"line":74,"column":36}},"16":{"start":{"line":90,"column":8},"end":{"line":90,"column":89}},"17":{"start":{"line":91,"column":8},"end":{"line":91,"column":3337}},"18":{"start":{"line":92,"column":12},"end":{"line":92,"column":69}},"19":{"start":{"line":93,"column":15},"end":{"line":93,"column":3439}},"20":{"start":{"line":94,"column":12},"end":{"line":94,"column":74}},"21":{"start":{"line":95,"column":15},"end":{"line":95,"column":3550}},"22":{"start":{"line":96,"column":12},"end":{"line":96,"column":72}},"23":{"start":{"line":97,"column":15},"end":{"line":97,"column":3657}},"24":{"start":{"line":98,"column":12},"end":{"line":98,"column":63}},"25":{"start":{"line":100,"column":12},"end":{"line":100,"column":56}},"26":{"start":{"line":109,"column":8},"end":{"line":109,"column":4006}},"27":{"start":{"line":110,"column":12},"end":{"line":110,"column":24}},"28":{"start":{"line":112,"column":8},"end":{"line":112,"column":89}},"29":{"start":{"line":113,"column":8},"end":{"line":113,"column":4193}},"30":{"start":{"line":114,"column":12},"end":{"line":114,"column":54}},"31":{"start":{"line":116,"column":8},"end":{"line":116,"column":19}},"32":{"start":{"line":124,"column":8},"end":{"line":124,"column":4485}},"33":{"start":{"line":125,"column":12},"end":{"line":125,"column":24}},"34":{"start":{"line":127,"column":8},"end":{"line":127,"column":19}},"35":{"start":{"line":131,"column":8},"end":{"line":131,"column":4711}},"36":{"start":{"line":132,"column":12},"end":{"line":132,"column":24}},"37":{"start":{"line":134,"column":8},"end":{"line":134,"column":89}},"38":{"start":{"line":135,"column":8},"end":{"line":135,"column":4897}},"39":{"start":{"line":136,"column":12},"end":{"line":136,"column":80}},"40":{"start":{"line":138,"column":8},"end":{"line":138,"column":19}}},"branchMap":{"1":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":58},"end":{"line":26,"column":58}},{"start":{"line":26,"column":58},"end":{"line":26,"column":58}}]},"2":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":15},"end":{"line":36,"column":15}},{"start":{"line":36,"column":15},"end":{"line":36,"column":15}}]},"3":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":8},"end":{"line":38,"column":8}},{"start":{"line":38,"column":8},"end":{"line":38,"column":8}}]},"4":{"line":54,"type":"if","locations":[{"start":{"line":54,"column":8},"end":{"line":54,"column":8}},{"start":{"line":54,"column":8},"end":{"line":54,"column":8}}]},"5":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":15},"end":{"line":56,"column":15}},{"start":{"line":56,"column":15},"end":{"line":56,"column":15}}]},"6":{"line":61,"type":"if","locations":[{"start":{"line":61,"column":15},"end":{"line":61,"column":15}},{"start":{"line":61,"column":15},"end":{"line":61,"column":15}}]},"7":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":15},"end":{"line":66,"column":15}},{"start":{"line":66,"column":15},"end":{"line":66,"column":15}}]},"8":{"line":71,"type":"if","locations":[{"start":{"line":71,"column":15},"end":{"line":71,"column":15}},{"start":{"line":71,"column":15},"end":{"line":71,"column":15}}]},"9":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":8},"end":{"line":91,"column":8}},{"start":{"line":91,"column":8},"end":{"line":91,"column":8}}]},"10":{"line":93,"type":"if","locations":[{"start":{"line":93,"column":15},"end":{"line":93,"column":15}},{"start":{"line":93,"column":15},"end":{"line":93,"column":15}}]},"11":{"line":95,"type":"if","locations":[{"start":{"line":95,"column":15},"end":{"line":95,"column":15}},{"start":{"line":95,"column":15},"end":{"line":95,"column":15}}]},"12":{"line":97,"type":"if","locations":[{"start":{"line":97,"column":15},"end":{"line":97,"column":15}},{"start":{"line":97,"column":15},"end":{"line":97,"column":15}}]},"13":{"line":109,"type":"if","locations":[{"start":{"line":109,"column":8},"end":{"line":109,"column":8}},{"start":{"line":109,"column":8},"end":{"line":109,"column":8}}]},"14":{"line":113,"type":"if","locations":[{"start":{"line":113,"column":8},"end":{"line":113,"column":8}},{"start":{"line":113,"column":8},"end":{"line":113,"column":8}}]},"15":{"line":124,"type":"if","locations":[{"start":{"line":124,"column":8},"end":{"line":124,"column":8}},{"start":{"line":124,"column":8},"end":{"line":124,"column":8}}]},"16":{"line":124,"type":"cond-expr","locations":[{"start":{"line":124,"column":12},"end":{"line":124,"column":19}},{"start":{"line":124,"column":24},"end":{"line":124,"column":35}}]},"17":{"line":124,"type":"cond-expr","locations":[{"start":{"line":124,"column":12},"end":{"line":124,"column":35}},{"start":{"line":124,"column":40},"end":{"line":124,"column":49}}]},"18":{"line":131,"type":"if","locations":[{"start":{"line":131,"column":8},"end":{"line":131,"column":8}},{"start":{"line":131,"column":8},"end":{"line":131,"column":8}}]},"19":{"line":135,"type":"if","locations":[{"start":{"line":135,"column":8},"end":{"line":135,"column":8}},{"start":{"line":135,"column":8},"end":{"line":135,"column":8}}]}}}, -"contracts/modules/wrapper/core/BaseModule.sol":{"l":{"47":375,"48":375,"49":375,"50":375,"56":10,"57":10,"61":10,"62":10,"65":8,"66":8,"75":2,"76":2,"77":2,"86":2,"87":2,"88":2,"97":2,"98":2,"99":2,"104":409},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/core/BaseModule.sol","s":{"1":375,"2":10,"3":10,"4":10,"5":10,"6":8,"7":8,"8":2,"9":2,"10":2,"11":2,"12":2,"13":2},"b":{"1":[375,0],"2":[2,2],"3":[2,2],"4":[2,2]},"f":{"1":375,"2":10,"3":10,"4":8,"5":2,"6":2,"7":2,"8":409},"fnMap":{"1":{"name":"__Base_init_unchained","line":46,"loc":{"start":{"line":42,"column":4},"end":{"line":51,"column":4}}},"2":{"name":"tokenId","line":55,"loc":{"start":{"line":55,"column":4},"end":{"line":58,"column":4}}},"3":{"name":"terms","line":60,"loc":{"start":{"line":60,"column":4},"end":{"line":63,"column":4}}},"4":{"name":"information","line":64,"loc":{"start":{"line":64,"column":4},"end":{"line":67,"column":4}}},"5":{"name":"setTokenId","line":74,"loc":{"start":{"line":72,"column":4},"end":{"line":78,"column":4}}},"6":{"name":"setTerms","line":85,"loc":{"start":{"line":83,"column":4},"end":{"line":89,"column":4}}},"7":{"name":"setInformation","line":96,"loc":{"start":{"line":94,"column":4},"end":{"line":100,"column":4}}},"8":{"name":"_getBaseModuleStorage","line":103,"loc":{"start":{"line":103,"column":4},"end":{"line":107,"column":4}}}},"statementMap":{"1":{"start":{"line":47,"column":8},"end":{"line":47,"column":61}},"2":{"start":{"line":56,"column":8},"end":{"line":56,"column":61}},"3":{"start":{"line":57,"column":8},"end":{"line":57,"column":25}},"4":{"start":{"line":61,"column":8},"end":{"line":61,"column":61}},"5":{"start":{"line":62,"column":8},"end":{"line":62,"column":23}},"6":{"start":{"line":65,"column":8},"end":{"line":65,"column":61}},"7":{"start":{"line":66,"column":8},"end":{"line":66,"column":29}},"8":{"start":{"line":75,"column":8},"end":{"line":75,"column":61}},"9":{"start":{"line":77,"column":8},"end":{"line":77,"column":40}},"10":{"start":{"line":86,"column":8},"end":{"line":86,"column":61}},"11":{"start":{"line":88,"column":8},"end":{"line":88,"column":33}},"12":{"start":{"line":97,"column":8},"end":{"line":97,"column":61}},"13":{"start":{"line":99,"column":8},"end":{"line":99,"column":52}}},"branchMap":{"1":{"line":46,"type":"if","locations":[{"start":{"line":46,"column":15},"end":{"line":46,"column":15}},{"start":{"line":46,"column":15},"end":{"line":46,"column":15}}]},"2":{"line":74,"type":"if","locations":[{"start":{"line":74,"column":13},"end":{"line":74,"column":13}},{"start":{"line":74,"column":13},"end":{"line":74,"column":13}}]},"3":{"line":85,"type":"if","locations":[{"start":{"line":85,"column":13},"end":{"line":85,"column":13}},{"start":{"line":85,"column":13},"end":{"line":85,"column":13}}]},"4":{"line":96,"type":"if","locations":[{"start":{"line":96,"column":13},"end":{"line":96,"column":13}},{"start":{"line":96,"column":13},"end":{"line":96,"column":13}}]}}}, -"contracts/modules/wrapper/core/EnforcementModule.sol":{"l":{"38":22,"52":8},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/core/EnforcementModule.sol","s":{"1":22,"2":8},"b":{"1":[375,0],"2":[22,2],"3":[8,2]},"f":{"1":375,"2":22,"3":8},"fnMap":{"1":{"name":"__EnforcementModule_init_unchained","line":25,"loc":{"start":{"line":25,"column":4},"end":{"line":27,"column":4}}},"2":{"name":"freeze","line":37,"loc":{"start":{"line":34,"column":4},"end":{"line":39,"column":4}}},"3":{"name":"unfreeze","line":51,"loc":{"start":{"line":48,"column":4},"end":{"line":53,"column":4}}}},"statementMap":{"1":{"start":{"line":38,"column":8},"end":{"line":38,"column":39}},"2":{"start":{"line":52,"column":8},"end":{"line":52,"column":41}}},"branchMap":{"1":{"line":25,"type":"if","locations":[{"start":{"line":25,"column":59},"end":{"line":25,"column":59}},{"start":{"line":25,"column":59},"end":{"line":25,"column":59}}]},"2":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":13},"end":{"line":37,"column":13}},{"start":{"line":37,"column":13},"end":{"line":37,"column":13}}]},"3":{"line":51,"type":"if","locations":[{"start":{"line":51,"column":13},"end":{"line":51,"column":13}},{"start":{"line":51,"column":13},"end":{"line":51,"column":13}}]}}}, -"contracts/modules/wrapper/core/ERC20BaseModule.sol":{"l":{"35":375,"36":375,"46":2,"47":2,"66":10,"67":2,"71":8,"72":4,"75":4,"78":10,"82":2,"97":10,"99":2,"100":2,"103":2,"112":4,"113":4,"114":6,"116":4,"120":377},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/core/ERC20BaseModule.sol","s":{"1":375,"2":2,"3":2,"4":10,"5":8,"6":4,"7":10,"8":2,"9":10,"10":2,"11":2,"12":2,"13":4},"b":{"1":[375,0],"2":[2,8],"3":[4,4],"4":[2,0]},"f":{"1":375,"2":2,"3":10,"4":10,"5":4,"6":377},"fnMap":{"1":{"name":"__ERC20BaseModule_init_unchained","line":34,"loc":{"start":{"line":32,"column":4},"end":{"line":37,"column":4}}},"2":{"name":"decimals","line":45,"loc":{"start":{"line":45,"column":4},"end":{"line":48,"column":4}}},"3":{"name":"transferBatch","line":62,"loc":{"start":{"line":62,"column":4},"end":{"line":83,"column":4}}},"4":{"name":"transferFrom","line":92,"loc":{"start":{"line":92,"column":4},"end":{"line":104,"column":4}}},"5":{"name":"balanceInfo","line":111,"loc":{"start":{"line":111,"column":4},"end":{"line":117,"column":4}}},"6":{"name":"_getERC20BaseModuleStorage","line":119,"loc":{"start":{"line":119,"column":4},"end":{"line":123,"column":4}}}},"statementMap":{"1":{"start":{"line":35,"column":8},"end":{"line":35,"column":71}},"2":{"start":{"line":46,"column":8},"end":{"line":46,"column":71}},"3":{"start":{"line":47,"column":8},"end":{"line":47,"column":26}},"4":{"start":{"line":66,"column":8},"end":{"line":66,"column":2357}},"5":{"start":{"line":71,"column":8},"end":{"line":71,"column":2574}},"6":{"start":{"line":75,"column":8},"end":{"line":75,"column":2769}},"7":{"start":{"line":78,"column":12},"end":{"line":78,"column":70}},"8":{"start":{"line":82,"column":8},"end":{"line":82,"column":19}},"9":{"start":{"line":97,"column":8},"end":{"line":97,"column":68}},"10":{"start":{"line":99,"column":8},"end":{"line":99,"column":3719}},"11":{"start":{"line":100,"column":12},"end":{"line":100,"column":49}},"12":{"start":{"line":103,"column":8},"end":{"line":103,"column":21}},"13":{"start":{"line":113,"column":8},"end":{"line":113,"column":4212}}},"branchMap":{"1":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":15},"end":{"line":34,"column":15}},{"start":{"line":34,"column":15},"end":{"line":34,"column":15}}]},"2":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":8},"end":{"line":66,"column":8}},{"start":{"line":66,"column":8},"end":{"line":66,"column":8}}]},"3":{"line":71,"type":"if","locations":[{"start":{"line":71,"column":8},"end":{"line":71,"column":8}},{"start":{"line":71,"column":8},"end":{"line":71,"column":8}}]},"4":{"line":99,"type":"if","locations":[{"start":{"line":99,"column":8},"end":{"line":99,"column":8}},{"start":{"line":99,"column":8},"end":{"line":99,"column":8}}]}}}, -"contracts/modules/wrapper/core/ERC20BurnModule.sol":{"l":{"37":14,"38":12,"61":12,"62":2,"66":10,"67":4,"70":6,"71":18,"72":16,"95":4,"96":4,"97":4,"99":2,"102":2,"103":2,"106":2,"108":2,"110":2},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/core/ERC20BurnModule.sol","s":{"1":14,"2":12,"3":12,"4":10,"5":6,"6":18,"7":16,"8":4,"9":4,"10":4,"11":2,"12":2,"13":2,"14":2},"b":{"1":[375,0],"2":[14,4],"3":[12,2],"4":[2,10],"5":[4,6],"6":[4,2],"7":[2,2]},"f":{"1":375,"2":14,"3":12,"4":4},"fnMap":{"1":{"name":"__ERC20BurnModule_init_unchained","line":19,"loc":{"start":{"line":19,"column":4},"end":{"line":21,"column":4}}},"2":{"name":"burn","line":36,"loc":{"start":{"line":32,"column":4},"end":{"line":39,"column":4}}},"3":{"name":"burnBatch","line":60,"loc":{"start":{"line":56,"column":4},"end":{"line":74,"column":4}}},"4":{"name":"burnFrom","line":92,"loc":{"start":{"line":90,"column":4},"end":{"line":111,"column":4}}}},"statementMap":{"1":{"start":{"line":37,"column":8},"end":{"line":37,"column":28}},"2":{"start":{"line":38,"column":8},"end":{"line":38,"column":41}},"3":{"start":{"line":61,"column":8},"end":{"line":61,"column":2316}},"4":{"start":{"line":66,"column":8},"end":{"line":66,"column":2538}},"5":{"start":{"line":70,"column":8},"end":{"line":70,"column":2738}},"6":{"start":{"line":71,"column":12},"end":{"line":71,"column":40}},"7":{"start":{"line":72,"column":12},"end":{"line":72,"column":53}},"8":{"start":{"line":95,"column":8},"end":{"line":95,"column":38}},"9":{"start":{"line":96,"column":8},"end":{"line":96,"column":61}},"10":{"start":{"line":97,"column":8},"end":{"line":97,"column":3627}},"11":{"start":{"line":103,"column":12},"end":{"line":103,"column":62}},"12":{"start":{"line":106,"column":8},"end":{"line":106,"column":28}},"13":{"start":{"line":108,"column":8},"end":{"line":108,"column":45}},"14":{"start":{"line":110,"column":8},"end":{"line":110,"column":45}}},"branchMap":{"1":{"line":19,"type":"if","locations":[{"start":{"line":19,"column":57},"end":{"line":19,"column":57}},{"start":{"line":19,"column":57},"end":{"line":19,"column":57}}]},"2":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":13},"end":{"line":36,"column":13}},{"start":{"line":36,"column":13},"end":{"line":36,"column":13}}]},"3":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":13},"end":{"line":60,"column":13}},{"start":{"line":60,"column":13},"end":{"line":60,"column":13}}]},"4":{"line":61,"type":"if","locations":[{"start":{"line":61,"column":8},"end":{"line":61,"column":8}},{"start":{"line":61,"column":8},"end":{"line":61,"column":8}}]},"5":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":8},"end":{"line":66,"column":8}},{"start":{"line":66,"column":8},"end":{"line":66,"column":8}}]},"6":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":8},"end":{"line":92,"column":8}},{"start":{"line":92,"column":8},"end":{"line":92,"column":8}}]},"7":{"line":97,"type":"if","locations":[{"start":{"line":97,"column":8},"end":{"line":97,"column":8}},{"start":{"line":97,"column":8},"end":{"line":97,"column":8}}]}}}, -"contracts/modules/wrapper/core/ERC20MintModule.sol":{"l":{"35":289,"36":289,"58":24,"59":2,"63":22,"64":4,"67":18,"68":54,"69":54},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/core/ERC20MintModule.sol","s":{"1":289,"2":289,"3":24,"4":22,"5":18,"6":54,"7":54},"b":{"1":[375,0],"2":[289,4],"3":[24,2],"4":[2,22],"5":[4,18]},"f":{"1":375,"2":289,"3":24},"fnMap":{"1":{"name":"__ERC20MintModule_init_unchained","line":17,"loc":{"start":{"line":17,"column":4},"end":{"line":19,"column":4}}},"2":{"name":"mint","line":34,"loc":{"start":{"line":34,"column":4},"end":{"line":37,"column":4}}},"3":{"name":"mintBatch","line":57,"loc":{"start":{"line":54,"column":4},"end":{"line":71,"column":4}}}},"statementMap":{"1":{"start":{"line":35,"column":8},"end":{"line":35,"column":28}},"2":{"start":{"line":36,"column":8},"end":{"line":36,"column":33}},"3":{"start":{"line":58,"column":8},"end":{"line":58,"column":2105}},"4":{"start":{"line":63,"column":8},"end":{"line":63,"column":2327}},"5":{"start":{"line":67,"column":8},"end":{"line":67,"column":2527}},"6":{"start":{"line":68,"column":12},"end":{"line":68,"column":40}},"7":{"start":{"line":69,"column":12},"end":{"line":69,"column":45}}},"branchMap":{"1":{"line":17,"type":"if","locations":[{"start":{"line":17,"column":57},"end":{"line":17,"column":57}},{"start":{"line":17,"column":57},"end":{"line":17,"column":57}}]},"2":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":57},"end":{"line":34,"column":57}},{"start":{"line":34,"column":57},"end":{"line":34,"column":57}}]},"3":{"line":57,"type":"if","locations":[{"start":{"line":57,"column":13},"end":{"line":57,"column":13}},{"start":{"line":57,"column":13},"end":{"line":57,"column":13}}]},"4":{"line":58,"type":"if","locations":[{"start":{"line":58,"column":8},"end":{"line":58,"column":8}},{"start":{"line":58,"column":8},"end":{"line":58,"column":8}}]},"5":{"line":63,"type":"if","locations":[{"start":{"line":63,"column":8},"end":{"line":63,"column":8}},{"start":{"line":63,"column":8},"end":{"line":63,"column":8}}]}}}, -"contracts/modules/wrapper/core/PauseModule.sol":{"l":{"26":12,"51":14,"63":6,"64":6,"65":2,"67":4,"83":2,"84":2,"85":2,"86":2,"93":4,"94":4},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/core/PauseModule.sol","s":{"1":14,"2":6,"3":6,"4":4,"5":2,"6":2,"7":2,"8":4,"9":4},"b":{"1":[375,0],"2":[14,3],"3":[6,2],"4":[2,4],"5":[2,2]},"f":{"1":12,"2":375,"3":14,"4":6,"5":2,"6":4},"fnMap":{"1":{"name":"_getPauseModuleStorage","line":25,"loc":{"start":{"line":25,"column":4},"end":{"line":29,"column":4}}},"2":{"name":"__PauseModule_init_unchained","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":39,"column":4}}},"3":{"name":"pause","line":50,"loc":{"start":{"line":50,"column":4},"end":{"line":52,"column":4}}},"4":{"name":"unpause","line":62,"loc":{"start":{"line":62,"column":4},"end":{"line":68,"column":4}}},"5":{"name":"deactivateContract","line":81,"loc":{"start":{"line":79,"column":4},"end":{"line":87,"column":4}}},"6":{"name":"deactivated","line":92,"loc":{"start":{"line":92,"column":4},"end":{"line":95,"column":4}}}},"statementMap":{"1":{"start":{"line":51,"column":8},"end":{"line":51,"column":15}},"2":{"start":{"line":63,"column":8},"end":{"line":63,"column":63}},"3":{"start":{"line":64,"column":8},"end":{"line":64,"column":2143}},"4":{"start":{"line":67,"column":8},"end":{"line":67,"column":17}},"5":{"start":{"line":83,"column":8},"end":{"line":83,"column":63}},"6":{"start":{"line":85,"column":7},"end":{"line":85,"column":14}},"7":{"start":{"line":86,"column":7},"end":{"line":86,"column":37}},"8":{"start":{"line":93,"column":8},"end":{"line":93,"column":63}},"9":{"start":{"line":94,"column":8},"end":{"line":94,"column":31}}},"branchMap":{"1":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":53},"end":{"line":37,"column":53}},{"start":{"line":37,"column":53},"end":{"line":37,"column":53}}]},"2":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":28},"end":{"line":50,"column":28}},{"start":{"line":50,"column":28},"end":{"line":50,"column":28}}]},"3":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":30},"end":{"line":62,"column":30}},{"start":{"line":62,"column":30},"end":{"line":62,"column":30}}]},"4":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":8},"end":{"line":64,"column":8}},{"start":{"line":64,"column":8},"end":{"line":64,"column":8}}]},"5":{"line":81,"type":"if","locations":[{"start":{"line":81,"column":8},"end":{"line":81,"column":8}},{"start":{"line":81,"column":8},"end":{"line":81,"column":8}}]}}}, -"contracts/modules/wrapper/extensions/DebtModule.sol":{"l":{"31":375,"32":3,"33":3,"34":3,"41":8,"42":8,"52":5,"53":5,"54":1,"56":4,"57":4,"61":2,"62":2,"63":2,"68":2,"69":2,"70":2,"75":20},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/extensions/DebtModule.sol","s":{"1":375,"2":3,"3":3,"4":8,"5":8,"6":5,"7":5,"8":4,"9":2,"10":2,"11":2,"12":2},"b":{"1":[375,0],"2":[3,372],"3":[5,1],"4":[1,4],"5":[2,0],"6":[2,0]},"f":{"1":375,"2":8,"3":5,"4":2,"5":2,"6":20},"fnMap":{"1":{"name":"__DebtModule_init_unchained","line":30,"loc":{"start":{"line":29,"column":4},"end":{"line":38,"column":4}}},"2":{"name":"debtEngine","line":40,"loc":{"start":{"line":40,"column":4},"end":{"line":43,"column":4}}},"3":{"name":"setDebtEngine","line":51,"loc":{"start":{"line":49,"column":4},"end":{"line":58,"column":4}}},"4":{"name":"debt","line":60,"loc":{"start":{"line":60,"column":4},"end":{"line":65,"column":4}}},"5":{"name":"creditEvents","line":67,"loc":{"start":{"line":67,"column":4},"end":{"line":72,"column":4}}},"6":{"name":"_getDebtModuleStorage","line":74,"loc":{"start":{"line":74,"column":4},"end":{"line":78,"column":4}}}},"statementMap":{"1":{"start":{"line":31,"column":8},"end":{"line":31,"column":1097}},"2":{"start":{"line":32,"column":12},"end":{"line":32,"column":65}},"3":{"start":{"line":34,"column":12},"end":{"line":34,"column":40}},"4":{"start":{"line":41,"column":8},"end":{"line":41,"column":61}},"5":{"start":{"line":42,"column":8},"end":{"line":42,"column":28}},"6":{"start":{"line":52,"column":8},"end":{"line":52,"column":61}},"7":{"start":{"line":53,"column":8},"end":{"line":53,"column":1736}},"8":{"start":{"line":57,"column":8},"end":{"line":57,"column":36}},"9":{"start":{"line":61,"column":8},"end":{"line":61,"column":61}},"10":{"start":{"line":62,"column":8},"end":{"line":62,"column":2063}},"11":{"start":{"line":68,"column":8},"end":{"line":68,"column":61}},"12":{"start":{"line":69,"column":8},"end":{"line":69,"column":2334}}},"branchMap":{"1":{"line":30,"type":"if","locations":[{"start":{"line":30,"column":13},"end":{"line":30,"column":13}},{"start":{"line":30,"column":13},"end":{"line":30,"column":13}}]},"2":{"line":31,"type":"if","locations":[{"start":{"line":31,"column":8},"end":{"line":31,"column":8}},{"start":{"line":31,"column":8},"end":{"line":31,"column":8}}]},"3":{"line":51,"type":"if","locations":[{"start":{"line":51,"column":15},"end":{"line":51,"column":15}},{"start":{"line":51,"column":15},"end":{"line":51,"column":15}}]},"4":{"line":53,"type":"if","locations":[{"start":{"line":53,"column":8},"end":{"line":53,"column":8}},{"start":{"line":53,"column":8},"end":{"line":53,"column":8}}]},"5":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":8},"end":{"line":62,"column":8}},{"start":{"line":62,"column":8},"end":{"line":62,"column":8}}]},"6":{"line":69,"type":"if","locations":[{"start":{"line":69,"column":8},"end":{"line":69,"column":8}},{"start":{"line":69,"column":8},"end":{"line":69,"column":8}}]}}}, -"contracts/modules/wrapper/extensions/DocumentModule.sol":{"l":{"17":28,"18":28,"22":76,"39":375,"40":12,"41":12,"42":12,"53":16,"54":16,"55":2,"57":14,"58":14,"63":16,"64":16,"65":16,"67":0,"72":4,"73":4,"74":4},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/extensions/DocumentModule.sol","s":{"1":28,"2":28,"3":375,"4":12,"5":12,"6":16,"7":16,"8":14,"9":16,"10":16,"11":16,"12":0,"13":4,"14":4},"b":{"1":[375,0],"2":[12,363],"3":[16,2],"4":[2,14],"5":[16,0],"6":[4,0]},"f":{"1":28,"2":76,"3":375,"4":16,"5":16,"6":4},"fnMap":{"1":{"name":"documentEngine","line":16,"loc":{"start":{"line":16,"column":4},"end":{"line":19,"column":4}}},"2":{"name":"_getDocumentModuleStorage","line":21,"loc":{"start":{"line":21,"column":4},"end":{"line":25,"column":4}}},"3":{"name":"__DocumentModule_init_unchained","line":38,"loc":{"start":{"line":37,"column":4},"end":{"line":44,"column":4}}},"4":{"name":"setDocumentEngine","line":52,"loc":{"start":{"line":50,"column":4},"end":{"line":59,"column":4}}},"5":{"name":"getDocument","line":62,"loc":{"start":{"line":62,"column":4},"end":{"line":69,"column":4}}},"6":{"name":"getAllDocuments","line":71,"loc":{"start":{"line":71,"column":4},"end":{"line":76,"column":4}}}},"statementMap":{"1":{"start":{"line":17,"column":8},"end":{"line":17,"column":69}},"2":{"start":{"line":18,"column":8},"end":{"line":18,"column":32}},"3":{"start":{"line":39,"column":8},"end":{"line":39,"column":1483}},"4":{"start":{"line":40,"column":12},"end":{"line":40,"column":73}},"5":{"start":{"line":42,"column":12},"end":{"line":42,"column":48}},"6":{"start":{"line":53,"column":8},"end":{"line":53,"column":69}},"7":{"start":{"line":54,"column":8},"end":{"line":54,"column":1987}},"8":{"start":{"line":58,"column":8},"end":{"line":58,"column":44}},"9":{"start":{"line":63,"column":8},"end":{"line":63,"column":69}},"10":{"start":{"line":64,"column":8},"end":{"line":64,"column":2374}},"11":{"start":{"line":65,"column":12},"end":{"line":65,"column":56}},"12":{"start":{"line":67,"column":12},"end":{"line":67,"column":30}},"13":{"start":{"line":72,"column":8},"end":{"line":72,"column":69}},"14":{"start":{"line":73,"column":8},"end":{"line":73,"column":2703}}},"branchMap":{"1":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":13},"end":{"line":38,"column":13}},{"start":{"line":38,"column":13},"end":{"line":38,"column":13}}]},"2":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":8},"end":{"line":39,"column":8}},{"start":{"line":39,"column":8},"end":{"line":39,"column":8}}]},"3":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":15},"end":{"line":52,"column":15}},{"start":{"line":52,"column":15},"end":{"line":52,"column":15}}]},"4":{"line":54,"type":"if","locations":[{"start":{"line":54,"column":8},"end":{"line":54,"column":8}},{"start":{"line":54,"column":8},"end":{"line":54,"column":8}}]},"5":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":8},"end":{"line":64,"column":8}},{"start":{"line":64,"column":8},"end":{"line":64,"column":8}}]},"6":{"line":73,"type":"if","locations":[{"start":{"line":73,"column":8},"end":{"line":73,"column":8}},{"start":{"line":73,"column":8},"end":{"line":73,"column":8}}]}}}, -"contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol":{"l":{"30":170,"41":12,"53":22,"64":12,"74":12},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol","s":{"1":170,"2":12,"3":22,"4":12,"5":12},"b":{"1":[375,0],"2":[170,2],"3":[12,2],"4":[22,2],"5":[12,2],"6":[12,2]},"f":{"1":375,"2":170,"3":12,"4":22,"5":12,"6":12},"fnMap":{"1":{"name":"__ERC20SnasphotModule_init_unchained","line":20,"loc":{"start":{"line":20,"column":4},"end":{"line":22,"column":4}}},"2":{"name":"scheduleSnapshot","line":29,"loc":{"start":{"line":29,"column":4},"end":{"line":31,"column":4}}},"3":{"name":"scheduleSnapshotNotOptimized","line":40,"loc":{"start":{"line":38,"column":4},"end":{"line":42,"column":4}}},"4":{"name":"rescheduleSnapshot","line":52,"loc":{"start":{"line":49,"column":4},"end":{"line":54,"column":4}}},"5":{"name":"unscheduleLastSnapshot","line":63,"loc":{"start":{"line":61,"column":4},"end":{"line":65,"column":4}}},"6":{"name":"unscheduleSnapshotNotOptimized","line":73,"loc":{"start":{"line":71,"column":4},"end":{"line":75,"column":4}}}},"statementMap":{"1":{"start":{"line":30,"column":8},"end":{"line":30,"column":30}},"2":{"start":{"line":41,"column":8},"end":{"line":41,"column":42}},"3":{"start":{"line":53,"column":8},"end":{"line":53,"column":44}},"4":{"start":{"line":64,"column":8},"end":{"line":64,"column":36}},"5":{"start":{"line":74,"column":8},"end":{"line":74,"column":44}}},"branchMap":{"1":{"line":20,"type":"if","locations":[{"start":{"line":20,"column":61},"end":{"line":20,"column":61}},{"start":{"line":20,"column":61},"end":{"line":20,"column":61}}]},"2":{"line":29,"type":"if","locations":[{"start":{"line":29,"column":51},"end":{"line":29,"column":51}},{"start":{"line":29,"column":51},"end":{"line":29,"column":51}}]},"3":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":13},"end":{"line":40,"column":13}},{"start":{"line":40,"column":13},"end":{"line":40,"column":13}}]},"4":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":13},"end":{"line":52,"column":13}},{"start":{"line":52,"column":13},"end":{"line":52,"column":13}}]},"5":{"line":63,"type":"if","locations":[{"start":{"line":63,"column":13},"end":{"line":63,"column":13}},{"start":{"line":63,"column":13},"end":{"line":63,"column":13}}]},"6":{"line":73,"type":"if","locations":[{"start":{"line":73,"column":13},"end":{"line":73,"column":13}},{"start":{"line":73,"column":13},"end":{"line":73,"column":13}}]}}}, -"contracts/modules/wrapper/extensions/MetaTxModule.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/extensions/MetaTxModule.sol","s":{},"b":{},"f":{"1":389},"fnMap":{"1":{"name":"constructor","line":18,"loc":{"start":{"line":16,"column":4},"end":{"line":20,"column":4}}}},"statementMap":{},"branchMap":{}}, +"contracts/modules/CMTAT_BASE.sol":{"l":{"65":381,"85":381,"86":381,"88":381,"90":381,"91":381,"94":381,"99":381,"100":381,"102":381,"106":381,"107":379,"108":379,"110":379,"111":379,"113":379,"114":379,"120":379,"121":379,"122":379,"125":379,"128":379,"150":2,"163":10,"178":6,"179":4,"194":438,"195":17,"202":421,"203":421,"217":1386,"226":1386,"238":0},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/CMTAT_BASE.sol","s":{"1":381,"2":381,"3":381,"4":381,"5":381,"6":381,"7":381,"8":381,"9":381,"10":381,"11":381,"12":379,"13":379,"14":379,"15":379,"16":379,"17":379,"18":379,"19":379,"20":379,"21":379,"22":379,"23":2,"24":10,"25":6,"26":4,"27":438,"28":421,"29":421,"30":1386,"31":1386,"32":0},"b":{"1":[381,1],"2":[381,0],"3":[379,0],"4":[17,421]},"f":{"1":381,"2":381,"3":379,"4":2,"5":10,"6":6,"7":438,"8":1386,"9":1386,"10":0},"fnMap":{"1":{"name":"initialize","line":64,"loc":{"start":{"line":59,"column":4},"end":{"line":71,"column":4}}},"2":{"name":"__CMTAT_init","line":82,"loc":{"start":{"line":77,"column":4},"end":{"line":129,"column":4}}},"3":{"name":"__CMTAT_init_unchained","line":131,"loc":{"start":{"line":131,"column":4},"end":{"line":133,"column":4}}},"4":{"name":"decimals","line":143,"loc":{"start":{"line":143,"column":4},"end":{"line":151,"column":4}}},"5":{"name":"transferFrom","line":153,"loc":{"start":{"line":153,"column":4},"end":{"line":164,"column":4}}},"6":{"name":"burnAndMint","line":177,"loc":{"start":{"line":177,"column":4},"end":{"line":180,"column":4}}},"7":{"name":"_update","line":189,"loc":{"start":{"line":189,"column":4},"end":{"line":204,"column":4}}},"8":{"name":"_msgSender","line":211,"loc":{"start":{"line":211,"column":4},"end":{"line":218,"column":4}}},"9":{"name":"_contextSuffixLength","line":223,"loc":{"start":{"line":223,"column":4},"end":{"line":227,"column":4}}},"10":{"name":"_msgData","line":232,"loc":{"start":{"line":232,"column":4},"end":{"line":239,"column":4}}}},"statementMap":{"1":{"start":{"line":65,"column":8},"end":{"line":65,"column":2165}},"2":{"start":{"line":85,"column":8},"end":{"line":85,"column":33}},"3":{"start":{"line":86,"column":8},"end":{"line":86,"column":99}},"4":{"start":{"line":88,"column":8},"end":{"line":88,"column":32}},"5":{"start":{"line":90,"column":8},"end":{"line":90,"column":39}},"6":{"start":{"line":91,"column":8},"end":{"line":91,"column":34}},"7":{"start":{"line":94,"column":8},"end":{"line":94,"column":37}},"8":{"start":{"line":99,"column":8},"end":{"line":99,"column":44}},"9":{"start":{"line":100,"column":8},"end":{"line":100,"column":39}},"10":{"start":{"line":102,"column":8},"end":{"line":102,"column":56}},"11":{"start":{"line":106,"column":8},"end":{"line":106,"column":81}},"12":{"start":{"line":107,"column":8},"end":{"line":107,"column":41}},"13":{"start":{"line":108,"column":8},"end":{"line":108,"column":41}},"14":{"start":{"line":110,"column":8},"end":{"line":110,"column":43}},"15":{"start":{"line":111,"column":8},"end":{"line":111,"column":77}},"16":{"start":{"line":113,"column":8},"end":{"line":113,"column":37}},"17":{"start":{"line":114,"column":8},"end":{"line":114,"column":42}},"18":{"start":{"line":120,"column":8},"end":{"line":120,"column":45}},"19":{"start":{"line":121,"column":8},"end":{"line":121,"column":64}},"20":{"start":{"line":122,"column":8},"end":{"line":122,"column":56}},"21":{"start":{"line":125,"column":8},"end":{"line":125,"column":123}},"22":{"start":{"line":128,"column":8},"end":{"line":128,"column":31}},"23":{"start":{"line":150,"column":8},"end":{"line":150,"column":41}},"24":{"start":{"line":163,"column":8},"end":{"line":163,"column":70}},"25":{"start":{"line":178,"column":8},"end":{"line":178,"column":39}},"26":{"start":{"line":179,"column":8},"end":{"line":179,"column":29}},"27":{"start":{"line":194,"column":8},"end":{"line":194,"column":6702}},"28":{"start":{"line":202,"column":8},"end":{"line":202,"column":60}},"29":{"start":{"line":203,"column":8},"end":{"line":203,"column":49}},"30":{"start":{"line":217,"column":8},"end":{"line":217,"column":53}},"31":{"start":{"line":226,"column":9},"end":{"line":226,"column":64}},"32":{"start":{"line":238,"column":8},"end":{"line":238,"column":51}}},"branchMap":{"1":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":21},"end":{"line":64,"column":21}},{"start":{"line":64,"column":21},"end":{"line":64,"column":21}}]},"2":{"line":82,"type":"if","locations":[{"start":{"line":82,"column":15},"end":{"line":82,"column":15}},{"start":{"line":82,"column":15},"end":{"line":82,"column":15}}]},"3":{"line":131,"type":"if","locations":[{"start":{"line":131,"column":47},"end":{"line":131,"column":47}},{"start":{"line":131,"column":47},"end":{"line":131,"column":47}}]},"4":{"line":194,"type":"if","locations":[{"start":{"line":194,"column":8},"end":{"line":194,"column":8}},{"start":{"line":194,"column":8},"end":{"line":194,"column":8}}]}}}, +"contracts/modules/internal/base/SnapshotModuleBase.sol":{"l":{"83":2,"84":2,"92":76,"93":76,"95":76,"96":68,"101":68,"102":48,"105":20,"107":8,"110":8,"112":8,"113":12,"120":28,"132":170,"134":170,"136":168,"138":94,"141":94,"142":2,"148":2,"151":164,"152":164,"159":12,"160":12,"161":10,"163":10,"164":2,"167":8,"168":2,"170":6,"173":6,"174":10,"175":10,"176":10,"179":6,"181":8,"188":22,"190":22,"191":20,"192":18,"193":2,"195":16,"196":12,"197":8,"198":8,"199":2,"205":2,"208":8,"209":4,"210":2,"216":6,"218":6,"225":14,"227":14,"228":10,"229":2,"232":8,"233":2,"235":6,"236":6,"246":10,"247":10,"249":10,"251":8,"252":16,"254":8,"282":1920,"284":1920,"285":1484,"287":436,"301":842,"302":842,"303":842,"304":36,"305":36,"315":421,"316":421,"320":421,"321":18,"322":18,"332":842,"333":834,"335":8,"346":36,"347":36,"348":36,"350":36,"354":22,"358":8,"362":6,"375":489,"376":489,"378":489,"382":403,"385":86,"386":86,"388":86,"389":116,"390":52,"391":52,"394":64,"397":86,"406":26,"407":26,"408":6,"410":20,"413":202,"414":6,"421":46,"422":6,"428":4856},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/internal/base/SnapshotModuleBase.sol","s":{"1":2,"2":2,"3":76,"4":76,"5":76,"6":68,"7":68,"8":48,"9":20,"10":8,"11":8,"12":28,"13":170,"14":170,"15":168,"16":94,"17":94,"18":92,"19":164,"20":164,"21":12,"22":12,"23":10,"24":10,"25":8,"26":2,"27":6,"28":6,"29":8,"30":22,"31":22,"32":20,"33":18,"34":16,"35":12,"36":8,"37":8,"38":6,"39":8,"40":4,"41":6,"42":14,"43":14,"44":10,"45":8,"46":6,"47":6,"48":10,"49":10,"50":10,"51":8,"52":8,"53":1920,"54":1920,"55":1484,"56":436,"57":842,"58":842,"59":842,"60":36,"61":36,"62":421,"63":421,"64":421,"65":842,"66":834,"67":8,"68":36,"69":36,"70":36,"71":36,"72":22,"73":14,"74":8,"75":6,"76":489,"77":489,"78":489,"79":403,"80":86,"81":86,"82":116,"83":86,"84":26,"85":26,"86":20,"87":202,"88":46},"b":{"1":[381,0],"2":[68,8],"3":[48,20],"4":[8,12],"5":[94,74],"6":[2,92],"7":[2,90],"8":[2,8],"9":[2,6],"10":[2,16],"11":[8,4],"12":[2,6],"13":[2,4],"14":[4,4],"15":[2,2],"16":[2,8],"17":[2,6],"18":[1484,436],"19":[36,806],"20":[18,403],"21":[834,8],"22":[22,14],"23":[8,6],"24":[403,86],"25":[403,0],"26":[52,64],"27":[6,20],"28":[6,196],"29":[6,40]},"f":{"1":381,"2":2,"3":76,"4":170,"5":12,"6":22,"7":14,"8":10,"9":1920,"10":842,"11":421,"12":842,"13":36,"14":489,"15":26,"16":202,"17":46,"18":4856},"fnMap":{"1":{"name":"__SnapshotModuleBase_init_unchained","line":70,"loc":{"start":{"line":70,"column":4},"end":{"line":73,"column":4}}},"2":{"name":"getAllSnapshots","line":82,"loc":{"start":{"line":82,"column":4},"end":{"line":85,"column":4}}},"3":{"name":"getNextSnapshots","line":91,"loc":{"start":{"line":91,"column":4},"end":{"line":121,"column":4}}},"4":{"name":"_scheduleSnapshot","line":131,"loc":{"start":{"line":131,"column":4},"end":{"line":153,"column":4}}},"5":{"name":"_scheduleSnapshotNotOptimized","line":158,"loc":{"start":{"line":158,"column":4},"end":{"line":182,"column":4}}},"6":{"name":"_rescheduleSnapshot","line":187,"loc":{"start":{"line":187,"column":4},"end":{"line":219,"column":4}}},"7":{"name":"_unscheduleLastSnapshot","line":224,"loc":{"start":{"line":224,"column":4},"end":{"line":237,"column":4}}},"8":{"name":"_unscheduleSnapshotNotOptimized","line":245,"loc":{"start":{"line":245,"column":4},"end":{"line":255,"column":4}}},"9":{"name":"_valueAt","line":264,"loc":{"start":{"line":264,"column":4},"end":{"line":289,"column":4}}},"10":{"name":"_updateSnapshot","line":297,"loc":{"start":{"line":297,"column":4},"end":{"line":307,"column":4}}},"11":{"name":"_setCurrentSnapshot","line":314,"loc":{"start":{"line":314,"column":4},"end":{"line":324,"column":4}}},"12":{"name":"_lastSnapshot","line":329,"loc":{"start":{"line":329,"column":4},"end":{"line":337,"column":4}}},"13":{"name":"_findScheduledSnapshotIndex","line":343,"loc":{"start":{"line":343,"column":4},"end":{"line":364,"column":4}}},"14":{"name":"_findScheduledMostRecentPastSnapshot","line":370,"loc":{"start":{"line":370,"column":4},"end":{"line":398,"column":4}}},"15":{"name":"_findAndRevertScheduledSnapshotIndex","line":403,"loc":{"start":{"line":403,"column":4},"end":{"line":411,"column":4}}},"16":{"name":"_checkTimeInThePast","line":412,"loc":{"start":{"line":412,"column":4},"end":{"line":419,"column":4}}},"17":{"name":"_checkTimeSnapshotAlreadyDone","line":420,"loc":{"start":{"line":420,"column":4},"end":{"line":424,"column":4}}},"18":{"name":"_getSnapshotModuleBaseStorage","line":427,"loc":{"start":{"line":427,"column":4},"end":{"line":431,"column":4}}}},"statementMap":{"1":{"start":{"line":83,"column":8},"end":{"line":83,"column":77}},"2":{"start":{"line":84,"column":8},"end":{"line":84,"column":36}},"3":{"start":{"line":92,"column":8},"end":{"line":92,"column":77}},"4":{"start":{"line":93,"column":8},"end":{"line":93,"column":65}},"5":{"start":{"line":95,"column":8},"end":{"line":95,"column":3656}},"6":{"start":{"line":96,"column":12},"end":{"line":96,"column":3754}},"7":{"start":{"line":101,"column":12},"end":{"line":101,"column":3917}},"8":{"start":{"line":102,"column":16},"end":{"line":102,"column":44}},"9":{"start":{"line":105,"column":16},"end":{"line":105,"column":4127}},"10":{"start":{"line":107,"column":20},"end":{"line":107,"column":4317}},"11":{"start":{"line":112,"column":20},"end":{"line":112,"column":4595}},"12":{"start":{"line":120,"column":8},"end":{"line":120,"column":36}},"13":{"start":{"line":132,"column":8},"end":{"line":132,"column":77}},"14":{"start":{"line":134,"column":7},"end":{"line":134,"column":31}},"15":{"start":{"line":136,"column":8},"end":{"line":136,"column":5452}},"16":{"start":{"line":138,"column":12},"end":{"line":138,"column":5563}},"17":{"start":{"line":141,"column":12},"end":{"line":141,"column":5688}},"18":{"start":{"line":147,"column":19},"end":{"line":147,"column":5941}},"19":{"start":{"line":151,"column":8},"end":{"line":151,"column":39}},"20":{"start":{"line":152,"column":8},"end":{"line":152,"column":38}},"21":{"start":{"line":159,"column":8},"end":{"line":159,"column":77}},"22":{"start":{"line":160,"column":8},"end":{"line":160,"column":32}},"23":{"start":{"line":161,"column":8},"end":{"line":161,"column":73}},"24":{"start":{"line":163,"column":8},"end":{"line":163,"column":6517}},"25":{"start":{"line":167,"column":8},"end":{"line":167,"column":6708}},"26":{"start":{"line":168,"column":12},"end":{"line":168,"column":43}},"27":{"start":{"line":170,"column":12},"end":{"line":170,"column":6832}},"28":{"start":{"line":173,"column":12},"end":{"line":173,"column":6959}},"29":{"start":{"line":181,"column":8},"end":{"line":181,"column":38}},"30":{"start":{"line":188,"column":8},"end":{"line":188,"column":77}},"31":{"start":{"line":190,"column":8},"end":{"line":190,"column":45}},"32":{"start":{"line":191,"column":8},"end":{"line":191,"column":35}},"33":{"start":{"line":192,"column":8},"end":{"line":192,"column":7690}},"34":{"start":{"line":195,"column":8},"end":{"line":195,"column":69}},"35":{"start":{"line":196,"column":8},"end":{"line":196,"column":7890}},"36":{"start":{"line":197,"column":12},"end":{"line":197,"column":71}},"37":{"start":{"line":198,"column":12},"end":{"line":198,"column":8027}},"38":{"start":{"line":204,"column":19},"end":{"line":204,"column":8285}},"39":{"start":{"line":208,"column":8},"end":{"line":208,"column":8424}},"40":{"start":{"line":209,"column":12},"end":{"line":209,"column":8466}},"41":{"start":{"line":218,"column":8},"end":{"line":218,"column":47}},"42":{"start":{"line":225,"column":8},"end":{"line":225,"column":77}},"43":{"start":{"line":227,"column":8},"end":{"line":227,"column":42}},"44":{"start":{"line":228,"column":8},"end":{"line":228,"column":9172}},"45":{"start":{"line":232,"column":8},"end":{"line":232,"column":9372}},"46":{"start":{"line":235,"column":8},"end":{"line":235,"column":34}},"47":{"start":{"line":236,"column":8},"end":{"line":236,"column":37}},"48":{"start":{"line":246,"column":8},"end":{"line":246,"column":77}},"49":{"start":{"line":247,"column":8},"end":{"line":247,"column":42}},"50":{"start":{"line":249,"column":8},"end":{"line":249,"column":66}},"51":{"start":{"line":251,"column":8},"end":{"line":251,"column":10193}},"52":{"start":{"line":254,"column":8},"end":{"line":254,"column":34}},"53":{"start":{"line":282,"column":8},"end":{"line":282,"column":58}},"54":{"start":{"line":284,"column":8},"end":{"line":284,"column":12022}},"55":{"start":{"line":285,"column":12},"end":{"line":285,"column":29}},"56":{"start":{"line":287,"column":12},"end":{"line":287,"column":50}},"57":{"start":{"line":301,"column":8},"end":{"line":301,"column":77}},"58":{"start":{"line":302,"column":8},"end":{"line":302,"column":48}},"59":{"start":{"line":303,"column":8},"end":{"line":303,"column":12660}},"60":{"start":{"line":304,"column":12},"end":{"line":304,"column":38}},"61":{"start":{"line":305,"column":12},"end":{"line":305,"column":46}},"62":{"start":{"line":315,"column":8},"end":{"line":315,"column":77}},"63":{"start":{"line":316,"column":8},"end":{"line":316,"column":13150}},"64":{"start":{"line":320,"column":8},"end":{"line":320,"column":13254}},"65":{"start":{"line":332,"column":8},"end":{"line":332,"column":13608}},"66":{"start":{"line":333,"column":12},"end":{"line":333,"column":20}},"67":{"start":{"line":335,"column":12},"end":{"line":335,"column":38}},"68":{"start":{"line":346,"column":8},"end":{"line":346,"column":77}},"69":{"start":{"line":347,"column":8},"end":{"line":347,"column":71}},"70":{"start":{"line":348,"column":8},"end":{"line":348,"column":72}},"71":{"start":{"line":350,"column":8},"end":{"line":350,"column":14238}},"72":{"start":{"line":354,"column":12},"end":{"line":354,"column":37}},"73":{"start":{"line":357,"column":13},"end":{"line":357,"column":14455}},"74":{"start":{"line":358,"column":12},"end":{"line":358,"column":38}},"75":{"start":{"line":362,"column":12},"end":{"line":362,"column":53}},"76":{"start":{"line":375,"column":8},"end":{"line":375,"column":77}},"77":{"start":{"line":376,"column":8},"end":{"line":376,"column":63}},"78":{"start":{"line":378,"column":8},"end":{"line":378,"column":15172}},"79":{"start":{"line":382,"column":12},"end":{"line":382,"column":40}},"80":{"start":{"line":385,"column":8},"end":{"line":385,"column":26}},"81":{"start":{"line":388,"column":8},"end":{"line":388,"column":15537}},"82":{"start":{"line":389,"column":12},"end":{"line":389,"column":15625}},"83":{"start":{"line":397,"column":8},"end":{"line":397,"column":34}},"84":{"start":{"line":406,"column":8},"end":{"line":406,"column":73}},"85":{"start":{"line":407,"column":8},"end":{"line":407,"column":16171}},"86":{"start":{"line":410,"column":8},"end":{"line":410,"column":20}},"87":{"start":{"line":413,"column":8},"end":{"line":413,"column":16370}},"88":{"start":{"line":421,"column":8},"end":{"line":421,"column":16673}}},"branchMap":{"1":{"line":70,"type":"if","locations":[{"start":{"line":70,"column":60},"end":{"line":70,"column":60}},{"start":{"line":70,"column":60},"end":{"line":70,"column":60}}]},"2":{"line":95,"type":"if","locations":[{"start":{"line":95,"column":8},"end":{"line":95,"column":8}},{"start":{"line":95,"column":8},"end":{"line":95,"column":8}}]},"3":{"line":101,"type":"if","locations":[{"start":{"line":101,"column":12},"end":{"line":101,"column":12}},{"start":{"line":101,"column":12},"end":{"line":101,"column":12}}]},"4":{"line":105,"type":"if","locations":[{"start":{"line":105,"column":16},"end":{"line":105,"column":16}},{"start":{"line":105,"column":16},"end":{"line":105,"column":16}}]},"5":{"line":136,"type":"if","locations":[{"start":{"line":136,"column":8},"end":{"line":136,"column":8}},{"start":{"line":136,"column":8},"end":{"line":136,"column":8}}]},"6":{"line":141,"type":"if","locations":[{"start":{"line":141,"column":12},"end":{"line":141,"column":12}},{"start":{"line":141,"column":12},"end":{"line":141,"column":12}}]},"7":{"line":147,"type":"if","locations":[{"start":{"line":147,"column":19},"end":{"line":147,"column":19}},{"start":{"line":147,"column":19},"end":{"line":147,"column":19}}]},"8":{"line":163,"type":"if","locations":[{"start":{"line":163,"column":8},"end":{"line":163,"column":8}},{"start":{"line":163,"column":8},"end":{"line":163,"column":8}}]},"9":{"line":167,"type":"if","locations":[{"start":{"line":167,"column":8},"end":{"line":167,"column":8}},{"start":{"line":167,"column":8},"end":{"line":167,"column":8}}]},"10":{"line":192,"type":"if","locations":[{"start":{"line":192,"column":8},"end":{"line":192,"column":8}},{"start":{"line":192,"column":8},"end":{"line":192,"column":8}}]},"11":{"line":196,"type":"if","locations":[{"start":{"line":196,"column":8},"end":{"line":196,"column":8}},{"start":{"line":196,"column":8},"end":{"line":196,"column":8}}]},"12":{"line":198,"type":"if","locations":[{"start":{"line":198,"column":12},"end":{"line":198,"column":12}},{"start":{"line":198,"column":12},"end":{"line":198,"column":12}}]},"13":{"line":204,"type":"if","locations":[{"start":{"line":204,"column":19},"end":{"line":204,"column":19}},{"start":{"line":204,"column":19},"end":{"line":204,"column":19}}]},"14":{"line":208,"type":"if","locations":[{"start":{"line":208,"column":8},"end":{"line":208,"column":8}},{"start":{"line":208,"column":8},"end":{"line":208,"column":8}}]},"15":{"line":209,"type":"if","locations":[{"start":{"line":209,"column":12},"end":{"line":209,"column":12}},{"start":{"line":209,"column":12},"end":{"line":209,"column":12}}]},"16":{"line":228,"type":"if","locations":[{"start":{"line":228,"column":8},"end":{"line":228,"column":8}},{"start":{"line":228,"column":8},"end":{"line":228,"column":8}}]},"17":{"line":232,"type":"if","locations":[{"start":{"line":232,"column":8},"end":{"line":232,"column":8}},{"start":{"line":232,"column":8},"end":{"line":232,"column":8}}]},"18":{"line":284,"type":"if","locations":[{"start":{"line":284,"column":8},"end":{"line":284,"column":8}},{"start":{"line":284,"column":8},"end":{"line":284,"column":8}}]},"19":{"line":303,"type":"if","locations":[{"start":{"line":303,"column":8},"end":{"line":303,"column":8}},{"start":{"line":303,"column":8},"end":{"line":303,"column":8}}]},"20":{"line":320,"type":"if","locations":[{"start":{"line":320,"column":8},"end":{"line":320,"column":8}},{"start":{"line":320,"column":8},"end":{"line":320,"column":8}}]},"21":{"line":332,"type":"if","locations":[{"start":{"line":332,"column":8},"end":{"line":332,"column":8}},{"start":{"line":332,"column":8},"end":{"line":332,"column":8}}]},"22":{"line":350,"type":"if","locations":[{"start":{"line":350,"column":8},"end":{"line":350,"column":8}},{"start":{"line":350,"column":8},"end":{"line":350,"column":8}}]},"23":{"line":357,"type":"if","locations":[{"start":{"line":357,"column":13},"end":{"line":357,"column":13}},{"start":{"line":357,"column":13},"end":{"line":357,"column":13}}]},"24":{"line":378,"type":"if","locations":[{"start":{"line":378,"column":8},"end":{"line":378,"column":8}},{"start":{"line":378,"column":8},"end":{"line":378,"column":8}}]},"25":{"line":379,"type":"cond-expr","locations":[{"start":{"line":379,"column":12},"end":{"line":379,"column":32}},{"start":{"line":380,"column":12},"end":{"line":380,"column":77}}]},"26":{"line":389,"type":"if","locations":[{"start":{"line":389,"column":12},"end":{"line":389,"column":12}},{"start":{"line":389,"column":12},"end":{"line":389,"column":12}}]},"27":{"line":407,"type":"if","locations":[{"start":{"line":407,"column":8},"end":{"line":407,"column":8}},{"start":{"line":407,"column":8},"end":{"line":407,"column":8}}]},"28":{"line":413,"type":"if","locations":[{"start":{"line":413,"column":8},"end":{"line":413,"column":8}},{"start":{"line":413,"column":8},"end":{"line":413,"column":8}}]},"29":{"line":421,"type":"if","locations":[{"start":{"line":421,"column":8},"end":{"line":421,"column":8}},{"start":{"line":421,"column":8},"end":{"line":421,"column":8}}]}}}, +"contracts/modules/internal/EnforcementModuleInternal.sol":{"l":{"65":944,"66":944,"83":22,"84":22,"85":2,"87":20,"88":20,"89":20,"101":8,"102":8,"103":2,"105":6,"106":6,"108":6,"113":974},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/internal/EnforcementModuleInternal.sol","s":{"1":944,"2":944,"3":22,"4":22,"5":2,"6":20,"7":20,"8":8,"9":8,"10":2,"11":6,"12":6},"b":{"1":[381,0],"2":[2,20],"3":[2,6]},"f":{"1":381,"2":944,"3":22,"4":8,"5":974},"fnMap":{"1":{"name":"__Enforcement_init_unchained","line":53,"loc":{"start":{"line":53,"column":4},"end":{"line":55,"column":4}}},"2":{"name":"frozen","line":64,"loc":{"start":{"line":64,"column":4},"end":{"line":67,"column":4}}},"3":{"name":"_freeze","line":79,"loc":{"start":{"line":79,"column":4},"end":{"line":90,"column":4}}},"4":{"name":"_unfreeze","line":97,"loc":{"start":{"line":97,"column":4},"end":{"line":109,"column":4}}},"5":{"name":"_getEnforcementModuleInternalStorage","line":112,"loc":{"start":{"line":112,"column":4},"end":{"line":116,"column":4}}}},"statementMap":{"1":{"start":{"line":65,"column":8},"end":{"line":65,"column":91}},"2":{"start":{"line":66,"column":8},"end":{"line":66,"column":33}},"3":{"start":{"line":83,"column":8},"end":{"line":83,"column":91}},"4":{"start":{"line":84,"column":8},"end":{"line":84,"column":2789}},"5":{"start":{"line":85,"column":12},"end":{"line":85,"column":24}},"6":{"start":{"line":88,"column":8},"end":{"line":88,"column":58}},"7":{"start":{"line":89,"column":8},"end":{"line":89,"column":19}},"8":{"start":{"line":101,"column":8},"end":{"line":101,"column":91}},"9":{"start":{"line":102,"column":8},"end":{"line":102,"column":3351}},"10":{"start":{"line":103,"column":12},"end":{"line":103,"column":24}},"11":{"start":{"line":106,"column":8},"end":{"line":106,"column":60}},"12":{"start":{"line":108,"column":8},"end":{"line":108,"column":19}}},"branchMap":{"1":{"line":53,"type":"if","locations":[{"start":{"line":53,"column":53},"end":{"line":53,"column":53}},{"start":{"line":53,"column":53},"end":{"line":53,"column":53}}]},"2":{"line":84,"type":"if","locations":[{"start":{"line":84,"column":8},"end":{"line":84,"column":8}},{"start":{"line":84,"column":8},"end":{"line":84,"column":8}}]},"3":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":8},"end":{"line":102,"column":8}},{"start":{"line":102,"column":8},"end":{"line":102,"column":8}}]}}}, +"contracts/modules/internal/ERC20SnapshotModuleInternal.sol":{"l":{"35":480,"36":480,"44":160,"45":160,"46":480,"48":160,"56":80,"57":80,"58":80,"59":80,"71":1200,"72":1200,"77":1200,"86":720,"87":720,"91":720,"106":421,"107":421,"109":77,"110":77,"112":43,"115":34,"119":344,"120":344,"128":464,"129":464,"136":378,"137":378},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/internal/ERC20SnapshotModuleInternal.sol","s":{"1":160,"2":80,"3":1200,"4":1200,"5":1200,"6":720,"7":720,"8":720,"9":421,"10":421,"11":77,"12":77,"13":43,"14":34,"15":344,"16":344,"17":464,"18":464,"19":378,"20":378},"b":{"1":[381,0],"2":[400,800],"3":[36,684],"4":[77,344],"5":[43,34]},"f":{"1":381,"2":480,"3":160,"4":80,"5":1200,"6":720,"7":421,"8":464,"9":378},"fnMap":{"1":{"name":"__ERC20Snapshot_init_unchained","line":21,"loc":{"start":{"line":21,"column":4},"end":{"line":24,"column":4}}},"2":{"name":"snapshotInfo","line":34,"loc":{"start":{"line":34,"column":4},"end":{"line":37,"column":4}}},"3":{"name":"snapshotInfoBatch","line":43,"loc":{"start":{"line":43,"column":4},"end":{"line":49,"column":4}}},"4":{"name":"snapshotInfoBatch","line":55,"loc":{"start":{"line":55,"column":4},"end":{"line":61,"column":4}}},"5":{"name":"snapshotBalanceOf","line":67,"loc":{"start":{"line":67,"column":4},"end":{"line":78,"column":4}}},"6":{"name":"snapshotTotalSupply","line":85,"loc":{"start":{"line":85,"column":4},"end":{"line":92,"column":4}}},"7":{"name":"_snapshotUpdate","line":102,"loc":{"start":{"line":102,"column":4},"end":{"line":122,"column":4}}},"8":{"name":"_updateAccountSnapshot","line":127,"loc":{"start":{"line":127,"column":4},"end":{"line":130,"column":4}}},"9":{"name":"_updateTotalSupplySnapshot","line":135,"loc":{"start":{"line":135,"column":4},"end":{"line":138,"column":4}}}},"statementMap":{"1":{"start":{"line":45,"column":8},"end":{"line":45,"column":2070}},"2":{"start":{"line":58,"column":8},"end":{"line":58,"column":2733}},"3":{"start":{"line":71,"column":8},"end":{"line":71,"column":77}},"4":{"start":{"line":72,"column":8},"end":{"line":72,"column":3316}},"5":{"start":{"line":77,"column":8},"end":{"line":77,"column":53}},"6":{"start":{"line":86,"column":8},"end":{"line":86,"column":77}},"7":{"start":{"line":87,"column":8},"end":{"line":87,"column":3868}},"8":{"start":{"line":91,"column":8},"end":{"line":91,"column":50}},"9":{"start":{"line":106,"column":8},"end":{"line":106,"column":28}},"10":{"start":{"line":107,"column":8},"end":{"line":107,"column":4593}},"11":{"start":{"line":109,"column":12},"end":{"line":109,"column":39}},"12":{"start":{"line":110,"column":12},"end":{"line":110,"column":4719}},"13":{"start":{"line":112,"column":16},"end":{"line":112,"column":41}},"14":{"start":{"line":115,"column":16},"end":{"line":115,"column":43}},"15":{"start":{"line":119,"column":12},"end":{"line":119,"column":37}},"16":{"start":{"line":120,"column":12},"end":{"line":120,"column":39}},"17":{"start":{"line":128,"column":8},"end":{"line":128,"column":77}},"18":{"start":{"line":129,"column":8},"end":{"line":129,"column":79}},"19":{"start":{"line":136,"column":8},"end":{"line":136,"column":77}},"20":{"start":{"line":137,"column":8},"end":{"line":137,"column":62}}},"branchMap":{"1":{"line":21,"type":"if","locations":[{"start":{"line":21,"column":55},"end":{"line":21,"column":55}},{"start":{"line":21,"column":55},"end":{"line":21,"column":55}}]},"2":{"line":77,"type":"if","locations":[{"start":{"line":77,"column":29},"end":{"line":77,"column":33}},{"start":{"line":77,"column":37},"end":{"line":77,"column":52}}]},"3":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":29},"end":{"line":91,"column":33}},{"start":{"line":91,"column":37},"end":{"line":91,"column":49}}]},"4":{"line":107,"type":"if","locations":[{"start":{"line":107,"column":8},"end":{"line":107,"column":8}},{"start":{"line":107,"column":8},"end":{"line":107,"column":8}}]},"5":{"line":110,"type":"if","locations":[{"start":{"line":110,"column":12},"end":{"line":110,"column":12}},{"start":{"line":110,"column":12},"end":{"line":110,"column":12}}]}}}, +"contracts/modules/internal/ValidationModuleInternal.sol":{"l":{"33":381,"34":18,"35":18,"36":18,"46":32,"47":32,"63":12,"64":12,"73":6,"74":6,"85":6,"86":6,"90":60,"91":60,"97":628},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/internal/ValidationModuleInternal.sol","s":{"1":381,"2":18,"3":18,"4":32,"5":32,"6":12,"7":12,"8":6,"9":6,"10":6,"11":6,"12":60,"13":60},"b":{"1":[381,0],"2":[18,363]},"f":{"1":381,"2":32,"3":12,"4":6,"5":6,"6":60,"7":628},"fnMap":{"1":{"name":"__Validation_init_unchained","line":32,"loc":{"start":{"line":30,"column":4},"end":{"line":38,"column":4}}},"2":{"name":"ruleEngine","line":45,"loc":{"start":{"line":45,"column":4},"end":{"line":48,"column":4}}},"3":{"name":"_validateTransfer","line":58,"loc":{"start":{"line":58,"column":4},"end":{"line":65,"column":4}}},"4":{"name":"_messageForTransferRestriction","line":70,"loc":{"start":{"line":70,"column":4},"end":{"line":75,"column":4}}},"5":{"name":"_detectTransferRestriction","line":80,"loc":{"start":{"line":80,"column":4},"end":{"line":87,"column":4}}},"6":{"name":"_operateOnTransfer","line":89,"loc":{"start":{"line":89,"column":4},"end":{"line":92,"column":4}}},"7":{"name":"_getValidationModuleInternalStorage","line":96,"loc":{"start":{"line":96,"column":4},"end":{"line":100,"column":4}}}},"statementMap":{"1":{"start":{"line":33,"column":8},"end":{"line":33,"column":1219}},"2":{"start":{"line":34,"column":12},"end":{"line":34,"column":93}},"3":{"start":{"line":36,"column":12},"end":{"line":36,"column":40}},"4":{"start":{"line":46,"column":8},"end":{"line":46,"column":89}},"5":{"start":{"line":47,"column":8},"end":{"line":47,"column":28}},"6":{"start":{"line":63,"column":8},"end":{"line":63,"column":89}},"7":{"start":{"line":64,"column":8},"end":{"line":64,"column":63}},"8":{"start":{"line":73,"column":8},"end":{"line":73,"column":89}},"9":{"start":{"line":74,"column":8},"end":{"line":74,"column":75}},"10":{"start":{"line":85,"column":8},"end":{"line":85,"column":89}},"11":{"start":{"line":86,"column":8},"end":{"line":86,"column":72}},"12":{"start":{"line":90,"column":8},"end":{"line":90,"column":89}},"13":{"start":{"line":91,"column":8},"end":{"line":91,"column":64}}},"branchMap":{"1":{"line":32,"type":"if","locations":[{"start":{"line":32,"column":15},"end":{"line":32,"column":15}},{"start":{"line":32,"column":15},"end":{"line":32,"column":15}}]},"2":{"line":33,"type":"if","locations":[{"start":{"line":33,"column":8},"end":{"line":33,"column":8}},{"start":{"line":33,"column":8},"end":{"line":33,"column":8}}]}}}, +"contracts/modules/security/AuthorizationModule.sol":{"l":{"32":381,"33":2,"35":379,"36":379,"37":16,"38":16,"39":16,"49":2,"50":2,"61":16,"62":16,"63":4,"65":12,"66":12,"70":40,"71":40,"72":8,"73":8,"75":4,"78":36,"82":10,"83":10,"84":8,"85":8,"87":4,"90":6,"101":1280,"102":759,"104":521,"115":84},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/security/AuthorizationModule.sol","s":{"1":381,"2":379,"3":379,"4":16,"5":16,"6":2,"7":2,"8":16,"9":16,"10":12,"11":40,"12":40,"13":8,"14":8,"15":36,"16":10,"17":10,"18":8,"19":8,"20":6,"21":1280,"22":759,"23":521},"b":{"1":[381,0],"2":[2,379],"3":[16,363],"4":[16,4],"5":[4,12],"6":[40,2],"7":[8,32],"8":[4,4],"9":[10,2],"10":[8,2],"11":[4,4],"12":[759,521]},"f":{"1":381,"2":2,"3":16,"4":40,"5":10,"6":1280,"7":84},"fnMap":{"1":{"name":"__AuthorizationModule_init_unchained","line":31,"loc":{"start":{"line":30,"column":4},"end":{"line":41,"column":4}}},"2":{"name":"authorizationEngine","line":48,"loc":{"start":{"line":48,"column":4},"end":{"line":51,"column":4}}},"3":{"name":"setAuthorizationEngine","line":60,"loc":{"start":{"line":58,"column":4},"end":{"line":67,"column":4}}},"4":{"name":"grantRole","line":69,"loc":{"start":{"line":69,"column":4},"end":{"line":79,"column":4}}},"5":{"name":"revokeRole","line":81,"loc":{"start":{"line":81,"column":4},"end":{"line":91,"column":4}}},"6":{"name":"hasRole","line":96,"loc":{"start":{"line":96,"column":4},"end":{"line":105,"column":4}}},"7":{"name":"_getAuthorizationModuleStorage","line":114,"loc":{"start":{"line":114,"column":4},"end":{"line":118,"column":4}}}},"statementMap":{"1":{"start":{"line":32,"column":8},"end":{"line":32,"column":1354}},"2":{"start":{"line":35,"column":8},"end":{"line":35,"column":44}},"3":{"start":{"line":36,"column":8},"end":{"line":36,"column":1521}},"4":{"start":{"line":37,"column":12},"end":{"line":37,"column":83}},"5":{"start":{"line":39,"column":12},"end":{"line":39,"column":58}},"6":{"start":{"line":49,"column":8},"end":{"line":49,"column":79}},"7":{"start":{"line":50,"column":8},"end":{"line":50,"column":37}},"8":{"start":{"line":61,"column":8},"end":{"line":61,"column":79}},"9":{"start":{"line":62,"column":8},"end":{"line":62,"column":2578}},"10":{"start":{"line":66,"column":8},"end":{"line":66,"column":54}},"11":{"start":{"line":70,"column":8},"end":{"line":70,"column":79}},"12":{"start":{"line":71,"column":8},"end":{"line":71,"column":3034}},"13":{"start":{"line":72,"column":12},"end":{"line":72,"column":82}},"14":{"start":{"line":73,"column":12},"end":{"line":73,"column":3188}},"15":{"start":{"line":78,"column":8},"end":{"line":78,"column":64}},"16":{"start":{"line":82,"column":8},"end":{"line":82,"column":79}},"17":{"start":{"line":83,"column":8},"end":{"line":83,"column":3630}},"18":{"start":{"line":84,"column":12},"end":{"line":84,"column":83}},"19":{"start":{"line":85,"column":12},"end":{"line":85,"column":3785}},"20":{"start":{"line":90,"column":8},"end":{"line":90,"column":65}},"21":{"start":{"line":101,"column":8},"end":{"line":101,"column":4316}},"22":{"start":{"line":102,"column":12},"end":{"line":102,"column":23}},"23":{"start":{"line":104,"column":8},"end":{"line":104,"column":62}}},"branchMap":{"1":{"line":31,"type":"if","locations":[{"start":{"line":31,"column":13},"end":{"line":31,"column":13}},{"start":{"line":31,"column":13},"end":{"line":31,"column":13}}]},"2":{"line":32,"type":"if","locations":[{"start":{"line":32,"column":8},"end":{"line":32,"column":8}},{"start":{"line":32,"column":8},"end":{"line":32,"column":8}}]},"3":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":8},"end":{"line":36,"column":8}},{"start":{"line":36,"column":8},"end":{"line":36,"column":8}}]},"4":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":15},"end":{"line":60,"column":15}},{"start":{"line":60,"column":15},"end":{"line":60,"column":15}}]},"5":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":8},"end":{"line":62,"column":8}},{"start":{"line":62,"column":8},"end":{"line":62,"column":8}}]},"6":{"line":69,"type":"if","locations":[{"start":{"line":69,"column":70},"end":{"line":69,"column":70}},{"start":{"line":69,"column":70},"end":{"line":69,"column":70}}]},"7":{"line":71,"type":"if","locations":[{"start":{"line":71,"column":8},"end":{"line":71,"column":8}},{"start":{"line":71,"column":8},"end":{"line":71,"column":8}}]},"8":{"line":73,"type":"if","locations":[{"start":{"line":73,"column":12},"end":{"line":73,"column":12}},{"start":{"line":73,"column":12},"end":{"line":73,"column":12}}]},"9":{"line":81,"type":"if","locations":[{"start":{"line":81,"column":71},"end":{"line":81,"column":71}},{"start":{"line":81,"column":71},"end":{"line":81,"column":71}}]},"10":{"line":83,"type":"if","locations":[{"start":{"line":83,"column":8},"end":{"line":83,"column":8}},{"start":{"line":83,"column":8},"end":{"line":83,"column":8}}]},"11":{"line":85,"type":"if","locations":[{"start":{"line":85,"column":12},"end":{"line":85,"column":12}},{"start":{"line":85,"column":12},"end":{"line":85,"column":12}}]},"12":{"line":101,"type":"if","locations":[{"start":{"line":101,"column":8},"end":{"line":101,"column":8}},{"start":{"line":101,"column":8},"end":{"line":101,"column":8}}]}}}, +"contracts/modules/wrapper/controllers/ValidationModule.sol":{"l":{"44":18,"45":18,"46":3,"48":15,"49":15,"60":20,"61":20,"62":3,"67":4,"72":2,"77":2,"79":6,"81":3,"97":17,"98":17,"99":4,"101":2,"103":2,"105":6,"107":3,"116":19,"117":4,"119":15,"120":15,"121":12,"123":3,"135":457,"136":18,"138":439,"142":438,"143":14,"145":424,"146":424,"147":60,"149":364},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/controllers/ValidationModule.sol","s":{"1":18,"2":18,"3":15,"4":20,"5":20,"6":3,"7":17,"8":4,"9":13,"10":2,"11":11,"12":2,"13":9,"14":6,"15":3,"16":17,"17":17,"18":4,"19":13,"20":2,"21":11,"22":2,"23":9,"24":6,"25":3,"26":19,"27":4,"28":15,"29":15,"30":12,"31":3,"32":457,"33":18,"34":439,"35":438,"36":14,"37":424,"38":424,"39":60,"40":364},"b":{"1":[379,0],"2":[18,3],"3":[3,15],"4":[3,17],"5":[4,13],"6":[2,11],"7":[2,9],"8":[6,3],"9":[4,13],"10":[2,11],"11":[2,9],"12":[6,3],"13":[4,15],"14":[12,3],"15":[18,439],"16":[12,4],"17":[4,2],"18":[14,424],"19":[60,364]},"f":{"1":379,"2":18,"3":20,"4":17,"5":19,"6":457,"7":438},"fnMap":{"1":{"name":"__ValidationModule_init_unchained","line":28,"loc":{"start":{"line":28,"column":4},"end":{"line":30,"column":4}}},"2":{"name":"setRuleEngine","line":43,"loc":{"start":{"line":41,"column":4},"end":{"line":50,"column":4}}},"3":{"name":"messageForTransferRestriction","line":57,"loc":{"start":{"line":57,"column":4},"end":{"line":83,"column":4}}},"4":{"name":"detectTransferRestriction","line":92,"loc":{"start":{"line":92,"column":4},"end":{"line":109,"column":4}}},"5":{"name":"validateTransfer","line":111,"loc":{"start":{"line":111,"column":4},"end":{"line":124,"column":4}}},"6":{"name":"_validateTransferByModule","line":130,"loc":{"start":{"line":130,"column":4},"end":{"line":139,"column":4}}},"7":{"name":"_operateOnTransfer","line":141,"loc":{"start":{"line":141,"column":4},"end":{"line":150,"column":4}}}},"statementMap":{"1":{"start":{"line":44,"column":8},"end":{"line":44,"column":89}},"2":{"start":{"line":45,"column":8},"end":{"line":45,"column":1409}},"3":{"start":{"line":49,"column":8},"end":{"line":49,"column":36}},"4":{"start":{"line":60,"column":10},"end":{"line":60,"column":91}},"5":{"start":{"line":61,"column":8},"end":{"line":61,"column":2191}},"6":{"start":{"line":62,"column":12},"end":{"line":62,"column":35}},"7":{"start":{"line":63,"column":15},"end":{"line":63,"column":2307}},"8":{"start":{"line":67,"column":12},"end":{"line":67,"column":48}},"9":{"start":{"line":68,"column":15},"end":{"line":68,"column":2483}},"10":{"start":{"line":72,"column":12},"end":{"line":72,"column":53}},"11":{"start":{"line":73,"column":15},"end":{"line":73,"column":2669}},"12":{"start":{"line":77,"column":12},"end":{"line":77,"column":51}},"13":{"start":{"line":78,"column":15},"end":{"line":78,"column":2851}},"14":{"start":{"line":79,"column":12},"end":{"line":79,"column":66}},"15":{"start":{"line":81,"column":12},"end":{"line":81,"column":36}},"16":{"start":{"line":97,"column":8},"end":{"line":97,"column":89}},"17":{"start":{"line":98,"column":8},"end":{"line":98,"column":3641}},"18":{"start":{"line":99,"column":12},"end":{"line":99,"column":69}},"19":{"start":{"line":100,"column":15},"end":{"line":100,"column":3743}},"20":{"start":{"line":101,"column":12},"end":{"line":101,"column":74}},"21":{"start":{"line":102,"column":15},"end":{"line":102,"column":3854}},"22":{"start":{"line":103,"column":12},"end":{"line":103,"column":72}},"23":{"start":{"line":104,"column":15},"end":{"line":104,"column":3961}},"24":{"start":{"line":105,"column":12},"end":{"line":105,"column":63}},"25":{"start":{"line":107,"column":12},"end":{"line":107,"column":56}},"26":{"start":{"line":116,"column":8},"end":{"line":116,"column":4310}},"27":{"start":{"line":117,"column":12},"end":{"line":117,"column":24}},"28":{"start":{"line":119,"column":8},"end":{"line":119,"column":89}},"29":{"start":{"line":120,"column":8},"end":{"line":120,"column":4497}},"30":{"start":{"line":121,"column":12},"end":{"line":121,"column":54}},"31":{"start":{"line":123,"column":8},"end":{"line":123,"column":19}},"32":{"start":{"line":135,"column":8},"end":{"line":135,"column":4983}},"33":{"start":{"line":136,"column":12},"end":{"line":136,"column":24}},"34":{"start":{"line":138,"column":8},"end":{"line":138,"column":19}},"35":{"start":{"line":142,"column":8},"end":{"line":142,"column":5209}},"36":{"start":{"line":143,"column":12},"end":{"line":143,"column":24}},"37":{"start":{"line":145,"column":8},"end":{"line":145,"column":89}},"38":{"start":{"line":146,"column":8},"end":{"line":146,"column":5395}},"39":{"start":{"line":147,"column":12},"end":{"line":147,"column":80}},"40":{"start":{"line":149,"column":8},"end":{"line":149,"column":19}}},"branchMap":{"1":{"line":28,"type":"if","locations":[{"start":{"line":28,"column":58},"end":{"line":28,"column":58}},{"start":{"line":28,"column":58},"end":{"line":28,"column":58}}]},"2":{"line":43,"type":"if","locations":[{"start":{"line":43,"column":15},"end":{"line":43,"column":15}},{"start":{"line":43,"column":15},"end":{"line":43,"column":15}}]},"3":{"line":45,"type":"if","locations":[{"start":{"line":45,"column":8},"end":{"line":45,"column":8}},{"start":{"line":45,"column":8},"end":{"line":45,"column":8}}]},"4":{"line":61,"type":"if","locations":[{"start":{"line":61,"column":8},"end":{"line":61,"column":8}},{"start":{"line":61,"column":8},"end":{"line":61,"column":8}}]},"5":{"line":63,"type":"if","locations":[{"start":{"line":63,"column":15},"end":{"line":63,"column":15}},{"start":{"line":63,"column":15},"end":{"line":63,"column":15}}]},"6":{"line":68,"type":"if","locations":[{"start":{"line":68,"column":15},"end":{"line":68,"column":15}},{"start":{"line":68,"column":15},"end":{"line":68,"column":15}}]},"7":{"line":73,"type":"if","locations":[{"start":{"line":73,"column":15},"end":{"line":73,"column":15}},{"start":{"line":73,"column":15},"end":{"line":73,"column":15}}]},"8":{"line":78,"type":"if","locations":[{"start":{"line":78,"column":15},"end":{"line":78,"column":15}},{"start":{"line":78,"column":15},"end":{"line":78,"column":15}}]},"9":{"line":98,"type":"if","locations":[{"start":{"line":98,"column":8},"end":{"line":98,"column":8}},{"start":{"line":98,"column":8},"end":{"line":98,"column":8}}]},"10":{"line":100,"type":"if","locations":[{"start":{"line":100,"column":15},"end":{"line":100,"column":15}},{"start":{"line":100,"column":15},"end":{"line":100,"column":15}}]},"11":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":15},"end":{"line":102,"column":15}},{"start":{"line":102,"column":15},"end":{"line":102,"column":15}}]},"12":{"line":104,"type":"if","locations":[{"start":{"line":104,"column":15},"end":{"line":104,"column":15}},{"start":{"line":104,"column":15},"end":{"line":104,"column":15}}]},"13":{"line":116,"type":"if","locations":[{"start":{"line":116,"column":8},"end":{"line":116,"column":8}},{"start":{"line":116,"column":8},"end":{"line":116,"column":8}}]},"14":{"line":120,"type":"if","locations":[{"start":{"line":120,"column":8},"end":{"line":120,"column":8}},{"start":{"line":120,"column":8},"end":{"line":120,"column":8}}]},"15":{"line":135,"type":"if","locations":[{"start":{"line":135,"column":8},"end":{"line":135,"column":8}},{"start":{"line":135,"column":8},"end":{"line":135,"column":8}}]},"16":{"line":135,"type":"cond-expr","locations":[{"start":{"line":135,"column":12},"end":{"line":135,"column":19}},{"start":{"line":135,"column":24},"end":{"line":135,"column":35}}]},"17":{"line":135,"type":"cond-expr","locations":[{"start":{"line":135,"column":12},"end":{"line":135,"column":35}},{"start":{"line":135,"column":40},"end":{"line":135,"column":49}}]},"18":{"line":142,"type":"if","locations":[{"start":{"line":142,"column":8},"end":{"line":142,"column":8}},{"start":{"line":142,"column":8},"end":{"line":142,"column":8}}]},"19":{"line":146,"type":"if","locations":[{"start":{"line":146,"column":8},"end":{"line":146,"column":8}},{"start":{"line":146,"column":8},"end":{"line":146,"column":8}}]}}}, +"contracts/modules/wrapper/core/BaseModule.sol":{"l":{"46":379,"47":379,"48":379,"49":379,"57":10,"58":10,"62":10,"63":10,"66":8,"67":8,"76":2,"77":2,"78":2,"87":2,"88":2,"89":2,"98":2,"99":2,"100":2,"110":413},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/core/BaseModule.sol","s":{"1":379,"2":10,"3":10,"4":10,"5":10,"6":8,"7":8,"8":2,"9":2,"10":2,"11":2,"12":2,"13":2},"b":{"1":[379,0],"2":[2,2],"3":[2,2],"4":[2,2]},"f":{"1":379,"2":10,"3":10,"4":8,"5":2,"6":2,"7":2,"8":413},"fnMap":{"1":{"name":"__Base_init_unchained","line":45,"loc":{"start":{"line":41,"column":4},"end":{"line":50,"column":4}}},"2":{"name":"tokenId","line":56,"loc":{"start":{"line":56,"column":4},"end":{"line":59,"column":4}}},"3":{"name":"terms","line":61,"loc":{"start":{"line":61,"column":4},"end":{"line":64,"column":4}}},"4":{"name":"information","line":65,"loc":{"start":{"line":65,"column":4},"end":{"line":68,"column":4}}},"5":{"name":"setTokenId","line":75,"loc":{"start":{"line":73,"column":4},"end":{"line":79,"column":4}}},"6":{"name":"setTerms","line":86,"loc":{"start":{"line":84,"column":4},"end":{"line":90,"column":4}}},"7":{"name":"setInformation","line":97,"loc":{"start":{"line":95,"column":4},"end":{"line":101,"column":4}}},"8":{"name":"_getBaseModuleStorage","line":109,"loc":{"start":{"line":109,"column":4},"end":{"line":113,"column":4}}}},"statementMap":{"1":{"start":{"line":46,"column":8},"end":{"line":46,"column":61}},"2":{"start":{"line":57,"column":8},"end":{"line":57,"column":61}},"3":{"start":{"line":58,"column":8},"end":{"line":58,"column":25}},"4":{"start":{"line":62,"column":8},"end":{"line":62,"column":61}},"5":{"start":{"line":63,"column":8},"end":{"line":63,"column":23}},"6":{"start":{"line":66,"column":8},"end":{"line":66,"column":61}},"7":{"start":{"line":67,"column":8},"end":{"line":67,"column":29}},"8":{"start":{"line":76,"column":8},"end":{"line":76,"column":61}},"9":{"start":{"line":78,"column":8},"end":{"line":78,"column":40}},"10":{"start":{"line":87,"column":8},"end":{"line":87,"column":61}},"11":{"start":{"line":89,"column":8},"end":{"line":89,"column":33}},"12":{"start":{"line":98,"column":8},"end":{"line":98,"column":61}},"13":{"start":{"line":100,"column":8},"end":{"line":100,"column":52}}},"branchMap":{"1":{"line":45,"type":"if","locations":[{"start":{"line":45,"column":15},"end":{"line":45,"column":15}},{"start":{"line":45,"column":15},"end":{"line":45,"column":15}}]},"2":{"line":75,"type":"if","locations":[{"start":{"line":75,"column":13},"end":{"line":75,"column":13}},{"start":{"line":75,"column":13},"end":{"line":75,"column":13}}]},"3":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":13},"end":{"line":86,"column":13}},{"start":{"line":86,"column":13},"end":{"line":86,"column":13}}]},"4":{"line":97,"type":"if","locations":[{"start":{"line":97,"column":13},"end":{"line":97,"column":13}},{"start":{"line":97,"column":13},"end":{"line":97,"column":13}}]}}}, +"contracts/modules/wrapper/core/EnforcementModule.sol":{"l":{"42":22,"56":8},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/core/EnforcementModule.sol","s":{"1":22,"2":8},"b":{"1":[379,0],"2":[22,2],"3":[8,2]},"f":{"1":379,"2":22,"3":8},"fnMap":{"1":{"name":"__EnforcementModule_init_unchained","line":26,"loc":{"start":{"line":26,"column":4},"end":{"line":28,"column":4}}},"2":{"name":"freeze","line":41,"loc":{"start":{"line":38,"column":4},"end":{"line":43,"column":4}}},"3":{"name":"unfreeze","line":55,"loc":{"start":{"line":52,"column":4},"end":{"line":57,"column":4}}}},"statementMap":{"1":{"start":{"line":42,"column":8},"end":{"line":42,"column":39}},"2":{"start":{"line":56,"column":8},"end":{"line":56,"column":41}}},"branchMap":{"1":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":59},"end":{"line":26,"column":59}},{"start":{"line":26,"column":59},"end":{"line":26,"column":59}}]},"2":{"line":41,"type":"if","locations":[{"start":{"line":41,"column":13},"end":{"line":41,"column":13}},{"start":{"line":41,"column":13},"end":{"line":41,"column":13}}]},"3":{"line":55,"type":"if","locations":[{"start":{"line":55,"column":13},"end":{"line":55,"column":13}},{"start":{"line":55,"column":13},"end":{"line":55,"column":13}}]}}}, +"contracts/modules/wrapper/core/ERC20BaseModule.sol":{"l":{"34":379,"35":379,"46":2,"47":2,"66":10,"67":2,"71":8,"72":4,"75":4,"78":10,"82":2,"97":10,"99":2,"100":2,"103":2,"112":4,"113":4,"114":6,"116":4,"127":381},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/core/ERC20BaseModule.sol","s":{"1":379,"2":2,"3":2,"4":10,"5":8,"6":4,"7":10,"8":2,"9":10,"10":2,"11":2,"12":2,"13":4},"b":{"1":[379,0],"2":[2,8],"3":[4,4],"4":[2,0]},"f":{"1":379,"2":2,"3":10,"4":10,"5":4,"6":381},"fnMap":{"1":{"name":"__ERC20BaseModule_init_unchained","line":33,"loc":{"start":{"line":31,"column":4},"end":{"line":36,"column":4}}},"2":{"name":"decimals","line":45,"loc":{"start":{"line":45,"column":4},"end":{"line":48,"column":4}}},"3":{"name":"transferBatch","line":62,"loc":{"start":{"line":62,"column":4},"end":{"line":83,"column":4}}},"4":{"name":"transferFrom","line":92,"loc":{"start":{"line":92,"column":4},"end":{"line":104,"column":4}}},"5":{"name":"balanceInfo","line":111,"loc":{"start":{"line":111,"column":4},"end":{"line":117,"column":4}}},"6":{"name":"_getERC20BaseModuleStorage","line":126,"loc":{"start":{"line":126,"column":4},"end":{"line":130,"column":4}}}},"statementMap":{"1":{"start":{"line":34,"column":8},"end":{"line":34,"column":71}},"2":{"start":{"line":46,"column":8},"end":{"line":46,"column":71}},"3":{"start":{"line":47,"column":8},"end":{"line":47,"column":26}},"4":{"start":{"line":66,"column":8},"end":{"line":66,"column":2666}},"5":{"start":{"line":71,"column":8},"end":{"line":71,"column":2883}},"6":{"start":{"line":75,"column":8},"end":{"line":75,"column":3078}},"7":{"start":{"line":78,"column":12},"end":{"line":78,"column":70}},"8":{"start":{"line":82,"column":8},"end":{"line":82,"column":19}},"9":{"start":{"line":97,"column":8},"end":{"line":97,"column":68}},"10":{"start":{"line":99,"column":8},"end":{"line":99,"column":4028}},"11":{"start":{"line":100,"column":12},"end":{"line":100,"column":49}},"12":{"start":{"line":103,"column":8},"end":{"line":103,"column":21}},"13":{"start":{"line":113,"column":8},"end":{"line":113,"column":4521}}},"branchMap":{"1":{"line":33,"type":"if","locations":[{"start":{"line":33,"column":15},"end":{"line":33,"column":15}},{"start":{"line":33,"column":15},"end":{"line":33,"column":15}}]},"2":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":8},"end":{"line":66,"column":8}},{"start":{"line":66,"column":8},"end":{"line":66,"column":8}}]},"3":{"line":71,"type":"if","locations":[{"start":{"line":71,"column":8},"end":{"line":71,"column":8}},{"start":{"line":71,"column":8},"end":{"line":71,"column":8}}]},"4":{"line":99,"type":"if","locations":[{"start":{"line":99,"column":8},"end":{"line":99,"column":8}},{"start":{"line":99,"column":8},"end":{"line":99,"column":8}}]}}}, +"contracts/modules/wrapper/core/ERC20BurnModule.sol":{"l":{"47":14,"48":12,"71":12,"72":2,"76":10,"77":4,"80":6,"81":18,"82":16,"105":4,"106":4,"107":4,"109":2,"112":2,"113":2,"116":2,"118":2,"120":2},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/core/ERC20BurnModule.sol","s":{"1":14,"2":12,"3":12,"4":10,"5":6,"6":18,"7":16,"8":4,"9":4,"10":4,"11":2,"12":2,"13":2,"14":2},"b":{"1":[379,0],"2":[14,4],"3":[12,2],"4":[2,10],"5":[4,6],"6":[4,2],"7":[2,2]},"f":{"1":379,"2":14,"3":12,"4":4},"fnMap":{"1":{"name":"__ERC20BurnModule_init_unchained","line":25,"loc":{"start":{"line":25,"column":4},"end":{"line":27,"column":4}}},"2":{"name":"burn","line":46,"loc":{"start":{"line":42,"column":4},"end":{"line":49,"column":4}}},"3":{"name":"burnBatch","line":70,"loc":{"start":{"line":66,"column":4},"end":{"line":84,"column":4}}},"4":{"name":"burnFrom","line":102,"loc":{"start":{"line":100,"column":4},"end":{"line":121,"column":4}}}},"statementMap":{"1":{"start":{"line":47,"column":8},"end":{"line":47,"column":28}},"2":{"start":{"line":48,"column":8},"end":{"line":48,"column":41}},"3":{"start":{"line":71,"column":8},"end":{"line":71,"column":2648}},"4":{"start":{"line":76,"column":8},"end":{"line":76,"column":2870}},"5":{"start":{"line":80,"column":8},"end":{"line":80,"column":3070}},"6":{"start":{"line":81,"column":12},"end":{"line":81,"column":40}},"7":{"start":{"line":82,"column":12},"end":{"line":82,"column":53}},"8":{"start":{"line":105,"column":8},"end":{"line":105,"column":38}},"9":{"start":{"line":106,"column":8},"end":{"line":106,"column":61}},"10":{"start":{"line":107,"column":8},"end":{"line":107,"column":3959}},"11":{"start":{"line":113,"column":12},"end":{"line":113,"column":62}},"12":{"start":{"line":116,"column":8},"end":{"line":116,"column":28}},"13":{"start":{"line":118,"column":8},"end":{"line":118,"column":45}},"14":{"start":{"line":120,"column":8},"end":{"line":120,"column":45}}},"branchMap":{"1":{"line":25,"type":"if","locations":[{"start":{"line":25,"column":57},"end":{"line":25,"column":57}},{"start":{"line":25,"column":57},"end":{"line":25,"column":57}}]},"2":{"line":46,"type":"if","locations":[{"start":{"line":46,"column":13},"end":{"line":46,"column":13}},{"start":{"line":46,"column":13},"end":{"line":46,"column":13}}]},"3":{"line":70,"type":"if","locations":[{"start":{"line":70,"column":13},"end":{"line":70,"column":13}},{"start":{"line":70,"column":13},"end":{"line":70,"column":13}}]},"4":{"line":71,"type":"if","locations":[{"start":{"line":71,"column":8},"end":{"line":71,"column":8}},{"start":{"line":71,"column":8},"end":{"line":71,"column":8}}]},"5":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":8},"end":{"line":76,"column":8}},{"start":{"line":76,"column":8},"end":{"line":76,"column":8}}]},"6":{"line":102,"type":"if","locations":[{"start":{"line":102,"column":8},"end":{"line":102,"column":8}},{"start":{"line":102,"column":8},"end":{"line":102,"column":8}}]},"7":{"line":107,"type":"if","locations":[{"start":{"line":107,"column":8},"end":{"line":107,"column":8}},{"start":{"line":107,"column":8},"end":{"line":107,"column":8}}]}}}, +"contracts/modules/wrapper/core/ERC20MintModule.sol":{"l":{"41":290,"42":290,"64":24,"65":2,"69":22,"70":4,"73":18,"74":54,"75":54},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/core/ERC20MintModule.sol","s":{"1":290,"2":290,"3":24,"4":22,"5":18,"6":54,"7":54},"b":{"1":[379,0],"2":[290,4],"3":[24,2],"4":[2,22],"5":[4,18]},"f":{"1":379,"2":290,"3":24},"fnMap":{"1":{"name":"__ERC20MintModule_init_unchained","line":20,"loc":{"start":{"line":20,"column":4},"end":{"line":22,"column":4}}},"2":{"name":"mint","line":40,"loc":{"start":{"line":40,"column":4},"end":{"line":43,"column":4}}},"3":{"name":"mintBatch","line":63,"loc":{"start":{"line":60,"column":4},"end":{"line":77,"column":4}}}},"statementMap":{"1":{"start":{"line":41,"column":8},"end":{"line":41,"column":28}},"2":{"start":{"line":42,"column":8},"end":{"line":42,"column":33}},"3":{"start":{"line":64,"column":8},"end":{"line":64,"column":2412}},"4":{"start":{"line":69,"column":8},"end":{"line":69,"column":2634}},"5":{"start":{"line":73,"column":8},"end":{"line":73,"column":2834}},"6":{"start":{"line":74,"column":12},"end":{"line":74,"column":40}},"7":{"start":{"line":75,"column":12},"end":{"line":75,"column":45}}},"branchMap":{"1":{"line":20,"type":"if","locations":[{"start":{"line":20,"column":57},"end":{"line":20,"column":57}},{"start":{"line":20,"column":57},"end":{"line":20,"column":57}}]},"2":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":57},"end":{"line":40,"column":57}},{"start":{"line":40,"column":57},"end":{"line":40,"column":57}}]},"3":{"line":63,"type":"if","locations":[{"start":{"line":63,"column":13},"end":{"line":63,"column":13}},{"start":{"line":63,"column":13},"end":{"line":63,"column":13}}]},"4":{"line":64,"type":"if","locations":[{"start":{"line":64,"column":8},"end":{"line":64,"column":8}},{"start":{"line":64,"column":8},"end":{"line":64,"column":8}}]},"5":{"line":69,"type":"if","locations":[{"start":{"line":69,"column":8},"end":{"line":69,"column":8}},{"start":{"line":69,"column":8},"end":{"line":69,"column":8}}]}}}, +"contracts/modules/wrapper/core/PauseModule.sol":{"l":{"50":14,"62":6,"63":6,"64":2,"66":4,"82":2,"83":2,"84":2,"85":2,"92":4,"93":4,"104":12},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/core/PauseModule.sol","s":{"1":14,"2":6,"3":6,"4":4,"5":2,"6":2,"7":2,"8":4,"9":4},"b":{"1":[379,0],"2":[14,3],"3":[6,2],"4":[2,4],"5":[2,2]},"f":{"1":379,"2":14,"3":6,"4":2,"5":4,"6":12},"fnMap":{"1":{"name":"__PauseModule_init_unchained","line":33,"loc":{"start":{"line":33,"column":4},"end":{"line":35,"column":4}}},"2":{"name":"pause","line":49,"loc":{"start":{"line":49,"column":4},"end":{"line":51,"column":4}}},"3":{"name":"unpause","line":61,"loc":{"start":{"line":61,"column":4},"end":{"line":67,"column":4}}},"4":{"name":"deactivateContract","line":80,"loc":{"start":{"line":78,"column":4},"end":{"line":86,"column":4}}},"5":{"name":"deactivated","line":91,"loc":{"start":{"line":91,"column":4},"end":{"line":94,"column":4}}},"6":{"name":"_getPauseModuleStorage","line":103,"loc":{"start":{"line":103,"column":4},"end":{"line":107,"column":4}}}},"statementMap":{"1":{"start":{"line":50,"column":8},"end":{"line":50,"column":15}},"2":{"start":{"line":62,"column":8},"end":{"line":62,"column":63}},"3":{"start":{"line":63,"column":8},"end":{"line":63,"column":2362}},"4":{"start":{"line":66,"column":8},"end":{"line":66,"column":17}},"5":{"start":{"line":82,"column":8},"end":{"line":82,"column":63}},"6":{"start":{"line":84,"column":7},"end":{"line":84,"column":14}},"7":{"start":{"line":85,"column":7},"end":{"line":85,"column":37}},"8":{"start":{"line":92,"column":8},"end":{"line":92,"column":63}},"9":{"start":{"line":93,"column":8},"end":{"line":93,"column":31}}},"branchMap":{"1":{"line":33,"type":"if","locations":[{"start":{"line":33,"column":53},"end":{"line":33,"column":53}},{"start":{"line":33,"column":53},"end":{"line":33,"column":53}}]},"2":{"line":49,"type":"if","locations":[{"start":{"line":49,"column":28},"end":{"line":49,"column":28}},{"start":{"line":49,"column":28},"end":{"line":49,"column":28}}]},"3":{"line":61,"type":"if","locations":[{"start":{"line":61,"column":30},"end":{"line":61,"column":30}},{"start":{"line":61,"column":30},"end":{"line":61,"column":30}}]},"4":{"line":63,"type":"if","locations":[{"start":{"line":63,"column":8},"end":{"line":63,"column":8}},{"start":{"line":63,"column":8},"end":{"line":63,"column":8}}]},"5":{"line":80,"type":"if","locations":[{"start":{"line":80,"column":8},"end":{"line":80,"column":8}},{"start":{"line":80,"column":8},"end":{"line":80,"column":8}}]}}}, +"contracts/modules/wrapper/extensions/DebtModule.sol":{"l":{"37":379,"38":3,"39":3,"40":3,"49":8,"50":8,"60":5,"61":5,"62":1,"64":4,"65":4,"69":2,"70":2,"71":2,"76":2,"77":2,"78":2,"89":20},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/extensions/DebtModule.sol","s":{"1":379,"2":3,"3":3,"4":8,"5":8,"6":5,"7":5,"8":4,"9":2,"10":2,"11":2,"12":2},"b":{"1":[379,0],"2":[3,376],"3":[5,1],"4":[1,4],"5":[2,0],"6":[2,0]},"f":{"1":379,"2":8,"3":5,"4":2,"5":2,"6":20},"fnMap":{"1":{"name":"__DebtModule_init_unchained","line":36,"loc":{"start":{"line":35,"column":4},"end":{"line":44,"column":4}}},"2":{"name":"debtEngine","line":48,"loc":{"start":{"line":48,"column":4},"end":{"line":51,"column":4}}},"3":{"name":"setDebtEngine","line":59,"loc":{"start":{"line":57,"column":4},"end":{"line":66,"column":4}}},"4":{"name":"debt","line":68,"loc":{"start":{"line":68,"column":4},"end":{"line":73,"column":4}}},"5":{"name":"creditEvents","line":75,"loc":{"start":{"line":75,"column":4},"end":{"line":80,"column":4}}},"6":{"name":"_getDebtModuleStorage","line":88,"loc":{"start":{"line":88,"column":4},"end":{"line":92,"column":4}}}},"statementMap":{"1":{"start":{"line":37,"column":8},"end":{"line":37,"column":1321}},"2":{"start":{"line":38,"column":12},"end":{"line":38,"column":65}},"3":{"start":{"line":40,"column":12},"end":{"line":40,"column":40}},"4":{"start":{"line":49,"column":8},"end":{"line":49,"column":61}},"5":{"start":{"line":50,"column":8},"end":{"line":50,"column":28}},"6":{"start":{"line":60,"column":8},"end":{"line":60,"column":61}},"7":{"start":{"line":61,"column":8},"end":{"line":61,"column":2151}},"8":{"start":{"line":65,"column":8},"end":{"line":65,"column":36}},"9":{"start":{"line":69,"column":8},"end":{"line":69,"column":61}},"10":{"start":{"line":70,"column":8},"end":{"line":70,"column":2478}},"11":{"start":{"line":76,"column":8},"end":{"line":76,"column":61}},"12":{"start":{"line":77,"column":8},"end":{"line":77,"column":2749}}},"branchMap":{"1":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":13},"end":{"line":36,"column":13}},{"start":{"line":36,"column":13},"end":{"line":36,"column":13}}]},"2":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":8},"end":{"line":37,"column":8}},{"start":{"line":37,"column":8},"end":{"line":37,"column":8}}]},"3":{"line":59,"type":"if","locations":[{"start":{"line":59,"column":15},"end":{"line":59,"column":15}},{"start":{"line":59,"column":15},"end":{"line":59,"column":15}}]},"4":{"line":61,"type":"if","locations":[{"start":{"line":61,"column":8},"end":{"line":61,"column":8}},{"start":{"line":61,"column":8},"end":{"line":61,"column":8}}]},"5":{"line":70,"type":"if","locations":[{"start":{"line":70,"column":8},"end":{"line":70,"column":8}},{"start":{"line":70,"column":8},"end":{"line":70,"column":8}}]},"6":{"line":77,"type":"if","locations":[{"start":{"line":77,"column":8},"end":{"line":77,"column":8}},{"start":{"line":77,"column":8},"end":{"line":77,"column":8}}]}}}, +"contracts/modules/wrapper/extensions/DocumentModule.sol":{"l":{"34":379,"35":12,"36":12,"37":12,"45":28,"46":28,"56":16,"57":16,"58":2,"60":14,"61":14,"66":16,"67":16,"68":16,"70":0,"75":4,"76":4,"77":4,"88":76},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/extensions/DocumentModule.sol","s":{"1":379,"2":12,"3":12,"4":28,"5":28,"6":16,"7":16,"8":14,"9":16,"10":16,"11":16,"12":0,"13":4,"14":4},"b":{"1":[379,0],"2":[12,367],"3":[16,2],"4":[2,14],"5":[16,0],"6":[4,0]},"f":{"1":379,"2":28,"3":16,"4":16,"5":4,"6":76},"fnMap":{"1":{"name":"__DocumentModule_init_unchained","line":33,"loc":{"start":{"line":32,"column":4},"end":{"line":39,"column":4}}},"2":{"name":"documentEngine","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":47,"column":4}}},"3":{"name":"setDocumentEngine","line":55,"loc":{"start":{"line":53,"column":4},"end":{"line":62,"column":4}}},"4":{"name":"getDocument","line":65,"loc":{"start":{"line":65,"column":4},"end":{"line":72,"column":4}}},"5":{"name":"getAllDocuments","line":74,"loc":{"start":{"line":74,"column":4},"end":{"line":79,"column":4}}},"6":{"name":"_getDocumentModuleStorage","line":87,"loc":{"start":{"line":87,"column":4},"end":{"line":91,"column":4}}}},"statementMap":{"1":{"start":{"line":34,"column":8},"end":{"line":34,"column":1308}},"2":{"start":{"line":35,"column":12},"end":{"line":35,"column":73}},"3":{"start":{"line":37,"column":12},"end":{"line":37,"column":48}},"4":{"start":{"line":45,"column":8},"end":{"line":45,"column":69}},"5":{"start":{"line":46,"column":8},"end":{"line":46,"column":32}},"6":{"start":{"line":56,"column":8},"end":{"line":56,"column":69}},"7":{"start":{"line":57,"column":8},"end":{"line":57,"column":2187}},"8":{"start":{"line":61,"column":8},"end":{"line":61,"column":44}},"9":{"start":{"line":66,"column":8},"end":{"line":66,"column":69}},"10":{"start":{"line":67,"column":8},"end":{"line":67,"column":2574}},"11":{"start":{"line":68,"column":12},"end":{"line":68,"column":56}},"12":{"start":{"line":70,"column":12},"end":{"line":70,"column":30}},"13":{"start":{"line":75,"column":8},"end":{"line":75,"column":69}},"14":{"start":{"line":76,"column":8},"end":{"line":76,"column":2903}}},"branchMap":{"1":{"line":33,"type":"if","locations":[{"start":{"line":33,"column":13},"end":{"line":33,"column":13}},{"start":{"line":33,"column":13},"end":{"line":33,"column":13}}]},"2":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":8},"end":{"line":34,"column":8}},{"start":{"line":34,"column":8},"end":{"line":34,"column":8}}]},"3":{"line":55,"type":"if","locations":[{"start":{"line":55,"column":15},"end":{"line":55,"column":15}},{"start":{"line":55,"column":15},"end":{"line":55,"column":15}}]},"4":{"line":57,"type":"if","locations":[{"start":{"line":57,"column":8},"end":{"line":57,"column":8}},{"start":{"line":57,"column":8},"end":{"line":57,"column":8}}]},"5":{"line":67,"type":"if","locations":[{"start":{"line":67,"column":8},"end":{"line":67,"column":8}},{"start":{"line":67,"column":8},"end":{"line":67,"column":8}}]},"6":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":8},"end":{"line":76,"column":8}},{"start":{"line":76,"column":8},"end":{"line":76,"column":8}}]}}}, +"contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol":{"l":{"33":170,"44":12,"56":22,"67":14,"77":10},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol","s":{"1":170,"2":12,"3":22,"4":14,"5":10},"b":{"1":[379,0],"2":[170,2],"3":[12,4],"4":[22,2],"5":[14,2],"6":[10,0]},"f":{"1":379,"2":170,"3":12,"4":22,"5":14,"6":10},"fnMap":{"1":{"name":"__ERC20SnasphotModule_init_unchained","line":21,"loc":{"start":{"line":21,"column":4},"end":{"line":23,"column":4}}},"2":{"name":"scheduleSnapshot","line":32,"loc":{"start":{"line":32,"column":4},"end":{"line":34,"column":4}}},"3":{"name":"scheduleSnapshotNotOptimized","line":43,"loc":{"start":{"line":41,"column":4},"end":{"line":45,"column":4}}},"4":{"name":"rescheduleSnapshot","line":55,"loc":{"start":{"line":52,"column":4},"end":{"line":57,"column":4}}},"5":{"name":"unscheduleLastSnapshot","line":66,"loc":{"start":{"line":64,"column":4},"end":{"line":68,"column":4}}},"6":{"name":"unscheduleSnapshotNotOptimized","line":76,"loc":{"start":{"line":74,"column":4},"end":{"line":78,"column":4}}}},"statementMap":{"1":{"start":{"line":33,"column":8},"end":{"line":33,"column":30}},"2":{"start":{"line":44,"column":8},"end":{"line":44,"column":42}},"3":{"start":{"line":56,"column":8},"end":{"line":56,"column":44}},"4":{"start":{"line":67,"column":8},"end":{"line":67,"column":36}},"5":{"start":{"line":77,"column":8},"end":{"line":77,"column":44}}},"branchMap":{"1":{"line":21,"type":"if","locations":[{"start":{"line":21,"column":61},"end":{"line":21,"column":61}},{"start":{"line":21,"column":61},"end":{"line":21,"column":61}}]},"2":{"line":32,"type":"if","locations":[{"start":{"line":32,"column":51},"end":{"line":32,"column":51}},{"start":{"line":32,"column":51},"end":{"line":32,"column":51}}]},"3":{"line":43,"type":"if","locations":[{"start":{"line":43,"column":13},"end":{"line":43,"column":13}},{"start":{"line":43,"column":13},"end":{"line":43,"column":13}}]},"4":{"line":55,"type":"if","locations":[{"start":{"line":55,"column":13},"end":{"line":55,"column":13}},{"start":{"line":55,"column":13},"end":{"line":55,"column":13}}]},"5":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":13},"end":{"line":66,"column":13}},{"start":{"line":66,"column":13},"end":{"line":66,"column":13}}]},"6":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":13},"end":{"line":76,"column":13}},{"start":{"line":76,"column":13},"end":{"line":76,"column":13}}]}}}, +"contracts/modules/wrapper/extensions/MetaTxModule.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/extensions/MetaTxModule.sol","s":{},"b":{},"f":{"1":395},"fnMap":{"1":{"name":"constructor","line":18,"loc":{"start":{"line":16,"column":4},"end":{"line":20,"column":4}}}},"statementMap":{},"branchMap":{}}, "contracts/test/proxy/CMTAT_PROXY_TEST_UUPS.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/test/proxy/CMTAT_PROXY_TEST_UUPS.sol","s":{},"b":{},"f":{"1":3},"fnMap":{"1":{"name":"constructor","line":18,"loc":{"start":{"line":16,"column":4},"end":{"line":20,"column":4}}}},"statementMap":{},"branchMap":{}}, "contracts/test/proxy/CMTAT_PROXY_TEST.sol":{"l":{},"path":"/home/ryan/Downloads/CM/CMTAT/contracts/test/proxy/CMTAT_PROXY_TEST.sol","s":{},"b":{},"f":{"1":1},"fnMap":{"1":{"name":"constructor","line":18,"loc":{"start":{"line":16,"column":4},"end":{"line":20,"column":4}}}},"statementMap":{},"branchMap":{}}} diff --git a/doc/general/test/coverage/index.html b/doc/general/test/coverage/index.html index c8fe8018..d20dfec4 100644 --- a/doc/general/test/coverage/index.html +++ b/doc/general/test/coverage/index.html @@ -20,24 +20,24 @@

- 99.4% + 99.45% Statements - 333/335 + 361/363
- 90.98% + 90.53% Branches - 242/266 + 239/264
- 99.22% + 99.28% Functions - 128/129 + 138/139
- 99.53% + 99.57% Lines - 427/429 + 461/463
@@ -75,13 +75,26 @@

contracts/deployment/
100% - 29/29 + 33/33 100% - 20/20 + 10/10 100% - 12/12 + 16/16 + 100% + 51/51 + + + + contracts/deployment/libraries/ +
100% - 49/49 + 8/8 + 100% + 10/10 + 100% + 4/4 + 100% + 16/16 @@ -153,26 +166,26 @@

contracts/modules/internal/
100% - 41/41 + 45/45 85% 17/20 100% 21/21 100% - 54/54 + 58/58 contracts/modules/internal/base/
100% - 76/76 - 96.67% - 58/60 + 88/88 + 96.55% + 56/58 100% - 16/16 + 18/18 100% - 100/100 + 112/112 @@ -219,8 +232,8 @@

96.77% 30/31 - 80.56% - 29/36 + 77.78% + 28/36 100% 19/19 97.62% @@ -246,7 +259,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/CMTAT_PROXY.sol.html b/doc/general/test/coverage/lcov-report/contracts/CMTAT_PROXY.sol.html index 3d3cdbd9..18655b87 100644 --- a/doc/general/test/coverage/lcov-report/contracts/CMTAT_PROXY.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/CMTAT_PROXY.sol.html @@ -78,7 +78,7 @@

      -194× +197×      
//SPDX-License-Identifier: MPL-2.0
@@ -106,7 +106,7 @@ 

diff --git a/doc/general/test/coverage/lcov-report/contracts/CMTAT_PROXY_UUPS.sol.html b/doc/general/test/coverage/lcov-report/contracts/CMTAT_PROXY_UUPS.sol.html index e03ce88e..a46ce9f7 100644 --- a/doc/general/test/coverage/lcov-report/contracts/CMTAT_PROXY_UUPS.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/CMTAT_PROXY_UUPS.sol.html @@ -92,12 +92,7 @@

47 48 49 -50 -51 -52 -53 -54 -55  +50        @@ -113,8 +108,8 @@

      +   -       @@ -133,30 +128,24 @@

      +       +     -             -  - -  -  -  -   
//SPDX-License-Identifier: MPL-2.0
  
 pragma solidity ^0.8.20;
-import "../openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol";
+import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
 import "./modules/CMTAT_BASE.sol";
-import "./interfaces/engine/IEngine.sol";
 contract CMTAT_PROXY_UUPS is CMTAT_BASE, UUPSUpgradeable {
     bytes32 public constant PROXY_UPGRADE_ROLE = keccak256("PROXY_UPGRADE_ROLE");
     /**
@@ -170,39 +159,35 @@ 

// Disable the possibility to initialize the implementation _disableInitializers(); } +  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @notice * initialize the proxy contract * The calls to this function will revert if the contract was deployed without a proxy * @param admin address of the admin of contract (Access Control) - * @param nameIrrevocable name of the token - * @param symbolIrrevocable name of the symbol - * @param decimalsIrrevocable number of decimals of the token, must be 0 to be compliant with Swiss law as per CMTAT specifications (non-zero decimal number may be needed for other use cases) - * @param tokenId_ name of the tokenId - * @param terms_ terms associated with the token - * @param information_ additional information to describe the token - * @param engines list of engines + * @param ERC20Attributes_ ERC20 name, symbol and decimals + * @param baseModuleAttributes_ tokenId, terms, information + * @param engines_ external contract */ function initialize( address admin, - string memory nameIrrevocable, - string memory symbolIrrevocable, - uint8 decimalsIrrevocable, - string memory tokenId_, - string memory terms_, - string memory information_, - IEngine.Engine memory engines) public override Einitializer { + ICMTATConstructor.ERC20Attributes memory ERC20Attributes_, + ICMTATConstructor.BaseModuleAttributes memory baseModuleAttributes_, + ICMTATConstructor.Engine memory engines_ ) public override Einitializer { CMTAT_BASE.initialize( admin, - nameIrrevocable, - symbolIrrevocable, - decimalsIrrevocable, - tokenId_, - terms_, - information_, - engines); + ERC20Attributes_, + baseModuleAttributes_, + engines_); __UUPSUpgradeable_init_unchained(); }   +  + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ function _authorizeUpgrade(address) internal override onlyRole(PROXY_UPGRADE_ROLE) {} }  

@@ -211,7 +196,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/CMTAT_STANDALONE.sol.html b/doc/general/test/coverage/lcov-report/contracts/CMTAT_STANDALONE.sol.html index 7480fbc7..016d674d 100644 --- a/doc/general/test/coverage/lcov-report/contracts/CMTAT_STANDALONE.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/CMTAT_STANDALONE.sol.html @@ -76,27 +76,7 @@

31 32 33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46  -  -  -  -  -  -  -  -  +34        @@ -129,10 +109,6 @@

      -  -  -  -   
//SPDX-License-Identifier: MPL-2.0
  
 pragma solidity ^0.8.20;
@@ -144,37 +120,25 @@ 

* @notice Contract version for standalone deployment * @param forwarderIrrevocable address of the forwarder, required for the gasless support * @param admin address of the admin of contract (Access Control) - * @param authorizationEngineIrrevocable - * @param nameIrrevocable name of the token - * @param symbolIrrevocable name of the symbol - * @param decimalsIrrevocable number of decimals used to get its user representation, should be 0 to be compliant with the CMTAT specifications. - * @param tokenId_ name of the tokenId - * @param terms_ terms associated with the token - * @param information_ additional information to describe the token + * @param ERC20Attributes_ ERC20 name, symbol and decimals + * @param baseModuleAttributes_ tokenId, terms, information + * @param engines_ external contract */ /// @custom:oz-upgrades-unsafe-allow constructor constructor( address forwarderIrrevocable, address admin, - string memory nameIrrevocable, - string memory symbolIrrevocable, - uint8 decimalsIrrevocable, - string memory tokenId_, - string memory terms_, - string memory information_, - IEngine.Engine memory engine_ + ICMTATConstructor.ERC20Attributes memory ERC20Attributes_, + ICMTATConstructor.BaseModuleAttributes memory baseModuleAttributes_, + ICMTATConstructor.Engine memory engines_ ) MetaTxModule(forwarderIrrevocable) { // Initialize the contract to avoid front-running // Warning : do not initialize the proxy initialize( admin, - nameIrrevocable, - symbolIrrevocable, - decimalsIrrevocable, - tokenId_, - terms_, - information_, - engine_ + ERC20Attributes_, + baseModuleAttributes_, + engines_ ); } } @@ -184,7 +148,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/deployment/CMTAT_BEACON_FACTORY.sol.html b/doc/general/test/coverage/lcov-report/contracts/deployment/CMTAT_BEACON_FACTORY.sol.html index 2c7a0047..a9f007e0 100644 --- a/doc/general/test/coverage/lcov-report/contracts/deployment/CMTAT_BEACON_FACTORY.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/deployment/CMTAT_BEACON_FACTORY.sol.html @@ -22,22 +22,22 @@

100% Statements - 10/10 + 13/13
100% Branches - 8/8 + 6/6
100% Functions - 4/4 + 6/6
100% Lines - 17/17 + 21/21
@@ -141,8 +141,11 @@

96 97 98 -99  -  +99 +100 +101 +102 +103        @@ -166,30 +169,30 @@

      + +   + +   +             - -   - -   - -   - - -     + +     + +       @@ -201,6 +204,7 @@

      +     @@ -210,6 +214,13 @@

      + + + + + + +       @@ -217,19 +228,16 @@

      - - - - -     +           - +  +       @@ -247,34 +255,22 @@

import '@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol'; import "../CMTAT_PROXY.sol"; import "../modules/CMTAT_BASE.sol"; -import "../libraries/FactoryErrors.sol"; -import '@openzeppelin/contracts/access/AccessControl.sol'; -import "../interfaces/engine/IEngine.sol"; +import "./libraries/CMTATFactoryRoot.sol"; +    /** * @notice Factory to deploy beacon proxy * */ -contract CMTAT_BEACON_FACTORY is AccessControl { - // Private - mapping(uint256 => address) private cmtats; - uint256 private cmtatCounterId; +contract CMTAT_BEACON_FACTORY is AccessControl, CMTATFactoryRoot { // public - /// @dev Role to deploy CMTAT - bytes32 public constant CMTAT_DEPLOYER_ROLE = keccak256("CMTAT_DEPLOYER_ROLE"); UpgradeableBeacon public immutable beacon; - address[] public cmtatsList; - event CMTAT(address indexed CMTAT, uint256 id); -  /** * @param implementation_ contract implementation * @param factoryAdmin admin * @param beaconOwner owner */ - constructor(address implementation_, address factoryAdmin, address beaconOwner) { - if(factoryAdmin == address(0)){ - revert FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForFactoryAdmin(); - } + constructor(address implementation_, address factoryAdmin, address beaconOwner, bool useCustomSalt_)CMTATFactoryRoot(factoryAdmin, useCustomSalt_) { if(beaconOwner == address(0)){ revert FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForBeaconOwner(); } @@ -282,8 +278,6 @@

revert FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForLogicContract(); } beacon = new UpgradeableBeacon(implementation_, beaconOwner); - _grantRole(DEFAULT_ADMIN_ROLE, factoryAdmin); - _grantRole(CMTAT_DEPLOYER_ROLE, factoryAdmin); }   /** @@ -291,44 +285,62 @@

* */ function deployCMTAT( + bytes32 deploymentSaltInput, // CMTAT function initialize - address admin, - string memory nameIrrevocable, - string memory symbolIrrevocable, - uint8 decimalsIrrevocable, - string memory tokenId_, - string memory terms_, - string memory information_, - IEngine.Engine memory engines + CMTAT_ARGUMENT calldata cmtatArgument ) public onlyRole(CMTAT_DEPLOYER_ROLE) returns(BeaconProxy cmtat) { - cmtat = new BeaconProxy( - address(beacon), - abi.encodeWithSelector( - CMTAT_PROXY(address(0)).initialize.selector, - admin, - nameIrrevocable, - symbolIrrevocable, - decimalsIrrevocable, - tokenId_, - terms_, - information_, - engines - ) - ); - cmtats[cmtatCounterId] = address(cmtat); - emit CMTAT(address(cmtat), cmtatCounterId); - cmtatCounterId++; - cmtatsList.push(address(cmtat)); + bytes32 deploymentSalt = _checkAndDetermineDeploymentSalt(deploymentSaltInput); + bytes memory bytecode = _getBytecode( + // CMTAT function initialize + cmtatArgument); + cmtat = _deployBytecode(bytecode, deploymentSalt); return cmtat; }   /** - * @notice get CMTAT proxy address - * + * @param deploymentSalt salt for the deployment + * @param cmtatArgument argument for the function initialize + * @notice get the proxy address depending on a particular salt */ - function getCMTATAddress(uint256 cmtatID_) external view returns (address) { - return cmtats[cmtatID_]; + function computedProxyAddress( + bytes32 deploymentSalt, + // CMTAT function initialize + CMTAT_ARGUMENT calldata cmtatArgument) public view returns (address) { + bytes memory bytecode = _getBytecode( + // CMTAT function initialize + cmtatArgument); + return Create2.computeAddress(deploymentSalt, keccak256(bytecode), address(this) ); } +  + /** + * @notice Deploy CMTAT and push the created CMTAT in the list + */ + function _deployBytecode(bytes memory bytecode, bytes32 deploymentSalt) internal returns (BeaconProxy cmtat) { + address cmtatAddress = Create2.deploy(0, deploymentSalt, bytecode); + cmtat = BeaconProxy(payable(cmtatAddress)); + cmtats[cmtatCounterId] = address(cmtat); + emit CMTAT(address(cmtat), cmtatCounterId); + ++cmtatCounterId; + cmtatsList.push(address(cmtat)); + return cmtat; + } +  + + /** + * @notice return the smart contract bytecode + */ + function _getBytecode( + // CMTAT function initialize + CMTAT_ARGUMENT calldata cmtatArgument) internal view returns(bytes memory bytecode) { + bytes memory _implementation = abi.encodeWithSelector( + CMTAT_PROXY(address(0)).initialize.selector, + cmtatArgument.CMTATAdmin, + cmtatArgument.ERC20Attributes, + cmtatArgument.baseModuleAttributes, + cmtatArgument.engines + ); + bytecode = abi.encodePacked(type(BeaconProxy).creationCode, abi.encode(address(beacon), _implementation)); + }   /** * @notice get the implementation address from the beacon @@ -343,7 +355,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/deployment/CMTAT_TP_FACTORY.sol.html b/doc/general/test/coverage/lcov-report/contracts/deployment/CMTAT_TP_FACTORY.sol.html index 8962d89e..0508c5a1 100644 --- a/doc/general/test/coverage/lcov-report/contracts/deployment/CMTAT_TP_FACTORY.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/deployment/CMTAT_TP_FACTORY.sol.html @@ -22,22 +22,22 @@

100% Statements - 19/19 + 10/10
100% Branches - 12/12 + 2/2
100% Functions - 8/8 + 5/5
100% Lines - 32/32 + 15/15
@@ -123,100 +123,7 @@

78 79 80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174  +81        @@ -241,48 +148,6 @@

      -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - - -  - - -  - - -  - - - -  -  -  -  -  -  -  -  -  -  -    @@ -313,32 +178,6 @@

      -  - -  -  -  -  -  -  -  -  - - - -  - - -  -  - -  -  -  -  -  -  -  @@ -362,33 +201,8 @@

      -  -  -  - -  -  -  -  -  -  -  -  -  -  -    -  -  -  -  -  -  -  -  -  -   
//SPDX-License-Identifier: MPL-2.0
 pragma solidity ^0.8.20;
  
@@ -396,57 +210,15 @@ 

import "../CMTAT_PROXY.sol"; import "../libraries/FactoryErrors.sol"; import '@openzeppelin/contracts/utils/Create2.sol'; -import '@openzeppelin/contracts/access/AccessControl.sol'; -import "../interfaces/engine/IEngine.sol"; -  +import "./libraries/CMTATFactoryInvariant.sol"; +import "./libraries/CMTATFactoryBase.sol"; /** * @notice Factory to deploy CMTAT with a transparent proxy * */ -contract CMTAT_TP_FACTORY is AccessControl { - // Public - /// @dev Role to deploy CMTAT - bytes32 public constant CMTAT_DEPLOYER_ROLE = keccak256("CMTAT_DEPLOYER_ROLE"); - address public immutable logic; - address[] public cmtatsList; - bool public useCustomSalt; - uint256 public cmtatID; - /// mapping - mapping(uint256 => address) private cmtats; - mapping(bytes32 => bool) private customSaltUsed; - - struct CMTAT_ARGUMENT{ - address CMTATAdmin; - string nameIrrevocable; - string symbolIrrevocable; - uint8 decimalsIrrevocable; - string tokenId; - string terms; - string information; - IEngine.Engine engines; - } - event CMTAT(address indexed CMTAT, uint256 id); +contract CMTAT_TP_FACTORY is CMTATFactoryInvariant, CMTATFactoryBase {   - - /** - * @param logic_ contract implementation - * @param factoryAdmin admin - */ - constructor(address logic_, address factoryAdmin, bool useCustomSalt_) { - if(logic_ == address(0)){ - revert FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForLogicContract(); - } - if(factoryAdmin == address(0)){ - revert FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForFactoryAdmin(); - } - if(useCustomSalt_){ - useCustomSalt = useCustomSalt_; - } - logic = logic_; - _grantRole(DEFAULT_ADMIN_ROLE, factoryAdmin); - _grantRole(CMTAT_DEPLOYER_ROLE, factoryAdmin); - } - + constructor(address logic_, address factoryAdmin, bool useCustomSalt_) CMTATFactoryBase(logic_, factoryAdmin,useCustomSalt_){} /** * @notice deploy a transparent proxy with a proxy admin contract */ @@ -481,32 +253,6 @@

cmtatArgument); return Create2.computeAddress(deploymentSalt, keccak256(bytecode), address(this) ); } - - /** - * @notice get CMTAT proxy address - * - */ - function CMTATProxyAddress(uint256 cmtatID_) external view returns (address) { - return cmtats[cmtatID_]; - } - - /** - * @param deploymentSalt salt for deployment - * @dev - * if useCustomSalt is at false, the salt used is the current value of cmtatId - */ - function _checkAndDetermineDeploymentSalt(bytes32 deploymentSalt) internal returns(bytes32 saltBytes){ - if(useCustomSalt){ - if(customSaltUsed[deploymentSalt]){ - revert FactoryErrors.CMTAT_Factory_SaltAlreadyUsed(); - }else { - customSaltUsed[deploymentSalt] = true; - saltBytes = deploymentSalt; - } - }else{ - saltBytes = bytes32(keccak256(abi.encodePacked(cmtatID))); - } - }   /** * @notice Deploy CMTAT and push the created CMTAT in the list @@ -514,9 +260,9 @@

function _deployBytecode(bytes memory bytecode, bytes32 deploymentSalt) internal returns (TransparentUpgradeableProxy cmtat) { address cmtatAddress = Create2.deploy(0, deploymentSalt, bytecode); cmtat = TransparentUpgradeableProxy(payable(cmtatAddress)); - cmtats[cmtatID] = address(cmtat); - emit CMTAT(address(cmtat), cmtatID); - ++cmtatID; + cmtats[cmtatCounterId] = address(cmtat); + emit CMTAT(address(cmtat), cmtatCounterId); + ++cmtatCounterId; cmtatsList.push(address(cmtat)); return cmtat; } @@ -528,47 +274,22 @@

function _getBytecode( address proxyAdminOwner, // CMTAT function initialize CMTAT_ARGUMENT calldata cmtatArgument) internal view returns(bytes memory bytecode) { - bytes memory implementation = _encodeImplementationArgument( - cmtatArgument.CMTATAdmin, - cmtatArgument.nameIrrevocable, - cmtatArgument.symbolIrrevocable, - cmtatArgument.decimalsIrrevocable, - cmtatArgument.tokenId, - cmtatArgument.terms, - cmtatArgument.information, - cmtatArgument.engines - ); - bytecode = abi.encodePacked(type(TransparentUpgradeableProxy).creationCode, abi.encode(logic, proxyAdminOwner, implementation)); - } -  -  - function _encodeImplementationArgument( address admin, - string memory nameIrrevocable, - string memory symbolIrrevocable, - uint8 decimalsIrrevocable, - string memory tokenId_, - string memory terms_, - string memory information_, - IEngine.Engine memory engines) internal pure returns(bytes memory){ - return abi.encodeWithSelector( + bytes memory implementation = abi.encodeWithSelector( CMTAT_PROXY(address(0)).initialize.selector, - admin, - nameIrrevocable, - symbolIrrevocable, - decimalsIrrevocable, - tokenId_, - terms_, - information_, - engines + cmtatArgument.CMTATAdmin, + cmtatArgument.ERC20Attributes, + cmtatArgument.baseModuleAttributes, + cmtatArgument.engines ); - } + bytecode = abi.encodePacked(type(TransparentUpgradeableProxy).creationCode, abi.encode(logic, proxyAdminOwner, implementation)); + } }

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/DebtModule/CreditEventsModule.sol.html b/doc/general/test/coverage/lcov-report/contracts/deployment/CMTAT_UUPS_FACTORY.sol.html similarity index 50% rename from doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/DebtModule/CreditEventsModule.sol.html rename to doc/general/test/coverage/lcov-report/contracts/deployment/CMTAT_UUPS_FACTORY.sol.html index 9fc63921..33a52f20 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/DebtModule/CreditEventsModule.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/deployment/CMTAT_UUPS_FACTORY.sol.html @@ -1,14 +1,14 @@ - Code coverage report for contracts/modules/wrapper/extensions/DebtModule/CreditEventsModule.sol + Code coverage report for contracts/deployment/CMTAT_UUPS_FACTORY.sol - - + + @@ -16,32 +16,32 @@

- all files / contracts/modules/wrapper/extensions/DebtModule/ CreditEventsModule.sol + all files / contracts/deployment/ CMTAT_UUPS_FACTORY.sol

- 0% + 100% Statements - 0/8 + 10/10
- 0% + 100% Branches - 0/14 + 2/2
- 0% + 100% Functions - 0/5 + 5/5
- 0% + 100% Lines - 0/14 + 15/15
-
+

+    
+    /**
+    * @notice return the smart contract bytecode
+    */
+     function _getBytecode( 
+        // CMTAT function initialize
+        CMTAT_ARGUMENT calldata cmtatArgument) internal view returns(bytes memory bytecode) {
+        bytes memory implementation = abi.encodeWithSelector(
+            CMTAT_PROXY_UUPS(address(0)).initialize.selector,
+                  cmtatArgument.CMTATAdmin,
+                    cmtatArgument.ERC20Attributes,
+                cmtatArgument.baseModuleAttributes,
+                cmtatArgument.engines
+        );
+        bytecode = abi.encodePacked(type(ERC1967Proxy).creationCode,  abi.encode(logic, implementation));
+     }
+}
1 2 @@ -127,7 +127,10 @@

82 83 84 -85

  +85 +86 +87 +88        @@ -157,9 +160,13 @@

      + +     +   +       @@ -167,23 +174,17 @@

      -  -  -  -          +     +     -  -    -  -        @@ -191,12 +192,15 @@

      + + + + + + +   -  -    -  -        @@ -204,107 +208,112 @@

      +   -  -          +  + +   

//SPDX-License-Identifier: MPL-2.0
- 
 pragma solidity ^0.8.20;
  
-import "../../../../../openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol";
-import "../../../../../openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol";
-import "../../../../interfaces/IDebtGlobal.sol";
-import "../../../security/AuthorizationModule.sol";
- 
-import "../../../../libraries/Errors.sol";
- 
-abstract contract CreditEventsModule is
-    IDebtGlobal,
-    Initializable,
-    ContextUpgradeable,
-    AuthorizationModule
-{
-    // CreditEvents
-    bytes32 public constant DEBT_CREDIT_EVENT_ROLE =
-    keccak256("DEBT_CREDIT_EVENT_ROLE");
-    CreditEvents public creditEvents;
- 
-    /* Events */
-    event FlagDefault(bool indexed newFlagDefault);
-    event FlagRedeemed(bool indexed newFlagRedeemed);
-    event Rating(string indexed newRatingIndexed, string newRating);
- 
-    function __CreditEvents_init_unchained() internal onlyInitializing {
-        // no variable to initialize
-    }
- 
-    /** 
-    * @notice Set all attributes of creditEvents
-    * The values of all attributes will be changed even if the new values are the same as the current ones
+import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
+import "../CMTAT_PROXY_UUPS.sol";
+import "../libraries/FactoryErrors.sol";
+import '@openzeppelin/contracts/utils/Create2.sol';
+import '@openzeppelin/contracts/access/AccessControl.sol';
+import "./libraries/CMTATFactoryInvariant.sol";
+import "./libraries/CMTATFactoryBase.sol";
+/**
+* @notice Factory to deploy CMTAT with a UUPS proxy
+* 
+*/
+contract CMTAT_UUPS_FACTORY is CMTATFactoryInvariant, CMTATFactoryBase {
+    /**
+    * @param logic_ contract implementation
+    * @param factoryAdmin admin
     */
-    function setCreditEvents(
-        bool flagDefault_,
-        bool flagRedeemed_,
-        string calldata rating_
-    ) public onlyRole(DEBT_CREDIT_EVENT_ROLE) {
-        creditEvents = (CreditEvents(flagDefault_, flagRedeemed_, rating_));
-        emit FlagDefault(flagDefault_);
-        emit FlagRedeemed(flagRedeemed_);
-        emit Rating(rating_, rating_);
-    }
- 
-    /** 
-    * @notice The call will be reverted if the new value of flagDefault is the same as the current one
+    constructor(address logic_, address factoryAdmin, bool useCustomSalt_) CMTATFactoryBase(logic_, factoryAdmin,useCustomSalt_){}
+       
+    
+    /**
+    * @notice deploy a transparent proxy with a proxy admin contract
     */
-    function setFlagDefault(
-        bool flagDefault_
-    ) public onlyRole(DEBT_CREDIT_EVENT_ROLE) {
-        if (flagDefault_ == creditEvents.flagDefault) {
-            revert Errors.CMTAT_DebtModule_SameValue();
-        }
-        creditEvents.flagDefault = flagDefault_;
-        emit FlagDefault(flagDefault_);
+    function deployCMTAT(
+        bytes32 deploymentSaltInput,
+        // CMTAT function initialize
+        CMTAT_ARGUMENT calldata cmtatArgument
+    ) public onlyRole(CMTAT_DEPLOYER_ROLE) returns(ERC1967Proxy cmtat)   {
+        bytes32 deploymentSalt = _checkAndDetermineDeploymentSalt(deploymentSaltInput);
+        bytes memory bytecode = _getBytecode(
+        // CMTAT function initialize
+        cmtatArgument);
+        cmtat = _deployBytecode(bytecode,  deploymentSalt);
+        
+        return cmtat;
     }
  
-    /** 
-    * @notice The call will be reverted if the new value of flagRedeemed is the same as the current one
+    /**
+    * @param deploymentSalt salt for the deployment
+    * @param cmtatArgument argument for the function initialize
+    * @notice get the proxy address depending on a particular salt
     */
-    function setFlagRedeemed(
-        bool flagRedeemed_
-    ) public onlyRole(DEBT_CREDIT_EVENT_ROLE) {
-        if (flagRedeemed_ == creditEvents.flagRedeemed) {
-            revert Errors.CMTAT_DebtModule_SameValue();
-        }
-        creditEvents.flagRedeemed = flagRedeemed_;
-        emit FlagRedeemed(flagRedeemed_);
+    function computedProxyAddress( 
+        bytes32 deploymentSalt,
+        // CMTAT function initialize
+        CMTAT_ARGUMENT calldata cmtatArgument) public view returns (address) {
+        bytes memory bytecode =  _getBytecode(
+        // CMTAT function initialize
+        cmtatArgument);
+        return Create2.computeAddress(deploymentSalt,  keccak256(bytecode), address(this) );
     }
  
-    /** 
-    * @notice The rating will be changed even if the new value is the same as the current one
+    /*//////////////////////////////////////////////////////////////
+                            INTERNAL FUNCTIONS
+    //////////////////////////////////////////////////////////////*/
+ 
+    /**
+    * @notice Deploy CMTAT and push the created CMTAT in the list
     */
-    function setRating(
-        string calldata rating_
-    ) public onlyRole(DEBT_CREDIT_EVENT_ROLE) {
-        creditEvents.rating = rating_;
-        emit Rating(rating_, rating_);
-    }
+    function _deployBytecode(bytes memory bytecode, bytes32  deploymentSalt) internal returns (ERC1967Proxy cmtat) {
+                    address cmtatAddress = Create2.deploy(0, deploymentSalt, bytecode);
+                    cmtat = ERC1967Proxy(payable(cmtatAddress));
+                    cmtats[cmtatCounterId] = address(cmtat);
+                    emit CMTAT(address(cmtat), cmtatCounterId);
+                    ++cmtatCounterId;
+                    cmtatsList.push(address(cmtat));
+                    return cmtat;
+     }
  
-    uint256[50] private __gap;
-}
- 
- + - + diff --git a/doc/general/test/coverage/lcov-report/contracts/deployment/index.html b/doc/general/test/coverage/lcov-report/contracts/deployment/index.html index 36e590b9..b4c7db02 100644 --- a/doc/general/test/coverage/lcov-report/contracts/deployment/index.html +++ b/doc/general/test/coverage/lcov-report/contracts/deployment/index.html @@ -22,22 +22,22 @@

100% Statements - 29/29 + 33/33
100% Branches - 20/20 + 10/10
100% Functions - 12/12 + 16/16
100% Lines - 49/49 + 51/51
@@ -62,26 +62,39 @@

CMTAT_BEACON_FACTORY.sol
100% - 10/10 + 13/13 100% - 8/8 + 6/6 100% - 4/4 + 6/6 100% - 17/17 + 21/21 CMTAT_TP_FACTORY.sol
100% - 19/19 + 10/10 + 100% + 2/2 + 100% + 5/5 + 100% + 15/15 + + + + CMTAT_UUPS_FACTORY.sol +
+ 100% + 10/10 100% - 12/12 + 2/2 100% - 8/8 + 5/5 100% - 32/32 + 15/15 @@ -90,7 +103,7 @@

diff --git a/doc/general/test/coverage/contracts/test/proxy/CMTAT_PROXY.sol.html b/doc/general/test/coverage/lcov-report/contracts/deployment/libraries/CMTATFactoryBase.sol.html similarity index 73% rename from doc/general/test/coverage/contracts/test/proxy/CMTAT_PROXY.sol.html rename to doc/general/test/coverage/lcov-report/contracts/deployment/libraries/CMTATFactoryBase.sol.html index bc1d9738..1402b62c 100644 --- a/doc/general/test/coverage/contracts/test/proxy/CMTAT_PROXY.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/deployment/libraries/CMTATFactoryBase.sol.html @@ -1,7 +1,7 @@ - Code coverage report for contracts/test/proxy/CMTAT_PROXY.sol + Code coverage report for contracts/deployment/libraries/CMTATFactoryBase.sol @@ -16,18 +16,18 @@

- all files / contracts/test/proxy/ CMTAT_PROXY.sol + all files / contracts/deployment/libraries/ CMTATFactoryBase.sol

100% Statements - 0/0 + 1/1
100% Branches - 0/0 + 2/2
100% @@ -37,7 +37,7 @@

100% Lines - 0/0 + 3/3

@@ -84,41 +84,41 @@

      +16× +   -  -  -  +14×    
//SPDX-License-Identifier: MPL-2.0
- 
 pragma solidity ^0.8.20;
  
-import "../../CMTAT_PROXY.sol";
+import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
+import "./CMTATFactoryRoot.sol";
  
 /**
- * @title a contrat used to test the proxy upgrade functionality
- */
-contract CMTAT_PROXY_TEST is CMTAT_PROXY {
+* @notice Code common to TP and UUPS Factory
+* 
+*/
+abstract contract CMTATFactoryBase is CMTATFactoryRoot {
+    // Public
+    address public immutable logic;
     /**
-     * @notice Contract version for the deployment with a proxy
-     * @param forwarderIrrevocable address of the forwarder, required for the gasless support
-     */
-    /// @custom:oz-upgrades-unsafe-allow constructor
-    constructor(
-        address forwarderIrrevocable
-    ) CMTAT_PROXY(forwarderIrrevocable) {
-        // Nothing to do
+    * @param logic_ contract implementation
+    * @param factoryAdmin admin
+    */
+    constructor(address logic_, address factoryAdmin, bool useCustomSalt_)CMTATFactoryRoot( factoryAdmin, useCustomSalt_) {
+        if(logic_ == address(0)){
+            revert  FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForLogicContract();
+        }
+        logic = logic_;
     }
- 
-    uint256[50] private __gap;
-}
- 
+}

diff --git a/doc/general/test/coverage/contracts/interfaces/engine/IEngine.sol.html b/doc/general/test/coverage/lcov-report/contracts/deployment/libraries/CMTATFactoryInvariant.sol.html similarity index 79% rename from doc/general/test/coverage/contracts/interfaces/engine/IEngine.sol.html rename to doc/general/test/coverage/lcov-report/contracts/deployment/libraries/CMTATFactoryInvariant.sol.html index 86048200..90b86137 100644 --- a/doc/general/test/coverage/contracts/interfaces/engine/IEngine.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/deployment/libraries/CMTATFactoryInvariant.sol.html @@ -1,7 +1,7 @@ - Code coverage report for contracts/interfaces/engine/IEngine.sol + Code coverage report for contracts/deployment/libraries/CMTATFactoryInvariant.sol @@ -16,7 +16,7 @@

- all files / contracts/interfaces/engine/ IEngine.sol + all files / contracts/deployment/libraries/ CMTATFactoryInvariant.sol

@@ -86,33 +86,33 @@

     
//SPDX-License-Identifier: MPL-2.0
-import "./IDebtEngine.sol";
-import "./IRuleEngine.sol";
-import "./IAuthorizationEngine.sol";
-import "./draft-IERC1643.sol";
- 
 pragma solidity ^0.8.20;
  
+ 
+import "../../interfaces/ICMTATConstructor.sol";
+ 
 /**
-* @notice interface to represent debt tokens
+* @notice Factory to deploy CMTAT with a transparent proxy
+* 
 */
-interface IEngine {
-    struct Engine {
-        IRuleEngine ruleEngine;
-        IDebtEngine debtEngine;
-        IAuthorizationEngine authorizationEngine;
-        IERC1643 documentEngine;
+abstract contract CMTATFactoryInvariant {
+    /// @dev Role to deploy CMTAT
+    bytes32 public constant CMTAT_DEPLOYER_ROLE = keccak256("CMTAT_DEPLOYER_ROLE");
+    struct CMTAT_ARGUMENT{
+        address CMTATAdmin;
+        ICMTATConstructor.ERC20Attributes ERC20Attributes;
+        ICMTATConstructor.BaseModuleAttributes baseModuleAttributes;
+        ICMTATConstructor.Engine engines;
     }
- 
- 
-}
- 
+ /* ============ Events ============ */ + event CMTAT(address indexed CMTAT, uint256 id); +}

diff --git a/doc/general/test/coverage/lcov-report/contracts/deployment/libraries/CMTATFactoryRoot.sol.html b/doc/general/test/coverage/lcov-report/contracts/deployment/libraries/CMTATFactoryRoot.sol.html new file mode 100644 index 00000000..c882bef0 --- /dev/null +++ b/doc/general/test/coverage/lcov-report/contracts/deployment/libraries/CMTATFactoryRoot.sol.html @@ -0,0 +1,245 @@ + + + + Code coverage report for contracts/deployment/libraries/CMTATFactoryRoot.sol + + + + + + + +
+
+

+ all files / contracts/deployment/libraries/ CMTATFactoryRoot.sol +

+
+
+ 100% + Statements + 7/7 +
+
+ 100% + Branches + 8/8 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 13/13 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +27× + +  +24× +15× +  +24× +24× +  +  +  +  +  +  +  +13× +  +  +  +  +  +  +  +  +11× + + +  + + +  +  + +  +  + 
//SPDX-License-Identifier: MPL-2.0
+pragma solidity ^0.8.20;
+ 
+import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
+import "../../CMTAT_PROXY.sol";
+import "../../libraries/FactoryErrors.sol";
+import '@openzeppelin/contracts/utils/Create2.sol';
+import '@openzeppelin/contracts/access/AccessControl.sol';
+import "./CMTATFactoryInvariant.sol";
+/**
+* @notice Code common to Beacon, TP and UUPS factory
+* 
+*/
+abstract contract CMTATFactoryRoot is AccessControl, CMTATFactoryInvariant {
+    // Public
+    address[] public cmtatsList;
+    bool public useCustomSalt;
+    uint256 public cmtatCounterId;
+    /// mapping
+    mapping(uint256 => address) internal cmtats;
+    mapping(bytes32 => bool) internal customSaltUsed;
+    /**
+    * @param factoryAdmin admin
+    */
+    constructor(address factoryAdmin, bool useCustomSalt_) {
+        if(factoryAdmin == address(0)){
+            revert  FactoryErrors.CMTAT_Factory_AddressZeroNotAllowedForFactoryAdmin();
+        }
+        if(useCustomSalt_){
+            useCustomSalt = useCustomSalt_;
+        }
+        _grantRole(DEFAULT_ADMIN_ROLE, factoryAdmin);
+        _grantRole(CMTAT_DEPLOYER_ROLE, factoryAdmin);
+    }
+ 
+    /**
+    * @notice get CMTAT proxy address
+    *
+    */
+    function CMTATProxyAddress(uint256 cmtatCounterId_) external view returns (address) {
+        return cmtats[cmtatCounterId_];
+    }
+    
+    /**
+    * @param deploymentSalt salt for deployment
+    * @dev 
+    * if useCustomSalt is at false, the salt used is the current value of cmtatCounterId
+    */
+    function _checkAndDetermineDeploymentSalt(bytes32 deploymentSalt) internal returns(bytes32 saltBytes){
+       if(useCustomSalt){
+            if(customSaltUsed[deploymentSalt]){
+                revert FactoryErrors.CMTAT_Factory_SaltAlreadyUsed();
+            }else {
+                customSaltUsed[deploymentSalt] = true;
+                saltBytes = deploymentSalt;
+            }
+        }else{
+            saltBytes = bytes32(keccak256(abi.encodePacked(cmtatCounterId)));
+        }
+    }
+}
+
+
+ +
+ + + + + diff --git a/doc/general/test/coverage/lcov-report/contracts/deployment/libraries/index.html b/doc/general/test/coverage/lcov-report/contracts/deployment/libraries/index.html new file mode 100644 index 00000000..1536542b --- /dev/null +++ b/doc/general/test/coverage/lcov-report/contracts/deployment/libraries/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for contracts/deployment/libraries/ + + + + + + + +
+
+

+ all files contracts/deployment/libraries/ +

+
+
+ 100% + Statements + 8/8 +
+
+ 100% + Branches + 10/10 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 16/16 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
CMTATFactoryBase.sol
100%1/1100%2/2100%1/1100%3/3
CMTATFactoryInvariant.sol
100%0/0100%0/0100%0/0100%0/0
CMTATFactoryRoot.sol
100%7/7100%8/8100%3/3100%13/13
+
+
+ +
+ + + + + diff --git a/doc/general/test/coverage/lcov-report/contracts/index.html b/doc/general/test/coverage/lcov-report/contracts/index.html index 11aec3ce..2399575b 100644 --- a/doc/general/test/coverage/lcov-report/contracts/index.html +++ b/doc/general/test/coverage/lcov-report/contracts/index.html @@ -103,7 +103,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/interfaces/ICCIPToken.sol.html b/doc/general/test/coverage/lcov-report/contracts/interfaces/ICCIPToken.sol.html index 4729389d..34fd651f 100644 --- a/doc/general/test/coverage/lcov-report/contracts/interfaces/ICCIPToken.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/interfaces/ICCIPToken.sol.html @@ -121,7 +121,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/interfaces/ICMTATConstructor.sol.html b/doc/general/test/coverage/lcov-report/contracts/interfaces/ICMTATConstructor.sol.html new file mode 100644 index 00000000..85ad78c9 --- /dev/null +++ b/doc/general/test/coverage/lcov-report/contracts/interfaces/ICMTATConstructor.sol.html @@ -0,0 +1,170 @@ + + + + Code coverage report for contracts/interfaces/ICMTATConstructor.sol + + + + + + + +
+
+

+ all files / contracts/interfaces/ ICMTATConstructor.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
//SPDX-License-Identifier: MPL-2.0
+import "./engine/IDebtEngine.sol";
+import "./engine/IRuleEngine.sol";
+import "./engine/IAuthorizationEngine.sol";
+import "./engine/draft-IERC1643.sol";
+ 
+pragma solidity ^0.8.20;
+ 
+/**
+* @notice interface to represent arguments used for CMTAT constructor / initialize
+*/
+interface ICMTATConstructor {
+    struct Engine {
+        IRuleEngine ruleEngine;
+        IDebtEngine debtEngine;
+        IAuthorizationEngine authorizationEngine;
+        IERC1643 documentEngine;
+    }
+    struct ERC20Attributes {
+        // name of the token,
+        string nameIrrevocable;
+        // name of the symbol
+        string symbolIrrevocable;
+        // number of decimals of the token, must be 0 to be compliant with Swiss law as per CMTAT specifications (non-zero decimal number may be needed for other use cases)
+        uint8 decimalsIrrevocable;
+    }
+    struct BaseModuleAttributes {
+        // name of the tokenId
+        string tokenId;
+        // terms associated with the token
+        string terms;
+        // additional information to describe the token
+        string information;
+    }
+}
+ 
+
+
+ + + + + + + diff --git a/doc/general/test/coverage/lcov-report/contracts/interfaces/ICMTATSnapshot.sol.html b/doc/general/test/coverage/lcov-report/contracts/interfaces/ICMTATSnapshot.sol.html index b89864ba..4b4c5842 100644 --- a/doc/general/test/coverage/lcov-report/contracts/interfaces/ICMTATSnapshot.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/interfaces/ICMTATSnapshot.sol.html @@ -163,7 +163,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/interfaces/IDebtGlobal.sol.html b/doc/general/test/coverage/lcov-report/contracts/interfaces/IDebtGlobal.sol.html index 2a46dbad..55c69a84 100644 --- a/doc/general/test/coverage/lcov-report/contracts/interfaces/IDebtGlobal.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/interfaces/IDebtGlobal.sol.html @@ -136,7 +136,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/interfaces/draft-IERC1404/draft-IERC1404.sol.html b/doc/general/test/coverage/lcov-report/contracts/interfaces/draft-IERC1404/draft-IERC1404.sol.html index 1570c292..a9f17adb 100644 --- a/doc/general/test/coverage/lcov-report/contracts/interfaces/draft-IERC1404/draft-IERC1404.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/interfaces/draft-IERC1404/draft-IERC1404.sol.html @@ -127,7 +127,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/interfaces/draft-IERC1404/draft-IERC1404EnumCode.sol.html b/doc/general/test/coverage/lcov-report/contracts/interfaces/draft-IERC1404/draft-IERC1404EnumCode.sol.html index 141e5c93..0bb7499a 100644 --- a/doc/general/test/coverage/lcov-report/contracts/interfaces/draft-IERC1404/draft-IERC1404EnumCode.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/interfaces/draft-IERC1404/draft-IERC1404EnumCode.sol.html @@ -94,7 +94,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/interfaces/draft-IERC1404/draft-IERC1404Wrapper.sol.html b/doc/general/test/coverage/lcov-report/contracts/interfaces/draft-IERC1404/draft-IERC1404Wrapper.sol.html index d650211d..a9b84efa 100644 --- a/doc/general/test/coverage/lcov-report/contracts/interfaces/draft-IERC1404/draft-IERC1404Wrapper.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/interfaces/draft-IERC1404/draft-IERC1404Wrapper.sol.html @@ -103,7 +103,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/interfaces/draft-IERC1404/index.html b/doc/general/test/coverage/lcov-report/contracts/interfaces/draft-IERC1404/index.html index af8d247d..b3b35735 100644 --- a/doc/general/test/coverage/lcov-report/contracts/interfaces/draft-IERC1404/index.html +++ b/doc/general/test/coverage/lcov-report/contracts/interfaces/draft-IERC1404/index.html @@ -103,7 +103,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/IAuthorizationEngine.sol.html b/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/IAuthorizationEngine.sol.html index 5b38cdde..3b0babb7 100644 --- a/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/IAuthorizationEngine.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/IAuthorizationEngine.sol.html @@ -109,7 +109,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/IDebtEngine.sol.html b/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/IDebtEngine.sol.html index 50a785dc..9fab0048 100644 --- a/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/IDebtEngine.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/IDebtEngine.sol.html @@ -82,11 +82,11 @@

  interface IDebtEngine is IDebtGlobal { /** - * @dev Returns true if the operation is authorized, and false otherwise. + * @dev Returns debt information */ function debt() external view returns(IDebtGlobal.DebtBase memory); /** - * @dev Returns true if the operation is authorized, and false otherwise. + * @dev Returns credit events */ function creditEvents() external view returns(IDebtGlobal.CreditEvents memory); @@ -97,7 +97,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/IRuleEngine.sol.html b/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/IRuleEngine.sol.html index d829cb9b..35bf495c 100644 --- a/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/IRuleEngine.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/IRuleEngine.sol.html @@ -100,7 +100,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/draft-IERC1643.sol.html b/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/draft-IERC1643.sol.html index 4c195ec7..b0586cc6 100644 --- a/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/draft-IERC1643.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/draft-IERC1643.sol.html @@ -79,7 +79,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/index.html b/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/index.html index 394530be..be4b8cc1 100644 --- a/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/index.html +++ b/doc/general/test/coverage/lcov-report/contracts/interfaces/engine/index.html @@ -84,19 +84,6 @@

0/0 - - IEngine.sol -
- 100% - 0/0 - 100% - 0/0 - 100% - 0/0 - 100% - 0/0 - - IRuleEngine.sol
@@ -129,7 +116,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/interfaces/index.html b/doc/general/test/coverage/lcov-report/contracts/interfaces/index.html index 88d4e165..0dc4c554 100644 --- a/doc/general/test/coverage/lcov-report/contracts/interfaces/index.html +++ b/doc/general/test/coverage/lcov-report/contracts/interfaces/index.html @@ -71,6 +71,19 @@

0/0 + + ICMTATConstructor.sol +
+ 100% + 0/0 + 100% + 0/0 + 100% + 0/0 + 100% + 0/0 + + ICMTATSnapshot.sol
@@ -103,7 +116,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/libraries/Errors.sol.html b/doc/general/test/coverage/lcov-report/contracts/libraries/Errors.sol.html index 47797d09..3df6d18f 100644 --- a/doc/general/test/coverage/lcov-report/contracts/libraries/Errors.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/libraries/Errors.sol.html @@ -256,7 +256,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/libraries/FactoryErrors.sol.html b/doc/general/test/coverage/lcov-report/contracts/libraries/FactoryErrors.sol.html index 50f6a676..818589f8 100644 --- a/doc/general/test/coverage/lcov-report/contracts/libraries/FactoryErrors.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/libraries/FactoryErrors.sol.html @@ -79,7 +79,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/libraries/index.html b/doc/general/test/coverage/lcov-report/contracts/libraries/index.html index d272ea9a..4604548c 100644 --- a/doc/general/test/coverage/lcov-report/contracts/libraries/index.html +++ b/doc/general/test/coverage/lcov-report/contracts/libraries/index.html @@ -90,7 +90,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/CMTAT_BASE.sol.html b/doc/general/test/coverage/lcov-report/contracts/modules/CMTAT_BASE.sol.html index 691297a5..fbbcd8b4 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/CMTAT_BASE.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/CMTAT_BASE.sol.html @@ -283,8 +283,7 @@

238 239 240 -241 -242  +241        @@ -348,10 +347,10 @@

      +381×       -377×       @@ -368,61 +367,56 @@

      +381× +381×   +381×   +381× +381×     +381×         +381× +381×   +381×   -377× -377×   -377×   -377× -377× +381× +379× +379×   +379× +379×   -377× +379× +379×         -377× -377×   -377× +379× +379× +379×     +379×   -377× -375× -375×   -375× -375× +379×   -375× -375×           -375× -375× -375× -  -  -375× -  -  -375× -        @@ -479,7 +473,10 @@

      -437× +  +  +  +438× 17×     @@ -487,8 +484,9 @@

      -420× -420× +421× +421× +        @@ -501,7 +499,7 @@

      -1381× +1386×       @@ -510,7 +508,7 @@

      -1381× +1386×       @@ -530,8 +528,8 @@

pragma solidity ^0.8.20;   // required OZ imports here -import "../../openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol"; -import "../../openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";   import "./wrapper/core/BaseModule.sol"; import "./wrapper/core/ERC20BurnModule.sol"; @@ -550,7 +548,7 @@

import "./wrapper/extensions/DebtModule.sol"; import "./wrapper/extensions/DocumentModule.sol"; import "./security/AuthorizationModule.sol"; -import "../interfaces/engine/IEngine.sol"; +import "../interfaces/ICMTATConstructor.sol"; import "../libraries/Errors.sol";   abstract contract CMTAT_BASE is @@ -569,58 +567,48 @@

ERC20SnapshotModule, DebtModule, DocumentModule -{ +{ +  + /*////////////////////////////////////////////////////////////// + INITIALIZER FUNCTION + //////////////////////////////////////////////////////////////*/ /** * @notice * initialize the proxy contract * The calls to this function will revert if the contract was deployed without a proxy * @param admin address of the admin of contract (Access Control) - * @param nameIrrevocable name of the token - * @param symbolIrrevocable name of the symbol - * @param decimalsIrrevocable number of decimals of the token, must be 0 to be compliant with Swiss law as per CMTAT specifications (non-zero decimal number may be needed for other use cases) - * @param tokenId_ name of the tokenId - * @param terms_ terms associated with the token - * @param information_ additional information to describe the token + * @param ERC20Attributes_ ERC20 name, symbol and decimals + * @param baseModuleAttributes_ tokenId, terms, information + * @param engines_ external contract */ function initialize( address admin, - string memory nameIrrevocable, - string memory symbolIrrevocable, - uint8 decimalsIrrevocable, - string memory tokenId_, - string memory terms_, - string memory information_, - IEngine.Engine memory engines + ICMTATConstructor.ERC20Attributes memory ERC20Attributes_, + ICMTATConstructor.BaseModuleAttributes memory baseModuleAttributes_, + ICMTATConstructor.Engine memory engines_ ) public virtual initializer { __CMTAT_init( admin, - nameIrrevocable, - symbolIrrevocable, - decimalsIrrevocable, - tokenId_, - terms_, - information_, - engines + ERC20Attributes_, + baseModuleAttributes_, + engines_ ); } +    /** * @dev calls the different initialize functions from the different modules */ function __CMTAT_init( address admin, - string memory nameIrrevocable, - string memory symbolIrrevocable, - uint8 decimalsIrrevocable, - string memory tokenId_, - string memory terms_, - string memory information_, - IEngine.Engine memory engines + ICMTATConstructor.ERC20Attributes memory ERC20Attributes_, + ICMTATConstructor.BaseModuleAttributes memory baseModuleAttributes_, + ICMTATConstructor.Engine memory engines_ ) internal EonlyInitializing { /* OpenZeppelin library */ // OZ init_unchained functions are called firstly due to inheritance __Context_init_unchained(); - __ERC20_init_unchained(nameIrrevocable, symbolIrrevocable); + __ERC20_init_unchained(ERC20Attributes_.nameIrrevocable, ERC20Attributes_.symbolIrrevocable); // AccessControlUpgradeable inherits from ERC165Upgradeable __ERC165_init_unchained(); // AuthorizationModule inherits from AccessControlUpgradeable @@ -636,16 +624,16 @@

__SnapshotModuleBase_init_unchained(); __ERC20Snapshot_init_unchained(); - __Validation_init_unchained(engines.ruleEngine); + __Validation_init_unchained(engines_ .ruleEngine);   /* Wrapper */ // AuthorizationModule_init_unchained is called firstly due to inheritance - __AuthorizationModule_init_unchained(admin, engines.authorizationEngine); + __AuthorizationModule_init_unchained(admin, engines_ .authorizationEngine); __ERC20BurnModule_init_unchained(); __ERC20MintModule_init_unchained(); // EnforcementModule_init_unchained is called before ValidationModule_init_unchained due to inheritance __EnforcementModule_init_unchained(); - __ERC20BaseModule_init_unchained(decimalsIrrevocable); + __ERC20BaseModule_init_unchained(ERC20Attributes_.decimalsIrrevocable); // PauseModule_init_unchained is called before ValidationModule_init_unchained due to inheritance __PauseModule_init_unchained(); __ValidationModule_init_unchained(); @@ -655,11 +643,11 @@

Add this call in case you add the SnapshotModule */ __ERC20SnasphotModule_init_unchained(); - __DocumentModule_init_unchained(engines.documentEngine); - __DebtModule_init_unchained(engines.debtEngine); + __DocumentModule_init_unchained(engines_ .documentEngine); + __DebtModule_init_unchained(engines_ .debtEngine);   /* Other modules */ - __Base_init_unchained(tokenId_, terms_, information_); + __Base_init_unchained(baseModuleAttributes_.tokenId, baseModuleAttributes_.terms, baseModuleAttributes_.information);   /* own function */ __CMTAT_init_unchained(); @@ -668,6 +656,11 @@

function __CMTAT_init_unchained() internal EonlyInitializing { // no variable to initialize } +  +  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/   /** * @notice Returns the number of decimals used to get its user representation. @@ -711,6 +704,9 @@

mint(to, amountToMint); }   + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @dev * @@ -731,8 +727,9 @@

ERC20SnapshotModuleInternal._snapshotUpdate(from, to); ERC20Upgradeable._update(from, to, amount); } -  - /************* MetaTx Module *************/ + /*////////////////////////////////////////////////////////////// + METAXTX MODULE + //////////////////////////////////////////////////////////////*/ /** * @dev This surcharge is not necessary if you do not use the MetaTxModule */ @@ -772,7 +769,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/index.html b/doc/general/test/coverage/lcov-report/contracts/modules/index.html index d122d295..62d133df 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/index.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/index.html @@ -77,7 +77,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/internal/ERC20SnapshotModuleInternal.sol.html b/doc/general/test/coverage/lcov-report/contracts/modules/internal/ERC20SnapshotModuleInternal.sol.html index bc712d86..e9ec8a55 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/internal/ERC20SnapshotModuleInternal.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/internal/ERC20SnapshotModuleInternal.sol.html @@ -22,7 +22,7 @@

100% Statements - 16/16 + 20/20
90% @@ -37,7 +37,7 @@

100% Lines - 24/24 + 28/28

@@ -180,10 +180,9 @@

135 136 137 -138  -  -  -  +138 +139 +140        @@ -254,6 +253,7 @@

    1200× +1200×       @@ -268,6 +268,7 @@

    720× +720×       @@ -283,8 +284,11 @@

      -420× -420× +  +  +  +421× +421×   77× 77× @@ -296,8 +300,8 @@

      -343× -343× +344× +344×       @@ -305,23 +309,23 @@

      -463× +464× +464×             -377× -  -  +378× +378×      
//SPDX-License-Identifier: MPL-2.0
  
 pragma solidity ^0.8.20;
  
-import "../../../openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol";
+import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
 import {Arrays} from '@openzeppelin/contracts/utils/Arrays.sol';
 import "./base/SnapshotModuleBase.sol";
 import "../../interfaces/ICMTATSnapshot.sol";
@@ -336,19 +340,16 @@ 

  abstract contract ERC20SnapshotModuleInternal is ICMTATSnapshot, SnapshotModuleBase, ERC20Upgradeable { using Arrays for uint256[]; -  - /** - * @dev - * list of scheduled snapshot (time) - * This list is sorted in ascending order - */ - uint256[] private _scheduledSnapshots; -  + /* ============ Initializer Function ============ */ function __ERC20Snapshot_init_unchained() internal EonlyInitializing { // Nothing to do // _currentSnapshotTime & _currentSnapshotIndex are initialized to zero }   +  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @notice Return snapshotBalanceOf and snapshotTotalSupply to avoid multiple calls * @return ownerBalance , totalSupply - see snapshotBalanceOf and snapshotTotalSupply @@ -390,9 +391,10 @@

uint256 time, address owner ) public view returns (uint256) { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); (bool snapshotted, uint256 value) = _valueAt( time, - _accountBalanceSnapshots[owner] + $._accountBalanceSnapshots[owner] );   return snapshotted ? value : balanceOf(owner); @@ -404,13 +406,17 @@

* @return value stored in the snapshot, or the actual totalSupply if no snapshot */ function snapshotTotalSupply(uint256 time) public view returns (uint256) { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); (bool snapshotted, uint256 value) = _valueAt( time, - _totalSupplySnapshots + $._totalSupplySnapshots ); return snapshotted ? value : totalSupply(); }   + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/   /** * @dev Update balance and/or total supply snapshots before the values are modified. This is implemented @@ -442,17 +448,17 @@

* @dev See {OpenZeppelin - ERC20Snapshot} */ function _updateAccountSnapshot(address account) private { - _updateSnapshot(_accountBalanceSnapshots[account], balanceOf(account)); + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); + _updateSnapshot($._accountBalanceSnapshots[account], balanceOf(account)); }   /** * @dev See {OpenZeppelin - ERC20Snapshot} */ function _updateTotalSupplySnapshot() private { - _updateSnapshot(_totalSupplySnapshots, totalSupply()); + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); + _updateSnapshot($._totalSupplySnapshots, totalSupply()); } -  - uint256[50] private __gap; }  

@@ -460,7 +466,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/internal/EnforcementModuleInternal.sol.html b/doc/general/test/coverage/lcov-report/contracts/modules/internal/EnforcementModuleInternal.sol.html index 0051a21e..8ed2e7e5 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/internal/EnforcementModuleInternal.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/internal/EnforcementModuleInternal.sol.html @@ -145,7 +145,22 @@

100 101 102 -103  +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118        @@ -199,8 +214,22 @@

      -942× -942× +  +  +  +  +  +  +  +  +  +  +944× +944× +  +  +  +        @@ -242,7 +271,8 @@

      -972× +  +974×       @@ -251,9 +281,9 @@

  pragma solidity ^0.8.20;   -import "../../../openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol"; -import "../../../openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol"; -import "../../../openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";   /** * @dev Enforcement module. @@ -264,9 +294,7 @@

Initializable, ContextUpgradeable { - // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.EnforcementModuleInternal")) - 1)) & ~bytes32(uint256(0xff)) - bytes32 private constant EnforcementModuleInternalStorageLocation = 0x0c7bc8a17be064111d299d7669f49519cb26c58611b72d9f6ccc40a1e1184e00; - + /* ============ Events ============ */ /** * @notice Emitted when an address is frozen. */ @@ -287,15 +315,27 @@

string reason );   - /* Variables */ + /* ============ ERC-7201 ============ */ + // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.EnforcementModuleInternal")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant EnforcementModuleInternalStorageLocation = 0x0c7bc8a17be064111d299d7669f49519cb26c58611b72d9f6ccc40a1e1184e00; + +  + /* ==== ERC-7201 State Variables === */ struct EnforcementModuleInternalStorage { mapping(address => bool) _frozen; }     + /*////////////////////////////////////////////////////////////// + INITIALIZER FUNCTION + //////////////////////////////////////////////////////////////*/ function __Enforcement_init_unchained() internal EonlyInitializing { // no variable to initialize } +  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/   /** * @dev Returns true if the account is frozen, and false otherwise. @@ -304,6 +344,10 @@

EnforcementModuleInternalStorage storage $ = _getEnforcementModuleInternalStorage(); return $._frozen[account]; } +  + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/   /** * @dev Freezes an address. @@ -343,6 +387,7 @@

return true; }   + /* ============ ERC-7201 ============ */ function _getEnforcementModuleInternalStorage() private pure returns (EnforcementModuleInternalStorage storage $) { assembly { $.slot := EnforcementModuleInternalStorageLocation @@ -355,7 +400,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/internal/ValidationModuleInternal.sol.html b/doc/general/test/coverage/lcov-report/contracts/modules/internal/ValidationModuleInternal.sol.html index 34e55910..313ade69 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/internal/ValidationModuleInternal.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/internal/ValidationModuleInternal.sol.html @@ -132,7 +132,19 @@

87 88 89 -90  +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102        @@ -162,6 +174,21 @@

      +  +  +381× +18× +18× +18× +  +  +  +  +  +  +  +  +  32× 32×   @@ -169,11 +196,6 @@

      -377× -18× -18× -18× -        @@ -216,7 +238,9 @@

      -627× +  +  +628×       @@ -225,8 +249,8 @@

  pragma solidity ^0.8.20;   -import "../../../openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol"; -import "../../../openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol"; +import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "../../interfaces/engine/IRuleEngine.sol"; /** * @dev Validation module. @@ -237,24 +261,19 @@

Initializable, ContextUpgradeable { - // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.ValidationModuleInternal")) - 1)) & ~bytes32(uint256(0xff)) - bytes32 private constant ValidationModuleInternalStorageLocation = 0xb3e8f29e401cfa802cad91001b5f9eb50decccdb111d80cb07177ab650b04700; - /* Variables */ - struct ValidationModuleInternalStorage { - IRuleEngine _ruleEngine; - } - /* - + /* ============ Events ============ */ /** * @dev Emitted when a rule engine is set. */ event RuleEngine(IRuleEngine indexed newRuleEngine); -  - function ruleEngine() public view returns(IRuleEngine){ - ValidationModuleInternalStorage storage $ = _getValidationModuleInternalStorage(); - return $._ruleEngine; + /* ============ ERC-7201 ============ */ + // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.ValidationModuleInternal")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant ValidationModuleInternalStorageLocation = 0xb3e8f29e401cfa802cad91001b5f9eb50decccdb111d80cb07177ab650b04700; + /* ==== ERC-7201 State Variables === */ + struct ValidationModuleInternalStorage { + IRuleEngine _ruleEngine; } -  + /* ============ Initializer Function ============ */ function __Validation_init_unchained( IRuleEngine ruleEngine_ ) internal EonlyInitializing { @@ -264,6 +283,21 @@

emit RuleEngine(ruleEngine_); } } +  +  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ + + function ruleEngine() public view returns(IRuleEngine){ + ValidationModuleInternalStorage storage $ = _getValidationModuleInternalStorage(); + return $._ruleEngine; + } +  +  + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/   /** * @dev before making a call to this function, you have to check if a ruleEngine is set. @@ -304,6 +338,8 @@

return $._ruleEngine.operateOnTransfer(from, to, amount); }   +  + /* ============ ERC-7201 ============ */ function _getValidationModuleInternalStorage() internal pure returns (ValidationModuleInternalStorage storage $) { assembly { $.slot := ValidationModuleInternalStorageLocation @@ -316,7 +352,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/internal/base/SnapshotModuleBase.sol.html b/doc/general/test/coverage/lcov-report/contracts/modules/internal/base/SnapshotModuleBase.sol.html index bce34257..27216dd9 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/internal/base/SnapshotModuleBase.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/internal/base/SnapshotModuleBase.sol.html @@ -22,22 +22,22 @@

100% Statements - 76/76 + 88/88
- 96.67% + 96.55% Branches - 58/60 + 56/58
100% Functions - 16/16 + 18/18
100% Lines - 100/100 + 112/112
@@ -441,7 +441,41 @@

396 397 398 -399  +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433        @@ -515,6 +549,15 @@

      +  +  +  +  +  +  +  +  +     @@ -524,6 +567,7 @@

    76× +76×   76× 68× @@ -560,6 +604,10 @@

      +  +  +170× +  170×   168× @@ -582,24 +630,11 @@

      -202× - -  -  -  -  -  -  -46× - -  -  -  -        12× +12× 10×   10× @@ -627,6 +662,7 @@

      +22×   22× 20× @@ -634,9 +670,6 @@

  16× -16× - -  12× @@ -666,8 +699,9 @@

      +14×   -12× +14× 10×   @@ -686,11 +720,10 @@

      -12× 10× 10× -   +10×   16× @@ -742,8 +775,9 @@

      -840× -840× +842× +842× +842× 36× 36×   @@ -755,11 +789,12 @@

      -420× +421× +421×       -420× +421× 18× 18×   @@ -771,8 +806,8 @@

      -840× -832× +842× +834×     @@ -787,6 +822,7 @@

  36× 36× +36×   36×   @@ -813,13 +849,14 @@

      -488× +489× +489×   -488× +489×       -402× +403×     86× @@ -839,11 +876,42 @@

      +  +  +  +  +26× +26× + +  +20× +  +  +202× + +  +  +  +  +  +  +46× + +  +  +  +  +  +4856× +  +  +  +   
//SPDX-License-Identifier: MPL-2.0
  
 pragma solidity ^0.8.20;
  
-import "../../../../openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol";
+import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
 import {Arrays} from '@openzeppelin/contracts/utils/Arrays.sol';
  
 import "../../../libraries/Errors.sol";
@@ -859,17 +927,7 @@ 

  abstract contract SnapshotModuleBase is Initializable { using Arrays for uint256[]; -  - /** - @notice Emitted when the snapshot with the specified oldTime was scheduled or rescheduled at the specified newTime. - */ - event SnapshotSchedule(uint256 indexed oldTime, uint256 indexed newTime); -  - /** - * @notice Emitted when the scheduled snapshot with the specified time was cancelled. - */ - event SnapshotUnschedule(uint256 indexed time); -  + /* ============ Structs ============ * /** * @dev See {OpenZeppelin - ERC20Snapshot} * Snapshotted values have arrays of ids (time) and the value corresponding to that id. @@ -880,68 +938,88 @@

uint256[] ids; uint256[] values; } -  - /** - * @dev See {OpenZeppelin - ERC20Snapshot} - */ - mapping(address => Snapshots) internal _accountBalanceSnapshots; - Snapshots internal _totalSupplySnapshots; -  + /* ============ Events ============ */ /** - * @dev time instead of a counter for OpenZeppelin + @notice Emitted when the snapshot with the specified oldTime was scheduled or rescheduled at the specified newTime. */ - // Initialized to zero - uint256 private _currentSnapshotTime; - // Initialized to zero - uint256 private _currentSnapshotIndex; + event SnapshotSchedule(uint256 indexed oldTime, uint256 indexed newTime);   /** - * @dev - * list of scheduled snapshot (time) - * This list is sorted in ascending order + * @notice Emitted when the scheduled snapshot with the specified time was cancelled. */ - uint256[] private _scheduledSnapshots; + event SnapshotUnschedule(uint256 indexed time);   + /* ============ ERC-7201 ============ */ + // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.SnapshotModuleBase")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant SnapshotModuleBaseStorageLocation = 0x649d9af4a0486294740af60c5e3bf61210e7b49108a80b1f369042ea9fd02000; + /* ==== ERC-7201 State Variables === */ + struct SnapshotModuleBaseStorage { + /** + * @dev See {OpenZeppelin - ERC20Snapshot} + */ + mapping(address => Snapshots) _accountBalanceSnapshots; + Snapshots _totalSupplySnapshots; + /** + * @dev time instead of a counter for OpenZeppelin + */ + // Initialized to zero + uint256 _currentSnapshotTime; + // Initialized to zero + uint256 _currentSnapshotIndex; + /** + * @dev + * list of scheduled snapshot (time) + * This list is sorted in ascending order + */ + uint256[] _scheduledSnapshots; + } + /*////////////////////////////////////////////////////////////// + INITIALIZER FUNCTION + //////////////////////////////////////////////////////////////*/ function __SnapshotModuleBase_init_unchained() internal EonlyInitializing { // Nothing to do // _currentSnapshotTime & _currentSnapshotIndex are initialized to zero }   -  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * * @notice Get all snapshots */ function getAllSnapshots() public view returns (uint256[] memory) { - return _scheduledSnapshots; + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); + return $._scheduledSnapshots; }   - /** + /** * @dev * Get the next scheduled snapshots */ function getNextSnapshots() public view returns (uint256[] memory) { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); uint256[] memory nextScheduledSnapshot = new uint256[](0); // no snapshot were planned - if (_scheduledSnapshots.length > 0) { + if ($._scheduledSnapshots.length > 0) { ( uint256 timeLowerBound, uint256 indexLowerBound ) = _findScheduledMostRecentPastSnapshot(); // All snapshots are situated in the futur - if ((timeLowerBound == 0) && (_currentSnapshotTime == 0)) { - return _scheduledSnapshots; + if ((timeLowerBound == 0) && ($._currentSnapshotTime == 0)) { + return $._scheduledSnapshots; } else { // There are snapshots situated in the futur - if (indexLowerBound + 1 != _scheduledSnapshots.length) { + if (indexLowerBound + 1 != $._scheduledSnapshots.length) { // All next snapshots are located after the snapshot specified by indexLowerBound - uint256 arraySize = _scheduledSnapshots.length - + uint256 arraySize = $._scheduledSnapshots.length - indexLowerBound - 1; nextScheduledSnapshot = new uint256[](arraySize); // No need of unchecked block since Soliditiy 0.8.22 for (uint256 i; i < arraySize; ++i) { - nextScheduledSnapshot[i] = _scheduledSnapshots[ + nextScheduledSnapshot[i] = $._scheduledSnapshots[ indexLowerBound + 1 + i ]; } @@ -951,19 +1029,23 @@

return nextScheduledSnapshot; }   + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/   /** * @dev schedule a snapshot at the specified time * You can only add a snapshot after the last previous */ function _scheduleSnapshot(uint256 time) internal { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); // Check the time firstly to avoid an useless read of storage _checkTimeInThePast(time);   - if (_scheduledSnapshots.length > 0) { + if ($._scheduledSnapshots.length > 0) { // We check the last snapshot on the list - uint256 nextSnapshotTime = _scheduledSnapshots[ - _scheduledSnapshots.length - 1 + uint256 nextSnapshotTime = $._scheduledSnapshots[ + $._scheduledSnapshots.length - 1 ]; if (time < nextSnapshotTime) { revert Errors @@ -975,28 +1057,15 @@

revert Errors.CMTAT_SnapshotModule_SnapshotAlreadyExists(); } } - _scheduledSnapshots.push(time); + $._scheduledSnapshots.push(time); emit SnapshotSchedule(0, time); } -  - function _checkTimeInThePast(uint256 time) internal view{ - if (time <= block.timestamp) { - revert Errors.CMTAT_SnapshotModule_SnapshotScheduledInThePast( - time, - block.timestamp - ); - } - } - function _checkTimeSnapshotAlreadyDone(uint256 time) internal view{ - if (time <= block.timestamp) { - revert Errors.CMTAT_SnapshotModule_SnapshotAlreadyDone(); - } - }   /** * @dev schedule a snapshot at the specified time */ function _scheduleSnapshotNotOptimized(uint256 time) internal { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); _checkTimeInThePast(time); (bool isFound, uint256 index) = _findScheduledSnapshotIndex(time); // Perfect match @@ -1004,19 +1073,19 @@

revert Errors.CMTAT_SnapshotModule_SnapshotAlreadyExists(); } // if no upper bound match found, we push the snapshot at the end of the list - if (index == _scheduledSnapshots.length) { - _scheduledSnapshots.push(time); + if (index == $._scheduledSnapshots.length) { + $._scheduledSnapshots.push(time); } else { - _scheduledSnapshots.push( - _scheduledSnapshots[_scheduledSnapshots.length - 1] + $._scheduledSnapshots.push( + $._scheduledSnapshots[$._scheduledSnapshots.length - 1] ); - for (uint256 i = _scheduledSnapshots.length - 2; i > index; ) { - _scheduledSnapshots[i] = _scheduledSnapshots[i - 1]; + for (uint256 i = $._scheduledSnapshots.length - 2; i > index; ) { + $._scheduledSnapshots[i] = $._scheduledSnapshots[i - 1]; unchecked { --i; } } - _scheduledSnapshots[index] = time; + $._scheduledSnapshots[index] = time; } emit SnapshotSchedule(0, time); } @@ -1025,18 +1094,16 @@

* @dev reschedule a scheduled snapshot at the specified newTime */ function _rescheduleSnapshot(uint256 oldTime, uint256 newTime) internal { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); // Check the time firstly to avoid an useless read of storage _checkTimeSnapshotAlreadyDone(oldTime); _checkTimeInThePast(newTime); - if (_scheduledSnapshots.length == 0) { + if ($._scheduledSnapshots.length == 0) { revert Errors.CMTAT_SnapshotModule_NoSnapshotScheduled(); } - (bool foundOld, uint256 index) = _findScheduledSnapshotIndex(oldTime); - if (!foundOld) { - revert Errors.CMTAT_SnapshotModule_SnapshotNotFound(); - } - if (index + 1 < _scheduledSnapshots.length) { - uint256 nextSnapshotTime = _scheduledSnapshots[index + 1]; + uint256 index = _findAndRevertScheduledSnapshotIndex(oldTime); + if (index + 1 < $._scheduledSnapshots.length) { + uint256 nextSnapshotTime = $._scheduledSnapshots[index + 1]; if (newTime > nextSnapshotTime) { revert Errors .CMTAT_SnapshotModule_SnapshotTimestampAfterNextSnapshot( @@ -1048,14 +1115,14 @@

} } if (index > 0) { - if (newTime <= _scheduledSnapshots[index - 1]) + if (newTime <= $._scheduledSnapshots[index - 1]) revert Errors .CMTAT_SnapshotModule_SnapshotTimestampBeforePreviousSnapshot( newTime, - _scheduledSnapshots[index - 1] + $._scheduledSnapshots[index - 1] ); } - _scheduledSnapshots[index] = newTime; + $._scheduledSnapshots[index] = newTime;   emit SnapshotSchedule(oldTime, newTime); } @@ -1064,16 +1131,17 @@

* @dev unschedule the last scheduled snapshot */ function _unscheduleLastSnapshot(uint256 time) internal { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); // Check the time firstly to avoid an useless read of storage _checkTimeSnapshotAlreadyDone(time); - if (_scheduledSnapshots.length == 0) { + if ($._scheduledSnapshots.length == 0) { revert Errors.CMTAT_SnapshotModule_NoSnapshotScheduled(); } // All snapshot time are unique, so we do not check the indice - if (time != _scheduledSnapshots[_scheduledSnapshots.length - 1]) { + if (time !=$._scheduledSnapshots[$._scheduledSnapshots.length - 1]) { revert Errors.CMTAT_SnapshotModule_SnapshotNotFound(); } - _scheduledSnapshots.pop(); + $._scheduledSnapshots.pop(); emit SnapshotUnschedule(time); }   @@ -1084,16 +1152,15 @@

* - Reduce the array size by deleting the last snapshot */ function _unscheduleSnapshotNotOptimized(uint256 time) internal { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); _checkTimeSnapshotAlreadyDone(time); - (bool isFound, uint256 index) = _findScheduledSnapshotIndex(time); - if (!isFound) { - revert Errors.CMTAT_SnapshotModule_SnapshotNotFound(); - } + + uint256 index = _findAndRevertScheduledSnapshotIndex(time); // No need of unchecked block since Soliditiy 0.8.22 - for (uint256 i = index; i + 1 < _scheduledSnapshots.length; ++i ) { - _scheduledSnapshots[i] = _scheduledSnapshots[i + 1]; + for (uint256 i = index; i + 1 < $._scheduledSnapshots.length; ++i ) { + $._scheduledSnapshots[i] = $._scheduledSnapshots[i + 1]; } - _scheduledSnapshots.pop(); + $._scheduledSnapshots.pop(); }   /** @@ -1140,7 +1207,8 @@

Snapshots storage snapshots, uint256 currentValue ) internal { - uint256 current = _currentSnapshotTime; + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); + uint256 current = $._currentSnapshotTime; if (_lastSnapshot(snapshots.ids) < current) { snapshots.ids.push(current); snapshots.values.push(currentValue); @@ -1153,13 +1221,14 @@

* if a snapshot exists, clear all past scheduled snapshot */ function _setCurrentSnapshot() internal { + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); ( uint256 scheduleSnapshotTime, uint256 scheduleSnapshotIndex ) = _findScheduledMostRecentPastSnapshot(); if (scheduleSnapshotTime > 0) { - _currentSnapshotTime = scheduleSnapshotTime; - _currentSnapshotIndex = scheduleSnapshotIndex; + $._currentSnapshotTime = scheduleSnapshotTime; + $._currentSnapshotIndex = scheduleSnapshotIndex; } }   @@ -1183,12 +1252,13 @@

function _findScheduledSnapshotIndex( uint256 time ) private view returns (bool, uint256) { - uint256 indexFound = _scheduledSnapshots.findUpperBound(time); - uint256 _scheduledSnapshotsLength = _scheduledSnapshots.length; + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); + uint256 indexFound = $._scheduledSnapshots.findUpperBound(time); + uint256 _scheduledSnapshotsLength = $._scheduledSnapshots.length; // Exact match if ( indexFound != _scheduledSnapshotsLength && - _scheduledSnapshots[indexFound] == time + $._scheduledSnapshots[indexFound] == time ) { return (true, indexFound); } @@ -1211,11 +1281,12 @@

view returns (uint256 time, uint256 index) { - uint256 currentArraySize = _scheduledSnapshots.length; + SnapshotModuleBaseStorage storage $ = _getSnapshotModuleBaseStorage(); + uint256 currentArraySize = $._scheduledSnapshots.length; // no snapshot or the current snapshot already points on the last snapshot if ( currentArraySize == 0 || - ((_currentSnapshotIndex + 1 == currentArraySize) && (time != 0)) + (($._currentSnapshotIndex + 1 == currentArraySize) && (time != 0)) ) { return (0, currentArraySize); } @@ -1223,9 +1294,9 @@

uint256 mostRecent; index = currentArraySize; // No need of unchecked block since Soliditiy 0.8.22 - for (uint256 i = _currentSnapshotIndex; i < currentArraySize; ++i ) { - if (_scheduledSnapshots[i] <= block.timestamp) { - mostRecent = _scheduledSnapshots[i]; + for (uint256 i = $._currentSnapshotIndex; i < currentArraySize; ++i ) { + if ($._scheduledSnapshots[i] <= block.timestamp) { + mostRecent = $._scheduledSnapshots[i]; index = i; } else { // All snapshot are planned in the futur @@ -1235,7 +1306,38 @@

return (mostRecent, index); }   - uint256[50] private __gap; + /* ============ Utility functions ============ */ +  +  + function _findAndRevertScheduledSnapshotIndex( + uint256 time + ) private view returns (uint256){ + (bool isFound, uint256 index) = _findScheduledSnapshotIndex(time); + if (!isFound) { + revert Errors.CMTAT_SnapshotModule_SnapshotNotFound(); + } + return index; + } + function _checkTimeInThePast(uint256 time) internal view{ + if (time <= block.timestamp) { + revert Errors.CMTAT_SnapshotModule_SnapshotScheduledInThePast( + time, + block.timestamp + ); + } + } + function _checkTimeSnapshotAlreadyDone(uint256 time) internal view{ + if (time <= block.timestamp) { + revert Errors.CMTAT_SnapshotModule_SnapshotAlreadyDone(); + } + } +  + /* ============ ERC-7201 ============ */ + function _getSnapshotModuleBaseStorage() internal pure returns (SnapshotModuleBaseStorage storage $) { + assembly { + $.slot := SnapshotModuleBaseStorageLocation + } + } }  

@@ -1243,7 +1345,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/internal/base/index.html b/doc/general/test/coverage/lcov-report/contracts/modules/internal/base/index.html index c6e17589..2b828b8e 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/internal/base/index.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/internal/base/index.html @@ -22,22 +22,22 @@

100% Statements - 76/76 + 88/88
- 96.67% + 96.55% Branches - 58/60 + 56/58
100% Functions - 16/16 + 18/18
100% Lines - 100/100 + 112/112
@@ -62,13 +62,13 @@

SnapshotModuleBase.sol
100% - 76/76 - 96.67% - 58/60 + 88/88 + 96.55% + 56/58 100% - 16/16 + 18/18 100% - 100/100 + 112/112 @@ -77,7 +77,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/internal/index.html b/doc/general/test/coverage/lcov-report/contracts/modules/internal/index.html index b91dca9e..9f473b7d 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/internal/index.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/internal/index.html @@ -22,7 +22,7 @@

100% Statements - 41/41 + 45/45
85% @@ -37,7 +37,7 @@

100% Lines - 54/54 + 58/58

@@ -62,13 +62,13 @@

ERC20SnapshotModuleInternal.sol
100% - 16/16 + 20/20 90% 9/10 100% 9/9 100% - 24/24 + 28/28 @@ -103,7 +103,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/security/AuthorizationModule.sol.html b/doc/general/test/coverage/lcov-report/contracts/modules/security/AuthorizationModule.sol.html index 63eebbda..7d849acf 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/security/AuthorizationModule.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/security/AuthorizationModule.sol.html @@ -147,7 +147,22 @@

102 103 104 -105  +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120        @@ -175,11 +190,14 @@

      -377× +  +  +  +381×   -375× -375× +379× +379× 16× 16× 16× @@ -187,6 +205,11 @@

      +  +  +  +  +    @@ -239,10 +262,17 @@

      -1275× -758× +1280× +759× +  +521× +  +  +  +  +  +    -517×       @@ -255,21 +285,24 @@

  pragma solidity ^0.8.20;   -import "../../../openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "../../libraries/Errors.sol"; import "../../interfaces/engine/IAuthorizationEngine.sol";   abstract contract AuthorizationModule is AccessControlUpgradeable { + /* ============ Events ============ */ + /** + * @dev Emitted when a rule engine is set. + */ + event AuthorizationEngine(IAuthorizationEngine indexed newAuthorizationEngine); + /* ============ ERC-7201 ============ */ // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.AuthorizationModule")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant AuthorizationModuleStorageLocation = 0x59b7f077fa4ad020f9053fd2197fef0113b19f0b11dcfe516e88cbc0e9226d00; - /* Variables */ + /* ==== ERC-7201 State Variables === */ struct AuthorizationModuleStorage { IAuthorizationEngine _authorizationEngine; } - /** - * @dev Emitted when a rule engine is set. - */ - event AuthorizationEngine(IAuthorizationEngine indexed newAuthorizationEngine); + /* ============ Initializer Function ============ */ /** * @dev * @@ -289,6 +322,11 @@

emit AuthorizationEngine(authorizationEngine_); } } +  +  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/   function authorizationEngine() public view virtual returns (IAuthorizationEngine) { AuthorizationModuleStorage storage $ = _getAuthorizationModuleStorage(); @@ -349,6 +387,13 @@

return AccessControlUpgradeable.hasRole(role, account); }   +  + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ +  +  + /* ============ ERC-7201 ============ */ function _getAuthorizationModuleStorage() private pure returns (AuthorizationModuleStorage storage $) { assembly { $.slot := AuthorizationModuleStorageLocation @@ -361,7 +406,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/security/index.html b/doc/general/test/coverage/lcov-report/contracts/modules/security/index.html index 0747fc04..83fe875c 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/security/index.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/security/index.html @@ -77,7 +77,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/controllers/ValidationModule.sol.html b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/controllers/ValidationModule.sol.html index 2a461400..56eaa88f 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/controllers/ValidationModule.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/controllers/ValidationModule.sol.html @@ -183,7 +183,25 @@

138 139 140 -141  +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152  +  +  +  +  +  +  +        @@ -306,21 +324,25 @@

      -456× +  +  +  +  +457× 18×   -438× +439×       -437× +438× 14×   -423× -423× +424× +424× 60×   -363× +364×      
//SPDX-License-Identifier: MPL-2.0
@@ -345,12 +367,19 @@ 

EnforcementModule, IERC1404Wrapper { + /* ============ State Variables ============ */ string constant TEXT_TRANSFER_OK = "No restriction"; string constant TEXT_UNKNOWN_CODE = "Unknown code";   + /* ============ Initializer Function ============ */ function __ValidationModule_init_unchained() internal EonlyInitializing { // no variable to initialize } +  +  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/   /* * @notice set a RuleEngine @@ -441,6 +470,10 @@

return true; }   +  + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ function _validateTransferByModule( address from, address to, @@ -469,7 +502,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/controllers/index.html b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/controllers/index.html index e16131f1..3b3d4fcc 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/controllers/index.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/controllers/index.html @@ -77,7 +77,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/BaseModule.sol.html b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/BaseModule.sol.html index 012a34d3..fb309d22 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/BaseModule.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/BaseModule.sol.html @@ -152,7 +152,13 @@

107 108 109 -110  +110 +111 +112 +113 +114 +115 +116        @@ -197,11 +203,12 @@

      +379× +379× +379× +379× +    -375× -375× -375× -375×       @@ -255,7 +262,12 @@

      -409× +  +  +  +  +  +413×       @@ -269,22 +281,14 @@

import "../../security/AuthorizationModule.sol"; import "../../../libraries/Errors.sol"; abstract contract BaseModule is AuthorizationModule { - // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.BaseModule")) - 1)) & ~bytes32(uint256(0xff)) - bytes32 private constant BaseModuleStorageLocation = 0xa98e72f7f70574363edb12c42a03ac1feb8cc898a6e0a30f6eefbab7093e0d00; -  - /* Variables */ - struct BaseModuleStorage { - string _tokenId; - string _terms; - string _information; - } + /* ============ State Variables ============ */ /** * @notice * Get the current version of the smart contract */ - string public constant VERSION = "2.4.1"; + string public constant VERSION = "2.5.0"; - /* Events */ + /* ============ Events ============ */ event Term(string indexed newTermIndexed, string newTerm); event TokenId(string indexed newTokenIdIndexed, string newTokenId); event Information( @@ -292,10 +296,17 @@

string newInformation ); event Flag(uint256 indexed newFlag); + /* ============ ERC-7201 ============ */ + // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.BaseModule")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant BaseModuleStorageLocation = 0xa98e72f7f70574363edb12c42a03ac1feb8cc898a6e0a30f6eefbab7093e0d00;   -  -  - /* Initializers */ + /* ==== ERC-7201 State Variables === */ + struct BaseModuleStorage { + string _tokenId; + string _terms; + string _information; + } + /* ============ Initializer Function ============ */ /** * @dev Sets the values for {name} and {symbol}. * @@ -313,7 +324,9 @@

$._information = information_; }   - /* Methods */ + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/   function tokenId() public view virtual returns (string memory) { BaseModuleStorage storage $ = _getBaseModuleStorage(); @@ -363,6 +376,11 @@

}     + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ +  + /* ============ ERC-7201 ============ */ function _getBaseModuleStorage() private pure returns (BaseModuleStorage storage $) { assembly { $.slot := BaseModuleStorageLocation @@ -376,7 +394,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/ERC20BaseModule.sol.html b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/ERC20BaseModule.sol.html index e295ae7c..3c458492 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/ERC20BaseModule.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/ERC20BaseModule.sol.html @@ -167,7 +167,14 @@

122 123 124 -125  +125 +126 +127 +128 +129 +130 +131 +132        @@ -200,9 +207,9 @@

      +379× +379×   -375× -375×       @@ -286,7 +293,14 @@

      -377× +  +  +  +  +  +  +  +381×       @@ -296,28 +310,27 @@

pragma solidity ^0.8.20;   // required OZ imports here -import "../../../../openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "../../../libraries/Errors.sol";   abstract contract ERC20BaseModule is ERC20Upgradeable { - // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.ERC20BaseModule")) - 1)) & ~bytes32(uint256(0xff)) - bytes32 private constant ERC20BaseModuleStorageLocation = 0x9bd8d607565c0370ae5f91651ca67fd26d4438022bf72037316600e29e6a3a00; - - struct ERC20BaseModuleStorage { - uint8 _decimals; - } -  - /* Events */ + /* ============ Events ============ */ /** * @notice Emitted when the specified `spender` spends the specified `value` tokens owned by the specified `owner` reducing the corresponding allowance. * @dev The allowance can be also "spend" with the function BurnFrom, but in this case, the emitted event is BurnFrom. */ event Spend(address indexed owner, address indexed spender, uint256 value); + /* ============ ERC-7201 ============ */ + // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.ERC20BaseModule")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant ERC20BaseModuleStorageLocation = 0x9bd8d607565c0370ae5f91651ca67fd26d4438022bf72037316600e29e6a3a00; + /* ==== ERC-7201 State Variables === */ + struct ERC20BaseModuleStorage { + uint8 _decimals; + }   - /* Initializers */ -  + /* ============ Initializer Function ============ */ /** - * @dev Sets the values for decimals. + * @dev Initializers: Sets the values for decimals. * * this value is immutable: it can only be set once during * construction/initialization. @@ -328,8 +341,9 @@

ERC20BaseModuleStorage storage $ = _getERC20BaseModuleStorage(); $._decimals = decimals_; } -  - /* Methods */ + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * * @notice Returns the number of decimals used to get its user representation. @@ -409,6 +423,13 @@

totalSupply = ERC20Upgradeable.totalSupply(); }   +  + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ +  +  + /* ============ ERC-7201 ============ */ function _getERC20BaseModuleStorage() private pure returns (ERC20BaseModuleStorage storage $) { assembly { $.slot := ERC20BaseModuleStorageLocation @@ -421,7 +442,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/ERC20BurnModule.sol.html b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/ERC20BurnModule.sol.html index 3659b140..525d94ca 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/ERC20BurnModule.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/ERC20BurnModule.sol.html @@ -155,7 +155,27 @@

110 111 112 -113  +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123  +  +  +  +  +  +  +  +  +  +        @@ -271,12 +291,15 @@

  pragma solidity ^0.8.20;   -import "../../../../openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "../../security/AuthorizationModule.sol"; import "../../../interfaces/ICCIPToken.sol"; abstract contract ERC20BurnModule is ERC20Upgradeable, ICCIPBurnFromERC20, AuthorizationModule { + /* ============ State Variables ============ */ bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE"); bytes32 public constant BURNER_FROM_ROLE = keccak256("BURNER_FROM_ROLE"); + + /* ============ Events ============ */ /** * @notice Emitted when the specified `value` amount of tokens owned by `owner`are destroyed with the given `reason` */ @@ -285,9 +308,16 @@

* @notice Emitted when the specified `spender` burns the specified `value` tokens owned by the specified `owner` reducing the corresponding allowance. */ event BurnFrom(address indexed owner, address indexed spender, uint256 value); +  +  + /* ============ Initializer Function ============ */ function __ERC20BurnModule_init_unchained() internal EonlyInitializing { // no variable to initialize } +  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/   /** * @notice Destroys a `value` amount of tokens from `account`, by transferring it to address(0). @@ -385,7 +415,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/ERC20MintModule.sol.html b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/ERC20MintModule.sol.html index 2b289f4b..0af0174d 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/ERC20MintModule.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/ERC20MintModule.sol.html @@ -115,7 +115,13 @@

70 71 72 -73  +73 +74 +75 +76 +77 +78 +79        @@ -149,8 +155,14 @@

      -289× -289× +  +  +  +  +  +  +290× +290×       @@ -191,22 +203,28 @@

  pragma solidity ^0.8.20;   -import "../../../../openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "../../security/AuthorizationModule.sol"; import "../../../interfaces/ICCIPToken.sol"; abstract contract ERC20MintModule is ERC20Upgradeable, ICCIPMintERC20, AuthorizationModule { - // MintModule + /* ============ State Variables ============ */ bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); + /* ============ Events ============ */ /** * @notice Emitted when the specified `value` amount of new tokens are created and * allocated to the specified `account`. */ event Mint(address indexed account, uint256 value);   +  + /* ============ Initializer Function ============ */ function __ERC20MintModule_init_unchained() internal EonlyInitializing { // no variable to initialize }   + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @notice Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0) * @param account token receiver @@ -265,7 +283,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/EnforcementModule.sol.html b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/EnforcementModule.sol.html index a835965a..b1722a25 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/EnforcementModule.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/EnforcementModule.sol.html @@ -97,7 +97,15 @@

52 53 54 -55  +55 +56 +57 +58 +59  +  +  +  +        @@ -167,7 +175,7 @@

EnforcementModuleInternal, AuthorizationModule { - // EnforcementModule + /* ============ State Variables ============ */ bytes32 public constant ENFORCER_ROLE = keccak256("ENFORCER_ROLE"); string internal constant TEXT_TRANSFER_REJECTED_FROM_FROZEN = "Address FROM is frozen"; @@ -175,10 +183,14 @@

string internal constant TEXT_TRANSFER_REJECTED_TO_FROZEN = "Address TO is frozen";   + /* ============ Initializer Function ============ */ function __EnforcementModule_init_unchained() internal EonlyInitializing { // no variable to initialize }   + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @notice Freezes an address. * @param account the account to freeze @@ -211,7 +223,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/PauseModule.sol.html b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/PauseModule.sol.html index 54925f87..9cccc67c 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/PauseModule.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/PauseModule.sol.html @@ -139,7 +139,19 @@

94 95 96 -97  +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109        @@ -164,7 +176,6 @@

      -12×       @@ -235,11 +246,24 @@

    +  +  +  +  +  +  +  +  +12× +  +  +  +   
//SPDX-License-Identifier: MPL-2.0
  
 pragma solidity ^0.8.20;
  
-import "../../../../openzeppelin-contracts-upgradeable/contracts/utils/PausableUpgradeable.sol";
+import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol";
 import "../../security/AuthorizationModule.sol";
  
 /**
@@ -253,28 +277,27 @@ 

* event of a large bug. */ abstract contract PauseModule is PausableUpgradeable, AuthorizationModule { + /* ============ State Variables ============ */ + bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); + string internal constant TEXT_TRANSFER_REJECTED_PAUSED = + "All transfers paused"; + /* ============ Events ============ */ + event Deactivated(address account); + /* ============ ERC-7201 ============ */ // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.ERC20BaseModule")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant PauseModuleStorageLocation = 0x9bd8d607565c0370ae5f91651ca67fd26d4438022bf72037316600e29e6a3a00; + /* ==== ERC-7201 State Variables === */ struct PauseModuleStorage { bool _isDeactivated; } -  - function _getPauseModuleStorage() private pure returns (PauseModuleStorage storage $) { - assembly { - $.slot := PauseModuleStorageLocation - } - } -  - // PauseModule - bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); - string internal constant TEXT_TRANSFER_REJECTED_PAUSED = - "All transfers paused"; - event Deactivated(address account); -  + /* ============ Initializer Function ============ */ function __PauseModule_init_unchained() internal EonlyInitializing { // no variable to initialize } -  + + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @notice Pauses all token transfers. * @dev See {ERC20Pausable} and {Pausable-_pause}. @@ -330,6 +353,19 @@

PauseModuleStorage storage $ = _getPauseModuleStorage(); return $._isDeactivated; } +  +  + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ +  +  + /* ============ ERC-7201 ============ */ + function _getPauseModuleStorage() private pure returns (PauseModuleStorage storage $) { + assembly { + $.slot := PauseModuleStorageLocation + } + } }  

@@ -337,7 +373,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/index.html b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/index.html index 58824a37..4fa59c60 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/index.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/core/index.html @@ -142,7 +142,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/DebtModule.sol.html b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/DebtModule.sol.html index 25ac2161..ae910c4e 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/DebtModule.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/DebtModule.sol.html @@ -123,7 +123,21 @@

78 79 80 -81  +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95        @@ -153,7 +167,13 @@

      -375× +  +  +  +  +  +  +379× @@ -163,6 +183,8 @@

      +  +    @@ -197,6 +219,12 @@

      +  +  +  +  +  +  20×     @@ -212,18 +240,24 @@

import "../../../interfaces/engine/IDebtEngine.sol";   abstract contract DebtModule is AuthorizationModule, IDebtEngine { + /* ============ State Variables ============ */ bytes32 public constant DEBT_ROLE = keccak256("DEBT_ROLE"); + /* ============ ERC-7201 ============ */ // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.DebtModule")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant DebtModuleStorageLocation = 0xf8a315cc5f2213f6481729acd86e55db7ccc930120ccf9fb78b53dcce75f7c00; - /* Variables */ + /* ==== ERC-7201 State Variables === */ struct DebtModuleStorage { IDebtEngine _debtEngine; } + /* ============ Events ============ */ /** * @dev Emitted when a rule engine is set. */ event DebtEngine(IDebtEngine indexed newDebtEngine); +  +  + /* ============ Initializer Function ============ */ /** * @dev * @@ -241,7 +275,9 @@

  } -  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ function debtEngine() public view virtual returns (IDebtEngine) { DebtModuleStorage storage $ = _getDebtModuleStorage(); return $._debtEngine; @@ -276,6 +312,12 @@

} }   +  + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ + + /* ============ ERC-7201 ============ */ function _getDebtModuleStorage() private pure returns (DebtModuleStorage storage $) { assembly { $.slot := DebtModuleStorageLocation @@ -289,7 +331,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/DebtModule/DebtBaseModule.sol.html b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/DebtModule/DebtBaseModule.sol.html deleted file mode 100644 index e09ebdad..00000000 --- a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/DebtModule/DebtBaseModule.sol.html +++ /dev/null @@ -1,764 +0,0 @@ - - - - Code coverage report for contracts/modules/wrapper/extensions/DebtModule/DebtBaseModule.sol - - - - - - - -
-
-

- all files / contracts/modules/wrapper/extensions/DebtModule/ DebtBaseModule.sol -

-
-
- 0% - Statements - 0/26 -
-
- 0% - Branches - 0/32 -
-
- 0% - Functions - 0/14 -
-
- 0% - Lines - 0/41 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
//SPDX-License-Identifier: MPL-2.0
- 
-pragma solidity ^0.8.20;
- 
-import "../../../../../openzeppelin-contracts-upgradeable/contracts/access/AccessControlUpgradeable.sol";
-import "../../../../../openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol";
-import "../../../../interfaces/IDebtGlobal.sol";
-import "../../../security/AuthorizationModule.sol";
- 
-import "../../../../libraries/Errors.sol";
- 
-abstract contract DebtBaseModule is
-    IDebtGlobal,
-    Initializable,
-    ContextUpgradeable,
-    AuthorizationModule
-{
-    // DebtModule
-    bytes32 public constant DEBT_ROLE = keccak256("DEBT_ROLE");
-    DebtBase public debt;
- 
-    /* Events */
-    event InterestRate(uint256 newInterestRate);
-    event ParValue(uint256 newParValue);
-    event Guarantor(string indexed newGuarantorIndexed, string newGuarantor);
-    event BondHolder(string indexed newBondHolderIndexed, string newBondHolder);
-    event MaturityDate(
-        string indexed newMaturityDateIndexed,
-        string newMaturityDate
-    );
-    event InterestScheduleFormat(
-        string indexed newInterestScheduleFormatIndexed,
-        string newInterestScheduleFormat
-    );
-    event InterestPaymentDate(
-        string indexed newInterestPaymentDateIndexed,
-        string newInterestPaymentDate
-    );
-    event DayCountConvention(
-        string indexed newDayCountConventionIndexed,
-        string newDayCountConvention
-    );
-    event BusinessDayConvention(
-        string indexed newBusinessDayConventionIndexed,
-        string newBusinessDayConvention
-    );
-    event PublicHolidaysCalendar(
-        string indexed newPublicHolidaysCalendarIndexed,
-        string newPublicHolidaysCalendar
-    );
-    event IssuanceDate(
-        string indexed newIssuanceDateIndexed,
-        string newIssuanceDate
-    );
-    event CouponFrequency(
-        string indexed newCouponFrequencyIndexed,
-        string newCouponFrequency
-    );
- 
-    function __DebtBaseModule_init_unchained() internal onlyInitializing {
-        // no variable to initialize
-    }
- 
-    /** 
-    * @notice Set all attributes of debt
-    * The values of all attributes will be changed even if the new values are the same as the current ones
-    */
-    function setDebt(DebtBase calldata debt_) public onlyRole(DEBT_ROLE) {
-        debt = debt_;
-        emit InterestRate(debt_.interestRate);
-        emit ParValue(debt_.parValue);
-        emit Guarantor(debt_.guarantor, debt_.guarantor);
-        emit BondHolder(debt_.bondHolder, debt_.bondHolder);
-        emit MaturityDate(debt_.maturityDate, debt_.maturityDate);
-        emit InterestScheduleFormat(
-            debt_.interestScheduleFormat,
-            debt_.interestScheduleFormat
-        );
-        emit InterestPaymentDate(
-            debt_.interestPaymentDate,
-            debt_.interestPaymentDate
-        );
-        emit DayCountConvention(
-            debt_.dayCountConvention,
-            debt_.dayCountConvention
-        );
-        emit BusinessDayConvention(
-            debt_.businessDayConvention,
-            debt_.businessDayConvention
-        );
-        emit PublicHolidaysCalendar(
-            debt_.publicHolidaysCalendar,
-            debt_.publicHolidaysCalendar
-        );
- 
-        emit IssuanceDate(debt_.issuanceDate, debt_.issuanceDate);
- 
-        emit CouponFrequency(debt_.couponFrequency, debt_.couponFrequency);
-    }
- 
-    /** 
-    * @notice The call will be reverted if the new value of interestRate is the same as the current one
-    */
-    function setInterestRate(uint256 interestRate_) public onlyRole(DEBT_ROLE) {
-        if (interestRate_ == debt.interestRate) {
-            revert Errors.CMTAT_DebtModule_SameValue();
-        }
-        debt.interestRate = interestRate_;
-        emit InterestRate(interestRate_);
-    }
- 
-    /**
-    * @notice The call will be reverted if the new value of parValue is the same as the current one
-    */
-    function setParValue(uint256 parValue_) public onlyRole(DEBT_ROLE) {
-        if (parValue_ == debt.parValue) {
-            revert Errors.CMTAT_DebtModule_SameValue();
-        }
-        debt.parValue = parValue_;
-        emit ParValue(parValue_);
-    }
- 
-    /** 
-    * @notice The Guarantor will be changed even if the new value is the same as the current one
-    */
-    function setGuarantor(
-        string calldata guarantor_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.guarantor = guarantor_;
-        emit Guarantor(guarantor_, guarantor_);
-    }
- 
-    /** 
-    * @notice The bonHolder will be changed even if the new value is the same as the current one
-    */
-    function setBondHolder(
-        string calldata bondHolder_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.bondHolder = bondHolder_;
-        emit BondHolder(bondHolder_, bondHolder_);
-    }
- 
-    /** 
-    * @notice The maturityDate will be changed even if the new value is the same as the current one
-    */
-    function setMaturityDate(
-        string calldata maturityDate_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.maturityDate = maturityDate_;
-        emit MaturityDate(maturityDate_, maturityDate_);
-    }
- 
-    /** 
-    * @notice The interestScheduleFormat will be changed even if the new value is the same as the current one
-    */
-    function setInterestScheduleFormat(
-        string calldata interestScheduleFormat_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.interestScheduleFormat = interestScheduleFormat_;
-        emit InterestScheduleFormat(
-            interestScheduleFormat_,
-            interestScheduleFormat_
-        );
-    }
- 
-    /** 
-    * @notice The interestPaymentDate will be changed even if the new value is the same as the current one
-    */
-    function setInterestPaymentDate(
-        string calldata interestPaymentDate_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.interestPaymentDate = interestPaymentDate_;
-        emit InterestPaymentDate(interestPaymentDate_, interestPaymentDate_);
-    }
- 
-    /**
-    * @notice The dayCountConvention will be changed even if the new value is the same as the current one
-    */
-    function setDayCountConvention(
-        string calldata dayCountConvention_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.dayCountConvention = dayCountConvention_;
-        emit DayCountConvention(dayCountConvention_, dayCountConvention_);
-    }
- 
-    /** 
-    * @notice The businessDayConvention will be changed even if the new value is the same as the current one
-    */
-    function setBusinessDayConvention(
-        string calldata businessDayConvention_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.businessDayConvention = businessDayConvention_;
-        emit BusinessDayConvention(
-            businessDayConvention_,
-            businessDayConvention_
-        );
-    }
- 
-    /** 
-    * @notice The publicHolidayCalendar will be changed even if the new value is the same as the current one
-    */
-    function setPublicHolidaysCalendar(
-        string calldata publicHolidaysCalendar_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.publicHolidaysCalendar = publicHolidaysCalendar_;
-        emit PublicHolidaysCalendar(
-            publicHolidaysCalendar_,
-            publicHolidaysCalendar_
-        );
-    }
- 
-    /**
-    * @notice The issuanceDate will be changed even if the new value is the same as the current one
-    */
-    function setIssuanceDate(
-        string calldata issuanceDate_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.issuanceDate = issuanceDate_;
-        emit IssuanceDate(issuanceDate_, issuanceDate_);
-    }
- 
-    /** 
-    * @notice The couponFrequency will be changed even if the new value is the same as the current one
-    */
-    function setCouponFrequency(
-        string calldata couponFrequency_
-    ) public onlyRole(DEBT_ROLE) {
-        debt.couponFrequency = couponFrequency_;
-        emit CouponFrequency(couponFrequency_, couponFrequency_);
-    }
- 
-    uint256[50] private __gap;
-}
- 
-
-
- - - - - - - diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/DebtModule/index.html b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/DebtModule/index.html deleted file mode 100644 index 45ad1a64..00000000 --- a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/DebtModule/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for contracts/modules/wrapper/extensions/DebtModule/ - - - - - - - -
-
-

- all files contracts/modules/wrapper/extensions/DebtModule/ -

-
-
- 0% - Statements - 0/34 -
-
- 0% - Branches - 0/46 -
-
- 0% - Functions - 0/19 -
-
- 0% - Lines - 0/55 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
CreditEventsModule.sol
0%0/80%0/140%0/50%0/14
DebtBaseModule.sol
0%0/260%0/320%0/140%0/41
-
-
- - - - - - - diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/DocumentModule.sol.html b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/DocumentModule.sol.html index 019c0c7e..2640e420 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/DocumentModule.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/DocumentModule.sol.html @@ -120,7 +120,22 @@

75 76 77 -78  +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93        @@ -136,13 +151,9 @@

      -28× -28×       -76× -        @@ -157,8 +168,7 @@

      -  -375× +379× 12× 12× 12× @@ -169,6 +179,14 @@

      +28× +28× +  +  +  +  +  +        @@ -197,6 +215,18 @@

      +  +  +  +  +  +  +  +76× +  +  +  +   
//SPDX-License-Identifier: MPL-2.0
  
 pragma solidity ^0.8.20;
@@ -205,27 +235,22 @@ 

import "../../../libraries/Errors.sol"; import "../../../interfaces/engine/draft-IERC1643.sol"; abstract contract DocumentModule is AuthorizationModule, IERC1643 { + /* ============ Events ============ */ + /** + * @dev Emitted when a rule engine is set. + */ + event DocumentEngine(IERC1643 indexed newDocumentEngine); + + /* ============ ERC-7201 ============ */ bytes32 public constant DOCUMENT_ROLE = keccak256("DOCUMENT_ROLE"); // keccak256(abi.encode(uint256(keccak256("CMTAT.storage.DocumentModule")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant DocumentModuleStorageLocation = 0x5edcb2767f407e647b6a4171ef53e8015a3eff0bb2b6e7765b1a26332bc43000; + /* ==== ERC-7201 State Variables === */ struct DocumentModuleStorage { IERC1643 _documentEngine; }   - function documentEngine() public view virtual returns (IERC1643) { - DocumentModuleStorage storage $ = _getDocumentModuleStorage(); - return $._documentEngine; - } -  - function _getDocumentModuleStorage() private pure returns (DocumentModuleStorage storage $) { - assembly { - $.slot := DocumentModuleStorageLocation - } - } - /** - * @dev Emitted when a rule engine is set. - */ - event DocumentEngine(IERC1643 indexed newDocumentEngine); + /* ============ Initializer Function ============ */ /** * @dev * @@ -241,6 +266,14 @@

emit DocumentEngine(documentEngine_); } } +  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ + function documentEngine() public view virtual returns (IERC1643) { + DocumentModuleStorage storage $ = _getDocumentModuleStorage(); + return $._documentEngine; + }   /* * @notice set an authorizationEngine if not already set @@ -273,6 +306,18 @@

documents = $._documentEngine.getAllDocuments(); } } +  +  + /*////////////////////////////////////////////////////////////// + INTERNAL/PRIVATE FUNCTIONS + //////////////////////////////////////////////////////////////*/ +  + /* ============ ERC-7201 ============ */ + function _getDocumentModuleStorage() private pure returns (DocumentModuleStorage storage $) { + assembly { + $.slot := DocumentModuleStorageLocation + } + } }  

@@ -280,7 +325,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol.html b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol.html index 410d02e3..1b44a9d6 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol.html @@ -25,9 +25,9 @@

5/5
- 91.67% + 83.33% Branches - 11/12 + 10/12
100% @@ -119,7 +119,13 @@

74 75 76 -77  +77 +78 +79 +80  +  +  +        @@ -182,7 +188,7 @@

      -12× +14×       @@ -192,7 +198,7 @@

      -12× +10×      
//SPDX-License-Identifier: MPL-2.0
@@ -212,12 +218,15 @@ 

ERC20SnapshotModuleInternal, AuthorizationModule { - // SnapshotModule + /* ============ State Variables ============ */ bytes32 public constant SNAPSHOOTER_ROLE = keccak256("SNAPSHOOTER_ROLE"); + /* ============ Initializer Function ============ */ function __ERC20SnasphotModule_init_unchained() internal EonlyInitializing { // no variable to initialize } -  + /*////////////////////////////////////////////////////////////// + PUBLIC/EXTERNAL FUNCTIONS + //////////////////////////////////////////////////////////////*/ /** * @notice * Schedule a snapshot at the given time specified as a number of seconds since epoch. @@ -267,7 +276,7 @@

*/ function unscheduleSnapshotNotOptimized( uint256 time - ) public onlyRole(SNAPSHOOTER_ROLE) { + ) public EonlyRole(SNAPSHOOTER_ROLE) { _unscheduleSnapshotNotOptimized(time); } } @@ -277,7 +286,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/MetaTxModule.sol.html b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/MetaTxModule.sol.html index d9002c2f..6e186086 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/MetaTxModule.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/MetaTxModule.sol.html @@ -89,7 +89,7 @@

  pragma solidity ^0.8.20;   -import "../../../../openzeppelin-contracts-upgradeable/contracts/metatx/ERC2771ContextUpgradeable.sol"; +import "@openzeppelin/contracts-upgradeable/metatx/ERC2771ContextUpgradeable.sol";   /** * @dev Meta transaction (gasless) module. @@ -112,7 +112,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/index.html b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/index.html index 4ab46148..d00598d6 100644 --- a/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/index.html +++ b/doc/general/test/coverage/lcov-report/contracts/modules/wrapper/extensions/index.html @@ -25,9 +25,9 @@

30/31
- 80.56% + 77.78% Branches - 29/36 + 28/36
100% @@ -89,8 +89,8 @@

100% 5/5 - 91.67% - 11/12 + 83.33% + 10/12 100% 6/6 100% @@ -116,7 +116,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/test/proxy/CMTAT_PROXY_TEST.sol.html b/doc/general/test/coverage/lcov-report/contracts/test/proxy/CMTAT_PROXY_TEST.sol.html index 877bdbe9..643ed222 100644 --- a/doc/general/test/coverage/lcov-report/contracts/test/proxy/CMTAT_PROXY_TEST.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/test/proxy/CMTAT_PROXY_TEST.sol.html @@ -112,7 +112,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/test/proxy/CMTAT_PROXY_TEST_UUPS.sol.html b/doc/general/test/coverage/lcov-report/contracts/test/proxy/CMTAT_PROXY_TEST_UUPS.sol.html index 35d655bb..e70a37ac 100644 --- a/doc/general/test/coverage/lcov-report/contracts/test/proxy/CMTAT_PROXY_TEST_UUPS.sol.html +++ b/doc/general/test/coverage/lcov-report/contracts/test/proxy/CMTAT_PROXY_TEST_UUPS.sol.html @@ -112,7 +112,7 @@

diff --git a/doc/general/test/coverage/lcov-report/contracts/test/proxy/index.html b/doc/general/test/coverage/lcov-report/contracts/test/proxy/index.html index 78dc763f..666beb15 100644 --- a/doc/general/test/coverage/lcov-report/contracts/test/proxy/index.html +++ b/doc/general/test/coverage/lcov-report/contracts/test/proxy/index.html @@ -90,7 +90,7 @@

diff --git a/doc/general/test/coverage/lcov-report/index.html b/doc/general/test/coverage/lcov-report/index.html index c8fe8018..d20dfec4 100644 --- a/doc/general/test/coverage/lcov-report/index.html +++ b/doc/general/test/coverage/lcov-report/index.html @@ -20,24 +20,24 @@

- 99.4% + 99.45% Statements - 333/335 + 361/363
- 90.98% + 90.53% Branches - 242/266 + 239/264
- 99.22% + 99.28% Functions - 128/129 + 138/139
- 99.53% + 99.57% Lines - 427/429 + 461/463
@@ -75,13 +75,26 @@

contracts/deployment/
100% - 29/29 + 33/33 100% - 20/20 + 10/10 100% - 12/12 + 16/16 + 100% + 51/51 + + + + contracts/deployment/libraries/ +
100% - 49/49 + 8/8 + 100% + 10/10 + 100% + 4/4 + 100% + 16/16 @@ -153,26 +166,26 @@

contracts/modules/internal/
100% - 41/41 + 45/45 85% 17/20 100% 21/21 100% - 54/54 + 58/58 contracts/modules/internal/base/
100% - 76/76 - 96.67% - 58/60 + 88/88 + 96.55% + 56/58 100% - 16/16 + 18/18 100% - 100/100 + 112/112 @@ -219,8 +232,8 @@

96.77% 30/31 - 80.56% - 29/36 + 77.78% + 28/36 100% 19/19 97.62% @@ -246,7 +259,7 @@

diff --git a/doc/general/test/coverage/lcov.info b/doc/general/test/coverage/lcov.info index 8d350db6..96f9743c 100644 --- a/doc/general/test/coverage/lcov.info +++ b/doc/general/test/coverage/lcov.info @@ -1,22 +1,22 @@ TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/CMTAT_PROXY_UUPS.sol -FN:16,constructor -FN:41,initialize -FN:53,_authorizeUpgrade +FN:15,constructor +FN:36,initialize +FN:48,_authorizeUpgrade FNF:3 FNH:3 -FNDA:6,constructor -FNDA:3,initialize +FNDA:9,constructor +FNDA:5,initialize FNDA:2,_authorizeUpgrade -DA:18,6 -DA:42,3 -DA:50,3 +DA:17,9 +DA:37,5 +DA:41,5 LF:3 LH:3 -BRDA:41,1,0,3 -BRDA:41,1,1,0 -BRDA:53,2,0,2 -BRDA:53,2,1,1 +BRDA:36,1,0,5 +BRDA:36,1,1,0 +BRDA:48,2,0,2 +BRDA:48,2,1,1 BRF:4 BRH:3 end_of_record @@ -25,8 +25,8 @@ SF:/home/ryan/Downloads/CM/CMTAT/contracts/CMTAT_PROXY.sol FN:15,constructor FNF:1 FNH:1 -FNDA:194,constructor -DA:17,194 +FNDA:197,constructor +DA:17,197 LF:1 LH:1 BRF:0 @@ -34,11 +34,11 @@ BRH:0 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/CMTAT_STANDALONE.sol -FN:31,constructor +FN:23,constructor FNF:1 FNH:1 FNDA:189,constructor -DA:34,189 +DA:26,189 LF:1 LH:1 BRF:0 @@ -46,114 +46,184 @@ BRH:0 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/deployment/CMTAT_BEACON_FACTORY.sol -FN:33,constructor -FN:62,deployCMTAT -FN:88,getCMTATAddress -FN:96,implementation -FNF:4 -FNH:4 -FNDA:6,constructor +FN:24,constructor +FN:42,deployCMTAT +FN:56,computedProxyAddress +FN:69,_deployBytecode +FN:83,_getBytecode +FN:100,implementation +FNF:6 +FNH:6 +FNDA:8,constructor FNDA:2,deployCMTAT -FNDA:1,getCMTATAddress +FNDA:2,computedProxyAddress +FNDA:2,_deployBytecode +FNDA:4,_getBytecode FNDA:1,implementation -DA:34,6 -DA:35,1 -DA:37,5 -DA:38,1 -DA:40,4 -DA:41,1 -DA:43,3 -DA:44,3 -DA:45,3 +DA:25,8 +DA:26,1 +DA:28,7 +DA:29,1 +DA:31,6 +DA:43,2 +DA:44,2 +DA:47,2 +DA:48,2 +DA:60,2 DA:63,2 -DA:77,2 -DA:78,2 -DA:79,2 -DA:80,2 -DA:81,2 -DA:89,1 -DA:97,1 -LF:17 -LH:17 -BRDA:34,1,0,1 -BRDA:34,1,1,5 -BRDA:37,2,0,1 -BRDA:37,2,1,4 -BRDA:40,3,0,1 -BRDA:40,3,1,3 -BRDA:62,4,0,2 -BRDA:62,4,1,1 -BRF:8 -BRH:8 +DA:70,2 +DA:71,2 +DA:72,2 +DA:73,2 +DA:74,2 +DA:75,2 +DA:76,2 +DA:86,4 +DA:93,4 +DA:101,1 +LF:21 +LH:21 +BRDA:25,1,0,1 +BRDA:25,1,1,7 +BRDA:28,2,0,1 +BRDA:28,2,1,6 +BRDA:42,3,0,2 +BRDA:42,3,1,1 +BRF:6 +BRH:6 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/deployment/CMTAT_TP_FACTORY.sol -FN:44,constructor -FN:67,deployCMTAT -FN:83,computedProxyAddress -FN:98,CMTATProxyAddress -FN:107,_checkAndDetermineDeploymentSalt -FN:123,_deployBytecode -FN:137,_getBytecode -FN:154,_encodeImplementationArgument -FNF:8 -FNH:8 +FN:16,constructor +FN:25,deployCMTAT +FN:41,computedProxyAddress +FN:55,_deployBytecode +FN:69,_getBytecode +FNF:5 +FNH:5 FNDA:9,constructor FNDA:7,deployCMTAT FNDA:2,computedProxyAddress -FNDA:5,CMTATProxyAddress -FNDA:7,_checkAndDetermineDeploymentSalt FNDA:5,_deployBytecode FNDA:7,_getBytecode -FNDA:7,_encodeImplementationArgument -DA:45,9 -DA:46,1 -DA:48,8 -DA:49,1 -DA:51,7 -DA:52,4 -DA:54,7 -DA:55,7 -DA:56,7 -DA:68,7 -DA:69,5 -DA:72,5 -DA:74,5 -DA:88,2 -DA:91,2 -DA:99,5 -DA:108,7 -DA:109,5 -DA:110,2 -DA:112,3 -DA:113,3 -DA:116,2 -DA:124,5 -DA:125,5 -DA:126,5 -DA:127,5 -DA:128,5 -DA:129,5 -DA:130,5 -DA:140,7 -DA:150,7 -DA:162,7 -LF:32 -LH:32 -BRDA:45,1,0,1 -BRDA:45,1,1,8 -BRDA:48,2,0,1 -BRDA:48,2,1,7 -BRDA:51,3,0,4 -BRDA:51,3,1,3 -BRDA:67,4,0,7 -BRDA:67,4,1,2 -BRDA:108,5,0,5 -BRDA:108,5,1,2 -BRDA:109,6,0,2 -BRDA:109,6,1,3 -BRF:12 -BRH:12 +DA:26,7 +DA:27,5 +DA:30,5 +DA:32,5 +DA:46,2 +DA:49,2 +DA:56,5 +DA:57,5 +DA:58,5 +DA:59,5 +DA:60,5 +DA:61,5 +DA:62,5 +DA:72,7 +DA:79,7 +LF:15 +LH:15 +BRDA:25,1,0,7 +BRDA:25,1,1,2 +BRF:2 +BRH:2 +end_of_record +TN: +SF:/home/ryan/Downloads/CM/CMTAT/contracts/deployment/CMTAT_UUPS_FACTORY.sol +FN:20,constructor +FN:30,deployCMTAT +FN:45,computedProxyAddress +FN:62,_deployBytecode +FN:76,_getBytecode +FNF:5 +FNH:5 +FNDA:5,constructor +FNDA:2,deployCMTAT +FNDA:2,computedProxyAddress +FNDA:2,_deployBytecode +FNDA:4,_getBytecode +DA:31,2 +DA:32,2 +DA:35,2 +DA:37,2 +DA:49,2 +DA:52,2 +DA:63,2 +DA:64,2 +DA:65,2 +DA:66,2 +DA:67,2 +DA:68,2 +DA:69,2 +DA:79,4 +DA:86,4 +LF:15 +LH:15 +BRDA:30,1,0,2 +BRDA:30,1,1,1 +BRF:2 +BRH:2 +end_of_record +TN: +SF:/home/ryan/Downloads/CM/CMTAT/contracts/deployment/libraries/CMTATFactoryBase.sol +FN:18,constructor +FNF:1 +FNH:1 +FNDA:16,constructor +DA:19,16 +DA:20,2 +DA:22,14 +LF:3 +LH:3 +BRDA:19,1,0,2 +BRDA:19,1,1,14 +BRF:2 +BRH:2 +end_of_record +TN: +SF:/home/ryan/Downloads/CM/CMTAT/contracts/deployment/libraries/CMTATFactoryInvariant.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/ryan/Downloads/CM/CMTAT/contracts/deployment/libraries/CMTATFactoryRoot.sol +FN:25,constructor +FN:40,CMTATProxyAddress +FN:49,_checkAndDetermineDeploymentSalt +FNF:3 +FNH:3 +FNDA:27,constructor +FNDA:13,CMTATProxyAddress +FNDA:11,_checkAndDetermineDeploymentSalt +DA:26,27 +DA:27,3 +DA:29,24 +DA:30,15 +DA:32,24 +DA:33,24 +DA:41,13 +DA:50,11 +DA:51,5 +DA:52,2 +DA:54,3 +DA:55,3 +DA:58,6 +LF:13 +LH:13 +BRDA:26,1,0,3 +BRDA:26,1,1,24 +BRDA:29,2,0,15 +BRDA:29,2,1,9 +BRDA:50,3,0,5 +BRDA:50,3,1,6 +BRDA:51,4,0,2 +BRDA:51,4,1,3 +BRF:8 +BRH:8 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/draft-IERC1404/draft-IERC1404.sol @@ -210,7 +280,7 @@ BRF:0 BRH:0 end_of_record TN: -SF:/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/engine/IEngine.sol +SF:/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/engine/IRuleEngine.sol FNF:0 FNH:0 LF:0 @@ -219,7 +289,7 @@ BRF:0 BRH:0 end_of_record TN: -SF:/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/engine/IRuleEngine.sol +SF:/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/ICCIPToken.sol FNF:0 FNH:0 LF:0 @@ -228,7 +298,7 @@ BRF:0 BRH:0 end_of_record TN: -SF:/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/ICCIPToken.sol +SF:/home/ryan/Downloads/CM/CMTAT/contracts/interfaces/ICMTATConstructor.sol FNF:0 FNH:0 LF:0 @@ -274,685 +344,703 @@ BRH:0 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/modules/CMTAT_BASE.sol -FN:67,initialize -FN:92,__CMTAT_init -FN:141,__CMTAT_init_unchained -FN:148,decimals -FN:158,transferFrom -FN:182,burnAndMint -FN:191,_update -FN:212,_msgSender -FN:224,_contextSuffixLength -FN:233,_msgData +FN:64,initialize +FN:82,__CMTAT_init +FN:131,__CMTAT_init_unchained +FN:143,decimals +FN:153,transferFrom +FN:177,burnAndMint +FN:189,_update +FN:211,_msgSender +FN:223,_contextSuffixLength +FN:232,_msgData FNF:10 FNH:9 -FNDA:377,initialize -FNDA:377,__CMTAT_init -FNDA:375,__CMTAT_init_unchained +FNDA:381,initialize +FNDA:381,__CMTAT_init +FNDA:379,__CMTAT_init_unchained FNDA:2,decimals FNDA:10,transferFrom FNDA:6,burnAndMint -FNDA:437,_update -FNDA:1381,_msgSender -FNDA:1381,_contextSuffixLength +FNDA:438,_update +FNDA:1386,_msgSender +FNDA:1386,_contextSuffixLength FNDA:0,_msgData -DA:68,377 -DA:95,377 -DA:96,377 -DA:98,377 -DA:100,377 -DA:101,377 -DA:104,377 -DA:109,377 -DA:110,377 -DA:112,377 -DA:116,377 -DA:117,375 -DA:118,375 -DA:120,375 -DA:121,375 -DA:123,375 -DA:124,375 -DA:130,375 -DA:131,375 -DA:132,375 -DA:135,375 -DA:138,375 -DA:155,2 -DA:168,10 -DA:183,6 -DA:184,4 -DA:196,437 -DA:197,17 -DA:204,420 -DA:205,420 -DA:218,1381 -DA:227,1381 -DA:239,0 +DA:65,381 +DA:85,381 +DA:86,381 +DA:88,381 +DA:90,381 +DA:91,381 +DA:94,381 +DA:99,381 +DA:100,381 +DA:102,381 +DA:106,381 +DA:107,379 +DA:108,379 +DA:110,379 +DA:111,379 +DA:113,379 +DA:114,379 +DA:120,379 +DA:121,379 +DA:122,379 +DA:125,379 +DA:128,379 +DA:150,2 +DA:163,10 +DA:178,6 +DA:179,4 +DA:194,438 +DA:195,17 +DA:202,421 +DA:203,421 +DA:217,1386 +DA:226,1386 +DA:238,0 LF:33 LH:32 -BRDA:67,1,0,377 -BRDA:67,1,1,1 -BRDA:92,2,0,377 -BRDA:92,2,1,0 -BRDA:141,3,0,375 -BRDA:141,3,1,0 -BRDA:196,4,0,17 -BRDA:196,4,1,420 +BRDA:64,1,0,381 +BRDA:64,1,1,1 +BRDA:82,2,0,381 +BRDA:82,2,1,0 +BRDA:131,3,0,379 +BRDA:131,3,1,0 +BRDA:194,4,0,17 +BRDA:194,4,1,421 BRF:8 BRH:6 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/modules/internal/base/SnapshotModuleBase.sol -FN:64,__SnapshotModuleBase_init_unchained -FN:74,getAllSnapshots -FN:82,getNextSnapshots -FN:118,_scheduleSnapshot -FN:141,_checkTimeInThePast -FN:149,_checkTimeSnapshotAlreadyDone +FN:70,__SnapshotModuleBase_init_unchained +FN:82,getAllSnapshots +FN:91,getNextSnapshots +FN:131,_scheduleSnapshot FN:158,_scheduleSnapshotNotOptimized -FN:186,_rescheduleSnapshot -FN:225,_unscheduleLastSnapshot +FN:187,_rescheduleSnapshot +FN:224,_unscheduleLastSnapshot FN:245,_unscheduleSnapshotNotOptimized -FN:265,_valueAt -FN:298,_updateSnapshot +FN:264,_valueAt +FN:297,_updateSnapshot FN:314,_setCurrentSnapshot -FN:328,_lastSnapshot -FN:342,_findScheduledSnapshotIndex -FN:368,_findScheduledMostRecentPastSnapshot -FNF:16 -FNH:16 -FNDA:377,__SnapshotModuleBase_init_unchained +FN:329,_lastSnapshot +FN:343,_findScheduledSnapshotIndex +FN:370,_findScheduledMostRecentPastSnapshot +FN:403,_findAndRevertScheduledSnapshotIndex +FN:412,_checkTimeInThePast +FN:420,_checkTimeSnapshotAlreadyDone +FN:427,_getSnapshotModuleBaseStorage +FNF:18 +FNH:18 +FNDA:381,__SnapshotModuleBase_init_unchained FNDA:2,getAllSnapshots FNDA:76,getNextSnapshots FNDA:170,_scheduleSnapshot -FNDA:202,_checkTimeInThePast -FNDA:46,_checkTimeSnapshotAlreadyDone FNDA:12,_scheduleSnapshotNotOptimized FNDA:22,_rescheduleSnapshot -FNDA:12,_unscheduleLastSnapshot -FNDA:12,_unscheduleSnapshotNotOptimized +FNDA:14,_unscheduleLastSnapshot +FNDA:10,_unscheduleSnapshotNotOptimized FNDA:1920,_valueAt -FNDA:840,_updateSnapshot -FNDA:420,_setCurrentSnapshot -FNDA:840,_lastSnapshot +FNDA:842,_updateSnapshot +FNDA:421,_setCurrentSnapshot +FNDA:842,_lastSnapshot FNDA:36,_findScheduledSnapshotIndex -FNDA:488,_findScheduledMostRecentPastSnapshot -DA:75,2 -DA:83,76 -DA:85,76 -DA:86,68 -DA:91,68 -DA:92,48 -DA:95,20 -DA:97,8 -DA:100,8 -DA:102,8 -DA:103,12 -DA:110,28 -DA:120,170 -DA:122,168 -DA:124,94 -DA:127,94 -DA:128,2 -DA:134,2 -DA:137,164 -DA:138,164 -DA:142,202 -DA:143,6 -DA:150,46 -DA:151,6 +FNDA:489,_findScheduledMostRecentPastSnapshot +FNDA:26,_findAndRevertScheduledSnapshotIndex +FNDA:202,_checkTimeInThePast +FNDA:46,_checkTimeSnapshotAlreadyDone +FNDA:4856,_getSnapshotModuleBaseStorage +DA:83,2 +DA:84,2 +DA:92,76 +DA:93,76 +DA:95,76 +DA:96,68 +DA:101,68 +DA:102,48 +DA:105,20 +DA:107,8 +DA:110,8 +DA:112,8 +DA:113,12 +DA:120,28 +DA:132,170 +DA:134,170 +DA:136,168 +DA:138,94 +DA:141,94 +DA:142,2 +DA:148,2 +DA:151,164 +DA:152,164 DA:159,12 -DA:160,10 -DA:162,10 -DA:163,2 -DA:166,8 -DA:167,2 -DA:169,6 -DA:172,6 -DA:173,10 +DA:160,12 +DA:161,10 +DA:163,10 +DA:164,2 +DA:167,8 +DA:168,2 +DA:170,6 +DA:173,6 DA:174,10 DA:175,10 -DA:178,6 -DA:180,8 +DA:176,10 +DA:179,6 +DA:181,8 DA:188,22 -DA:189,20 -DA:190,18 -DA:191,2 -DA:193,16 -DA:194,16 -DA:195,4 -DA:197,12 +DA:190,22 +DA:191,20 +DA:192,18 +DA:193,2 +DA:195,16 +DA:196,12 +DA:197,8 DA:198,8 -DA:199,8 -DA:200,2 -DA:206,2 -DA:209,8 -DA:210,4 -DA:211,2 -DA:217,6 -DA:219,6 -DA:227,12 +DA:199,2 +DA:205,2 +DA:208,8 +DA:209,4 +DA:210,2 +DA:216,6 +DA:218,6 +DA:225,14 +DA:227,14 DA:228,10 DA:229,2 DA:232,8 DA:233,2 DA:235,6 DA:236,6 -DA:246,12 +DA:246,10 DA:247,10 -DA:248,10 -DA:249,2 -DA:252,8 -DA:253,16 -DA:255,8 -DA:283,1920 -DA:285,1920 -DA:286,1484 -DA:288,436 -DA:302,840 -DA:303,840 +DA:249,10 +DA:251,8 +DA:252,16 +DA:254,8 +DA:282,1920 +DA:284,1920 +DA:285,1484 +DA:287,436 +DA:301,842 +DA:302,842 +DA:303,842 DA:304,36 DA:305,36 -DA:315,420 -DA:319,420 -DA:320,18 +DA:315,421 +DA:316,421 +DA:320,421 DA:321,18 -DA:331,840 -DA:332,832 -DA:334,8 -DA:345,36 +DA:322,18 +DA:332,842 +DA:333,834 +DA:335,8 DA:346,36 +DA:347,36 DA:348,36 -DA:352,22 -DA:356,8 -DA:360,6 -DA:373,488 -DA:375,488 -DA:379,402 -DA:382,86 -DA:383,86 +DA:350,36 +DA:354,22 +DA:358,8 +DA:362,6 +DA:375,489 +DA:376,489 +DA:378,489 +DA:382,403 DA:385,86 -DA:386,116 -DA:387,52 -DA:388,52 -DA:391,64 -DA:394,86 -LF:100 -LH:100 -BRDA:64,1,0,377 -BRDA:64,1,1,0 -BRDA:85,2,0,68 -BRDA:85,2,1,8 -BRDA:91,3,0,48 -BRDA:91,3,1,20 -BRDA:95,4,0,8 -BRDA:95,4,1,12 -BRDA:122,5,0,94 -BRDA:122,5,1,74 -BRDA:127,6,0,2 -BRDA:127,6,1,92 -BRDA:133,7,0,2 -BRDA:133,7,1,90 -BRDA:142,8,0,6 -BRDA:142,8,1,196 -BRDA:150,9,0,6 -BRDA:150,9,1,40 -BRDA:162,10,0,2 -BRDA:162,10,1,8 -BRDA:166,11,0,2 -BRDA:166,11,1,6 -BRDA:190,12,0,2 -BRDA:190,12,1,16 -BRDA:194,13,0,4 -BRDA:194,13,1,12 -BRDA:197,14,0,8 -BRDA:197,14,1,4 -BRDA:199,15,0,2 -BRDA:199,15,1,6 -BRDA:205,16,0,2 -BRDA:205,16,1,4 -BRDA:209,17,0,4 -BRDA:209,17,1,4 -BRDA:210,18,0,2 -BRDA:210,18,1,2 -BRDA:228,19,0,2 -BRDA:228,19,1,8 -BRDA:232,20,0,2 -BRDA:232,20,1,6 -BRDA:248,21,0,2 -BRDA:248,21,1,8 -BRDA:285,22,0,1484 -BRDA:285,22,1,436 -BRDA:303,23,0,36 -BRDA:303,23,1,804 -BRDA:319,24,0,18 -BRDA:319,24,1,402 -BRDA:331,25,0,832 -BRDA:331,25,1,8 -BRDA:348,26,0,22 -BRDA:348,26,1,14 -BRDA:355,27,0,8 -BRDA:355,27,1,6 -BRDA:375,28,0,402 -BRDA:375,28,1,86 -BRDA:376,29,0,402 -BRDA:376,29,1,0 -BRDA:386,30,0,52 -BRDA:386,30,1,64 -BRF:60 -BRH:58 +DA:386,86 +DA:388,86 +DA:389,116 +DA:390,52 +DA:391,52 +DA:394,64 +DA:397,86 +DA:406,26 +DA:407,26 +DA:408,6 +DA:410,20 +DA:413,202 +DA:414,6 +DA:421,46 +DA:422,6 +DA:428,4856 +LF:112 +LH:112 +BRDA:70,1,0,381 +BRDA:70,1,1,0 +BRDA:95,2,0,68 +BRDA:95,2,1,8 +BRDA:101,3,0,48 +BRDA:101,3,1,20 +BRDA:105,4,0,8 +BRDA:105,4,1,12 +BRDA:136,5,0,94 +BRDA:136,5,1,74 +BRDA:141,6,0,2 +BRDA:141,6,1,92 +BRDA:147,7,0,2 +BRDA:147,7,1,90 +BRDA:163,8,0,2 +BRDA:163,8,1,8 +BRDA:167,9,0,2 +BRDA:167,9,1,6 +BRDA:192,10,0,2 +BRDA:192,10,1,16 +BRDA:196,11,0,8 +BRDA:196,11,1,4 +BRDA:198,12,0,2 +BRDA:198,12,1,6 +BRDA:204,13,0,2 +BRDA:204,13,1,4 +BRDA:208,14,0,4 +BRDA:208,14,1,4 +BRDA:209,15,0,2 +BRDA:209,15,1,2 +BRDA:228,16,0,2 +BRDA:228,16,1,8 +BRDA:232,17,0,2 +BRDA:232,17,1,6 +BRDA:284,18,0,1484 +BRDA:284,18,1,436 +BRDA:303,19,0,36 +BRDA:303,19,1,806 +BRDA:320,20,0,18 +BRDA:320,20,1,403 +BRDA:332,21,0,834 +BRDA:332,21,1,8 +BRDA:350,22,0,22 +BRDA:350,22,1,14 +BRDA:357,23,0,8 +BRDA:357,23,1,6 +BRDA:378,24,0,403 +BRDA:378,24,1,86 +BRDA:379,25,0,403 +BRDA:379,25,1,0 +BRDA:389,26,0,52 +BRDA:389,26,1,64 +BRDA:407,27,0,6 +BRDA:407,27,1,20 +BRDA:413,28,0,6 +BRDA:413,28,1,196 +BRDA:421,29,0,6 +BRDA:421,29,1,40 +BRF:58 +BRH:56 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/modules/internal/EnforcementModuleInternal.sol -FN:47,__Enforcement_init_unchained -FN:54,frozen -FN:65,_freeze -FN:83,_unfreeze -FN:97,_getEnforcementModuleInternalStorage +FN:53,__Enforcement_init_unchained +FN:64,frozen +FN:79,_freeze +FN:97,_unfreeze +FN:112,_getEnforcementModuleInternalStorage FNF:5 FNH:5 -FNDA:377,__Enforcement_init_unchained -FNDA:942,frozen +FNDA:381,__Enforcement_init_unchained +FNDA:944,frozen FNDA:22,_freeze FNDA:8,_unfreeze -FNDA:972,_getEnforcementModuleInternalStorage -DA:55,942 -DA:56,942 -DA:69,22 -DA:70,22 -DA:71,2 -DA:73,20 -DA:74,20 -DA:75,20 -DA:87,8 -DA:88,8 -DA:89,2 -DA:91,6 -DA:92,6 -DA:94,6 -DA:98,972 +FNDA:974,_getEnforcementModuleInternalStorage +DA:65,944 +DA:66,944 +DA:83,22 +DA:84,22 +DA:85,2 +DA:87,20 +DA:88,20 +DA:89,20 +DA:101,8 +DA:102,8 +DA:103,2 +DA:105,6 +DA:106,6 +DA:108,6 +DA:113,974 LF:15 LH:15 -BRDA:47,1,0,377 -BRDA:47,1,1,0 -BRDA:70,2,0,2 -BRDA:70,2,1,20 -BRDA:88,3,0,2 -BRDA:88,3,1,6 +BRDA:53,1,0,381 +BRDA:53,1,1,0 +BRDA:84,2,0,2 +BRDA:84,2,1,20 +BRDA:102,3,0,2 +BRDA:102,3,1,6 BRF:6 BRH:5 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/modules/internal/ERC20SnapshotModuleInternal.sol -FN:28,__ERC20Snapshot_init_unchained -FN:37,snapshotInfo -FN:46,snapshotInfoBatch -FN:58,snapshotInfoBatch -FN:70,snapshotBalanceOf -FN:87,snapshotTotalSupply -FN:100,_snapshotUpdate -FN:125,_updateAccountSnapshot -FN:132,_updateTotalSupplySnapshot +FN:21,__ERC20Snapshot_init_unchained +FN:34,snapshotInfo +FN:43,snapshotInfoBatch +FN:55,snapshotInfoBatch +FN:67,snapshotBalanceOf +FN:85,snapshotTotalSupply +FN:102,_snapshotUpdate +FN:127,_updateAccountSnapshot +FN:135,_updateTotalSupplySnapshot FNF:9 FNH:9 -FNDA:377,__ERC20Snapshot_init_unchained +FNDA:381,__ERC20Snapshot_init_unchained FNDA:480,snapshotInfo FNDA:160,snapshotInfoBatch FNDA:80,snapshotInfoBatch FNDA:1200,snapshotBalanceOf FNDA:720,snapshotTotalSupply -FNDA:420,_snapshotUpdate -FNDA:463,_updateAccountSnapshot -FNDA:377,_updateTotalSupplySnapshot -DA:38,480 -DA:39,480 -DA:47,160 +FNDA:421,_snapshotUpdate +FNDA:464,_updateAccountSnapshot +FNDA:378,_updateTotalSupplySnapshot +DA:35,480 +DA:36,480 +DA:44,160 +DA:45,160 +DA:46,480 DA:48,160 -DA:49,480 -DA:51,160 +DA:56,80 +DA:57,80 +DA:58,80 DA:59,80 -DA:60,80 -DA:61,80 -DA:62,80 -DA:74,1200 -DA:79,1200 -DA:88,720 -DA:92,720 -DA:104,420 -DA:105,420 -DA:107,77 -DA:108,77 -DA:110,43 -DA:113,34 -DA:117,343 -DA:118,343 -DA:126,463 -DA:133,377 -LF:24 -LH:24 -BRDA:28,1,0,377 -BRDA:28,1,1,0 -BRDA:79,2,0,400 -BRDA:79,2,1,800 -BRDA:92,3,0,36 -BRDA:92,3,1,684 -BRDA:105,4,0,77 -BRDA:105,4,1,343 -BRDA:108,5,0,43 -BRDA:108,5,1,34 +DA:71,1200 +DA:72,1200 +DA:77,1200 +DA:86,720 +DA:87,720 +DA:91,720 +DA:106,421 +DA:107,421 +DA:109,77 +DA:110,77 +DA:112,43 +DA:115,34 +DA:119,344 +DA:120,344 +DA:128,464 +DA:129,464 +DA:136,378 +DA:137,378 +LF:28 +LH:28 +BRDA:21,1,0,381 +BRDA:21,1,1,0 +BRDA:77,2,0,400 +BRDA:77,2,1,800 +BRDA:91,3,0,36 +BRDA:91,3,1,684 +BRDA:107,4,0,77 +BRDA:107,4,1,344 +BRDA:110,5,0,43 +BRDA:110,5,1,34 BRF:10 BRH:9 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/modules/internal/ValidationModuleInternal.sol -FN:30,ruleEngine -FN:37,__Validation_init_unchained -FN:48,_validateTransfer -FN:60,_messageForTransferRestriction -FN:70,_detectTransferRestriction -FN:79,_operateOnTransfer -FN:84,_getValidationModuleInternalStorage +FN:32,__Validation_init_unchained +FN:45,ruleEngine +FN:58,_validateTransfer +FN:70,_messageForTransferRestriction +FN:80,_detectTransferRestriction +FN:89,_operateOnTransfer +FN:96,_getValidationModuleInternalStorage FNF:7 FNH:7 +FNDA:381,__Validation_init_unchained FNDA:32,ruleEngine -FNDA:377,__Validation_init_unchained FNDA:12,_validateTransfer FNDA:6,_messageForTransferRestriction FNDA:6,_detectTransferRestriction FNDA:60,_operateOnTransfer -FNDA:627,_getValidationModuleInternalStorage -DA:31,32 -DA:32,32 -DA:38,377 -DA:39,18 -DA:40,18 -DA:41,18 -DA:53,12 -DA:54,12 -DA:63,6 -DA:64,6 -DA:75,6 -DA:76,6 -DA:80,60 -DA:81,60 -DA:85,627 +FNDA:628,_getValidationModuleInternalStorage +DA:33,381 +DA:34,18 +DA:35,18 +DA:36,18 +DA:46,32 +DA:47,32 +DA:63,12 +DA:64,12 +DA:73,6 +DA:74,6 +DA:85,6 +DA:86,6 +DA:90,60 +DA:91,60 +DA:97,628 LF:15 LH:15 -BRDA:37,1,0,377 -BRDA:37,1,1,0 -BRDA:38,2,0,18 -BRDA:38,2,1,359 +BRDA:32,1,0,381 +BRDA:32,1,1,0 +BRDA:33,2,0,18 +BRDA:33,2,1,363 BRF:4 BRH:3 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/modules/security/AuthorizationModule.sol -FN:28,__AuthorizationModule_init_unchained -FN:40,authorizationEngine -FN:52,setAuthorizationEngine -FN:61,grantRole -FN:73,revokeRole -FN:88,hasRole -FN:99,_getAuthorizationModuleStorage +FN:31,__AuthorizationModule_init_unchained +FN:48,authorizationEngine +FN:60,setAuthorizationEngine +FN:69,grantRole +FN:81,revokeRole +FN:96,hasRole +FN:114,_getAuthorizationModuleStorage FNF:7 FNH:7 -FNDA:377,__AuthorizationModule_init_unchained +FNDA:381,__AuthorizationModule_init_unchained FNDA:2,authorizationEngine FNDA:16,setAuthorizationEngine FNDA:40,grantRole FNDA:10,revokeRole -FNDA:1275,hasRole +FNDA:1280,hasRole FNDA:84,_getAuthorizationModuleStorage -DA:29,377 -DA:30,2 -DA:32,375 -DA:33,375 -DA:34,16 -DA:35,16 -DA:36,16 -DA:41,2 -DA:42,2 -DA:53,16 -DA:54,16 -DA:55,4 -DA:57,12 -DA:58,12 -DA:62,40 -DA:63,40 -DA:64,8 -DA:65,8 -DA:67,4 -DA:70,36 -DA:74,10 -DA:75,10 -DA:76,8 -DA:77,8 -DA:79,4 -DA:82,6 -DA:93,1275 -DA:94,758 -DA:96,517 -DA:100,84 +DA:32,381 +DA:33,2 +DA:35,379 +DA:36,379 +DA:37,16 +DA:38,16 +DA:39,16 +DA:49,2 +DA:50,2 +DA:61,16 +DA:62,16 +DA:63,4 +DA:65,12 +DA:66,12 +DA:70,40 +DA:71,40 +DA:72,8 +DA:73,8 +DA:75,4 +DA:78,36 +DA:82,10 +DA:83,10 +DA:84,8 +DA:85,8 +DA:87,4 +DA:90,6 +DA:101,1280 +DA:102,759 +DA:104,521 +DA:115,84 LF:30 LH:30 -BRDA:28,1,0,377 -BRDA:28,1,1,0 -BRDA:29,2,0,2 -BRDA:29,2,1,375 -BRDA:33,3,0,16 -BRDA:33,3,1,359 -BRDA:52,4,0,16 -BRDA:52,4,1,4 -BRDA:54,5,0,4 -BRDA:54,5,1,12 -BRDA:61,6,0,40 -BRDA:61,6,1,2 -BRDA:63,7,0,8 -BRDA:63,7,1,32 -BRDA:65,8,0,4 -BRDA:65,8,1,4 -BRDA:73,9,0,10 -BRDA:73,9,1,2 -BRDA:75,10,0,8 -BRDA:75,10,1,2 -BRDA:77,11,0,4 -BRDA:77,11,1,4 -BRDA:93,12,0,758 -BRDA:93,12,1,517 +BRDA:31,1,0,381 +BRDA:31,1,1,0 +BRDA:32,2,0,2 +BRDA:32,2,1,379 +BRDA:36,3,0,16 +BRDA:36,3,1,363 +BRDA:60,4,0,16 +BRDA:60,4,1,4 +BRDA:62,5,0,4 +BRDA:62,5,1,12 +BRDA:69,6,0,40 +BRDA:69,6,1,2 +BRDA:71,7,0,8 +BRDA:71,7,1,32 +BRDA:73,8,0,4 +BRDA:73,8,1,4 +BRDA:81,9,0,10 +BRDA:81,9,1,2 +BRDA:83,10,0,8 +BRDA:83,10,1,2 +BRDA:85,11,0,4 +BRDA:85,11,1,4 +BRDA:101,12,0,759 +BRDA:101,12,1,521 BRF:24 BRH:23 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/controllers/ValidationModule.sol -FN:26,__ValidationModule_init_unchained -FN:36,setRuleEngine -FN:50,messageForTransferRestriction -FN:85,detectTransferRestriction -FN:104,validateTransfer -FN:119,_validateTransferByModule -FN:130,_operateOnTransfer +FN:28,__ValidationModule_init_unchained +FN:43,setRuleEngine +FN:57,messageForTransferRestriction +FN:92,detectTransferRestriction +FN:111,validateTransfer +FN:130,_validateTransferByModule +FN:141,_operateOnTransfer FNF:7 FNH:7 -FNDA:375,__ValidationModule_init_unchained +FNDA:379,__ValidationModule_init_unchained FNDA:18,setRuleEngine FNDA:20,messageForTransferRestriction FNDA:17,detectTransferRestriction FNDA:19,validateTransfer -FNDA:456,_validateTransferByModule -FNDA:437,_operateOnTransfer -DA:37,18 -DA:38,18 -DA:39,3 -DA:41,15 -DA:42,15 -DA:53,20 -DA:54,20 -DA:55,3 -DA:60,4 -DA:65,2 -DA:70,2 -DA:72,6 -DA:74,3 -DA:90,17 -DA:91,17 -DA:92,4 -DA:94,2 -DA:96,2 -DA:98,6 -DA:100,3 -DA:109,19 -DA:110,4 -DA:112,15 -DA:113,15 -DA:114,12 -DA:116,3 -DA:124,456 -DA:125,18 -DA:127,438 -DA:131,437 -DA:132,14 -DA:134,423 -DA:135,423 -DA:136,60 -DA:138,363 +FNDA:457,_validateTransferByModule +FNDA:438,_operateOnTransfer +DA:44,18 +DA:45,18 +DA:46,3 +DA:48,15 +DA:49,15 +DA:60,20 +DA:61,20 +DA:62,3 +DA:67,4 +DA:72,2 +DA:77,2 +DA:79,6 +DA:81,3 +DA:97,17 +DA:98,17 +DA:99,4 +DA:101,2 +DA:103,2 +DA:105,6 +DA:107,3 +DA:116,19 +DA:117,4 +DA:119,15 +DA:120,15 +DA:121,12 +DA:123,3 +DA:135,457 +DA:136,18 +DA:138,439 +DA:142,438 +DA:143,14 +DA:145,424 +DA:146,424 +DA:147,60 +DA:149,364 LF:35 LH:35 -BRDA:26,1,0,375 -BRDA:26,1,1,0 -BRDA:36,2,0,18 -BRDA:36,2,1,3 -BRDA:38,3,0,3 -BRDA:38,3,1,15 -BRDA:54,4,0,3 -BRDA:54,4,1,17 -BRDA:56,5,0,4 -BRDA:56,5,1,13 -BRDA:61,6,0,2 -BRDA:61,6,1,11 -BRDA:66,7,0,2 -BRDA:66,7,1,9 -BRDA:71,8,0,6 -BRDA:71,8,1,3 -BRDA:91,9,0,4 -BRDA:91,9,1,13 -BRDA:93,10,0,2 -BRDA:93,10,1,11 -BRDA:95,11,0,2 -BRDA:95,11,1,9 -BRDA:97,12,0,6 -BRDA:97,12,1,3 -BRDA:109,13,0,4 -BRDA:109,13,1,15 -BRDA:113,14,0,12 -BRDA:113,14,1,3 -BRDA:124,15,0,18 -BRDA:124,15,1,438 -BRDA:124,16,0,12 -BRDA:124,16,1,4 -BRDA:124,17,0,4 -BRDA:124,17,1,2 -BRDA:131,18,0,14 -BRDA:131,18,1,423 -BRDA:135,19,0,60 -BRDA:135,19,1,363 +BRDA:28,1,0,379 +BRDA:28,1,1,0 +BRDA:43,2,0,18 +BRDA:43,2,1,3 +BRDA:45,3,0,3 +BRDA:45,3,1,15 +BRDA:61,4,0,3 +BRDA:61,4,1,17 +BRDA:63,5,0,4 +BRDA:63,5,1,13 +BRDA:68,6,0,2 +BRDA:68,6,1,11 +BRDA:73,7,0,2 +BRDA:73,7,1,9 +BRDA:78,8,0,6 +BRDA:78,8,1,3 +BRDA:98,9,0,4 +BRDA:98,9,1,13 +BRDA:100,10,0,2 +BRDA:100,10,1,11 +BRDA:102,11,0,2 +BRDA:102,11,1,9 +BRDA:104,12,0,6 +BRDA:104,12,1,3 +BRDA:116,13,0,4 +BRDA:116,13,1,15 +BRDA:120,14,0,12 +BRDA:120,14,1,3 +BRDA:135,15,0,18 +BRDA:135,15,1,439 +BRDA:135,16,0,12 +BRDA:135,16,1,4 +BRDA:135,17,0,4 +BRDA:135,17,1,2 +BRDA:142,18,0,14 +BRDA:142,18,1,424 +BRDA:146,19,0,60 +BRDA:146,19,1,364 BRF:38 BRH:37 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/core/BaseModule.sol -FN:46,__Base_init_unchained -FN:55,tokenId -FN:60,terms -FN:64,information -FN:74,setTokenId -FN:85,setTerms -FN:96,setInformation -FN:103,_getBaseModuleStorage +FN:45,__Base_init_unchained +FN:56,tokenId +FN:61,terms +FN:65,information +FN:75,setTokenId +FN:86,setTerms +FN:97,setInformation +FN:109,_getBaseModuleStorage FNF:8 FNH:8 -FNDA:375,__Base_init_unchained +FNDA:379,__Base_init_unchained FNDA:10,tokenId FNDA:10,terms FNDA:8,information FNDA:2,setTokenId FNDA:2,setTerms FNDA:2,setInformation -FNDA:409,_getBaseModuleStorage -DA:47,375 -DA:48,375 -DA:49,375 -DA:50,375 -DA:56,10 +FNDA:413,_getBaseModuleStorage +DA:46,379 +DA:47,379 +DA:48,379 +DA:49,379 DA:57,10 -DA:61,10 +DA:58,10 DA:62,10 -DA:65,8 +DA:63,10 DA:66,8 -DA:75,2 +DA:67,8 DA:76,2 DA:77,2 -DA:86,2 +DA:78,2 DA:87,2 DA:88,2 -DA:97,2 +DA:89,2 DA:98,2 DA:99,2 -DA:104,409 +DA:100,2 +DA:110,413 LF:20 LH:20 -BRDA:46,1,0,375 -BRDA:46,1,1,0 -BRDA:74,2,0,2 -BRDA:74,2,1,2 -BRDA:85,3,0,2 -BRDA:85,3,1,2 -BRDA:96,4,0,2 -BRDA:96,4,1,2 +BRDA:45,1,0,379 +BRDA:45,1,1,0 +BRDA:75,2,0,2 +BRDA:75,2,1,2 +BRDA:86,3,0,2 +BRDA:86,3,1,2 +BRDA:97,4,0,2 +BRDA:97,4,1,2 BRF:8 BRH:7 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/core/EnforcementModule.sol -FN:25,__EnforcementModule_init_unchained -FN:37,freeze -FN:51,unfreeze +FN:26,__EnforcementModule_init_unchained +FN:41,freeze +FN:55,unfreeze FNF:3 FNH:3 -FNDA:375,__EnforcementModule_init_unchained +FNDA:379,__EnforcementModule_init_unchained FNDA:22,freeze FNDA:8,unfreeze -DA:38,22 -DA:52,8 +DA:42,22 +DA:56,8 LF:2 LH:2 -BRDA:25,1,0,375 -BRDA:25,1,1,0 -BRDA:37,2,0,22 -BRDA:37,2,1,2 -BRDA:51,3,0,8 -BRDA:51,3,1,2 +BRDA:26,1,0,379 +BRDA:26,1,1,0 +BRDA:41,2,0,22 +BRDA:41,2,1,2 +BRDA:55,3,0,8 +BRDA:55,3,1,2 BRF:6 BRH:5 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/core/ERC20BaseModule.sol -FN:34,__ERC20BaseModule_init_unchained +FN:33,__ERC20BaseModule_init_unchained FN:45,decimals FN:62,transferBatch FN:92,transferFrom FN:111,balanceInfo -FN:119,_getERC20BaseModuleStorage +FN:126,_getERC20BaseModuleStorage FNF:6 FNH:6 -FNDA:375,__ERC20BaseModule_init_unchained +FNDA:379,__ERC20BaseModule_init_unchained FNDA:2,decimals FNDA:10,transferBatch FNDA:10,transferFrom FNDA:4,balanceInfo -FNDA:377,_getERC20BaseModuleStorage -DA:35,375 -DA:36,375 +FNDA:381,_getERC20BaseModuleStorage +DA:34,379 +DA:35,379 DA:46,2 DA:47,2 DA:66,10 @@ -970,11 +1058,11 @@ DA:112,4 DA:113,4 DA:114,6 DA:116,4 -DA:120,377 +DA:127,381 LF:20 LH:20 -BRDA:34,1,0,375 -BRDA:34,1,1,0 +BRDA:33,1,0,379 +BRDA:33,1,1,0 BRDA:66,2,0,2 BRDA:66,2,1,8 BRDA:71,3,0,4 @@ -986,277 +1074,277 @@ BRH:6 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/core/ERC20BurnModule.sol -FN:19,__ERC20BurnModule_init_unchained -FN:36,burn -FN:60,burnBatch -FN:92,burnFrom +FN:25,__ERC20BurnModule_init_unchained +FN:46,burn +FN:70,burnBatch +FN:102,burnFrom FNF:4 FNH:4 -FNDA:375,__ERC20BurnModule_init_unchained +FNDA:379,__ERC20BurnModule_init_unchained FNDA:14,burn FNDA:12,burnBatch FNDA:4,burnFrom -DA:37,14 -DA:38,12 -DA:61,12 -DA:62,2 -DA:66,10 -DA:67,4 -DA:70,6 -DA:71,18 -DA:72,16 -DA:95,4 -DA:96,4 -DA:97,4 -DA:99,2 -DA:102,2 -DA:103,2 -DA:106,2 -DA:108,2 -DA:110,2 +DA:47,14 +DA:48,12 +DA:71,12 +DA:72,2 +DA:76,10 +DA:77,4 +DA:80,6 +DA:81,18 +DA:82,16 +DA:105,4 +DA:106,4 +DA:107,4 +DA:109,2 +DA:112,2 +DA:113,2 +DA:116,2 +DA:118,2 +DA:120,2 LF:18 LH:18 -BRDA:19,1,0,375 -BRDA:19,1,1,0 -BRDA:36,2,0,14 -BRDA:36,2,1,4 -BRDA:60,3,0,12 -BRDA:60,3,1,2 -BRDA:61,4,0,2 -BRDA:61,4,1,10 -BRDA:66,5,0,4 -BRDA:66,5,1,6 -BRDA:92,6,0,4 -BRDA:92,6,1,2 -BRDA:97,7,0,2 -BRDA:97,7,1,2 +BRDA:25,1,0,379 +BRDA:25,1,1,0 +BRDA:46,2,0,14 +BRDA:46,2,1,4 +BRDA:70,3,0,12 +BRDA:70,3,1,2 +BRDA:71,4,0,2 +BRDA:71,4,1,10 +BRDA:76,5,0,4 +BRDA:76,5,1,6 +BRDA:102,6,0,4 +BRDA:102,6,1,2 +BRDA:107,7,0,2 +BRDA:107,7,1,2 BRF:14 BRH:13 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/core/ERC20MintModule.sol -FN:17,__ERC20MintModule_init_unchained -FN:34,mint -FN:57,mintBatch +FN:20,__ERC20MintModule_init_unchained +FN:40,mint +FN:63,mintBatch FNF:3 FNH:3 -FNDA:375,__ERC20MintModule_init_unchained -FNDA:289,mint +FNDA:379,__ERC20MintModule_init_unchained +FNDA:290,mint FNDA:24,mintBatch -DA:35,289 -DA:36,289 -DA:58,24 -DA:59,2 -DA:63,22 -DA:64,4 -DA:67,18 -DA:68,54 -DA:69,54 +DA:41,290 +DA:42,290 +DA:64,24 +DA:65,2 +DA:69,22 +DA:70,4 +DA:73,18 +DA:74,54 +DA:75,54 LF:9 LH:9 -BRDA:17,1,0,375 -BRDA:17,1,1,0 -BRDA:34,2,0,289 -BRDA:34,2,1,4 -BRDA:57,3,0,24 -BRDA:57,3,1,2 -BRDA:58,4,0,2 -BRDA:58,4,1,22 -BRDA:63,5,0,4 -BRDA:63,5,1,18 +BRDA:20,1,0,379 +BRDA:20,1,1,0 +BRDA:40,2,0,290 +BRDA:40,2,1,4 +BRDA:63,3,0,24 +BRDA:63,3,1,2 +BRDA:64,4,0,2 +BRDA:64,4,1,22 +BRDA:69,5,0,4 +BRDA:69,5,1,18 BRF:10 BRH:9 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/core/PauseModule.sol -FN:25,_getPauseModuleStorage -FN:37,__PauseModule_init_unchained -FN:50,pause -FN:62,unpause -FN:81,deactivateContract -FN:92,deactivated +FN:33,__PauseModule_init_unchained +FN:49,pause +FN:61,unpause +FN:80,deactivateContract +FN:91,deactivated +FN:103,_getPauseModuleStorage FNF:6 FNH:6 -FNDA:12,_getPauseModuleStorage -FNDA:375,__PauseModule_init_unchained +FNDA:379,__PauseModule_init_unchained FNDA:14,pause FNDA:6,unpause FNDA:2,deactivateContract FNDA:4,deactivated -DA:26,12 -DA:51,14 +FNDA:12,_getPauseModuleStorage +DA:50,14 +DA:62,6 DA:63,6 -DA:64,6 -DA:65,2 -DA:67,4 +DA:64,2 +DA:66,4 +DA:82,2 DA:83,2 DA:84,2 DA:85,2 -DA:86,2 +DA:92,4 DA:93,4 -DA:94,4 +DA:104,12 LF:12 LH:12 -BRDA:37,1,0,375 -BRDA:37,1,1,0 -BRDA:50,2,0,14 -BRDA:50,2,1,3 -BRDA:62,3,0,6 -BRDA:62,3,1,2 -BRDA:64,4,0,2 -BRDA:64,4,1,4 -BRDA:81,5,0,2 -BRDA:81,5,1,2 +BRDA:33,1,0,379 +BRDA:33,1,1,0 +BRDA:49,2,0,14 +BRDA:49,2,1,3 +BRDA:61,3,0,6 +BRDA:61,3,1,2 +BRDA:63,4,0,2 +BRDA:63,4,1,4 +BRDA:80,5,0,2 +BRDA:80,5,1,2 BRF:10 BRH:9 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/extensions/DebtModule.sol -FN:30,__DebtModule_init_unchained -FN:40,debtEngine -FN:51,setDebtEngine -FN:60,debt -FN:67,creditEvents -FN:74,_getDebtModuleStorage +FN:36,__DebtModule_init_unchained +FN:48,debtEngine +FN:59,setDebtEngine +FN:68,debt +FN:75,creditEvents +FN:88,_getDebtModuleStorage FNF:6 FNH:6 -FNDA:375,__DebtModule_init_unchained +FNDA:379,__DebtModule_init_unchained FNDA:8,debtEngine FNDA:5,setDebtEngine FNDA:2,debt FNDA:2,creditEvents FNDA:20,_getDebtModuleStorage -DA:31,375 -DA:32,3 -DA:33,3 -DA:34,3 -DA:41,8 -DA:42,8 -DA:52,5 -DA:53,5 -DA:54,1 -DA:56,4 -DA:57,4 -DA:61,2 -DA:62,2 -DA:63,2 -DA:68,2 +DA:37,379 +DA:38,3 +DA:39,3 +DA:40,3 +DA:49,8 +DA:50,8 +DA:60,5 +DA:61,5 +DA:62,1 +DA:64,4 +DA:65,4 DA:69,2 DA:70,2 -DA:75,20 +DA:71,2 +DA:76,2 +DA:77,2 +DA:78,2 +DA:89,20 LF:18 LH:18 -BRDA:30,1,0,375 -BRDA:30,1,1,0 -BRDA:31,2,0,3 -BRDA:31,2,1,372 -BRDA:51,3,0,5 -BRDA:51,3,1,1 -BRDA:53,4,0,1 -BRDA:53,4,1,4 -BRDA:62,5,0,2 -BRDA:62,5,1,0 -BRDA:69,6,0,2 -BRDA:69,6,1,0 +BRDA:36,1,0,379 +BRDA:36,1,1,0 +BRDA:37,2,0,3 +BRDA:37,2,1,376 +BRDA:59,3,0,5 +BRDA:59,3,1,1 +BRDA:61,4,0,1 +BRDA:61,4,1,4 +BRDA:70,5,0,2 +BRDA:70,5,1,0 +BRDA:77,6,0,2 +BRDA:77,6,1,0 BRF:12 BRH:9 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/extensions/DocumentModule.sol -FN:16,documentEngine -FN:21,_getDocumentModuleStorage -FN:38,__DocumentModule_init_unchained -FN:52,setDocumentEngine -FN:62,getDocument -FN:71,getAllDocuments +FN:33,__DocumentModule_init_unchained +FN:44,documentEngine +FN:55,setDocumentEngine +FN:65,getDocument +FN:74,getAllDocuments +FN:87,_getDocumentModuleStorage FNF:6 FNH:6 +FNDA:379,__DocumentModule_init_unchained FNDA:28,documentEngine -FNDA:76,_getDocumentModuleStorage -FNDA:375,__DocumentModule_init_unchained FNDA:16,setDocumentEngine FNDA:16,getDocument FNDA:4,getAllDocuments -DA:17,28 -DA:18,28 -DA:22,76 -DA:39,375 -DA:40,12 -DA:41,12 -DA:42,12 -DA:53,16 -DA:54,16 -DA:55,2 -DA:57,14 -DA:58,14 -DA:63,16 -DA:64,16 -DA:65,16 -DA:67,0 -DA:72,4 -DA:73,4 -DA:74,4 +FNDA:76,_getDocumentModuleStorage +DA:34,379 +DA:35,12 +DA:36,12 +DA:37,12 +DA:45,28 +DA:46,28 +DA:56,16 +DA:57,16 +DA:58,2 +DA:60,14 +DA:61,14 +DA:66,16 +DA:67,16 +DA:68,16 +DA:70,0 +DA:75,4 +DA:76,4 +DA:77,4 +DA:88,76 LF:19 LH:18 -BRDA:38,1,0,375 -BRDA:38,1,1,0 -BRDA:39,2,0,12 -BRDA:39,2,1,363 -BRDA:52,3,0,16 -BRDA:52,3,1,2 -BRDA:54,4,0,2 -BRDA:54,4,1,14 -BRDA:64,5,0,16 -BRDA:64,5,1,0 -BRDA:73,6,0,4 -BRDA:73,6,1,0 +BRDA:33,1,0,379 +BRDA:33,1,1,0 +BRDA:34,2,0,12 +BRDA:34,2,1,367 +BRDA:55,3,0,16 +BRDA:55,3,1,2 +BRDA:57,4,0,2 +BRDA:57,4,1,14 +BRDA:67,5,0,16 +BRDA:67,5,1,0 +BRDA:76,6,0,4 +BRDA:76,6,1,0 BRF:12 BRH:9 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol -FN:20,__ERC20SnasphotModule_init_unchained -FN:29,scheduleSnapshot -FN:40,scheduleSnapshotNotOptimized -FN:52,rescheduleSnapshot -FN:63,unscheduleLastSnapshot -FN:73,unscheduleSnapshotNotOptimized +FN:21,__ERC20SnasphotModule_init_unchained +FN:32,scheduleSnapshot +FN:43,scheduleSnapshotNotOptimized +FN:55,rescheduleSnapshot +FN:66,unscheduleLastSnapshot +FN:76,unscheduleSnapshotNotOptimized FNF:6 FNH:6 -FNDA:375,__ERC20SnasphotModule_init_unchained +FNDA:379,__ERC20SnasphotModule_init_unchained FNDA:170,scheduleSnapshot FNDA:12,scheduleSnapshotNotOptimized FNDA:22,rescheduleSnapshot -FNDA:12,unscheduleLastSnapshot -FNDA:12,unscheduleSnapshotNotOptimized -DA:30,170 -DA:41,12 -DA:53,22 -DA:64,12 -DA:74,12 +FNDA:14,unscheduleLastSnapshot +FNDA:10,unscheduleSnapshotNotOptimized +DA:33,170 +DA:44,12 +DA:56,22 +DA:67,14 +DA:77,10 LF:5 LH:5 -BRDA:20,1,0,375 -BRDA:20,1,1,0 -BRDA:29,2,0,170 -BRDA:29,2,1,2 -BRDA:40,3,0,12 -BRDA:40,3,1,2 -BRDA:52,4,0,22 -BRDA:52,4,1,2 -BRDA:63,5,0,12 -BRDA:63,5,1,2 -BRDA:73,6,0,12 -BRDA:73,6,1,2 +BRDA:21,1,0,379 +BRDA:21,1,1,0 +BRDA:32,2,0,170 +BRDA:32,2,1,2 +BRDA:43,3,0,12 +BRDA:43,3,1,4 +BRDA:55,4,0,22 +BRDA:55,4,1,2 +BRDA:66,5,0,14 +BRDA:66,5,1,2 +BRDA:76,6,0,10 +BRDA:76,6,1,0 BRF:12 -BRH:11 +BRH:10 end_of_record TN: SF:/home/ryan/Downloads/CM/CMTAT/contracts/modules/wrapper/extensions/MetaTxModule.sol FN:18,constructor FNF:1 FNH:1 -FNDA:389,constructor +FNDA:395,constructor LF:0 LH:0 BRF:0 diff --git a/doc/modules/presentation/core/base.md b/doc/modules/presentation/core/base.md index 3bb0326a..49684c94 100644 --- a/doc/modules/presentation/core/base.md +++ b/doc/modules/presentation/core/base.md @@ -48,7 +48,6 @@ This document defines Base Module for the CMTA Token specification. | └ | setTokenId | Public ❗️ | 🛑 | onlyRole | | └ | setTerms | Public ❗️ | 🛑 | onlyRole | | └ | setInformation | Public ❗️ | 🛑 | onlyRole | -| └ | setFlag | Public ❗️ | 🛑 | onlyRole | ### Legend @@ -129,9 +128,6 @@ Only authorized users are allowed to call this function. | └ | setInformation | Public ❗️ | 🛑 | onlyRole | | └ | setFlag | Public ❗️ | 🛑 | onlyRole | - -### - ### Events #### `Term(string)` @@ -169,15 +165,3 @@ event Information(string indexed newInformationIndexed, string newInformation) ##### Description: Emitted when the variable `information` is set to `newInformation`. - -#### `Flag(uint256)` - -##### Definition: - -```solidity -event Flag(uint256 indexed newFlag) -``` - -##### Description: - -Emitted when the variable `flag` is set to `newFlag`. diff --git a/doc/modules/presentation/core/pause.md b/doc/modules/presentation/core/pause.md index 487bdbe2..c70af5e4 100644 --- a/doc/modules/presentation/core/pause.md +++ b/doc/modules/presentation/core/pause.md @@ -8,6 +8,10 @@ This document defines the Pause Module for the CMTA Token specification. > The issuer must be able to “pause” the smart contract, to prevent execution of transactions on the distributed ledger until the issuer puts an end to the pause. This function can be used to block transactions in case of a “hard fork” of the distributed ledger, pending a decision of the issuer as to which version of the distributed ledger it will support. +The PauseModule contract introduces contract pausing functionality into the CMTAT ERC20 token. This prevents users from being able to perform transfers while the contract is paused. + +However, this is not enforced in the functions that allow to change a user’s allowance. We don't think it is necessary to prevent allowance change while the contract is in the pause state. + ## Schema ### Inheritance diff --git a/doc/modules/presentation/extensions/Debt/creditEvents.md b/doc/modules/presentation/extensions/Debt/creditEvents.md deleted file mode 100644 index c81f70ef..00000000 --- a/doc/modules/presentation/extensions/Debt/creditEvents.md +++ /dev/null @@ -1,157 +0,0 @@ -# CreditEvents Module - -This document defines CreditEvents Module for the CMTA Token specification. - -[TOC] - -## Rationale - -> A number of events may occur during the lifetime of a debt instrument. Contrary to corporate actions, some of these events typically involve third parties (e.g. a bond agent or a rating agency). The issuer may in such cases wish to delegate the relevant functions to the relevant third parties. - -## Schema - -### Inheritance - -![surya_inheritance_CreditEventsModule.sol](../../../../schema/surya_inheritance/surya_inheritance_CreditEventsModule.sol.png) - -### UML - -![CreditEventsModule](../../../../schema/sol2uml/CreditEventsModule.svg) - -### Graph - -![surya_graph_CreditEventsModule.sol](../../../../schema/surya_graph/surya_graph_CreditEventsModule.sol.png) - -## Sūrya's Description Report - -### Files Description Table - - -| File Name | SHA-1 Hash | -| ------------------------------------------------------------ | ---------------------------------------- | -| ./modules/wrapper/extensions/DebtModule/CreditEventsModule.sol | 166aee930aee560044280eb305ebb8a477fc9c49 | - - -### Contracts Description Table - - -| Contract | Type | Bases | | | -| :--------------------: | :---------------------------: | :----------------------------------------------------------: | :------------: | :--------------: | -| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | -| | | | | | -| **CreditEventsModule** | Implementation | IDebtGlobal, Initializable, ContextUpgradeable, AuthorizationModule | | | -| └ | __CreditEvents_init_unchained | Internal 🔒 | 🛑 | onlyInitializing | -| └ | setCreditEvents | Public ❗️ | 🛑 | onlyRole | -| └ | setFlagDefault | Public ❗️ | 🛑 | onlyRole | -| └ | setFlagRedeemed | Public ❗️ | 🛑 | onlyRole | -| └ | setRating | Public ❗️ | 🛑 | onlyRole | - - -### Legend - -| Symbol | Meaning | -| :----: | ------------------------- | -| 🛑 | Function can modify state | -| 💵 | Function is payable | - -## API for Ethereum - -This section describes the Ethereum API of CreditEvents Module. - -### Functions - -#### `setCreditEvents(bool,bool,string)` - -##### Definition: - -```solidity -function setCreditEvents(bool flagDefault_,bool flagRedeemed_,string memory rating_) -public onlyRole(DEBT_CREDIT_EVENT_ROLE) -``` - -##### Description: - -Set the optional Credit Events with the different parameters. -Only authorized users are allowed to call this function. - -#### `setFlagDefault(bool flagDefault_)` - -##### Definition: - -```solidity -function setFlagDefault(bool flagDefault_) -public onlyRole(DEBT_CREDIT_EVENT_ROLE) -``` - -##### Description: - -Set the optional `flagDefault` to the given `flagDefault_`. -Only authorized users are allowed to call this function. - -#### `setFlagRedeemed (bool)` - -##### Definition: - -```solidity -function setFlagRedeemed(bool flagRedeemed_) -public onlyRole(DEBT_CREDIT_EVENT_ROLE) -``` - -##### Description: - -Set the optional `flagRedeemed` to the given `flagRedeemed`. -Only authorized users are allowed to call this function. - -#### `setRating(string)` - -##### Definition: - -```solidity -function setRating(string memory rating_) -public onlyRole(DEBT_CREDIT_EVENT_ROLE) -``` - -##### Description: - -Set the optional attribute `rating` to the given `rating_`. -Only authorized users are allowed to call this function. - - - -### Events - -#### ` FlagDefault(bool` - -##### Definition: - -```solidity -event FlagDefault(bool indexed newFlagDefault) -``` - -##### Description: - -Emitted when the attribute `flagDefault` is set. - -#### `FlagRedeemed(bool)` - -##### Definition: - -```solidity -event FlagRedeemed(bool indexed newFlagRedeemed) -``` - -##### Description: - -Emitted when the attribute `flagRedeemed` is set. - -#### `Rating(string, string)` - -##### Definition: - -```solidity -event Rating(string indexed newRatingIndexed, string newRating) -``` - -##### Description: - -Emitted when the attribute `rating` is set. diff --git a/doc/modules/presentation/extensions/Debt/debtBase.md b/doc/modules/presentation/extensions/Debt/debtBase.md deleted file mode 100644 index 6537d330..00000000 --- a/doc/modules/presentation/extensions/Debt/debtBase.md +++ /dev/null @@ -1,425 +0,0 @@ -# DebtBase Module - -This document defines DebtBase Module for the CMTA Token specification. - -[TOC] - -## Schema - -### Inheritance - -![surya_inheritance_DebtBaseModule.sol](../../../../schema/surya_inheritance/surya_inheritance_DebtBaseModule.sol.png) - - - -### UML - -![DebtBaseModule](../../../../schema/sol2uml/DebtBaseModule.svg) - -### Graph - -![surya_graph_DebtBaseModule.sol](../../../../schema/surya_graph/surya_graph_DebtBaseModule.sol.png) - -## Sūrya's Description Report - -### Files Description Table - - -| File Name | SHA-1 Hash | -| ---------------------------------------------------------- | ---------------------------------------- | -| ./modules/wrapper/extensions/DebtModule/DebtBaseModule.sol | c01d4bc33e2e5531cf1a9800eff532a38f07b674 | - - -### Contracts Description Table - - -| Contract | Type | Bases | | | -| :----------------: | :-----------------------------: | :----------------------------------------------------------: | :------------: | :--------------: | -| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | -| | | | | | -| **DebtBaseModule** | Implementation | IDebtGlobal, Initializable, ContextUpgradeable, AuthorizationModule | | | -| └ | __DebtBaseModule_init_unchained | Internal 🔒 | 🛑 | onlyInitializing | -| └ | setDebt | Public ❗️ | 🛑 | onlyRole | -| └ | setInterestRate | Public ❗️ | 🛑 | onlyRole | -| └ | setParValue | Public ❗️ | 🛑 | onlyRole | -| └ | setGuarantor | Public ❗️ | 🛑 | onlyRole | -| └ | setBondHolder | Public ❗️ | 🛑 | onlyRole | -| └ | setMaturityDate | Public ❗️ | 🛑 | onlyRole | -| └ | setInterestScheduleFormat | Public ❗️ | 🛑 | onlyRole | -| └ | setInterestPaymentDate | Public ❗️ | 🛑 | onlyRole | -| └ | setDayCountConvention | Public ❗️ | 🛑 | onlyRole | -| └ | setBusinessDayConvention | Public ❗️ | 🛑 | onlyRole | -| └ | setPublicHolidaysCalendar | Public ❗️ | 🛑 | onlyRole | -| └ | setIssuanceDate | Public ❗️ | 🛑 | onlyRole | -| └ | setCouponFrequency | Public ❗️ | 🛑 | onlyRole | - - -### Legend - -| Symbol | Meaning | -| :----: | ------------------------- | -| 🛑 | Function can modify state | -| 💵 | Function is payable | - -## API for Ethereum - -This section describes the Ethereum API of Debt Module. - -### Functions - -#### `setDebt((uint256,uint256,string,string,string,string,string,string,string,string))` - -##### Definition: - -```solidity -function setDebt(DebtBase memory debt_) -public onlyRole(DEBT_ROLE) -``` - -##### Description: - -Set the optional Debt with the different parameters. -Only authorized users are allowed to call this function. - -#### `setInterestRate(uint256)` - -##### Definition: - -```solidity -function setInterestRate(uint256 interestRate_) -public onlyRole(DEBT_ROLE) -``` - -##### Description: - -Set the optional interest rate to the given `interestRate_`. -Only authorized users are allowed to call this function. - -#### `setParValue(uint256)` - -##### Definition: - -```solidity -function setParValue (uint256 parValue_) -public onlyRole(DEFAULT_ADMIN_ROLE) -``` - -##### Description: - -Set the optional `parValue` to the given `parValue_`. -Only authorized users are allowed to call this function. - -#### `setGuarantor(string)` - -##### Definition: - -```solidity -function setGuarantor (string memory guarantor_) -public onlyRole(DEFAULT_ADMIN_ROLE) -``` - -##### Description: - -Set the optional attribute `Guarantor` to the given `guarantor_`. -Only authorized users are allowed to call this function. - -#### `setBondHolder(string)` - -##### Definition: - -```solidity -function setBondHolder (string memory bondHolder_) -public onlyRole(DEFAULT_ADMIN_ROLE) -``` - -##### Description: - -Set the optional attribute `bondHolder` to the given `bondHolder_`. -Only authorized users are allowed to call this function. - -#### `setMaturityDate(string)` - -##### Definition: - -```solidity -function setMaturityDate (string memory maturityDate_) -public onlyRole(DEFAULT_ADMIN_ROLE) -``` - -##### Description: - -Set the optional attribute `maturityDate` to the given `maturityDate_`. -Only authorized users are allowed to call this function. - -#### `setInterestScheduleFormat(string)` - -##### Definition: - -```solidity -function setInterestScheduleFormat (string memory interestScheduleFormat_) -public onlyRole(DEFAULT_ADMIN_ROLE) -``` - -##### Description: - -Set the optional attribute `interestScheduleFormat` to the given `interestScheduleFormat_`. -Only authorized users are allowed to call this function. - -#### `setInterestPaymentDate(string)` - -##### Definition: - -```solidity -function setInterestPaymentDate (string memory interestPaymentDate_) -public onlyRole(DEFAULT_ADMIN_ROLE) -``` - -##### Description: - -Set the optional attribute `interestPaymentDate` to the given `interestPaymentDate_`. -Only authorized users are allowed to call this function. - -#### `setDayCountConvention(string)` - -##### Definition: - -```solidity -function setDayCountConvention (string memory dayCountConvention_) -public onlyRole(DEFAULT_ADMIN_ROLE) -``` - -##### Description: - -Set the optional attribute `dayCountConvention` to the given `interestPaymentDate_`. -Only authorized users are allowed to call this function. - -#### `setBusinessDayConvention(string)` - -##### Definition: - -```solidity -function setBusinessDayConvention (string memory businessDayConvention_) -public onlyRole(DEFAULT_ADMIN_ROLE) -``` - -##### Description: - -Set the optional attribute `businessDayConvention` to the given `businessDayConvention_`. -Only authorized users are allowed to call this function. - -#### ` setPublicHolidaysCalendar(string)` - -##### Definition: - -```solidity -function setPublicHolidaysCalendar(string memory publicHolidaysCalendar_) -public onlyRole(DEFAULT_ADMIN_ROLE) -``` - -##### Description: - -Set the optional attribute `publicHolidaysCalendar` to the given `publicHolidaysCalendar_`. -Only authorized users are allowed to call this function. - - - -#### ` setIssuanceDate(string) ` - -##### Definition: - -```solidity -function setIssuanceDate(string memory issuanceDate_) -``` - -##### Description: - -Set the optional attribute `issuanceDate` to the given `issuanceDate_`. -Only authorized users are allowed to call this function. - - - -#### ` setCouponFrequency(string)` - -##### Definition: - -```solidity -function setCouponFrequency(string memory couponFrequency_) -public onlyRole(DEBT_ROLE) -``` - -##### Description: - -Set the optional attribute `couponFrequency` to the given `couponFrequency_`. -Only authorized users are allowed to call this function. - -### Events - -#### `InterestRate(uint256)` - -##### Definition: - -```solidity -event InterestRate(uint256 newInterestRate) -``` - -##### Description: - -Emitted when the attribute `Interest Rate` is set. - -#### `ParValue(uint256)` - -##### Definition: - -```solidity -event ParValue(uint256 newParValue) -``` - -##### Description: - -Emitted when the attribute `ParValue` is set. - -#### `Guarantor(string, string)` - -##### Definition: - -```solidity -event Guarantor(string indexed newGuarantorIndexed, string newGuarantor) -``` - -##### Description: - -Emitted when the attribute `Guarantor` is set. - -#### `BondHolder(string,string)` - -##### Definition: - -```solidity -event BondHolder(string indexed newBondHolderIndexed, string newBondHolder) -``` - -##### Description: - -Emitted when the attribute `BondHolder` is set. - -#### `MaturityDate(string,string)` - -##### Definition: - -```solidity -event MaturityDate( - string indexed newMaturityDateIndexed, - string newMaturityDate -) -``` - -##### Description: - -Emitted when the attribute `maturityDate` is set. - -#### `InterestScheduleFormat(string,string)` - -##### Definition: - -```solidity -event InterestScheduleFormat( - string indexed newInterestScheduleFormatIndexed, - string newInterestScheduleFormat -) -``` - -##### Description: - -Emitted when the attribute `interestScheduleFormat` is set. - -#### `InterestPaymentDate(string,string)` - -##### Definition: - -```solidity - event InterestPaymentDate( - string indexed newInterestPaymentDateIndexed, - string newInterestPaymentDate -) -``` - -##### Description: - -Emitted when the attribute `interestPaymentDate` is set. - -#### `DayCountConvention(string,string)` - -##### Definition: - -```solidity -event DayCountConvention( - string indexed newDayCountConventionIndexed, - string newDayCountConvention -) -``` - -##### Description: - -Emitted when the attribute `DayCountConvention` is set. - -#### `BusinessDayConvention(string,string)` - -##### Definition: - -```solidity -event BusinessDayConvention( - string indexed newBusinessDayConventionIndexed, - string newBusinessDayConvention -) -``` - -##### Description: - -Emitted when the attribute `BusinessDayConvention` is set. - -#### `PublicHolidaysCalendar(string,string)` - -##### Definition: - -```solidity -event PublicHolidaysCalendar( - string indexed newPublicHolidaysCalendarIndexed, - string newPublicHolidaysCalendar -) -``` - -##### Description: - -Emitted when the attribute `PublicHolidaysCalendar` is set. - - - -#### `IssuanceDatee(string,string)` - -##### Definition: - -```solidity -event IssuanceDate( - string indexed newIssuanceDateIndexed, - string newIssuanceDate -) -``` - -##### Description: - -Emitted when the attribute `issuanceDate` is set. - -#### `CouponFrequency(string,string)` - -##### Definition: - -```solidity -event CouponFrequency( - string indexed newCouponFrequencyIndexed, - string newCouponFrequency -) -``` - -##### Description: - -Emitted when the attribute `couponFrequency` is set. diff --git a/doc/modules/presentation/extensions/debt.md b/doc/modules/presentation/extensions/debt.md new file mode 100644 index 00000000..cefa4e6f --- /dev/null +++ b/doc/modules/presentation/extensions/debt.md @@ -0,0 +1,58 @@ +# Debt Module + +This document defines Debt Module for the CMTA Token specification. + +[TOC] + +## Schema + +### Inheritance + +![surya_inheritance_DebtBaseModule.sol](../../../schema/surya_inheritance/surya_inheritance_DebtModule.sol.png) + + + + + +### Graph + +![surya_graph_DebtBaseModule.sol](../../../schema/surya_graph/surya_graph_DebtModule.sol.png) + +## Sūrya's Description Report + +### Files Description Table + + +| File Name | SHA-1 Hash | +| ------------------------------------------- | ---------------- | +| ./modules/wrapper/extensions/DebtModule.sol | [object Promise] | + + +### Contracts Description Table + + +| Contract | Type | Bases | | | +| :------------: | :-------------------------: | :------------------------------: | :------------: | :--------------: | +| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | +| | | | | | +| **DebtModule** | Implementation | AuthorizationModule, IDebtEngine | | | +| └ | __DebtModule_init_unchained | Internal 🔒 | 🛑 | onlyInitializing | +| └ | debtEngine | Public ❗️ | | NO❗️ | +| └ | setDebtEngine | External ❗️ | 🛑 | onlyRole | +| └ | debt | Public ❗️ | | NO❗️ | +| └ | creditEvents | Public ❗️ | | NO❗️ | +| └ | _getDebtModuleStorage | Private 🔐 | | | + + +### Legend + +| Symbol | Meaning | +| :----: | ------------------------- | +| 🛑 | Function can modify state | +| 💵 | Function is payable | + +## API for Ethereum + +This section describes the Ethereum API of Debt Module. + + diff --git a/doc/modules/presentation/extensions/document.md b/doc/modules/presentation/extensions/document.md new file mode 100644 index 00000000..8e96a151 --- /dev/null +++ b/doc/modules/presentation/extensions/document.md @@ -0,0 +1,54 @@ +# Document Module + +This document defines Document Module for the CMTA Token specification. + +[TOC] + +## Schema + +### Inheritance + +![surya_inheritance_DebtBaseModule.sol](../../../schema/surya_inheritance/surya_inheritance_DocumentModule.sol.png) + + + + + +### Graph + +![surya_graph_DebtBaseModule.sol](../../../schema/surya_graph/surya_graph_DocumentModule.sol.png) + +## Sūrya's Description Report + +| | [object Promise] | +| ---- | ---------------- | + + +### Contracts Description Table + + +| Contract | Type | Bases | | | +| :----------------: | :-----------------------------: | :---------------------------: | :------------: | :--------------: | +| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | +| | | | | | +| **DocumentModule** | Implementation | AuthorizationModule, IERC1643 | | | +| └ | __DocumentModule_init_unchained | Internal 🔒 | 🛑 | onlyInitializing | +| └ | documentEngine | Public ❗️ | | NO❗️ | +| └ | setDocumentEngine | External ❗️ | 🛑 | onlyRole | +| └ | getDocument | Public ❗️ | | NO❗️ | +| └ | getAllDocuments | Public ❗️ | | NO❗️ | +| └ | _getDocumentModuleStorage | Private 🔐 | | | + + +### Legend + +| Symbol | Meaning | +| :----: | ------------------------- | +| 🛑 | Function can modify state | +| 💵 | Function is payable | + +## API for Ethereum + +This section describes the Ethereum API of Document Module. + + diff --git a/doc/modules/specification.odt b/doc/modules/specification.odt deleted file mode 100644 index 596d5156..00000000 Binary files a/doc/modules/specification.odt and /dev/null differ diff --git a/doc/modules/specification.pdf b/doc/modules/specification.pdf deleted file mode 100644 index 921ad7a1..00000000 Binary files a/doc/modules/specification.pdf and /dev/null differ diff --git a/doc/schema/drawio/Engine-Engine.drawio.png b/doc/schema/drawio/Engine-Engine.drawio.png new file mode 100644 index 00000000..32a1600d Binary files /dev/null and b/doc/schema/drawio/Engine-Engine.drawio.png differ diff --git a/doc/schema/drawio/Engine.drawio b/doc/schema/drawio/Engine.drawio index fff92e67..69cea1aa 100644 --- a/doc/schema/drawio/Engine.drawio +++ b/doc/schema/drawio/Engine.drawio @@ -1 +1 @@ -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 \ No newline at end of file +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 \ No newline at end of file diff --git a/doc/schema/drawio/architecture.drawio b/doc/schema/drawio/architecture.drawio index f8517718..13b92569 100644 --- a/doc/schema/drawio/architecture.drawio +++ b/doc/schema/drawio/architecture.drawio @@ -1 +1 @@ -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 \ No newline at end of file +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 \ No newline at end of file diff --git a/doc/schema/drawio/architecture.pdf b/doc/schema/drawio/architecture.pdf index 5341b3dd..c22d31fe 100644 Binary files a/doc/schema/drawio/architecture.pdf and b/doc/schema/drawio/architecture.pdf differ diff --git a/doc/schema/surya_graph/surya_graph_AuthorizationModule.sol.png b/doc/schema/surya_graph/surya_graph_AuthorizationModule.sol.png index b3554ad9..c61cff42 100644 Binary files a/doc/schema/surya_graph/surya_graph_AuthorizationModule.sol.png and b/doc/schema/surya_graph/surya_graph_AuthorizationModule.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_BaseModule.sol.png b/doc/schema/surya_graph/surya_graph_BaseModule.sol.png index c08b1b0a..7a835183 100644 Binary files a/doc/schema/surya_graph/surya_graph_BaseModule.sol.png and b/doc/schema/surya_graph/surya_graph_BaseModule.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_CMTATFactoryBase.sol.png b/doc/schema/surya_graph/surya_graph_CMTATFactoryBase.sol.png new file mode 100644 index 00000000..5821ed67 Binary files /dev/null and b/doc/schema/surya_graph/surya_graph_CMTATFactoryBase.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_CMTATFactoryInvariant.sol.png b/doc/schema/surya_graph/surya_graph_CMTATFactoryInvariant.sol.png new file mode 100644 index 00000000..e166f8f3 Binary files /dev/null and b/doc/schema/surya_graph/surya_graph_CMTATFactoryInvariant.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_CMTATFactoryRoot.sol.png b/doc/schema/surya_graph/surya_graph_CMTATFactoryRoot.sol.png new file mode 100644 index 00000000..8df73d37 Binary files /dev/null and b/doc/schema/surya_graph/surya_graph_CMTATFactoryRoot.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_CMTAT_BASE.sol.png b/doc/schema/surya_graph/surya_graph_CMTAT_BASE.sol.png index 104a1df4..13cfbe85 100644 Binary files a/doc/schema/surya_graph/surya_graph_CMTAT_BASE.sol.png and b/doc/schema/surya_graph/surya_graph_CMTAT_BASE.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_CMTAT_BEACON_FACTORY.sol.png b/doc/schema/surya_graph/surya_graph_CMTAT_BEACON_FACTORY.sol.png index 08c9b54d..c965fcfe 100644 Binary files a/doc/schema/surya_graph/surya_graph_CMTAT_BEACON_FACTORY.sol.png and b/doc/schema/surya_graph/surya_graph_CMTAT_BEACON_FACTORY.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_CMTAT_PROXY_TEST.sol.png b/doc/schema/surya_graph/surya_graph_CMTAT_PROXY_TEST.sol.png new file mode 100644 index 00000000..b374077c Binary files /dev/null and b/doc/schema/surya_graph/surya_graph_CMTAT_PROXY_TEST.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_CMTAT_PROXY_TEST_UUPS.sol.png b/doc/schema/surya_graph/surya_graph_CMTAT_PROXY_TEST_UUPS.sol.png new file mode 100644 index 00000000..94abfa91 Binary files /dev/null and b/doc/schema/surya_graph/surya_graph_CMTAT_PROXY_TEST_UUPS.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_CMTAT_PROXY_UUPS.sol.png b/doc/schema/surya_graph/surya_graph_CMTAT_PROXY_UUPS.sol.png new file mode 100644 index 00000000..0210229a Binary files /dev/null and b/doc/schema/surya_graph/surya_graph_CMTAT_PROXY_UUPS.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_CMTAT_TP_FACTORY.sol.png b/doc/schema/surya_graph/surya_graph_CMTAT_TP_FACTORY.sol.png index 4216bf65..17e74068 100644 Binary files a/doc/schema/surya_graph/surya_graph_CMTAT_TP_FACTORY.sol.png and b/doc/schema/surya_graph/surya_graph_CMTAT_TP_FACTORY.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_CMTAT_UUPS_FACTORY.sol.png b/doc/schema/surya_graph/surya_graph_CMTAT_UUPS_FACTORY.sol.png new file mode 100644 index 00000000..41976837 Binary files /dev/null and b/doc/schema/surya_graph/surya_graph_CMTAT_UUPS_FACTORY.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_CreditEventsModule.sol.png b/doc/schema/surya_graph/surya_graph_CreditEventsModule.sol.png deleted file mode 100644 index 963b7745..00000000 Binary files a/doc/schema/surya_graph/surya_graph_CreditEventsModule.sol.png and /dev/null differ diff --git a/doc/schema/surya_graph/surya_graph_DebtBaseModule.sol.png b/doc/schema/surya_graph/surya_graph_DebtBaseModule.sol.png deleted file mode 100644 index 8789d43b..00000000 Binary files a/doc/schema/surya_graph/surya_graph_DebtBaseModule.sol.png and /dev/null differ diff --git a/doc/schema/surya_graph/surya_graph_DebtEngineMock.sol.png b/doc/schema/surya_graph/surya_graph_DebtEngineMock.sol.png new file mode 100644 index 00000000..33dd080a Binary files /dev/null and b/doc/schema/surya_graph/surya_graph_DebtEngineMock.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_DebtModule.sol.png b/doc/schema/surya_graph/surya_graph_DebtModule.sol.png new file mode 100644 index 00000000..169445a9 Binary files /dev/null and b/doc/schema/surya_graph/surya_graph_DebtModule.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_DocumentEngineMock.sol.png b/doc/schema/surya_graph/surya_graph_DocumentEngineMock.sol.png new file mode 100644 index 00000000..5c9dda85 Binary files /dev/null and b/doc/schema/surya_graph/surya_graph_DocumentEngineMock.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_DocumentModule.sol.png b/doc/schema/surya_graph/surya_graph_DocumentModule.sol.png new file mode 100644 index 00000000..6c80a1ef Binary files /dev/null and b/doc/schema/surya_graph/surya_graph_DocumentModule.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_ERC20BaseModule.sol.png b/doc/schema/surya_graph/surya_graph_ERC20BaseModule.sol.png index c03f7979..e39dac19 100644 Binary files a/doc/schema/surya_graph/surya_graph_ERC20BaseModule.sol.png and b/doc/schema/surya_graph/surya_graph_ERC20BaseModule.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_ERC20SnapshotModuleInternal.sol.png b/doc/schema/surya_graph/surya_graph_ERC20SnapshotModuleInternal.sol.png index 0ff8bd8b..87447d48 100644 Binary files a/doc/schema/surya_graph/surya_graph_ERC20SnapshotModuleInternal.sol.png and b/doc/schema/surya_graph/surya_graph_ERC20SnapshotModuleInternal.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_EnforcementModuleInternal.sol.png b/doc/schema/surya_graph/surya_graph_EnforcementModuleInternal.sol.png index 79822629..4d28a0d9 100644 Binary files a/doc/schema/surya_graph/surya_graph_EnforcementModuleInternal.sol.png and b/doc/schema/surya_graph/surya_graph_EnforcementModuleInternal.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_ICMTATConstructor.sol.png b/doc/schema/surya_graph/surya_graph_ICMTATConstructor.sol.png new file mode 100644 index 00000000..e166f8f3 Binary files /dev/null and b/doc/schema/surya_graph/surya_graph_ICMTATConstructor.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_IDebtEngine.sol.png b/doc/schema/surya_graph/surya_graph_IDebtEngine.sol.png new file mode 100644 index 00000000..46bd805e Binary files /dev/null and b/doc/schema/surya_graph/surya_graph_IDebtEngine.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_PauseModule.sol.png b/doc/schema/surya_graph/surya_graph_PauseModule.sol.png index ce31fcc6..2b4a91b4 100644 Binary files a/doc/schema/surya_graph/surya_graph_PauseModule.sol.png and b/doc/schema/surya_graph/surya_graph_PauseModule.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_SnapshotModuleBase.sol.png b/doc/schema/surya_graph/surya_graph_SnapshotModuleBase.sol.png index de827397..458e3a19 100644 Binary files a/doc/schema/surya_graph/surya_graph_SnapshotModuleBase.sol.png and b/doc/schema/surya_graph/surya_graph_SnapshotModuleBase.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_ValidationModule.sol.png b/doc/schema/surya_graph/surya_graph_ValidationModule.sol.png index 44cfd313..ab13dcca 100644 Binary files a/doc/schema/surya_graph/surya_graph_ValidationModule.sol.png and b/doc/schema/surya_graph/surya_graph_ValidationModule.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_ValidationModuleInternal.sol.png b/doc/schema/surya_graph/surya_graph_ValidationModuleInternal.sol.png index 986159da..d8c9a076 100644 Binary files a/doc/schema/surya_graph/surya_graph_ValidationModuleInternal.sol.png and b/doc/schema/surya_graph/surya_graph_ValidationModuleInternal.sol.png differ diff --git a/doc/schema/surya_graph/surya_graph_draft-IERC1643.sol.png b/doc/schema/surya_graph/surya_graph_draft-IERC1643.sol.png new file mode 100644 index 00000000..bd3df10e Binary files /dev/null and b/doc/schema/surya_graph/surya_graph_draft-IERC1643.sol.png differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_CMTATFactoryBase.sol.png b/doc/schema/surya_inheritance/surya_inheritance_CMTATFactoryBase.sol.png new file mode 100644 index 00000000..44f26bde Binary files /dev/null and b/doc/schema/surya_inheritance/surya_inheritance_CMTATFactoryBase.sol.png differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_CMTATFactoryInvariant.sol.png b/doc/schema/surya_inheritance/surya_inheritance_CMTATFactoryInvariant.sol.png new file mode 100644 index 00000000..e1bea6d2 Binary files /dev/null and b/doc/schema/surya_inheritance/surya_inheritance_CMTATFactoryInvariant.sol.png differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_CMTATFactoryRoot.sol.png b/doc/schema/surya_inheritance/surya_inheritance_CMTATFactoryRoot.sol.png new file mode 100644 index 00000000..235a7df0 Binary files /dev/null and b/doc/schema/surya_inheritance/surya_inheritance_CMTATFactoryRoot.sol.png differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_CMTAT_BASE.sol.png b/doc/schema/surya_inheritance/surya_inheritance_CMTAT_BASE.sol.png index 90314a89..e2870733 100644 Binary files a/doc/schema/surya_inheritance/surya_inheritance_CMTAT_BASE.sol.png and b/doc/schema/surya_inheritance/surya_inheritance_CMTAT_BASE.sol.png differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_CMTAT_BEACON_FACTORY.sol.png b/doc/schema/surya_inheritance/surya_inheritance_CMTAT_BEACON_FACTORY.sol.png index 4baba5eb..055bfb56 100644 Binary files a/doc/schema/surya_inheritance/surya_inheritance_CMTAT_BEACON_FACTORY.sol.png and b/doc/schema/surya_inheritance/surya_inheritance_CMTAT_BEACON_FACTORY.sol.png differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_CMTAT_PROXY_TEST.sol.png b/doc/schema/surya_inheritance/surya_inheritance_CMTAT_PROXY_TEST.sol.png new file mode 100644 index 00000000..b6f1e95e Binary files /dev/null and b/doc/schema/surya_inheritance/surya_inheritance_CMTAT_PROXY_TEST.sol.png differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_CMTAT_PROXY_TEST_UUPS.sol.png b/doc/schema/surya_inheritance/surya_inheritance_CMTAT_PROXY_TEST_UUPS.sol.png new file mode 100644 index 00000000..28cfaa0e Binary files /dev/null and b/doc/schema/surya_inheritance/surya_inheritance_CMTAT_PROXY_TEST_UUPS.sol.png differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_CMTAT_PROXY_UUPS.sol.png b/doc/schema/surya_inheritance/surya_inheritance_CMTAT_PROXY_UUPS.sol.png new file mode 100644 index 00000000..a485830f Binary files /dev/null and b/doc/schema/surya_inheritance/surya_inheritance_CMTAT_PROXY_UUPS.sol.png differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_CMTAT_TP_FACTORY.sol.png b/doc/schema/surya_inheritance/surya_inheritance_CMTAT_TP_FACTORY.sol.png index 8410d514..251f7a14 100644 Binary files a/doc/schema/surya_inheritance/surya_inheritance_CMTAT_TP_FACTORY.sol.png and b/doc/schema/surya_inheritance/surya_inheritance_CMTAT_TP_FACTORY.sol.png differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_CMTAT_UUPS_FACTORY.sol.png b/doc/schema/surya_inheritance/surya_inheritance_CMTAT_UUPS_FACTORY.sol.png new file mode 100644 index 00000000..e7547b3d Binary files /dev/null and b/doc/schema/surya_inheritance/surya_inheritance_CMTAT_UUPS_FACTORY.sol.png differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_CreditEventsModule.sol.png b/doc/schema/surya_inheritance/surya_inheritance_CreditEventsModule.sol.png deleted file mode 100644 index 9ab297a7..00000000 Binary files a/doc/schema/surya_inheritance/surya_inheritance_CreditEventsModule.sol.png and /dev/null differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_DebtBaseModule.sol.png b/doc/schema/surya_inheritance/surya_inheritance_DebtBaseModule.sol.png deleted file mode 100644 index 7377f75e..00000000 Binary files a/doc/schema/surya_inheritance/surya_inheritance_DebtBaseModule.sol.png and /dev/null differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_DebtEngineMock.sol.png b/doc/schema/surya_inheritance/surya_inheritance_DebtEngineMock.sol.png new file mode 100644 index 00000000..31bfa30b Binary files /dev/null and b/doc/schema/surya_inheritance/surya_inheritance_DebtEngineMock.sol.png differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_DebtModule.sol.png b/doc/schema/surya_inheritance/surya_inheritance_DebtModule.sol.png new file mode 100644 index 00000000..0935aff0 Binary files /dev/null and b/doc/schema/surya_inheritance/surya_inheritance_DebtModule.sol.png differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_DocumentEngineMock.sol.png b/doc/schema/surya_inheritance/surya_inheritance_DocumentEngineMock.sol.png new file mode 100644 index 00000000..820c4364 Binary files /dev/null and b/doc/schema/surya_inheritance/surya_inheritance_DocumentEngineMock.sol.png differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_DocumentModule.sol.png b/doc/schema/surya_inheritance/surya_inheritance_DocumentModule.sol.png new file mode 100644 index 00000000..425a8047 Binary files /dev/null and b/doc/schema/surya_inheritance/surya_inheritance_DocumentModule.sol.png differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_ICMTATConstructor.sol.png b/doc/schema/surya_inheritance/surya_inheritance_ICMTATConstructor.sol.png new file mode 100644 index 00000000..6dd1cbaf Binary files /dev/null and b/doc/schema/surya_inheritance/surya_inheritance_ICMTATConstructor.sol.png differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_IDebtEngine.sol.png b/doc/schema/surya_inheritance/surya_inheritance_IDebtEngine.sol.png new file mode 100644 index 00000000..fcd31e49 Binary files /dev/null and b/doc/schema/surya_inheritance/surya_inheritance_IDebtEngine.sol.png differ diff --git a/doc/schema/surya_inheritance/surya_inheritance_draft-IERC1643.sol.png b/doc/schema/surya_inheritance/surya_inheritance_draft-IERC1643.sol.png new file mode 100644 index 00000000..a1730e7d Binary files /dev/null and b/doc/schema/surya_inheritance/surya_inheritance_draft-IERC1643.sol.png differ diff --git a/doc/schema/surya_report/surya_report_AuthorizationModule.sol.md b/doc/schema/surya_report/surya_report_AuthorizationModule.sol.md index adf2e5d7..46e38818 100644 --- a/doc/schema/surya_report/surya_report_AuthorizationModule.sol.md +++ b/doc/schema/surya_report/surya_report_AuthorizationModule.sol.md @@ -17,10 +17,12 @@ |||||| | **AuthorizationModule** | Implementation | AccessControlUpgradeable ||| | └ | __AuthorizationModule_init_unchained | Internal 🔒 | 🛑 | onlyInitializing | +| └ | authorizationEngine | Public ❗️ | |NO❗️ | | └ | setAuthorizationEngine | External ❗️ | 🛑 | onlyRole | | └ | grantRole | Public ❗️ | 🛑 | onlyRole | | └ | revokeRole | Public ❗️ | 🛑 | onlyRole | | └ | hasRole | Public ❗️ | |NO❗️ | +| └ | _getAuthorizationModuleStorage | Private 🔐 | | | ### Legend diff --git a/doc/schema/surya_report/surya_report_BaseModule.sol.md b/doc/schema/surya_report/surya_report_BaseModule.sol.md index 0d5ddc97..743074f3 100644 --- a/doc/schema/surya_report/surya_report_BaseModule.sol.md +++ b/doc/schema/surya_report/surya_report_BaseModule.sol.md @@ -17,10 +17,13 @@ |||||| | **BaseModule** | Implementation | AuthorizationModule ||| | └ | __Base_init_unchained | Internal 🔒 | 🛑 | onlyInitializing | +| └ | tokenId | Public ❗️ | |NO❗️ | +| └ | terms | Public ❗️ | |NO❗️ | +| └ | information | Public ❗️ | |NO❗️ | | └ | setTokenId | Public ❗️ | 🛑 | onlyRole | | └ | setTerms | Public ❗️ | 🛑 | onlyRole | | └ | setInformation | Public ❗️ | 🛑 | onlyRole | -| └ | setFlag | Public ❗️ | 🛑 | onlyRole | +| └ | _getBaseModuleStorage | Private 🔐 | | | ### Legend diff --git a/doc/schema/surya_report/surya_report_CreditEventsModule.sol.md b/doc/schema/surya_report/surya_report_CMTATFactoryBase.sol.md similarity index 53% rename from doc/schema/surya_report/surya_report_CreditEventsModule.sol.md rename to doc/schema/surya_report/surya_report_CMTATFactoryBase.sol.md index 0bd91c66..bc5bbf6a 100644 --- a/doc/schema/surya_report/surya_report_CreditEventsModule.sol.md +++ b/doc/schema/surya_report/surya_report_CMTATFactoryBase.sol.md @@ -5,7 +5,7 @@ | File Name | SHA-1 Hash | |-------------|--------------| -| ./modules/wrapper/extensions/DebtModule/CreditEventsModule.sol | [object Promise] | +| ./deployment/libraries/CMTATFactoryBase.sol | [object Promise] | ### Contracts Description Table @@ -15,12 +15,8 @@ |:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| | └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | |||||| -| **CreditEventsModule** | Implementation | IDebtGlobal, Initializable, ContextUpgradeable, AuthorizationModule ||| -| └ | __CreditEvents_init_unchained | Internal 🔒 | 🛑 | onlyInitializing | -| └ | setCreditEvents | Public ❗️ | 🛑 | onlyRole | -| └ | setFlagDefault | Public ❗️ | 🛑 | onlyRole | -| └ | setFlagRedeemed | Public ❗️ | 🛑 | onlyRole | -| └ | setRating | Public ❗️ | 🛑 | onlyRole | +| **CMTATFactoryBase** | Implementation | CMTATFactoryRoot ||| +| └ | | Public ❗️ | 🛑 | CMTATFactoryRoot | ### Legend diff --git a/doc/schema/surya_report/surya_report_CMTATFactoryInvariant.sol.md b/doc/schema/surya_report/surya_report_CMTATFactoryInvariant.sol.md new file mode 100644 index 00000000..cb6784c3 --- /dev/null +++ b/doc/schema/surya_report/surya_report_CMTATFactoryInvariant.sol.md @@ -0,0 +1,26 @@ +## Sūrya's Description Report + +### Files Description Table + + +| File Name | SHA-1 Hash | +|-------------|--------------| +| ./deployment/libraries/CMTATFactoryInvariant.sol | [object Promise] | + + +### Contracts Description Table + + +| Contract | Type | Bases | | | +|:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| +| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | +|||||| +| **CMTATFactoryInvariant** | Implementation | ||| + + +### Legend + +| Symbol | Meaning | +|:--------:|-----------| +| 🛑 | Function can modify state | +| 💵 | Function is payable | diff --git a/doc/schema/surya_report/surya_report_CMTATFactoryRoot.sol.md b/doc/schema/surya_report/surya_report_CMTATFactoryRoot.sol.md new file mode 100644 index 00000000..c75672d1 --- /dev/null +++ b/doc/schema/surya_report/surya_report_CMTATFactoryRoot.sol.md @@ -0,0 +1,29 @@ +## Sūrya's Description Report + +### Files Description Table + + +| File Name | SHA-1 Hash | +|-------------|--------------| +| ./deployment/libraries/CMTATFactoryRoot.sol | [object Promise] | + + +### Contracts Description Table + + +| Contract | Type | Bases | | | +|:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| +| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | +|||||| +| **CMTATFactoryRoot** | Implementation | AccessControl, CMTATFactoryInvariant ||| +| └ | | Public ❗️ | 🛑 |NO❗️ | +| └ | CMTATProxyAddress | External ❗️ | |NO❗️ | +| └ | _checkAndDetermineDeploymentSalt | Internal 🔒 | 🛑 | | + + +### Legend + +| Symbol | Meaning | +|:--------:|-----------| +| 🛑 | Function can modify state | +| 💵 | Function is payable | diff --git a/doc/schema/surya_report/surya_report_CMTAT_BASE.sol.md b/doc/schema/surya_report/surya_report_CMTAT_BASE.sol.md index 0caa1c3b..bc34fa5e 100644 --- a/doc/schema/surya_report/surya_report_CMTAT_BASE.sol.md +++ b/doc/schema/surya_report/surya_report_CMTAT_BASE.sol.md @@ -15,7 +15,7 @@ |:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| | └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | |||||| -| **CMTAT_BASE** | Implementation | Initializable, ContextUpgradeable, BaseModule, PauseModule, ERC20MintModule, ERC20BurnModule, EnforcementModule, ValidationModule, MetaTxModule, ERC20BaseModule, ERC20SnapshotModule, DebtBaseModule, CreditEventsModule ||| +| **CMTAT_BASE** | Implementation | Initializable, ContextUpgradeable, BaseModule, PauseModule, ERC20MintModule, ERC20BurnModule, EnforcementModule, ValidationModule, ERC20BaseModule, MetaTxModule, ERC20SnapshotModule, DebtModule, DocumentModule ||| | └ | initialize | Public ❗️ | 🛑 | initializer | | └ | __CMTAT_init | Internal 🔒 | 🛑 | onlyInitializing | | └ | __CMTAT_init_unchained | Internal 🔒 | 🛑 | onlyInitializing | diff --git a/doc/schema/surya_report/surya_report_CMTAT_BEACON_FACTORY.sol.md b/doc/schema/surya_report/surya_report_CMTAT_BEACON_FACTORY.sol.md index ab277d58..8ee6ed86 100644 --- a/doc/schema/surya_report/surya_report_CMTAT_BEACON_FACTORY.sol.md +++ b/doc/schema/surya_report/surya_report_CMTAT_BEACON_FACTORY.sol.md @@ -15,10 +15,12 @@ |:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| | └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | |||||| -| **CMTAT_BEACON_FACTORY** | Implementation | AccessControl ||| -| └ | | Public ❗️ | 🛑 |NO❗️ | +| **CMTAT_BEACON_FACTORY** | Implementation | AccessControl, CMTATFactoryRoot ||| +| └ | | Public ❗️ | 🛑 | CMTATFactoryRoot | | └ | deployCMTAT | Public ❗️ | 🛑 | onlyRole | -| └ | getAddress | External ❗️ | |NO❗️ | +| └ | computedProxyAddress | Public ❗️ | |NO❗️ | +| └ | _deployBytecode | Internal 🔒 | 🛑 | | +| └ | _getBytecode | Internal 🔒 | | | | └ | implementation | Public ❗️ | |NO❗️ | diff --git a/doc/schema/surya_report/surya_report_CMTAT_PROXY_TEST.sol.md b/doc/schema/surya_report/surya_report_CMTAT_PROXY_TEST.sol.md new file mode 100644 index 00000000..ca1d9c3d --- /dev/null +++ b/doc/schema/surya_report/surya_report_CMTAT_PROXY_TEST.sol.md @@ -0,0 +1,27 @@ +## Sūrya's Description Report + +### Files Description Table + + +| File Name | SHA-1 Hash | +|-------------|--------------| +| ./test/proxy/CMTAT_PROXY_TEST.sol | [object Promise] | + + +### Contracts Description Table + + +| Contract | Type | Bases | | | +|:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| +| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | +|||||| +| **CMTAT_PROXY_TEST** | Implementation | CMTAT_PROXY ||| +| └ | | Public ❗️ | 🛑 | CMTAT_PROXY | + + +### Legend + +| Symbol | Meaning | +|:--------:|-----------| +| 🛑 | Function can modify state | +| 💵 | Function is payable | diff --git a/doc/schema/surya_report/surya_report_CMTAT_PROXY_TEST_UUPS.sol.md b/doc/schema/surya_report/surya_report_CMTAT_PROXY_TEST_UUPS.sol.md new file mode 100644 index 00000000..8edd408b --- /dev/null +++ b/doc/schema/surya_report/surya_report_CMTAT_PROXY_TEST_UUPS.sol.md @@ -0,0 +1,27 @@ +## Sūrya's Description Report + +### Files Description Table + + +| File Name | SHA-1 Hash | +|-------------|--------------| +| ./test/proxy/CMTAT_PROXY_TEST_UUPS.sol | [object Promise] | + + +### Contracts Description Table + + +| Contract | Type | Bases | | | +|:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| +| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | +|||||| +| **CMTAT_PROXY_TEST_UUPS** | Implementation | CMTAT_PROXY_UUPS ||| +| └ | | Public ❗️ | 🛑 | CMTAT_PROXY_UUPS | + + +### Legend + +| Symbol | Meaning | +|:--------:|-----------| +| 🛑 | Function can modify state | +| 💵 | Function is payable | diff --git a/doc/schema/surya_report/surya_report_CMTAT_PROXY_UUPS.sol.md b/doc/schema/surya_report/surya_report_CMTAT_PROXY_UUPS.sol.md new file mode 100644 index 00000000..d0780cbf --- /dev/null +++ b/doc/schema/surya_report/surya_report_CMTAT_PROXY_UUPS.sol.md @@ -0,0 +1,29 @@ +## Sūrya's Description Report + +### Files Description Table + + +| File Name | SHA-1 Hash | +|-------------|--------------| +| ./CMTAT_PROXY_UUPS.sol | [object Promise] | + + +### Contracts Description Table + + +| Contract | Type | Bases | | | +|:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| +| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | +|||||| +| **CMTAT_PROXY_UUPS** | Implementation | CMTAT_BASE, UUPSUpgradeable ||| +| └ | | Public ❗️ | 🛑 | MetaTxModule | +| └ | initialize | Public ❗️ | 🛑 | initializer | +| └ | _authorizeUpgrade | Internal 🔒 | 🛑 | onlyRole | + + +### Legend + +| Symbol | Meaning | +|:--------:|-----------| +| 🛑 | Function can modify state | +| 💵 | Function is payable | diff --git a/doc/schema/surya_report/surya_report_CMTAT_TP_FACTORY.sol.md b/doc/schema/surya_report/surya_report_CMTAT_TP_FACTORY.sol.md index 6c44769c..9a18a8b6 100644 --- a/doc/schema/surya_report/surya_report_CMTAT_TP_FACTORY.sol.md +++ b/doc/schema/surya_report/surya_report_CMTAT_TP_FACTORY.sol.md @@ -15,10 +15,12 @@ |:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| | └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | |||||| -| **CMTAT_TP_FACTORY** | Implementation | AccessControl ||| -| └ | | Public ❗️ | 🛑 |NO❗️ | +| **CMTAT_TP_FACTORY** | Implementation | CMTATFactoryInvariant, CMTATFactoryBase ||| +| └ | | Public ❗️ | 🛑 | CMTATFactoryBase | | └ | deployCMTAT | Public ❗️ | 🛑 | onlyRole | -| └ | getAddress | External ❗️ | |NO❗️ | +| └ | computedProxyAddress | Public ❗️ | |NO❗️ | +| └ | _deployBytecode | Internal 🔒 | 🛑 | | +| └ | _getBytecode | Internal 🔒 | | | ### Legend diff --git a/doc/schema/surya_report/surya_report_CMTAT_UUPS_FACTORY.sol.md b/doc/schema/surya_report/surya_report_CMTAT_UUPS_FACTORY.sol.md new file mode 100644 index 00000000..8628dcb2 --- /dev/null +++ b/doc/schema/surya_report/surya_report_CMTAT_UUPS_FACTORY.sol.md @@ -0,0 +1,31 @@ +## Sūrya's Description Report + +### Files Description Table + + +| File Name | SHA-1 Hash | +|-------------|--------------| +| ./deployment/CMTAT_UUPS_FACTORY.sol | [object Promise] | + + +### Contracts Description Table + + +| Contract | Type | Bases | | | +|:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| +| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | +|||||| +| **CMTAT_UUPS_FACTORY** | Implementation | CMTATFactoryInvariant, CMTATFactoryBase ||| +| └ | | Public ❗️ | 🛑 | CMTATFactoryBase | +| └ | deployCMTAT | Public ❗️ | 🛑 | onlyRole | +| └ | computedProxyAddress | Public ❗️ | |NO❗️ | +| └ | _deployBytecode | Internal 🔒 | 🛑 | | +| └ | _getBytecode | Internal 🔒 | | | + + +### Legend + +| Symbol | Meaning | +|:--------:|-----------| +| 🛑 | Function can modify state | +| 💵 | Function is payable | diff --git a/doc/schema/surya_report/surya_report_DebtBaseModule.sol.md b/doc/schema/surya_report/surya_report_DebtBaseModule.sol.md deleted file mode 100644 index 84444dd4..00000000 --- a/doc/schema/surya_report/surya_report_DebtBaseModule.sol.md +++ /dev/null @@ -1,40 +0,0 @@ -## Sūrya's Description Report - -### Files Description Table - - -| File Name | SHA-1 Hash | -|-------------|--------------| -| ./modules/wrapper/extensions/DebtModule/DebtBaseModule.sol | [object Promise] | - - -### Contracts Description Table - - -| Contract | Type | Bases | | | -|:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| -| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | -|||||| -| **DebtBaseModule** | Implementation | IDebtGlobal, Initializable, ContextUpgradeable, AuthorizationModule ||| -| └ | __DebtBaseModule_init_unchained | Internal 🔒 | 🛑 | onlyInitializing | -| └ | setDebt | Public ❗️ | 🛑 | onlyRole | -| └ | setInterestRate | Public ❗️ | 🛑 | onlyRole | -| └ | setParValue | Public ❗️ | 🛑 | onlyRole | -| └ | setGuarantor | Public ❗️ | 🛑 | onlyRole | -| └ | setBondHolder | Public ❗️ | 🛑 | onlyRole | -| └ | setMaturityDate | Public ❗️ | 🛑 | onlyRole | -| └ | setInterestScheduleFormat | Public ❗️ | 🛑 | onlyRole | -| └ | setInterestPaymentDate | Public ❗️ | 🛑 | onlyRole | -| └ | setDayCountConvention | Public ❗️ | 🛑 | onlyRole | -| └ | setBusinessDayConvention | Public ❗️ | 🛑 | onlyRole | -| └ | setPublicHolidaysCalendar | Public ❗️ | 🛑 | onlyRole | -| └ | setIssuanceDate | Public ❗️ | 🛑 | onlyRole | -| └ | setCouponFrequency | Public ❗️ | 🛑 | onlyRole | - - -### Legend - -| Symbol | Meaning | -|:--------:|-----------| -| 🛑 | Function can modify state | -| 💵 | Function is payable | diff --git a/doc/schema/surya_report/surya_report_DebtEngineMock.sol.md b/doc/schema/surya_report/surya_report_DebtEngineMock.sol.md new file mode 100644 index 00000000..85d7a637 --- /dev/null +++ b/doc/schema/surya_report/surya_report_DebtEngineMock.sol.md @@ -0,0 +1,34 @@ +## Sūrya's Description Report + +### Files Description Table + + +| File Name | SHA-1 Hash | +|-------------|--------------| +| ./mocks/DebtEngineMock.sol | [object Promise] | + + +### Contracts Description Table + + +| Contract | Type | Bases | | | +|:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| +| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | +|||||| +| **IDebtEngineMock** | Interface | IDebtEngine ||| +| └ | setDebt | External ❗️ | 🛑 |NO❗️ | +| └ | setCreditEvents | External ❗️ | 🛑 |NO❗️ | +|||||| +| **DebtEngineMock** | Implementation | IDebtEngineMock ||| +| └ | debt | External ❗️ | |NO❗️ | +| └ | creditEvents | External ❗️ | |NO❗️ | +| └ | setDebt | External ❗️ | 🛑 |NO❗️ | +| └ | setCreditEvents | External ❗️ | 🛑 |NO❗️ | + + +### Legend + +| Symbol | Meaning | +|:--------:|-----------| +| 🛑 | Function can modify state | +| 💵 | Function is payable | diff --git a/doc/schema/surya_report/surya_report_DebtModule.sol.md b/doc/schema/surya_report/surya_report_DebtModule.sol.md new file mode 100644 index 00000000..5fa1d369 --- /dev/null +++ b/doc/schema/surya_report/surya_report_DebtModule.sol.md @@ -0,0 +1,32 @@ +## Sūrya's Description Report + +### Files Description Table + + +| File Name | SHA-1 Hash | +|-------------|--------------| +| ./modules/wrapper/extensions/DebtModule.sol | [object Promise] | + + +### Contracts Description Table + + +| Contract | Type | Bases | | | +|:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| +| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | +|||||| +| **DebtModule** | Implementation | AuthorizationModule, IDebtEngine ||| +| └ | __DebtModule_init_unchained | Internal 🔒 | 🛑 | onlyInitializing | +| └ | debtEngine | Public ❗️ | |NO❗️ | +| └ | setDebtEngine | External ❗️ | 🛑 | onlyRole | +| └ | debt | Public ❗️ | |NO❗️ | +| └ | creditEvents | Public ❗️ | |NO❗️ | +| └ | _getDebtModuleStorage | Private 🔐 | | | + + +### Legend + +| Symbol | Meaning | +|:--------:|-----------| +| 🛑 | Function can modify state | +| 💵 | Function is payable | diff --git a/doc/schema/surya_report/surya_report_DocumentEngineMock.sol.md b/doc/schema/surya_report/surya_report_DocumentEngineMock.sol.md new file mode 100644 index 00000000..645f1795 --- /dev/null +++ b/doc/schema/surya_report/surya_report_DocumentEngineMock.sol.md @@ -0,0 +1,36 @@ +## Sūrya's Description Report + +### Files Description Table + + +| File Name | SHA-1 Hash | +|-------------|--------------| +| ./mocks/DocumentEngineMock.sol | [object Promise] | + + +### Contracts Description Table + + +| Contract | Type | Bases | | | +|:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| +| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | +|||||| +| **IERC1643Whole** | Interface | ||| +| └ | getDocument | External ❗️ | |NO❗️ | +| └ | setDocument | External ❗️ | 🛑 |NO❗️ | +| └ | removeDocument | External ❗️ | 🛑 |NO❗️ | +| └ | getAllDocuments | External ❗️ | |NO❗️ | +|||||| +| **DocumentEngineMock** | Implementation | IERC1643Whole ||| +| └ | getDocument | External ❗️ | |NO❗️ | +| └ | setDocument | External ❗️ | 🛑 |NO❗️ | +| └ | removeDocument | External ❗️ | 🛑 |NO❗️ | +| └ | getAllDocuments | External ❗️ | |NO❗️ | + + +### Legend + +| Symbol | Meaning | +|:--------:|-----------| +| 🛑 | Function can modify state | +| 💵 | Function is payable | diff --git a/doc/schema/surya_report/surya_report_DocumentModule.sol.md b/doc/schema/surya_report/surya_report_DocumentModule.sol.md new file mode 100644 index 00000000..750fe9c3 --- /dev/null +++ b/doc/schema/surya_report/surya_report_DocumentModule.sol.md @@ -0,0 +1,32 @@ +## Sūrya's Description Report + +### Files Description Table + + +| File Name | SHA-1 Hash | +|-------------|--------------| +| ./modules/wrapper/extensions/DocumentModule.sol | [object Promise] | + + +### Contracts Description Table + + +| Contract | Type | Bases | | | +|:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| +| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | +|||||| +| **DocumentModule** | Implementation | AuthorizationModule, IERC1643 ||| +| └ | __DocumentModule_init_unchained | Internal 🔒 | 🛑 | onlyInitializing | +| └ | documentEngine | Public ❗️ | |NO❗️ | +| └ | setDocumentEngine | External ❗️ | 🛑 | onlyRole | +| └ | getDocument | Public ❗️ | |NO❗️ | +| └ | getAllDocuments | Public ❗️ | |NO❗️ | +| └ | _getDocumentModuleStorage | Private 🔐 | | | + + +### Legend + +| Symbol | Meaning | +|:--------:|-----------| +| 🛑 | Function can modify state | +| 💵 | Function is payable | diff --git a/doc/schema/surya_report/surya_report_ERC20BaseModule.sol.md b/doc/schema/surya_report/surya_report_ERC20BaseModule.sol.md index 827eca45..0760f2a5 100644 --- a/doc/schema/surya_report/surya_report_ERC20BaseModule.sol.md +++ b/doc/schema/surya_report/surya_report_ERC20BaseModule.sol.md @@ -21,6 +21,7 @@ | └ | transferBatch | Public ❗️ | 🛑 |NO❗️ | | └ | transferFrom | Public ❗️ | 🛑 |NO❗️ | | └ | balanceInfo | Public ❗️ | |NO❗️ | +| └ | _getERC20BaseModuleStorage | Private 🔐 | | | ### Legend diff --git a/doc/schema/surya_report/surya_report_EnforcementModuleInternal.sol.md b/doc/schema/surya_report/surya_report_EnforcementModuleInternal.sol.md index 782a5d0e..42cf90f7 100644 --- a/doc/schema/surya_report/surya_report_EnforcementModuleInternal.sol.md +++ b/doc/schema/surya_report/surya_report_EnforcementModuleInternal.sol.md @@ -20,6 +20,7 @@ | └ | frozen | Public ❗️ | |NO❗️ | | └ | _freeze | Internal 🔒 | 🛑 | | | └ | _unfreeze | Internal 🔒 | 🛑 | | +| └ | _getEnforcementModuleInternalStorage | Private 🔐 | | | ### Legend diff --git a/doc/schema/surya_report/surya_report_ICMTATConstructor.sol.md b/doc/schema/surya_report/surya_report_ICMTATConstructor.sol.md new file mode 100644 index 00000000..1392f034 --- /dev/null +++ b/doc/schema/surya_report/surya_report_ICMTATConstructor.sol.md @@ -0,0 +1,26 @@ +## Sūrya's Description Report + +### Files Description Table + + +| File Name | SHA-1 Hash | +|-------------|--------------| +| ./interfaces/ICMTATConstructor.sol | [object Promise] | + + +### Contracts Description Table + + +| Contract | Type | Bases | | | +|:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| +| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | +|||||| +| **ICMTATConstructor** | Interface | ||| + + +### Legend + +| Symbol | Meaning | +|:--------:|-----------| +| 🛑 | Function can modify state | +| 💵 | Function is payable | diff --git a/doc/schema/surya_report/surya_report_IDebtEngine.sol.md b/doc/schema/surya_report/surya_report_IDebtEngine.sol.md new file mode 100644 index 00000000..bacc30be --- /dev/null +++ b/doc/schema/surya_report/surya_report_IDebtEngine.sol.md @@ -0,0 +1,28 @@ +## Sūrya's Description Report + +### Files Description Table + + +| File Name | SHA-1 Hash | +|-------------|--------------| +| ./interfaces/engine/IDebtEngine.sol | [object Promise] | + + +### Contracts Description Table + + +| Contract | Type | Bases | | | +|:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| +| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | +|||||| +| **IDebtEngine** | Interface | IDebtGlobal ||| +| └ | debt | External ❗️ | |NO❗️ | +| └ | creditEvents | External ❗️ | |NO❗️ | + + +### Legend + +| Symbol | Meaning | +|:--------:|-----------| +| 🛑 | Function can modify state | +| 💵 | Function is payable | diff --git a/doc/schema/surya_report/surya_report_PauseModule.sol.md b/doc/schema/surya_report/surya_report_PauseModule.sol.md index 4902d9b1..c199643c 100644 --- a/doc/schema/surya_report/surya_report_PauseModule.sol.md +++ b/doc/schema/surya_report/surya_report_PauseModule.sol.md @@ -21,6 +21,7 @@ | └ | unpause | Public ❗️ | 🛑 | onlyRole | | └ | deactivateContract | Public ❗️ | 🛑 | onlyRole | | └ | deactivated | Public ❗️ | |NO❗️ | +| └ | _getPauseModuleStorage | Private 🔐 | | | ### Legend diff --git a/doc/schema/surya_report/surya_report_SnapshotModuleBase.sol.md b/doc/schema/surya_report/surya_report_SnapshotModuleBase.sol.md index fc57e06a..befb7089 100644 --- a/doc/schema/surya_report/surya_report_SnapshotModuleBase.sol.md +++ b/doc/schema/surya_report/surya_report_SnapshotModuleBase.sol.md @@ -30,6 +30,10 @@ | └ | _lastSnapshot | Private 🔐 | | | | └ | _findScheduledSnapshotIndex | Private 🔐 | | | | └ | _findScheduledMostRecentPastSnapshot | Private 🔐 | | | +| └ | _findAndRevertScheduledSnapshotIndex | Private 🔐 | | | +| └ | _checkTimeInThePast | Internal 🔒 | | | +| └ | _checkTimeSnapshotAlreadyDone | Internal 🔒 | | | +| └ | _getSnapshotModuleBaseStorage | Internal 🔒 | | | ### Legend diff --git a/doc/schema/surya_report/surya_report_ValidationModuleInternal.sol.md b/doc/schema/surya_report/surya_report_ValidationModuleInternal.sol.md index b6c1b578..9fb36bd6 100644 --- a/doc/schema/surya_report/surya_report_ValidationModuleInternal.sol.md +++ b/doc/schema/surya_report/surya_report_ValidationModuleInternal.sol.md @@ -17,10 +17,12 @@ |||||| | **ValidationModuleInternal** | Implementation | Initializable, ContextUpgradeable ||| | └ | __Validation_init_unchained | Internal 🔒 | 🛑 | onlyInitializing | +| └ | ruleEngine | Public ❗️ | |NO❗️ | | └ | _validateTransfer | Internal 🔒 | | | | └ | _messageForTransferRestriction | Internal 🔒 | | | | └ | _detectTransferRestriction | Internal 🔒 | | | | └ | _operateOnTransfer | Internal 🔒 | 🛑 | | +| └ | _getValidationModuleInternalStorage | Internal 🔒 | | | ### Legend diff --git a/doc/schema/surya_report/surya_report_draft-IERC1643.sol.md b/doc/schema/surya_report/surya_report_draft-IERC1643.sol.md new file mode 100644 index 00000000..bdedbda1 --- /dev/null +++ b/doc/schema/surya_report/surya_report_draft-IERC1643.sol.md @@ -0,0 +1,28 @@ +## Sūrya's Description Report + +### Files Description Table + + +| File Name | SHA-1 Hash | +|-------------|--------------| +| ./interfaces/engine/draft-IERC1643.sol | [object Promise] | + + +### Contracts Description Table + + +| Contract | Type | Bases | | | +|:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| +| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | +|||||| +| **IERC1643** | Interface | ||| +| └ | getDocument | External ❗️ | |NO❗️ | +| └ | getAllDocuments | External ❗️ | |NO❗️ | + + +### Legend + +| Symbol | Meaning | +|:--------:|-----------| +| 🛑 | Function can modify state | +| 💵 | Function is payable | diff --git a/migrations/1_deploy_contracts.js b/migrations/1_deploy_contracts.js deleted file mode 100644 index 793b5a30..00000000 --- a/migrations/1_deploy_contracts.js +++ /dev/null @@ -1,33 +0,0 @@ -require('dotenv').config() - -const CMTAT_PROXY = artifacts.require("CMTAT_PROXY") -const { deployProxy } = require("@openzeppelin/truffle-upgrades") -const { Address } = require("ethereumjs-util") -const { time } = require('@openzeppelin/test-helpers') -module.exports = async function (deployer, _network, account) { - const admin = process.env.ADMIN_ADDRESS ? process.env.ADMIN_ADDRESS : account[0] - const flag = 0 - const ZERO_ADDRESS = Address.zero().toString() - const delayTime = BigInt(time.duration.days(3)) - const proxyContract = await deployProxy( - CMTAT_PROXY, - [ - admin, - delayTime, - "Test CMTA Token", - "TCMTAT", - 0, - "TCMTAT_ISIN", - "https://cmta.ch", - ZERO_ADDRESS, - "TCMTAT_info", - flag, - ], - { - deployer, - constructorArgs: [ZERO_ADDRESS] - } - ); - await CMTAT_PROXY.deployed() - console.log("Proxy deployed at: ", proxyContract.address) -} diff --git a/package-lock.json b/package-lock.json index cb5881c4..42d9a0dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,8 @@ "version": "2.4.1", "license": "MPL", "dependencies": { - "@openzeppelin/contracts": "^5.0.2", - "ethereumjs-wallet": "^1.0.2" + "@openzeppelin/contracts": "5.0.2", + "@openzeppelin/contracts-upgradeable": "^5.0.2" }, "devDependencies": { "@nomicfoundation/hardhat-chai-matchers": "^2.0.7", @@ -4088,6 +4088,14 @@ "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-5.0.2.tgz", "integrity": "sha512-ytPc6eLGcHHnapAZ9S+5qsdomhjo6QBHTDRRBFfTxXIpsicMhVPouPgmUPebZZZGX7vt9USA+Z+0M0dSVtSUEA==" }, + "node_modules/@openzeppelin/contracts-upgradeable": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-5.0.2.tgz", + "integrity": "sha512-0MmkHSHiW2NRFiT9/r5Lu4eJq5UJ4/tzlOgYXNAIj/ONkQTVnz22pLxDvp4C4uZ9he7ZFvGn3Driptn1/iU7tQ==", + "peerDependencies": { + "@openzeppelin/contracts": "5.0.2" + } + }, "node_modules/@openzeppelin/defender-sdk-base-client": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@openzeppelin/defender-sdk-base-client/-/defender-sdk-base-client-1.14.1.tgz", @@ -5766,6 +5774,7 @@ "version": "5.1.5", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.5.tgz", "integrity": "sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A==", + "dev": true, "dependencies": { "@types/node": "*" } @@ -5877,6 +5886,7 @@ "version": "20.10.4", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.4.tgz", "integrity": "sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==", + "dev": true, "dependencies": { "undici-types": "~5.26.4" } @@ -5885,6 +5895,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.2.tgz", "integrity": "sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew==", + "dev": true, "dependencies": { "@types/node": "*" } @@ -5908,6 +5919,7 @@ "version": "4.0.6", "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.6.tgz", "integrity": "sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ==", + "dev": true, "dependencies": { "@types/node": "*" } @@ -5992,11 +6004,6 @@ "node": ">=0.3.0" } }, - "node_modules/aes-js": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", - "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==" - }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -6609,6 +6616,7 @@ "version": "3.0.9", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", + "dev": true, "dependencies": { "safe-buffer": "^5.0.1" } @@ -6763,7 +6771,8 @@ "node_modules/blakejs": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", - "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==", + "dev": true }, "node_modules/bluebird": { "version": "3.7.2", @@ -6774,7 +6783,8 @@ "node_modules/bn.js": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true }, "node_modules/body-parser": { "version": "1.20.2", @@ -6941,7 +6951,8 @@ "node_modules/brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "dev": true }, "node_modules/browser-stdout": { "version": "1.3.1", @@ -6953,6 +6964,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, "dependencies": { "buffer-xor": "^1.0.3", "cipher-base": "^1.0.0", @@ -6998,6 +7010,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dev": true, "dependencies": { "base-x": "^3.0.2" } @@ -7006,6 +7019,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "dev": true, "dependencies": { "bs58": "^4.0.0", "create-hash": "^1.1.0", @@ -7047,7 +7061,8 @@ "node_modules/buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==" + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", + "dev": true }, "node_modules/bufferutil": { "version": "4.0.8", @@ -7524,6 +7539,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, "dependencies": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -8148,6 +8164,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, "dependencies": { "cipher-base": "^1.0.1", "inherits": "^2.0.1", @@ -8160,6 +8177,7 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, "dependencies": { "cipher-base": "^1.0.3", "create-hash": "^1.1.0", @@ -8653,6 +8671,7 @@ "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dev": true, "dependencies": { "bn.js": "^4.11.9", "brorand": "^1.1.0", @@ -9916,6 +9935,7 @@ "version": "7.1.5", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", + "dev": true, "dependencies": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -9930,49 +9950,14 @@ "node_modules/ethereumjs-util/node_modules/bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true }, "node_modules/ethereumjs-util/node_modules/ethereum-cryptography": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/ethereumjs-wallet": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/ethereumjs-wallet/-/ethereumjs-wallet-1.0.2.tgz", - "integrity": "sha512-CCWV4RESJgRdHIvFciVQFnCHfqyhXWchTPlkfp28Qc53ufs+doi5I/cV2+xeK9+qEo25XCWfP9MiL+WEPAZfdA==", - "dependencies": { - "aes-js": "^3.1.2", - "bs58check": "^2.1.2", - "ethereum-cryptography": "^0.1.3", - "ethereumjs-util": "^7.1.2", - "randombytes": "^2.1.0", - "scrypt-js": "^3.0.1", - "utf8": "^3.0.0", - "uuid": "^8.3.2" - } - }, - "node_modules/ethereumjs-wallet/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, "dependencies": { "@types/pbkdf2": "^3.0.0", "@types/secp256k1": "^4.0.1", @@ -10183,6 +10168,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, "dependencies": { "md5.js": "^1.3.4", "safe-buffer": "^5.1.1" @@ -12238,6 +12224,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, "dependencies": { "inherits": "^2.0.4", "readable-stream": "^3.6.0", @@ -12251,6 +12238,7 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, "dependencies": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" @@ -12337,6 +12325,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dev": true, "dependencies": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -12573,7 +12562,8 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "node_modules/ini": { "version": "1.3.8", @@ -13310,6 +13300,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.4.tgz", "integrity": "sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q==", + "dev": true, "hasInstallScript": true, "dependencies": { "node-addon-api": "^2.0.0", @@ -13664,6 +13655,7 @@ "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, "dependencies": { "hash-base": "^3.0.0", "inherits": "^2.0.1", @@ -13854,12 +13846,14 @@ "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true }, "node_modules/minimalistic-crypto-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "dev": true }, "node_modules/minimatch": { "version": "3.1.2", @@ -14499,7 +14493,8 @@ "node_modules/node-addon-api": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", - "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", + "dev": true }, "node_modules/node-emoji": { "version": "1.11.0", @@ -14534,6 +14529,7 @@ "version": "4.7.1", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.7.1.tgz", "integrity": "sha512-wTSrZ+8lsRRa3I3H8Xr65dLWSgCvY2l4AOnaeKdPA9TB/WYMPaTcrzf3rXvFoVvjKNVnu0CcWSx54qq9GKRUYg==", + "dev": true, "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -18179,6 +18175,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dev": true, "dependencies": { "create-hash": "^1.1.2", "create-hmac": "^1.1.4", @@ -18625,6 +18622,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, "dependencies": { "safe-buffer": "^5.1.0" } @@ -18732,6 +18730,7 @@ "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -19463,6 +19462,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, "dependencies": { "hash-base": "^3.0.0", "inherits": "^2.0.1" @@ -19481,6 +19481,7 @@ "version": "2.2.7", "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", + "dev": true, "dependencies": { "bn.js": "^5.2.0" }, @@ -19491,7 +19492,8 @@ "node_modules/rlp/node_modules/bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true }, "node_modules/rsvp": { "version": "3.6.2", @@ -19553,6 +19555,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, "funding": [ { "type": "github", @@ -19693,12 +19696,14 @@ "node_modules/scrypt-js": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", - "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", + "dev": true }, "node_modules/secp256k1": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", + "dev": true, "hasInstallScript": true, "dependencies": { "elliptic": "^6.5.4", @@ -19878,7 +19883,8 @@ "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true }, "node_modules/setprototypeof": { "version": "1.2.0", @@ -19890,6 +19896,7 @@ "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, "dependencies": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -21465,6 +21472,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, "dependencies": { "safe-buffer": "~5.2.0" } @@ -22426,7 +22434,8 @@ "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true }, "node_modules/unfetch": { "version": "4.2.0", @@ -22656,7 +22665,8 @@ "node_modules/utf8": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", - "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==" + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", + "dev": true }, "node_modules/util": { "version": "0.12.5", @@ -22674,7 +22684,8 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true }, "node_modules/utils-merge": { "version": "1.0.1", @@ -22689,6 +22700,7 @@ "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, "bin": { "uuid": "dist/bin/uuid" } @@ -26527,6 +26539,12 @@ "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-5.0.2.tgz", "integrity": "sha512-ytPc6eLGcHHnapAZ9S+5qsdomhjo6QBHTDRRBFfTxXIpsicMhVPouPgmUPebZZZGX7vt9USA+Z+0M0dSVtSUEA==" }, + "@openzeppelin/contracts-upgradeable": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-5.0.2.tgz", + "integrity": "sha512-0MmkHSHiW2NRFiT9/r5Lu4eJq5UJ4/tzlOgYXNAIj/ONkQTVnz22pLxDvp4C4uZ9he7ZFvGn3Driptn1/iU7tQ==", + "requires": {} + }, "@openzeppelin/defender-sdk-base-client": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@openzeppelin/defender-sdk-base-client/-/defender-sdk-base-client-1.14.1.tgz", @@ -27931,6 +27949,7 @@ "version": "5.1.5", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.5.tgz", "integrity": "sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A==", + "dev": true, "requires": { "@types/node": "*" } @@ -28042,6 +28061,7 @@ "version": "20.10.4", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.4.tgz", "integrity": "sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==", + "dev": true, "requires": { "undici-types": "~5.26.4" } @@ -28050,6 +28070,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.2.tgz", "integrity": "sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew==", + "dev": true, "requires": { "@types/node": "*" } @@ -28073,6 +28094,7 @@ "version": "4.0.6", "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.6.tgz", "integrity": "sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ==", + "dev": true, "requires": { "@types/node": "*" } @@ -28140,11 +28162,6 @@ "integrity": "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==", "dev": true }, - "aes-js": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", - "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==" - }, "agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -28626,6 +28643,7 @@ "version": "3.0.9", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", + "dev": true, "requires": { "safe-buffer": "^5.0.1" } @@ -28719,7 +28737,8 @@ "blakejs": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", - "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==", + "dev": true }, "bluebird": { "version": "3.7.2", @@ -28730,7 +28749,8 @@ "bn.js": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true }, "body-parser": { "version": "1.20.2", @@ -28864,7 +28884,8 @@ "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "dev": true }, "browser-stdout": { "version": "1.3.1", @@ -28876,6 +28897,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, "requires": { "buffer-xor": "^1.0.3", "cipher-base": "^1.0.0", @@ -28901,6 +28923,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dev": true, "requires": { "base-x": "^3.0.2" } @@ -28909,6 +28932,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "dev": true, "requires": { "bs58": "^4.0.0", "create-hash": "^1.1.0", @@ -28947,7 +28971,8 @@ "buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==" + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", + "dev": true }, "bufferutil": { "version": "4.0.8", @@ -29318,6 +29343,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -29801,6 +29827,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, "requires": { "cipher-base": "^1.0.1", "inherits": "^2.0.1", @@ -29813,6 +29840,7 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, "requires": { "cipher-base": "^1.0.3", "create-hash": "^1.1.0", @@ -30180,6 +30208,7 @@ "version": "6.5.4", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dev": true, "requires": { "bn.js": "^4.11.9", "brorand": "^1.1.0", @@ -31164,6 +31193,7 @@ "version": "7.1.5", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", + "dev": true, "requires": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -31175,51 +31205,14 @@ "bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true }, "ethereum-cryptography": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "requires": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - } - } - }, - "ethereumjs-wallet": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/ethereumjs-wallet/-/ethereumjs-wallet-1.0.2.tgz", - "integrity": "sha512-CCWV4RESJgRdHIvFciVQFnCHfqyhXWchTPlkfp28Qc53ufs+doi5I/cV2+xeK9+qEo25XCWfP9MiL+WEPAZfdA==", - "requires": { - "aes-js": "^3.1.2", - "bs58check": "^2.1.2", - "ethereum-cryptography": "^0.1.3", - "ethereumjs-util": "^7.1.2", - "randombytes": "^2.1.0", - "scrypt-js": "^3.0.1", - "utf8": "^3.0.0", - "uuid": "^8.3.2" - }, - "dependencies": { - "ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, "requires": { "@types/pbkdf2": "^3.0.0", "@types/secp256k1": "^4.0.1", @@ -31406,6 +31399,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, "requires": { "md5.js": "^1.3.4", "safe-buffer": "^5.1.1" @@ -32988,6 +32982,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, "requires": { "inherits": "^2.0.4", "readable-stream": "^3.6.0", @@ -32998,6 +32993,7 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, "requires": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" @@ -33068,6 +33064,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dev": true, "requires": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -33248,7 +33245,8 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "ini": { "version": "1.3.8", @@ -33794,6 +33792,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.4.tgz", "integrity": "sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q==", + "dev": true, "requires": { "node-addon-api": "^2.0.0", "node-gyp-build": "^4.2.0", @@ -34085,6 +34084,7 @@ "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, "requires": { "hash-base": "^3.0.0", "inherits": "^2.0.1", @@ -34237,12 +34237,14 @@ "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true }, "minimalistic-crypto-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "dev": true }, "minimatch": { "version": "3.1.2", @@ -34726,7 +34728,8 @@ "node-addon-api": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", - "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", + "dev": true }, "node-emoji": { "version": "1.11.0", @@ -34749,7 +34752,8 @@ "node-gyp-build": { "version": "4.7.1", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.7.1.tgz", - "integrity": "sha512-wTSrZ+8lsRRa3I3H8Xr65dLWSgCvY2l4AOnaeKdPA9TB/WYMPaTcrzf3rXvFoVvjKNVnu0CcWSx54qq9GKRUYg==" + "integrity": "sha512-wTSrZ+8lsRRa3I3H8Xr65dLWSgCvY2l4AOnaeKdPA9TB/WYMPaTcrzf3rXvFoVvjKNVnu0CcWSx54qq9GKRUYg==", + "dev": true }, "node-releases": { "version": "2.0.14", @@ -37240,6 +37244,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dev": true, "requires": { "create-hash": "^1.1.2", "create-hmac": "^1.1.4", @@ -37564,6 +37569,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, "requires": { "safe-buffer": "^5.1.0" } @@ -37651,6 +37657,7 @@ "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -38236,6 +38243,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, "requires": { "hash-base": "^3.0.0", "inherits": "^2.0.1" @@ -38251,6 +38259,7 @@ "version": "2.2.7", "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", + "dev": true, "requires": { "bn.js": "^5.2.0" }, @@ -38258,7 +38267,8 @@ "bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true } } }, @@ -38300,7 +38310,8 @@ "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true }, "safe-regex": { "version": "1.1.0", @@ -38404,12 +38415,14 @@ "scrypt-js": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", - "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", + "dev": true }, "secp256k1": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", + "dev": true, "requires": { "elliptic": "^6.5.4", "node-addon-api": "^2.0.0", @@ -38567,7 +38580,8 @@ "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true }, "setprototypeof": { "version": "1.2.0", @@ -38579,6 +38593,7 @@ "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -39861,6 +39876,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, "requires": { "safe-buffer": "~5.2.0" } @@ -40614,7 +40630,8 @@ "undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true }, "unfetch": { "version": "4.2.0", @@ -40784,7 +40801,8 @@ "utf8": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", - "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==" + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", + "dev": true }, "util": { "version": "0.12.5", @@ -40802,7 +40820,8 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true }, "utils-merge": { "version": "1.0.1", @@ -40813,7 +40832,8 @@ "uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true }, "validate-npm-package-license": { "version": "3.0.4", diff --git a/package.json b/package.json index d3507062..1e909b17 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "surya": "^0.4.11" }, "dependencies": { - "@openzeppelin/contracts": "^5.0.2", - "ethereumjs-wallet": "^1.0.2" + "@openzeppelin/contracts": "5.0.2", + "@openzeppelin/contracts-upgradeable": "^5.0.2" } } diff --git a/slither-report.md b/slither-report.md new file mode 100644 index 00000000..fdbb00d6 --- /dev/null +++ b/slither-report.md @@ -0,0 +1,775 @@ +**THIS CHECKLIST IS NOT COMPLETE**. Use `--show-ignored-findings` to show all the results. +Summary + - [incorrect-equality](#incorrect-equality) (2 results) (Medium) + - [uninitialized-local](#uninitialized-local) (1 results) (Medium) + - [unused-return](#unused-return) (1 results) (Medium) + - [shadowing-local](#shadowing-local) (1 results) (Low) + - [missing-zero-check](#missing-zero-check) (1 results) (Low) + - [calls-loop](#calls-loop) (4 results) (Low) + - [timestamp](#timestamp) (5 results) (Low) + - [assembly](#assembly) (9 results) (Informational) + - [costly-loop](#costly-loop) (1 results) (Informational) + - [dead-code](#dead-code) (1 results) (Informational) + - [solc-version](#solc-version) (1 results) (Informational) + - [naming-convention](#naming-convention) (56 results) (Informational) + - [similar-names](#similar-names) (3 results) (Informational) + - [too-many-digits](#too-many-digits) (2 results) (Informational) + - [unused-import](#unused-import) (6 results) (Informational) + - [immutable-states](#immutable-states) (1 results) (Optimization) +## incorrect-equality + +> It is a mock contract, not destined to be used in production + +Impact: Medium +Confidence: High + - [ ] ID-0 + [DocumentEngineMock.getDocument(bytes32)](contracts/mocks/DocumentEngineMock.sol#L35-L47) uses a dangerous strict equality: + - [bytes(documents[name_].uri).length == 0](contracts/mocks/DocumentEngineMock.sol#L41) + +contracts/mocks/DocumentEngineMock.sol#L35-L47 + + + - [ ] ID-1 + [DocumentEngineMock.removeDocument(bytes32)](contracts/mocks/DocumentEngineMock.sol#L70-L87) uses a dangerous strict equality: + - [bytes(documents[name_].uri).length == 0](contracts/mocks/DocumentEngineMock.sol#L71) + +contracts/mocks/DocumentEngineMock.sol#L70-L87 + +## uninitialized-local + +> The concerned variable local `mostRecent` is initialized in the loop + +Impact: Medium +Confidence: Medium + - [ ] ID-2 +[SnapshotModuleBase._findScheduledMostRecentPastSnapshot().mostRecent](contracts/modules/internal/base/SnapshotModuleBase.sol#L385) is a local variable never initialized + +contracts/modules/internal/base/SnapshotModuleBase.sol#L385 + + +## unused-return +Impact: Medium +Confidence: Medium + - [ ] ID-3 +[DocumentModule.getDocument(bytes32)](contracts/modules/wrapper/extensions/DocumentModule.sol#L65-L72) ignores return value by [$._documentEngine.getDocument(_name)](contracts/modules/wrapper/extensions/DocumentModule.sol#L68) + +contracts/modules/wrapper/extensions/DocumentModule.sol#L65-L72 + + +## shadowing-local +Impact: Low +Confidence: High + - [ ] ID-4 + [IDebtEngine.setCreditEvents(IDebtGlobal.CreditEvents).creditEvents](contracts/mocks/DebtEngineMock.sol#L9) shadows: + - [IDebtEngine.creditEvents()](contracts/mocks/DebtEngineMock.sol#L7) (function) + +contracts/mocks/DebtEngineMock.sol#L9 + +## missing-zero-check + +> Mock: not intended to be used in production + +Impact: Low +Confidence: Medium + - [ ] ID-5 + [AuthorizationEngineMock.authorizeAdminChange(address).newAdmin](contracts/mocks/AuthorizationEngineMock.sol#L21) lacks a zero-check on : + - [nextAdmin = newAdmin](contracts/mocks/AuthorizationEngineMock.sol#L22) + +contracts/mocks/AuthorizationEngineMock.sol#L21 + +## calls-loop + +> Mock: not intended to be used in production +> ValidationModuleInternal: the loop happens only for batch function. A relevant alternative could be the creation of a batch function for the RuleEngine, but for the moment we don't have an implemented solution. + +Impact: Low +Confidence: Medium + + - [ ] ID-6 +[RuleEngineMock.messageForTransferRestriction(uint8)](contracts/mocks/RuleEngine/RuleEngineMock.sol#L83-L97) has external calls inside a loop: [_rules[i].canReturnTransferRestrictionCode(_restrictionCode)](contracts/mocks/RuleEngine/RuleEngineMock.sol#L88) + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L83-L97 + + + - [ ] ID-7 +[RuleEngineMock.messageForTransferRestriction(uint8)](contracts/mocks/RuleEngine/RuleEngineMock.sol#L83-L97) has external calls inside a loop: [_rules[i].messageForTransferRestriction(_restrictionCode)](contracts/mocks/RuleEngine/RuleEngineMock.sol#L89-L90) + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L83-L97 + + + - [ ] ID-8 +[ValidationModuleInternal._operateOnTransfer(address,address,uint256)](contracts/modules/internal/ValidationModuleInternal.sol#L89-L92) has external calls inside a loop: [$._ruleEngine.operateOnTransfer(from,to,amount)](contracts/modules/internal/ValidationModuleInternal.sol#L91) + +contracts/modules/internal/ValidationModuleInternal.sol#L89-L92 + + + - [ ] ID-9 +[RuleEngineMock.detectTransferRestriction(address,address,uint256)](contracts/mocks/RuleEngine/RuleEngineMock.sol#L39-L59) has external calls inside a loop: [restriction = _rules[i].detectTransferRestriction(_from,_to,_amount)](contracts/mocks/RuleEngine/RuleEngineMock.sol#L46-L50) + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L39-L59 + +## timestamp + +> With the Proof of Work, it was possible for a miner to modify the timestamp in a range of about 15 seconds +> +> With the Proof Of Stake, a new block is created every 12 seconds +> +> In all cases, we are not looking for such precision + +Impact: Low +Confidence: Medium + - [ ] ID-10 + [SnapshotModuleBase._findScheduledMostRecentPastSnapshot()](contracts/modules/internal/base/SnapshotModuleBase.sol#L370-L398) uses timestamp for comparisons + Dangerous comparisons: + - [$._scheduledSnapshots[i] <= block.timestamp](contracts/modules/internal/base/SnapshotModuleBase.sol#L389) + +contracts/modules/internal/base/SnapshotModuleBase.sol#L370-L398 + + + - [ ] ID-11 + [SnapshotModuleBase._checkTimeSnapshotAlreadyDone(uint256)](contracts/modules/internal/base/SnapshotModuleBase.sol#L420-L424) uses timestamp for comparisons + Dangerous comparisons: + - [time <= block.timestamp](contracts/modules/internal/base/SnapshotModuleBase.sol#L421) + +contracts/modules/internal/base/SnapshotModuleBase.sol#L420-L424 + + + - [ ] ID-12 + [DocumentEngineMock.getDocument(bytes32)](contracts/mocks/DocumentEngineMock.sol#L35-L47) uses timestamp for comparisons + Dangerous comparisons: + - [bytes(documents[name_].uri).length == 0](contracts/mocks/DocumentEngineMock.sol#L41) + +contracts/mocks/DocumentEngineMock.sol#L35-L47 + + + - [ ] ID-13 + [SnapshotModuleBase._checkTimeInThePast(uint256)](contracts/modules/internal/base/SnapshotModuleBase.sol#L412-L419) uses timestamp for comparisons + Dangerous comparisons: + - [time <= block.timestamp](contracts/modules/internal/base/SnapshotModuleBase.sol#L413) + +contracts/modules/internal/base/SnapshotModuleBase.sol#L412-L419 + + + - [ ] ID-14 + [DocumentEngineMock.removeDocument(bytes32)](contracts/mocks/DocumentEngineMock.sol#L70-L87) uses timestamp for comparisons + Dangerous comparisons: + - [bytes(documents[name_].uri).length == 0](contracts/mocks/DocumentEngineMock.sol#L71) + +contracts/mocks/DocumentEngineMock.sol#L70-L87 + +## assembly + +> It comes from [eip-7201](https://eips.ethereum.org/EIPS/eip-7201) + +Impact: Informational +Confidence: High + - [ ] ID-15 + [AuthorizationModule._getAuthorizationModuleStorage()](contracts/modules/security/AuthorizationModule.sol#L114-L118) uses assembly + - [INLINE ASM](contracts/modules/security/AuthorizationModule.sol#L115-L117) + +contracts/modules/security/AuthorizationModule.sol#L114-L118 + + + - [ ] ID-16 + [ERC20BaseModule._getERC20BaseModuleStorage()](contracts/modules/wrapper/core/ERC20BaseModule.sol#L126-L130) uses assembly + - [INLINE ASM](contracts/modules/wrapper/core/ERC20BaseModule.sol#L127-L129) + +contracts/modules/wrapper/core/ERC20BaseModule.sol#L126-L130 + + + - [ ] ID-17 + [DocumentModule._getDocumentModuleStorage()](contracts/modules/wrapper/extensions/DocumentModule.sol#L87-L91) uses assembly + - [INLINE ASM](contracts/modules/wrapper/extensions/DocumentModule.sol#L88-L90) + +contracts/modules/wrapper/extensions/DocumentModule.sol#L87-L91 + + + - [ ] ID-18 + [BaseModule._getBaseModuleStorage()](contracts/modules/wrapper/core/BaseModule.sol#L109-L113) uses assembly + - [INLINE ASM](contracts/modules/wrapper/core/BaseModule.sol#L110-L112) + +contracts/modules/wrapper/core/BaseModule.sol#L109-L113 + + + - [ ] ID-19 + [EnforcementModuleInternal._getEnforcementModuleInternalStorage()](contracts/modules/internal/EnforcementModuleInternal.sol#L112-L116) uses assembly + - [INLINE ASM](contracts/modules/internal/EnforcementModuleInternal.sol#L113-L115) + +contracts/modules/internal/EnforcementModuleInternal.sol#L112-L116 + + + - [ ] ID-20 + [ValidationModuleInternal._getValidationModuleInternalStorage()](contracts/modules/internal/ValidationModuleInternal.sol#L96-L100) uses assembly + - [INLINE ASM](contracts/modules/internal/ValidationModuleInternal.sol#L97-L99) + +contracts/modules/internal/ValidationModuleInternal.sol#L96-L100 + + + - [ ] ID-21 + [SnapshotModuleBase._getSnapshotModuleBaseStorage()](contracts/modules/internal/base/SnapshotModuleBase.sol#L427-L431) uses assembly + - [INLINE ASM](contracts/modules/internal/base/SnapshotModuleBase.sol#L428-L430) + +contracts/modules/internal/base/SnapshotModuleBase.sol#L427-L431 + + + - [ ] ID-22 + [DebtModule._getDebtModuleStorage()](contracts/modules/wrapper/extensions/DebtModule.sol#L88-L92) uses assembly + - [INLINE ASM](contracts/modules/wrapper/extensions/DebtModule.sol#L89-L91) + +contracts/modules/wrapper/extensions/DebtModule.sol#L88-L92 + + + - [ ] ID-23 + [PauseModule._getPauseModuleStorage()](contracts/modules/wrapper/core/PauseModule.sol#L103-L107) uses assembly + - [INLINE ASM](contracts/modules/wrapper/core/PauseModule.sol#L104-L106) + +contracts/modules/wrapper/core/PauseModule.sol#L103-L107 + +## costly-loop + +> it is a mock + +Impact: Informational +Confidence: Medium + - [ ] ID-24 + [DocumentEngineMock.removeDocument(bytes32)](contracts/mocks/DocumentEngineMock.sol#L70-L87) has costly operations inside a loop: + - [documentNames.pop()](contracts/mocks/DocumentEngineMock.sol#L81) + +contracts/mocks/DocumentEngineMock.sol#L70-L87 + +## dead-code + +>- Implemented to be gasless compatible (see MetaTxModule) +> +>- If we remove this function, we will have the following error: +> +> "Derived contract must override function "_msgData". Two or more base classes define function with same name and parameter types." + +Impact: Informational +Confidence: Medium + - [ ] ID-25 +[CMTAT_BASE._msgData()](contracts/modules/CMTAT_BASE.sol#L232-L239) is never used and should be removed + +contracts/modules/CMTAT_BASE.sol#L232-L239 + +## solc-version + +> The version set in the config file is 0.8.26 + +Impact: Informational +Confidence: High + - [ ] ID-26 + Version constraint ^0.8.20 contains known severe issues (https://solidity.readthedocs.io/en/latest/bugs.html) + - VerbatimInvalidDeduplication + - FullInlinerNonExpressionSplitArgumentEvaluationOrder + - MissingSideEffectsOnSelectorAccess. + It is used by: + - node_modules/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol#4 + - node_modules/@openzeppelin/contracts-upgradeable/metatx/ERC2771ContextUpgradeable.sol#4 + - node_modules/@openzeppelin/contracts-upgradeable/metatx/ERC2771ForwarderUpgradeable.sol#4 + - node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol#4 + - node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol#4 + - node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol#4 + - node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol#4 + - node_modules/@openzeppelin/contracts-upgradeable/utils/NoncesUpgradeable.sol#3 + - node_modules/@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol#4 + - node_modules/@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol#4 + - node_modules/@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol#4 + - node_modules/@openzeppelin/contracts/access/AccessControl.sol#4 + - node_modules/@openzeppelin/contracts/access/IAccessControl.sol#4 + - node_modules/@openzeppelin/contracts/access/Ownable.sol#4 + - node_modules/@openzeppelin/contracts/interfaces/IERC1967.sol#4 + - node_modules/@openzeppelin/contracts/interfaces/IERC5267.sol#4 + - node_modules/@openzeppelin/contracts/interfaces/draft-IERC1822.sol#4 + - node_modules/@openzeppelin/contracts/interfaces/draft-IERC6093.sol#3 + - node_modules/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol#4 + - node_modules/@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol#4 + - node_modules/@openzeppelin/contracts/proxy/Proxy.sol#4 + - node_modules/@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol#4 + - node_modules/@openzeppelin/contracts/proxy/beacon/IBeacon.sol#4 + - node_modules/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol#4 + - node_modules/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol#4 + - node_modules/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol#4 + - node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol#4 + - node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol#4 + - node_modules/@openzeppelin/contracts/utils/Address.sol#4 + - node_modules/@openzeppelin/contracts/utils/Arrays.sol#4 + - node_modules/@openzeppelin/contracts/utils/Context.sol#4 + - node_modules/@openzeppelin/contracts/utils/Create2.sol#4 + - node_modules/@openzeppelin/contracts/utils/StorageSlot.sol#5 + - node_modules/@openzeppelin/contracts/utils/Strings.sol#4 + - node_modules/@openzeppelin/contracts/utils/cryptography/ECDSA.sol#4 + - node_modules/@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol#4 + - node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol#4 + - node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol#4 + - node_modules/@openzeppelin/contracts/utils/math/Math.sol#4 + - node_modules/@openzeppelin/contracts/utils/math/SignedMath.sol#4 + - contracts/CMTAT_PROXY.sol#3 + - contracts/CMTAT_PROXY_UUPS.sol#3 + - contracts/CMTAT_STANDALONE.sol#3 + - contracts/deployment/CMTAT_BEACON_FACTORY.sol#2 + - contracts/deployment/CMTAT_TP_FACTORY.sol#2 + - contracts/deployment/CMTAT_UUPS_FACTORY.sol#2 + - contracts/deployment/libraries/CMTATFactoryBase.sol#2 + - contracts/deployment/libraries/CMTATFactoryInvariant.sol#2 + - contracts/deployment/libraries/CMTATFactoryRoot.sol#2 + - contracts/interfaces/ICCIPToken.sol#3 + - contracts/interfaces/ICMTATConstructor.sol#7 + - contracts/interfaces/ICMTATSnapshot.sol#3 + - contracts/interfaces/IDebtGlobal.sol#3 + - contracts/interfaces/draft-IERC1404/draft-IERC1404.sol#3 + - contracts/interfaces/draft-IERC1404/draft-IERC1404EnumCode.sol#3 + - contracts/interfaces/draft-IERC1404/draft-IERC1404Wrapper.sol#3 + - contracts/interfaces/engine/IAuthorizationEngine.sol#3 + - contracts/interfaces/engine/IDebtEngine.sol#3 + - contracts/interfaces/engine/IRuleEngine.sol#3 + - contracts/interfaces/engine/draft-IERC1643.sol#3 + - contracts/libraries/Errors.sol#3 + - contracts/libraries/FactoryErrors.sol#3 + - contracts/mocks/AuthorizationEngineMock.sol#3 + - contracts/mocks/DebtEngineMock.sol#3 + - contracts/mocks/DocumentEngineMock.sol#3 + - contracts/mocks/MinimalForwarderMock.sol#3 + - contracts/mocks/RuleEngine/CodeList.sol#3 + - contracts/mocks/RuleEngine/RuleEngineMock.sol#3 + - contracts/mocks/RuleEngine/RuleMock.sol#3 + - contracts/mocks/RuleEngine/interfaces/IRule.sol#3 + - contracts/mocks/RuleEngine/interfaces/IRuleEngineMock.sol#3 + - contracts/modules/CMTAT_BASE.sol#3 + - contracts/modules/internal/ERC20SnapshotModuleInternal.sol#3 + - contracts/modules/internal/EnforcementModuleInternal.sol#3 + - contracts/modules/internal/ValidationModuleInternal.sol#3 + - contracts/modules/internal/base/SnapshotModuleBase.sol#3 + - contracts/modules/security/AuthorizationModule.sol#3 + - contracts/modules/wrapper/controllers/ValidationModule.sol#3 + - contracts/modules/wrapper/core/BaseModule.sol#3 + - contracts/modules/wrapper/core/ERC20BaseModule.sol#3 + - contracts/modules/wrapper/core/ERC20BurnModule.sol#3 + - contracts/modules/wrapper/core/ERC20MintModule.sol#3 + - contracts/modules/wrapper/core/EnforcementModule.sol#3 + - contracts/modules/wrapper/core/PauseModule.sol#3 + - contracts/modules/wrapper/extensions/DebtModule.sol#3 + - contracts/modules/wrapper/extensions/DocumentModule.sol#3 + - contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol#3 + - contracts/modules/wrapper/extensions/MetaTxModule.sol#3 + - contracts/test/proxy/CMTAT_PROXY_TEST.sol#3 + - contracts/test/proxy/CMTAT_PROXY_TEST_UUPS.sol#3 + +## naming-convention + +> It is not really necessary to rename all the variables. It will generate a lot of work for a minor improvement. + +Impact: Informational +Confidence: High + - [ ] ID-27 +Contract [CMTAT_PROXY_UUPS](contracts/CMTAT_PROXY_UUPS.sol#L6-L49) is not in CapWords + +contracts/CMTAT_PROXY_UUPS.sol#L6-L49 + + + - [ ] ID-28 +Enum [IERC1404EnumCode.REJECTED_CODE_BASE](contracts/interfaces/draft-IERC1404/draft-IERC1404EnumCode.sol#L9-L14) is not in CapWords + +contracts/interfaces/draft-IERC1404/draft-IERC1404EnumCode.sol#L9-L14 + + + - [ ] ID-29 +Constant [EnforcementModuleInternal.EnforcementModuleInternalStorageLocation](contracts/modules/internal/EnforcementModuleInternal.sol#L41) is not in UPPER_CASE_WITH_UNDERSCORES + +contracts/modules/internal/EnforcementModuleInternal.sol#L41 + + + - [ ] ID-30 +Function [CMTATFactoryRoot.CMTATProxyAddress(uint256)](contracts/deployment/libraries/CMTATFactoryRoot.sol#L40-L42) is not in mixedCase + +contracts/deployment/libraries/CMTATFactoryRoot.sol#L40-L42 + + + - [ ] ID-31 +Parameter [RuleEngineMock.detectTransferRestriction(address,address,uint256)._amount](contracts/mocks/RuleEngine/RuleEngineMock.sol#L42) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L42 + + + - [ ] ID-32 +Constant [PauseModule.PauseModuleStorageLocation](contracts/modules/wrapper/core/PauseModule.sol#L27) is not in UPPER_CASE_WITH_UNDERSCORES + +contracts/modules/wrapper/core/PauseModule.sol#L27 + + + - [ ] ID-33 +Contract [CMTAT_UUPS_FACTORY](contracts/deployment/CMTAT_UUPS_FACTORY.sol#L15-L89) is not in CapWords + +contracts/deployment/CMTAT_UUPS_FACTORY.sol#L15-L89 + + + - [ ] ID-34 +Contract [CMTAT_PROXY](contracts/CMTAT_PROXY.sol#L7-L19) is not in CapWords + +contracts/CMTAT_PROXY.sol#L7-L19 + + + - [ ] ID-35 +Function [PauseModule.__PauseModule_init_unchained()](contracts/modules/wrapper/core/PauseModule.sol#L33-L35) is not in mixedCase + +contracts/modules/wrapper/core/PauseModule.sol#L33-L35 + + + - [ ] ID-36 +Function [BaseModule.__Base_init_unchained(string,string,string)](contracts/modules/wrapper/core/BaseModule.sol#L41-L50) is not in mixedCase + +contracts/modules/wrapper/core/BaseModule.sol#L41-L50 + + + - [ ] ID-37 +Function [EnforcementModuleInternal.__Enforcement_init_unchained()](contracts/modules/internal/EnforcementModuleInternal.sol#L53-L55) is not in mixedCase + +contracts/modules/internal/EnforcementModuleInternal.sol#L53-L55 + + + - [ ] ID-38 +Struct [CMTATFactoryInvariant.CMTAT_ARGUMENT](contracts/deployment/libraries/CMTATFactoryInvariant.sol#L14-L19) is not in CapWords + +contracts/deployment/libraries/CMTATFactoryInvariant.sol#L14-L19 + + + - [ ] ID-39 +Function [ERC20BurnModule.__ERC20BurnModule_init_unchained()](contracts/modules/wrapper/core/ERC20BurnModule.sol#L25-L27) is not in mixedCase + +contracts/modules/wrapper/core/ERC20BurnModule.sol#L25-L27 + + + - [ ] ID-40 +Function [ValidationModuleInternal.__Validation_init_unchained(IRuleEngine)](contracts/modules/internal/ValidationModuleInternal.sol#L30-L38) is not in mixedCase + +contracts/modules/internal/ValidationModuleInternal.sol#L30-L38 + + + - [ ] ID-41 +Constant [ValidationModuleInternal.ValidationModuleInternalStorageLocation](contracts/modules/internal/ValidationModuleInternal.sol#L24) is not in UPPER_CASE_WITH_UNDERSCORES + +contracts/modules/internal/ValidationModuleInternal.sol#L24 + + + - [ ] ID-42 +Contract [CMTAT_STANDALONE](contracts/CMTAT_STANDALONE.sol#L7-L33) is not in CapWords + +contracts/CMTAT_STANDALONE.sol#L7-L33 + + + - [ ] ID-43 +Parameter [RuleEngineMock.operateOnTransfer(address,address,uint256)._to](contracts/mocks/RuleEngine/RuleEngineMock.sol#L74) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L74 + + + - [ ] ID-44 +Parameter [RuleEngineMock.validateTransfer(address,address,uint256)._amount](contracts/mocks/RuleEngine/RuleEngineMock.sol#L64) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L64 + + + - [ ] ID-45 +Parameter [RuleEngineMock.operateOnTransfer(address,address,uint256)._from](contracts/mocks/RuleEngine/RuleEngineMock.sol#L73) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L73 + + + - [ ] ID-46 +Parameter [RuleMock.validateTransfer(address,address,uint256)._to](contracts/mocks/RuleEngine/RuleMock.sol#L14) is not in mixedCase + +contracts/mocks/RuleEngine/RuleMock.sol#L14 + + + - [ ] ID-47 +Parameter [RuleEngineMock.operateOnTransfer(address,address,uint256)._amount](contracts/mocks/RuleEngine/RuleEngineMock.sol#L75) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L75 + + + - [ ] ID-48 +Parameter [RuleMock.canReturnTransferRestrictionCode(uint8)._restrictionCode](contracts/mocks/RuleEngine/RuleMock.sol#L35) is not in mixedCase + +contracts/mocks/RuleEngine/RuleMock.sol#L35 + + + - [ ] ID-49 +Function [DebtModule.__DebtModule_init_unchained(IDebtEngine)](contracts/modules/wrapper/extensions/DebtModule.sol#L35-L44) is not in mixedCase + +contracts/modules/wrapper/extensions/DebtModule.sol#L35-L44 + + + - [ ] ID-50 +Parameter [RuleEngineMock.validateTransfer(address,address,uint256)._to](contracts/mocks/RuleEngine/RuleEngineMock.sol#L63) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L63 + + + - [ ] ID-51 +Function [DocumentModule.__DocumentModule_init_unchained(IERC1643)](contracts/modules/wrapper/extensions/DocumentModule.sol#L32-L39) is not in mixedCase + +contracts/modules/wrapper/extensions/DocumentModule.sol#L32-L39 + + + - [ ] ID-52 +Parameter [DocumentModule.getDocument(bytes32)._name](contracts/modules/wrapper/extensions/DocumentModule.sol#L65) is not in mixedCase + +contracts/modules/wrapper/extensions/DocumentModule.sol#L65 + + + - [ ] ID-53 +Constant [SnapshotModuleBase.SnapshotModuleBaseStorageLocation](contracts/modules/internal/base/SnapshotModuleBase.sol#L45) is not in UPPER_CASE_WITH_UNDERSCORES + +contracts/modules/internal/base/SnapshotModuleBase.sol#L45 + + + - [ ] ID-54 +Function [AuthorizationModule.__AuthorizationModule_init_unchained(address,IAuthorizationEngine)](contracts/modules/security/AuthorizationModule.sol#L30-L41) is not in mixedCase + +contracts/modules/security/AuthorizationModule.sol#L30-L41 + + + - [ ] ID-55 +Function [CMTAT_BASE.__CMTAT_init(address,ICMTATConstructor.ERC20Attributes,ICMTATConstructor.BaseModuleAttributes,ICMTATConstructor.Engine)](contracts/modules/CMTAT_BASE.sol#L77-L129) is not in mixedCase + +contracts/modules/CMTAT_BASE.sol#L77-L129 + + + - [ ] ID-56 +Constant [ERC20BaseModule.ERC20BaseModuleStorageLocation](contracts/modules/wrapper/core/ERC20BaseModule.sol#L18) is not in UPPER_CASE_WITH_UNDERSCORES + +contracts/modules/wrapper/core/ERC20BaseModule.sol#L18 + + + - [ ] ID-57 +Parameter [RuleEngineMock.validateTransfer(address,address,uint256)._from](contracts/mocks/RuleEngine/RuleEngineMock.sol#L62) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L62 + + + - [ ] ID-58 +Parameter [RuleMock.validateTransfer(address,address,uint256)._amount](contracts/mocks/RuleEngine/RuleMock.sol#L15) is not in mixedCase + +contracts/mocks/RuleEngine/RuleMock.sol#L15 + + + - [ ] ID-59 +Parameter [CMTAT_PROXY_UUPS.initialize(address,ICMTATConstructor.ERC20Attributes,ICMTATConstructor.BaseModuleAttributes,ICMTATConstructor.Engine).ERC20Attributes_](contracts/CMTAT_PROXY_UUPS.sol#L34) is not in mixedCase + +contracts/CMTAT_PROXY_UUPS.sol#L34 + + + - [ ] ID-60 +Parameter [CMTAT_BASE.initialize(address,ICMTATConstructor.ERC20Attributes,ICMTATConstructor.BaseModuleAttributes,ICMTATConstructor.Engine).ERC20Attributes_](contracts/modules/CMTAT_BASE.sol#L61) is not in mixedCase + +contracts/modules/CMTAT_BASE.sol#L61 + + + - [ ] ID-61 +Function [CMTAT_BASE.__CMTAT_init_unchained()](contracts/modules/CMTAT_BASE.sol#L131-L133) is not in mixedCase + +contracts/modules/CMTAT_BASE.sol#L131-L133 + + + - [ ] ID-62 +Constant [DocumentModule.DocumentModuleStorageLocation](contracts/modules/wrapper/extensions/DocumentModule.sol#L18) is not in UPPER_CASE_WITH_UNDERSCORES + +contracts/modules/wrapper/extensions/DocumentModule.sol#L18 + + + - [ ] ID-63 +Parameter [RuleMock.detectTransferRestriction(address,address,uint256)._amount](contracts/mocks/RuleEngine/RuleMock.sol#L26) is not in mixedCase + +contracts/mocks/RuleEngine/RuleMock.sol#L26 + + + - [ ] ID-64 +Function [ERC20BaseModule.__ERC20BaseModule_init_unchained(uint8)](contracts/modules/wrapper/core/ERC20BaseModule.sol#L31-L36) is not in mixedCase + +contracts/modules/wrapper/core/ERC20BaseModule.sol#L31-L36 + + + - [ ] ID-65 +Parameter [RuleMock.messageForTransferRestriction(uint8)._restrictionCode](contracts/mocks/RuleEngine/RuleMock.sol#L41) is not in mixedCase + +contracts/mocks/RuleEngine/RuleMock.sol#L41 + + + - [ ] ID-66 +Constant [AuthorizationModule.AuthorizationModuleStorageLocation](contracts/modules/security/AuthorizationModule.sol#L17) is not in UPPER_CASE_WITH_UNDERSCORES + +contracts/modules/security/AuthorizationModule.sol#L17 + + + - [ ] ID-67 +Function [ERC20MintModule.__ERC20MintModule_init_unchained()](contracts/modules/wrapper/core/ERC20MintModule.sol#L20-L22) is not in mixedCase + +contracts/modules/wrapper/core/ERC20MintModule.sol#L20-L22 + + + - [ ] ID-68 +Parameter [RuleEngineMock.detectTransferRestriction(address,address,uint256)._to](contracts/mocks/RuleEngine/RuleEngineMock.sol#L41) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L41 + + + - [ ] ID-69 +Constant [BaseModule.BaseModuleStorageLocation](contracts/modules/wrapper/core/BaseModule.sol#L26) is not in UPPER_CASE_WITH_UNDERSCORES + +contracts/modules/wrapper/core/BaseModule.sol#L26 + + + - [ ] ID-70 +Function [SnapshotModuleBase.__SnapshotModuleBase_init_unchained()](contracts/modules/internal/base/SnapshotModuleBase.sol#L70-L73) is not in mixedCase + +contracts/modules/internal/base/SnapshotModuleBase.sol#L70-L73 + + + - [ ] ID-71 +Contract [CMTAT_BEACON_FACTORY](contracts/deployment/CMTAT_BEACON_FACTORY.sol#L16-L104) is not in CapWords + +contracts/deployment/CMTAT_BEACON_FACTORY.sol#L16-L104 + + + - [ ] ID-72 +Parameter [CMTAT_BASE.__CMTAT_init(address,ICMTATConstructor.ERC20Attributes,ICMTATConstructor.BaseModuleAttributes,ICMTATConstructor.Engine).ERC20Attributes_](contracts/modules/CMTAT_BASE.sol#L79) is not in mixedCase + +contracts/modules/CMTAT_BASE.sol#L79 + + + - [ ] ID-73 +Contract [CMTAT_BASE](contracts/modules/CMTAT_BASE.sol#L29-L240) is not in CapWords + +contracts/modules/CMTAT_BASE.sol#L29-L240 + + + - [ ] ID-74 +Parameter [RuleEngineMock.messageForTransferRestriction(uint8)._restrictionCode](contracts/mocks/RuleEngine/RuleEngineMock.sol#L84) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L84 + + + - [ ] ID-75 +Function [ValidationModule.__ValidationModule_init_unchained()](contracts/modules/wrapper/controllers/ValidationModule.sol#L28-L30) is not in mixedCase + +contracts/modules/wrapper/controllers/ValidationModule.sol#L28-L30 + + + - [ ] ID-76 +Parameter [RuleEngineMock.detectTransferRestriction(address,address,uint256)._from](contracts/mocks/RuleEngine/RuleEngineMock.sol#L40) is not in mixedCase + +contracts/mocks/RuleEngine/RuleEngineMock.sol#L40 + + + - [ ] ID-77 +Constant [DebtModule.DebtModuleStorageLocation](contracts/modules/wrapper/extensions/DebtModule.sol#L14) is not in UPPER_CASE_WITH_UNDERSCORES + +contracts/modules/wrapper/extensions/DebtModule.sol#L14 + + + - [ ] ID-78 +Function [ERC20SnapshotModule.__ERC20SnasphotModule_init_unchained()](contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol#L21-L23) is not in mixedCase + +contracts/modules/wrapper/extensions/ERC20SnapshotModule.sol#L21-L23 + + + - [ ] ID-79 +Function [EnforcementModule.__EnforcementModule_init_unchained()](contracts/modules/wrapper/core/EnforcementModule.sol#L26-L28) is not in mixedCase + +contracts/modules/wrapper/core/EnforcementModule.sol#L26-L28 + + + - [ ] ID-80 +Function [ERC20SnapshotModuleInternal.__ERC20Snapshot_init_unchained()](contracts/modules/internal/ERC20SnapshotModuleInternal.sol#L21-L24) is not in mixedCase + +contracts/modules/internal/ERC20SnapshotModuleInternal.sol#L21-L24 + + + - [ ] ID-81 +Contract [CMTAT_TP_FACTORY](contracts/deployment/CMTAT_TP_FACTORY.sol#L14-L82) is not in CapWords + +contracts/deployment/CMTAT_TP_FACTORY.sol#L14-L82 + + + - [ ] ID-82 +Parameter [RuleMock.validateTransfer(address,address,uint256)._from](contracts/mocks/RuleEngine/RuleMock.sol#L13) is not in mixedCase + +contracts/mocks/RuleEngine/RuleMock.sol#L13 + + +## similar-names +Impact: Informational +Confidence: Medium + - [ ] ID-83 +Variable [IERC1643Whole.setDocument(bytes32,string,bytes32)._documentHash](contracts/mocks/DocumentEngineMock.sol#L8) is too similar to [DocumentEngineMock.setDocument(bytes32,string,bytes32).documentHash_](contracts/mocks/DocumentEngineMock.sol#L53) + +contracts/mocks/DocumentEngineMock.sol#L8 + + + - [ ] ID-84 +Variable [CMTAT_BEACON_FACTORY._getBytecode(CMTATFactoryInvariant.CMTAT_ARGUMENT)._implementation](contracts/deployment/CMTAT_BEACON_FACTORY.sol#L86-L92) is too similar to [CMTAT_BEACON_FACTORY.constructor(address,address,address,bool).implementation_](contracts/deployment/CMTAT_BEACON_FACTORY.sol#L24) + +contracts/deployment/CMTAT_BEACON_FACTORY.sol#L86-L92 + + + - [ ] ID-85 +Variable [DebtEngineMock._creditEvents](contracts/mocks/DebtEngineMock.sol#L14) is too similar to [DebtEngineMock.setCreditEvents(IDebtGlobal.CreditEvents).creditEvents_](contracts/mocks/DebtEngineMock.sol#L28) + +contracts/mocks/DebtEngineMock.sol#L14 + + +## too-many-digits +Impact: Informational +Confidence: Medium + - [ ] ID-86 + [CMTAT_TP_FACTORY._getBytecode(address,CMTATFactoryInvariant.CMTAT_ARGUMENT)](contracts/deployment/CMTAT_TP_FACTORY.sol#L69-L80) uses literals with too many digits: + - [bytecode = abi.encodePacked(type()(TransparentUpgradeableProxy).creationCode,abi.encode(logic,proxyAdminOwner,implementation))](contracts/deployment/CMTAT_TP_FACTORY.sol#L79) + +contracts/deployment/CMTAT_TP_FACTORY.sol#L69-L80 + + + - [ ] ID-87 + [CMTAT_BEACON_FACTORY._getBytecode(CMTATFactoryInvariant.CMTAT_ARGUMENT)](contracts/deployment/CMTAT_BEACON_FACTORY.sol#L83-L94) uses literals with too many digits: + - [bytecode = abi.encodePacked(type()(BeaconProxy).creationCode,abi.encode(address(beacon),_implementation))](contracts/deployment/CMTAT_BEACON_FACTORY.sol#L93) + +contracts/deployment/CMTAT_BEACON_FACTORY.sol#L83-L94 + + +## unused-import +Impact: Informational +Confidence: High + - [ ] ID-88 +The following unused import(s) in contracts/deployment/libraries/CMTATFactoryBase.sol should be removed: + -import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; (contracts/deployment/libraries/CMTATFactoryBase.sol#4) + + - [ ] ID-89 +The following unused import(s) in contracts/deployment/CMTAT_BEACON_FACTORY.sol should be removed: + -import "../modules/CMTAT_BASE.sol"; (contracts/deployment/CMTAT_BEACON_FACTORY.sol#8) + + - [ ] ID-90 +The following unused import(s) in contracts/deployment/libraries/CMTATFactoryRoot.sol should be removed: + -import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; (contracts/deployment/libraries/CMTATFactoryRoot.sol#4) + -import "../../CMTAT_PROXY.sol"; (contracts/deployment/libraries/CMTATFactoryRoot.sol#5) + -import '@openzeppelin/contracts/utils/Create2.sol'; (contracts/deployment/libraries/CMTATFactoryRoot.sol#7) + + - [ ] ID-91 +The following unused import(s) in contracts/deployment/CMTAT_UUPS_FACTORY.sol should be removed: + -import "../libraries/FactoryErrors.sol"; (contracts/deployment/CMTAT_UUPS_FACTORY.sol#6) + -import '@openzeppelin/contracts/access/AccessControl.sol'; (contracts/deployment/CMTAT_UUPS_FACTORY.sol#8) + + - [ ] ID-92 +The following unused import(s) in contracts/deployment/CMTAT_TP_FACTORY.sol should be removed: + -import "../libraries/FactoryErrors.sol"; (contracts/deployment/CMTAT_TP_FACTORY.sol#6) + + - [ ] ID-93 + The following unused import(s) in contracts/modules/wrapper/core/BaseModule.sol should be removed: + -import "../../../libraries/Errors.sol"; (contracts/modules/wrapper/core/BaseModule.sol#7) + +## immutable-states +Impact: Optimization +Confidence: High + - [ ] ID-94 +[CMTATFactoryRoot.useCustomSalt](contracts/deployment/libraries/CMTATFactoryRoot.sol#L17) should be immutable + +contracts/deployment/libraries/CMTATFactoryRoot.sol#L17 + diff --git a/test/common/AuthorizationModule/AuthorizationModuleCommon.js b/test/common/AuthorizationModule/AuthorizationModuleCommon.js index b2d15f73..70845c05 100644 --- a/test/common/AuthorizationModule/AuthorizationModuleCommon.js +++ b/test/common/AuthorizationModule/AuthorizationModuleCommon.js @@ -1,7 +1,4 @@ const { expect } = require('chai'); -const { - expectRevertCustomError -} = require('../../../openzeppelin-contracts-upgradeable/test/helpers/customError') const { PAUSER_ROLE, DEFAULT_ADMIN_ROLE, @@ -38,11 +35,9 @@ function AuthorizationModuleCommon () { // Arrange - Assert expect(await this.cmtat.hasRole(PAUSER_ROLE, this.address1)).to.equal(false) // Act - await expectRevertCustomError( - this.cmtat.connect(this.address2).grantRole(PAUSER_ROLE, this.address1), - 'AccessControlUnauthorizedAccount', - [this.address2.address, DEFAULT_ADMIN_ROLE] - ); + await expect(this.cmtat.connect(this.address2).grantRole(PAUSER_ROLE, this.address1)) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address2.address, DEFAULT_ADMIN_ROLE); // Assert expect(await this.cmtat.hasRole(PAUSER_ROLE, this.address1)).to.equal(false) }) @@ -57,11 +52,9 @@ function AuthorizationModuleCommon () { // Arrange - Assert expect(await this.cmtat.hasRole(PAUSER_ROLE, this.address1)).to.equal(true) // Act - await expectRevertCustomError( - this.cmtat.connect(this.address2).revokeRole(PAUSER_ROLE, this.address1), - 'AccessControlUnauthorizedAccount', - [this.address2.address, DEFAULT_ADMIN_ROLE] - ); + await expect( this.cmtat.connect(this.address2).revokeRole(PAUSER_ROLE, this.address1)) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address2.address, DEFAULT_ADMIN_ROLE) // Assert expect(await this.cmtat.hasRole(PAUSER_ROLE, this.address1)).to.equal(true) }) diff --git a/test/common/AuthorizationModule/AuthorizationModuleSetAuthorizationEngineCommon.js b/test/common/AuthorizationModule/AuthorizationModuleSetAuthorizationEngineCommon.js index aff06e03..942a3dc2 100644 --- a/test/common/AuthorizationModule/AuthorizationModuleSetAuthorizationEngineCommon.js +++ b/test/common/AuthorizationModule/AuthorizationModuleSetAuthorizationEngineCommon.js @@ -1,7 +1,4 @@ const { expect } = require('chai'); -const { - expectRevertCustomError -} = require('../../../openzeppelin-contracts-upgradeable/test/helpers/customError.js') const { DEFAULT_ADMIN_ROLE } = require('../../utils.js') function AuthorizationModuleSetAuthorizationEngineCommon () { @@ -33,25 +30,20 @@ function AuthorizationModuleSetAuthorizationEngineCommon () { this.authorizationEngineMock.target ) } - // Act - await expectRevertCustomError( - this.cmtat.connect(this.admin).setAuthorizationEngine( - this.authorizationEngineMock.target - ), - 'CMTAT_AuthorizationModule_AuthorizationEngineAlreadySet', - [] - ) + await expect( this.cmtat.connect(this.admin).setAuthorizationEngine( + this.authorizationEngineMock.target + )) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_AuthorizationModule_AuthorizationEngineAlreadySet') }) it('testCannotNonAdminSetAuthorizationEngine', async function () { // Act - await expectRevertCustomError( - this.cmtat.connect(this.address1).setAuthorizationEngine( - this.authorizationEngineMock.target - ), - 'AccessControlUnauthorizedAccount', - [this.address1.address, DEFAULT_ADMIN_ROLE] + await expect( this.cmtat.connect(this.address1).setAuthorizationEngine( + this.authorizationEngineMock.target + )) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount').withArgs( + this.address1.address, DEFAULT_ADMIN_ROLE ) }) @@ -84,11 +76,8 @@ function AuthorizationModuleSetAuthorizationEngineCommon () { ) } // Act - await expectRevertCustomError( - this.cmtat.connect(this.admin).grantRole(DEFAULT_ADMIN_ROLE, this.address1), - 'CMTAT_AuthorizationModule_InvalidAuthorization', - [] - ) + await expect( this.cmtat.connect(this.admin).grantRole(DEFAULT_ADMIN_ROLE, this.address1)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_AuthorizationModule_InvalidAuthorization') }) it('testCanRevokeAdminIfAuthorizedByTheEngine', async function () { @@ -119,11 +108,8 @@ function AuthorizationModuleSetAuthorizationEngineCommon () { await this.authorizationEngineMock.setRevokeAdminRoleAuthorized(false) // Act - await expectRevertCustomError( - this.cmtat.connect(this.admin).revokeRole(DEFAULT_ADMIN_ROLE, this.address1), - 'CMTAT_AuthorizationModule_InvalidAuthorization', - [] - ) + await expect( this.cmtat.connect(this.admin).revokeRole(DEFAULT_ADMIN_ROLE, this.address1)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_AuthorizationModule_InvalidAuthorization') }) }) } diff --git a/test/common/BaseModuleCommon.js b/test/common/BaseModuleCommon.js index a6b0b98f..14c3cef3 100644 --- a/test/common/BaseModuleCommon.js +++ b/test/common/BaseModuleCommon.js @@ -1,14 +1,11 @@ const { expect } = require('chai'); const { DEFAULT_ADMIN_ROLE } = require('../utils') -const { - expectRevertCustomError -} = require('../../openzeppelin-contracts-upgradeable/test/helpers/customError.js') function BaseModuleCommon () { context('Token structure', function () { it('testHasTheDefinedVersion', async function () { // Act + Assert - expect(await this.cmtat.VERSION()).to.equal('2.4.1') + expect(await this.cmtat.VERSION()).to.equal('2.5.0') }) it('testHasTheDefinedTokenId', async function () { // Act + Assert @@ -31,11 +28,9 @@ function BaseModuleCommon () { // Arrange - Assert expect(await this.cmtat.tokenId()).to.equal('CMTAT_ISIN') // Act - await expectRevertCustomError( - this.cmtat.connect(this.address1).setTokenId('CMTAT_TOKENID'), - 'AccessControlUnauthorizedAccount', - [this.address1.address, DEFAULT_ADMIN_ROLE] - ); + await expect( this.cmtat.connect(this.address1).setTokenId('CMTAT_TOKENID')) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address1.address, DEFAULT_ADMIN_ROLE); // Assert expect(await this.cmtat.tokenId()).to.equal('CMTAT_ISIN') }) @@ -52,11 +47,9 @@ function BaseModuleCommon () { // Arrange - Assert expect(await this.cmtat.terms()).to.equal('https://cmta.ch') // Act - await expectRevertCustomError( - this.cmtat.connect(this.address1).setTerms('https://cmta.ch/terms'), - 'AccessControlUnauthorizedAccount', - [this.address1.address, DEFAULT_ADMIN_ROLE] - ); + await expect( this.cmtat.connect(this.address1).setTerms('https://cmta.ch/terms')) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address1.address, DEFAULT_ADMIN_ROLE) // Assert expect(await this.cmtat.terms()).to.equal('https://cmta.ch') }) @@ -73,11 +66,9 @@ function BaseModuleCommon () { // Arrange - Assert expect(await this.cmtat.information()).to.equal('CMTAT_info') // Act - await expectRevertCustomError( - this.cmtat.connect(this.address1).setInformation('new info available'), - 'AccessControlUnauthorizedAccount', - [this.address1.address, DEFAULT_ADMIN_ROLE] - ); + await expect( this.cmtat.connect(this.address1).setInformation('new info available')) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address1.address, DEFAULT_ADMIN_ROLE); // Assert expect(await this.cmtat.information()).to.equal('CMTAT_info') }) diff --git a/test/common/DebtModule/DebtModuleCommon.js b/test/common/DebtModule/DebtModuleCommon.js index 7e220bc4..a3659bad 100644 --- a/test/common/DebtModule/DebtModuleCommon.js +++ b/test/common/DebtModule/DebtModuleCommon.js @@ -1,7 +1,4 @@ const { expect } = require('chai'); -const { - expectRevertCustomError -} = require('../../../openzeppelin-contracts-upgradeable/test/helpers/customError') const { ZERO_ADDRESS } = require('../../utils') function DebtModuleCommon () { diff --git a/test/common/DebtModule/DebtModuleSetDebtEngineCommon.js b/test/common/DebtModule/DebtModuleSetDebtEngineCommon.js index 51e2e8ea..a595f577 100644 --- a/test/common/DebtModule/DebtModuleSetDebtEngineCommon.js +++ b/test/common/DebtModule/DebtModuleSetDebtEngineCommon.js @@ -1,7 +1,4 @@ const { expect } = require('chai'); -const { - expectRevertCustomError -} = require('../../../openzeppelin-contracts-upgradeable/test/helpers/customError.js') const { DEBT_ROLE } = require('../../utils.js') function DebtModuleSetDebtEngineCommon () { @@ -18,20 +15,15 @@ function DebtModuleSetDebtEngineCommon () { it('testCanNotBeSetByAdminWithTheSameValue', async function () { // Act - await expectRevertCustomError( - this.cmtat.connect(this.admin).setDebtEngine(await this.cmtat.debtEngine()), - 'CMTAT_DebtModule_SameValue', - [] - ) + await expect(this.cmtat.connect(this.admin).setDebtEngine(await this.cmtat.debtEngine())) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_DebtModule_SameValue') }) it('testCannotBeSetByNonAdmin', async function () { // Act - await expectRevertCustomError( - this.cmtat.connect(this.address1).setDebtEngine(this.debtEngineMock.target), - 'AccessControlUnauthorizedAccount', - [this.address1.address, DEBT_ROLE] - ) + await expect( this.cmtat.connect(this.address1).setDebtEngine(this.debtEngineMock.target)) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address1.address, DEBT_ROLE) }) }) } diff --git a/test/common/DocumentModule/DocumentModuleCommon.js b/test/common/DocumentModule/DocumentModuleCommon.js index 0f156c4b..5a2348af 100644 --- a/test/common/DocumentModule/DocumentModuleCommon.js +++ b/test/common/DocumentModule/DocumentModuleCommon.js @@ -1,11 +1,7 @@ const { expect } = require('chai'); -const { - expectRevertCustomError -} = require('../../../openzeppelin-contracts-upgradeable/test/helpers/customError') const { ZERO_ADDRESS } = require('../../utils') function DocumentModuleCommon () { - // Transferring with Rule Engine set context('Document Module Test', function () { beforeEach(async function () { if ((await this.cmtat.documentEngine()) === ZERO_ADDRESS) { diff --git a/test/common/DocumentModule/DocumentModuleSetDocumentEngineCommon.js b/test/common/DocumentModule/DocumentModuleSetDocumentEngineCommon.js index c31dee9c..78991899 100644 --- a/test/common/DocumentModule/DocumentModuleSetDocumentEngineCommon.js +++ b/test/common/DocumentModule/DocumentModuleSetDocumentEngineCommon.js @@ -1,7 +1,4 @@ const { expect } = require('chai'); -const { - expectRevertCustomError -} = require('../../../openzeppelin-contracts-upgradeable/test/helpers/customError.js') const { DOCUMENT_ROLE } = require('../../utils.js') function DocumentModuleSetDocumentEngineCommon () { @@ -18,20 +15,15 @@ function DocumentModuleSetDocumentEngineCommon () { it('testCanNotBeSetByAdminWithTheSameValue', async function () { // Act - await expectRevertCustomError( - this.cmtat.connect(this.admin).setDocumentEngine(await this.cmtat.documentEngine()), - 'CMTAT_DocumentModule_SameValue', - [] - ) + await expect(this.cmtat.connect(this.admin).setDocumentEngine(await this.cmtat.documentEngine())) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_DocumentModule_SameValue') }) it('testCannotBeSetByNonAdmin', async function () { // Act - await expectRevertCustomError( - this.cmtat.connect(this.address1).setDocumentEngine(this.documentEngineMock.target), - 'AccessControlUnauthorizedAccount', - [this.address1.address, DOCUMENT_ROLE] - ) + await expect( this.cmtat.connect(this.address1).setDocumentEngine(this.documentEngineMock.target)) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address1.address, DOCUMENT_ROLE) }) }) } diff --git a/test/common/ERC20BaseModuleCommon.js b/test/common/ERC20BaseModuleCommon.js index cdd5c5d2..8e5aa3bd 100644 --- a/test/common/ERC20BaseModuleCommon.js +++ b/test/common/ERC20BaseModuleCommon.js @@ -1,7 +1,4 @@ const { expect } = require('chai'); -const { - expectRevertCustomError, -} = require("../../openzeppelin-contracts-upgradeable/test/helpers/customError"); function ERC20BaseModuleCommon() { context("Token structure", function () { @@ -141,13 +138,11 @@ function ERC20BaseModuleCommon() { const ADDRESS1_BALANCE = await this.cmtat.balanceOf(this.address1); const AMOUNT_TO_TRANSFER = 50n; // Act - await expectRevertCustomError( - this.cmtat - .connect(this.address1) - .transfer(this.address2, AMOUNT_TO_TRANSFER), - "ERC20InsufficientBalance", - [this.address1.address, ADDRESS1_BALANCE, AMOUNT_TO_TRANSFER] - ); + await expect( this.cmtat + .connect(this.address1) + .transfer(this.address2, AMOUNT_TO_TRANSFER)) + .to.be.revertedWithCustomError(this.cmtat, 'ERC20InsufficientBalance') + .withArgs(this.address1.address, ADDRESS1_BALANCE, AMOUNT_TO_TRANSFER) }); // allows address3 to transfer tokens from address1 to address2 with the right allowance @@ -202,13 +197,11 @@ function ERC20BaseModuleCommon() { ); // Act // Transfer - await expectRevertCustomError( - this.cmtat - .connect(this.address3) - .transferFrom(this.address1, this.address2, 31), - "ERC20InsufficientAllowance", - [this.address3.address, ALLOWANCE_FOR_ADDRESS3, AMOUNT_TO_TRANSFER] - ); + await expect( this.cmtat + .connect(this.address3) + .transferFrom(this.address1, this.address2, 31)) + .to.be.revertedWithCustomError(this.cmtat, 'ERC20InsufficientAllowance') + .withArgs(this.address3.address, ALLOWANCE_FOR_ADDRESS3, AMOUNT_TO_TRANSFER) }); // reverts if address3 transfers more tokens than address1 owns from address1 to address2 @@ -218,13 +211,11 @@ function ERC20BaseModuleCommon() { const ADDRESS1_BALANCE = await this.cmtat.balanceOf(this.address1); await this.cmtat.connect(this.address1).approve(this.address3, 1000); // Act - await expectRevertCustomError( - this.cmtat - .connect(this.address3) - .transferFrom(this.address1, this.address2, AMOUNT_TO_TRANSFER), - "ERC20InsufficientBalance", - [this.address1.address, ADDRESS1_BALANCE, AMOUNT_TO_TRANSFER] - ); + await expect( this.cmtat + .connect(this.address3) + .transferFrom(this.address1, this.address2, AMOUNT_TO_TRANSFER)) + .to.be.revertedWithCustomError(this.cmtat, 'ERC20InsufficientBalance') + .withArgs(this.address1.address, ADDRESS1_BALANCE, AMOUNT_TO_TRANSFER) }); }); @@ -268,13 +259,11 @@ function ERC20BaseModuleCommon() { const ADDRESS1_BALANCE = await this.cmtat.balanceOf(this.address1); const AMOUNT_TO_TRANSFER = 50n; // Act - await expectRevertCustomError( - this.cmtat - .connect(this.address1) - .transfer(this.address2, AMOUNT_TO_TRANSFER), - "ERC20InsufficientBalance", - [this.address1.address, ADDRESS1_BALANCE, AMOUNT_TO_TRANSFER] - ); + await expect( this.cmtat + .connect(this.address1) + .transfer(this.address2, AMOUNT_TO_TRANSFER)) + .to.be.revertedWithCustomError(this.cmtat, 'ERC20InsufficientBalance') + .withArgs(this.address1.address, ADDRESS1_BALANCE, AMOUNT_TO_TRANSFER) }); }); @@ -325,25 +314,18 @@ function ERC20BaseModuleCommon() { TOKEN_AMOUNTS[2], ]; // Act - await expectRevertCustomError( - this.cmtat - .connect(this.admin) - .transferBatch(TOKEN_ADDRESS_TOS, TOKEN_AMOUNTS_INVALID), - "ERC20InsufficientBalance", - [this.admin.address, BALANCE_AFTER_FIRST_TRANSFER, AMOUNT_TO_TRANSFER_SECOND] - ); + await expect( this.cmtat + .connect(this.admin) + .transferBatch(TOKEN_ADDRESS_TOS, TOKEN_AMOUNTS_INVALID)) + .to.be.revertedWithCustomError(this.cmtat, 'ERC20InsufficientBalance') + .withArgs(this.admin.address, BALANCE_AFTER_FIRST_TRANSFER, AMOUNT_TO_TRANSFER_SECOND) }); it("testCannotTransferBatchIfLengthMismatchMissingAddresses", async function () { // Number of addresses is insufficient const TOKEN_ADDRESS_TOS_INVALID = [this.address1, this.address2]; - await expectRevertCustomError( - this.cmtat - .connect(this.admin) - .transferBatch(TOKEN_ADDRESS_TOS_INVALID, TOKEN_AMOUNTS), - "CMTAT_ERC20BaseModule_TosValueslengthMismatch", - [] - ); + await expect(this.cmtat.connect(this.admin).transferBatch(TOKEN_ADDRESS_TOS_INVALID, TOKEN_AMOUNTS)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_ERC20BaseModule_TosValueslengthMismatch') }); it("testCannotTransferBatchIfLengthMismatchTooManyAddresses", async function () { @@ -354,24 +336,14 @@ function ERC20BaseModuleCommon() { this.address1, this.address1, ]; - await expectRevertCustomError( - this.cmtat - .connect(this.admin) - .transferBatch(TOKEN_ADDRESS_TOS_INVALID, TOKEN_AMOUNTS), - "CMTAT_ERC20BaseModule_TosValueslengthMismatch", - [] - ); + await expect(this.cmtat.connect(this.admin).transferBatch(TOKEN_ADDRESS_TOS_INVALID, TOKEN_AMOUNTS)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_ERC20BaseModule_TosValueslengthMismatch') }); it("testCannotTransferBatchIfTOSIsEmpty", async function () { const TOKEN_ADDRESS_TOS_INVALID = []; - await expectRevertCustomError( - this.cmtat - .connect(this.admin) - .transferBatch(TOKEN_ADDRESS_TOS_INVALID, TOKEN_AMOUNTS), - "CMTAT_ERC20BaseModule_EmptyTos", - [] - ); + await expect(this.cmtat.connect(this.admin).transferBatch(TOKEN_ADDRESS_TOS_INVALID, TOKEN_AMOUNTS)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_ERC20BaseModule_EmptyTos') }); }); } diff --git a/test/common/ERC20BurnModuleCommon.js b/test/common/ERC20BurnModuleCommon.js index ef0779f8..e3dd16a3 100644 --- a/test/common/ERC20BurnModuleCommon.js +++ b/test/common/ERC20BurnModuleCommon.js @@ -4,9 +4,6 @@ const { MINTER_ROLE, ZERO_ADDRESS } = require('../utils') -const { - expectRevertCustomError -} = require('../../openzeppelin-contracts-upgradeable/test/helpers/customError.js') const { expect } = require('chai'); function ERC20BurnModuleCommon () { @@ -77,19 +74,15 @@ function ERC20BurnModuleCommon () { const AMOUNT_TO_BURN = 200n const ADDRESS1_BALANCE = await this.cmtat.balanceOf(this.address1) // Act - await expectRevertCustomError( - this.cmtat.connect(this.admin).burn(this.address1, AMOUNT_TO_BURN, ''), - 'ERC20InsufficientBalance', - [this.address1.address, ADDRESS1_BALANCE, AMOUNT_TO_BURN] - ) + await expect( this.cmtat.connect(this.admin).burn(this.address1, AMOUNT_TO_BURN, '')) + .to.be.revertedWithCustomError(this.cmtat, 'ERC20InsufficientBalance') + .withArgs(this.address1.address, ADDRESS1_BALANCE, AMOUNT_TO_BURN); }) it('testCannotBeBurntWithoutBurnerRole', async function () { - await expectRevertCustomError( - this.cmtat.connect(this.address2).burn(this.address1, 20n, ''), - 'AccessControlUnauthorizedAccount', - [this.address2.address, BURNER_ROLE] - ) + await expect( this.cmtat.connect(this.address2).burn(this.address1, 20n, '')) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address2.address, BURNER_ROLE); }) }) @@ -124,19 +117,15 @@ function ERC20BurnModuleCommon () { it('TestCannotBeBurnWithoutAllowance', async function () { const AMOUNT_TO_BURN = 20n - await expectRevertCustomError( - this.cmtat.connect(this.admin).burnFrom(this.address1, AMOUNT_TO_BURN), - 'ERC20InsufficientAllowance', - [this.admin.address, 0, AMOUNT_TO_BURN] - ) + await expect( this.cmtat.connect(this.admin).burnFrom(this.address1, AMOUNT_TO_BURN)) + .to.be.revertedWithCustomError(this.cmtat, 'ERC20InsufficientAllowance') + .withArgs(this.admin.address, 0, AMOUNT_TO_BURN); }) it('testCannotBeBurntWithoutBurnerFromRole', async function () { - await expectRevertCustomError( - this.cmtat.connect(this.address2).burnFrom(this.address1, 20n), - 'AccessControlUnauthorizedAccount', - [this.address2.address, BURNER_FROM_ROLE] - ) + await expect( this.cmtat.connect(this.address2).burnFrom(this.address1, 20n)) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address2.address, BURNER_FROM_ROLE); }) }) @@ -199,17 +188,15 @@ function ERC20BurnModuleCommon () { const AMOUNT_TO_MINT = 15n await this.cmtat.connect(this.admin).grantRole(BURNER_ROLE, this.address2) // Act - await expectRevertCustomError( - this.cmtat.connect(this.address2).burnAndMint( - this.address1, - this.address3, - AMOUNT_TO_BURN, - AMOUNT_TO_MINT, - 'recovery' - ), - 'AccessControlUnauthorizedAccount', - [this.address2.address, MINTER_ROLE] - ) + await expect( this.cmtat.connect(this.address2).burnAndMint( + this.address1, + this.address3, + AMOUNT_TO_BURN, + AMOUNT_TO_MINT, + 'recovery' + )) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address2.address, MINTER_ROLE); }) it('canBeBurnAndMintWithoutBurnerRole', async function () { @@ -218,17 +205,15 @@ function ERC20BurnModuleCommon () { const AMOUNT_TO_MINT = 15n await this.cmtat.connect(this.admin).grantRole(MINTER_ROLE, this.address2) // Assert - await expectRevertCustomError( - this.cmtat.connect(this.address2).burnAndMint( - this.address1, - this.address3, - AMOUNT_TO_BURN, - AMOUNT_TO_MINT, - 'recovery' - ), - 'AccessControlUnauthorizedAccount', - [this.address2.address, BURNER_ROLE] - ) + await expect( this.cmtat.connect(this.address2).burnAndMint( + this.address1, + this.address3, + AMOUNT_TO_BURN, + AMOUNT_TO_MINT, + 'recovery' + )) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address2.address, BURNER_ROLE); }) }) @@ -342,66 +327,53 @@ function ERC20BurnModuleCommon () { ) }) - it('testCannotBeBurntIfOneBalanceExceeds', async function () { + it('testCannotBeBurntBatchIfOneBalanceExceeds', async function () { const TOKEN_HOLDER = [this.admin, this.address1, this.address2] const TOKEN_BY_HOLDERS_TO_BURN_FAIL = [5n, 50n, 5000000n] const ADDRESS2_BALANCE = await this.cmtat.balanceOf(this.address2) // Act - await expectRevertCustomError( - this.cmtat.connect(this.admin).burnBatch(TOKEN_HOLDER, TOKEN_BY_HOLDERS_TO_BURN_FAIL, ''), - 'ERC20InsufficientBalance', - [this.address2.address, ADDRESS2_BALANCE, TOKEN_BY_HOLDERS_TO_BURN_FAIL[2]] - ) + await expect( this.cmtat.connect(this.admin).burnBatch(TOKEN_HOLDER, TOKEN_BY_HOLDERS_TO_BURN_FAIL, '')) + .to.be.revertedWithCustomError(this.cmtat, 'ERC20InsufficientBalance') + .withArgs(this.address2.address, ADDRESS2_BALANCE, TOKEN_BY_HOLDERS_TO_BURN_FAIL[2]); }) - it('testCannotBeBurntWithoutBurnerRole', async function () { + it('testCannotBeBurntBatchWithoutBurnerRole', async function () { const TOKEN_HOLDER = [this.admin, this.address1, this.address2] - await expectRevertCustomError( - this.cmtat.connect(this.address2).burnBatch(TOKEN_HOLDER, TOKEN_BY_HOLDERS_TO_BURN, ''), - 'AccessControlUnauthorizedAccount', - [this.address2.address, BURNER_ROLE] - ) + await expect( this.cmtat.connect(this.address2).burnBatch(TOKEN_HOLDER, TOKEN_BY_HOLDERS_TO_BURN, '')) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address2.address, BURNER_ROLE); }) it('testCannotburnBatchIfLengthMismatchMissingAddresses', async function () { // Number of addresses is insufficient const TOKEN_HOLDER_INVALID = [this.admin, this.address1] - await expectRevertCustomError( - this.cmtat.connect(this.admin).burnBatch( - TOKEN_HOLDER_INVALID, - TOKEN_BY_HOLDERS_TO_BURN, - REASON - ), - 'CMTAT_BurnModule_AccountsValueslengthMismatch', - [] - ) + await expect(this.cmtat.connect(this.admin).burnBatch( + TOKEN_HOLDER_INVALID, + TOKEN_BY_HOLDERS_TO_BURN, + REASON + )) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_BurnModule_AccountsValueslengthMismatch') }) it('testCannotburnBatchIfLengthMismatchTooManyAddresses', async function () { // There are too many addresses const TOKEN_HOLDER_INVALID = [this.admin, this.address1, this.address1, this.address1] - await expectRevertCustomError( - this.cmtat.connect(this.admin).burnBatch( - TOKEN_HOLDER_INVALID, - TOKEN_BY_HOLDERS_TO_BURN, - REASON - ), - 'CMTAT_BurnModule_AccountsValueslengthMismatch', - [] - ) + await expect(this.cmtat.connect(this.admin).burnBatch( + TOKEN_HOLDER_INVALID, + TOKEN_BY_HOLDERS_TO_BURN, + REASON + )) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_BurnModule_AccountsValueslengthMismatch') }) it('testCannotburnBatchIfAccountsIsEmpty', async function () { const TOKEN_ADDRESS_TOS_INVALID = [] - await expectRevertCustomError( - this.cmtat.connect(this.admin).burnBatch( - TOKEN_ADDRESS_TOS_INVALID, - TOKEN_BY_HOLDERS_TO_BURN, - REASON - ), - 'CMTAT_BurnModule_EmptyAccounts', - [] - ) + await expect(this.cmtat.connect(this.admin).burnBatch( + TOKEN_ADDRESS_TOS_INVALID, + TOKEN_BY_HOLDERS_TO_BURN, + REASON + )) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_BurnModule_EmptyAccounts') }) }) } diff --git a/test/common/ERC20MintModuleCommon.js b/test/common/ERC20MintModuleCommon.js index de2b398b..a51b6a6b 100644 --- a/test/common/ERC20MintModuleCommon.js +++ b/test/common/ERC20MintModuleCommon.js @@ -1,7 +1,4 @@ const { expect } = require('chai'); -const { - expectRevertCustomError, -} = require("../../openzeppelin-contracts-upgradeable/test/helpers/customError.js"); const { ZERO_ADDRESS, MINTER_ROLE } = require("../utils.js"); function ERC20MintModuleCommon() { @@ -91,11 +88,9 @@ function ERC20MintModuleCommon() { // reverts when issuing by a non minter it("testCannotMintByNonMinter", async function () { - await expectRevertCustomError( - this.cmtat.connect(this.address1).mint(this.address1, VALUE1), - "AccessControlUnauthorizedAccount", - [this.address1.address, MINTER_ROLE] - ); + await expect( this.cmtat.connect(this.address1).mint(this.address1, VALUE1)) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address1.address, MINTER_ROLE); }); }); @@ -194,26 +189,21 @@ function ERC20MintModuleCommon() { it("testCannotMintBatchByNonMinter", async function () { const TOKEN_HOLDER = [this.admin, this.address1, this.address2]; const TOKEN_SUPPLY_BY_HOLDERS = [10n, 100n, 1000n]; - await expectRevertCustomError( - this.cmtat - .connect(this.address1) - .mintBatch(TOKEN_HOLDER, TOKEN_SUPPLY_BY_HOLDERS), - "AccessControlUnauthorizedAccount", - [this.address1.address, MINTER_ROLE] - ); + await expect( this.cmtat + .connect(this.address1) + .mintBatch(TOKEN_HOLDER, TOKEN_SUPPLY_BY_HOLDERS)) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address1.address, MINTER_ROLE); }); it("testCannotMintBatchIfLengthMismatchMissingAddresses", async function () { // Number of addresses is insufficient const TOKEN_HOLDER_INVALID = [this.admin, this.address1]; const TOKEN_SUPPLY_BY_HOLDERS = [10n, 100n, 1000n]; - await expectRevertCustomError( - this.cmtat - .connect(this.admin) - .mintBatch(TOKEN_HOLDER_INVALID, TOKEN_SUPPLY_BY_HOLDERS), - "CMTAT_MintModule_AccountsValueslengthMismatch", - [] - ); + await expect( this.cmtat + .connect(this.admin) + .mintBatch(TOKEN_HOLDER_INVALID, TOKEN_SUPPLY_BY_HOLDERS)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_MintModule_AccountsValueslengthMismatch') }); it("testCannotMintBatchIfLengthMismatchTooManyAddresses", async function () { @@ -225,25 +215,20 @@ function ERC20MintModuleCommon() { this.address1, ]; const TOKEN_SUPPLY_BY_HOLDERS = [10n, 100n, 1000n]; - await expectRevertCustomError( - this.cmtat - .connect(this.admin) - .mintBatch(TOKEN_HOLDER_INVALID, TOKEN_SUPPLY_BY_HOLDERS), - "CMTAT_MintModule_AccountsValueslengthMismatch", - [] - ); + await expect( this.cmtat + .connect(this.admin) + .mintBatch(TOKEN_HOLDER_INVALID, TOKEN_SUPPLY_BY_HOLDERS)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_MintModule_AccountsValueslengthMismatch') }); it("testCannotMintBatchIfTOSIsEmpty", async function () { const TOKEN_HOLDER_INVALID = []; const TOKEN_SUPPLY_BY_HOLDERS = []; - await expectRevertCustomError( - this.cmtat - .connect(this.admin) - .mintBatch(TOKEN_HOLDER_INVALID, TOKEN_SUPPLY_BY_HOLDERS), - "CMTAT_MintModule_EmptyAccounts", - [] - ); + await expect( this.cmtat + .connect(this.admin) + .mintBatch(TOKEN_HOLDER_INVALID, TOKEN_SUPPLY_BY_HOLDERS)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_MintModule_EmptyAccounts') + }); }); } diff --git a/test/common/ERC20SnapshotModuleCommon/ERC20SnapshotModuleCommonRescheduling.js b/test/common/ERC20SnapshotModuleCommon/ERC20SnapshotModuleCommonRescheduling.js index a87a7370..ef51825c 100644 --- a/test/common/ERC20SnapshotModuleCommon/ERC20SnapshotModuleCommonRescheduling.js +++ b/test/common/ERC20SnapshotModuleCommon/ERC20SnapshotModuleCommonRescheduling.js @@ -1,8 +1,5 @@ const { time } = require ("@nomicfoundation/hardhat-network-helpers"); const { expect } = require('chai'); -const { - expectRevertCustomError -} = require('../../../openzeppelin-contracts-upgradeable/test/helpers/customError') const { SNAPSHOOTER_ROLE } = require('../../utils') const { checkArraySnapshot @@ -67,14 +64,15 @@ function ERC20SnapshotModuleCommonRescheduling () { await this.cmtat.connect(this.admin).scheduleSnapshot(SNAPSHOT_MIDDLE_OLD_TIME) await this.cmtat.connect(this.admin).scheduleSnapshot(FIRST_SNAPSHOT) await this.cmtat.connect(this.admin).scheduleSnapshot(SECOND_SNAPSHOT) - await expectRevertCustomError( - this.cmtat.connect(this.admin).rescheduleSnapshot( - SNAPSHOT_MIDDLE_OLD_TIME, - SNAPSHOT_MIDDLE_NEW_TIME - ), - 'CMTAT_SnapshotModule_SnapshotTimestampAfterNextSnapshot', - [SNAPSHOT_MIDDLE_NEW_TIME, FIRST_SNAPSHOT] + // Act + await expect( this.cmtat.connect(this.admin).rescheduleSnapshot( + SNAPSHOT_MIDDLE_OLD_TIME, + SNAPSHOT_MIDDLE_NEW_TIME + )) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_SnapshotModule_SnapshotTimestampAfterNextSnapshot').withArgs( + SNAPSHOT_MIDDLE_NEW_TIME, FIRST_SNAPSHOT ) + // Assert const snapshots = await this.cmtat.getNextSnapshots() expect(snapshots.length).to.equal(4) checkArraySnapshot(snapshots, [ @@ -95,14 +93,15 @@ function ERC20SnapshotModuleCommonRescheduling () { await this.cmtat.connect(this.admin).scheduleSnapshot(SNAPSHOT_MIDDLE_OLD_TIME) await this.cmtat.connect(this.admin).scheduleSnapshot(FIRST_SNAPSHOT) await this.cmtat.connect(this.admin).scheduleSnapshot(SECOND_SNAPSHOT) - await expectRevertCustomError( - this.cmtat.connect(this.admin).rescheduleSnapshot( - SNAPSHOT_MIDDLE_OLD_TIME, - SNAPSHOT_MIDDLE_NEW_TIME - ), - 'CMTAT_SnapshotModule_SnapshotTimestampBeforePreviousSnapshot', - [SNAPSHOT_MIDDLE_NEW_TIME, this.snapshotTime] - ) + // Act + await expect( this.cmtat.connect(this.admin).rescheduleSnapshot( + SNAPSHOT_MIDDLE_OLD_TIME, + SNAPSHOT_MIDDLE_NEW_TIME + )) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_SnapshotModule_SnapshotTimestampBeforePreviousSnapshot').withArgs( + SNAPSHOT_MIDDLE_NEW_TIME, this.snapshotTime) + + // Assert const snapshots = await this.cmtat.getNextSnapshots() expect(snapshots.length).to.equal(4) checkArraySnapshot(snapshots, [ @@ -115,30 +114,23 @@ function ERC20SnapshotModuleCommonRescheduling () { it('reverts when calling from non-owner', async function () { // Act - await expectRevertCustomError( - this.cmtat.connect(this.address1).rescheduleSnapshot(this.snapshotTime, this.newSnapshotTime), - 'AccessControlUnauthorizedAccount', - [this.address1.address, SNAPSHOOTER_ROLE] - ) + await expect( this.cmtat.connect(this.address1).rescheduleSnapshot(this.snapshotTime, this.newSnapshotTime)) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address1.address, SNAPSHOOTER_ROLE); }) it('reverts when trying to reschedule a snapshot in the past', async function () { const NEW_TIME = this.snapshotTime - time.duration.seconds(60) - await expectRevertCustomError( - this.cmtat.connect(this.admin).rescheduleSnapshot(this.snapshotTime, NEW_TIME), - 'CMTAT_SnapshotModule_SnapshotScheduledInThePast', - [NEW_TIME, (await time.latest()) + time.duration.seconds(1)] - ) + await expect( this.cmtat.connect(this.admin).rescheduleSnapshot(this.snapshotTime, NEW_TIME)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_SnapshotModule_SnapshotScheduledInThePast') + .withArgs(NEW_TIME, (await time.latest()) + time.duration.seconds(1)); }) it('reverts when trying to reschedule a snapshot to a snapshot time already existing', async function () { const NEW_TIME = this.snapshotTime + time.duration.seconds(60) await this.cmtat.connect(this.admin).scheduleSnapshot(NEW_TIME) - await expectRevertCustomError( - this.cmtat.connect(this.admin).rescheduleSnapshot(this.snapshotTime, NEW_TIME), - 'CMTAT_SnapshotModule_SnapshotAlreadyExists', - [] - ) + await expect(this.cmtat.connect(this.admin).rescheduleSnapshot(this.snapshotTime, NEW_TIME)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_SnapshotModule_SnapshotAlreadyExists') }) it('reverts when trying to schedule a snapshot with the same time twice', async function () { @@ -154,11 +146,8 @@ function ERC20SnapshotModuleCommonRescheduling () { // Act We try to reschedule the previous snapshot */ - await expectRevertCustomError( - this.cmtat.connect(this.admin).rescheduleSnapshot(this.snapshotTime, this.newSnapshotTime), - 'CMTAT_SnapshotModule_SnapshotNotFound', - [] - ) + await expect(this.cmtat.connect(this.admin).rescheduleSnapshot(this.snapshotTime, this.newSnapshotTime)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_SnapshotModule_SnapshotNotFound') // Assert const snapshots = await this.cmtat.getNextSnapshots() expect(snapshots.length).to.equal(1) @@ -167,29 +156,20 @@ function ERC20SnapshotModuleCommonRescheduling () { it('reverts when snapshot is not found', async function () { const SNAPSHOT_TIME = this.currentTime + time.duration.seconds(90) - await expectRevertCustomError( - this.cmtat.connect(this.admin).rescheduleSnapshot(SNAPSHOT_TIME, this.newSnapshotTime), - 'CMTAT_SnapshotModule_SnapshotNotFound', - [] - ) + await expect(this.cmtat.connect(this.admin).rescheduleSnapshot(SNAPSHOT_TIME, this.newSnapshotTime)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_SnapshotModule_SnapshotNotFound') }) it('reverts if no snapshot exits', async function () { this.logs = await this.cmtat.connect(this.admin).unscheduleLastSnapshot(this.snapshotTime) - await expectRevertCustomError( - this.cmtat.connect(this.admin).rescheduleSnapshot(this.snapshotTime, this.newSnapshotTime), - 'CMTAT_SnapshotModule_NoSnapshotScheduled', - [] - ) + await expect(this.cmtat.connect(this.admin).rescheduleSnapshot(this.snapshotTime, this.newSnapshotTime)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_SnapshotModule_NoSnapshotScheduled') }) it('reverts when snapshot has been processed', async function () { const SNAPSHOT_TIME = this.currentTime - time.duration.seconds(60) - await expectRevertCustomError( - this.cmtat.connect(this.admin).rescheduleSnapshot(SNAPSHOT_TIME, this.newSnapshotTime), - 'CMTAT_SnapshotModule_SnapshotAlreadyDone', - [] - ) + await expect(this.cmtat.connect(this.admin).rescheduleSnapshot(SNAPSHOT_TIME, this.newSnapshotTime)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_SnapshotModule_SnapshotAlreadyDone') }) }) } diff --git a/test/common/ERC20SnapshotModuleCommon/ERC20SnapshotModuleCommonScheduling.js b/test/common/ERC20SnapshotModuleCommon/ERC20SnapshotModuleCommonScheduling.js index ed45feb8..54e5c304 100644 --- a/test/common/ERC20SnapshotModuleCommon/ERC20SnapshotModuleCommonScheduling.js +++ b/test/common/ERC20SnapshotModuleCommon/ERC20SnapshotModuleCommonScheduling.js @@ -1,8 +1,5 @@ const { time } = require ("@nomicfoundation/hardhat-network-helpers"); const { expect } = require('chai'); -const { - expectRevertCustomError -} = require('../../../openzeppelin-contracts-upgradeable/test/helpers/customError') const { SNAPSHOOTER_ROLE } = require('../../utils') const { checkArraySnapshot @@ -30,11 +27,9 @@ function ERC20SnapshotModuleCommonScheduling () { it('reverts when calling from non-admin', async function () { const SNAPSHOT_TIME = this.currentTime + time.duration.seconds(60) - await expectRevertCustomError( - this.cmtat.connect(this.address1).scheduleSnapshot(SNAPSHOT_TIME), - 'AccessControlUnauthorizedAccount', - [this.address1.address, SNAPSHOOTER_ROLE] - ) + await expect( this.cmtat.connect(this.address1).scheduleSnapshot(SNAPSHOT_TIME)) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address1.address, SNAPSHOOTER_ROLE); }) it('reverts when trying to schedule a snapshot before the last snapshot', async function () { @@ -43,20 +38,16 @@ function ERC20SnapshotModuleCommonScheduling () { this.logs = await this.cmtat.connect(this.admin).scheduleSnapshot(SNAPSHOT_TIME) const SNAPSHOT_TIME_INVALID = SNAPSHOT_TIME - time.duration.seconds(60) - await expectRevertCustomError( - this.cmtat.connect(this.admin).scheduleSnapshot(SNAPSHOT_TIME_INVALID), - 'CMTAT_SnapshotModule_SnapshotTimestampBeforeLastSnapshot', - [SNAPSHOT_TIME_INVALID, SNAPSHOT_TIME] - ) + await expect( this.cmtat.connect(this.admin).scheduleSnapshot(SNAPSHOT_TIME_INVALID)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_SnapshotModule_SnapshotTimestampBeforeLastSnapshot') + .withArgs(SNAPSHOT_TIME_INVALID, SNAPSHOT_TIME) }) it('reverts when trying to schedule a snapshot in the past', async function () { const SNAPSHOT_TIME = this.currentTime - time.duration.seconds(60) - await expectRevertCustomError( - this.cmtat.connect(this.admin).scheduleSnapshot(SNAPSHOT_TIME), - 'CMTAT_SnapshotModule_SnapshotScheduledInThePast', - [SNAPSHOT_TIME, (await time.latest()) + time.duration.seconds(1)] - ) + await expect( this.cmtat.connect(this.admin).scheduleSnapshot(SNAPSHOT_TIME)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_SnapshotModule_SnapshotScheduledInThePast') + .withArgs(SNAPSHOT_TIME, (await time.latest()) + time.duration.seconds(1)) }) it('reverts when trying to schedule a snapshot with the same time twice', async function () { @@ -64,11 +55,8 @@ function ERC20SnapshotModuleCommonScheduling () { // Arrange await this.cmtat.connect(this.admin).scheduleSnapshot(SNAPSHOT_TIME) // Act - await expectRevertCustomError( - this.cmtat.connect(this.admin).scheduleSnapshot(SNAPSHOT_TIME), - 'CMTAT_SnapshotModule_SnapshotAlreadyExists', - [] - ) + await expect(this.cmtat.connect(this.admin).scheduleSnapshot(SNAPSHOT_TIME)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_SnapshotModule_SnapshotAlreadyExists') // Assert const snapshots = await this.cmtat.getNextSnapshots() expect(snapshots.length).to.equal(1) @@ -143,20 +131,16 @@ function ERC20SnapshotModuleCommonScheduling () { it('reverts when calling from non-admin', async function () { const SNAPSHOT_TIME = this.currentTime + time.duration.seconds(60) - await expectRevertCustomError( - this.cmtat.connect(this.address1).scheduleSnapshotNotOptimized(SNAPSHOT_TIME), - 'AccessControlUnauthorizedAccount', - [this.address1.address, SNAPSHOOTER_ROLE] - ) + await expect( this.cmtat.connect(this.address1).scheduleSnapshotNotOptimized(SNAPSHOT_TIME)) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address1.address, SNAPSHOOTER_ROLE); }) it('reverts when trying to schedule a snapshot in the past', async function () { const SNAPSHOT_TIME = this.currentTime - time.duration.seconds(60) - await expectRevertCustomError( - this.cmtat.connect(this.admin).scheduleSnapshotNotOptimized(SNAPSHOT_TIME), - 'CMTAT_SnapshotModule_SnapshotScheduledInThePast', - [SNAPSHOT_TIME, (await time.latest()) + time.duration.seconds(1)] - ) + await expect( this.cmtat.connect(this.admin).scheduleSnapshotNotOptimized(SNAPSHOT_TIME)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_SnapshotModule_SnapshotScheduledInThePast') + .withArgs(SNAPSHOT_TIME, (await time.latest()) + time.duration.seconds(1)) }) it('reverts when trying to schedule a snapshot with the same time twice', async function () { @@ -166,11 +150,8 @@ function ERC20SnapshotModuleCommonScheduling () { this.logs = await this.cmtat.connect(this.admin).scheduleSnapshot(FIRST_SNAPSHOT) this.logs = await this.cmtat.connect(this.admin).scheduleSnapshot(SECOND_SNAPSHOT) // Act - await expectRevertCustomError( - this.cmtat.connect(this.admin).scheduleSnapshotNotOptimized(FIRST_SNAPSHOT), - 'CMTAT_SnapshotModule_SnapshotAlreadyExists', - [] - ) + await expect( this.cmtat.connect(this.admin).scheduleSnapshotNotOptimized(FIRST_SNAPSHOT)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_SnapshotModule_SnapshotAlreadyExists') // Assert const snapshots = await this.cmtat.getNextSnapshots() expect(snapshots.length).to.equal(2) diff --git a/test/common/ERC20SnapshotModuleCommon/ERC20SnapshotModuleCommonUnschedule.js b/test/common/ERC20SnapshotModuleCommon/ERC20SnapshotModuleCommonUnschedule.js index 900a179a..3b7edefa 100644 --- a/test/common/ERC20SnapshotModuleCommon/ERC20SnapshotModuleCommonUnschedule.js +++ b/test/common/ERC20SnapshotModuleCommon/ERC20SnapshotModuleCommonUnschedule.js @@ -1,8 +1,5 @@ const { time } = require ("@nomicfoundation/hardhat-network-helpers"); const { expect } = require('chai'); -const { - expectRevertCustomError -} = require('../../../openzeppelin-contracts-upgradeable/test/helpers/customError') const { SNAPSHOOTER_ROLE } = require('../../utils') const { checkArraySnapshot @@ -52,22 +49,16 @@ function ERC20SnapshotModuleCommonUnschedule () { const SNAPSHOT_TIME = this.currentTime + time.duration.seconds(60) let snapshots = await this.cmtat.getNextSnapshots() expect(snapshots.length).to.equal(0) - await expectRevertCustomError( - this.cmtat.connect(this.admin).unscheduleSnapshotNotOptimized(SNAPSHOT_TIME), - 'CMTAT_SnapshotModule_SnapshotNotFound', - [] - ) + await expect(this.cmtat.connect(this.admin).unscheduleSnapshotNotOptimized(SNAPSHOT_TIME)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_SnapshotModule_SnapshotNotFound') snapshots = await this.cmtat.getNextSnapshots() expect(snapshots.length).to.equal(0) }) it('testCannotUnscheduleASnapshotInThePast', async function () { const SNAPSHOT_TIME = this.currentTime - time.duration.seconds(60) - await expectRevertCustomError( - this.cmtat.connect(this.admin).unscheduleSnapshotNotOptimized(SNAPSHOT_TIME), - 'CMTAT_SnapshotModule_SnapshotAlreadyDone', - [] - ) + await expect(this.cmtat.connect(this.admin).unscheduleLastSnapshot(SNAPSHOT_TIME)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_SnapshotModule_SnapshotAlreadyDone') }) it('can unschedule a snaphot in a random place', async function () { @@ -132,11 +123,9 @@ function ERC20SnapshotModuleCommonUnschedule () { expect(snapshots.length).to.equal(1) expect(snapshots[0]).to.equal(SNAPSHOT_TIME) // Act - await expectRevertCustomError( - this.cmtat.connect(this.address1).unscheduleSnapshotNotOptimized(SNAPSHOT_TIME), - 'AccessControlUnauthorizedAccount', - [this.address1.address, SNAPSHOOTER_ROLE] - ) + await expect( this.cmtat.connect(this.address1).scheduleSnapshotNotOptimized(SNAPSHOT_TIME)) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address1.address, SNAPSHOOTER_ROLE) // Assert snapshots = await this.cmtat.getNextSnapshots() expect(snapshots.length).to.equal(1) @@ -160,11 +149,9 @@ function ERC20SnapshotModuleCommonUnschedule () { }) it('reverts when calling from non-admin', async function () { - await expectRevertCustomError( - this.cmtat.connect(this.address1).unscheduleLastSnapshot(this.snapshotTime), - 'AccessControlUnauthorizedAccount', - [this.address1.address, SNAPSHOOTER_ROLE] - ) + await expect( this.cmtat.connect(this.address1).unscheduleLastSnapshot(this.snapshotTime)) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address1.address, SNAPSHOOTER_ROLE) }) it('reverts if no snapshot is scheduled', async function () { @@ -173,30 +160,21 @@ function ERC20SnapshotModuleCommonUnschedule () { // Delete the only snapshot this.logs = await this.cmtat.connect(this.admin).unscheduleLastSnapshot(this.snapshotTime) // Act - await expectRevertCustomError( - this.cmtat.connect(this.admin).unscheduleLastSnapshot(SNAPSHOT_TIME), - 'CMTAT_SnapshotModule_NoSnapshotScheduled', - [] - ) + await expect(this.cmtat.connect(this.admin).unscheduleLastSnapshot(SNAPSHOT_TIME)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_SnapshotModule_NoSnapshotScheduled') }) it('reverts when snapshot is not found', async function () { const SNAPSHOT_TIME = this.currentTime + time.duration.seconds(90) // Act - await expectRevertCustomError( - this.cmtat.connect(this.admin).unscheduleLastSnapshot(SNAPSHOT_TIME), - 'CMTAT_SnapshotModule_SnapshotNotFound', - [] - ) + await expect(this.cmtat.connect(this.admin).unscheduleLastSnapshot(SNAPSHOT_TIME)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_SnapshotModule_SnapshotNotFound') }) it('reverts when snapshot has been processed', async function () { const SNAPSHOT_TIME = this.currentTime - time.duration.seconds(60) - await expectRevertCustomError( - this.cmtat.connect(this.admin).unscheduleLastSnapshot(SNAPSHOT_TIME), - 'CMTAT_SnapshotModule_SnapshotAlreadyDone', - [] - ) + await expect(this.cmtat.connect(this.admin).unscheduleLastSnapshot(SNAPSHOT_TIME)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_SnapshotModule_SnapshotAlreadyDone') }) }) } diff --git a/test/common/EnforcementModuleCommon.js b/test/common/EnforcementModuleCommon.js index c285a503..8ba58094 100644 --- a/test/common/EnforcementModuleCommon.js +++ b/test/common/EnforcementModuleCommon.js @@ -1,8 +1,5 @@ const { ENFORCER_ROLE } = require('../utils') const { expect } = require('chai'); -const { - expectRevertCustomError -} = require('../../openzeppelin-contracts-upgradeable/test/helpers/customError.js') const reasonFreeze = 'testFreeze' const reasonUnfreeze = 'testUnfreeze' @@ -101,11 +98,9 @@ function EnforcementModuleCommon () { it('testCannotNonEnforcerFreezeAddress', async function () { // Act - await expectRevertCustomError( - this.cmtat.connect(this.address2).freeze(this.address1, reasonFreeze), - 'AccessControlUnauthorizedAccount', - [this.address2.address, ENFORCER_ROLE] - ); + await expect( this.cmtat.connect(this.address2).freeze(this.address1, reasonFreeze)) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address2.address, ENFORCER_ROLE); // Assert expect(await this.cmtat.frozen(this.address1)).to.equal(false) }) @@ -114,11 +109,9 @@ function EnforcementModuleCommon () { // Arrange await this.cmtat.connect(this.admin).freeze(this.address1, reasonFreeze) // Act - await expectRevertCustomError( - this.cmtat.connect(this.address2).unfreeze(this.address1, reasonUnfreeze), - 'AccessControlUnauthorizedAccount', - [this.address2.address, ENFORCER_ROLE] - ); + await expect( this.cmtat.connect(this.address2).unfreeze(this.address1, reasonFreeze)) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address2.address, ENFORCER_ROLE); // Assert expect(await this.cmtat.frozen(this.address1)).to.equal(true) }) @@ -135,11 +128,9 @@ function EnforcementModuleCommon () { 'Address FROM is frozen' ) const AMOUNT_TO_TRANSFER = 10 - await expectRevertCustomError( - this.cmtat.connect(this.address1).transfer(this.address2, AMOUNT_TO_TRANSFER), - 'CMTAT_InvalidTransfer', - [this.address1.address, this.address2.address, AMOUNT_TO_TRANSFER] - ) + await expect( this.cmtat.connect(this.address1).transfer(this.address2, AMOUNT_TO_TRANSFER)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_InvalidTransfer') + .withArgs(this.address1.address, this.address2.address, AMOUNT_TO_TRANSFER); }) // reverts if address3 transfers tokens from address1 to this.address2 when paused @@ -158,11 +149,9 @@ function EnforcementModuleCommon () { 'Address TO is frozen' ) const AMOUNT_TO_TRANSFER = 10 - await expectRevertCustomError( - this.cmtat.connect(this.address1).transferFrom(this.address3, this.address2, AMOUNT_TO_TRANSFER), - 'CMTAT_InvalidTransfer', - [this.address3.address, this.address2.address, AMOUNT_TO_TRANSFER] - ) + await expect( this.cmtat.connect(this.address1).transferFrom(this.address3, this.address2, AMOUNT_TO_TRANSFER)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_InvalidTransfer') + .withArgs(this.address3.address, this.address2.address, AMOUNT_TO_TRANSFER) }) // Improvement: check the return value but it is not possible to get the return value of a state modifying function diff --git a/test/common/PauseModuleCommon.js b/test/common/PauseModuleCommon.js index d3057b1f..a3794557 100644 --- a/test/common/PauseModuleCommon.js +++ b/test/common/PauseModuleCommon.js @@ -1,6 +1,3 @@ -const { - expectRevertCustomError, -} = require("../../openzeppelin-contracts-upgradeable/test/helpers/customError.js"); const { PAUSER_ROLE, DEFAULT_ADMIN_ROLE } = require("../utils"); const { expect } = require('chai'); function PauseModuleCommon() { @@ -20,13 +17,11 @@ function PauseModuleCommon() { .to.emit(this.cmtat, "Paused") .withArgs(this.admin); // Transfer is reverted - await expectRevertCustomError( - this.cmtat - .connect(this.address1) - .transfer(this.address2, AMOUNT_TO_TRANSFER), - "CMTAT_InvalidTransfer", - [this.address1.address, this.address2.address, AMOUNT_TO_TRANSFER] - ); + await expect( this.cmtat + .connect(this.address1) + .transfer(this.address2, AMOUNT_TO_TRANSFER)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_InvalidTransfer') + .withArgs(this.address1.address, this.address2.address, AMOUNT_TO_TRANSFER); }); it("testCanBePausedByPauserRole", async function () { @@ -46,20 +41,15 @@ function PauseModuleCommon() { .to.emit(this.cmtat, "Paused") .withArgs(this.address1); // Transfer is reverted - await expectRevertCustomError( - this.cmtat.connect(this.address1).transfer(this.address2, AMOUNT_TO_TRANSFER), - "CMTAT_InvalidTransfer", - [this.address1.address, this.address2.address, AMOUNT_TO_TRANSFER] - ); + await expect( this.cmtat.connect(this.address1).transfer(this.address2, AMOUNT_TO_TRANSFER)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_InvalidTransfer') + .withArgs(this.address1.address, this.address2.address, AMOUNT_TO_TRANSFER); }); it("testCannotBePausedByNonPauser", async function () { - // Act - await expectRevertCustomError( - this.cmtat.connect(this.address1).pause(), - "AccessControlUnauthorizedAccount", - [this.address1.address, PAUSER_ROLE] - ); + await expect( this.cmtat.connect(this.address1).pause()) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address1.address, PAUSER_ROLE); }); it("testCanBeUnpausedByAdmin", async function () { @@ -99,11 +89,9 @@ function PauseModuleCommon() { // Arrange await this.cmtat.connect(this.admin).pause(); // Act - await expectRevertCustomError( - this.cmtat.connect(this.address1).unpause(), - "AccessControlUnauthorizedAccount", - [this.address1.address, PAUSER_ROLE] - ); + await expect( this.cmtat.connect(this.address1).unpause()) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address1.address, PAUSER_ROLE); }); // reverts if address1 transfers tokens to address2 when paused @@ -130,13 +118,11 @@ function PauseModuleCommon() { expect(await this.cmtat.messageForTransferRestriction(1)).to.equal( "All transfers paused" ); - await expectRevertCustomError( - this.cmtat - .connect(this.address1) - .transfer(this.address2, AMOUNT_TO_TRANSFER), - "CMTAT_InvalidTransfer", - [this.address1.address, this.address2.address, AMOUNT_TO_TRANSFER] - ); + await expect( this.cmtat + .connect(this.address1) + .transfer(this.address2, AMOUNT_TO_TRANSFER)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_InvalidTransfer') + .withArgs(this.address1.address, this.address2.address, AMOUNT_TO_TRANSFER); }); // reverts if address3 transfers tokens from address1 to address2 when paused @@ -160,13 +146,11 @@ function PauseModuleCommon() { expect(await this.cmtat.messageForTransferRestriction(1)).to.equal( "All transfers paused" ); - await expectRevertCustomError( - this.cmtat - .connect(this.address3) - .transferFrom(this.address1, this.address2, AMOUNT_TO_TRANSFER), - "CMTAT_InvalidTransfer", - [this.address1.address, this.address2.address, AMOUNT_TO_TRANSFER] - ); + await expect( this.cmtat + .connect(this.address3) + .transferFrom(this.address1, this.address2, AMOUNT_TO_TRANSFER)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_InvalidTransfer') + .withArgs(this.address1.address, this.address2.address, AMOUNT_TO_TRANSFER); }); }); @@ -186,27 +170,20 @@ function PauseModuleCommon() { // emits a Deactivated event await expect(this.logs).to.emit(this.cmtat, 'Deactivated').withArgs(this.admin); // Transfer is reverted because contract is in paused state - await expectRevertCustomError( - this.cmtat.connect(this.address1).transfer(this.address2, AMOUNT_TO_TRANSFER), - "CMTAT_InvalidTransfer", - [this.address1.address, this.address2.address, AMOUNT_TO_TRANSFER] - ); + await expect(this.cmtat.connect(this.address1).transfer(this.address2, AMOUNT_TO_TRANSFER)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_InvalidTransfer') + .withArgs(this.address1.address, this.address2.address, AMOUNT_TO_TRANSFER); // Unpause is reverted - await expectRevertCustomError( - this.cmtat.connect(this.admin).unpause(), - "CMTAT_PauseModule_ContractIsDeactivated", - [] - ); + await expect( this.cmtat.connect(this.admin).unpause()) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_PauseModule_ContractIsDeactivated') }); it("testCannotBeDeactivatedByNonAdmin", async function () { // Act - await expectRevertCustomError( - this.cmtat.connect(this.address1).deactivateContract(), - "AccessControlUnauthorizedAccount", - [this.address1.address, DEFAULT_ADMIN_ROLE] - ); + await expect( this.cmtat.connect(this.address1).deactivateContract()) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address1.address, DEFAULT_ADMIN_ROLE); // Assert expect(await this.cmtat.deactivated()).to.equal(false); }); diff --git a/test/common/ValidationModule/ValidationModuleCommon.js b/test/common/ValidationModule/ValidationModuleCommon.js index 1fa89433..26493f0e 100644 --- a/test/common/ValidationModule/ValidationModuleCommon.js +++ b/test/common/ValidationModule/ValidationModuleCommon.js @@ -1,7 +1,4 @@ const { expect } = require('chai'); -const { - expectRevertCustomError -} = require('../../../openzeppelin-contracts-upgradeable/test/helpers/customError') const { RULE_MOCK_AMOUNT_MAX, ZERO_ADDRESS } = require('../../utils') function ValidationModuleCommon () { @@ -114,11 +111,9 @@ function ValidationModuleCommon () { ) ).to.equal(false) // Act - await expectRevertCustomError( - this.cmtat.connect(this.address1).transfer(this.address2, AMOUNT_TO_TRANSFER), - 'CMTAT_InvalidTransfer', - [this.address1.address, this.address2.address, AMOUNT_TO_TRANSFER] - ) + await expect(this.cmtat.connect(this.address1).transfer(this.address2, AMOUNT_TO_TRANSFER)) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_InvalidTransfer') + .withArgs(this.address1.address, this.address2.address, AMOUNT_TO_TRANSFER) }) }) } diff --git a/test/common/ValidationModule/ValidationModuleSetRuleEngineCommon.js b/test/common/ValidationModule/ValidationModuleSetRuleEngineCommon.js index 595afb72..33209258 100644 --- a/test/common/ValidationModule/ValidationModuleSetRuleEngineCommon.js +++ b/test/common/ValidationModule/ValidationModuleSetRuleEngineCommon.js @@ -1,7 +1,4 @@ const { expect } = require('chai'); -const { - expectRevertCustomError -} = require('../../../openzeppelin-contracts-upgradeable/test/helpers/customError.js') const { DEFAULT_ADMIN_ROLE } = require('../../utils') function ValidationModuleSetRuleEngineCommon () { @@ -18,20 +15,15 @@ function ValidationModuleSetRuleEngineCommon () { it('testCanNotBeSetByAdminWithTheSameValue', async function () { // Act - await expectRevertCustomError( - this.cmtat.connect(this.admin).setRuleEngine(await this.cmtat.ruleEngine()), - 'CMTAT_ValidationModule_SameValue', - [] - ) + await expect(this.cmtat.connect(this.admin).setRuleEngine(await this.cmtat.ruleEngine())) + .to.be.revertedWithCustomError(this.cmtat, 'CMTAT_ValidationModule_SameValue') }) it('testCannotBeSetByNonAdmin', async function () { // Act - await expectRevertCustomError( - this.cmtat.connect(this.address1).setRuleEngine(this.ruleEngine), - 'AccessControlUnauthorizedAccount', - [this.address1.address, DEFAULT_ADMIN_ROLE] - ) + await expect( this.cmtat.connect(this.address1).setRuleEngine(this.ruleEngine)) + .to.be.revertedWithCustomError(this.cmtat, 'AccessControlUnauthorizedAccount') + .withArgs(this.address1.address, DEFAULT_ADMIN_ROLE); }) it('testCanReturnMessageWithNoRuleEngine&UnknownRestrictionCode', async function () { diff --git a/test/deployment/deployment.test.js b/test/deployment/deployment.test.js index ffe21d2d..4ef95764 100644 --- a/test/deployment/deployment.test.js +++ b/test/deployment/deployment.test.js @@ -1,55 +1,47 @@ -const { - expectRevertCustomError -} = require('../../openzeppelin-contracts-upgradeable/test/helpers/customError.js') const { ZERO_ADDRESS } = require('../utils') +const { expect } = require('chai'); const { deployCMTATProxyWithParameter, deployCMTATStandaloneWithParameter, + deployCMTATProxy, fixture, loadFixture } = require('../deploymentUtils') describe('CMTAT - Deployment', function () { beforeEach(async function () { Object.assign(this, await loadFixture(fixture)); + this.cmtatCustomError = await deployCMTATProxy(this._.address, this.admin.address, this.deployerAddress.address) }) it('testCannotDeployProxyWithAdminSetToAddressZero', async function () { const DECIMAL = 0 // Act + Assert - await expectRevertCustomError( - deployCMTATProxyWithParameter( - this.deployerAddress.address, - this._.address, - ZERO_ADDRESS, - 'CMTA Token', - 'CMTAT', - DECIMAL, - 'CMTAT_ISIN', - 'https://cmta.ch', - 'CMTAT_info', - [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS] - ), - 'CMTAT_AuthorizationModule_AddressZeroNotAllowed', - [] - ) + await expect( deployCMTATProxyWithParameter( + this.deployerAddress.address, + this._.address, + ZERO_ADDRESS, + 'CMTA Token', + 'CMTAT', + DECIMAL, + 'CMTAT_ISIN', + 'https://cmta.ch', + 'CMTAT_info', + [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS])) + .to.be.revertedWithCustomError( this.cmtatCustomError, 'CMTAT_AuthorizationModule_AddressZeroNotAllowed') }) it('testCannotDeployStandaloneWithAdminSetToAddressZero', async function () { const DECIMAL = 0 // Act + Assert - await expectRevertCustomError( - deployCMTATStandaloneWithParameter( - this.deployerAddress.address, - this._.address, - ZERO_ADDRESS, - 'CMTA Token', - 'CMTAT', - DECIMAL, - 'CMTAT_ISIN', - 'https://cmta.ch', - 'CMTAT_info', - [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS] - ), - 'CMTAT_AuthorizationModule_AddressZeroNotAllowed', - [] - ) + await expect( deployCMTATStandaloneWithParameter( + this.deployerAddress.address, + this._.address, + ZERO_ADDRESS, + 'CMTA Token', + 'CMTAT', + DECIMAL, + 'CMTAT_ISIN', + 'https://cmta.ch', + 'CMTAT_info', + [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS])) + .to.be.revertedWithCustomError( this.cmtatCustomError, 'CMTAT_AuthorizationModule_AddressZeroNotAllowed') }) }) diff --git a/test/deploymentUtils.js b/test/deploymentUtils.js index 309967f9..a5e31992 100644 --- a/test/deploymentUtils.js +++ b/test/deploymentUtils.js @@ -10,12 +10,8 @@ async function deployCMTATStandalone (_, admin, deployerAddress) { const cmtat = await ethers.deployContract("CMTAT_STANDALONE", [ _, admin, - 'CMTA Token', - 'CMTAT', - DEPLOYMENT_DECIMAL, - 'CMTAT_ISIN', - 'https://cmta.ch', - 'CMTAT_info', + ['CMTA Token', 'CMTAT', DEPLOYMENT_DECIMAL], + ['CMTAT_ISIN', 'https://cmta.ch', 'CMTAT_info'], [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS]]); return cmtat } @@ -28,6 +24,14 @@ async function deployCMTATProxyImplementation ( return cmtat } +async function deployCMTATProxyUUPSImplementation ( + deployerAddress, + forwarderIrrevocable +) { + const cmtat = await ethers.deployContract('CMTAT_PROXY_UUPS',[forwarderIrrevocable]) + return cmtat +} + async function deployCMTATStandaloneWithParameter ( deployerAddress, forwarderIrrevocable, @@ -43,12 +47,8 @@ async function deployCMTATStandaloneWithParameter ( const cmtat = await ethers.deployContract('CMTAT_STANDALONE',[ forwarderIrrevocable, admin, - nameIrrevocable, - symbolIrrevocable, - decimalsIrrevocable, - tokenId_, - terms_, - information_, + [ nameIrrevocable, symbolIrrevocable, decimalsIrrevocable], + [tokenId_, terms_, information_], engines ]) return cmtat @@ -63,12 +63,8 @@ async function deployCMTATProxy (_, admin, deployerAddress) { ETHERS_CMTAT_PROXY_FACTORY, [ admin, - 'CMTA Token', - 'CMTAT', - DEPLOYMENT_DECIMAL, - 'CMTAT_ISIN', - 'https://cmta.ch', - 'CMTAT_info', + ['CMTA Token', 'CMTAT', DEPLOYMENT_DECIMAL], + ['CMTAT_ISIN', 'https://cmta.ch', 'CMTAT_info'], [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS] ], { @@ -100,12 +96,8 @@ async function deployCMTATProxyWithParameter ( ETHERS_CMTAT_PROXY_FACTORY, [ admin, - nameIrrevocable, - symbolIrrevocable, - decimalsIrrevocable, - tokenId_, - terms_, - information_, + [ nameIrrevocable, symbolIrrevocable, decimalsIrrevocable], + [tokenId_, terms_, information_], engines ], { @@ -125,6 +117,7 @@ module.exports = { deployCMTATStandaloneWithParameter, DEPLOYMENT_DECIMAL, deployCMTATProxyImplementation, + deployCMTATProxyUUPSImplementation, fixture, loadFixture } diff --git a/test/proxy/general/Proxy.test.js b/test/proxy/general/Proxy.test.js index 1509345b..7d956442 100644 --- a/test/proxy/general/Proxy.test.js +++ b/test/proxy/general/Proxy.test.js @@ -1,12 +1,10 @@ -const { - expectRevertCustomError -} = require('../../../openzeppelin-contracts-upgradeable/test/helpers/customError.js') +const { expect } = require('chai'); const { DEFAULT_ADMIN_ROLE, PAUSER_ROLE } = require('../../utils') const { ZERO_ADDRESS } = require('../../utils') -const DECIMAL = 0 -const { deployCMTATProxy, DEPLOYMENT_FLAG, +const { deployCMTATProxy, fixture, - loadFixture } = require('../../deploymentUtils') + loadFixture, + DEPLOYMENT_DECIMAL } = require('../../deploymentUtils') const { upgrades } = require('hardhat') describe( 'Proxy - Security Test', @@ -29,26 +27,21 @@ describe( context('Attacker', function () { it('testCannotBeTakenControlByAttacker', async function () { // Act - await expectRevertCustomError( - this.implementationContract.connect(this.attacker).initialize( - this.attacker, - 'CMTA Token', - 'CMTAT', - DECIMAL, - 'CMTAT_ISIN', - 'https://cmta.ch', - 'CMTAT_info', - [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS] - ), - 'InvalidInitialization', - [] - ) + await expect( this.implementationContract.connect(this.attacker).initialize( + this.attacker, + ['CMTA Token', + 'CMTAT', + DEPLOYMENT_DECIMAL], + ['CMTAT_ISIN', + 'https://cmta.ch', + 'CMTAT_info'], + [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS] + )) + .to.be.revertedWithCustomError(this.implementationContract, 'InvalidInitialization') // act + assert - await expectRevertCustomError( - this.implementationContract.connect(this.attacker).pause(), - 'AccessControlUnauthorizedAccount', - [this.attacker.address, PAUSER_ROLE] - ) + await expect( this.implementationContract.connect(this.attacker).pause()) + .to.be.revertedWithCustomError(this.implementationContract, 'AccessControlUnauthorizedAccount') + .withArgs(this.attacker.address, PAUSER_ROLE) }) }) } diff --git a/test/proxy/general/UpgradeProxy.test.js b/test/proxy/general/UpgradeProxy.test.js index 54d086ce..85968e47 100644 --- a/test/proxy/general/UpgradeProxy.test.js +++ b/test/proxy/general/UpgradeProxy.test.js @@ -24,12 +24,12 @@ describe( CMTAT_PROXY_FACTORY, [ this.admin.address, - 'CMTA Token', + ['CMTA Token', 'CMTAT', - DEPLOYMENT_DECIMAL, - 'CMTAT_ISIN', + DEPLOYMENT_DECIMAL], + ['CMTAT_ISIN', 'https://cmta.ch', - 'CMTAT_info', + 'CMTAT_info'], [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS] ], { diff --git a/test/proxy/general/UpgradeProxyCommon.js b/test/proxy/general/UpgradeProxyCommon.js index 06257663..68b3beb2 100644 --- a/test/proxy/general/UpgradeProxyCommon.js +++ b/test/proxy/general/UpgradeProxyCommon.js @@ -1,9 +1,4 @@ const { expect } = require('chai'); -const { ZERO_ADDRESS } = require('../../utils') -const { - DEPLOYMENT_DECIMAL, - fixture, loadFixture -} = require('../../deploymentUtils') const { ethers, upgrades } = require('hardhat') function UpgradeProxyCommon () { diff --git a/test/proxy/general/UpgradeProxyUUPS.test.js b/test/proxy/general/UpgradeProxyUUPS.test.js index 9cf24f8a..9291921a 100644 --- a/test/proxy/general/UpgradeProxyUUPS.test.js +++ b/test/proxy/general/UpgradeProxyUUPS.test.js @@ -1,18 +1,13 @@ const { expect } = require("chai"); const { ethers, upgrades } = require("hardhat"); -const { ZERO_ADDRESS, DEFAULT_ADMIN_ROLE, PROXY_UPGRADE_ROLE } = require('../../utils') +const { ZERO_ADDRESS, PROXY_UPGRADE_ROLE } = require('../../utils') const UpgradeProxyCommon = require('./UpgradeProxyCommon') -const { - expectRevertCustomError - } = require('../../../openzeppelin-contracts-upgradeable/test/helpers/customError.js') const { DEPLOYMENT_DECIMAL, fixture, loadFixture } = require('../../deploymentUtils') describe("CMTAT with UUPS Proxy", function () { - let TokenV1, token, TokenV2 - beforeEach(async function () { Object.assign(this, await loadFixture(fixture)); @@ -25,12 +20,12 @@ describe("CMTAT with UUPS Proxy", function () { ) this.IsUUPSProxy = true this.CMTAT = await upgrades.deployProxy(CMTAT_PROXY_FACTORY, [this.admin.address, - 'CMTA Token', - 'CMTAT', - DEPLOYMENT_DECIMAL, - 'CMTAT_ISIN', - 'https://cmta.ch', - 'CMTAT_info', + ['CMTA Token', + 'CMTAT', + DEPLOYMENT_DECIMAL], + ['CMTAT_ISIN', + 'https://cmta.ch', + 'CMTAT_info'], [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS]], { initializer: 'initialize', kind: 'uups',constructorArgs: [this._.address] }); }) @@ -47,14 +42,12 @@ describe("CMTAT with UUPS Proxy", function () { }); it("testNonAdminCanNotUpgradeProxy", async function () { - await expectRevertCustomError( - upgrades.upgradeProxy(this.CMTAT.target, this.CMTAT_PROXY_TestFactory.connect(this.address1), - { - constructorArgs: [this._.address], - kind: 'uups' - }), - 'AccessControlUnauthorizedAccount', - [this.address1.address, PROXY_UPGRADE_ROLE] - ); + await expect( upgrades.upgradeProxy(this.CMTAT.target, this.CMTAT_PROXY_TestFactory.connect(this.address1), + { + constructorArgs: [this._.address], + kind: 'uups' + })) + .to.be.revertedWithCustomError(this.CMTAT, 'AccessControlUnauthorizedAccount') + .withArgs(this.address1.address, PROXY_UPGRADE_ROLE) }); }); \ No newline at end of file diff --git a/test/proxy/general/factory/Beacon.test.js b/test/proxy/general/factory/Beacon.test.js index 92303ddc..de1f251c 100644 --- a/test/proxy/general/factory/Beacon.test.js +++ b/test/proxy/general/factory/Beacon.test.js @@ -1,11 +1,7 @@ const { expect } = require('chai'); -const { - expectRevertCustomError -} = require('../../../../openzeppelin-contracts-upgradeable/test/helpers/customError.js') const { CMTAT_DEPLOYER_ROLE } = require('../../../utils.js') const { ZERO_ADDRESS } = require('../../../utils.js') const { - DEPLOYMENT_FLAG, deployCMTATProxyImplementation, fixture, loadFixture } = require('../../../deploymentUtils.js') @@ -16,14 +12,25 @@ describe( beforeEach(async function () { Object.assign(this, await loadFixture(fixture)); this.CMTAT_PROXY_IMPL = await deployCMTATProxyImplementation( + this.deployerAddress.address, this._.address, - this.deployerAddress.address ) this.FACTORY = await ethers.deployContract("CMTAT_BEACON_FACTORY",[ this.CMTAT_PROXY_IMPL.target, this.admin, - this.admin + this.admin, + false ]) + this.CMTATArg = [ + this.admin, + ['CMTA Token', + 'CMTAT', + DEPLOYMENT_DECIMAL], + ['CMTAT_ISIN', + 'https://cmta.ch', + 'CMTAT_info'], + [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS] + ]; }) context('FactoryDeployment', function () { @@ -38,32 +45,23 @@ describe( context('Deploy CMTAT with Factory', function () { it('testCannotBeDeployedByAttacker', async function () { // Act - await expectRevertCustomError( - this.FACTORY.connect(this.attacker).deployCMTAT( - this.admin, - 'CMTA Token', - 'CMTAT', - DEPLOYMENT_DECIMAL, - 'CMTAT_ISIN', - 'https://cmta.ch', - 'CMTAT_info', - [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS] - ), - 'AccessControlUnauthorizedAccount', - [this.attacker.address, CMTAT_DEPLOYER_ROLE] - ) + await expect( this.FACTORY.connect(this.attacker).deployCMTAT( + ethers.encodeBytes32String("test"), + this.CMTATArg + )) + .to.be.revertedWithCustomError(this.FACTORY, 'AccessControlUnauthorizedAccount') + .withArgs(this.attacker.address, CMTAT_DEPLOYER_ROLE); }) it('testCanDeployCMTATWithFactory', async function () { + let computedCMTATAddress = await this.FACTORY.computedProxyAddress( + // 0x0 => id counter 0 + ethers.keccak256(ethers.solidityPacked(["uint256"], [0x0])), + this.CMTATArg + ); // Act this.logs = await this.FACTORY.connect(this.admin).deployCMTAT( - this.admin, - 'CMTA Token', - 'CMTAT', - DEPLOYMENT_DECIMAL, - 'CMTAT_ISIN', - 'https://cmta.ch', - 'CMTAT_info', - [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS] + ethers.encodeBytes32String("test"), + this.CMTATArg ) // https://github.com/ethers-io/ethers.js/discussions/4484#discussioncomment-9890653 @@ -74,9 +72,10 @@ describe( // Check Id increment expect(args[1]).to.equal(0) // Assert - const CMTAT_ADDRESS = args[0]; + let CMTAT_ADDRESS = args[0]; // Check address with ID - expect(await this.FACTORY.getCMTATAddress(0)).to.equal(CMTAT_ADDRESS) + expect(await this.FACTORY.CMTATProxyAddress(0)).to.equal(CMTAT_ADDRESS) + expect(await this.FACTORY.CMTATProxyAddress(0)).to.equal(computedCMTATAddress); const MyContract = await ethers.getContractFactory("CMTAT_PROXY"); const CMTAT_PROXY = MyContract.attach( CMTAT_ADDRESS @@ -85,19 +84,22 @@ describe( await CMTAT_PROXY.connect(this.admin).mint(this.admin, 100) // Deploy second contract this.logs = await this.FACTORY.connect(this.admin).deployCMTAT( - this.admin, - 'CMTA Token', - 'CMTAT', - DEPLOYMENT_DECIMAL, - 'CMTAT_ISIN', - 'https://cmta.ch', - 'CMTAT_info', - [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS] + ethers.encodeBytes32String("test"), + this.CMTATArg ) // Check Id increment events = await this.FACTORY.queryFilter(filter, -1); args = events[0].args; expect(args[1]).to.equal(1) + + // Check address + computedCMTATAddress = await this.FACTORY.computedProxyAddress( + ethers.keccak256(ethers.solidityPacked(["uint256"], [0x1])), + this.CMTATArg + ); + CMTAT_ADDRESS = args[0]; + expect(await this.FACTORY.CMTATProxyAddress(1)).to.equal(CMTAT_ADDRESS); + expect(await this.FACTORY.CMTATProxyAddress(1)).to.equal(computedCMTATAddress); }) }) } diff --git a/test/proxy/general/factory/BeaconFactoryDeploy.test.js b/test/proxy/general/factory/BeaconFactoryDeploy.test.js index 6e52b86b..790769ec 100644 --- a/test/proxy/general/factory/BeaconFactoryDeploy.test.js +++ b/test/proxy/general/factory/BeaconFactoryDeploy.test.js @@ -1,7 +1,5 @@ -const { - expectRevertCustomError -} = require('../../../../openzeppelin-contracts-upgradeable/test/helpers/customError.js') const { ZERO_ADDRESS } = require('../../../utils.js') +const { expect } = require('chai'); const { deployCMTATProxyImplementation, fixture, loadFixture @@ -15,34 +13,31 @@ describe( this._.address, this.deployerAddress.address ) + this.FACTORYCustomError = await ethers.deployContract("CMTAT_BEACON_FACTORY",[ + this.CMTAT_PROXY_IMPL.target, + this.admin, + this.admin, + true + ]) }) context('BeaconDeployment', function () { it('testCannotDeployIfImplementationIsZero', async function () { - await expectRevertCustomError( - ethers.deployContract("CMTAT_BEACON_FACTORY",[ZERO_ADDRESS, this.admin.address, this.admin.address]), - 'CMTAT_Factory_AddressZeroNotAllowedForLogicContract', - [] - ) + await expect(ethers.deployContract("CMTAT_BEACON_FACTORY",[ZERO_ADDRESS, this.admin.address, this.admin.address])) + .to.be.revertedWithCustomError(this.FACTORYCustomError, 'CMTAT_Factory_AddressZeroNotAllowedForLogicContract') }) it('testCannotDeployIfFactoryAdminIsZero', async function () { - await expectRevertCustomError( - ethers.deployContract("CMTAT_BEACON_FACTORY",[ this.CMTAT_PROXY_IMPL.target, - ZERO_ADDRESS, - this.admin.address] - ), - 'CMTAT_Factory_AddressZeroNotAllowedForFactoryAdmin', - [] - ) + await expect( ethers.deployContract("CMTAT_BEACON_FACTORY",[ this.CMTAT_PROXY_IMPL.target, + ZERO_ADDRESS, + this.admin.address] + )) + .to.be.revertedWithCustomError(this.FACTORYCustomError, 'CMTAT_Factory_AddressZeroNotAllowedForFactoryAdmin') }) it('testCannotDeployIfBeaconOwnerIsZero', async function () { - await expectRevertCustomError( - ethers.deployContract("CMTAT_BEACON_FACTORY",[ this.CMTAT_PROXY_IMPL.target, - this.admin.address, - ZERO_ADDRESS] - ), - 'CMTAT_Factory_AddressZeroNotAllowedForBeaconOwner', - [] - ) + await expect(ethers.deployContract("CMTAT_BEACON_FACTORY",[ this.CMTAT_PROXY_IMPL.target, + this.admin.address, + ZERO_ADDRESS] + )) + .to.be.revertedWithCustomError(this.FACTORYCustomError, 'CMTAT_Factory_AddressZeroNotAllowedForBeaconOwner') }) }) } diff --git a/test/proxy/general/factory/Transparent.test.js b/test/proxy/general/factory/Transparent.test.js index 6971b4b4..9dc5bfd7 100644 --- a/test/proxy/general/factory/Transparent.test.js +++ b/test/proxy/general/factory/Transparent.test.js @@ -1,7 +1,4 @@ const { expect } = require('chai'); -const { - expectRevertCustomError, -} = require("../../../../openzeppelin-contracts-upgradeable/test/helpers/customError.js"); const { ZERO_ADDRESS, CMTAT_DEPLOYER_ROLE } = require("../../../utils.js"); const { DEPLOYMENT_FLAG, @@ -24,12 +21,12 @@ describe("Deploy TP with Factory", function () { this.CMTATArg = [ this.admin, - "CMTA Token", - "CMTAT", - DEPLOYMENT_DECIMAL, - "CMTAT_ISIN", - "https://cmta.ch", - "CMTAT_info", + ['CMTA Token', + 'CMTAT', + DEPLOYMENT_DECIMAL], + ['CMTAT_ISIN', + 'https://cmta.ch', + 'CMTAT_info'], [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS] ]; }); @@ -46,18 +43,18 @@ describe("Deploy TP with Factory", function () { context("Deploy CMTAT with Factory", function () { it("testCannotBeDeployedByAttacker", async function () { // Act - await expectRevertCustomError( - this.FACTORY.connect(this.attacker).deployCMTAT( - ethers.encodeBytes32String("test"), - this.admin.address, - this.CMTATArg - ), - "AccessControlUnauthorizedAccount", - [this.attacker.address, CMTAT_DEPLOYER_ROLE] - ); + await expect( this.FACTORY.connect(this.attacker).deployCMTAT( + ethers.encodeBytes32String("test"), + this.admin.address, + this.CMTATArg + )) + .to.be.revertedWithCustomError(this.FACTORY, 'AccessControlUnauthorizedAccount').withArgs( + this.attacker.address, CMTAT_DEPLOYER_ROLE + ) }); it("testCanDeployCMTATWithFactory", async function () { let computedCMTATAddress = await this.FACTORY.computedProxyAddress( + // 0x0 => id counter 0 ethers.keccak256(ethers.solidityPacked(["uint256"], [0x0])), this.admin, this.CMTATArg diff --git a/test/proxy/general/factory/TransparentFactoyDeploy.test.js b/test/proxy/general/factory/TransparentFactoyDeploy.test.js index e8ec3b12..d7bc5a83 100644 --- a/test/proxy/general/factory/TransparentFactoyDeploy.test.js +++ b/test/proxy/general/factory/TransparentFactoyDeploy.test.js @@ -1,13 +1,11 @@ -const { - expectRevertCustomError -} = require('../../../../openzeppelin-contracts-upgradeable/test/helpers/customError.js') +const { expect } = require('chai'); const { ZERO_ADDRESS } = require('../../../utils.js') const { deployCMTATProxyImplementation, fixture, loadFixture } = require('../../../deploymentUtils.js') describe( - 'Deploy TP with Factory', + 'Deploy TP Factory', function () { beforeEach(async function () { Object.assign(this, await loadFixture(fixture)); @@ -15,28 +13,26 @@ describe( this._.address, this.deployerAddress.address ) - // this.FACTORY = await CMTAT_TP_FACTORY.new(this.CMTAT_PROXY_IMPL.address, admin) + this.FACTORYCustomError = await ethers.deployContract('CMTAT_TP_FACTORY',[ + this.CMTAT_PROXY_IMPL.target, + this.admin, + true + ]) }) context('FactoryDeployment', function () { it('testCannotDeployIfImplementationIsZero', async function () { - await expectRevertCustomError( - ethers.deployContract('CMTAT_TP_FACTORY',[ - ZERO_ADDRESS, this.admin - ]), - 'CMTAT_Factory_AddressZeroNotAllowedForLogicContract', - [] - ) + await expect( ethers.deployContract('CMTAT_TP_FACTORY',[ + ZERO_ADDRESS, this.admin + ])) + .to.be.revertedWithCustomError(this.FACTORYCustomError, 'CMTAT_Factory_AddressZeroNotAllowedForLogicContract') }) it('testCannotDeployIfFactoryAdminIsZero', async function () { - await expectRevertCustomError( - ethers.deployContract('CMTAT_TP_FACTORY', [ - this.CMTAT_PROXY_IMPL.target, ZERO_ADDRESS - ]), - 'CMTAT_Factory_AddressZeroNotAllowedForFactoryAdmin', - [] - ) + await expect( ethers.deployContract('CMTAT_TP_FACTORY', [ + this.CMTAT_PROXY_IMPL.target, ZERO_ADDRESS + ])) + .to.be.revertedWithCustomError(this.FACTORYCustomError, 'CMTAT_Factory_AddressZeroNotAllowedForFactoryAdmin') }) }) } diff --git a/test/proxy/general/factory/TransparentSalt.test.js b/test/proxy/general/factory/TransparentSalt.test.js index 0a9a8d69..bbfcdf53 100644 --- a/test/proxy/general/factory/TransparentSalt.test.js +++ b/test/proxy/general/factory/TransparentSalt.test.js @@ -1,7 +1,4 @@ const { expect } = require('chai'); -const { - expectRevertCustomError -} = require('../../../../openzeppelin-contracts-upgradeable/test/helpers/customError.js') const { ZERO_ADDRESS, CMTAT_DEPLOYER_ROLE } = require('../../../utils.js') const { DEPLOYMENT_FLAG, @@ -26,12 +23,12 @@ describe( ]) this.CMTATArg = [ this.admin, - 'CMTA Token', + ['CMTA Token', 'CMTAT', - DEPLOYMENT_DECIMAL, - 'CMTAT_ISIN', + DEPLOYMENT_DECIMAL], + ['CMTAT_ISIN', 'https://cmta.ch', - 'CMTAT_info', + 'CMTAT_info'], [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS] ] }) @@ -48,15 +45,13 @@ describe( context('Deploy CMTAT with Factory', function () { it('testCannotBeDeployedByAttacker', async function () { // Act - await expectRevertCustomError( - this.FACTORY.connect(this.attacker).deployCMTAT( - ethers.encodeBytes32String('test'), - this.admin, - this.CMTATArg - ), - 'AccessControlUnauthorizedAccount', - [this.attacker.address, CMTAT_DEPLOYER_ROLE] - ) + await expect( this.FACTORY.connect(this.attacker).deployCMTAT( + ethers.encodeBytes32String('test'), + this.admin, + this.CMTATArg + )) + .to.be.revertedWithCustomError(this.FACTORY, 'AccessControlUnauthorizedAccount') + .withArgs(this.attacker.address, CMTAT_DEPLOYER_ROLE); }) it('testCanDeployCMTATWithFactory', async function () { // Act @@ -91,13 +86,12 @@ describe( args = events[0].args; expect(args[1]).to.equal(1) // Revert - await expectRevertCustomError(this.FACTORY.connect(this.admin).deployCMTAT( + await expect(this.FACTORY.connect(this.admin).deployCMTAT( ethers.encodeBytes32String('test'), this.admin, this.CMTATArg, - ), - 'CMTAT_Factory_SaltAlreadyUsed', - []) + )) + .to.be.revertedWithCustomError(this.FACTORY, 'CMTAT_Factory_SaltAlreadyUsed') }) it('testCannotDeployCMTATWithFactoryWithSaltAlreadyUsed', async function () { // Arrange @@ -108,13 +102,12 @@ describe( ) // Act with Revert - await expectRevertCustomError(this.FACTORY.connect(this.admin).deployCMTAT( + await expect( this.FACTORY.connect(this.admin).deployCMTAT( ethers.encodeBytes32String('test'), this.admin, this.CMTATArg - ), - 'CMTAT_Factory_SaltAlreadyUsed', - []) + )) + .to.be.revertedWithCustomError(this.FACTORY, 'CMTAT_Factory_SaltAlreadyUsed') }) }) } diff --git a/test/proxy/general/factory/UUPS.test.js b/test/proxy/general/factory/UUPS.test.js new file mode 100644 index 00000000..b7bfc32e --- /dev/null +++ b/test/proxy/general/factory/UUPS.test.js @@ -0,0 +1,101 @@ +const { expect } = require('chai'); +const { ZERO_ADDRESS, CMTAT_DEPLOYER_ROLE } = require("../../../utils.js"); +const { + DEPLOYMENT_FLAG, + deployCMTATProxyUUPSImplementation, + fixture, + loadFixture, +} = require("../../../deploymentUtils.js"); +const { ethers } = require("hardhat"); +const DEPLOYMENT_DECIMAL = 0; +describe("Deploy UUPPSwith Factory", function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + this.CMTAT_PROXY_IMPL = await deployCMTATProxyUUPSImplementation( + this._.address, + this.deployerAddress.address + ); + this.FACTORY = await ethers.deployContract("CMTAT_UUPS_FACTORY",[ + this.CMTAT_PROXY_IMPL.target, this.admin, false + ]); + + this.CMTATArg = [ + this.admin, + ['CMTA Token', + 'CMTAT', + DEPLOYMENT_DECIMAL], + ['CMTAT_ISIN', + 'https://cmta.ch', + 'CMTAT_info'], + [ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS] + ]; + }); + + context("FactoryDeployment", function () { + it("testCanReturnTheRightImplementation", async function () { + // Act + Assert + expect(await this.FACTORY.logic()).to.equal( + this.CMTAT_PROXY_IMPL.target + ); + }); + }); + + context("Deploy CMTAT with Factory", function () { + it("testCannotBeDeployedByAttacker", async function () { + // Act + await expect( this.FACTORY.connect(this.attacker).deployCMTAT( + ethers.encodeBytes32String("test"), + this.CMTATArg + )) + .to.be.revertedWithCustomError(this.FACTORY, 'AccessControlUnauthorizedAccount').withArgs( + this.attacker.address, CMTAT_DEPLOYER_ROLE + ) + }); + it("testCanDeployCMTATWithFactory", async function () { + let computedCMTATAddress = await this.FACTORY.computedProxyAddress( + // 0x0 => id counter 0 + ethers.keccak256(ethers.solidityPacked(["uint256"], [0x0])), + this.CMTATArg + ); + // Act + this.logs = await this.FACTORY.connect(this.admin).deployCMTAT( + ethers.encodeBytes32String("test"), + this.CMTATArg + ); + const receipt = await this.logs.wait(); + const filter = this.FACTORY.filters.CMTAT; + let events = await this.FACTORY.queryFilter(filter, -1); + let args = events[0].args; + // Assert + // Check Id + expect(args[1]).to.equal(0); + let CMTAT_ADDRESS = args[0]; + // Check address with ID + expect(await this.FACTORY.CMTATProxyAddress(0)).to.equal(CMTAT_ADDRESS); + expect(await this.FACTORY.CMTATProxyAddress(0)).to.equal(computedCMTATAddress); + const MyContract = await ethers.getContractFactory("CMTAT_PROXY_UUPS"); + const CMTAT_PROXY = MyContract.attach( + CMTAT_ADDRESS + ) + await CMTAT_PROXY.connect(this.admin).mint(this.admin, 100); + // Second deployment + this.logs = await this.FACTORY.connect(this.admin).deployCMTAT( + ethers.encodeBytes32String("test"), + this.CMTATArg + ); + // Check Id increment + events = await this.FACTORY.queryFilter(filter, -1); + args = events[0].args; + expect(args[1]).to.equal(1); + + // Check address + computedCMTATAddress = await this.FACTORY.computedProxyAddress( + ethers.keccak256(ethers.solidityPacked(["uint256"], [0x1])), + this.CMTATArg + ); + CMTAT_ADDRESS = args[0]; + expect(await this.FACTORY.CMTATProxyAddress(1)).to.equal(CMTAT_ADDRESS); + expect(await this.FACTORY.CMTATProxyAddress(1)).to.equal(computedCMTATAddress); + }); + }); +}); diff --git a/test/proxy/general/factory/UUPSFactoyDeploy.test.js b/test/proxy/general/factory/UUPSFactoyDeploy.test.js new file mode 100644 index 00000000..f2658603 --- /dev/null +++ b/test/proxy/general/factory/UUPSFactoyDeploy.test.js @@ -0,0 +1,39 @@ +const { ZERO_ADDRESS } = require('../../../utils.js') +const { expect } = require('chai'); +const { + deployCMTATProxyImplementation, + fixture, loadFixture +} = require('../../../deploymentUtils.js') +describe( + 'Deploy UUPS Factory', + function () { + beforeEach(async function () { + Object.assign(this, await loadFixture(fixture)); + this.CMTAT_PROXY_IMPL = await deployCMTATProxyImplementation( + this._.address, + this.deployerAddress.address + ) + this.FACTORYCustomError = await ethers.deployContract('CMTAT_UUPS_FACTORY',[ + this.CMTAT_PROXY_IMPL.target, + this.admin, + true + ]) + }) + + context('FactoryDeployment', function () { + it('testCannotDeployIfImplementationIsZero', async function () { + await expect(ethers.deployContract('CMTAT_UUPS_FACTORY',[ + ZERO_ADDRESS, this.admin + ])) + .to.be.revertedWithCustomError(this.FACTORYCustomError, 'CMTAT_Factory_AddressZeroNotAllowedForLogicContract') + }) + + it('testCannotDeployIfFactoryAdminIsZero', async function () { + await expect(ethers.deployContract('CMTAT_UUPS_FACTORY', [ + this.CMTAT_PROXY_IMPL.target, ZERO_ADDRESS + ])) + .to.be.revertedWithCustomError(this.FACTORYCustomError, 'CMTAT_Factory_AddressZeroNotAllowedForFactoryAdmin') + }) + }) + } +) diff --git a/test/standard/modules/DocumentModule/DocumentModule.test.js b/test/standard/modules/DocumentModule/DocumentModule.test.js index 7dca0a22..93676fb9 100644 --- a/test/standard/modules/DocumentModule/DocumentModule.test.js +++ b/test/standard/modules/DocumentModule/DocumentModule.test.js @@ -8,7 +8,6 @@ describe( Object.assign(this, await loadFixture(fixture)); this.cmtat = await deployCMTATStandalone(this._.address, this.admin.address, this.deployerAddress.address) this.documentEngineMock = await ethers.deployContract("DocumentEngineMock") - }) DocumentModuleCommon() DocumentModuleSetDocumentEngineCommon()