ETH Price: $2,482.14 (+0.21%)

Contract

0x4933a4F77E0B8fdfb388b62A85458f721A1bd11C
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00
Transaction Hash
Method
Block
From
To
Claim Reward210620052024-10-28 5:20:231 hr ago1730092823IN
0x4933a4F7...21A1bd11C
0 ETH0.000371784.34449753
Claim Reward210612972024-10-28 2:57:473 hrs ago1730084267IN
0x4933a4F7...21A1bd11C
0 ETH0.001212455.91073572
Claim Reward210612912024-10-28 2:56:353 hrs ago1730084195IN
0x4933a4F7...21A1bd11C
0 ETH0.00056646.45362535
Claim Reward210612832024-10-28 2:54:593 hrs ago1730084099IN
0x4933a4F7...21A1bd11C
0 ETH0.000288656.73358806
Claim Reward210604882024-10-28 0:15:116 hrs ago1730074511IN
0x4933a4F7...21A1bd11C
0 ETH0.000626145.4574754
Claim Reward210602082024-10-27 23:19:117 hrs ago1730071151IN
0x4933a4F7...21A1bd11C
0 ETH0.000687275.88764919
Claim Reward210602062024-10-27 23:18:477 hrs ago1730071127IN
0x4933a4F7...21A1bd11C
0 ETH0.00179266.22746943
Claim Reward210589632024-10-27 19:09:2311 hrs ago1730056163IN
0x4933a4F7...21A1bd11C
0 ETH0.000548495.45903299
Claim Reward210565862024-10-27 11:12:1119 hrs ago1730027531IN
0x4933a4F7...21A1bd11C
0 ETH0.002625347.0302801
Claim Reward210538822024-10-27 2:09:2328 hrs ago1729994963IN
0x4933a4F7...21A1bd11C
0 ETH0.001606584.26976538
Claim Reward210536182024-10-27 1:16:3529 hrs ago1729991795IN
0x4933a4F7...21A1bd11C
0 ETH0.003171433.26384039
Claim Reward210525732024-10-26 21:46:1132 hrs ago1729979171IN
0x4933a4F7...21A1bd11C
0 ETH0.001839184.57551953
Claim Reward210520382024-10-26 19:58:5934 hrs ago1729972739IN
0x4933a4F7...21A1bd11C
0 ETH0.003084126.71887922
Claim Reward210485562024-10-26 8:18:2346 hrs ago1729930703IN
0x4933a4F7...21A1bd11C
0 ETH0.003387815.63190553
Claim Reward210469152024-10-26 2:48:592 days ago1729910939IN
0x4933a4F7...21A1bd11C
0 ETH0.000542194.64480619
Claim Reward210446342024-10-25 19:10:352 days ago1729883435IN
0x4933a4F7...21A1bd11C
0 ETH0.001417389.03555192
Claim Reward210435682024-10-25 15:36:592 days ago1729870619IN
0x4933a4F7...21A1bd11C
0 ETH0.0033615517.79844248
Claim Reward210424732024-10-25 11:56:232 days ago1729857383IN
0x4933a4F7...21A1bd11C
0 ETH0.000794266.66756264
Claim Reward210424672024-10-25 11:55:112 days ago1729857311IN
0x4933a4F7...21A1bd11C
0 ETH0.000742216.23063025
Remove Liquidity210410082024-10-25 7:02:592 days ago1729839779IN
0x4933a4F7...21A1bd11C
0 ETH0.001709134.89050435
Claim Reward210410052024-10-25 7:02:232 days ago1729839743IN
0x4933a4F7...21A1bd11C
0 ETH0.000208165.11740744
Claim Reward210410032024-10-25 7:01:592 days ago1729839719IN
0x4933a4F7...21A1bd11C
0 ETH0.008222425.00854591
Claim Reward210405362024-10-25 5:28:113 days ago1729834091IN
0x4933a4F7...21A1bd11C
0 ETH0.000438663.84483408
Claim Reward210397282024-10-25 2:45:353 days ago1729824335IN
0x4933a4F7...21A1bd11C
0 ETH0.000403134.71084448
Claim Reward210394522024-10-25 1:50:113 days ago1729821011IN
0x4933a4F7...21A1bd11C
0 ETH0.000481414.82218596
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
203196012024-07-16 14:14:47103 days ago1721139287
0x4933a4F7...21A1bd11C
29.28794987 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LiquidityMining

Compiler Version
v0.8.26+commit.8a97fa7a

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 18 : LiquidityMining.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "./interfaces/IAggregatorV3Interface.sol";
import "./interfaces/IUniswapV2Factory.sol";
import "./interfaces/IUniswapV2Router02.sol";
import "./interfaces/IUniswapV2Pair.sol";
import "./interfaces/IClaiming.sol";

