-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathTestWeightedInterestRateModel.sol
41 lines (34 loc) · 1.33 KB
/
TestWeightedInterestRateModel.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
37
38
39
40
41
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.25;
import "../../rates/WeightedInterestRateModel.sol";
/**
* @title Test Contract Wrapper for WeightedInterestRateModel
* @author MetaStreet Labs
*/
contract TestWeightedInterestRateModel is WeightedInterestRateModel {
/**************************************************************************/
/* Constructor */
/**************************************************************************/
constructor() WeightedInterestRateModel() {}
/**************************************************************************/
/* Wrapper for Primary API */
/**************************************************************************/
/**
* @dev External wrapper for _price()
*/
function price(
uint256 principal,
uint64 duration,
LiquidityLogic.NodeSource[] memory nodes,
uint16 count,
uint64[] memory rates,
uint32 adminFeeRate
) external pure returns (uint256, uint256, uint128[] memory) {
(uint256 repayment, uint256 adminFee) = _price(principal, duration, nodes, count, rates, adminFeeRate);
uint128[] memory pending = new uint128[](count);
for (uint256 i; i < count; i++) {
pending[i] = nodes[i].pending;
}
return (repayment, adminFee, pending);
}
}