mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
updated params
This commit is contained in:
parent
6126d72bdd
commit
bcfca12267
|
@ -58,8 +58,8 @@ abstract contract Helpers is DSMath, Basic {
|
||||||
approve(_sellAddr, address(swapRouter), _slippageAmt);
|
approve(_sellAddr, address(swapRouter), _slippageAmt);
|
||||||
|
|
||||||
ExactOutputSingleParams memory params = ExactOutputSingleParams({
|
ExactOutputSingleParams memory params = ExactOutputSingleParams({
|
||||||
tokenIn: buyData.sellAddr,
|
tokenIn: address(_sellAddr),
|
||||||
tokenOut: buyData.buyAddr,
|
tokenOut: address(_buyAddr),
|
||||||
fee: buyData.fee,
|
fee: buyData.fee,
|
||||||
recipient: address(this),
|
recipient: address(this),
|
||||||
deadline: block.timestamp + 1,
|
deadline: block.timestamp + 1,
|
||||||
|
@ -120,8 +120,8 @@ abstract contract Helpers is DSMath, Basic {
|
||||||
convertEthToWeth(isEth, _sellAddr, _sellAmt);
|
convertEthToWeth(isEth, _sellAddr, _sellAmt);
|
||||||
approve(_sellAddr, address(swapRouter), _sellAmt);
|
approve(_sellAddr, address(swapRouter), _sellAmt);
|
||||||
ExactInputSingleParams memory params = ExactInputSingleParams({
|
ExactInputSingleParams memory params = ExactInputSingleParams({
|
||||||
tokenIn: sellData.sellAddr,
|
tokenIn: address(_sellAddr),
|
||||||
tokenOut: sellData.buyAddr,
|
tokenOut: address(_buyAddr),
|
||||||
fee: sellData.fee,
|
fee: sellData.fee,
|
||||||
recipient: address(this),
|
recipient: address(this),
|
||||||
deadline: block.timestamp + 1,
|
deadline: block.timestamp + 1,
|
||||||
|
|
|
@ -58,8 +58,8 @@ abstract contract Helpers is DSMath, Basic {
|
||||||
approve(_sellAddr, address(swapRouter), _slippageAmt);
|
approve(_sellAddr, address(swapRouter), _slippageAmt);
|
||||||
|
|
||||||
ExactOutputSingleParams memory params = ExactOutputSingleParams({
|
ExactOutputSingleParams memory params = ExactOutputSingleParams({
|
||||||
tokenIn: buyData.sellAddr,
|
tokenIn: address(_sellAddr),
|
||||||
tokenOut: buyData.buyAddr,
|
tokenOut: address(_buyAddr),
|
||||||
fee: buyData.fee,
|
fee: buyData.fee,
|
||||||
recipient: address(this),
|
recipient: address(this),
|
||||||
deadline: block.timestamp + 1,
|
deadline: block.timestamp + 1,
|
||||||
|
@ -67,7 +67,6 @@ abstract contract Helpers is DSMath, Basic {
|
||||||
amountInMaximum: _slippageAmt, //require(_sellAmt <= amountInMaximum)
|
amountInMaximum: _slippageAmt, //require(_sellAmt <= amountInMaximum)
|
||||||
sqrtPriceLimitX96: 0
|
sqrtPriceLimitX96: 0
|
||||||
});
|
});
|
||||||
|
|
||||||
uint256 _sellAmt = swapRouter.exactOutputSingle(params);
|
uint256 _sellAmt = swapRouter.exactOutputSingle(params);
|
||||||
require(_slippageAmt >= _sellAmt, "Too much slippage");
|
require(_slippageAmt >= _sellAmt, "Too much slippage");
|
||||||
|
|
||||||
|
@ -120,8 +119,8 @@ abstract contract Helpers is DSMath, Basic {
|
||||||
convertEthToWeth(isEth, _sellAddr, _sellAmt);
|
convertEthToWeth(isEth, _sellAddr, _sellAmt);
|
||||||
approve(_sellAddr, address(swapRouter), _sellAmt);
|
approve(_sellAddr, address(swapRouter), _sellAmt);
|
||||||
ExactInputSingleParams memory params = ExactInputSingleParams({
|
ExactInputSingleParams memory params = ExactInputSingleParams({
|
||||||
tokenIn: sellData.sellAddr,
|
tokenIn: address(_sellAddr),
|
||||||
tokenOut: sellData.buyAddr,
|
tokenOut: address(_buyAddr),
|
||||||
fee: sellData.fee,
|
fee: sellData.fee,
|
||||||
recipient: address(this),
|
recipient: address(this),
|
||||||
deadline: block.timestamp + 1,
|
deadline: block.timestamp + 1,
|
||||||
|
@ -129,7 +128,6 @@ abstract contract Helpers is DSMath, Basic {
|
||||||
amountOutMinimum: _slippageAmt, //require(_buyAmt >= amountOutMinimum)
|
amountOutMinimum: _slippageAmt, //require(_buyAmt >= amountOutMinimum)
|
||||||
sqrtPriceLimitX96: 0
|
sqrtPriceLimitX96: 0
|
||||||
});
|
});
|
||||||
|
|
||||||
uint256 _buyAmt = swapRouter.exactInputSingle(params);
|
uint256 _buyAmt = swapRouter.exactInputSingle(params);
|
||||||
require(_slippageAmt <= _buyAmt, "Too much slippage");
|
require(_slippageAmt <= _buyAmt, "Too much slippage");
|
||||||
|
|
||||||
|
|
|
@ -58,8 +58,8 @@ abstract contract Helpers is DSMath, Basic {
|
||||||
approve(_sellAddr, address(swapRouter), _slippageAmt);
|
approve(_sellAddr, address(swapRouter), _slippageAmt);
|
||||||
|
|
||||||
ExactOutputSingleParams memory params = ExactOutputSingleParams({
|
ExactOutputSingleParams memory params = ExactOutputSingleParams({
|
||||||
tokenIn: buyData.sellAddr,
|
tokenIn: address(_sellAddr),
|
||||||
tokenOut: buyData.buyAddr,
|
tokenOut: address(_buyAddr),
|
||||||
fee: buyData.fee,
|
fee: buyData.fee,
|
||||||
recipient: address(this),
|
recipient: address(this),
|
||||||
deadline: block.timestamp + 1,
|
deadline: block.timestamp + 1,
|
||||||
|
@ -120,8 +120,8 @@ abstract contract Helpers is DSMath, Basic {
|
||||||
convertEthToWeth(isEth, _sellAddr, _sellAmt);
|
convertEthToWeth(isEth, _sellAddr, _sellAmt);
|
||||||
approve(_sellAddr, address(swapRouter), _sellAmt);
|
approve(_sellAddr, address(swapRouter), _sellAmt);
|
||||||
ExactInputSingleParams memory params = ExactInputSingleParams({
|
ExactInputSingleParams memory params = ExactInputSingleParams({
|
||||||
tokenIn: sellData.sellAddr,
|
tokenIn: address(_sellAddr),
|
||||||
tokenOut: sellData.buyAddr,
|
tokenOut: address(_buyAddr),
|
||||||
fee: sellData.fee,
|
fee: sellData.fee,
|
||||||
recipient: address(this),
|
recipient: address(this),
|
||||||
deadline: block.timestamp + 1,
|
deadline: block.timestamp + 1,
|
||||||
|
|
|
@ -57,8 +57,8 @@ abstract contract Helpers is DSMath, Basic {
|
||||||
convertMaticToWmatic(isMatic, _sellAddr, _slippageAmt);
|
convertMaticToWmatic(isMatic, _sellAddr, _slippageAmt);
|
||||||
approve(_sellAddr, address(swapRouter), _slippageAmt);
|
approve(_sellAddr, address(swapRouter), _slippageAmt);
|
||||||
ExactOutputSingleParams memory params = ExactOutputSingleParams({
|
ExactOutputSingleParams memory params = ExactOutputSingleParams({
|
||||||
tokenIn: buyData.sellAddr,
|
tokenIn: address(_sellAddr),
|
||||||
tokenOut: buyData.buyAddr,
|
tokenOut: address(_buyAddr),
|
||||||
fee: buyData.fee,
|
fee: buyData.fee,
|
||||||
recipient: address(this),
|
recipient: address(this),
|
||||||
deadline: block.timestamp + 1,
|
deadline: block.timestamp + 1,
|
||||||
|
@ -119,8 +119,8 @@ abstract contract Helpers is DSMath, Basic {
|
||||||
convertMaticToWmatic(isMatic, _sellAddr, _sellAmt);
|
convertMaticToWmatic(isMatic, _sellAddr, _sellAmt);
|
||||||
approve(_sellAddr, address(swapRouter), _sellAmt);
|
approve(_sellAddr, address(swapRouter), _sellAmt);
|
||||||
ExactInputSingleParams memory params = ExactInputSingleParams({
|
ExactInputSingleParams memory params = ExactInputSingleParams({
|
||||||
tokenIn: sellData.sellAddr,
|
tokenIn: address(_sellAddr),
|
||||||
tokenOut: sellData.buyAddr,
|
tokenOut: address(_buyAddr),
|
||||||
fee: sellData.fee,
|
fee: sellData.fee,
|
||||||
recipient: address(this),
|
recipient: address(this),
|
||||||
deadline: block.timestamp + 1,
|
deadline: block.timestamp + 1,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user