LayerCover

IPoolCreationPolicy

Interface reference for IPoolCreationPolicy.

Interface

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {Types} from "../libraries/helpers/Types.sol";

/**
 * @title IPoolCreationPolicy
 * @notice Pluggable validation hook for permissionless pool creation in PoolRegistry
 * @dev When set on PoolRegistry, delegates creation authorization to this contract
 *      instead of the default `onlyOwner` check. Implementations can enforce arbitrary
 *      rules: creation bonds, rating requirements, whitelist checks, anti-spam caps, etc.
 *
 * Example policies:
 *   - OwnerOnlyPolicy: replicates current onlyOwner behavior
 *   - BondedCreationPolicy: requires a refundable bond deposit
 *   - RatingGatedPolicy: only allows creators with minimum market rating
 */
interface IPoolCreationPolicy {
    /**
     * @notice Validate whether a caller is allowed to create a new pool
     * @param caller The address attempting to create a pool
     * @param protocolToken The protocol token the pool will cover (zero when the pool does not target a specific token)
     * @param riskRating The proposed risk rating for the new pool
     * @return approved True if creation should be allowed
     */
    function validatePoolCreation(
        address caller,
        address protocolToken,
        Types.RiskRating riskRating
    ) external returns (bool approved);
}