Verified contractExactBUSL-1.1
RenounceRoleValidationLibrary
Address0x35375aa484d13b4921bfca0923a79f3d3b4ff06a
- Balance
0 ETH
- Transactions
1
- Compiler
solc 0.8.22
- Same code
1 more contract
Details
- Compiler
- solc 0.8.22+commit.4fc1097e
- Language
- solidity
- Optimization
- Yes, 1,000,000 runs
- EVM version
- paris
- License
- BUSL-1.1
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,377,654
- Creation transaction
- 0x4ca6a86cd9…543ead1402
10 files
- contracts/multisig/libraries/RenounceRoleValidationLibrary.solmain1.8 KB
- @openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol8.91 KB
- @openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol1.18 KB
- @openzeppelin/contracts/utils/introspection/IERC165.sol869 B
- contracts/interfaces/base/IERC165Extended.sol1.18 KB
- contracts/interfaces/compiler/ILiquidityPoolsController.sol5.34 KB
- contracts/interfaces/compliance/IWhitelistingController.sol11.3 KB
- contracts/interfaces/compliance/IWhitelistingControllerAgreement.sol4.37 KB
- contracts/interfaces/diamond/IDiamondCut.sol868 B
- contracts/interfaces/multisig/IUpgradeMultisig.sol23.59 KB
contracts/multisig/libraries/RenounceRoleValidationLibrary.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.22;
import {IUpgradeMultisig} from "contracts/interfaces/multisig/IUpgradeMultisig.sol";
/**
* @title RenounceRoleValidationLibrary
* @notice Library for validating renounceRole operations
*/
library RenounceRoleValidationLibrary {
bytes32 public constant UPGRADE_PROPOSAL_OFFICER_ROLE =
keccak256("Upgrade Proposal Officer Role");
bytes32 public constant UPGRADE_APPROVAL_OFFICER_ROLE =
keccak256("Upgrade Approval Officer Role");
bytes32 public constant ARKIS_SECURITY_OFFICER_ROLE = keccak256("Arkis Security Officer Role");
uint256 public constant MIN_OPERATORS = 2;
/**
* @notice Validate if a role can be renounced
* @param role The role to renounce
* @param approverCount Current number of approvers
* @param operatorCount Current number of operators
* @param securityOfficerCount Current number of security officers
* @param threshold Current threshold value
*/
function validateRenounceRole(
bytes32 role,
uint256 approverCount,
uint256 operatorCount,
uint256 securityOfficerCount,
uint8 threshold
) external pure {
if (role == UPGRADE_APPROVAL_OFFICER_ROLE) {
if (approverCount - 1 < threshold) {
revert IUpgradeMultisig.CannotRenounceBelowThreshold();
}
} else if (role == UPGRADE_PROPOSAL_OFFICER_ROLE) {
if (operatorCount <= MIN_OPERATORS) {
revert IUpgradeMultisig.InsufficientOperators();
}
} else if (role == ARKIS_SECURITY_OFFICER_ROLE) {
if (securityOfficerCount <= 1) {
revert IUpgradeMultisig.CannotRenounceLastSecurityOfficer();
}
}
}
}
@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.20;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Storage of the initializable contract.
*
* It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
* when using with upgradeable contracts.
*
* @custom:storage-location erc7201:openzeppelin.storage.Initializable
*/
struct InitializableStorage {
/**
* @dev Indicates that the contract has been initialized.
*/
uint64 _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool _initializing;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;
/**
* @dev The contract is already initialized.
*/
error InvalidInitialization();
/**
* @dev The contract is not initializing.
*/
error NotInitializing();
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint64 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
* number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
* production.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
// Cache values to avoid duplicated sloads
bool isTopLevelCall = !$._initializing;
uint64 initialized = $._initialized;
// Allowed calls:
// - initialSetup: the contract is not in the initializing state and no previous version was
// initialized
// - construction: the contract is initialized at version 1 (no reininitialization) and the
// current contract is just being deployed
bool initialSetup = initialized == 0 && isTopLevelCall;
bool construction = initialized == 1 && address(this).code.length == 0;
if (!initialSetup && !construction) {
revert InvalidInitialization();
}
$._initialized = 1;
if (isTopLevelCall) {
$._initializing = true;
}
_;
if (isTopLevelCall) {
$._initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint64 version) {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing || $._initialized >= version) {
revert InvalidInitialization();
}
$._initialized = version;
$._initializing = true;
_;
$._initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
_checkInitializing();
_;
}
/**
* @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
*/
function _checkInitializing() internal view virtual {
if (!_isInitializing()) {
revert NotInitializing();
}
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing) {
revert InvalidInitialization();
}
if ($._initialized != type(uint64).max) {
$._initialized = type(uint64).max;
emit Initialized(type(uint64).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint64) {
return _getInitializableStorage()._initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _getInitializableStorage()._initializing;
}
/**
* @dev Returns a pointer to the storage namespace.
*/
// solhint-disable-next-line var-name-mixedcase
function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
assembly {
$.slot := INITIALIZABLE_STORAGE
}
}
}
@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {Initializable} from "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*/
abstract contract ERC165Upgradeable is Initializable, IERC165 {
function __ERC165_init() internal onlyInitializing {
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
@openzeppelin/contracts/utils/introspection/IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
contracts/interfaces/base/IERC165Extended.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.22;
/* solhint-disable no-unused-import */
import {
IERC165
} from "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol";
/* solhint-enable no-unused-import */
/**
* @notice An error indicating that an address does not support the expected interface
* @param implementation The address that does not implement the required interface
*/
error UnsupportedInterface(address implementation);
/**
* @dev Extended interface of the ERC165 standard to ensure compatibility
* with Diamond facets as defined in EIP-2535.
*
* This interface extends the basic ERC165 mechanism to provide additional
* flexibility for querying supported interfaces, which can then be
* dynamically resolved by one of facets in a Diamond.
*/
interface IERC165Extended {
/**
* @notice Checks if the given interface ID is supported by the contract.
* @param interfaceId The ID of the interface to query.
* @return isSupported Boolean value indicating whether the interface is supported.
*/
function supportsInterfaceExtended(bytes4 interfaceId) external pure returns (bool isSupported);
}
contracts/interfaces/compiler/ILiquidityPoolsController.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.22;
import {Status} from "../compliance/IWhitelistingController.sol";
/**
* @notice Represents a record for an evaluator associated with a specific protocol.
* @param protocol The name of the protocol that the evaluator is associated with.
* @param evaluator The address of the evaluator.
*/
struct EvaluatorRecord {
string protocol;
address evaluator;
}
/**
* @title WhitelistingBytesRecord
* @notice A struct used to store encoded pool data and its support status.
* @dev This struct is employed in the [`ILiquidityPoolsController`](/interfaces/compiler/ILiquidityPoolsController.sol/interface.ILiquidityPoolsController.html) interface.
* @dev `encoded`: Encoded pool data. The encoding depends on the underlying protocol.
* For example UniswapV3 protocol expects this as `(address token0, address token1, uint24 fee)`.
* To find out which encoding does `ProtocolName` expects,
* check `{ProtocolName}LiquidityPoolsRepository.initializePool()`
* @dev `supported`: Indicates whether the pool is supported.
*/
struct WhitelistingBytesRecord {
bytes encoded;
bool supported;
}
/**
* @title ILiquidityPoolsController
* @notice Interface for managing liquidity pools and their support status for different protocols.
*/
interface ILiquidityPoolsController {
/**
* @notice Emitted when an evaluator is updated for a specific protocol.
* @param protocol The name of the protocol associated with the updated evaluator.
* @param evaluator The address of the updated evaluator.
*/
event EvaluatorUpdated(string protocol, address evaluator);
/**
* @dev Emitted when the support status of a pool changes.
* @param protocol The `protocol` identifier.
* @param encodedPool The encoded pool data.
* @param poolId The unique identifier of the pool.
* @param supported Whether the pool is supported or not.
*/
event PoolSupportChanged(
string protocol,
bytes encodedPool,
uint256 indexed poolId,
bool supported
);
/**
* @notice Updates the evaluators for the specified protocols.
* @dev This function allows updating the evaluators by passing an array of [`EvaluatorRecord`](#evaluatorrecord) structs.
* @param records An array of [`EvaluatorRecord`](#evaluatorrecord) structs, each containing the protocol name and the new evaluator address.
*/
function updateEvaluators(EvaluatorRecord[] calldata records) external;
/**
* @notice Update the support status of multiple liquidity pools for a specific protocol.
* @dev Reverts with an [`AlreadyUpToDate`](/interfaces/base/CommonErrors.sol/error.AlreadyUpToDate.html) error if status didn't change for any given pool.
* @dev Emits a [`PoolSupportChanged`](#poolsupportchanged) event for each pool.
* @param _protocol The `protocol` identifier.
* @param _pools An array of [`WhitelistingBytesRecord`](/interfaces/compiler/ILiquidityPoolsController.sol/struct.WhitelistingBytesRecord.html#whitelistingbytesrecord) structs containing pool data and support status.
*/
function updatePoolsSupport(
string calldata _protocol,
WhitelistingBytesRecord[] calldata _pools
) external;
/**
* @notice Returns the role identifier required to manage all master set whitelists.
* @return A bytes32 value representing the ARKIS_WHITELIST_OFFICER_ROLE.
*/
/* solhint-disable-next-line func-name-mixedcase*/
function ARKIS_WHITELIST_OFFICER_ROLE() external view returns (bytes32);
/* solhint-disable ordering */
/**
* @notice Retrieves the evaluator address for a given protocol.
* @dev This function returns the address of the evaluator associated with the specified protocol.
* @param protocol The name of the protocol for which to retrieve the evaluator address.
* @return The address of the evaluator associated with the specified protocol.
*/
function getProtocolEvaluator(string calldata protocol) external view returns (address);
/**
* @notice Get the status of a specific pool and its associated protocol.
* @param _protocol The `protocol` identifier.
* @param _poolId The unique identifier of the pool.
* @return poolStatus_ The [`Status`](/interfaces/compliance/IWhitelistingController.sol/enum.Status.html)
* of the pool.
*/
function getPoolStatus(
string calldata _protocol,
uint256 _poolId
) external returns (Status poolStatus_);
/**
* @notice Get the unique identifier (pool ID) of a specific pool.
* @param _protocol The `protocol` identifier.
* @param _encodedPool The encoded pool data. The encoding depends on the underlying protocol.
* For example UniswapV3 protocol expects this as (address token0, address token1, uint24 fee).
* To find out which encoding does `ProtocolName` expects,
* check {ProtocolName}LiquidityPoolsRepository.getPoolIdFromTokens()
* @dev `supported`: Indicates whether the pool is supported.
* @return poolId_ The unique identifier of the pool.
*/
function getPoolId(
string calldata _protocol,
bytes calldata _encodedPool
) external returns (uint256 poolId_);
/* solhint-enable ordering */
}
contracts/interfaces/compliance/IWhitelistingController.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.22;
import {IERC165Extended} from "../base/IERC165Extended.sol";
import {IWhitelistingControllerAgreement} from "./IWhitelistingControllerAgreement.sol";
/**
* @title Status
* @notice Enum representing status of a record (e.g., token, protocol, operator)
* used for operation validation.
* @notice Validators must adhere to the following rules for different operations and contexts:
* 1) For exchanges: `operator`, `pool`, and `input token` *MAY* be either supported or suspended, but the `output token` *MUST* be supported.
* 2) For deposits: `operator`, `pool`, and every `token` in the `pool` *MUST* be supported.
* 3) For withdrawals: `operator`, `pool`, and each `token` *MAY* be either supported or suspended.
*
* @dev **Note** that deposit denotes **all** ways of acquiring liquidity such
* as token deposit, LP tokens stake, NFT mint etc.
*/
enum Status {
Undefined,
Supported,
Suspended
}
/**
* @title WhitelistingAddressRecord
* @notice A struct to store an address and its support status.
* @dev This struct stores an address and its support status.
* @dev `source`: The address to be stored.
* @dev `supported`: Indicates whether the address is supported or not.
*/
struct WhitelistingAddressRecord {
address source;
bool supported;
}
/**
* @title WhitelistingTokenRecord
* @notice This struct stores an address and its support status for whitelisting, collateral and leverage.
* @dev `source`: The address of the token.
* @dev `supported`: Whether the token can be received from a protocol trades.
*/
struct WhitelistingTokenRecord {
address source;
bool supported;
}
/**
* @title TreasuryStorage
* @notice ERC-7201 namespaced storage for the protocol treasury address.
* @dev `treasury`: The address that receives protocol fees on close.
*/
struct TreasuryStorage {
address treasury;
}
/**
* @notice An error indicating that a token is not supported by the whitelisting controller.
* @dev This error is thrown when an unsupported token is used.
* @dev `token`: The address of the unsupported token.
*/
error TokenIsNotSupported(address token);
/**
* @notice An error indicating that a token is suspended by the whitelisting controller.
* @dev This error is thrown when a suspended token is used.
* @dev `token`: The address of the suspended token.
*/
error TokenIsSuspended(address token);
/**
* @notice An error indicating that an operator is not supported by the whitelisting controller.
* @dev This error is thrown when an unsupported operator is used.
* @dev `operator`: The address of the unsupported operator.
*/
error OperatorIsNotSupported(address operator);
/**
* @notice An error indicating that an operator is suspended by the whitelisting controller.
* @dev This error is thrown when a suspended operator is used.
* @dev `operator`: The address of the suspended operator.
*/
error OperatorIsSuspended(address operator);
/**
* @notice An error indicating that a protocol is not supported by the whitelisting controller.
* @dev This error is thrown when an unsupported protocol is used.
* @dev `protocol`: The identification string of the unsupported protocol.
*/
error ProtocolIsNotSupported(bytes31 protocolNameHash);
/**
* @notice An error indicating that a protocol is suspended by the whitelisting controller.
* @dev This error is thrown when a suspended protocol is used.
* @dev `protocol`: The identification string of the unsupported protocol.
*/
error ProtocolIsSuspended(bytes31 protocolNameHash);
interface ITenant {
function factory() external view returns (address);
}
/**
* @title IWhitelistingController
* @notice Interface for managing whitelisting of tokens, protocols, and operators.
*/
interface IWhitelistingController is IWhitelistingControllerAgreement, IERC165Extended {
/**
* @dev Emitted when the support status of a protocol changes.
* @dev `protocol`: The identification string of the protocol.
* @dev `supported`: Whether the protocol is supported or not.
*/
event ProtocolSupportChanged(string indexed protocol, bool supported);
/**
* @dev Emitted when the support status of a token changes.
* @dev `token`: The address of the token.
* @dev `supported`: Whether the token is supported or not.
*/
event TokenSupportChanged(address indexed token, bool supported);
/**
* @dev Emitted when the support status of an operator changes for a specific protocol.
* @dev `protocol`: The identification string of the protocol.
* @dev `operator`: The address of the operator.
* @dev `supported`: Whether the operator is supported or not.
*/
event OperatorSupportChanged(string indexed protocol, address indexed operator, bool supported);
/**
* @dev Emitted when the protocol treasury address is changed.
* @dev `previousTreasury`: The treasury address before the change.
* @dev `newTreasury`: The treasury address after the change.
*/
event TreasuryChanged(address indexed previousTreasury, address indexed newTreasury);
/**
* @notice Reverts when the agreement was deployed by a different factory version.
* @dev This error is used by the `onlyAgreementFactory` modifier to prevent
* `addTokens` and `addOperators` calls from wrong factory.
* @param factory The address of the factory attempting to interact.
* @param agreement The agreement contract whose associated factory version did not match the caller.
*/
error AgreementFactoryVersionMismatch(address factory, address agreement);
/**
* @notice Reverts when the caller contract supports a prohibited interface.
* @dev This error is used by the `notMarginAccount` modifier to prevent
* function calls from contracts that implement the `IAccount` interface.
* @param caller The address of the caller contract
*/
error CallerSupportsForbiddenInterface(address caller);
/**
* @notice An error indicating that the provided address is not a valid token address.
* @dev This error is thrown when the address does not conform to the expected token interface.
* @param token The address that failed the token validation check.
*/
error InvalidTokenAddress(address token);
/**
* @notice Update the support status of multiple tokens.
* @dev Emits a [`TokenSupportChanged()`](#tokensupportchanged) event for each token whose status changed.
* @dev Reverts with an [`AlreadyUpToDate()`](/interfaces/base/CommonErrors.sol/error.AlreadyUpToDate.html)
* error if no token status changed.
* @param _tokens An array of [`WhitelistingTokenRecord`](./struct.WhitelistingTokenRecord.html)
* structs containing token addresses and support.
*/
function updateTokensSupport(WhitelistingTokenRecord[] calldata _tokens) external;
/**
* @notice Update the support status of a protocol.
* @dev Emits a [`ProtocolSupportChanged()`](#protocolsupportchanged) event.
* @dev Reverts with an [`AlreadyUpToDate()`](/interfaces/base/CommonErrors.sol/error.AlreadyUpToDate.html)
* error if protocol status is up to date.
* @param _protocol The identification string of the protocol.
* @param _supported Whether the protocol is supported or not.
*/
function updateProtocolSupport(string calldata _protocol, bool _supported) external;
/**
* @notice Update the support status of multiple operators for a specific protocol.
* @dev Emits a [`OperatorSupportChanged()`](#operatorsupportchanged) event for each token whose status changed.
* @dev Reverts with an [`AlreadyUpToDate()`](/interfaces/base/CommonErrors.sol/error.AlreadyUpToDate.html)
* error if no operator status changed.
* @param _protocol The identification string of the protocol.
* @param _operators An array of `WhitelistingAddressRecord` structs containing operator addresses and support statuses.
*/
function updateOperatorsSupport(
string calldata _protocol,
WhitelistingAddressRecord[] calldata _operators
) external;
/**
* @notice Sets the protocol treasury address.
* @dev Only callable by an account with `ARKIS_SECURITY_OFFICER_ROLE`.
* Emits a [`TreasuryChanged()`](#treasurychanged) event.
* @param newTreasury The new treasury address.
*/
function setTreasury(address newTreasury) external;
/**
* @notice Returns the role identifier required to manage all master set whitelists.
* @return A bytes32 value representing the ARKIS_WHITELIST_OFFICER_ROLE.
*/
/* solhint-disable-next-line func-name-mixedcase*/
function ARKIS_WHITELIST_OFFICER_ROLE() external view returns (bytes32);
/**
* @notice Returns the support status of a token.
* @param _token The address of the token.
* @return The [`Status`](./enum.Status.html) of the token.
*/
function getTokenStatus(address _token) external view returns (Status);
/**
* @notice Checks whether a specific token is supported by a tenant.
* @dev This function returns a boolean indicating if the given token is supported by the specified tenant.
* @param tenant The address of the tenant to check.
* @param token The address of the token to check for support.
* @return A boolean value indicating whether the token is supported by the tenant.
*/
function getTokenSupport(address tenant, address token) external view returns (bool);
/**
* @notice Retrieves the list of tokens supported by a specific tenant.
* @dev This function returns an array of token addresses that are supported by the specified tenant.
* @param tenant The address of the tenant whose supported tokens are to be retrieved.
* @return An array of addresses representing the tokens supported by the tenant.
*/
function getTokens(address tenant) external view returns (address[] memory);
/**
* @notice Returns the support status of a protocol.
* @param protocol The identification string of the protocol.
* @return The [`Status`](./enum.Status.html)
* of the protocol.
*/
function getProtocolStatus(string calldata protocol) external view returns (Status);
/**
* @notice Returns the support status of an operator for a specific protocol.
* @param _operator The address of the operator.
* @return operatorStatus_ The [`Status`](./enum.Status.html)
* of the operator.
* @return protocolStatus_ The [`Status`](./enum.Status.html)
* of the protocol.
*/
function getOperatorStatus(
address _operator
) external view returns (Status operatorStatus_, Status protocolStatus_);
/**
* @notice Returns role identifier for unpause operators
* @return bytes32 keccak256 hash of ARKIS_SECURITY_OFFICER_ROLE
*/
/* solhint-disable-next-line func-name-mixedcase*/
function ARKIS_SECURITY_OFFICER_ROLE() external view returns (bytes32);
/**
* @notice Returns the protocol treasury address that receives protocol fees on close.
* @return The treasury address.
*/
function treasury() external view returns (address);
}
contracts/interfaces/compliance/IWhitelistingControllerAgreement.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.22;
/**
* @title IWhitelistingControllerAgreement
* @notice Interface for managing whitelisting of tokens and operators for Agreements.
*/
interface IWhitelistingControllerAgreement {
/**
* @notice Emitted when a new token is added for a specific tenant.
* @param tenant The address of the tenant to whom the token is added.
* @param token The address of the token that has been added.
*/
event TokenAdded(address tenant, address token);
/**
* @notice Emitted when a new operator is added for a specific tenant.
* @param tenant The address of the tenant to whom the operator is added.
* @param operator The address of the operator that has been added.
*/
event OperatorAdded(address tenant, address operator);
/**
* @notice Adds a list of tokens to the specified tenant.
* @param tenant The address of the tenant to which the tokens will be added.
* @param tokens An array of addresses representing the tokens to be added.
* @dev This function can be used to update the list of supported tokens for a given tenant.
*/
function addTokens(address tenant, address[] calldata tokens) external;
/**
* @notice Adds a list of operators to the specified tenant.
* @param tenant The address of the tenant to which the operators will be added.
* @param operators An array of addresses representing the operators to be added.
* @dev This function updates the list of authorized operators for a given tenant.
*/
function addOperators(address tenant, address[] calldata operators) external;
/**
* @notice Returns the address of the agreement factory contract.
* @return The address of the agreement factory.
* @dev The agreement factory is used to create and manage agreements.
*/
function agreementFactory() external view returns (address);
/**
* @notice Returns the address of the agreement V2 factory contract.
* @return The address of the agreement V2 factory.
* @dev The agreement V2 factory is used to create and manage agreements V2.
*/
function agreementV2Factory() external view returns (address);
/**
* @notice Checks if a specific token is supported for a given tenant.
* @param tenant The address of the tenant whose supported tokens are being queried.
* @param token The address of the token to check for support.
* @return A boolean indicating whether the token is supported by the tenant.
* @dev This function will return `true` if the token is supported, and `false` otherwise.
*/
function getTokenSupport(address tenant, address token) external view returns (bool);
/**
* @notice Retrieves a list of tokens supported by a specific tenant.
* @param tenant The address of the tenant whose supported tokens are being queried.
* @return An array of token addresses supported by the specified tenant.
* @dev This function returns an array containing the addresses of tokens that the tenant supports.
* It is a view function and does not modify the contract state.
*/
function getTokens(address tenant) external view returns (address[] memory);
/**
* @notice Checks if a specific operator is supported by a given tenant.
* @param tenant The address of the tenant whose supported operators are being queried.
* @param operator The address of the operator to check for support.
* @return A boolean value indicating whether the operator is supported by the tenant.
* @dev This function returns `true` if the operator is supported by the specified tenant, and `false` otherwise.
* It is a view function and does not modify the contract state.
*/
function getOperatorSupport(address tenant, address operator) external view returns (bool);
/**
* @notice Retrieves the list of operators associated with a specific tenant.
* @param tenant The address of the tenant whose operators are being queried.
* @return A dynamically-sized array of addresses representing the operators associated with the tenant.
* @dev This function is a view function and does not modify the contract state.
*/
function getOperators(address tenant) external view returns (address[] memory);
}
contracts/interfaces/diamond/IDiamondCut.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;
interface IDiamondCut {
enum FacetCutAction {
Add,
Replace,
Remove
}
struct FacetCut {
address facetAddress;
FacetCutAction action;
bytes4[] functionSelectors;
}
/// @notice Add/replace/remove any number of functions and optionally execute
/// a function with delegatecall
/// @param _diamondCut Contains the facet addresses and function selectors
/// @param _init The address of the contract or facet to execute _calldata
/// @param _calldata A function call, including function selector and arguments
/// _calldata is executed with delegatecall on _init
function diamondCut(
FacetCut[] calldata _diamondCut,
address _init,
bytes calldata _calldata
) external;
}
contracts/interfaces/multisig/IUpgradeMultisig.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.22;
import {EvaluatorRecord} from "contracts/interfaces/compiler/ILiquidityPoolsController.sol";
import {IDiamondCut} from "contracts/interfaces/diamond/IDiamondCut.sol";
/**
* @title IUpgradeMultisig
* @dev Interface for multisig contract managing smart contract upgrades
* @notice Operators submit releases, approvers approve, then anyone executes after the timelock
*/
interface IUpgradeMultisig {
// ============ Structs ============
struct BeaconUpgrade {
address beacon;
address newImplementation;
}
struct ProxyUpgrade {
address proxy;
address newImplementation;
bytes initData;
uint256 value;
}
struct DiamondCut {
address diamond;
IDiamondCut.FacetCut[] cuts;
address init;
bytes initData;
}
struct EvaluatorUpdate {
EvaluatorRecord[] records;
}
struct ReleaseData {
BeaconUpgrade[] beaconUpgrades;
ProxyUpgrade[] proxyUpgrades;
DiamondCut[] diamondCuts;
EvaluatorUpdate[] evaluatorUpdates;
}
enum ManagementRequestType {
AddApprover,
RemoveApprover,
ChangeThreshold,
AddOperator,
RemoveOperator,
ChangeTimelock,
AddSecurityOfficer,
RemoveSecurityOfficer,
RenounceOwnership,
TransferOwnership
}
enum Status {
Pending,
Executed,
Rejected
}
struct ManagementRequest {
bytes32 requestId;
address targetApprover;
uint80 nonce;
uint8 newThreshold;
ManagementRequestType requestType;
uint128 newTimelockDuration;
Status status;
address targetOperator;
address targetContract;
address[] targetContracts;
address newOwner;
uint128 timelockDuration;
uint256 timelockStart;
mapping(address => bool) approvals;
mapping(address => bool) rejections;
}
struct Release {
address operator;
uint80 nonce;
Status status;
uint128 timelockDuration;
uint256 timelockStart;
BeaconUpgrade[] beaconUpgrades;
ProxyUpgrade[] proxyUpgrades;
DiamondCut[] diamondCuts;
EvaluatorUpdate[] evaluatorUpdates;
}
// ============ Events ============
/**
* @dev Emitted when a new release is submitted
* @param releaseId The unique identifier for the release
* @param operator The address of the operator who submitted the release
* @param releaseHash The hash of the release data (keccak256(abi.encode(releaseData)))
* @param beaconCount Number of beacon upgrades in the release
* @param proxyCount Number of proxy upgrades in the release
* @param diamondCount Number of diamond cuts in the release
* @param evaluatorCount Number of evaluator updates in the release
* @param timestamp Block timestamp when the release was submitted
*/
event ReleaseSubmitted(
bytes32 indexed releaseId,
address indexed operator,
bytes32 releaseHash,
uint256 beaconCount,
uint256 proxyCount,
uint256 diamondCount,
uint256 evaluatorCount,
uint256 timestamp
);
/**
* @dev Emitted when a release is approved by a signer
* @param releaseId The unique identifier for the release
* @param approver The address of the signer who approved
* @param timestamp Block timestamp when the release was approved
*/
event ReleaseApproved(bytes32 indexed releaseId, address indexed approver, uint256 timestamp);
/**
* @dev Emitted when a release is rejected by a signer
* @param releaseId The unique identifier for the release
* @param rejector The address of the signer who rejected
* @param timestamp Block timestamp when the release was rejected
*/
event ReleaseRejected(bytes32 indexed releaseId, address indexed rejector, uint256 timestamp);
/**
* @dev Emitted when a release is ready for execution (threshold approvals reached)
* @param releaseId The unique identifier for the release
* @param timestamp Block timestamp when the release became ready for execution
*/
event ReleaseTimelockStarted(bytes32 indexed releaseId, uint256 timestamp);
/**
* @dev Emitted when a release is executed
* @param releaseId The unique identifier for the release
* @param executor The address of the executor
* @param timestamp Block timestamp when the release was executed
*/
event ReleaseExecuted(bytes32 indexed releaseId, address indexed executor, uint256 timestamp);
event AddApproverRequestSubmitted(
bytes32 indexed requestId,
address indexed operator,
address indexed approver,
uint256 timestamp
);
event RemoveApproverRequestSubmitted(
bytes32 indexed requestId,
address indexed operator,
address indexed approver,
uint256 timestamp
);
event ChangeThresholdRequestSubmitted(
bytes32 indexed requestId,
address indexed operator,
uint8 newThreshold,
uint256 timestamp
);
event AddOperatorRequestSubmitted(
bytes32 indexed requestId,
address indexed operator,
address indexed targetOperator,
uint256 timestamp
);
event RemoveOperatorRequestSubmitted(
bytes32 indexed requestId,
address indexed operator,
address indexed targetOperator,
uint256 timestamp
);
event ChangeTimelockRequestSubmitted(
bytes32 indexed requestId,
address indexed operator,
uint128 newTimelockDuration,
uint256 timestamp
);
event ManagementRequestApproved(
bytes32 indexed requestId,
address indexed approver,
uint256 timestamp
);
event ManagementRequestRejected(
bytes32 indexed requestId,
address indexed rejector,
uint256 timestamp
);
/**
* @dev Emitted when a management request rejection threshold is reached and the request is finalized as rejected
* @param requestId The unique identifier for the management request
* @param timestamp Block timestamp when the rejection threshold was reached
*/
event ManagementRequestRejectionThresholdReached(bytes32 indexed requestId, uint256 timestamp);
event ManagementRequestTimelockStarted(bytes32 indexed requestId, uint256 timestamp);
event ManagementRequestExecuted(
bytes32 indexed requestId,
address indexed executor,
uint256 timestamp
);
event ApproverAdded(bytes32 indexed requestId, address indexed approver);
event ApproverRemoved(bytes32 indexed requestId, address indexed approver);
event ThresholdChanged(bytes32 indexed requestId, uint8 oldThreshold, uint8 newThreshold);
event OperatorAdded(bytes32 indexed requestId, address indexed operator);
event OperatorRemoved(bytes32 indexed requestId, address indexed operator);
event TimelockChanged(bytes32 indexed requestId, uint128 oldTimelock, uint128 newTimelock);
event AddSecurityOfficerRequestSubmitted(
bytes32 indexed requestId,
address indexed operator,
address indexed securityOfficer,
uint256 timestamp
);
event RemoveSecurityOfficerRequestSubmitted(
bytes32 indexed requestId,
address indexed operator,
address indexed securityOfficer,
uint256 timestamp
);
event SecurityOfficerAdded(bytes32 indexed requestId, address indexed securityOfficer);
event SecurityOfficerRemoved(bytes32 indexed requestId, address indexed securityOfficer);
event RenounceOwnershipRequestSubmitted(
bytes32 indexed requestId,
address indexed operator,
address indexed targetContract,
uint256 timestamp
);
event OwnershipRenounced(bytes32 indexed requestId, address indexed targetContract);
event TransferOwnershipRequestSubmitted(
bytes32 indexed requestId,
address indexed operator,
address indexed newOwner,
address[] targetContracts,
uint256 timestamp
);
event OwnershipTransferred(
bytes32 indexed requestId,
address indexed targetContract,
address indexed newOwner
);
// ============ Errors ============
/**
* @dev Thrown when an unauthorized signer attempts to perform an action
*/
error UnauthorizedSigner();
/**
* @dev Thrown when attempting to create a release that already exists
*/
error ReleaseAlreadyExists();
/**
* @dev Thrown when attempting to perform an action on a non-existent release
*/
error ReleaseDoesNotExist();
/**
* @dev Thrown when attempting to perform an action on an already executed release
*/
error ReleaseAlreadyExecuted();
/**
* @dev Thrown when attempting to perform an action on a rejected release
*/
error CannotApproveRejectedRelease();
/**
* @dev Thrown when attempting to reject a release that is already rejected
*/
error ReleaseAlreadyRejected();
/**
* @dev Thrown when attempting to execute a rejected release
*/
error CannotExecuteRejectedRelease();
/**
* @dev Thrown when attempting to approve a release that has already been approved
*/
error AlreadyApproved();
/**
* @dev Thrown when attempting to perform an action that requires approval but hasn't been approved
*/
error NotApproved();
/**
* @dev Thrown when an invalid address is provided (zero address or duplicate addresses)
*/
error InvalidAddress();
/**
* @dev Thrown when initData is provided but is invalid:
* - Shorter than 4 bytes (minimum function selector size)
* - Not properly ABI-encoded (length % 32 != 4, i.e., must be 4 bytes selector + 32-byte aligned parameters)
*/
error InvalidInitData();
/**
* @dev Thrown when a proxy is not an EIP-1967 proxy (implementation slot is zero)
*/
error NotEip1967Proxy();
/**
* @dev Thrown when a proxy's admin doesn't match the expected proxyAdmin
*/
error WrongAdmin();
/**
* @dev Thrown when attempting to submit an empty release
*/
error EmptyRelease();
error ManagementRequestAlreadyExists();
error ManagementRequestDoesNotExist();
error ManagementRequestAlreadyExecuted();
error ManagementRequestAlreadyRejected();
error CannotApproveRejectedManagementRequest();
error CannotExecuteRejectedManagementRequest();
error CannotRejectAfterApproving();
error CannotApproveAfterRejecting();
error CannotRenounceBelowThreshold();
error InsufficientOperators();
error InvalidThreshold();
error ApproverAlreadyExists();
error ApproverDoesNotExist();
error ApproverCannotBeOperator();
error CannotRenounceWhileManagementRequestPending();
error InsufficientApprovers();
error InsufficientApprovals();
error InsufficientValue(uint256 required, uint256 provided);
error OperatorAlreadyExists();
error OperatorDoesNotExist();
error RateLimit(address operator, uint256 lastProposed);
error OperatorCannotBeApprover();
error EmptyTargetContracts();
error AddressesNotAscending(address previous, address current);
error InvalidManagementRequestType();
error SecurityOfficerAlreadyExists();
error SecurityOfficerDoesNotExist();
error CannotRemoveLastSecurityOfficer();
error CannotRenounceLastSecurityOfficer();
error InvalidReleaseHash();
error TimelockNotPassed();
/**
* @dev Thrown when a target contract does not implement Ownable (no owner() function)
* @param target The address that is not Ownable
*/
error NotOwnable(address target);
/**
* @dev Thrown when the multisig is not the owner of the target contract
* @param target The target contract address
* @param expectedOwner The expected owner (multisig address)
* @param actualOwner The actual owner of the contract
*/
error NotOwner(address target, address expectedOwner, address actualOwner);
/**
* @dev Thrown when timelock duration would cause overflow or is invalid
*/
error InvalidTimelockDuration();
error ReleaseNotReady();
error ManagementRequestNotReady();
/**
* @dev Thrown when attempting to execute a release out of order
* @param expectedNonce The expected nonce for the next release
* @param actualNonce The nonce of the release being executed
*/
error ReleaseOutOfOrder(uint80 expectedNonce, uint80 actualNonce);
/**
* @dev Thrown when attempting to execute a management request out of order
* @param expectedNonce The expected nonce for the next management request
* @param actualNonce The nonce of the management request being executed
*/
error ManagementRequestOutOfOrder(uint80 expectedNonce, uint80 actualNonce);
/**
* @dev Thrown when attempting to submit a release while a management request is pending
*/
error ManagementRequestPending();
/**
* @dev Thrown when attempting to submit a management request while a release is pending
*/
error ReleasePending();
/**
* @dev Thrown when a beacon upgrade fails during execution
* @param index The index of the failed upgrade in the beaconUpgrades array
* @param beacon The address of the beacon that failed to upgrade
* @param reason The original error reason bytes
*/
error BeaconUpgradeFailed(uint256 index, address beacon, bytes reason);
/**
* @dev Thrown when beacon upgrade validation fails after execution
* @param index The index of the failed upgrade in the beaconUpgrades array
* @param beacon The address of the beacon that failed validation
* @param expectedImplementation The expected implementation address
* @param actualImplementation The actual implementation address returned by beacon.implementation()
*/
error BeaconUpgradeValidationFailed(
uint256 index,
address beacon,
address expectedImplementation,
address actualImplementation
);
/**
* @dev Thrown when a proxy upgrade fails during execution
* @param index The index of the failed upgrade in the proxyUpgrades array
* @param proxy The address of the proxy that failed to upgrade
* @param isUpgradeAndCall Whether this was an upgradeAndCall operation
* @param reason The original error reason bytes
*/
error ProxyUpgradeFailed(uint256 index, address proxy, bool isUpgradeAndCall, bytes reason);
/**
* @dev Thrown when proxy upgrade validation fails after execution
* @param index The index of the failed upgrade in the proxyUpgrades array
* @param proxy The address of the proxy that failed validation
* @param isUpgradeAndCall Whether this was an upgradeAndCall operation
* @param expectedImplementation The expected implementation address
* @param actualImplementation The actual implementation address returned by proxy.implementation()
*/
error ProxyUpgradeValidationFailed(
uint256 index,
address proxy,
bool isUpgradeAndCall,
address expectedImplementation,
address actualImplementation
);
/**
* @dev Thrown when a proxy admin slot validation fails after upgrade
* @param index The index of the failed upgrade in the proxyUpgrades array
* @param proxy The address of the proxy that failed validation
* @param expectedAdmin The expected admin address (proxyAdmin)
* @param actualAdmin The actual admin address after upgrade
*/
error ProxyAdminValidationFailed(
uint256 index,
address proxy,
address expectedAdmin,
address actualAdmin
);
/**
* @dev Thrown when a diamond cut fails during execution
* @param index The index of the failed cut in the diamondCuts array
* @param diamond The address of the diamond that failed to cut
* @param reason The original error reason bytes
*/
error DiamondCutFailed(uint256 index, address diamond, bytes reason);
/**
* @dev Thrown when an evaluator update fails during execution
* @param index The index of the failed update in the evaluatorUpdates array
* @param reason The original error reason bytes
*/
error EvaluatorUpdateFailed(uint256 index, bytes reason);
/**
* @dev Thrown when diamond cut validation fails after execution
* @param cutIndex The index of the failed cut in the diamondCuts array
* @param diamond The address of the diamond that failed validation
* @param facetCutIndex The index of the facet cut within the cuts array
* @param selectorIndex The index of the selector within the functionSelectors array
* @param selector The function selector that failed validation
* @param action The FacetCutAction (Add/Replace/Remove)
* @param expectedFacet The expected facet address
* @param actualFacet The actual facet address returned by facetAddress(selector)
*/
error DiamondCutValidationFailed(
uint256 cutIndex,
address diamond,
uint256 facetCutIndex,
uint256 selectorIndex,
bytes4 selector,
IDiamondCut.FacetCutAction action,
address expectedFacet,
address actualFacet
);
/**
* @dev Thrown when a diamond doesn't support IDiamondLoupe interface
*/
error InvalidDiamond();
/**
* @dev Thrown when FacetCutAction enum value is out of bounds
*/
error InvalidFacetCutAction();
/**
* @dev Thrown when a selector appears multiple times in a diamond cut batch
*/
error DuplicateSelector(bytes4 selector);
/**
* @dev Thrown when a selector is bytes4(0)
*/
error InvalidSelector();
/**
* @dev Thrown when trying to add a selector that already exists
*/
error SelectorAlreadyExists(bytes4 selector);
/**
* @dev Thrown when trying to replace/remove a selector that doesn't exist
*/
error SelectorDoesNotExist(bytes4 selector);
/**
* @dev Thrown when trying to remove an immutable selector (implemented directly in diamond)
*/
error SelectorImmutable(bytes4 selector);
/**
* @dev Thrown when init and initData are not coherent
*/
error InvalidInitCoherence();
// ============ Functions ============
/**
* @dev Submit a new release with upgrade operations
* @param releaseData Struct containing all upgrade operations
* @param releaseHash Hash of the release data for validation
* @return releaseId The generated release ID
*/
function submitRelease(
ReleaseData calldata releaseData,
bytes32 releaseHash
) external returns (bytes32 releaseId);
/**
* @dev Approve a release
* @param releaseId The release ID to approve
*/
function approveRelease(bytes32 releaseId) external;
/**
* @dev Execute an approved release after timelock period
* @param releaseId The release ID to execute
*/
function executeRelease(bytes32 releaseId) external payable;
/**
* @dev Reject a release (clears all approvals)
* @param releaseId The release ID to reject
*/
function rejectRelease(bytes32 releaseId) external;
// ============ Management Functions ============
/**
* @dev Submit a management request (generic function for all request types)
* @param requestType The type of management request to submit
* @param requestData ABI-encoded request parameters:
* - AddApprover: abi.encode(address _approver)
* - RemoveApprover: abi.encode(address _approver)
* - ChangeThreshold: abi.encode(uint8 _newThreshold)
* - AddOperator: abi.encode(address _operator)
* - RemoveOperator: abi.encode(address _operator)
* - ChangeTimelock: abi.encode(uint128 _newTimelockDuration)
* - AddSecurityOfficer: abi.encode(address _securityOfficer)
* - RemoveSecurityOfficer: abi.encode(address _securityOfficer)
* - RenounceOwnership: abi.encode(address _targetContract)
* - TransferOwnership: abi.encode(address[] _targetContracts, address _newOwner), targets strictly ascending
* @return requestId The unique identifier for the management request
*/
function submitManagementRequest(
ManagementRequestType requestType,
bytes calldata requestData
) external returns (bytes32 requestId);
/**
* @dev Approve a management request
* @param requestId The management request ID to approve
*/
function approveManagementRequest(bytes32 requestId) external;
/**
* @dev Reject a management request
* @param requestId The management request ID to reject
*/
function rejectManagementRequest(bytes32 requestId) external;
/**
* @dev Execute an approved management request after timelock period
* @param requestId The management request ID to execute
*/
function executeManagementRequest(bytes32 requestId) external;
// ============ View Functions ============
/**
* @dev Get the list of approvers
* @return Array of approver addresses
*/
function getApprovers() external view returns (address[] memory);
/**
* @dev Get management request information
* @param requestId The management request ID
* @return requestType The type of management request
* @return targetApprover The target approver (for add/remove operations)
* @return newThreshold The new threshold (for threshold change operations)
* @return targetOperator The operator to add or remove (for operator operations)
* @return newTimelockDuration The new timelock duration (for timelock change operations)
* @return targetContract The target contract address (for renounce ownership operations)
* @return newOwner The new owner (for transfer ownership operations)
* @return status The status of the request (Pending, Executed, or Rejected)
*/
function getManagementRequestInfo(
bytes32 requestId
)
external
view
returns (
ManagementRequestType requestType,
address targetApprover,
uint8 newThreshold,
address targetOperator,
uint128 newTimelockDuration,
address targetContract,
address newOwner,
Status status
);
/**
* @dev Get the target contracts of a transfer ownership request
* @param requestId The management request ID
* @return The contracts whose ownership the request transfers
*/
function getManagementRequestTargetContracts(
bytes32 requestId
) external view returns (address[] memory);
/**
* @dev Get management request approval and rejection status
* @param requestId The management request ID
* @param approver The approver address to check
* @return approved Whether the approver has approved this management request
* @return rejected Whether the approver has rejected this management request
*/
function getManagementRequestApprovalStatus(
bytes32 requestId,
address approver
) external view returns (bool approved, bool rejected);
}
Compiler settingsShow
{
"viaIR": false,
"metadata": {
"useLiteralContent": true
},
"optimizer": {
"runs": 1000000,
"details": {
"yulDetails": {
"optimizerSteps": "u"
}
},
"enabled": true
},
"evmVersion": "paris"
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.