Skip to content

Commit

Permalink
fix bug import with the new OpenZeppelin version
Browse files Browse the repository at this point in the history
  • Loading branch information
rya-sge committed Nov 10, 2023
1 parent e628f6c commit a5a06d4
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,21 @@

Please follow <https://changelog.md/> 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))
Expand Down
4 changes: 2 additions & 2 deletions contracts/modules/internal/ERC20SnapshotModuleInternal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion contracts/modules/security/AuthorizationModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion doc/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a5a06d4

Please sign in to comment.