Skip to content

Commit

Permalink
fix: tf remove
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Mar 28, 2024
1 parent bbc3a03 commit caa71a1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Bases/HealthCheck/BaseHealthCheck.sol
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,15 @@ abstract contract BaseHealthCheck is BaseStrategy {
if (_newTotalAssets > currentTotalAssets) {
require(
((_newTotalAssets - currentTotalAssets) <=
(currentTotalAssets * uint256(_profitLimitRatio)) / MAX_BPS),
(currentTotalAssets * uint256(_profitLimitRatio)) /
MAX_BPS),
"healthCheck"
);
} else if (currentTotalAssets > _newTotalAssets) {
require(
(currentTotalAssets - _newTotalAssets <=
((currentTotalAssets * uint256(_lossLimitRatio)) / MAX_BPS)),
((currentTotalAssets * uint256(_lossLimitRatio)) /
MAX_BPS)),
"healthCheck"
);
}
Expand Down
6 changes: 5 additions & 1 deletion src/swappers/TradeFactorySwapper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ abstract contract TradeFactorySwapper {
ERC20(_tokenFrom).safeApprove(_tradeFactory, 0);
ITradeFactory(_tradeFactory).disable(_tokenFrom, _tokenTo);

_rewardTokens = _rewardTokens;
// Set to storage
_rewardTokens = rewardTokens_;
_rewardTokens.pop();
}
}
Expand All @@ -70,6 +71,9 @@ abstract contract TradeFactorySwapper {
_removeTradeFactoryPermissions();
}

// If setting to address(0) we are done.
if (tradeFactory_ == address(0)) return;

address[] memory rewardTokens_ = _rewardTokens;
ITradeFactory tf = ITradeFactory(tradeFactory_);

Expand Down

0 comments on commit caa71a1

Please sign in to comment.