contract LiquidityMining is Ownable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    struct UserDeposit {
        uint256 amount;
        uint256 depositOn;
        uint256 liquidity;
        bool removed;
    }

    struct Checkpoint {
        uint256 amount;
        uint256 prev;
        uint256 next;
    }

    // address of sale token
    IERC20 public token;
    // address of claiming contract
    address public claiming;

    // status for liquidity is added
    uint256 public listedTime;
    // liquidity amount to be listed
    uint256 public listedLiquidity;

    // deposit start time, i.e the time presale is over
    uint256 public depositStart;
    
    // minimum ETH amount to deposit
    uint256 public ALLOWED_MINIMUM_DEPOSIT;
    // WETH token address
    address public WETH;
    // total deposit ETH until list the liquidity
    uint256 public totalDeposits;
    // user's deposit ETH
    mapping(address => UserDeposit[]) public userDeposits;
    // total deposited amount of each user
    mapping(address => uint256) public userTotalDeposits;

    // states for reward
    uint256 public startDay;
    uint256 public rewardPeriod;
    uint256 public totalReward;
    bool public claimRewardEnabled;
    mapping(address => mapping(uint256 => Checkpoint)) public userDailyHistory; // user => day => amount
    mapping(address => uint256) public userLastUpdateDay; // user => day (last day that daily history was updated)
    mapping(address => uint256) public lastRewardClaimDay; // user => day (last day that claimed reward)
    mapping(address => uint256) public lastCheckpointDay; // user => day (last day that was considered in reward calculation for user deposit)
    mapping(address => uint256) public lastTotalCheckpointDay; // user => day (last day that was considered in reward calculation for total deposit)
    mapping(uint256 => Checkpoint) public dailyTotalHistory; // day => amount
    uint256 public lastUpdateDay;

    IUniswapV2Pair public pair;
    IUniswapV2Factory public uniswapV2Factory;
    IUniswapV2Router02 public uniswapV2Router;

    AggregatorV3Interface internal chainlinkETHUSDContract;

    /* ========== EVENTS ========== */
    // Event emitted when a presale buyer deposits ETH
    event Deposited(address indexed user, uint256 amount, uint256 time);
    // Event emitted when an owner updates the time to start deposit
    event DepositStartTimeUpdated(address indexed user, uint256 depositStartTime);
    // Event emitted when allowed minimum deposit amount is updated
    event AllowedMinimumDepositUpdated(address indexed user, uint256 previousAmount, uint256 amount, uint256 time);
    // Event emitted when claiming contract address was updated by the owner
    event ClaimingContractAddressUpdated(address indexed user, address claiming, uint256 time);
    // Event emitted when liquidity added by the owner
    event LiquidityAdded(address indexed user, uint256 liquidity, uint256 time);
    // Event emitted when liquidity removed by the depositor
    event LiquidityRemoved(address indexed user, uint256 ownLiquidity, uint256 amountToken, uint256 amountETH, uint256 time);
    // Event emitted when reward token is transferred
    event RewardTransferred(address indexed user, uint256 amount, uint256 time);
    // Event emitted when reward token is deposited by the owner
    event TokenDepositedForReward(address indexed user, uint256 amount, uint256 time);
    // Event emitted when the owner updates the reward program states
    event RewardProgramPlanUpdated(address indexed user, uint256 startDay, uint256 period, uint256 totalReward, uint256 time);
    // Event emitted when the owner enable claim reward of liquidity miners
    event ClaimRewardEnabled(address indexed user, uint256 time);

    modifier onlyWhenNotListed() {
        require(listedTime == 0, "Liquidity was already listed");
        _;
    }

    modifier onlyWhenListed() {
        require(listedTime != 0, "Liquidity wasn't listed yet");
        _;
    }

    constructor(
        address _token,
        address _chainlinkETHUSDAddress,
        address _uniswapV2Factory, // 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f
        address _uniswapV2Router // 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
    ) Ownable(msg.sender) {
        // verify input argument
        require(_token != address(0), "Sale token address cannot be zero");

        token = IERC20(_token);

        chainlinkETHUSDContract = AggregatorV3Interface(_chainlinkETHUSDAddress);

        // set uniswap factory and router02
        uniswapV2Factory = IUniswapV2Factory(_uniswapV2Factory);
        uniswapV2Router = IUniswapV2Router02(_uniswapV2Router);

        // set the WETH token address
        WETH = uniswapV2Router.WETH();
    }

    /******************************************************
                            Setter
    ******************************************************/

    /**
     * @notice Set the time to start claiming
     *
     * @param _depositStart The time to start claiming
     */
    function setDepositStart(uint256 _depositStart) external onlyOwner {
        // verify input argument
        require(_depositStart >= block.timestamp, "Invalid time for start deposit.");

        depositStart = _depositStart;

        emit DepositStartTimeUpdated(msg.sender, _depositStart);
    }

    /**
     * @notice Set the address of claiming contract
     * 
     * @dev Only owner can call this function; should check non-zero address
     * 
     * @param _claiming address of the claiming contract
     */
    function setClaimingContract(address _claiming) external onlyOwner {
        // verify input argument
        require(_claiming != address(0), "Contract address cannot be zero address");

        claiming = _claiming;

        emit ClaimingContractAddressUpdated(msg.sender, claiming, block.timestamp);
    }

    /**
     * @notice Set the minimum allowed to deposit ETH
     *
     * @dev amount can be zero value
     *
     * @param amount allowed minimum amount to deposit ETH
     */
    function setAllowedMinimumDeposit(uint256 amount) external onlyOwner {
        uint256 previousAmount = ALLOWED_MINIMUM_DEPOSIT;
        ALLOWED_MINIMUM_DEPOSIT = amount;

        emit AllowedMinimumDepositUpdated(msg.sender, previousAmount, amount, block.timestamp);
    }

    /**
     * @notice Set the states for reward program
     *
     * @param _period reward program period in days
     * @param _start reward program start time in timestamp
     * @param _total total reward token amount
     */
    function setRewardStates(uint256 _start, uint256 _period, uint256 _total) external onlyOwner {
        // verify setting of deposit start date
        require(depositStart != 0, "Deposit start time should be set");

        // verify input argument
        require(_start != 0, "Invalid reward start time");
        require(_start >= depositStart, "Cannot be before deposit start time");
        require(_period != 0, "Invalid reward period");
        require(_total != 0, "Invalid reward token amount");

        // set the start day at the 00h:00min of the start day
        startDay = _start / 1 days;

        uint256 day = depositStart / 1 days;
        Checkpoint storage startDayCp = dailyTotalHistory[startDay];
        while (day <= startDay) {
            Checkpoint memory dayCp = dailyTotalHistory[day];
            if (dailyTotalHistory[day].amount != 0) {
                startDayCp.amount = dayCp.amount;
                startDayCp.prev = dayCp.prev;
                startDayCp.next = dayCp.next;
            }

            ++day;
        }

        rewardPeriod = _period;
        totalReward = _total;

        emit RewardProgramPlanUpdated(msg.sender, startDay, rewardPeriod, totalReward, block.timestamp);
    }

    /**
     * @notice Allows liquidity miners to claim their rewards
     */
    function setClaimRewardEnabled() external onlyOwner {
        require(!claimRewardEnabled, "Claim reward is enabled already");

        claimRewardEnabled = true;

        emit ClaimRewardEnabled(msg.sender, block.timestamp);
    }

    /******************************************************
                           External
    ******************************************************/

    /**
     * @notice deposit ETH for liquidity mining
     */
    function depositETH() external payable nonReentrant onlyWhenNotListed {
        require(msg.value > 0, "Cannot deposit 0 ETH");
        // verify if deposit is allowed
        require(depositStart != 0 && block.timestamp >= depositStart, "Deposit is not allowed for now");

        if (ALLOWED_MINIMUM_DEPOSIT > 0) {
            require(msg.value >= ALLOWED_MINIMUM_DEPOSIT, "Insufficient deposit amount for minimum allowed");
        }

        (
            bool depositable,
            uint256 claimableAmount,
            uint256 ethValue
        ) = _checkClaimableAmountForDepositETH(msg.sender, msg.value);
        
        // only presale buyer can deposit ETH
        require(depositable, "You don't have sufficient claimable token amount to deposit ETH");

        // decrease the user's claimable token amount by deposited ETH market value
        IClaiming(claiming).setClaim(msg.sender, claimableAmount - ethValue);

        userDeposits[msg.sender].push(UserDeposit({
            amount: msg.value,
            depositOn: block.timestamp,
            liquidity: 0,
            removed: false
        }));

        userTotalDeposits[msg.sender] += msg.value;

        // increase total deposit amount
        totalDeposits += msg.value;

        _updateHistoryForReward(msg.sender, msg.value, false);

        emit Deposited(msg.sender, msg.value, block.timestamp);
    }

    function _updateHistoryForReward(address user, uint256 amount, bool isRemove) private {
        // get the today number
        uint256 today = block.timestamp / 1 days;

        Checkpoint storage todayCp = userDailyHistory[user][today];
        if (today != userLastUpdateDay[user]) {
            // if it is the first updating for today, update with last update day's amount
            uint256 userLastDay = userLastUpdateDay[user];
            Checkpoint storage lastCp = userDailyHistory[user][userLastDay];
            todayCp.amount = lastCp.amount;
            // update today's previous checkpoint day
            todayCp.prev = userLastDay;
            // update last checkpoint day's next checkpoint day
            lastCp.next = today;
        }

        Checkpoint storage todayTotalCp = dailyTotalHistory[today];
        if (today != lastUpdateDay) {
            Checkpoint storage lastTotalCp = dailyTotalHistory[lastUpdateDay];
            todayTotalCp.amount = lastTotalCp.amount;
            todayTotalCp.prev = lastUpdateDay;
            lastTotalCp.next = today;
        }

        if (isRemove) {
            todayCp.amount -= amount;
            todayTotalCp.amount -= amount;
        } else {
            todayCp.amount += amount;
            todayTotalCp.amount += amount;
        }
        userLastUpdateDay[user] = today;
        lastUpdateDay = today;
        // udpate the first checkpoint for reward
        if (today <= startDay) {
            Checkpoint storage startDayCp = userDailyHistory[user][startDay];
            startDayCp.amount = todayCp.amount;
            startDayCp.prev = todayCp.prev;
            startDayCp.next = 0;

            Checkpoint storage startDayTotalCp = dailyTotalHistory[startDay];
            startDayTotalCp.amount = todayTotalCp.amount;
            startDayTotalCp.prev = todayTotalCp.prev;
            startDayTotalCp.next = todayTotalCp.next;
        }
    }

    /**
     * @notice List liquidity of deposited ETH and some Token to UniV2
     *
     * @param _pair the address of pair pool on Uni v2
     */
    function listLiquidity(address _pair) external onlyOwner onlyWhenNotListed {
        require(address(token) != address(0), "Sale token address cannot be zero");

        // verify passed pair address with sale token and WETH 
        // require(uniswapV2Factory.getPair(address(token), WETH) == _pair, "The pair address is invalid");
        
        // verify sufficient ETH balance to add liquidity
        require(totalDeposits != 0, "Insufficient ETH balance to mint LP");

        pair = IUniswapV2Pair(_pair);
        require(pair.token0() == address(token) || pair.token1() == address(token), "Invalid pair address");

        listedTime = block.timestamp;

        (uint256 reserve0, uint256 reserve1, ) = pair.getReserves();
        uint256 amount;
        if (address(token) < WETH) {
            amount = uniswapV2Router.quote(totalDeposits, reserve1, reserve0);
        } else {
            amount = uniswapV2Router.quote(totalDeposits, reserve0, reserve1);
        }

        // get the sale token from the claiming contract for adding liquidity
        IClaiming(claiming).transferTokenToLiquidityMining(amount);
        // update claim start time as 7 days later from listed time
        IClaiming(claiming).setClaimStart(listedTime + 7 days);

        // Approve router to mint LP
        bool success = token.approve(address(uniswapV2Router), amount);
        require(success, "Approve failed");

        try uniswapV2Router.addLiquidityETH{value: totalDeposits} ( // Amount of ETH to send for LP on univ2
            address(token),
            2 * amount, // to calc as WETH desired quote
            100, // Infinite slippage basically since it's in wei
            totalDeposits, // should add liquidity this amount exactly
            address(this), // Transfer LP token to this contract
            block.timestamp
        ) returns (uint256 , uint256 , uint256 liquidity) {
            listedLiquidity = liquidity;

            emit LiquidityAdded(msg.sender, listedLiquidity, block.timestamp);
        } catch {
            revert(string("Adding liquidity was failed"));
        }
    }

    /**
     * @notice cancel liquidity mining to receive back funds
     *
     * @dev able to only after 7 days later from listing
     *
     * @param index index of the deposit array to get reward
     */
    function removeLiquidity(uint256 index) external nonReentrant onlyWhenListed returns(
        uint256 amountToken,
        uint256 amountETH
    ){
        // verify 1 week after listed
        require(block.timestamp >= listedTime + 7 days, "Cannot remove liquidity until 7 days after listing");
        // verify input argument
        require(index < userDeposits[msg.sender].length, "Invalid index value");
        
        UserDeposit storage userDeposit = userDeposits[msg.sender][index];
        require(!userDeposit.removed, "This liquidity was already removed");
        
        // update the removed flag as true
        userDeposit.removed = true;

        userTotalDeposits[msg.sender] -= userDeposit.amount;

        uint256 ownLiquidity;
        if (userDeposit.liquidity != 0) {
            // if liquidity after listing
            ownLiquidity = userDeposit.liquidity;
        } else {
            // if liquidity before listing
            // valid if liquidity exists
            require(listedLiquidity != 0, "There is no liquidity in the contract");
            
            ownLiquidity = listedLiquidity * userDeposit.amount / totalDeposits;
        }

        bool success = pair.approve(address(uniswapV2Router), ownLiquidity);
        require(success, "Approve failed");
        
        // remove liquidity and transfer tokens to caller
        (amountToken, amountETH) = uniswapV2Router.removeLiquidityETH(
            address(token),
            ownLiquidity,
            100,
            100,
            msg.sender,
            block.timestamp
        );

        _updateHistoryForReward(msg.sender, userDeposit.amount, true);

        emit LiquidityRemoved(msg.sender, ownLiquidity, amountToken, amountETH, block.timestamp);
    }

    /**
     * @notice add liquidity after presale buyers' liquidity was listed
     *
     * @param amount sale token amount to add liquidity
     */
    function addLiquidity(uint256 amount)external payable nonReentrant onlyWhenListed returns(
        uint256 aToken,
        uint256 aETH,
        uint256 aLiquidity
    ) {
        require(msg.value != 0, "Invalid ETH deposit");
        require(amount != 0 , "Invalid token deposit");

        // transfer token from user to mining contract here
        token.safeTransferFrom(msg.sender, address(this), amount);
        // approve router to transfer token from mining to pair
        bool success = token.approve(address(uniswapV2Router), amount);
        require(success, "Approve failed");

        // add liquidity by depositing both of token and ETH
        try uniswapV2Router.addLiquidityETH{value: msg.value} (
            address(token),
            amount, // to calc as WETH desired quote
            100, // Infinite slippage basically since it's in wei
            100, // Infinite slippage basically since it's in wei
            address(this), // Transfer LP token to this contract
            block.timestamp
        ) returns (uint256 amountToken, uint256 amountETH, uint256 liquidity) {
            if (amount > amountToken) {
                // refund left token to the user back
                token.safeTransfer(msg.sender, amount - amountToken);
            }

            if (msg.value > amountETH) { // no need, but for security
                // refund left ETH to the user back
                ( success, ) = address(msg.sender).call{
                    value: msg.value - amountETH,
                    gas: 35000 // limit gas fee to prevent hook operation
                }("");
                require(success, "Failed to refund Ether");
            }

            userDeposits[msg.sender].push(UserDeposit({
                amount: amountETH,
                depositOn: block.timestamp,
                liquidity: liquidity,
                removed: false
            }));

            userTotalDeposits[msg.sender] += amountETH;

            _updateHistoryForReward(msg.sender, amountETH, false);

            aToken = amountToken;
            aETH = amountETH;
            aLiquidity = liquidity;

            emit LiquidityAdded(msg.sender, liquidity, block.timestamp);
        } catch {
            revert(string("Adding liquidity was failed"));
        }
    }

    /**
     * @notice claim reward based on the daily reward program
     */
    function claimReward() external {
        // verify claiming reward is enabled
        require(claimRewardEnabled, "Claiming reward is not enabled yet");
        // verify deposit and reward start time
        require(depositStart > 0, "Invalid deposit start time");
        require(startDay > 0, "Invalid reward start time");
        require(block.timestamp / 1 days > startDay, "Invalid date to claim reward");

        // if it is first claiming, update checkpoint for reward start day
        updateCheckpointStartDay(msg.sender);

        (
            uint256 rewardAmount,
            uint256 lastCpDay, 
            uint256 lastTotalCpDay
        ) = getRewardTokenAmount(msg.sender);

        if (rewardAmount > 0)
            token.safeTransfer(msg.sender, rewardAmount);

        // update last claim day as today
        lastRewardClaimDay[msg.sender] = block.timestamp / 1 days;
        lastCheckpointDay[msg.sender] = lastCpDay;
        lastTotalCheckpointDay[msg.sender] = lastTotalCpDay;
    }

    /**
     * @notice update start day's checkpoint info for particular user
     */
    function updateCheckpointStartDay(address user) public {
        // if it is first claiming, update checkpoint for reward start day
        Checkpoint storage startDayCp = userDailyHistory[user][startDay];
        if (
            lastRewardClaimDay[user] == 0 &&
            startDayCp.amount == 0
        ) {
            uint256 day = 0;
            while (day <= startDay) {
                Checkpoint memory dayCp = userDailyHistory[user][day];
                startDayCp.amount = dayCp.amount;
                startDayCp.prev = dayCp.prev;
                startDayCp.next = dayCp.next;

                if (dayCp.next != 0) {
                    day = dayCp.next;
                } else {
                    break;
                }
            }
        }
    }

    /**
     * @notice deposit tokens for reward program of liquidity mining
     */
    function depositRewardTokens(uint256 amount) external onlyOwner {
        // verity input argument
        require(amount != 0, "Invalid token amount");

        // transfer token for reward from caller to this contract
        token.safeTransferFrom(msg.sender, address(this), amount);

        emit TokenDepositedForReward(msg.sender, amount, block.timestamp);
    }

    /*****************************************************
                            Getter
    *****************************************************/

    /**
     * @notice How many deposits a particular address has done
     *
     * @param user an address to query number of times deposited
     * @return number of times a particular address has deposited
     */
    function numDepoists(address user) public view returns(uint256) {
        return userDeposits[user].length;
    }

    /**
     * @notice Get the reward token amount based on the reward program
     *
     * @param user address of user to get the reward
     */
    function getRewardTokenAmount(address user) public view returns(
        uint256 rewardAmount,
        uint256 lastCpDay,
        uint256 lastTotalCpDay
    ) {
        // verify input argument
        require(user != address(0), "Invalid user address");
        if (startDay == 0) { // in the case that start day is not defined yet
            rewardAmount = 0;
            lastCpDay = 0;
            lastTotalCpDay = 0;
        } else {
            // get the daily rewardable amount
            uint256 dailyReward = totalReward / rewardPeriod;

            // get the today
            uint256 today = block.timestamp / 1 days;
            // get the reward end day (the next day of end day, indeed)
            uint256 rewardEndDay = startDay + rewardPeriod;
            // get the last day when user claimed reward
            uint256 lastClaimDay = lastRewardClaimDay[user] == 0 ? startDay : lastRewardClaimDay[user];

            lastCpDay = lastCheckpointDay[user];
            lastTotalCpDay = lastTotalCheckpointDay[user];
            uint256 endDay = today > rewardEndDay ?  rewardEndDay : today;
            for (uint256 day = lastClaimDay; day < endDay; ++day) {
                uint256 totalCpAmount;
                Checkpoint memory dayTotalCp = dailyTotalHistory[day];
                if (dayTotalCp.amount != 0 || dayTotalCp.prev != 0) {
                    totalCpAmount = dayTotalCp.amount;
                    lastTotalCpDay = day;
                } else {
                    totalCpAmount = dailyTotalHistory[lastTotalCpDay].amount;
                }

                if (totalCpAmount == 0) continue;

                Checkpoint memory dayCp = userDailyHistory[user][day];

                if (dayCp.amount != 0 || dayCp.prev != 0) {
                    rewardAmount += dailyReward * dayCp.amount / totalCpAmount;
                    lastCpDay = day;
                } else {
                    // continue if user deposit ETH is zero
                    Checkpoint memory userLastDayCp = userDailyHistory[user][lastCpDay];
                    if (userLastDayCp.amount == 0) continue;

                    rewardAmount += dailyReward * userLastDayCp.amount / totalCpAmount;
                }
            }
        }
    }

    /**
     * @notice Get the info of a particular deposits
     * 
     * @param user address of user to get the deposits info
     */
    function getUserDepositsArray(address user) public view returns(UserDeposit[] memory) {
        uint256 length = numDepoists(user);
        UserDeposit[] memory userDepositArray = new UserDeposit[](length);

        for (uint256 i = 0; i < length;) {
            userDepositArray[i] = userDeposits[user][i];

            unchecked {
                ++i;
            }
        }

        return userDepositArray;
    }

    /**
     * @notice get user's deposit info at particular index
     *
     * @param user address of the user to get the info
     * @param index index of the deposit array of user
     */
    function getUserDepositInfo(
        address user,
        uint256 index
    ) public view returns (
        uint256,
        uint256,
        bool
    ) {
        UserDeposit storage userDeposit = userDeposits[user][index];

        return (
            userDeposit.amount,
            userDeposit.depositOn,
            userDeposit.removed
        );
    }

    /**
     * @notice get user's total deposited ETH amount
     */
    function getUserTotalDeposit(address user) public view returns(uint256) {
        return userTotalDeposits[user];
    }

    /**
     * @notice get user's daily checkpoint history
     */
    function getUserDailyCheckpoint(
        address user,
        uint256 day
    ) public view returns (
        uint256 amount,
        uint256 prev, 
        uint256 next
    ) {
        Checkpoint memory cp = userDailyHistory[user][day];
        amount = cp.amount;
        prev = cp.prev;
        next = cp.next;
    }

    /**
     * @notice get total daily checkpoint history
     */
    function getTotalDailyCheckpoint(uint256 day) public view returns(
        uint256 amount,
        uint256 prev,
        uint256 next
    ) {
        Checkpoint memory cp = dailyTotalHistory[day];
        amount = cp.amount;
        prev = cp.prev;
        next = cp.next;
    }

    /**
     * @notice get the lates ETH/USD price from chainlink price feed
     */
    function fetchETHUSDPrice() public view returns (uint256 price, uint256 decimals) {
        (, int256 priceInt, , , ) = chainlinkETHUSDContract.latestRoundData();
        decimals = chainlinkETHUSDContract.decimals();
        price = uint256(priceInt);
        return (price, decimals);
    }

    function _checkClaimableAmountForDepositETH(
        address user,
        uint256 ethAmount
    ) private view returns (
        bool depositable,
        uint256 claimableAmount,
        uint256 ethValue
    ) {
        // verify claiming contract address
        require(claiming != address(0), "The address of claiming contract cannot be zero");
        
        // get the latest ETH price and decimals
        (uint256 price, uint256 decimals) = fetchETHUSDPrice();

        // calculate deposited ETH market value
        // @note (not divide with 10^18, because the sale token's decimals is also 18)
        ethValue = ethAmount * price / (10 ** decimals);

        // get current claimable token amount for user
        ( , , claimableAmount) = IClaiming(claiming).getClaimInfo(user);
        
        depositable = claimableAmount >= ethValue;
    }
}

