commit
This commit is contained in:
28
contracts/ytLending/LendingFactory.sol
Normal file
28
contracts/ytLending/LendingFactory.sol
Normal file
@@ -0,0 +1,28 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "@openzeppelin/contracts/access/Ownable.sol";
|
||||
import "./Lending.sol";
|
||||
import "./LendingConfiguration.sol";
|
||||
|
||||
/**
|
||||
* @title LendingFactory
|
||||
* @notice 工厂合约 - 用于部署新的 Lending 实现
|
||||
*/
|
||||
contract LendingFactory is LendingConfiguration, Ownable {
|
||||
|
||||
constructor() Ownable(msg.sender) {}
|
||||
|
||||
event LendingDeployed(address indexed lending);
|
||||
|
||||
/**
|
||||
* @notice 部署新的 Lending 实现合约
|
||||
* @return 新 Lending 合约地址
|
||||
*/
|
||||
function deploy() external onlyOwner returns (address) {
|
||||
Lending lending = new Lending();
|
||||
emit LendingDeployed(address(lending));
|
||||
return address(lending);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user