@@ -114,6 +114,7 @@ contract EulerSwapFactory is IEulerSwapFactory, EVCUtil {
114
114
return allPools.length ;
115
115
}
116
116
117
+ /// @inheritdoc IEulerSwapFactory
117
118
function getEulerAccountState (address eulerAccount ) external view returns (address , uint48 , uint48 ) {
118
119
return (
119
120
eulerAccountState[eulerAccount].pool,
@@ -184,19 +185,36 @@ contract EulerSwapFactory is IEulerSwapFactory, EVCUtil {
184
185
}
185
186
}
186
187
188
+ /// @notice Updates an element at a specific index in an array
189
+ /// @dev Directly modifies the array element at the given index with a new value
190
+ /// @param arr The storage array to update
191
+ /// @param index The index of the element to update
192
+ /// @param _newValue The new value to set at the specified index
187
193
function _updateInArray (address [] storage arr , uint256 index , address _newValue ) internal {
188
194
arr[index] = _newValue;
189
195
}
190
196
197
+ /// @notice Adds a new element to the end of an array
198
+ /// @dev Uses the push operation to append a new value to the array
199
+ /// @param arr The storage array to append to
200
+ /// @param _newValue The new value to append to the array
191
201
function _pushInArray (address [] storage arr , address _newValue ) internal {
192
202
arr.push (_newValue);
193
203
}
194
204
205
+ /// @notice Removes an element from an array at a specific index
206
+ /// @dev Uses the swap-and-pop pattern to remove an element while maintaining array order
207
+ /// @param arr The storage array to remove from
208
+ /// @param index The index of the element to remove
195
209
function _removeFromArray (address [] storage arr , uint256 index ) internal {
196
210
arr[index] = arr[arr.length - 1 ];
197
211
arr.pop ();
198
212
}
199
213
214
+ /// @notice Retrieves the asset addresses for a given pool
215
+ /// @dev Calls the pool contract to get its asset0 and asset1 addresses
216
+ /// @param pool The address of the pool to query
217
+ /// @return The addresses of asset0 and asset1 in the pool
200
218
function _getAssets (address pool ) internal view returns (address , address ) {
201
219
return (EulerSwap (pool).asset0 (), EulerSwap (pool).asset1 ());
202
220
}
0 commit comments