@@ -20,15 +20,17 @@ contract FeesTest is EulerSwapTestBase {
20
20
// No fees
21
21
22
22
uint256 amountInNoFees = 1e18 ;
23
- uint256 amountOutNoFees = periphery.quoteExactInput (address (eulerSwap), address (assetTST), address (assetTST2), amountInNoFees);
23
+ uint256 amountOutNoFees =
24
+ periphery.quoteExactInput (address (eulerSwap), address (assetTST), address (assetTST2), amountInNoFees);
24
25
assertApproxEqAbs (amountOutNoFees, 0.9983e18 , 0.0001e18 );
25
26
26
27
// With fees: Increase input amount so that corresponding output amount matches
27
28
28
29
eulerSwap = createEulerSwap (60e18 , 60e18 , fee, 1e18 , 1e18 , 0.9e18 , 0.9e18 );
29
30
30
31
uint256 amountIn = amountInNoFees * 1e18 / (1e18 - fee);
31
- uint256 amountOut = periphery.quoteExactInput (address (eulerSwap), address (assetTST), address (assetTST2), amountIn);
32
+ uint256 amountOut =
33
+ periphery.quoteExactInput (address (eulerSwap), address (assetTST), address (assetTST2), amountIn);
32
34
assertApproxEqAbs (amountOut, amountOutNoFees, 1 ); // Same except for possible rounding down by 1
33
35
34
36
// Actually execute swap
@@ -68,14 +70,16 @@ contract FeesTest is EulerSwapTestBase {
68
70
// No fees
69
71
70
72
uint256 amountOut = 1e18 ;
71
- uint256 amountInNoFees = periphery.quoteExactOutput (address (eulerSwap), address (assetTST), address (assetTST2), amountOut);
73
+ uint256 amountInNoFees =
74
+ periphery.quoteExactOutput (address (eulerSwap), address (assetTST), address (assetTST2), amountOut);
72
75
assertApproxEqAbs (amountInNoFees, 1.0017e18 , 0.0001e18 );
73
76
74
77
// With fees: Increase input amount so output amount stays same
75
78
76
79
eulerSwap = createEulerSwap (60e18 , 60e18 , fee, 1e18 , 1e18 , 0.9e18 , 0.9e18 );
77
80
78
- uint256 amountIn = periphery.quoteExactOutput (address (eulerSwap), address (assetTST), address (assetTST2), amountOut);
81
+ uint256 amountIn =
82
+ periphery.quoteExactOutput (address (eulerSwap), address (assetTST), address (assetTST2), amountOut);
79
83
assertApproxEqAbs (amountIn, amountInNoFees * 1e18 / (1e18 - fee), 1 ); // Same except for possible rounding up by 1
80
84
81
85
// Actually execute swap
0 commit comments