@@ -81,7 +81,6 @@ contract StargateV2Strategy is BaseERC20Strategy, Ownable, ReentrancyGuard {
81
81
error TransferFailed ();
82
82
error DepositPaused ();
83
83
error WithdrawPaused ();
84
- error NotEnough ();
85
84
error PauserNotAuthorized ();
86
85
error EmptyAddress ();
87
86
error SwapFailed ();
@@ -154,7 +153,7 @@ contract StargateV2Strategy is BaseERC20Strategy, Ownable, ReentrancyGuard {
154
153
depositPaused = true ;
155
154
withdrawPaused = true ;
156
155
157
- uint256 amount = farm.balanceOf (address (lpToken), address (this )); // TODO: check if lpToken <> token ratio is 1:1
156
+ uint256 amount = farm.balanceOf (address (lpToken), address (this ));
158
157
159
158
// withdraw from farm
160
159
farm.withdraw (address (lpToken), amount);
@@ -250,7 +249,7 @@ contract StargateV2Strategy is BaseERC20Strategy, Ownable, ReentrancyGuard {
250
249
/**
251
250
* @notice invests currently available STG for compounding interest
252
251
*/
253
- function invest (bytes calldata arbData , bytes calldata stgData ) external {
252
+ function invest (bytes calldata arbData , bytes calldata stgData ) external onlyOwner {
254
253
IERC20 _stg = IERC20 (STG);
255
254
IERC20 _arb = IERC20 (ARB);
256
255
@@ -331,7 +330,7 @@ contract StargateV2Strategy is BaseERC20Strategy, Ownable, ReentrancyGuard {
331
330
// *********************************** //
332
331
function _currentBalance () internal view override returns (uint256 amount ) {
333
332
/// @dev: wrap fees are not taken into account here because it's 0
334
- amount = farm.balanceOf (address (lpToken), address (this )); // TODO: check if lpToken <> token ratio is 1:1
333
+ amount = farm.balanceOf (address (lpToken), address (this ));
335
334
amount += IERC20 (contractAddress).balanceOf (address (this ));
336
335
amount += pendingRewards ();
337
336
}
@@ -385,6 +384,7 @@ contract StargateV2Strategy is BaseERC20Strategy, Ownable, ReentrancyGuard {
385
384
386
385
// send `contractAddress`
387
386
IERC20 (contractAddress).safeTransfer (to, amount);
387
+ emit AmountWithdrawn (to, amount);
388
388
}
389
389
390
390
// ********************************* //
@@ -409,6 +409,8 @@ contract StargateV2Strategy is BaseERC20Strategy, Ownable, ReentrancyGuard {
409
409
lpToken.safeApprove (address (farm), type (uint256 ).max);
410
410
farm.deposit (address (lpToken), lpAmount);
411
411
lpToken.safeApprove (address (farm), 0 );
412
+
413
+ event AmountDeposited (uint256 lpAmount );
412
414
}
413
415
414
416
}
0 commit comments