Contract 0xe458018ad4283c90fb7f5460e24c4016f81b8175

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x9fb1f35bab7e0e5262240eb497a9d1228c482dc7cfbffe3427018758443948bbAdd Liquidity ET...560944482023-01-28 9:36:344 mins ago0x7b8651b39c29ab2ef4b0ff74a4d545123bdc5a49 IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750.00062916167625 ETH0.00012021
0x62a6142abdd46e0d817ee635b5e33b436353552ae8c3738b07b53ef5ea6426a7Add Liquidity ET...560941402023-01-28 9:34:585 mins ago0x7b8651b39c29ab2ef4b0ff74a4d545123bdc5a49 IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750.00062910751956 ETH0.00006301
0x6ae835dfc8638cc06c9adb87366257a6f93af9707d5cc8c11e9cdc5c599b5ab2Add Liquidity ET...560924022023-01-28 9:25:5014 mins ago0x35aecdb972e6b9a1c7e5032bfa734825db932a21 IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750.00063065210063 ETH0.00012173
0x39a31ac69421c40e433130a36d2122a3a17d6dcfffbd6f8b6ae4544ca15df441Add Liquidity ET...560920472023-01-28 9:23:5516 mins ago0x35aecdb972e6b9a1c7e5032bfa734825db932a21 IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750.000629174876912 ETH0.00006453
0xddab24c465084f9be9e174288743f9058fefc4779726eb32ac7c1232997a3e05Add Liquidity ET...560903812023-01-28 9:15:2625 mins ago0x933b039be56153b42e16c289f4b771a6ae5e3ded IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750.000628558518641 ETH0.00012079
0xdc241c50005003852ccd9e3b9333bebf71634fd9c53674014b15f0a9e5b76391Add Liquidity ET...560903542023-01-28 9:15:1625 mins ago0x9ef171a8c62eea6455830bde5de99db5a7ca5119 IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750.088043946629665 ETH0.00011669
0xff229970f12102801c412edf1993818ae8fb1eaafd9020746eaff5ee572ed37cAdd Liquidity ET...560866052023-01-28 8:56:0744 mins ago0x19dde5f247155293fb8c905d4a400021c12fb6f0 IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750.80444089004088 ETH0.00012157
0xec7226ebd894fe0c404c467f3e0a7e57dfdb78b3dccf3b80853ff2f379423204Add Liquidity ET...560827992023-01-28 8:36:561 hr 3 mins ago0x6771dea372ea6194bf77be6a6d3ce973fe940dc0 IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750.015540432351013 ETH0.00011843
0x2653b15203d098aacbb411b25e73fbe7fae29471325d2d2ee9658a962bf3b3c0Add Liquidity An...560825832023-01-28 8:35:461 hr 5 mins ago0x4e51f68940fac327b2f018b6b79109031031fe8b IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750 ETH0.00012807
0x6b1943b74996c15ea1749056c19632a0e5583e96ff1ebd692981ec588d6b2241Add Liquidity ET...560798812023-01-28 8:22:451 hr 18 mins ago0x11d67fa925877813b744abc0917900c2b1d6eb81 IN  0xe458018ad4283c90fb7f5460e24c4016f81b817516 ETH0.00012476
0x66d2fa361297fc570a1ec1ed02d310045c804f9097ab3868546deb7899190ce8Add Liquidity ET...560717932023-01-28 7:43:081 hr 57 mins ago0x6cc3c18ddd9cc0e2f1c9fbc2c6638d62fc7f8106 IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750.000536538214677 ETH0.00012221
0x2be2213b8322efde3fbc493010d9c31bdfdca9c05432e5a089fa22af391f61a3Add Liquidity ET...560700952023-01-28 7:33:442 hrs 7 mins ago0x9dd6a12bf9af29abbc06bd4b9ff37db2855b0e8d IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750.033872442082412 ETH0.0001161
0x8fc73be73775c415d86bcf4876b8a90a1f05d808531b675530341b8d961f030fAdd Liquidity ET...560677552023-01-28 7:21:562 hrs 18 mins ago0x06aae67461e8c3cc3ea1b883473598eb4ee1a6cd IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750.199605161312841 ETH0.00011786
0xc24dd4787b1be1f6e7f544f4fcaa22ee47e0858ac1f8c52f4a985188904771a4Add Liquidity ET...560558312023-01-28 6:23:053 hrs 17 mins ago0x7567175bccec1b516a6a9e1e2c984398754244e2 IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750.000641715096545 ETH0.00011435
0x016dfb00b1e3562fb83fbcb8e12b3d2736b3166213988fe5ff7300aaefb3bfccAdd Liquidity An...560491822023-01-28 5:47:493 hrs 52 mins ago0xc5ff5941ddc08f9e803c45bc36c18d3d3ed217d8 IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750 ETH0.00012349
0xe5fbf731bfecae722f96018e23c5eeeec87667e5c7f27281866e1c6b4a74e133Add Liquidity An...560473282023-01-28 5:37:054 hrs 3 mins ago0x29addbcc5f1ff2d54ff1eb6cf014e6d1e309b54f IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750 ETH0.00012777
0x9c5a302807968552917658a3b7f5ba6c86ce3e397335de8d649b5637977e3a5dAdd Liquidity ET...560424812023-01-28 5:07:564 hrs 32 mins ago0xf2bf8eded4d11dfadaf9f78b986767f7c59eb3d0 IN  0xe458018ad4283c90fb7f5460e24c4016f81b81753.096375914024538 ETH0.00011932
0x9bfc3168825cb970bb46c83787f058166582807b9de6fdb7a97c5f519e904146Add Liquidity An...560378322023-01-28 4:41:164 hrs 59 mins ago0x0f30803378827359c7726c40dedc5a034b6f2022 IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750 ETH0.00012779
0x3c88b65ef49760102e9cbe2837469f36dabbb016b3477f7b0e38d2f34ea3b544Add Liquidity ET...560354492023-01-28 4:26:085 hrs 14 mins ago0x885dafa95e05813e077c394dfc52ca8698607aa8 IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750.008973291172218 ETH0.00012476
0x89ca34abeace91632d22b0632ebadfae0bcf119c7cc5639fc1249eff0d647a53Add Liquidity ET...560327352023-01-28 4:09:255 hrs 31 mins ago0x885dafa95e05813e077c394dfc52ca8698607aa8 IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750.098776466250756 ETH0.00012583
0x4db6794e2ee5ab9a0f7ab8c4a2c4f7d0d9ef0ebe25fe31dfe587a7a165d49cd8Add Liquidity ET...560318902023-01-28 4:04:055 hrs 36 mins ago0x9b6e536706ddcc6f1cd1d51e198f5bed84085f21 IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750.352026729655136 ETH0.0001332
0xa88ad70f034fa23803ec31db2ea0d11f5db9076a8bd91bc68ff7deab6faa3f09Add Liquidity ET...560316512023-01-28 4:02:295 hrs 38 mins ago0x9ef171a8c62eea6455830bde5de99db5a7ca5119 IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750.035648529715631 ETH0.0001229
0x637d9ecdc0aa7768d69331e094c29d322b5df22dc1d1b1180013ee309bf5c664Add Liquidity An...560314082023-01-28 4:00:535 hrs 39 mins ago0x8c8cbd4eda1f0026de9b4d6a204eb6066ee82353 IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750 ETH0.0001308
0xe484b9db9d7630791a93ce8f581b7ed75351f2058cbf379e25f21627bcd47546Add Liquidity ET...560284052023-01-28 3:44:125 hrs 56 mins ago0x12f646475491f4ef0f296a23e3293266003b3721 IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750.12 ETH0.00014463
0x90c9426eb4840d600e29c121cd3cb8e7db013527d2d1fb57f02189ed22e27272Add Liquidity An...560277482023-01-28 3:40:495 hrs 59 mins ago0xaf0fdd39e5d92499b0ed9f68693da99c0ec1e92e IN  0xe458018ad4283c90fb7f5460e24c4016f81b81750 ETH0.00012419
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x9fb1f35bab7e0e5262240eb497a9d1228c482dc7cfbffe3427018758443948bb560944482023-01-28 9:36:344 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b81750x6bc938aba940fb828d39daa23a94dfc522120c110 ETH
0x9fb1f35bab7e0e5262240eb497a9d1228c482dc7cfbffe3427018758443948bb560944482023-01-28 9:36:344 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b81750x6bc938aba940fb828d39daa23a94dfc522120c110 ETH
0x9fb1f35bab7e0e5262240eb497a9d1228c482dc7cfbffe3427018758443948bb560944482023-01-28 9:36:344 mins ago 0x6bc938aba940fb828d39daa23a94dfc522120c11 0xe458018ad4283c90fb7f5460e24c4016f81b81750 ETH
0x9fb1f35bab7e0e5262240eb497a9d1228c482dc7cfbffe3427018758443948bb560944482023-01-28 9:36:344 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b81750x6bc938aba940fb828d39daa23a94dfc522120c110 ETH
0x9fb1f35bab7e0e5262240eb497a9d1228c482dc7cfbffe3427018758443948bb560944482023-01-28 9:36:344 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b81750x84652bb2539513baf36e225c930fdd8eaa63ce270 ETH
0x9fb1f35bab7e0e5262240eb497a9d1228c482dc7cfbffe3427018758443948bb560944482023-01-28 9:36:344 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b81750x84652bb2539513baf36e225c930fdd8eaa63ce270 ETH
0x9fb1f35bab7e0e5262240eb497a9d1228c482dc7cfbffe3427018758443948bb560944482023-01-28 9:36:344 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b81750x6bc938aba940fb828d39daa23a94dfc522120c110 ETH
0x9fb1f35bab7e0e5262240eb497a9d1228c482dc7cfbffe3427018758443948bb560944482023-01-28 9:36:344 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b81750x7b8651b39c29ab2ef4b0ff74a4d545123bdc5a490.000000013044690425 ETH
0x9fb1f35bab7e0e5262240eb497a9d1228c482dc7cfbffe3427018758443948bb560944482023-01-28 9:36:344 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b81750x84652bb2539513baf36e225c930fdd8eaa63ce270 ETH
0x9fb1f35bab7e0e5262240eb497a9d1228c482dc7cfbffe3427018758443948bb560944482023-01-28 9:36:344 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b8175 0x82af49447d8a07e3bd95bd0d56f35241523fbab10 ETH
0x9fb1f35bab7e0e5262240eb497a9d1228c482dc7cfbffe3427018758443948bb560944482023-01-28 9:36:344 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b8175 0x82af49447d8a07e3bd95bd0d56f35241523fbab10.000629148631560144 ETH
0x9fb1f35bab7e0e5262240eb497a9d1228c482dc7cfbffe3427018758443948bb560944482023-01-28 9:36:344 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b8175 0xff970a61a04b1ca14834a43f5de4533ebddb5cc80 ETH
0x9fb1f35bab7e0e5262240eb497a9d1228c482dc7cfbffe3427018758443948bb560944482023-01-28 9:36:344 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b81750x84652bb2539513baf36e225c930fdd8eaa63ce270 ETH
0x9fb1f35bab7e0e5262240eb497a9d1228c482dc7cfbffe3427018758443948bb560944482023-01-28 9:36:344 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b8175 0x6eccab422d763ac031210895c81787e87b43a6520 ETH
0x9fb1f35bab7e0e5262240eb497a9d1228c482dc7cfbffe3427018758443948bb560944482023-01-28 9:36:344 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b8175 0xc873fecbd354f5a56e00e710b90ef4201db2448d0 ETH
0x9fb1f35bab7e0e5262240eb497a9d1228c482dc7cfbffe3427018758443948bb560944482023-01-28 9:36:344 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b81750x6bc938aba940fb828d39daa23a94dfc522120c110 ETH
0x9fb1f35bab7e0e5262240eb497a9d1228c482dc7cfbffe3427018758443948bb560944482023-01-28 9:36:344 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b8175 0xc873fecbd354f5a56e00e710b90ef4201db2448d0 ETH
0x62a6142abdd46e0d817ee635b5e33b436353552ae8c3738b07b53ef5ea6426a7560941402023-01-28 9:34:585 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b81750x84652bb2539513baf36e225c930fdd8eaa63ce270 ETH
0x62a6142abdd46e0d817ee635b5e33b436353552ae8c3738b07b53ef5ea6426a7560941402023-01-28 9:34:585 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b8175 0x6eccab422d763ac031210895c81787e87b43a6520 ETH
0x62a6142abdd46e0d817ee635b5e33b436353552ae8c3738b07b53ef5ea6426a7560941402023-01-28 9:34:585 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b8175 0xc873fecbd354f5a56e00e710b90ef4201db2448d0 ETH
0x62a6142abdd46e0d817ee635b5e33b436353552ae8c3738b07b53ef5ea6426a7560941402023-01-28 9:34:585 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b81750x6bc938aba940fb828d39daa23a94dfc522120c110 ETH
0x62a6142abdd46e0d817ee635b5e33b436353552ae8c3738b07b53ef5ea6426a7560941402023-01-28 9:34:585 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b8175 0xc873fecbd354f5a56e00e710b90ef4201db2448d0 ETH
0x6ae835dfc8638cc06c9adb87366257a6f93af9707d5cc8c11e9cdc5c599b5ab2560924022023-01-28 9:25:5014 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b81750x6bc938aba940fb828d39daa23a94dfc522120c110 ETH
0x6ae835dfc8638cc06c9adb87366257a6f93af9707d5cc8c11e9cdc5c599b5ab2560924022023-01-28 9:25:5014 mins ago 0xe458018ad4283c90fb7f5460e24c4016f81b81750x6bc938aba940fb828d39daa23a94dfc522120c110 ETH
0x6ae835dfc8638cc06c9adb87366257a6f93af9707d5cc8c11e9cdc5c599b5ab2560924022023-01-28 9:25:5014 mins ago 0x6bc938aba940fb828d39daa23a94dfc522120c11 0xe458018ad4283c90fb7f5460e24c4016f81b81750 ETH
[ Download CSV Export 
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
PositionHelper

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 50000 runs

Other Settings:
default evmVersion
File 1 of 11 : PositionHelper.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";

import "./interfaces/ICamelotRouter.sol";
import "./interfaces/INFTPool.sol";

contract PositionHelper is ReentrancyGuard {
  using Address for address;
  using SafeERC20 for IERC20;
  using SafeMath for uint256;

  bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;
  ICamelotRouter public immutable router;
  address public immutable weth;

  uint256 expectedTokenId;
  address expectedNftPool;

  constructor(ICamelotRouter router_, address weth_){
    router = router_;
    weth = weth_;
  }

  receive() external payable {
    assert(msg.sender == weth); // only accept ETH via fallback from the WETH contract
  }

  function onERC721Received(address /*operator*/, address from, uint256 tokenId, bytes calldata /*data*/) external view returns (bytes4){
    require(tokenId == expectedTokenId && msg.sender == expectedNftPool && from == address(0), "Invalid tokenId");
    return _ERC721_RECEIVED;
  }

  function addLiquidityAndCreatePosition(
    address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired,
    uint256 amountAMin, uint256 amountBMin, uint256 deadline, address to, INFTPool nftPool, uint256 lockDuration
  ) external nonReentrant {
    address lp = router.getPair(tokenA, tokenB);

    {
      (address nftUnderlyingAsset,,,,,,,) = nftPool.getPoolInfo();
      require(lp == nftUnderlyingAsset, "invalid nftPool");
    }

    bytes memory data = address(router).functionDelegateCall(
      abi.encodeWithSelector(
        router.addLiquidity.selector,
        tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin, address(this), deadline
      )
    );
    (,, uint256 lpAmount) = abi.decode(data, (uint256, uint256, uint256));

    expectedTokenId = nftPool.lastTokenId().add(1);
    expectedNftPool = address(nftPool);

    IERC20(lp).safeApprove(expectedNftPool, lpAmount);
    nftPool.createPosition(lpAmount, lockDuration);

    (uint256 lpAmount_,,,uint256 lockDuration_,,,,) = nftPool.getStakingPosition(expectedTokenId);
    require(lpAmount == lpAmount_ && lockDuration == lockDuration_, "invalid position created");
    nftPool.safeTransferFrom(address(this), to, expectedTokenId);

    expectedTokenId = 0;
    expectedNftPool = address(0);
  }


  function addLiquidityETHAndCreatePosition(
    address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, uint256 deadline,
    address to, INFTPool nftPool, uint256 lockDuration
  ) external payable nonReentrant {
    address lp = router.getPair(token, weth);

    (address nftUnderlyingAsset,,,,,,,) = nftPool.getPoolInfo();
    require(lp == nftUnderlyingAsset, "invalid nftPool");

    bytes memory data = address(router).functionDelegateCall(
      abi.encodeWithSelector(
        router.addLiquidityETH.selector,
        token, amountTokenDesired, amountTokenMin, amountETHMin, address(this), deadline
      )
    );
    (,, uint256 lpAmount) = abi.decode(data, (uint256, uint256, uint256));

    expectedTokenId = nftPool.lastTokenId().add(1);
    expectedNftPool = address(nftPool);

    IERC20(lp).safeApprove(expectedNftPool, lpAmount);
    nftPool.createPosition(lpAmount, lockDuration);

    (uint256 lpAmount_,,,uint256 lockDuration_,,,,) = nftPool.getStakingPosition(expectedTokenId);
    require(lpAmount == lpAmount_ && lockDuration == lockDuration_, "invalid position created");
    nftPool.safeTransferFrom(address(this), to, expectedTokenId);

    expectedTokenId = 0;
    expectedNftPool = address(0);
  }
}

File 2 of 11 : IUniswapV2Router01.sol
// SPDX-License-Identifier: MIT
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 quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);

}