File 2 of 18 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

File 3 of 18 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
import {Address} from "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC-20 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 Address for address;

    /**
     * @dev An operation with an ERC-20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            safeTransfer(token, to, value);
        } else if (!token.transferAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferFromAndCallRelaxed(
        IERC1363 token,
        address from,
        address to,
        uint256 value,
        bytes memory data
    ) internal {
        if (to.code.length == 0) {
            safeTransferFrom(token, from, to, value);
        } else if (!token.transferFromAndCall(from, to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
     * once without retrying, and relies on the returned value to be true.
     *
     * Reverts if the returned value is other than `true`.
     */
    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            forceApprove(token, to, value);
        } else if (!token.approveAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @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);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // 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 cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}

File 4 of 18 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 5 of 18 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @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 EIP-1153 (transient storage) is available on the chain you're deploying at,
 * consider using {ReentrancyGuardTransient} instead.
 *
 * 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;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    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 making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

File 6 of 18 : IAggregatorV3Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface AggregatorV3Interface {
  function decimals() external view returns (uint8);

  function description() external view returns (string memory);

  function version() external view returns (uint256);

  function getRoundData(
    uint80 _roundId
  ) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);

  function latestRoundData()
    external
    view
    returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
}

File 7 of 18 : IUniswapV2Factory.sol
pragma solidity >=0.5.0;

interface IUniswapV2Factory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint);

    function feeTo() external view returns (address);
    function feeToSetter() external view returns (address);

    function getPair(address tokenA, address tokenB) external view returns (address pair);
    function allPairs(uint) external view returns (address pair);
    function allPairsLength() external view returns (uint);

    function createPair(address tokenA, address tokenB) external returns (address pair);

    function setFeeTo(address) external;
    function setFeeToSetter(address) external;
}

File 8 of 18 : IUniswapV2Router02.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.6.2;

import './IUniswapV2Router01.sol';

interface IUniswapV2Router02 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,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}

File 9 of 18 : IUniswapV2Pair.sol
pragma solidity >=0.5.0;

interface IUniswapV2Pair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
}

File 10 of 18 : IClaiming.sol
pragma solidity ^0.8.20;

interface IClaiming {
    function setClaimStart(uint256) external;

    function setClaim(address, uint256) external;

    function getClaimInfoIndex(address) external view returns(uint256);

    function getClaimableAmount(address) external view returns(uint256);

    function getClaimInfo(address) external view returns(uint256, uint256, uint256);

    function transferTokenToLiquidityMining(uint256) external;
}

File 11 of 18 : IERC1363.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1363.sol)

pragma solidity ^0.8.20;

import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";

/**
 * @title IERC1363
 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
 *
 * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
 * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
 */
interface IERC1363 is IERC20, IERC165 {
    /*
     * Note: the ERC-165 identifier for this interface is 0xb0202a11.
     * 0xb0202a11 ===
     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^
     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
     */

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @param data Additional data with no specified format, sent in call to `spender`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}

File 12 of 18 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

import {Errors} from "./Errors.sol";

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @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://consensys.net/diligence/blog/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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert Errors.InsufficientBalance(address(this).balance, amount);
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert Errors.FailedCall();
        }
    }

    /**
     * @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 or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {Errors.FailedCall} error.
     *
     * 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.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @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`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert Errors.InsufficientBalance(address(this).balance, value);
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case
     * of an unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {Errors.FailedCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.
     */
    function _revert(bytes memory returndata) private pure {
        // 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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert Errors.FailedCall();
        }
    }
}

File 13 of 18 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 14 of 18 : IUniswapV2Router01.sol
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 swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}

File 15 of 18 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../token/ERC20/IERC20.sol";

File 16 of 18 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../utils/introspection/IERC165.sol";

File 17 of 18 : Errors.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.20;

/**
 * @dev Collection of common custom errors used in multiple contracts
 *
 * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
 * It is recommended to avoid relying on the error API for critical functionality.
 */
library Errors {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error InsufficientBalance(uint256 balance, uint256 needed);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedCall();

    /**
     * @dev The deployment failed.
     */
    error FailedDeployment();
}

