diff --git a/.gitmodules b/.gitmodules index b2149193..f9a5e70f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "openzeppelin-contracts-upgradeable"] path = openzeppelin-contracts-upgradeable url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable +[submodule "openzeppelin-contracts"] + path = openzeppelin-contracts + url = https://github.com/OpenZeppelin/openzeppelin-contracts diff --git a/CHANGELOG.md b/CHANGELOG.md index 013446cb..803535f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,21 @@ Please follow conventions. +The modifications between the version v2.3.0 and this version are not audited !!! + +This version contains breaking changes with the version v2.3.0. + +- Remove useless functions init in wrapper modules [#230](https://github.com/CMTA/CMTAT/issues/230) +- Add missing tests in EnforcementModule [#239](https://github.com/CMTA/CMTAT/issues/239) +- Use calldate instead of memory [#224](https://github.com/CMTA/CMTAT/issues/224) +- Upgrade OpenZeppelin to the version [v.5.0.0](https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/releases/tag/v5.0.0) + ## 2.3.1-rc.0 - 20230925 +The modifications between the version v2.3.0 and this version are not audited !!! + +This version contains breaking changes with the version v2.3.0. + ### Summary **Architecture** - The directory `mandatory` is renamed in `core` ([#222](https://github.com/CMTA/CMTAT/pull/222)) diff --git a/contracts/modules/internal/ERC20SnapshotModuleInternal.sol b/contracts/modules/internal/ERC20SnapshotModuleInternal.sol index bf9c0ebe..c868a15a 100644 --- a/contracts/modules/internal/ERC20SnapshotModuleInternal.sol +++ b/contracts/modules/internal/ERC20SnapshotModuleInternal.sol @@ -5,7 +5,7 @@ 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/contracts/utils/ArraysUpgradeable.sol"; +import {Arrays} from '@openzeppelin/contracts/utils/Arrays.sol'; import "../../libraries/Errors.sol"; @@ -19,7 +19,7 @@ import "../../libraries/Errors.sol"; */ abstract contract ERC20SnapshotModuleInternal is ERC20Upgradeable { - using ArraysUpgradeable for uint256[]; + using Arrays for uint256[]; /** @notice Emitted when the snapshot with the specified oldTime was scheduled or rescheduled at the specified newTime. diff --git a/contracts/modules/security/AuthorizationModule.sol b/contracts/modules/security/AuthorizationModule.sol index aad968b7..43dbf630 100644 --- a/contracts/modules/security/AuthorizationModule.sol +++ b/contracts/modules/security/AuthorizationModule.sol @@ -58,7 +58,7 @@ abstract contract AuthorizationModule is AccessControlDefaultAdminRulesUpgradeab function hasRole( bytes32 role, address account - ) public view virtual override( IAccessControlUpgradeable, AccessControlUpgradeable) returns (bool) { + ) public view virtual override( IAccessControl, AccessControlUpgradeable) returns (bool) { // The Default Admin has all roles if (AccessControlUpgradeable.hasRole(DEFAULT_ADMIN_ROLE, account)) { return true; diff --git a/doc/USAGE.md b/doc/USAGE.md index a8adb0eb..b598e578 100644 --- a/doc/USAGE.md +++ b/doc/USAGE.md @@ -13,7 +13,12 @@ are the latest ones that we tested: - Solidity 0.8.17 (via solc-js) - Node 16.17.0 - Web3.js 1.9.0 -- OpenZeppelin Contracts Upgradeable (submodule) [v5.0.0](https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/releases/tag/v5.0.0) +- OpenZeppelin + - OpenZeppelin Contracts Upgradeable (submodule) [v5.0.0](https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/releases/tag/v5.0.0) + - OpenZeppelin Contracts (Node.js module) [v5.0.0](https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v5.0.0) + - Reason n°1: libraries and interfaces are no longer available inside the upgradeable version since the version v5.0.0. + - Reason n°2: It is not installed as a github submodule because it will create conflicts with the imports inside OpenZeppelin which use the Node.js version. + ## Installation diff --git a/package-lock.json b/package-lock.json index a58c9940..a0c0b9de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.1.0", "license": "MPL", "dependencies": { + "@openzeppelin/contracts": "^5.0.0", "@openzeppelin/truffle-upgrades": "^1.17.1", "eth-sig-util": "^3.0.1", "ethereumjs-wallet": "^1.0.2" @@ -4826,6 +4827,11 @@ "node": ">=6 <7 || >=8" } }, + "node_modules/@openzeppelin/contracts": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-5.0.0.tgz", + "integrity": "sha512-bv2sdS6LKqVVMLI5+zqnNrNU/CA+6z6CmwFXm/MzmOPBRSO5reEJN7z0Gbzvs0/bv/MZZXNklubpwy3v2+azsw==" + }, "node_modules/@openzeppelin/defender-admin-client": { "version": "1.48.0", "resolved": "https://registry.npmjs.org/@openzeppelin/defender-admin-client/-/defender-admin-client-1.48.0.tgz", @@ -34213,6 +34219,11 @@ } } }, + "@openzeppelin/contracts": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-5.0.0.tgz", + "integrity": "sha512-bv2sdS6LKqVVMLI5+zqnNrNU/CA+6z6CmwFXm/MzmOPBRSO5reEJN7z0Gbzvs0/bv/MZZXNklubpwy3v2+azsw==" + }, "@openzeppelin/defender-admin-client": { "version": "1.48.0", "resolved": "https://registry.npmjs.org/@openzeppelin/defender-admin-client/-/defender-admin-client-1.48.0.tgz", diff --git a/package.json b/package.json index b0f55319..4a340811 100644 --- a/package.json +++ b/package.json @@ -114,6 +114,7 @@ "web3": "^1.9.0" }, "dependencies": { + "@openzeppelin/contracts": "^5.0.0", "@openzeppelin/truffle-upgrades": "^1.17.1", "eth-sig-util": "^3.0.1", "ethereumjs-wallet": "^1.0.2"