File 3 of 11 : INFTPool.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

interface INFTPool is IERC721 {
  function exists(uint256 tokenId) external view returns (bool);
  function hasDeposits() external view returns (bool);
  function lastTokenId() external view returns (uint256);
  function getPoolInfo() external view returns (
    address lpToken, address grailToken, address sbtToken, uint256 lastRewardTime, uint256 accRewardsPerShare,
    uint256 lpSupply, uint256 lpSupplyWithMultiplier, uint256 allocPoint
  );
  function getStakingPosition(uint256 tokenId) external view returns (
    uint256 amount, uint256 amountWithMultiplier, uint256 startLockTime,
    uint256 lockDuration, uint256 lockMultiplier, uint256 rewardDebt,
    uint256 boostPoints, uint256 totalMultiplier
  );
  function createPosition(uint256 amount, uint256 lockDuration) external;
  function boost(uint256 userAddress, uint256 amount) external;
  function unboost(uint256 userAddress, uint256 amount) external;
}

File 4 of 11 : ICamelotRouter.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2;

import './IUniswapV2Router01.sol';

interface ICamelotRouter 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,
    address referrer,
    uint deadline
  ) external;

  function swapExactETHForTokensSupportingFeeOnTransferTokens(
    uint amountOutMin,
    address[] calldata path,
    address to,
    address referrer,
    uint deadline
  ) external payable;

  function swapExactTokensForETHSupportingFeeOnTransferTokens(
    uint amountIn,
    uint amountOutMin,
    address[] calldata path,
    address to,
    address referrer,
    uint deadline
  ) external;

  function getPair(address token1, address token2) external view returns (address);
}

