fixed bugs

This commit is contained in:
Samyak Jain 2021-11-19 20:10:44 +05:30
parent 07a3090294
commit 6cb9c6d226
2 changed files with 12 additions and 6 deletions

View File

@ -1,11 +1,17 @@
pragma solidity ^0.7.6; pragma solidity ^0.7.6;
pragma abicoder v2; pragma abicoder v2;
import "./interface.sol"; import {
UniswapV3Pool,
ISwapRouter
} from "./interface.sol";
import {SqrtPriceMath} from "./libraries/SqrtPriceMath.sol"; import {SqrtPriceMath} from "./libraries/SqrtPriceMath.sol";
import "./libraries/TransferHelper.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
contract Helpers {
using SafeERC20 for IERC20;
contract Helpers is ISwapRouter {
ISwapRouter constant public router = ISwapRouter constant public router =
ISwapRouter(0xE592427A0AEce92De3Edee1F18E0157C05861564); ISwapRouter(0xE592427A0AEce92De3Edee1F18E0157C05861564);
@ -53,9 +59,9 @@ contract Helpers is ISwapRouter {
address recipient, address recipient,
uint256 amountIn uint256 amountIn
) public { ) public {
TransferHelper.safeTransferFrom(tokenIn, sender, recipient, amountIn); IERC20(tokenIn).safeTransferFrom(sender, recipient, amountIn);
TransferHelper.safeApprove(tokenIn, address(router), amountIn); IERC20(tokenIn).safeApprove(address(router), amountIn);
} }
function swapSingleInput(ISwapRouter.ExactInputSingleParams memory params) function swapSingleInput(ISwapRouter.ExactInputSingleParams memory params)

View File

@ -3,7 +3,7 @@ pragma abicoder v2;
import "./helpers.sol"; import "./helpers.sol";
abstract contract uniswapSellBeta is Helpers { contract uniswapSellBeta is Helpers {
function sell( function sell(
address tokenIn, address tokenIn,
address tokenOut, address tokenOut,