forked from sherlock-audit/2025-07-mellow-flexible-vaults
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOwnedCustomVerifier.sol
More file actions
30 lines (25 loc) · 962 Bytes
/
OwnedCustomVerifier.sol
File metadata and controls
30 lines (25 loc) · 962 Bytes
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
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.25;
import "../../interfaces/permissions/ICustomVerifier.sol";
import "../MellowACL.sol";
abstract contract OwnedCustomVerifier is ICustomVerifier, MellowACL {
error ZeroValue();
constructor(string memory name_, uint256 version_) MellowACL(name_, version_) {
_disableInitializers();
}
// Mutable functions
function initialize(bytes calldata data) external initializer {
(address admin, address[] memory holders, bytes32[] memory roles) =
abi.decode(data, (address, address[], bytes32[]));
if (admin == address(0)) {
revert ZeroValue();
}
_grantRole(DEFAULT_ADMIN_ROLE, admin);
for (uint256 i = 0; i < holders.length; i++) {
if (holders[i] == address(0) || roles[i] == bytes32(0)) {
revert ZeroValue();
}
_grantRole(roles[i], holders[i]);
}
}
}