File 5 of 11 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor () {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 6 of 11 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 7 of 11 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

import "../../introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
      * @dev Safely transfers `tokenId` token from `from` to `to`.
      *
      * Requirements:
      *
      * - `from` cannot be the zero address.
      * - `to` cannot be the zero address.
      * - `tokenId` token must exist and be owned by `from`.
      * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
      * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
      *
      * Emits a {Transfer} event.
      */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}

File 8 of 11 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;
    using Address for address;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 9 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 10 of 11 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 11 of 11 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 50000
  },
  "evmVersion": "istanbul",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract ABI

[{"inputs":[{"internalType":"contract ICamelotRouter","name":"router_","type":"address"},{"internalType":"address","name":"weth_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountADesired","type":"uint256"},{"internalType":"uint256","name":"amountBDesired","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"contract INFTPool","name":"nftPool","type":"address"},{"internalType":"uint256","name":"lockDuration","type":"uint256"}],"name":"addLiquidityAndCreatePosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountTokenDesired","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"contract INFTPool","name":"nftPool","type":"address"},{"internalType":"uint256","name":"lockDuration","type":"uint256"}],"name":"addLiquidityETHAndCreatePosition","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"contract ICamelotRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60c060405234801561001057600080fd5b506040516119ef3803806119ef8339818101604052604081101561003357600080fd5b50805160209091015160016000556001600160601b0319606092831b8116608052911b1660a05260805160601c60a05160601c61194f6100a060003980607b528061039e528061047b52508061043e52806106f75280610b1b5280610dc6528061113d525061194f6000f3fe60806040526004361061005e5760003560e01c8063745e46f311610043578063745e46f3146101c6578063ee9eb0a514610228578063f887ea40146102a7576100a4565b8063150b7a02146100a95780633fc8cef314610188576100a4565b366100a4573373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146100a257fe5b005b600080fd5b3480156100b557600080fd5b50610153600480360360808110156100cc57600080fd5b73ffffffffffffffffffffffffffffffffffffffff82358116926020810135909116916040820135919081019060808101606082013564010000000081111561011457600080fd5b82018360208201111561012657600080fd5b8035906020019184600183028401116401000000008311171561014857600080fd5b5090925090506102bc565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b34801561019457600080fd5b5061019d61039c565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100a260048036036101008110156101dd57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359160408201359160608101359160808201359160a081013582169160c0820135169060e001356103c0565b34801561023457600080fd5b506100a2600480360361014081101561024c57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013582169160408201359160608101359160808201359160a08101359160c08201359160e081013582169161010082013516906101200135610a9d565b3480156102b357600080fd5b5061019d61113b565b6000600154841480156102e6575060025473ffffffffffffffffffffffffffffffffffffffff1633145b8015610306575073ffffffffffffffffffffffffffffffffffffffff8516155b61037157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f496e76616c696420746f6b656e49640000000000000000000000000000000000604482015290519081900360640190fd5b507f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6002600054141561043257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260008190555060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663e6a439058a7f00000000000000000000000000000000000000000000000000000000000000006040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561050157600080fd5b505afa158015610515573d6000803e3d6000fd5b505050506040513d602081101561052b57600080fd5b5051604080517f60246c88000000000000000000000000000000000000000000000000000000008152905191925060009173ffffffffffffffffffffffffffffffffffffffff8616916360246c8891600480830192610100929190829003018186803b15801561059a57600080fd5b505afa1580156105ae573d6000803e3d6000fd5b505050506040513d6101008110156105c557600080fd5b5051905073ffffffffffffffffffffffffffffffffffffffff8281169082161461065057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f696e76616c6964206e6674506f6f6c0000000000000000000000000000000000604482015290519081900360640190fd5b6040805173ffffffffffffffffffffffffffffffffffffffff808d166024830152604482018c9052606482018b9052608482018a90523060a483015260c48083018a90528351808403909101815260e49092019092526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167ff305d7190000000000000000000000000000000000000000000000000000000017905260009161071f917f00000000000000000000000000000000000000000000000000000000000000009091169061115f565b9050600081806020019051606081101561073857600080fd5b5060409081015181517ff84ddf0b00000000000000000000000000000000000000000000000000000000815291519092506107df9160019173ffffffffffffffffffffffffffffffffffffffff8a169163f84ddf0b916004808301926020929190829003018186803b1580156107ad57600080fd5b505afa1580156107c1573d6000803e3d6000fd5b505050506040513d60208110156107d757600080fd5b50519061118b565b600155600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8881169190911791829055610837918682169116836111ff565b8573ffffffffffffffffffffffffffffffffffffffff1663d1aaef0582876040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b15801561089257600080fd5b505af11580156108a6573d6000803e3d6000fd5b505050506000808773ffffffffffffffffffffffffffffffffffffffff166308521f796001546040518263ffffffff1660e01b8152600401808281526020019150506101006040518083038186803b15801561090157600080fd5b505afa158015610915573d6000803e3d6000fd5b505050506040513d61010081101561092c57600080fd5b5080516060909101519092509050828214801561094857508087145b6109b357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f696e76616c696420706f736974696f6e20637265617465640000000000000000604482015290519081900360640190fd5b8773ffffffffffffffffffffffffffffffffffffffff166342842e0e308b6001546040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015610a4457600080fd5b505af1158015610a58573d6000803e3d6000fd5b505060006001818155600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055905550505050505050505050505050505050565b60026000541415610b0f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260008190555060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663e6a439058c8c6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610bbe57600080fd5b505afa158015610bd2573d6000803e3d6000fd5b505050506040513d6020811015610be857600080fd5b5051604080517f60246c88000000000000000000000000000000000000000000000000000000008152905191925060009173ffffffffffffffffffffffffffffffffffffffff8616916360246c8891600480830192610100929190829003018186803b158015610c5757600080fd5b505afa158015610c6b573d6000803e3d6000fd5b505050506040513d610100811015610c8257600080fd5b5051905073ffffffffffffffffffffffffffffffffffffffff82811690821614610d0d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f696e76616c6964206e6674506f6f6c0000000000000000000000000000000000604482015290519081900360640190fd5b506040805173ffffffffffffffffffffffffffffffffffffffff808e166024830152808d166044830152606482018c9052608482018b905260a482018a905260c482018990523060e4830152610104808301899052835180840390910181526101249092019092526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fe8e3370000000000000000000000000000000000000000000000000000000000179052600091610dee917f00000000000000000000000000000000000000000000000000000000000000009091169061115f565b90506000818060200190516060811015610e0757600080fd5b5060409081015181517ff84ddf0b0000000000000000000000000000000000000000000000000000000081529151909250610e7c9160019173ffffffffffffffffffffffffffffffffffffffff89169163f84ddf0b916004808301926020929190829003018186803b1580156107ad57600080fd5b600155600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8781169190911791829055610ed4918582169116836111ff565b8473ffffffffffffffffffffffffffffffffffffffff1663d1aaef0582866040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b158015610f2f57600080fd5b505af1158015610f43573d6000803e3d6000fd5b505050506000808673ffffffffffffffffffffffffffffffffffffffff166308521f796001546040518263ffffffff1660e01b8152600401808281526020019150506101006040518083038186803b158015610f9e57600080fd5b505afa158015610fb2573d6000803e3d6000fd5b505050506040513d610100811015610fc957600080fd5b50805160609091015190925090508282148015610fe557508086145b61105057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f696e76616c696420706f736974696f6e20637265617465640000000000000000604482015290519081900360640190fd5b8673ffffffffffffffffffffffffffffffffffffffff166342842e0e308a6001546040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b1580156110e157600080fd5b505af11580156110f5573d6000803e3d6000fd5b505060006001818155600280547fffffffffffffffffffffffff000000000000000000000000000000000000000016905590555050505050505050505050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6060611184838360405180606001604052806027815260200161186d60279139611392565b9392505050565b60008282018381101561118457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b8015806112ab5750604080517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b15801561127d57600080fd5b505afa158015611291573d6000803e3d6000fd5b505050506040513d60208110156112a757600080fd5b5051155b611300576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806118e46036913960400191505060405180910390fd5b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b30000000000000000000000000000000000000000000000000000000017905261138d9084906114d9565b505050565b606061139d846115b1565b6113f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806118946026913960400191505060405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040518082805190602001908083835b6020831061145a57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161141d565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d80600081146114ba576040519150601f19603f3d011682016040523d82523d6000602084013e6114bf565b606091505b50915091506114cf8282866115b7565b9695505050505050565b600061153b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166116759092919063ffffffff16565b80519091501561138d5780806020019051602081101561155a57600080fd5b505161138d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806118ba602a913960400191505060405180910390fd5b3b151590565b606083156115c6575081611184565b8251156115d65782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561163a578181015183820152602001611622565b50505050905090810190601f1680156116675780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6060611684848460008561168c565b949350505050565b6060824710156116e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806118476026913960400191505060405180910390fd5b6116f0856115b1565b61175b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b602083106117c457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611787565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611826576040519150601f19603f3d011682016040523d82523d6000602084013e61182b565b606091505b509150915061183b8282866115b7565b97965050505050505056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6e74726163745361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a2646970667358221220d69c3800fb8b1ebdd2e6ffe50734fe7a04bdf142b688e87b5575190a1099448364736f6c63430007060033000000000000000000000000c873fecbd354f5a56e00e710b90ef4201db2448d00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000c873fecbd354f5a56e00e710b90ef4201db2448d00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1

-----Decoded View---------------
Arg [0] : router_ (address): 0xc873fecbd354f5a56e00e710b90ef4201db2448d
Arg [1] : weth_ (address): 0x82af49447d8a07e3bd95bd0d56f35241523fbab1

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000c873fecbd354f5a56e00e710b90ef4201db2448d
Arg [1] : 00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.