Skip to content
Verified contractExactBUSL-1.1

TreasuryInit

Address0xbfc39aff1cebb23e7138cbb7dd65212edd9b0252
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.8.22

 

Same code

Only this 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,448,450
Creation transaction
0x2ff7a8c0f6…c1eba0cfb2

contracts/compliance/init/V001_TreasuryInit.sol

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.22;

import {AddressMustNotBeZero} from "contracts/interfaces/base/CommonErrors.sol";
import {ITreasuryInit} from "contracts/interfaces/compliance/init/ITreasuryInit.sol";
import {
    IWhitelistingController,
    TreasuryStorage
} from "contracts/interfaces/compliance/IWhitelistingController.sol";

/**
 * @title TreasuryInit
 * @notice Seeds the Compliance diamond's protocol treasury, which upgraded diamonds read as zero.
 * @dev Delegatecalled through `DiamondCut.init` / `initData` so it writes the diamond's own storage.
 * `setTreasury` cannot do this from a release: it is `whenNotPaused` and the release pauses every
 * module before the cuts run, and its `onlyRole` check would fall on the multisig.
 */
contract TreasuryInit is ITreasuryInit {
    // keccak256(abi.encode(uint256(keccak256("compliance.treasury")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant TREASURY_SLOT =
        0xd883471e4e0acb4e3497a3cb2d60de5b9101c4dd020606dad2913b4f37e13200;

    function initTreasury(address newTreasury) external override {
        if (newTreasury == address(0)) revert AddressMustNotBeZero();

        TreasuryStorage storage $ = _treasuryStorage();
        address previousTreasury = $.treasury;
        if (previousTreasury != address(0)) revert TreasuryAlreadySet(previousTreasury);

        $.treasury = newTreasury;
        emit IWhitelistingController.TreasuryChanged(previousTreasury, newTreasury);
    }

    function _treasuryStorage() private pure returns (TreasuryStorage storage $) {
        assembly {
            $.slot := TREASURY_SLOT
        }
    }
}

@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/CommonErrors.sol

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.22;

/**
 * @notice An error indicating that the amount for the specified token is zero.
 * @param token The address of the token with a zero amount.
 */
error AmountMustNotBeZero(address token);

/**
 * @notice An error indicating that an address must not be zero.
 */
error AddressMustNotBeZero();

/**
 * @notice An error indicating that an array must not be empty.
 */
error ArrayMustNotBeEmpty();

/**
 * @notice An error indicating that an string must not be empty.
 */
error StringMustNotBeEmpty();

/**
 * @notice An error indicating storage is already up to date and doesn't need further processing.
 * @dev This error is thrown when attempting to update an entity(s) that is(are) already up to date.
 */
error AlreadyUpToDate();

/**
 * @notice An error indicating that an action is unauthorized for the specified account.
 * @param account The address of the unauthorized account.
 */
error UnauthorizedAccount(address account);

/**
 * @notice An error indicating that the min amount out must not be zero.
 */
error MinAmountOutMustNotBeZero();

/**
 * @notice An error indicating that the threshold exceeds the maximum allowed value.
 */

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/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/compliance/init/ITreasuryInit.sol

// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.22;

/**
 * @title ITreasuryInit
 * @notice Migration that seeds the Compliance diamond's protocol treasury.
 */
interface ITreasuryInit {
    /**
     * @dev Drop the migration from the release payload rather than letting it overwrite a treasury
     *  governance has since set.
     * @dev `treasury`: The treasury address already stored.
     */
    error TreasuryAlreadySet(address treasury);

    /**
     * @notice Writes the protocol treasury into the calling diamond's storage.
     * @dev Delegatecalled by the diamond through `DiamondCut.init` / `initData`.
     *  Emits a [`TreasuryChanged()`](/interfaces/compliance/IWhitelistingController.sol) event.
     * @param newTreasury The treasury address that receives protocol fees on close.
     */
    function initTreasury(address newTreasury) external;
}
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.