LayerCover

IIntentAllocations

Interface reference for IIntentAllocations.

Interface

// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.20;

/**
 * @title IIntentAllocations
 * @notice Dedicated storage/coordination for intent reservations and active policy coverage.
 * @dev PoolAllocations remains the public orchestration entrypoint and is the only mutator.
 */
interface IIntentAllocations {
    function initialize(address systemRegistry) external;

    function increaseIntentAllocation(
        address underwriter,
        uint256 poolId,
        uint256 amount,
        uint64 coverageEndTime
    ) external;

    function decreaseIntentAllocation(
        address underwriter,
        uint256 poolId,
        uint256 amount
    ) external;

    function transitionIntentToPolicy(
        address underwriter,
        uint256 poolId,
        uint256 amount
    ) external;

    function recordPolicyCoverageSettled(
        address underwriter,
        uint256 poolId,
        uint256 amount
    ) external returns (uint256 trackedBefore);

    function clearIntentAllocations(address underwriter, uint256 poolId) external returns (uint256 reserved);
    function clearCoverageState(address underwriter, uint256 poolId) external;
    function resetCoverageExpiryIfUnlocked(address underwriter, uint256 poolId) external;

    function getCoverageState(
        address underwriter,
        uint256 poolId
    ) external view returns (uint256 intentAllocation, uint256 activeCoverage, uint64 lastCoverageExpiry);

    function getReservedCoverage(address underwriter, uint256 poolId) external view returns (uint256);
    function getIntentAllocation(address underwriter, uint256 poolId) external view returns (uint256);
    function getPoolIntentAllocation(uint256 poolId) external view returns (uint256);
    function getActivePolicyCoverage(address underwriter, uint256 poolId) external view returns (uint256);
    function getLastCoverageExpiry(address underwriter, uint256 poolId) external view returns (uint64);
}