@@ -48,6 +48,12 @@ library ConfiguratorLogic {
48
48
address indexed implementation
49
49
);
50
50
51
+ /**
52
+ * @notice Initialize a reserve by creating and initializing aToken, stable debt token and variable debt token
53
+ * @dev Emits the `ReserveInitialized` event
54
+ * @param pool The Pool in which the reserve will be initialized
55
+ * @param input The needed parameters for the initialization
56
+ */
51
57
function executeInitReserve (IPool pool , ConfiguratorInputTypes.InitReserveInput calldata input )
52
58
public
53
59
{
@@ -120,6 +126,12 @@ library ConfiguratorLogic {
120
126
);
121
127
}
122
128
129
+ /**
130
+ * @notice Updates the aToken implementation and initializes it
131
+ * @dev Emits the `ATokenUpgraded` event
132
+ * @param cachedPool The Pool containing the reserve with the aToken
133
+ * @param input The parameters needed for the initialize call
134
+ */
123
135
function executeUpdateAToken (
124
136
IPool cachedPool ,
125
137
ConfiguratorInputTypes.UpdateATokenInput calldata input
@@ -144,6 +156,12 @@ library ConfiguratorLogic {
144
156
emit ATokenUpgraded (input.asset, reserveData.aTokenAddress, input.implementation);
145
157
}
146
158
159
+ /**
160
+ * @notice Updates the stable debt token implementation and initializes it
161
+ * @dev Emits the `StableDebtTokenUpgraded` event
162
+ * @param cachedPool The Pool containing the reserve with the stable debt token
163
+ * @param input The parameters needed for the initialize call
164
+ */
147
165
function executeUpdateStableDebtToken (
148
166
IPool cachedPool ,
149
167
ConfiguratorInputTypes.UpdateDebtTokenInput calldata input
@@ -175,6 +193,12 @@ library ConfiguratorLogic {
175
193
);
176
194
}
177
195
196
+ /**
197
+ * @notice Updates the variable debt token implementation and initializes it
198
+ * @dev Emits the `VariableDebtTokenUpgraded` event
199
+ * @param cachedPool The Pool containing the reserve with the variable debt token
200
+ * @param input The parameters needed for the initialize call
201
+ */
178
202
function executeUpdateVariableDebtToken (
179
203
IPool cachedPool ,
180
204
ConfiguratorInputTypes.UpdateDebtTokenInput calldata input
@@ -206,6 +230,12 @@ library ConfiguratorLogic {
206
230
);
207
231
}
208
232
233
+ /**
234
+ * @notice Creates a new proxy and initializes the implementation
235
+ * @param implementation The address of the implementation
236
+ * @param initParams The parameters that is passed to the implementation to initialize
237
+ * @return The address of initialized proxy
238
+ */
209
239
function _initTokenWithProxy (address implementation , bytes memory initParams )
210
240
internal
211
241
returns (address )
@@ -219,6 +249,13 @@ library ConfiguratorLogic {
219
249
return address (proxy);
220
250
}
221
251
252
+ /**
253
+ * @notice Upgrades the implementation and makes call to the proxy
254
+ * @dev In the current plementation the call is used to initialize the new implementation.
255
+ * @param proxyAddress The address of the proxy
256
+ * @param implementation The address of the new implementation
257
+ * @param initParams The parameters to the call after the upgrade
258
+ */
222
259
function _upgradeTokenImplementation (
223
260
address proxyAddress ,
224
261
address implementation ,
0 commit comments