This repository was archived by the owner on Jan 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
contribution from 0xlock #2
Open
0xlock
wants to merge
5
commits into
capofficial:main
Choose a base branch
from
0xlock:0xlock
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||
| pragma solidity >=0.5.0; | ||
|
|
||
| interface IUniswapV2Factory { | ||
| event PairCreated(address indexed token0, address indexed token1, address pair, uint); | ||
|
|
||
| function feeTo() external view returns (address); | ||
| function feeToSetter() external view returns (address); | ||
|
|
||
| function getPair(address tokenA, address tokenB) external view returns (address pair); | ||
| function allPairs(uint) external view returns (address pair); | ||
| function allPairsLength() external view returns (uint); | ||
|
|
||
| function createPair(address tokenA, address tokenB) external returns (address pair); | ||
|
|
||
| function setFeeTo(address) external; | ||
| function setFeeToSetter(address) external; | ||
| } |
This file contains hidden or 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,95 @@ | ||
| pragma solidity >=0.6.2; | ||
|
|
||
| interface IUniswapV2Router01 { | ||
| function factory() external pure returns (address); | ||
| function WETH() external pure returns (address); | ||
|
|
||
| function addLiquidity( | ||
| address tokenA, | ||
| address tokenB, | ||
| uint amountADesired, | ||
| uint amountBDesired, | ||
| uint amountAMin, | ||
| uint amountBMin, | ||
| address to, | ||
| uint deadline | ||
| ) external returns (uint amountA, uint amountB, uint liquidity); | ||
| function addLiquidityETH( | ||
| address token, | ||
| uint amountTokenDesired, | ||
| uint amountTokenMin, | ||
| uint amountETHMin, | ||
| address to, | ||
| uint deadline | ||
| ) external payable returns (uint amountToken, uint amountETH, uint liquidity); | ||
| function removeLiquidity( | ||
| address tokenA, | ||
| address tokenB, | ||
| uint liquidity, | ||
| uint amountAMin, | ||
| uint amountBMin, | ||
| address to, | ||
| uint deadline | ||
| ) external returns (uint amountA, uint amountB); | ||
| function removeLiquidityETH( | ||
| address token, | ||
| uint liquidity, | ||
| uint amountTokenMin, | ||
| uint amountETHMin, | ||
| address to, | ||
| uint deadline | ||
| ) external returns (uint amountToken, uint amountETH); | ||
| function removeLiquidityWithPermit( | ||
| address tokenA, | ||
| address tokenB, | ||
| uint liquidity, | ||
| uint amountAMin, | ||
| uint amountBMin, | ||
| address to, | ||
| uint deadline, | ||
| bool approveMax, uint8 v, bytes32 r, bytes32 s | ||
| ) external returns (uint amountA, uint amountB); | ||
| function removeLiquidityETHWithPermit( | ||
| address token, | ||
| uint liquidity, | ||
| uint amountTokenMin, | ||
| uint amountETHMin, | ||
| address to, | ||
| uint deadline, | ||
| bool approveMax, uint8 v, bytes32 r, bytes32 s | ||
| ) external returns (uint amountToken, uint amountETH); | ||
| function swapExactTokensForTokens( | ||
| uint amountIn, | ||
| uint amountOutMin, | ||
| address[] calldata path, | ||
| address to, | ||
| uint deadline | ||
| ) external returns (uint[] memory amounts); | ||
| function swapTokensForExactTokens( | ||
| uint amountOut, | ||
| uint amountInMax, | ||
| address[] calldata path, | ||
| address to, | ||
| uint deadline | ||
| ) external returns (uint[] memory amounts); | ||
| function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) | ||
| external | ||
| payable | ||
| returns (uint[] memory amounts); | ||
| function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) | ||
| external | ||
| returns (uint[] memory amounts); | ||
| function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) | ||
| external | ||
| returns (uint[] memory amounts); | ||
| function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) | ||
| external | ||
| payable | ||
| returns (uint[] memory amounts); | ||
|
|
||
| function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); | ||
| function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); | ||
| function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); | ||
| function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); | ||
| function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); | ||
| } |
This file contains hidden or 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,44 @@ | ||
| pragma solidity >=0.6.2; | ||
|
|
||
| import './IUniswapV2Router01.sol'; | ||
|
|
||
| interface IUniswapV2Router02 is IUniswapV2Router01 { | ||
| function removeLiquidityETHSupportingFeeOnTransferTokens( | ||
| address token, | ||
| uint liquidity, | ||
| uint amountTokenMin, | ||
| uint amountETHMin, | ||
| address to, | ||
| uint deadline | ||
| ) external returns (uint amountETH); | ||
| function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( | ||
| address token, | ||
| uint liquidity, | ||
| uint amountTokenMin, | ||
| uint amountETHMin, | ||
| address to, | ||
| uint deadline, | ||
| bool approveMax, uint8 v, bytes32 r, bytes32 s | ||
| ) external returns (uint amountETH); | ||
|
|
||
| function swapExactTokensForTokensSupportingFeeOnTransferTokens( | ||
| uint amountIn, | ||
| uint amountOutMin, | ||
| address[] calldata path, | ||
| address to, | ||
| uint deadline | ||
| ) external; | ||
| function swapExactETHForTokensSupportingFeeOnTransferTokens( | ||
| uint amountOutMin, | ||
| address[] calldata path, | ||
| address to, | ||
| uint deadline | ||
| ) external payable; | ||
| function swapExactTokensForETHSupportingFeeOnTransferTokens( | ||
| uint amountIn, | ||
| uint amountOutMin, | ||
| address[] calldata path, | ||
| address to, | ||
| uint deadline | ||
| ) external; | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, but here size must also be adjusted so leverage stays consistent. @0xlock