// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; /** * @title SOMA SomaEarn Factory Contract. * @author SOMA.finance. * @notice A factory that produces SomaEarn contracts. */ interface ISomaEarnFactory { /** * @notice Emitted when a SomaEarn is created. * @param id The ID of the SomaEarn. * @param asset The delegation asset of the SomaEarn. * @param instance The address of the created SomaEarn. */ event SomaEarnCreated(uint256 id, address asset, address instance); /** * @notice The SomaEarn's CREATE_ROLE. * @dev Returns keccak256('SomaEarn.CREATE_ROLE'). */ function CREATE_ROLE() external pure returns (bytes32); /** * @notice Creates a SomaEarn instance. * @param asset The address of the delegation asset. * @param withdrawTo The address that delegated assets will be withdrawn to. * @param startDate The start date configuration of the SomaEarn. * @param endDate The end date configuration of the SomaEarn. * @custom:emits SomaEarnCreated * @custom:requirement `asset` must not be equal to address zero. * @custom:requirement `withdrawTo` must not be equal to address zero. * @custom:requirement The function caller must have the CREATE_ROLE. */ function create(address asset, address withdrawTo, uint48 startDate, uint48 endDate) external; }