-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
128cadd
commit b699f2a
Showing
9 changed files
with
252 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity 0.8.17; | ||
|
||
interface ISmartVaultManagerV2 { | ||
function weth() external view returns (address); | ||
function swapRouter() external view returns (address); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity 0.8.17; | ||
|
||
interface ISwapRouter { | ||
struct ExactInputSingleParams { | ||
address tokenIn; | ||
address tokenOut; | ||
uint24 fee; | ||
address recipient; | ||
uint256 deadline; | ||
uint256 amountIn; | ||
uint256 amountOutMinimum; | ||
uint160 sqrtPriceLimitX96; | ||
} | ||
|
||
function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,40 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity 0.8.17; | ||
|
||
contract MockSwapRouter { | ||
import "contracts/interfaces/ISwapRouter.sol"; | ||
|
||
contract MockSwapRouter is ISwapRouter { | ||
address private tokenIn; | ||
address private tokenOut; | ||
uint24 private fee; | ||
address private recipient; | ||
uint256 private deadline; | ||
uint256 private amountIn; | ||
uint256 private amountOutMinimum; | ||
uint160 private sqrtPriceLimitX96; | ||
uint256 private txValue; | ||
|
||
struct MockSwapData { | ||
address tokenIn; address tokenOut; uint24 fee; address recipient; uint256 deadline; | ||
uint256 amountIn; uint256 amountOutMinimum; uint160 sqrtPriceLimitX96; uint256 txValue; | ||
} | ||
|
||
function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut) { | ||
tokenIn = params.tokenIn; | ||
tokenOut = params.tokenOut; | ||
fee = params.fee; | ||
recipient = params.recipient; | ||
deadline = params.deadline; | ||
amountIn = params.amountIn; | ||
amountOutMinimum = params.amountOutMinimum; | ||
sqrtPriceLimitX96 = params.sqrtPriceLimitX96; | ||
txValue = msg.value; | ||
} | ||
|
||
function receivedSwap() external view returns (MockSwapData memory) { | ||
return MockSwapData( | ||
tokenIn, tokenOut, fee, recipient, deadline, amountIn, amountOutMinimum, | ||
sqrtPriceLimitX96, txValue | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.