-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAutomatedLineOfCreditFactory.sol
36 lines (34 loc) · 1.2 KB
/
AutomatedLineOfCreditFactory.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import {IERC20WithDecimals} from "./interfaces/IERC20WithDecimals.sol";
import {IAutomatedLineOfCredit} from "./interfaces/IAutomatedLineOfCredit.sol";
import {BasePortfolioFactory} from "./BasePortfolioFactory.sol";
contract AutomatedLineOfCreditFactory is BasePortfolioFactory {
function createPortfolio(
uint256 _duration,
IERC20WithDecimals _underlyingToken,
uint256 _maxSize,
IAutomatedLineOfCredit.InterestRateParameters memory _interestRateParameters,
address _depositStrategy,
address _withdrawStrategy,
address _transferStrategy,
string calldata name,
string calldata symbol
) external onlyRole(MANAGER_ROLE) {
bytes memory initCalldata = abi.encodeWithSelector(
IAutomatedLineOfCredit.initialize.selector,
protocolConfig,
_duration,
_underlyingToken,
msg.sender,
_maxSize,
_interestRateParameters,
_depositStrategy,
_withdrawStrategy,
_transferStrategy,
name,
symbol
);
_deployPortfolio(initCalldata);
}
}