Skip to content

Commit c315ca5

Browse files
committed
refactor: reorder functions in BuyGDClone
1 parent f2fbea5 commit c315ca5

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

contracts/utils/BuyGDClone.sol

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,16 @@ contract BuyGDCloneV2 is Initializable {
195195
emit BoughtFromUniswap(celo, amountIn, bought);
196196
}
197197

198+
/**
199+
* @notice Swaps cUSD for GD tokens, choosing the best route between Uniswap (default path) and Mento.
200+
*/
201+
function swapCusd(
202+
uint256 _minAmount,
203+
address refundGas
204+
) public returns (uint256 bought) {
205+
return swapCusdWithPath(_minAmount, refundGas, cusdPath);
206+
}
207+
198208
/**
199209
* @notice Swaps cUSD for GD tokens, choosing the best route between Uniswap (custom path) and Mento.
200210
* @param _path The custom Uniswap path to use when Uniswap is chosen.
@@ -207,6 +217,9 @@ contract BuyGDCloneV2 is Initializable {
207217
return _swapCusdChooseRoute(_minAmount, refundGas, _path);
208218
}
209219

220+
/**
221+
@dev internal function to swap cUSD for GD tokens, choosing the best route between Uniswap (custom path) and Mento.
222+
*/
210223
function _swapCusdChooseRoute(
211224
uint256 _minAmount,
212225
address refundGas,
@@ -258,16 +271,6 @@ contract BuyGDCloneV2 is Initializable {
258271
emit BoughtFromUniswap(CUSD, amountIn, bought);
259272
}
260273

261-
/**
262-
* @notice Swaps cUSD for GD tokens, choosing the best route between Uniswap (default path) and Mento.
263-
*/
264-
function swapCusd(
265-
uint256 _minAmount,
266-
address refundGas
267-
) public returns (uint256 bought) {
268-
return swapCusdWithPath(_minAmount, refundGas, cusdPath);
269-
}
270-
271274
/**
272275
* @notice Swaps Celo for GD tokens using a custom Uniswap path.
273276
*/

0 commit comments

Comments
 (0)