generated from ZumZoom/solidity-template
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
7 changed files
with
429 additions
and
48 deletions.
There are no files selected for viewing
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.23; | ||
|
||
interface IAggregationRouter { | ||
function ethUnoswap(uint256 minReturn, uint256 dex) external payable returns(uint256 returnAmount); | ||
function ethUnoswap2(uint256 minReturn, uint256 dex, uint256 dex2) external payable returns(uint256 returnAmount); | ||
function unoswap( | ||
uint256 token, | ||
uint256 amount, | ||
uint256 minReturn, | ||
uint256 dex | ||
) external returns(uint256 returnAmount); | ||
function unoswap2( | ||
uint256 token, | ||
uint256 amount, | ||
uint256 minReturn, | ||
uint256 dex, | ||
uint256 dex2 | ||
) external returns(uint256 returnAmount); | ||
function unoswap3( | ||
uint256 token, | ||
uint256 amount, | ||
uint256 minReturn, | ||
uint256 dex, | ||
uint256 dex2, | ||
uint256 dex3 | ||
) external returns(uint256 returnAmount); | ||
} |
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,51 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
pragma solidity 0.8.23; | ||
|
||
interface IMatchaRouter { | ||
function sellToUniswap(address[] calldata tokens, uint256 sellAmount, uint256 minBuyAmount, bool isSushi) external payable; | ||
|
||
/// @dev Sell attached ETH directly against uniswap v3. | ||
/// @param encodedPath Uniswap-encoded path, where the first token is WETH. | ||
/// @param minBuyAmount Minimum amount of the last token in the path to buy. | ||
/// @param recipient The recipient of the bought tokens. Can be zero for sender. | ||
/// @return buyAmount Amount of the last token in the path bought. | ||
function sellEthForTokenToUniswapV3( | ||
bytes memory encodedPath, | ||
uint256 minBuyAmount, | ||
address recipient | ||
) | ||
external | ||
payable | ||
returns (uint256 buyAmount); | ||
|
||
/// @dev Sell a token for ETH directly against uniswap v3. | ||
/// @param encodedPath Uniswap-encoded path, where the last token is WETH. | ||
/// @param sellAmount amount of the first token in the path to sell. | ||
/// @param minBuyAmount Minimum amount of ETH to buy. | ||
/// @param recipient The recipient of the bought tokens. Can be zero for sender. | ||
/// @return buyAmount Amount of ETH bought. | ||
function sellTokenForEthToUniswapV3( | ||
bytes memory encodedPath, | ||
uint256 sellAmount, | ||
uint256 minBuyAmount, | ||
address payable recipient | ||
) | ||
external | ||
returns (uint256 buyAmount); | ||
|
||
/// @dev Sell a token for another token directly against uniswap v3. | ||
/// @param encodedPath Uniswap-encoded path. | ||
/// @param sellAmount amount of the first token in the path to sell. | ||
/// @param minBuyAmount Minimum amount of the last token in the path to buy. | ||
/// @param recipient The recipient of the bought tokens. Can be zero for sender. | ||
/// @return buyAmount Amount of the last token in the path bought. | ||
function sellTokenForTokenToUniswapV3( | ||
bytes memory encodedPath, | ||
uint256 sellAmount, | ||
uint256 minBuyAmount, | ||
address recipient | ||
) | ||
external | ||
returns (uint256 buyAmount); | ||
} |
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,130 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.23; | ||
|
||
interface IUniswapV2Router { | ||
function addLiquidity( | ||
address tokenA, | ||
address tokenB, | ||
uint256 amountADesired, | ||
uint256 amountBDesired, | ||
uint256 amountAMin, | ||
uint256 amountBMin, | ||
address to, | ||
uint256 deadline | ||
) external returns (uint256 amountA, uint256 amountB, uint256 liquidity); | ||
function addLiquidityETH( | ||
address token, | ||
uint256 amountTokenDesired, | ||
uint256 amountTokenMin, | ||
uint256 amountETHMin, | ||
address to, | ||
uint256 deadline | ||
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); | ||
function removeLiquidity( | ||
address tokenA, | ||
address tokenB, | ||
uint256 liquidity, | ||
uint256 amountAMin, | ||
uint256 amountBMin, | ||
address to, | ||
uint256 deadline | ||
) external returns (uint256 amountA, uint256 amountB); | ||
function removeLiquidityETH( | ||
address token, | ||
uint256 liquidity, | ||
uint256 amountTokenMin, | ||
uint256 amountETHMin, | ||
address to, | ||
uint256 deadline | ||
) external returns (uint256 amountToken, uint256 amountETH); | ||
function removeLiquidityWithPermit( | ||
address tokenA, | ||
address tokenB, | ||
uint256 liquidity, | ||
uint256 amountAMin, | ||
uint256 amountBMin, | ||
address to, | ||
uint256 deadline, | ||
bool approveMax, uint8 v, bytes32 r, bytes32 s | ||
) external returns (uint256 amountA, uint256 amountB); | ||
function removeLiquidityETHWithPermit( | ||
address token, | ||
uint256 liquidity, | ||
uint256 amountTokenMin, | ||
uint256 amountETHMin, | ||
address to, | ||
uint256 deadline, | ||
bool approveMax, uint8 v, bytes32 r, bytes32 s | ||
) external returns (uint256 amountToken, uint256 amountETH); | ||
function removeLiquidityETHSupportingFeeOnTransferTokens( | ||
address token, | ||
uint256 liquidity, | ||
uint256 amountTokenMin, | ||
uint256 amountETHMin, | ||
address to, | ||
uint256 deadline | ||
) external returns (uint256 amountETH); | ||
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( | ||
address token, | ||
uint256 liquidity, | ||
uint256 amountTokenMin, | ||
uint256 amountETHMin, | ||
address to, | ||
uint256 deadline, | ||
bool approveMax, uint8 v, bytes32 r, bytes32 s | ||
) external returns (uint256 amountETH); | ||
function swapExactTokensForTokensSupportingFeeOnTransferTokens( | ||
uint256 amountIn, | ||
uint256 amountOutMin, | ||
address[] calldata path, | ||
address to, | ||
uint256 deadline | ||
) external; | ||
function swapExactETHForTokensSupportingFeeOnTransferTokens( | ||
uint256 amountOutMin, | ||
address[] calldata path, | ||
address to, | ||
uint256 deadline | ||
) external payable; | ||
function swapExactTokensForETHSupportingFeeOnTransferTokens( | ||
uint256 amountIn, | ||
uint256 amountOutMin, | ||
address[] calldata path, | ||
address to, | ||
uint256 deadline | ||
) external; | ||
function swapExactTokensForTokens( | ||
uint256 amountIn, | ||
uint256 amountOutMin, | ||
address[] calldata path, | ||
address to, | ||
uint256 deadline | ||
) external returns (uint256[] memory amounts); | ||
function swapTokensForExactTokens( | ||
uint256 amountOut, | ||
uint256 amountInMax, | ||
address[] calldata path, | ||
address to, | ||
uint256 deadline | ||
) external returns (uint256[] memory amounts); | ||
function swapExactETHForTokens(uint256 amountOutMin, address[] calldata path, address to, uint256 deadline) | ||
external | ||
payable | ||
returns (uint256[] memory amounts); | ||
function swapTokensForExactETH(uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline) | ||
external | ||
returns (uint256[] memory amounts); | ||
function swapExactTokensForETH(uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline) | ||
external | ||
returns (uint256[] memory amounts); | ||
function swapETHForExactTokens(uint256 amountOut, address[] calldata path, address to, uint256 deadline) | ||
external | ||
payable | ||
returns (uint256[] memory amounts); | ||
|
||
function quote(uint256 amountA, uint256 reserveA, uint256 reserveB) external pure returns (uint256 amountB); | ||
function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) external pure returns (uint256 amountOut); | ||
function getAmountIn(uint256 amountOut, uint256 reserveIn, uint256 reserveOut) external pure returns (uint256 amountIn); | ||
function getAmountsOut(uint256 amountIn, address[] calldata path) external view returns (uint256[] memory amounts); | ||
function getAmountsIn(uint256 amountOut, address[] calldata path) external view returns (uint256[] memory amounts); | ||
} |
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.