Skip to content

Commit 453786a

Browse files
authored
Fix/prepare 2.7.0 (#90)
* husky & deps * added releaseTokens method & fixed tests * mv to finance dir * renamed access dir * fixed naming & diamond presets & adjusted tests * fix * adjusted diamond onlyOwner & tests * added renounce ownership * added event & virtual
1 parent 5fb4474 commit 453786a

File tree

53 files changed

+1060
-1431
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1060
-1431
lines changed

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npm run lint-fix && git add -u

contracts/access-control/MultiOwnable.sol renamed to contracts/access/MultiOwnable.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Ini
66

77
import {SetHelper} from "../libs/arrays/SetHelper.sol";
88
import {TypeCaster} from "../libs/utils/TypeCaster.sol";
9-
import {IMultiOwnable} from "../interfaces/access-control/IMultiOwnable.sol";
9+
import {IMultiOwnable} from "../interfaces/access/IMultiOwnable.sol";
1010

1111
/**
1212
* @notice The MultiOwnable module

contracts/access-control/RBAC.sol renamed to contracts/access/RBAC.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pragma solidity ^0.8.4;
33

44
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
55

6-
import {IRBAC} from "../interfaces/access-control/IRBAC.sol";
6+
import {IRBAC} from "../interfaces/access/IRBAC.sol";
77

88
import {TypeCaster} from "../libs/utils/TypeCaster.sol";
99
import {SetHelper} from "../libs/arrays/SetHelper.sol";

contracts/access-control/extensions/RBACGroupable.sol renamed to contracts/access/extensions/RBACGroupable.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.4;
33

4-
import {IRBACGroupable} from "../../interfaces/access-control/extensions/IRBACGroupable.sol";
4+
import {IRBACGroupable} from "../../interfaces/access/extensions/IRBACGroupable.sol";
55

66
import {StringSet} from "../../libs/data-structures/StringSet.sol";
77
import {SetHelper} from "../../libs/arrays/SetHelper.sol";

contracts/contracts-registry/pools/presets/MultiOwnablePoolContractsRegistry.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pragma solidity ^0.8.4;
33

44
import {AbstractPoolContractsRegistry} from "../AbstractPoolContractsRegistry.sol";
5-
import {MultiOwnable} from "../../../access-control/MultiOwnable.sol";
5+
import {MultiOwnable} from "../../../access/MultiOwnable.sol";
66

77
/**
88
* @notice The MultiOwnable preset of PoolContractsRegistry

contracts/contracts-registry/presets/MultiOwnableContractsRegistry.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pragma solidity ^0.8.4;
33

44
import {AbstractContractsRegistry} from "../AbstractContractsRegistry.sol";
5-
import {MultiOwnable} from "../../access-control/MultiOwnable.sol";
5+
import {MultiOwnable} from "../../access/MultiOwnable.sol";
66

77
/**
88
* @notice The MultiOwnable preset of ContractsRegistry

contracts/diamond/access/DiamondAccessControlStorage.sol

Lines changed: 0 additions & 49 deletions
This file was deleted.

contracts/diamond/access/DiamondAccessControl.sol renamed to contracts/diamond/access/access-control/DiamondAccessControl.sol

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.4;
33

4-
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
5-
64
import {DiamondAccessControlStorage, IAccessControl} from "./DiamondAccessControlStorage.sol";
75

86
/**
@@ -12,19 +10,6 @@ import {DiamondAccessControlStorage, IAccessControl} from "./DiamondAccessContro
1210
* by the Diamond Standard.
1311
*/
1412
abstract contract DiamondAccessControl is DiamondAccessControlStorage {
15-
/**
16-
* @dev Modifier that checks that an account has a specific role. Reverts
17-
* with a standardized message including the required role.
18-
*
19-
* The format of the revert reason is given by the following regular expression:
20-
*
21-
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
22-
*/
23-
modifier onlyRole(bytes32 role_) {
24-
_checkRole(role_);
25-
_;
26-
}
27-
2813
/**
2914
* @notice Sets `DEFAULT_ADMIN_ROLE` to `msg.sender`
3015
*/
@@ -106,36 +91,4 @@ abstract contract DiamondAccessControl is DiamondAccessControlStorage {
10691

10792
emit RoleRevoked(role_, account_, msg.sender);
10893
}
109-
110-
/**
111-
* @dev Revert with a standard message if `_msgSender()` is missing `role`.
112-
* Overriding this function changes the behavior of the {onlyRole} modifier.
113-
*
114-
* Format of the revert message is described in {_checkRole}.
115-
*/
116-
function _checkRole(bytes32 role_) internal view virtual {
117-
_checkRole(role_, msg.sender);
118-
}
119-
120-
/**_
121-
* @dev Revert with a standard message if `account` is missing `role`.
122-
*
123-
* The format of the revert reason is given by the following regular expression:
124-
*
125-
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
126-
*/
127-
function _checkRole(bytes32 role_, address account_) internal view virtual {
128-
if (!hasRole(role_, account_)) {
129-
revert(
130-
string(
131-
abi.encodePacked(
132-
"AccessControl: account ",
133-
Strings.toHexString(account_),
134-
" is missing role ",
135-
Strings.toHexString(uint256(role_), 32)
136-
)
137-
)
138-
);
139-
}
140-
}
14194
}

0 commit comments

Comments
 (0)