@@ -31,7 +31,7 @@ import { ISetToken} from "../interfaces/ISetToken.sol";
31
31
import { IWETH} from "../interfaces/IWETH.sol " ;
32
32
import { IWrapModuleV2} from "../interfaces/IWrapModuleV2.sol " ;
33
33
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol " ;
34
- import { DEXAdapter } from "./DEXAdapter .sol " ;
34
+ import { DEXAdapterV3 } from "./DEXAdapterV3 .sol " ;
35
35
36
36
/**
37
37
* @title FlashMintWrapped
@@ -53,7 +53,7 @@ import { DEXAdapter } from "./DEXAdapter.sol";
53
53
* Set components at index 1 = cDAI; then -> ComponentSwapData[1].underlyingERC20 = DAI; (wrapping will happen)
54
54
*/
55
55
contract FlashMintWrapped is Ownable , ReentrancyGuard {
56
- using DEXAdapter for DEXAdapter .Addresses;
56
+ using DEXAdapterV3 for DEXAdapterV3 .Addresses;
57
57
using Address for address payable ;
58
58
using Address for address ;
59
59
using SafeMath for uint256 ;
@@ -65,8 +65,8 @@ contract FlashMintWrapped is Ownable, ReentrancyGuard {
65
65
struct ComponentSwapData {
66
66
// unwrapped token version, e.g. DAI
67
67
address underlyingERC20;
68
- // swap data for DEX operation: fees, path, etc. see DEXAdapter .SwapData
69
- DEXAdapter .SwapData dexData;
68
+ // swap data for DEX operation: fees, path, etc. see DEXAdapterV3 .SwapData
69
+ DEXAdapterV3 .SwapData dexData;
70
70
// ONLY relevant for issue, not used for redeem:
71
71
// amount that has to be bought of the unwrapped token version (to cover required wrapped component amounts for issuance)
72
72
// this amount has to be computed beforehand through the exchange rate of wrapped Component <> unwrappedComponent
@@ -92,7 +92,7 @@ contract FlashMintWrapped is Ownable, ReentrancyGuard {
92
92
93
93
/* ============ State Variables ============ */
94
94
95
- DEXAdapter .Addresses public dexAdapter;
95
+ DEXAdapterV3 .Addresses public dexAdapter;
96
96
97
97
/* ============ Events ============ */
98
98
@@ -139,12 +139,12 @@ contract FlashMintWrapped is Ownable, ReentrancyGuard {
139
139
if (_inputToken != _outputToken) {
140
140
require (
141
141
_path[0 ] == _inputToken ||
142
- (_inputToken == dexAdapter.weth && _path[0 ] == DEXAdapter .ETH_ADDRESS),
142
+ (_inputToken == dexAdapter.weth && _path[0 ] == DEXAdapterV3 .ETH_ADDRESS),
143
143
"FlashMint: INPUT_TOKEN_NOT_IN_PATH "
144
144
);
145
145
require (
146
146
_path[_path.length - 1 ] == _outputToken ||
147
- (_outputToken == dexAdapter.weth && _path[_path.length - 1 ] == DEXAdapter .ETH_ADDRESS),
147
+ (_outputToken == dexAdapter.weth && _path[_path.length - 1 ] == DEXAdapterV3 .ETH_ADDRESS),
148
148
"FlashMint: OUTPUT_TOKEN_NOT_IN_PATH "
149
149
);
150
150
}
@@ -162,7 +162,7 @@ contract FlashMintWrapped is Ownable, ReentrancyGuard {
162
162
* @param _wrapModule WrapModuleV2 used to obtain a valid wrap adapter
163
163
*/
164
164
constructor (
165
- DEXAdapter .Addresses memory _dexAddresses ,
165
+ DEXAdapterV3 .Addresses memory _dexAddresses ,
166
166
IController _setController ,
167
167
IDebtIssuanceModule _issuanceModule ,
168
168
address _wrapModule
@@ -187,7 +187,7 @@ contract FlashMintWrapped is Ownable, ReentrancyGuard {
187
187
*/
188
188
function withdrawTokens (IERC20 [] calldata _tokens , address payable _to ) external onlyOwner payable {
189
189
for (uint256 i = 0 ; i < _tokens.length ; i++ ) {
190
- if (address (_tokens[i]) == DEXAdapter .ETH_ADDRESS){
190
+ if (address (_tokens[i]) == DEXAdapterV3 .ETH_ADDRESS){
191
191
_to.sendValue (address (this ).balance);
192
192
}
193
193
else {
@@ -206,7 +206,7 @@ contract FlashMintWrapped is Ownable, ReentrancyGuard {
206
206
function approveSetToken (ISetToken _setToken ) external isSetToken (_setToken) {
207
207
address [] memory _components = _setToken.getComponents ();
208
208
for (uint256 i = 0 ; i < _components.length ; ++ i) {
209
- DEXAdapter ._safeApprove (IERC20 (_components[i]), address (issuanceModule), MAX_UINT256);
209
+ DEXAdapterV3 ._safeApprove (IERC20 (_components[i]), address (issuanceModule), MAX_UINT256);
210
210
}
211
211
}
212
212
@@ -503,7 +503,7 @@ contract FlashMintWrapped is Ownable, ReentrancyGuard {
503
503
emit FlashMint (
504
504
msg .sender ,
505
505
_setToken,
506
- _issueFromETH ? IERC20 (DEXAdapter .ETH_ADDRESS) : _inputToken,
506
+ _issueFromETH ? IERC20 (DEXAdapterV3 .ETH_ADDRESS) : _inputToken,
507
507
spentInputTokenAmount,
508
508
_amountSetToken
509
509
);
@@ -567,7 +567,7 @@ contract FlashMintWrapped is Ownable, ReentrancyGuard {
567
567
emit FlashRedeem (
568
568
msg .sender ,
569
569
_setToken,
570
- _redeemToETH ? IERC20 (DEXAdapter .ETH_ADDRESS) : _outputToken,
570
+ _redeemToETH ? IERC20 (DEXAdapterV3 .ETH_ADDRESS) : _outputToken,
571
571
_amountSetToken,
572
572
totalOutputTokenObtained
573
573
);
@@ -796,7 +796,7 @@ contract FlashMintWrapped is Ownable, ReentrancyGuard {
796
796
* @param _outputToken Output token that will be bought
797
797
* @param _amount Amount that will be bought
798
798
* @param _maxAmountIn Maximum aount of input token that can be spent
799
- * @param _swapDexData DEXAdapter .SwapData with path, fees, etc. for inputToken -> outputToken swap
799
+ * @param _swapDexData DEXAdapterV3 .SwapData with path, fees, etc. for inputToken -> outputToken swap
800
800
*
801
801
* @return Amount of spent _inputToken
802
802
*/
@@ -805,7 +805,7 @@ contract FlashMintWrapped is Ownable, ReentrancyGuard {
805
805
IERC20 _outputToken ,
806
806
uint256 _amount ,
807
807
uint256 _maxAmountIn ,
808
- DEXAdapter .SwapData calldata _swapDexData
808
+ DEXAdapterV3 .SwapData calldata _swapDexData
809
809
)
810
810
internal
811
811
isValidPath (_swapDexData.path, address (_inputToken), address (_outputToken))
@@ -822,15 +822,15 @@ contract FlashMintWrapped is Ownable, ReentrancyGuard {
822
822
* @param _inputToken Input token that will be sold
823
823
* @param _outputToken Output token that will be bought
824
824
* @param _amount Amount that will be sold
825
- * @param _swapDexData DEXAdapter .SwapData with path, fees, etc. for inputToken -> outputToken swap
825
+ * @param _swapDexData DEXAdapterV3 .SwapData with path, fees, etc. for inputToken -> outputToken swap
826
826
*
827
827
* @return amount of received _outputToken
828
828
*/
829
829
function _swapFromExact (
830
830
IERC20 _inputToken ,
831
831
IERC20 _outputToken ,
832
832
uint256 _amount ,
833
- DEXAdapter .SwapData calldata _swapDexData
833
+ DEXAdapterV3 .SwapData calldata _swapDexData
834
834
)
835
835
internal
836
836
isValidPath (_swapDexData.path, address (_inputToken), address (_outputToken))
@@ -881,7 +881,7 @@ contract FlashMintWrapped is Ownable, ReentrancyGuard {
881
881
);
882
882
883
883
// 3. approve token transfer from this to _wrapCallTarget
884
- DEXAdapter ._safeApprove (
884
+ DEXAdapterV3 ._safeApprove (
885
885
IERC20 (_underlyingToken),
886
886
_wrapCallTarget,
887
887
_wrapAmount
0 commit comments