diff --git a/contracts/helpers/RebalancerFlashloanSwap.sol b/contracts/helpers/RebalancerFlashloanSwap.sol index a5056eaa..bb8368c9 100644 --- a/contracts/helpers/RebalancerFlashloanSwap.sol +++ b/contracts/helpers/RebalancerFlashloanSwap.sol @@ -4,13 +4,13 @@ pragma solidity ^0.8.19; import "./ARebalancerFlashloan.sol"; import { IERC20Metadata } from "oz/interfaces/IERC20Metadata.sol"; -import { ASwapper } from "utils/src/Swapper.sol"; +import { RouterSwapper } from "utils/src/RouterSwapper.sol"; /// @title RebalancerFlashloanSwap /// @author Angle Labs, Inc. /// @dev Rebalancer contract for a Transmuter with as collaterals a liquid stablecoin and an yield bearing asset /// using this liquid stablecoin as an asset -contract RebalancerFlashloanSwap is ARebalancerFlashloan, ASwapper { +contract RebalancerFlashloanSwap is ARebalancerFlashloan, RouterSwapper { using SafeCast for uint256; uint32 public maxSlippage; @@ -24,7 +24,7 @@ contract RebalancerFlashloanSwap is ARebalancerFlashloan, ASwapper { uint32 _maxSlippage ) ARebalancerFlashloan(_accessControlManager, _transmuter, _flashloan) - ASwapper(_swapRouter, _tokenTransferAddress) + RouterSwapper(_swapRouter, _tokenTransferAddress) { maxSlippage = _maxSlippage; } @@ -81,9 +81,9 @@ contract RebalancerFlashloanSwap is ARebalancerFlashloan, ASwapper { uint256 decimalsTokenOut = IERC20Metadata(tokenOut).decimals(); if (decimalsTokenIn > decimalsTokenOut) { - amountOut /= 10 ** (decimalsTokenIn - decimalsTokenOut); + amount /= 10 ** (decimalsTokenIn - decimalsTokenOut); } else if (decimalsTokenIn < decimalsTokenOut) { - amountOut *= 10 ** (decimalsTokenOut - decimalsTokenIn); + amount *= 10 ** (decimalsTokenOut - decimalsTokenIn); } if (amountOut < (amount * (BPS - maxSlippage)) / BPS) { revert SlippageTooHigh(); diff --git a/lib/utils b/lib/utils index 72df8cf3..addaee4e 160000 --- a/lib/utils +++ b/lib/utils @@ -1 +1 @@ -Subproject commit 72df8cf3c062f47fa54cdca792a142707414f5a0 +Subproject commit addaee4e6971172d44ca6739f3ef54d635734fc8