1
+ /*
2
+ Copyright 2020 Set Labs Inc.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache License, Version 2.0
17
+ */
18
+ pragma solidity 0.6.10 ;
19
+
20
+ import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol " ;
21
+
22
+ import { ISetToken } from "./ISetToken.sol " ;
23
+
24
+
25
+ /**
26
+ * CHANGELOG:
27
+ * - Added a module level issue hook that can be used to set state ahead of component level
28
+ * issue hooks
29
+ * - Added view function that return expected positional adjustments during issue/redeem to
30
+ * the issuance module in order to give more accurate token flow information
31
+ */
32
+ interface IModuleIssuanceHookV2 {
33
+
34
+ function moduleIssueHook (ISetToken _setToken , uint256 _setTokenQuantity ) external ;
35
+ function moduleRedeemHook (ISetToken _setToken , uint256 _setTokenQuantity ) external ;
36
+
37
+ function componentIssueHook (
38
+ ISetToken _setToken ,
39
+ uint256 _setTokenQuantity ,
40
+ IERC20 _component ,
41
+ bool _isEquity
42
+ ) external ;
43
+
44
+ function componentRedeemHook (
45
+ ISetToken _setToken ,
46
+ uint256 _setTokenQuantity ,
47
+ IERC20 _component ,
48
+ bool _isEquity
49
+ ) external ;
50
+
51
+ /**
52
+ * Adjustments should return the NET CHANGE in POSITION UNITS for each component in the SetToken's
53
+ * components array. Each entry in the returned arrays should index to the same component in the
54
+ * SetToken's components array (called using getComponents()). Directional adjustments should be made
55
+ * according to the following table (i.e. returning a negative debt number means debt is reduced during
56
+ * issue/redeem):
57
+ * | ------------------------------------|
58
+ * | Type | Positive | Negative |
59
+ * | ----- |---------- | --------------|
60
+ * | Equity | Add Equity| Equity Reduced|
61
+ * | Debt | Add Debt | Debt Reduced |
62
+ * | ------------------------------------|
63
+ */
64
+ function getIssuanceAdjustments (
65
+ ISetToken _setToken ,
66
+ uint256 _setTokenQuantity
67
+ )
68
+ external
69
+ view
70
+ returns (int256 [] memory , int256 [] memory );
71
+
72
+ /**
73
+ * Adjustments should return the NET CHANGE in POSITION UNITS for each component in the SetToken's
74
+ * components array. Each entry in the returned arrays should index to the same component in the
75
+ * SetToken's components array (called using getComponents()). Directional adjustments should be made
76
+ * according to the following table (i.e. returning a negative debt number means debt is reduced during
77
+ * issue/redeem):
78
+ * | ------------------------------------|
79
+ * | Type | Positive | Negative |
80
+ * | ----- |---------- | --------------|
81
+ * | Equity | Add Equity| Equity Reduced|
82
+ * | Debt | Add Debt | Debt Reduced |
83
+ * | ------------------------------------|
84
+ */
85
+ function getRedemptionAdjustments (
86
+ ISetToken _setToken ,
87
+ uint256 _setTokenQuantity
88
+ )
89
+ external
90
+ view
91
+ returns (int256 [] memory , int256 [] memory );
92
+ }
0 commit comments