mirror of
https://github.com/Instadapp/dsa-connectors-old.git
synced 2024-07-29 22:47:46 +00:00
Done with uniswap v2 swapping functions
This commit is contained in:
parent
8ed8852a28
commit
2786b1630e
|
@ -230,7 +230,6 @@ contract UniswapResolver is UniswapHelpers {
|
||||||
uint getId,
|
uint getId,
|
||||||
uint setId
|
uint setId
|
||||||
) external payable {
|
) external payable {
|
||||||
// swapTokensForExactTokens
|
|
||||||
uint _buyAmt = getUint(getId, buyAmt);
|
uint _buyAmt = getUint(getId, buyAmt);
|
||||||
(TokenInterface _buyAddr, TokenInterface _sellAddr) = changeEthAddress(buyAddr, sellAddr);
|
(TokenInterface _buyAddr, TokenInterface _sellAddr) = changeEthAddress(buyAddr, sellAddr);
|
||||||
address[] memory paths = getPaths(address(_buyAddr), address(_sellAddr));
|
address[] memory paths = getPaths(address(_buyAddr), address(_sellAddr));
|
||||||
|
@ -247,8 +246,6 @@ contract UniswapResolver is UniswapHelpers {
|
||||||
convertEthToWeth(_sellAddr, _expectedAmt);
|
convertEthToWeth(_sellAddr, _expectedAmt);
|
||||||
_sellAddr.approve(address(router), _expectedAmt);
|
_sellAddr.approve(address(router), _expectedAmt);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uint[] memory _amts = router.swapTokensForExactTokens(
|
uint[] memory _amts = router.swapTokensForExactTokens(
|
||||||
_buyAmt,
|
_buyAmt,
|
||||||
_expectedAmt,
|
_expectedAmt,
|
||||||
|
@ -287,7 +284,6 @@ contract UniswapResolver is UniswapHelpers {
|
||||||
uint getId,
|
uint getId,
|
||||||
uint setId
|
uint setId
|
||||||
) external payable {
|
) external payable {
|
||||||
// /swapExactTokensForTokens/
|
|
||||||
uint _sellAmt = getUint(getId, sellAmt);
|
uint _sellAmt = getUint(getId, sellAmt);
|
||||||
(TokenInterface _buyAddr, TokenInterface _sellAddr) = changeEthAddress(buyAddr, sellAddr);
|
(TokenInterface _buyAddr, TokenInterface _sellAddr) = changeEthAddress(buyAddr, sellAddr);
|
||||||
address[] memory paths = getPaths(address(_buyAddr), address(_sellAddr));
|
address[] memory paths = getPaths(address(_buyAddr), address(_sellAddr));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user