@@ -97,42 +97,42 @@ contract QuoterTest is Test {
9797 // $3000.00 = 1 ETH, wrong price = block swap
9898 fakeFeedETHUSD.setPrice (300000 , 2 );
9999 vm.expectRevert (bytes ("DFS: quote sanity check failed " ));
100- swapper.swapToCoin (eth, 1 ether, usdc, emptySwapData ());
100+ swapper.swapToCoin {value: 1 ether }(eth , usdc, emptySwapData ());
101101
102102 // $3450.00 = 1 ETH, ~correct price = OK, attempt swap
103103 fakeFeedETHUSD.setPrice (345000 , 2 );
104104 vm.expectRevert (bytes ("DFS: swap produced no output " ));
105- swapper.swapToCoin {value: 1 ether }(eth, 1 ether, usdc, emptySwapData ());
105+ swapper.swapToCoin {value: 1 ether }(eth, usdc, emptySwapData ());
106106
107107 // Feed returning stale or missing price = block swap
108108 fakeFeedETHUSD.setPrice (0 , 0 );
109109 vm.expectRevert (bytes ("DFS: CL price <= 0 " ));
110- swapper.swapToCoin {value: 1 ether }(eth, 1 ether, usdc, emptySwapData ());
110+ swapper.swapToCoin {value: 1 ether }(eth, usdc, emptySwapData ());
111111
112112 // No price feed = OK, attempt swap
113113 swapper.setKnownToken (weth, zeroToken);
114114 vm.expectRevert (bytes ("DFS: swap produced no output " ));
115- swapper.swapToCoin {value: 1 ether }(eth, 1 ether, usdc, emptySwapData ());
115+ swapper.swapToCoin {value: 1 ether }(eth, usdc, emptySwapData ());
116116 }
117117
118118 function testChainlinkSanityCheckERC20 () public {
119119 deal (address (degen), address (this ), 10e18 );
120- degen.approve (address (swapper), 10e18 );
120+ degen.transfer (address (swapper), 1e18 );
121121
122122 // $0.50 = 1 DEGEN, wrong price = block swap
123123 fakeFeedDEGENUSD.setPrice (500 , 3 );
124124 vm.expectRevert (bytes ("DFS: quote sanity check failed " ));
125- swapper.swapToCoin (degen, 1e18 , usdc, emptySwapData ());
125+ swapper.swapToCoin (degen, usdc, emptySwapData ());
126126
127127 // $0.0086 = 1 DEGEN, ~correct price = OK, attempt swap
128128 fakeFeedDEGENUSD.setPrice (8600 , 6 );
129129 vm.expectRevert (bytes ("DFS: swap produced no output " ));
130- swapper.swapToCoin (degen, 1 ether, usdc, emptySwapData ());
130+ swapper.swapToCoin (degen, usdc, emptySwapData ());
131131
132132 // No price = OK, attempt swap
133133 swapper.setKnownToken (degen, zeroToken);
134134 vm.expectRevert (bytes ("DFS: swap produced no output " ));
135- swapper.swapToCoin (degen, 1e18 , usdc, emptySwapData ());
135+ swapper.swapToCoin (degen, usdc, emptySwapData ());
136136 }
137137
138138 function testFlexSwapperQuote () public view {
@@ -154,14 +154,14 @@ contract QuoterTest is Test {
154154 function testRebasingToken () public {
155155 IERC20 usdm = IERC20 (0x28eD8909de1b3881400413Ea970ccE377a004ccA );
156156 deal (address (usdm), address (this ), 123e18 );
157- usdm.approve (address (swapper), 123e18 );
157+ usdm.transfer (address (swapper), 123e18 );
158158
159159 // Protocol lets you unwrap 123 USDM for 122 USDC = within 1% of 1:1
160160 bytes memory callData = fakeSwapData (usdm, usdc, 123e18 , 122e6 );
161161
162162 // Initially, swap fails because USDM is a rebasing token, no Uni price.
163163 vm.expectRevert (bytes ("DFS: no path found, amountOut 0 " ));
164- swapper.swapToCoin (usdm, 123e18 , usdc, callData);
164+ swapper.swapToCoin (usdm, usdc, callData);
165165
166166 // Give USDM a price feed + skip Uniswap. Swap should succeed.
167167 FakeAggregator fakeFeedUSDM = new FakeAggregator ();
@@ -174,7 +174,7 @@ contract QuoterTest is Test {
174174 skipUniswap: true
175175 })
176176 );
177- swapper.swapToCoin (usdm, 123e18 , usdc, callData);
177+ swapper.swapToCoin (usdm, usdc, callData);
178178
179179 assertEq (usdm.balanceOf (address (this )), 0 );
180180 assertEq (usdc.balanceOf (address (this )), 122e6 );
0 commit comments