File 18 of 18 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * 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[ERC 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": [
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_chainlinkETHUSDAddress","type":"address"},{"internalType":"address","name":"_uniswapV2Factory","type":"address"},{"internalType":"address","name":"_uniswapV2Router","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[],"name":"FailedCall","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"AllowedMinimumDepositUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"ClaimRewardEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"claiming","type":"address"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"ClaimingContractAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"depositStartTime","type":"uint256"}],"name":"DepositStartTimeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"liquidity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"LiquidityAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"ownLiquidity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountToken","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountETH","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"LiquidityRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"startDay","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"period","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"RewardProgramPlanUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"RewardTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"TokenDepositedForReward","type":"event"},{"inputs":[],"name":"ALLOWED_MINIMUM_DEPOSIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"addLiquidity","outputs":[{"internalType":"uint256","name":"aToken","type":"uint256"},{"internalType":"uint256","name":"aETH","type":"uint256"},{"internalType":"uint256","name":"aLiquidity","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"claimReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimRewardEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claiming","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"dailyTotalHistory","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"prev","type":"uint256"},{"internalType":"uint256","name":"next","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositRewardTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fetchETHUSDPrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"decimals","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getRewardTokenAmount","outputs":[{"internalType":"uint256","name":"rewardAmount","type":"uint256"},{"internalType":"uint256","name":"lastCpDay","type":"uint256"},{"internalType":"uint256","name":"lastTotalCpDay","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"day","type":"uint256"}],"name":"getTotalDailyCheckpoint","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"prev","type":"uint256"},{"internalType":"uint256","name":"next","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"day","type":"uint256"}],"name":"getUserDailyCheckpoint","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"prev","type":"uint256"},{"internalType":"uint256","name":"next","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getUserDepositInfo","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserDepositsArray","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"depositOn","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"bool","name":"removed","type":"bool"}],"internalType":"struct LiquidityMining.UserDeposit[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserTotalDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastCheckpointDay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastRewardClaimDay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastTotalCheckpointDay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateDay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_pair","type":"address"}],"name":"listLiquidity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"listedLiquidity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"listedTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"numDepoists","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pair","outputs":[{"internalType":"contract IUniswapV2Pair","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"removeLiquidity","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setAllowedMinimumDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setClaimRewardEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_claiming","type":"address"}],"name":"setClaimingContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_depositStart","type":"uint256"}],"name":"setDepositStart","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_period","type":"uint256"},{"internalType":"uint256","name":"_total","type":"uint256"}],"name":"setRewardStates","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startDay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniswapV2Factory","outputs":[{"internalType":"contract IUniswapV2Factory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswapV2Router","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"updateCheckpointStartDay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userDailyHistory","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"prev","type":"uint256"},{"internalType":"uint256","name":"next","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userDeposits","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"depositOn","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"bool","name":"removed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userLastUpdateDay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userTotalDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b5060405161382538038061382583398101604081905261002f91610201565b338061005657604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b61005f81610195565b50600180556001600160a01b0384166100c45760405162461bcd60e51b815260206004820152602160248201527f53616c6520746f6b656e20616464726573732063616e6e6f74206265207a65726044820152606f60f81b606482015260840161004d565b600280546001600160a01b038087166001600160a01b031992831617909255601a805486841690831617905560188054858416908316179055601980549284169290911682179055604080516315ab88c960e31b8152905163ad5c4648916004808201926020929091908290030181865afa158015610147573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061016b9190610255565b600880546001600160a01b0319166001600160a01b03929092169190911790555061027792505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146101fc57600080fd5b919050565b6000806000806080858703121561021757600080fd5b610220856101e5565b935061022e602086016101e5565b925061023c604086016101e5565b915061024a606086016101e5565b905092959194509250565b60006020828403121561026757600080fd5b610270826101e5565b9392505050565b61359f806102866000396000f3fe6080604052600436106102885760003560e01c80637bfa37e11161015a578063ad5c4648116100c1578063d9c146de1161007a578063d9c146de14610919578063dc713a481461092f578063e88dc5b714610945578063f2fde38b1461095b578063f6326fb31461097b578063fc0c546a1461098357600080fd5b8063ad5c464814610813578063af238ba514610833578063b88a802f14610860578063b935088b14610875578063c0806b03146108bc578063d4a86a40146108f957600080fd5b80639295953f116101135780639295953f1461073057806396ee87821461075d5780639c8f9f231461077d5780639ce696791461079d578063a4c828dc146107bd578063a8aa1b31146107f357600080fd5b80637bfa37e1146106685780637d8820971461067e578063833b3a6c1461069457806383c73126146106a95780638c983567146106e55780638da5cb5b1461071257600080fd5b806335dac638116101fe57806358cf4643116101b757806358cf46431461055d57806359d0f713146105c757806365a6cf11146105e7578063715018a61461061d57806372d970a314610632578063750142e61461065257600080fd5b806335dac6381461044c5780634007b92914610479578063413d5056146104a357806350f2bc5a146104c357806351c6590a146104d957806351f9c87c1461050757600080fd5b80630e37d869116102505780630e37d8691461037f5780631694505e146103a957806316c621e0146103c9578063184a22d1146103e9578063265900e8146103ff57806329d7157e1461041f57600080fd5b80630539272a1461028d578063057e2c40146102b657806308f43333146102e35780630d26ad9c146103255780630defc08a14610347575b600080fd5b34801561029957600080fd5b506102a3600c5481565b6040519081526020015b60405180910390f35b3480156102c257600080fd5b506102a36102d1366004613048565b60146020526000908152604090205481565b3480156102ef57600080fd5b506103036102fe366004613065565b6109a3565b60408051948552602085019390935291830152151560608201526080016102ad565b34801561033157600080fd5b50610345610340366004613048565b6109ec565b005b34801561035357600080fd5b50600354610367906001600160a01b031681565b6040516001600160a01b0390911681526020016102ad565b34801561038b57600080fd5b50600f546103999060ff1681565b60405190151581526020016102ad565b3480156103b557600080fd5b50601954610367906001600160a01b031681565b3480156103d557600080fd5b506103456103e4366004613091565b610ab4565b3480156103f557600080fd5b506102a360075481565b34801561040b57600080fd5b5061034561041a366004613048565b610b5e565b34801561042b57600080fd5b506102a361043a366004613048565b60136020526000908152604090205481565b34801561045857600080fd5b5061046c610467366004613048565b61120c565b6040516102ad91906130aa565b34801561048557600080fd5b5061048e611357565b604080519283526020830191909152016102ad565b3480156104af57600080fd5b506103456104be366004613091565b611452565b3480156104cf57600080fd5b506102a360165481565b6104ec6104e7366004613091565b6114e1565b604080519384526020840192909252908201526060016102ad565b34801561051357600080fd5b506104ec610522366004613091565b600090815260156020908152604091829020825160608101845281548082526001830154938201849052600290920154930183905292909190565b34801561056957600080fd5b506104ec610578366004613065565b6001600160a01b03909116600090815260106020908152604080832093835292815290829020825160608101845281548082526001830154938201849052600290920154930183905292909190565b3480156105d357600080fd5b50601854610367906001600160a01b031681565b3480156105f357600080fd5b506102a3610602366004613048565b6001600160a01b03166000908152600a602052604090205490565b34801561062957600080fd5b50610345611926565b34801561063e57600080fd5b5061034561064d366004613091565b61193a565b34801561065e57600080fd5b506102a3600e5481565b34801561067457600080fd5b506102a360055481565b34801561068a57600080fd5b506102a360095481565b3480156106a057600080fd5b50610345611990565b3480156106b557600080fd5b506104ec6106c4366004613091565b60156020526000908152604090208054600182015460029092015490919083565b3480156106f157600080fd5b506102a3610700366004613048565b60126020526000908152604090205481565b34801561071e57600080fd5b506000546001600160a01b0316610367565b34801561073c57600080fd5b506102a361074b366004613048565b600b6020526000908152604090205481565b34801561076957600080fd5b506104ec610778366004613048565b611a36565b34801561078957600080fd5b5061048e610798366004613091565b611d00565b3480156107a957600080fd5b506103456107b8366004613048565b612116565b3480156107c957600080fd5b506102a36107d8366004613048565b6001600160a01b03166000908152600b602052604090205490565b3480156107ff57600080fd5b50601754610367906001600160a01b031681565b34801561081f57600080fd5b50600854610367906001600160a01b031681565b34801561083f57600080fd5b506102a361084e366004613048565b60116020526000908152604090205481565b34801561086c57600080fd5b506103456121d9565b34801561088157600080fd5b506104ec610890366004613065565b601060209081526000928352604080842090915290825290208054600182015460029092015490919083565b3480156108c857600080fd5b506108dc6108d7366004613065565b6123a8565b6040805193845260208401929092521515908201526060016102ad565b34801561090557600080fd5b50610345610914366004613115565b612407565b34801561092557600080fd5b506102a360065481565b34801561093b57600080fd5b506102a360045481565b34801561095157600080fd5b506102a3600d5481565b34801561096757600080fd5b50610345610976366004613048565b6126ac565b6103456126ea565b34801561098f57600080fd5b50600254610367906001600160a01b031681565b600a60205281600052604060002081815481106109bf57600080fd5b60009182526020909120600490910201805460018201546002830154600390930154919450925060ff1684565b6001600160a01b0381166000818152601060209081526040808320600c54845282528083209383526012909152902054158015610a2857508054155b15610ab05760005b600c548111610aae576001600160a01b03831660009081526010602090815260408083208484528252918290208251606081018452815480825260018084015494830185905260029384015495830186905290875586019290925584018290559015610aa25780604001519150610aa8565b50610aae565b50610a30565b505b5050565b610abc612a5c565b80600003610b085760405162461bcd60e51b8152602060048201526014602482015273125b9d985b1a59081d1bdad95b88185b5bdd5b9d60621b60448201526064015b60405180910390fd5b600254610b20906001600160a01b0316333084612a89565b6040805182815242602082015233917f9f77c8cccc840812886a42aaa64dbd4b1145c9392e0c3fa498206caa5d4faba591015b60405180910390a250565b610b66612a5c565b60045415610bb65760405162461bcd60e51b815260206004820152601c60248201527f4c69717569646974792077617320616c7265616479206c6973746564000000006044820152606401610aff565b6002546001600160a01b0316610c185760405162461bcd60e51b815260206004820152602160248201527f53616c6520746f6b656e20616464726573732063616e6e6f74206265207a65726044820152606f60f81b6064820152608401610aff565b600954600003610c765760405162461bcd60e51b815260206004820152602360248201527f496e73756666696369656e74204554482062616c616e636520746f206d696e746044820152620204c560ec1b6064820152608401610aff565b601780546001600160a01b0319166001600160a01b0383811691821790925560025460408051630dfe168160e01b815290519190931692630dfe16819160048083019260209291908290030181865afa158015610cd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfb9190613141565b6001600160a01b03161480610d8b57506002546017546040805163d21220a760e01b815290516001600160a01b03938416939092169163d21220a7916004808201926020929091908290030181865afa158015610d5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d809190613141565b6001600160a01b0316145b610dce5760405162461bcd60e51b8152602060048201526014602482015273496e76616c69642070616972206164647265737360601b6044820152606401610aff565b42600490815560175460408051630240bc6b60e21b8152905160009384936001600160a01b031692630902f1ac92818301926060928290030181865afa158015610e1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e40919061317a565b506008546002546001600160701b0393841695509190921692506000916001600160a01b0390811691161015610ef657601954600954604051632b58577b60e21b8152600481019190915260248101849052604481018590526001600160a01b039091169063ad615dec90606401602060405180830381865afa158015610ecb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eef91906131ca565b9050610f78565b601954600954604051632b58577b60e21b8152600481019190915260248101859052604481018490526001600160a01b039091169063ad615dec90606401602060405180830381865afa158015610f51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7591906131ca565b90505b600354604051637527c93d60e11b8152600481018390526001600160a01b039091169063ea4f927a90602401600060405180830381600087803b158015610fbe57600080fd5b505af1158015610fd2573d6000803e3d6000fd5b50506003546004546001600160a01b03909116925063b0aa1e049150610ffb9062093a806131f9565b6040518263ffffffff1660e01b815260040161101991815260200190565b600060405180830381600087803b15801561103357600080fd5b505af1158015611047573d6000803e3d6000fd5b505060025460195460405163095ea7b360e01b81526001600160a01b03918216600482015260248101869052600094509116915063095ea7b3906044016020604051808303816000875af11580156110a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c7919061320c565b9050806110e65760405162461bcd60e51b8152600401610aff9061322e565b601954600954600280546001600160a01b039384169363f305d7199392911690611111908790613256565b606460095430426040518863ffffffff1660e01b81526004016111399695949392919061326d565b60606040518083038185885af193505050508015611174575060408051601f3d908101601f19168201909252611171918101906132a8565b60015b6111c357604080518082018252601b81527f416464696e67206c697175696469747920776173206661696c656400000000006020820152905162461bcd60e51b8152610aff91906004016132fa565b60058190556040805182815242602082015233917fac1d76749e5447b7b16f5ab61447e1bd502f3bb4807af3b28e620d1700a6ee45910160405180910390a25050505050505050565b6060600061122f836001600160a01b03166000908152600a602052604090205490565b905060008167ffffffffffffffff81111561124c5761124c61332d565b6040519080825280602002602001820160405280156112aa57816020015b61129760405180608001604052806000815260200160008152602001600081526020016000151581525090565b81526020019060019003908161126a5790505b50905060005b8281101561134f576001600160a01b0385166000908152600a602052604090208054829081106112e2576112e2613343565b60009182526020918290206040805160808101825260049093029091018054835260018101549383019390935260028301549082015260039091015460ff1615156060820152825183908390811061133c5761133c613343565b60209081029190910101526001016112b0565b509392505050565b6000806000601a60009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156113af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d39190613373565b5050601a546040805163313ce56760e01b815290519395506001600160a01b03909116935063313ce56792600480830193506020928290030181865afa158015611421573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144591906133c5565b60ff169150809250509091565b61145a612a5c565b428110156114aa5760405162461bcd60e51b815260206004820152601f60248201527f496e76616c69642074696d6520666f72207374617274206465706f7369742e006044820152606401610aff565b600681905560405181815233907fa50a5685ad4402dcad428a4b45e0ea75093cf2bf5c0dadf9829fb0aea648ea9690602001610b53565b60008060006114ee612af6565b6004546000036115405760405162461bcd60e51b815260206004820152601b60248201527f4c6971756964697479207761736e2774206c69737465642079657400000000006044820152606401610aff565b346000036115865760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081155120819195c1bdcda5d606a1b6044820152606401610aff565b836000036115ce5760405162461bcd60e51b8152602060048201526015602482015274125b9d985b1a59081d1bdad95b8819195c1bdcda5d605a1b6044820152606401610aff565b6002546115e6906001600160a01b0316333087612a89565b60025460195460405163095ea7b360e01b81526001600160a01b03918216600482015260248101879052600092919091169063095ea7b3906044016020604051808303816000875af1158015611640573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611664919061320c565b9050806116835760405162461bcd60e51b8152600401610aff9061322e565b60195460025460405163f305d71960e01b81526001600160a01b039283169263f305d7199234926116c592909116908a9060649081903090429060040161326d565b60606040518083038185885af193505050508015611700575060408051601f3d908101601f191682019092526116fd918101906132a8565b60015b61174f57604080518082018252601b81527f416464696e67206c697175696469747920776173206661696c656400000000006020820152905162461bcd60e51b8152610aff91906004016132fa565b828811156117785761177833611765858b6133e8565b6002546001600160a01b03169190612b20565b8134111561181e573361178b83346133e8565b6040516188b891906000818181858888f193505050503d80600081146117cd576040519150601f19603f3d011682016040523d82523d6000602084013e6117d2565b606091505b5050809450508361181e5760405162461bcd60e51b81526020600482015260166024820152752330b4b632b2103a37903932b33ab7321022ba3432b960511b6044820152606401610aff565b336000818152600a6020908152604080832081516080810183528781524281850190815281840188815260608301878152845460018082018755958952878920945160049091029094019384559151938301939093559151600282015590516003909101805460ff1916911515919091179055928252600b905290812080548492906118ab9084906131f9565b909155506118bd905033836000612b51565b829650819550809450336001600160a01b03167fac1d76749e5447b7b16f5ab61447e1bd502f3bb4807af3b28e620d1700a6ee45824260405161190a929190918252602082015260400190565b60405180910390a25050505061191f60018055565b9193909250565b61192e612a5c565b6119386000612d13565b565b611942612a5c565b600780549082905560408051828152602081018490524281830152905133917fe0407de8eae531920644bf37bbdf5155a48ebc803a304c405ce88b004b867c73919081900360600190a25050565b611998612a5c565b600f5460ff16156119eb5760405162461bcd60e51b815260206004820152601f60248201527f436c61696d2072657761726420697320656e61626c656420616c7265616479006044820152606401610aff565b600f805460ff1916600117905560405133907f435fb78792a2b47c4dff4e3e8ddcc6ec89af684fd371faaae93f10f6497a2ccc90611a2c9042815260200190565b60405180910390a2565b600080806001600160a01b038416611a875760405162461bcd60e51b8152602060048201526014602482015273496e76616c69642075736572206164647265737360601b6044820152606401610aff565b600c54600003611a9f5750600091508190508061191f565b6000600d54600e54611ab191906133fb565b90506000611ac262015180426133fb565b90506000600d54600c54611ad691906131f9565b6001600160a01b0388166000908152601260205260408120549192509015611b16576001600160a01b038816600090815260126020526040902054611b1a565b600c545b6001600160a01b03891660009081526013602090815260408083205460149092528220549098509650909150828411611b535783611b55565b825b9050815b81811015611cf3576000818152601560209081526040808320815160608101835281548082526001830154948201949094526002909101549181019190915290151580611ba95750602081015115155b15611bbd5780600001519150829850611bcf565b60008981526015602052604090205491505b81600003611bde575050611ceb565b6001600160a01b038c1660009081526010602090815260408083208684528252918290208251606081018452815480825260018301549382019390935260029091015492810192909252151580611c385750602081015115155b15611c695780518390611c4b908b613256565b611c5591906133fb565b611c5f908d6131f9565b9b50839a50611ce7565b6001600160a01b038d1660009081526010602090815260408083208e8452825280832081516060810183528154808252600183015494820194909452600290910154918101919091529103611cc15750505050611ceb565b80518490611ccf908c613256565b611cd991906133fb565b611ce3908e6131f9565b9c50505b5050505b600101611b59565b5050505050509193909250565b600080611d0b612af6565b600454600003611d5d5760405162461bcd60e51b815260206004820152601b60248201527f4c6971756964697479207761736e2774206c69737465642079657400000000006044820152606401610aff565b600454611d6d9062093a806131f9565b421015611dd75760405162461bcd60e51b815260206004820152603260248201527f43616e6e6f742072656d6f7665206c697175696469747920756e74696c20372060448201527164617973206166746572206c697374696e6760701b6064820152608401610aff565b336000908152600a60205260409020548310611e2b5760405162461bcd60e51b8152602060048201526013602482015272496e76616c696420696e6465782076616c756560681b6044820152606401610aff565b336000908152600a60205260408120805485908110611e4c57611e4c613343565b60009182526020909120600490910201600381015490915060ff1615611ebf5760405162461bcd60e51b815260206004820152602260248201527f54686973206c69717569646974792077617320616c72656164792072656d6f76604482015261195960f21b6064820152608401610aff565b60038101805460ff191660011790558054336000908152600b602052604081208054909190611eef9084906133e8565b9091555050600281015460009015611f0c57506002810154611f8b565b600554600003611f6c5760405162461bcd60e51b815260206004820152602560248201527f5468657265206973206e6f206c697175696469747920696e2074686520636f6e6044820152641d1c9858dd60da1b6064820152608401610aff565b6009548254600554611f7e9190613256565b611f8891906133fb565b90505b60175460195460405163095ea7b360e01b81526001600160a01b03918216600482015260248101849052600092919091169063095ea7b3906044016020604051808303816000875af1158015611fe5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612009919061320c565b9050806120285760405162461bcd60e51b8152600401610aff9061322e565b601954600254604051629d473b60e21b81526001600160a01b03928316926302751cec9261206692911690869060649081903390429060040161326d565b60408051808303816000875af1158015612084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a8919061341d565b845491965094506120bc9033906001612b51565b604080518381526020810187905290810185905242606082015233907f8598e6b147330d38243f9c4cd33d61e208b9015719e977086fa42a0f73b1462b9060800160405180910390a250505061211160018055565b915091565b61211e612a5c565b6001600160a01b0381166121845760405162461bcd60e51b815260206004820152602760248201527f436f6e747261637420616464726573732063616e6e6f74206265207a65726f206044820152666164647265737360c81b6064820152608401610aff565b600380546001600160a01b0319166001600160a01b0383169081179091556040805191825242602083015233917f756385748ba24e5ab4d1643f22cd0ae4c173b02757457d36eb25c592aea6cd7b9101610b53565b600f5460ff166122365760405162461bcd60e51b815260206004820152602260248201527f436c61696d696e6720726577617264206973206e6f7420656e61626c65642079604482015261195d60f21b6064820152608401610aff565b6000600654116122885760405162461bcd60e51b815260206004820152601a60248201527f496e76616c6964206465706f7369742073746172742074696d650000000000006044820152606401610aff565b6000600c54116122d65760405162461bcd60e51b8152602060048201526019602482015278496e76616c6964207265776172642073746172742074696d6560381b6044820152606401610aff565b600c546122e662015180426133fb565b116123335760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206461746520746f20636c61696d20726577617264000000006044820152606401610aff565b61233c336109ec565b600080600061234a33611a36565b91945092509050821561236e5760025461236e906001600160a01b03163385612b20565b61237b62015180426133fb565b33600090815260126020908152604080832093909355601381528282209490945560149093529091205550565b6001600160a01b0382166000908152600a60205260408120805482918291829190869081106123d9576123d9613343565b6000918252602090912060049091020180546001820154600390920154909891975060ff1695509350505050565b61240f612a5c565b6006546000036124615760405162461bcd60e51b815260206004820181905260248201527f4465706f7369742073746172742074696d652073686f756c64206265207365746044820152606401610aff565b826000036124ad5760405162461bcd60e51b8152602060048201526019602482015278496e76616c6964207265776172642073746172742074696d6560381b6044820152606401610aff565b60065483101561250b5760405162461bcd60e51b815260206004820152602360248201527f43616e6e6f74206265206265666f7265206465706f7369742073746172742074604482015262696d6560e81b6064820152608401610aff565b816000036125535760405162461bcd60e51b8152602060048201526015602482015274125b9d985b1a59081c995dd85c99081c195c9a5bd9605a1b6044820152606401610aff565b806000036125a35760405162461bcd60e51b815260206004820152601b60248201527f496e76616c69642072657761726420746f6b656e20616d6f756e7400000000006044820152606401610aff565b6125b062015180846133fb565b600c556006546000906125c79062015180906133fb565b600c5460009081526015602052604090209091505b600c548211612650576000828152601560208181526040808420815160608101835281548082526001830154828601526002909201549281019290925293869052919052901561263f578051825560208101516001830155604081015160028301555b61264883613441565b9250506125dc565b600d849055600e839055600c546040805191825260208201869052810184905242606082015233907f91971b8d63b004c0eb5e034d601797eb8bfdfed179e56b6234c25192ac2c908e9060800160405180910390a25050505050565b6126b4612a5c565b6001600160a01b0381166126de57604051631e4fbdf760e01b815260006004820152602401610aff565b6126e781612d13565b50565b6126f2612af6565b600454156127425760405162461bcd60e51b815260206004820152601c60248201527f4c69717569646974792077617320616c7265616479206c6973746564000000006044820152606401610aff565b600034116127895760405162461bcd60e51b8152602060048201526014602482015273086c2dcdcdee840c8cae0dee6d2e84060408aa8960631b6044820152606401610aff565b6006541580159061279c57506006544210155b6127e85760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974206973206e6f7420616c6c6f77656420666f72206e6f7700006044820152606401610aff565b6007541561285a5760075434101561285a5760405162461bcd60e51b815260206004820152602f60248201527f496e73756666696369656e74206465706f73697420616d6f756e7420666f722060448201526e1b5a5b9a5b5d5b48185b1b1bddd959608a1b6064820152608401610aff565b60008060006128693334612d63565b925092509250826128e25760405162461bcd60e51b815260206004820152603f60248201527f596f7520646f6e277420686176652073756666696369656e7420636c61696d6160448201527f626c6520746f6b656e20616d6f756e7420746f206465706f73697420455448006064820152608401610aff565b6003546001600160a01b03166361aec1e0336128fe84866133e8565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561294457600080fd5b505af1158015612958573d6000803e3d6000fd5b5050336000818152600a602090815260408083208151608081018352348082524282860190815282850187815260608401888152855460018082018855968a52888a20955160049091029095019485559151948401949094559251600283015591516003909101805460ff1916911515919091179055938352600b909152812080549294509250906129eb9084906131f9565b925050819055503460096000828254612a0491906131f9565b90915550612a16905033346000612b51565b6040805134815242602082015233917f73a19dd210f1a7f902193214c0ee91dd35ee5b4d920cba8d519eca65a7b488ca910160405180910390a250505061193860018055565b6000546001600160a01b031633146119385760405163118cdaa760e01b8152336004820152602401610aff565b6040516001600160a01b038481166024830152838116604483015260648201839052612af09186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050612e8e565b50505050565b600260015403612b1957604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b6040516001600160a01b03838116602483015260448201839052610aae91859182169063a9059cbb90606401612abe565b6000612b6062015180426133fb565b6001600160a01b038516600081815260106020908152604080832085845282528083209383526011909152902054919250908214612bd7576001600160a01b038516600090815260116020908152604080832054601083528184208185529092529091208054835560018301919091556002018290555b60008281526015602052604090206016548314612c125760168054600090815260156020526040902080548355905460018301556002018390555b8315612c505784826000016000828254612c2c91906133e8565b9091555050805485908290600090612c459084906133e8565b90915550612c839050565b84826000016000828254612c6491906131f9565b9091555050805485908290600090612c7d9084906131f9565b90915550505b6001600160a01b03861660009081526011602052604090208390556016839055600c548311612d0b576001600160a01b0386166000908152601060209081526040808320600c80548552908352818420865481556001808801548183015560029182018690559154855260159093529220835481558383015492810192909255828101549101555b505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600354600090819081906001600160a01b0316612dda5760405162461bcd60e51b815260206004820152602f60248201527f5468652061646472657373206f6620636c61696d696e6720636f6e747261637460448201526e2063616e6e6f74206265207a65726f60881b6064820152608401610aff565b600080612de5611357565b9092509050612df581600a613541565b612dff8388613256565b612e0991906133fb565b600354604051630835fe4760e01b81526001600160a01b038a81166004830152929550911690630835fe4790602401606060405180830381865afa158015612e55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7991906132a8565b858110159a9099509497509395505050505050565b6000612ea36001600160a01b03841683612ef1565b90508051600014158015612ec8575080806020019051810190612ec6919061320c565b155b15610aae57604051635274afe760e01b81526001600160a01b0384166004820152602401610aff565b6060612eff83836000612f08565b90505b92915050565b606081471015612f345760405163cf47918160e01b815247600482015260248101839052604401610aff565b600080856001600160a01b03168486604051612f50919061354d565b60006040518083038185875af1925050503d8060008114612f8d576040519150601f19603f3d011682016040523d82523d6000602084013e612f92565b606091505b5091509150612fa2868383612fae565b925050505b9392505050565b606082612fc357612fbe8261300a565b612fa7565b8151158015612fda57506001600160a01b0384163b155b1561300357604051639996b31560e01b81526001600160a01b0385166004820152602401610aff565b5080612fa7565b80511561301a5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6001600160a01b03811681146126e757600080fd5b60006020828403121561305a57600080fd5b8135612fa781613033565b6000806040838503121561307857600080fd5b823561308381613033565b946020939093013593505050565b6000602082840312156130a357600080fd5b5035919050565b602080825282518282018190526000918401906040840190835b8181101561310a578351805184526020810151602085015260408101516040850152606081015115156060850152506080830192506020840193506001810190506130c4565b509095945050505050565b60008060006060848603121561312a57600080fd5b505081359360208301359350604090920135919050565b60006020828403121561315357600080fd5b8151612fa781613033565b80516001600160701b038116811461317557600080fd5b919050565b60008060006060848603121561318f57600080fd5b6131988461315e565b92506131a66020850161315e565b9150604084015163ffffffff811681146131bf57600080fd5b809150509250925092565b6000602082840312156131dc57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115612f0257612f026131e3565b60006020828403121561321e57600080fd5b81518015158114612fa757600080fd5b6020808252600e908201526d105c1c1c9bdd994819985a5b195960921b604082015260600190565b8082028115828204841417612f0257612f026131e3565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b6000806000606084860312156132bd57600080fd5b5050815160208301516040909301519094929350919050565b60005b838110156132f15781810151838201526020016132d9565b50506000910152565b60208152600082518060208401526133198160408501602087016132d6565b601f01601f19169190910160400192915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b805169ffffffffffffffffffff8116811461317557600080fd5b600080600080600060a0868803121561338b57600080fd5b61339486613359565b602087015160408801516060890151929750909550935091506133b960808701613359565b90509295509295909350565b6000602082840312156133d757600080fd5b815160ff81168114612fa757600080fd5b81810381811115612f0257612f026131e3565b60008261341857634e487b7160e01b600052601260045260246000fd5b500490565b6000806040838503121561343057600080fd5b505080516020909101519092909150565b600060018201613453576134536131e3565b5060010190565b6001815b600184111561349557808504811115613479576134796131e3565b600184161561348757908102905b60019390931c92800261345e565b935093915050565b6000826134ac57506001612f02565b816134b957506000612f02565b81600181146134cf57600281146134d9576134f5565b6001915050612f02565b60ff8411156134ea576134ea6131e3565b50506001821b612f02565b5060208310610133831016604e8410600b8410161715613518575081810a612f02565b613525600019848461345a565b8060001904821115613539576135396131e3565b029392505050565b6000612eff838361349d565b6000825161355f8184602087016132d6565b919091019291505056fea26469706673582212206947e2c75efc5e7a65ff356d342c83488ba77c3f5713e444321551c0d895cbc764736f6c634300081a00330000000000000000000000005484581038cbf8ef33b7f6daec7a2f01f71db3c20000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b84190000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d

Deployed Bytecode

0x6080604052600436106102885760003560e01c80637bfa37e11161015a578063ad5c4648116100c1578063d9c146de1161007a578063d9c146de14610919578063dc713a481461092f578063e88dc5b714610945578063f2fde38b1461095b578063f6326fb31461097b578063fc0c546a1461098357600080fd5b8063ad5c464814610813578063af238ba514610833578063b88a802f14610860578063b935088b14610875578063c0806b03146108bc578063d4a86a40146108f957600080fd5b80639295953f116101135780639295953f1461073057806396ee87821461075d5780639c8f9f231461077d5780639ce696791461079d578063a4c828dc146107bd578063a8aa1b31146107f357600080fd5b80637bfa37e1146106685780637d8820971461067e578063833b3a6c1461069457806383c73126146106a95780638c983567146106e55780638da5cb5b1461071257600080fd5b806335dac638116101fe57806358cf4643116101b757806358cf46431461055d57806359d0f713146105c757806365a6cf11146105e7578063715018a61461061d57806372d970a314610632578063750142e61461065257600080fd5b806335dac6381461044c5780634007b92914610479578063413d5056146104a357806350f2bc5a146104c357806351c6590a146104d957806351f9c87c1461050757600080fd5b80630e37d869116102505780630e37d8691461037f5780631694505e146103a957806316c621e0146103c9578063184a22d1146103e9578063265900e8146103ff57806329d7157e1461041f57600080fd5b80630539272a1461028d578063057e2c40146102b657806308f43333146102e35780630d26ad9c146103255780630defc08a14610347575b600080fd5b34801561029957600080fd5b506102a3600c5481565b6040519081526020015b60405180910390f35b3480156102c257600080fd5b506102a36102d1366004613048565b60146020526000908152604090205481565b3480156102ef57600080fd5b506103036102fe366004613065565b6109a3565b60408051948552602085019390935291830152151560608201526080016102ad565b34801561033157600080fd5b50610345610340366004613048565b6109ec565b005b34801561035357600080fd5b50600354610367906001600160a01b031681565b6040516001600160a01b0390911681526020016102ad565b34801561038b57600080fd5b50600f546103999060ff1681565b60405190151581526020016102ad565b3480156103b557600080fd5b50601954610367906001600160a01b031681565b3480156103d557600080fd5b506103456103e4366004613091565b610ab4565b3480156103f557600080fd5b506102a360075481565b34801561040b57600080fd5b5061034561041a366004613048565b610b5e565b34801561042b57600080fd5b506102a361043a366004613048565b60136020526000908152604090205481565b34801561045857600080fd5b5061046c610467366004613048565b61120c565b6040516102ad91906130aa565b34801561048557600080fd5b5061048e611357565b604080519283526020830191909152016102ad565b3480156104af57600080fd5b506103456104be366004613091565b611452565b3480156104cf57600080fd5b506102a360165481565b6104ec6104e7366004613091565b6114e1565b604080519384526020840192909252908201526060016102ad565b34801561051357600080fd5b506104ec610522366004613091565b600090815260156020908152604091829020825160608101845281548082526001830154938201849052600290920154930183905292909190565b34801561056957600080fd5b506104ec610578366004613065565b6001600160a01b03909116600090815260106020908152604080832093835292815290829020825160608101845281548082526001830154938201849052600290920154930183905292909190565b3480156105d357600080fd5b50601854610367906001600160a01b031681565b3480156105f357600080fd5b506102a3610602366004613048565b6001600160a01b03166000908152600a602052604090205490565b34801561062957600080fd5b50610345611926565b34801561063e57600080fd5b5061034561064d366004613091565b61193a565b34801561065e57600080fd5b506102a3600e5481565b34801561067457600080fd5b506102a360055481565b34801561068a57600080fd5b506102a360095481565b3480156106a057600080fd5b50610345611990565b3480156106b557600080fd5b506104ec6106c4366004613091565b60156020526000908152604090208054600182015460029092015490919083565b3480156106f157600080fd5b506102a3610700366004613048565b60126020526000908152604090205481565b34801561071e57600080fd5b506000546001600160a01b0316610367565b34801561073c57600080fd5b506102a361074b366004613048565b600b6020526000908152604090205481565b34801561076957600080fd5b506104ec610778366004613048565b611a36565b34801561078957600080fd5b5061048e610798366004613091565b611d00565b3480156107a957600080fd5b506103456107b8366004613048565b612116565b3480156107c957600080fd5b506102a36107d8366004613048565b6001600160a01b03166000908152600b602052604090205490565b3480156107ff57600080fd5b50601754610367906001600160a01b031681565b34801561081f57600080fd5b50600854610367906001600160a01b031681565b34801561083f57600080fd5b506102a361084e366004613048565b60116020526000908152604090205481565b34801561086c57600080fd5b506103456121d9565b34801561088157600080fd5b506104ec610890366004613065565b601060209081526000928352604080842090915290825290208054600182015460029092015490919083565b3480156108c857600080fd5b506108dc6108d7366004613065565b6123a8565b6040805193845260208401929092521515908201526060016102ad565b34801561090557600080fd5b50610345610914366004613115565b612407565b34801561092557600080fd5b506102a360065481565b34801561093b57600080fd5b506102a360045481565b34801561095157600080fd5b506102a3600d5481565b34801561096757600080fd5b50610345610976366004613048565b6126ac565b6103456126ea565b34801561098f57600080fd5b50600254610367906001600160a01b031681565b600a60205281600052604060002081815481106109bf57600080fd5b60009182526020909120600490910201805460018201546002830154600390930154919450925060ff1684565b6001600160a01b0381166000818152601060209081526040808320600c54845282528083209383526012909152902054158015610a2857508054155b15610ab05760005b600c548111610aae576001600160a01b03831660009081526010602090815260408083208484528252918290208251606081018452815480825260018084015494830185905260029384015495830186905290875586019290925584018290559015610aa25780604001519150610aa8565b50610aae565b50610a30565b505b5050565b610abc612a5c565b80600003610b085760405162461bcd60e51b8152602060048201526014602482015273125b9d985b1a59081d1bdad95b88185b5bdd5b9d60621b60448201526064015b60405180910390fd5b600254610b20906001600160a01b0316333084612a89565b6040805182815242602082015233917f9f77c8cccc840812886a42aaa64dbd4b1145c9392e0c3fa498206caa5d4faba591015b60405180910390a250565b610b66612a5c565b60045415610bb65760405162461bcd60e51b815260206004820152601c60248201527f4c69717569646974792077617320616c7265616479206c6973746564000000006044820152606401610aff565b6002546001600160a01b0316610c185760405162461bcd60e51b815260206004820152602160248201527f53616c6520746f6b656e20616464726573732063616e6e6f74206265207a65726044820152606f60f81b6064820152608401610aff565b600954600003610c765760405162461bcd60e51b815260206004820152602360248201527f496e73756666696369656e74204554482062616c616e636520746f206d696e746044820152620204c560ec1b6064820152608401610aff565b601780546001600160a01b0319166001600160a01b0383811691821790925560025460408051630dfe168160e01b815290519190931692630dfe16819160048083019260209291908290030181865afa158015610cd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfb9190613141565b6001600160a01b03161480610d8b57506002546017546040805163d21220a760e01b815290516001600160a01b03938416939092169163d21220a7916004808201926020929091908290030181865afa158015610d5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d809190613141565b6001600160a01b0316145b610dce5760405162461bcd60e51b8152602060048201526014602482015273496e76616c69642070616972206164647265737360601b6044820152606401610aff565b42600490815560175460408051630240bc6b60e21b8152905160009384936001600160a01b031692630902f1ac92818301926060928290030181865afa158015610e1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e40919061317a565b506008546002546001600160701b0393841695509190921692506000916001600160a01b0390811691161015610ef657601954600954604051632b58577b60e21b8152600481019190915260248101849052604481018590526001600160a01b039091169063ad615dec90606401602060405180830381865afa158015610ecb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eef91906131ca565b9050610f78565b601954600954604051632b58577b60e21b8152600481019190915260248101859052604481018490526001600160a01b039091169063ad615dec90606401602060405180830381865afa158015610f51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7591906131ca565b90505b600354604051637527c93d60e11b8152600481018390526001600160a01b039091169063ea4f927a90602401600060405180830381600087803b158015610fbe57600080fd5b505af1158015610fd2573d6000803e3d6000fd5b50506003546004546001600160a01b03909116925063b0aa1e049150610ffb9062093a806131f9565b6040518263ffffffff1660e01b815260040161101991815260200190565b600060405180830381600087803b15801561103357600080fd5b505af1158015611047573d6000803e3d6000fd5b505060025460195460405163095ea7b360e01b81526001600160a01b03918216600482015260248101869052600094509116915063095ea7b3906044016020604051808303816000875af11580156110a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c7919061320c565b9050806110e65760405162461bcd60e51b8152600401610aff9061322e565b601954600954600280546001600160a01b039384169363f305d7199392911690611111908790613256565b606460095430426040518863ffffffff1660e01b81526004016111399695949392919061326d565b60606040518083038185885af193505050508015611174575060408051601f3d908101601f19168201909252611171918101906132a8565b60015b6111c357604080518082018252601b81527f416464696e67206c697175696469747920776173206661696c656400000000006020820152905162461bcd60e51b8152610aff91906004016132fa565b60058190556040805182815242602082015233917fac1d76749e5447b7b16f5ab61447e1bd502f3bb4807af3b28e620d1700a6ee45910160405180910390a25050505050505050565b6060600061122f836001600160a01b03166000908152600a602052604090205490565b905060008167ffffffffffffffff81111561124c5761124c61332d565b6040519080825280602002602001820160405280156112aa57816020015b61129760405180608001604052806000815260200160008152602001600081526020016000151581525090565b81526020019060019003908161126a5790505b50905060005b8281101561134f576001600160a01b0385166000908152600a602052604090208054829081106112e2576112e2613343565b60009182526020918290206040805160808101825260049093029091018054835260018101549383019390935260028301549082015260039091015460ff1615156060820152825183908390811061133c5761133c613343565b60209081029190910101526001016112b0565b509392505050565b6000806000601a60009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa1580156113af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d39190613373565b5050601a546040805163313ce56760e01b815290519395506001600160a01b03909116935063313ce56792600480830193506020928290030181865afa158015611421573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144591906133c5565b60ff169150809250509091565b61145a612a5c565b428110156114aa5760405162461bcd60e51b815260206004820152601f60248201527f496e76616c69642074696d6520666f72207374617274206465706f7369742e006044820152606401610aff565b600681905560405181815233907fa50a5685ad4402dcad428a4b45e0ea75093cf2bf5c0dadf9829fb0aea648ea9690602001610b53565b60008060006114ee612af6565b6004546000036115405760405162461bcd60e51b815260206004820152601b60248201527f4c6971756964697479207761736e2774206c69737465642079657400000000006044820152606401610aff565b346000036115865760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081155120819195c1bdcda5d606a1b6044820152606401610aff565b836000036115ce5760405162461bcd60e51b8152602060048201526015602482015274125b9d985b1a59081d1bdad95b8819195c1bdcda5d605a1b6044820152606401610aff565b6002546115e6906001600160a01b0316333087612a89565b60025460195460405163095ea7b360e01b81526001600160a01b03918216600482015260248101879052600092919091169063095ea7b3906044016020604051808303816000875af1158015611640573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611664919061320c565b9050806116835760405162461bcd60e51b8152600401610aff9061322e565b60195460025460405163f305d71960e01b81526001600160a01b039283169263f305d7199234926116c592909116908a9060649081903090429060040161326d565b60606040518083038185885af193505050508015611700575060408051601f3d908101601f191682019092526116fd918101906132a8565b60015b61174f57604080518082018252601b81527f416464696e67206c697175696469747920776173206661696c656400000000006020820152905162461bcd60e51b8152610aff91906004016132fa565b828811156117785761177833611765858b6133e8565b6002546001600160a01b03169190612b20565b8134111561181e573361178b83346133e8565b6040516188b891906000818181858888f193505050503d80600081146117cd576040519150601f19603f3d011682016040523d82523d6000602084013e6117d2565b606091505b5050809450508361181e5760405162461bcd60e51b81526020600482015260166024820152752330b4b632b2103a37903932b33ab7321022ba3432b960511b6044820152606401610aff565b336000818152600a6020908152604080832081516080810183528781524281850190815281840188815260608301878152845460018082018755958952878920945160049091029094019384559151938301939093559151600282015590516003909101805460ff1916911515919091179055928252600b905290812080548492906118ab9084906131f9565b909155506118bd905033836000612b51565b829650819550809450336001600160a01b03167fac1d76749e5447b7b16f5ab61447e1bd502f3bb4807af3b28e620d1700a6ee45824260405161190a929190918252602082015260400190565b60405180910390a25050505061191f60018055565b9193909250565b61192e612a5c565b6119386000612d13565b565b611942612a5c565b600780549082905560408051828152602081018490524281830152905133917fe0407de8eae531920644bf37bbdf5155a48ebc803a304c405ce88b004b867c73919081900360600190a25050565b611998612a5c565b600f5460ff16156119eb5760405162461bcd60e51b815260206004820152601f60248201527f436c61696d2072657761726420697320656e61626c656420616c7265616479006044820152606401610aff565b600f805460ff1916600117905560405133907f435fb78792a2b47c4dff4e3e8ddcc6ec89af684fd371faaae93f10f6497a2ccc90611a2c9042815260200190565b60405180910390a2565b600080806001600160a01b038416611a875760405162461bcd60e51b8152602060048201526014602482015273496e76616c69642075736572206164647265737360601b6044820152606401610aff565b600c54600003611a9f5750600091508190508061191f565b6000600d54600e54611ab191906133fb565b90506000611ac262015180426133fb565b90506000600d54600c54611ad691906131f9565b6001600160a01b0388166000908152601260205260408120549192509015611b16576001600160a01b038816600090815260126020526040902054611b1a565b600c545b6001600160a01b03891660009081526013602090815260408083205460149092528220549098509650909150828411611b535783611b55565b825b9050815b81811015611cf3576000818152601560209081526040808320815160608101835281548082526001830154948201949094526002909101549181019190915290151580611ba95750602081015115155b15611bbd5780600001519150829850611bcf565b60008981526015602052604090205491505b81600003611bde575050611ceb565b6001600160a01b038c1660009081526010602090815260408083208684528252918290208251606081018452815480825260018301549382019390935260029091015492810192909252151580611c385750602081015115155b15611c695780518390611c4b908b613256565b611c5591906133fb565b611c5f908d6131f9565b9b50839a50611ce7565b6001600160a01b038d1660009081526010602090815260408083208e8452825280832081516060810183528154808252600183015494820194909452600290910154918101919091529103611cc15750505050611ceb565b80518490611ccf908c613256565b611cd991906133fb565b611ce3908e6131f9565b9c50505b5050505b600101611b59565b5050505050509193909250565b600080611d0b612af6565b600454600003611d5d5760405162461bcd60e51b815260206004820152601b60248201527f4c6971756964697479207761736e2774206c69737465642079657400000000006044820152606401610aff565b600454611d6d9062093a806131f9565b421015611dd75760405162461bcd60e51b815260206004820152603260248201527f43616e6e6f742072656d6f7665206c697175696469747920756e74696c20372060448201527164617973206166746572206c697374696e6760701b6064820152608401610aff565b336000908152600a60205260409020548310611e2b5760405162461bcd60e51b8152602060048201526013602482015272496e76616c696420696e6465782076616c756560681b6044820152606401610aff565b336000908152600a60205260408120805485908110611e4c57611e4c613343565b60009182526020909120600490910201600381015490915060ff1615611ebf5760405162461bcd60e51b815260206004820152602260248201527f54686973206c69717569646974792077617320616c72656164792072656d6f76604482015261195960f21b6064820152608401610aff565b60038101805460ff191660011790558054336000908152600b602052604081208054909190611eef9084906133e8565b9091555050600281015460009015611f0c57506002810154611f8b565b600554600003611f6c5760405162461bcd60e51b815260206004820152602560248201527f5468657265206973206e6f206c697175696469747920696e2074686520636f6e6044820152641d1c9858dd60da1b6064820152608401610aff565b6009548254600554611f7e9190613256565b611f8891906133fb565b90505b60175460195460405163095ea7b360e01b81526001600160a01b03918216600482015260248101849052600092919091169063095ea7b3906044016020604051808303816000875af1158015611fe5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612009919061320c565b9050806120285760405162461bcd60e51b8152600401610aff9061322e565b601954600254604051629d473b60e21b81526001600160a01b03928316926302751cec9261206692911690869060649081903390429060040161326d565b60408051808303816000875af1158015612084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a8919061341d565b845491965094506120bc9033906001612b51565b604080518381526020810187905290810185905242606082015233907f8598e6b147330d38243f9c4cd33d61e208b9015719e977086fa42a0f73b1462b9060800160405180910390a250505061211160018055565b915091565b61211e612a5c565b6001600160a01b0381166121845760405162461bcd60e51b815260206004820152602760248201527f436f6e747261637420616464726573732063616e6e6f74206265207a65726f206044820152666164647265737360c81b6064820152608401610aff565b600380546001600160a01b0319166001600160a01b0383169081179091556040805191825242602083015233917f756385748ba24e5ab4d1643f22cd0ae4c173b02757457d36eb25c592aea6cd7b9101610b53565b600f5460ff166122365760405162461bcd60e51b815260206004820152602260248201527f436c61696d696e6720726577617264206973206e6f7420656e61626c65642079604482015261195d60f21b6064820152608401610aff565b6000600654116122885760405162461bcd60e51b815260206004820152601a60248201527f496e76616c6964206465706f7369742073746172742074696d650000000000006044820152606401610aff565b6000600c54116122d65760405162461bcd60e51b8152602060048201526019602482015278496e76616c6964207265776172642073746172742074696d6560381b6044820152606401610aff565b600c546122e662015180426133fb565b116123335760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206461746520746f20636c61696d20726577617264000000006044820152606401610aff565b61233c336109ec565b600080600061234a33611a36565b91945092509050821561236e5760025461236e906001600160a01b03163385612b20565b61237b62015180426133fb565b33600090815260126020908152604080832093909355601381528282209490945560149093529091205550565b6001600160a01b0382166000908152600a60205260408120805482918291829190869081106123d9576123d9613343565b6000918252602090912060049091020180546001820154600390920154909891975060ff1695509350505050565b61240f612a5c565b6006546000036124615760405162461bcd60e51b815260206004820181905260248201527f4465706f7369742073746172742074696d652073686f756c64206265207365746044820152606401610aff565b826000036124ad5760405162461bcd60e51b8152602060048201526019602482015278496e76616c6964207265776172642073746172742074696d6560381b6044820152606401610aff565b60065483101561250b5760405162461bcd60e51b815260206004820152602360248201527f43616e6e6f74206265206265666f7265206465706f7369742073746172742074604482015262696d6560e81b6064820152608401610aff565b816000036125535760405162461bcd60e51b8152602060048201526015602482015274125b9d985b1a59081c995dd85c99081c195c9a5bd9605a1b6044820152606401610aff565b806000036125a35760405162461bcd60e51b815260206004820152601b60248201527f496e76616c69642072657761726420746f6b656e20616d6f756e7400000000006044820152606401610aff565b6125b062015180846133fb565b600c556006546000906125c79062015180906133fb565b600c5460009081526015602052604090209091505b600c548211612650576000828152601560208181526040808420815160608101835281548082526001830154828601526002909201549281019290925293869052919052901561263f578051825560208101516001830155604081015160028301555b61264883613441565b9250506125dc565b600d849055600e839055600c546040805191825260208201869052810184905242606082015233907f91971b8d63b004c0eb5e034d601797eb8bfdfed179e56b6234c25192ac2c908e9060800160405180910390a25050505050565b6126b4612a5c565b6001600160a01b0381166126de57604051631e4fbdf760e01b815260006004820152602401610aff565b6126e781612d13565b50565b6126f2612af6565b600454156127425760405162461bcd60e51b815260206004820152601c60248201527f4c69717569646974792077617320616c7265616479206c6973746564000000006044820152606401610aff565b600034116127895760405162461bcd60e51b8152602060048201526014602482015273086c2dcdcdee840c8cae0dee6d2e84060408aa8960631b6044820152606401610aff565b6006541580159061279c57506006544210155b6127e85760405162461bcd60e51b815260206004820152601e60248201527f4465706f736974206973206e6f7420616c6c6f77656420666f72206e6f7700006044820152606401610aff565b6007541561285a5760075434101561285a5760405162461bcd60e51b815260206004820152602f60248201527f496e73756666696369656e74206465706f73697420616d6f756e7420666f722060448201526e1b5a5b9a5b5d5b48185b1b1bddd959608a1b6064820152608401610aff565b60008060006128693334612d63565b925092509250826128e25760405162461bcd60e51b815260206004820152603f60248201527f596f7520646f6e277420686176652073756666696369656e7420636c61696d6160448201527f626c6520746f6b656e20616d6f756e7420746f206465706f73697420455448006064820152608401610aff565b6003546001600160a01b03166361aec1e0336128fe84866133e8565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561294457600080fd5b505af1158015612958573d6000803e3d6000fd5b5050336000818152600a602090815260408083208151608081018352348082524282860190815282850187815260608401888152855460018082018855968a52888a20955160049091029095019485559151948401949094559251600283015591516003909101805460ff1916911515919091179055938352600b909152812080549294509250906129eb9084906131f9565b925050819055503460096000828254612a0491906131f9565b90915550612a16905033346000612b51565b6040805134815242602082015233917f73a19dd210f1a7f902193214c0ee91dd35ee5b4d920cba8d519eca65a7b488ca910160405180910390a250505061193860018055565b6000546001600160a01b031633146119385760405163118cdaa760e01b8152336004820152602401610aff565b6040516001600160a01b038481166024830152838116604483015260648201839052612af09186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050612e8e565b50505050565b600260015403612b1957604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b6040516001600160a01b03838116602483015260448201839052610aae91859182169063a9059cbb90606401612abe565b6000612b6062015180426133fb565b6001600160a01b038516600081815260106020908152604080832085845282528083209383526011909152902054919250908214612bd7576001600160a01b038516600090815260116020908152604080832054601083528184208185529092529091208054835560018301919091556002018290555b60008281526015602052604090206016548314612c125760168054600090815260156020526040902080548355905460018301556002018390555b8315612c505784826000016000828254612c2c91906133e8565b9091555050805485908290600090612c459084906133e8565b90915550612c839050565b84826000016000828254612c6491906131f9565b9091555050805485908290600090612c7d9084906131f9565b90915550505b6001600160a01b03861660009081526011602052604090208390556016839055600c548311612d0b576001600160a01b0386166000908152601060209081526040808320600c80548552908352818420865481556001808801548183015560029182018690559154855260159093529220835481558383015492810192909255828101549101555b505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600354600090819081906001600160a01b0316612dda5760405162461bcd60e51b815260206004820152602f60248201527f5468652061646472657373206f6620636c61696d696e6720636f6e747261637460448201526e2063616e6e6f74206265207a65726f60881b6064820152608401610aff565b600080612de5611357565b9092509050612df581600a613541565b612dff8388613256565b612e0991906133fb565b600354604051630835fe4760e01b81526001600160a01b038a81166004830152929550911690630835fe4790602401606060405180830381865afa158015612e55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7991906132a8565b858110159a9099509497509395505050505050565b6000612ea36001600160a01b03841683612ef1565b90508051600014158015612ec8575080806020019051810190612ec6919061320c565b155b15610aae57604051635274afe760e01b81526001600160a01b0384166004820152602401610aff565b6060612eff83836000612f08565b90505b92915050565b606081471015612f345760405163cf47918160e01b815247600482015260248101839052604401610aff565b600080856001600160a01b03168486604051612f50919061354d565b60006040518083038185875af1925050503d8060008114612f8d576040519150601f19603f3d011682016040523d82523d6000602084013e612f92565b606091505b5091509150612fa2868383612fae565b925050505b9392505050565b606082612fc357612fbe8261300a565b612fa7565b8151158015612fda57506001600160a01b0384163b155b1561300357604051639996b31560e01b81526001600160a01b0385166004820152602401610aff565b5080612fa7565b80511561301a5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b6001600160a01b03811681146126e757600080fd5b60006020828403121561305a57600080fd5b8135612fa781613033565b6000806040838503121561307857600080fd5b823561308381613033565b946020939093013593505050565b6000602082840312156130a357600080fd5b5035919050565b602080825282518282018190526000918401906040840190835b8181101561310a578351805184526020810151602085015260408101516040850152606081015115156060850152506080830192506020840193506001810190506130c4565b509095945050505050565b60008060006060848603121561312a57600080fd5b505081359360208301359350604090920135919050565b60006020828403121561315357600080fd5b8151612fa781613033565b80516001600160701b038116811461317557600080fd5b919050565b60008060006060848603121561318f57600080fd5b6131988461315e565b92506131a66020850161315e565b9150604084015163ffffffff811681146131bf57600080fd5b809150509250925092565b6000602082840312156131dc57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b80820180821115612f0257612f026131e3565b60006020828403121561321e57600080fd5b81518015158114612fa757600080fd5b6020808252600e908201526d105c1c1c9bdd994819985a5b195960921b604082015260600190565b8082028115828204841417612f0257612f026131e3565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b6000806000606084860312156132bd57600080fd5b5050815160208301516040909301519094929350919050565b60005b838110156132f15781810151838201526020016132d9565b50506000910152565b60208152600082518060208401526133198160408501602087016132d6565b601f01601f19169190910160400192915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b805169ffffffffffffffffffff8116811461317557600080fd5b600080600080600060a0868803121561338b57600080fd5b61339486613359565b602087015160408801516060890151929750909550935091506133b960808701613359565b90509295509295909350565b6000602082840312156133d757600080fd5b815160ff81168114612fa757600080fd5b81810381811115612f0257612f026131e3565b60008261341857634e487b7160e01b600052601260045260246000fd5b500490565b6000806040838503121561343057600080fd5b505080516020909101519092909150565b600060018201613453576134536131e3565b5060010190565b6001815b600184111561349557808504811115613479576134796131e3565b600184161561348757908102905b60019390931c92800261345e565b935093915050565b6000826134ac57506001612f02565b816134b957506000612f02565b81600181146134cf57600281146134d9576134f5565b6001915050612f02565b60ff8411156134ea576134ea6131e3565b50506001821b612f02565b5060208310610133831016604e8410600b8410161715613518575081810a612f02565b613525600019848461345a565b8060001904821115613539576135396131e3565b029392505050565b6000612eff838361349d565b6000825161355f8184602087016132d6565b919091019291505056fea26469706673582212206947e2c75efc5e7a65ff356d342c83488ba77c3f5713e444321551c0d895cbc764736f6c634300081a0033

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

0000000000000000000000005484581038cbf8ef33b7f6daec7a2f01f71db3c20000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b84190000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d

-----Decoded View---------------
Arg [0] : _token (address): 0x5484581038cBf8EF33B7F6daEc7A2f01f71DB3C2
Arg [1] : _chainlinkETHUSDAddress (address): 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419
Arg [2] : _uniswapV2Factory (address): 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f
Arg [3] : _uniswapV2Router (address): 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000005484581038cbf8ef33b7f6daec7a2f01f71db3c2
Arg [1] : 0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419
Arg [2] : 0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f
Arg [3] : 0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.