Skip to content

Commit

Permalink
fix: comment
Browse files Browse the repository at this point in the history
  • Loading branch information
toparc077 committed Oct 4, 2023
1 parent eb118f8 commit 4aec0d8
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 472 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ pragma solidity 0.8.17;

import {IERC20, SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {BaseHandler} from "../BaseHandler.sol";
import {IUniswapRouterV3} from "../interfaces/common/IUniswapRouterV3.sol";
import {IUniswapRouterETH} from "../interfaces/common/IUniswapRouterETH.sol";
import {BaseHandler} from "../../../handlers/BaseHandler.sol";
import {IUniswapRouterV3} from "./IUniswapRouterV3.sol";
import {IUniswapRouterETH} from "./IUniswapRouterETH.sol";

contract UniV3Handler is BaseHandler, ReentrancyGuard {
using SafeERC20 for IERC20;
Expand All @@ -18,32 +18,17 @@ contract UniV3Handler is BaseHandler, ReentrancyGuard {
address public constant WETH9 = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
uint24 public constant FEE_TIER = 3000; // 0.3% fee tier pool

mapping(address => uint256) public depositInfo;
mapping(address => bool) public isDepositUser;

address public immutable devAddress;
uint256 public immutable devFee; // 1% = 100

uint256 public totalDepositedUser;
uint256 public totalDepositedAmount;
uint256 public totalProfitAmount;
uint256 public devFeeAmount;

constructor(
IUniswapRouterV3 swapRouter_,
IUniswapRouterETH sushiRouter_,
uint256 devFee_,
address devAddress_
IUniswapRouterETH sushiRouter_
) {
swapRouter = swapRouter_;
sushiRouter = sushiRouter_;
devFee = devFee_;
devAddress = devAddress_;
}

function deposit(
uint256 amount
) external nonReentrant returns (uint256[] memory) {
) external nonReentrant returns (uint256[] memory){
_tokenApprove(USDC, address(swapRouter), amount);
IUniswapRouterV3.ExactInputSingleParams memory params = IUniswapRouterV3
.ExactInputSingleParams({
Expand All @@ -65,18 +50,15 @@ contract UniV3Handler is BaseHandler, ReentrancyGuard {
swapPath[1] = USDC;
uint256[] memory amountsOut = sushiRouter.swapExactTokensForTokens(
amountOut,
depositInfo[msg.sender],
amount,
swapPath,
address(this),
block.timestamp + 100
);
return amountsOut;
}

/* solhint-disable no-empty-blocks */
function execStrategy(bytes memory data) public payable {}

function getContractName() public pure override returns (string memory) {
return "UniswapV3 Handler";
return "UniswapV3 Example Handler";
}
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4aec0d8

Please sign in to comment.