// SPDX-License-Identifier: UNLICENSED pragma solidity =0.8.18; import "../TemplateFactory/TemplateDeployer.sol"; import "./ILockdrop.sol"; import "./ILockdropFactory.sol"; import "./extensions/TokenRecovery.sol"; /** * @notice Implementation of the {ILockdropFactory} interface. */ contract LockdropFactory is ILockdropFactory, TemplateDeployer, TokenRecovery { /** * @inheritdoc ILockdropFactory */ bytes32 public constant override CREATE_ROLE = keccak256("Lockdrop.CREATE_ROLE"); constructor(uint256 templateVersion) TemplateDeployer(bytes32("Lockdrop"), templateVersion) {} /** * @inheritdoc ILockdropFactory */ function create(address asset, address withdrawTo, ILockdrop.DateConfig calldata dateConfig) external override onlyRole(CREATE_ROLE) { uint256 index = totalDeployments(); address instance = _deploy(bytes32(index)); ILockdrop(instance).initialize(index, asset, withdrawTo, dateConfig); emit LockdropCreated(index, asset, instance); } }