ETH Price: $3,668.64 (+0.88%)
 
Transaction Hash
Method
Block
From
To
Remove Liquidity192754542024-02-21 10:31:35319 days ago1708511495IN
DeFiChain LM: DFI-USDT
0 ETH0.0072449336.76062531
Remove Liquidity186467312023-11-25 5:49:23407 days ago1700891363IN
DeFiChain LM: DFI-USDT
0 ETH0.0005995920.2895499
Remove Liquidity186466922023-11-25 5:41:35407 days ago1700890895IN
DeFiChain LM: DFI-USDT
0 ETH0.0035254919.22254234
Remove Liquidity186369022023-11-23 20:45:47409 days ago1700772347IN
DeFiChain LM: DFI-USDT
0 ETH0.0041037525.14710845
Remove Liquidity184107082023-10-23 4:50:11440 days ago1698036611IN
DeFiChain LM: DFI-USDT
0 ETH0.001219237.47180325
Claim Rewards183968362023-10-21 6:15:59442 days ago1697868959IN
DeFiChain LM: DFI-USDT
0 ETH0.000521456.34716827
Remove Liquidity182949282023-10-07 0:06:59457 days ago1696637219IN
DeFiChain LM: DFI-USDT
0 ETH0.000978075.42538492
Claim Rewards182403152023-09-29 8:54:59464 days ago1695977699IN
DeFiChain LM: DFI-USDT
0 ETH0.000528787.6013981
Remove Liquidity181010642023-09-09 19:57:47484 days ago1694289467IN
DeFiChain LM: DFI-USDT
0 ETH0.001468458.9984431
Claim Rewards181009592023-09-09 19:36:47484 days ago1694288207IN
DeFiChain LM: DFI-USDT
0 ETH0.000770289.15316967
Remove Liquidity180883472023-09-08 1:12:47486 days ago1694135567IN
DeFiChain LM: DFI-USDT
0 ETH0.0022587212.31555119
Remove Liquidity179587852023-08-20 21:58:11504 days ago1692568691IN
DeFiChain LM: DFI-USDT
0 ETH0.0029563716.39788926
Claim Rewards179587792023-08-20 21:56:59504 days ago1692568619IN
DeFiChain LM: DFI-USDT
0 ETH0.0010145514.5844128
Remove Liquidity179282102023-08-16 15:13:35508 days ago1692198815IN
DeFiChain LM: DFI-USDT
0 ETH0.0067873337.64176918
Remove Liquidity178478892023-08-05 9:31:11519 days ago1691227871IN
DeFiChain LM: DFI-USDT
0 ETH0.0023230614.2332306
Remove Liquidity178064962023-07-30 14:39:23525 days ago1690727963IN
DeFiChain LM: DFI-USDT
0 ETH0.0029498418.07614624
Claim Rewards178064922023-07-30 14:38:35525 days ago1690727915IN
DeFiChain LM: DFI-USDT
0 ETH0.0015862118.84869874
Claim Rewards178040822023-07-30 6:32:11525 days ago1690698731IN
DeFiChain LM: DFI-USDT
0 ETH0.00111816.07160483
Remove Liquidity178002052023-07-29 17:32:23526 days ago1690651943IN
DeFiChain LM: DFI-USDT
0 ETH0.0045730428.02280025
Claim Rewards178002042023-07-29 17:32:11526 days ago1690651931IN
DeFiChain LM: DFI-USDT
0 ETH0.002046429.41755534
Claim Rewards177786442023-07-26 17:07:59529 days ago1690391279IN
DeFiChain LM: DFI-USDT
0 ETH0.003753344.59985396
Remove Liquidity177473242023-07-22 7:57:23533 days ago1690012643IN
DeFiChain LM: DFI-USDT
0 ETH0.0025028215.33690599
Claim Rewards177473212023-07-22 7:56:47533 days ago1690012607IN
DeFiChain LM: DFI-USDT
0 ETH0.0009653614.83921384
Remove Liquidity177413322023-07-21 11:51:23534 days ago1689940283IN
DeFiChain LM: DFI-USDT
0 ETH0.0041110925.19394182
Claim Rewards177413282023-07-21 11:50:23534 days ago1689940223IN
DeFiChain LM: DFI-USDT
0 ETH0.0018955323.07266567
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ProxyLiquidityMining

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 16 : ProxyLiquidityMining.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.8.15;
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./LiquidityMiningLogic.sol";

contract ProxyLiquidityMining is LiquidityMiningLogic, ReentrancyGuard {
    using SafeERC20 for IERC20;

    IUniswapV2Router02 public immutable router;
    IERC20 public immutable secondToken;
    IERC20 public immutable pair;

    constructor(
        address router_,
        address _DFI,
        address _secondToken,
        address _pair,
        uint256 _admin_speed
    ) LiquidityMiningLogic(_DFI, _admin_speed) {
        router = IUniswapV2Router02(router_);
        secondToken = IERC20(_secondToken);
        pair = IERC20(_pair);
        IERC20(_DFI).safeApprove(router_, MAX_INT);
        IERC20(_secondToken).safeApprove(router_, MAX_INT);
        IERC20(_pair).safeApprove(router_, MAX_INT);
    }

    /**
     * @notice Add liquidity to the pool
     * User will need to approve this proxy to spend their at least
     * "amountDFIDesired" amount and "amountsecondTokenDesired" amount first
     * @param amountDFIDesired maximum amount of DFI to be deposited into DFI-secondToken pool (required by UniswapV2Router02)
     * @param amountsecondTokenDesired maximum amount of secondToken to be deposited into DFI-secondToken pool (required by UniswapV2Router02)
     * @param amountDFIMin minimum amount of DFI to be deposited into DFI-secondToken pool (required by UniswapV2Router02)
     * @param amountsecondTokenMin minimum amount of secondToken to be deposited into DFI-secondToken pool (required by UniswapV2Router02)
     * @param deadline the deadline required by UniswapV2Router02
     */
    function addLiquidity(
        uint256 amountDFIDesired,
        uint256 amountsecondTokenDesired,
        uint256 amountDFIMin,
        uint256 amountsecondTokenMin,
        uint256 deadline
    )
        external
        nonReentrant
        returns (
            uint256 amountDFI,
            uint256 amountsecondToken,
            uint256 liquidity
        )
    {
        beforeHook(msg.sender);
        DFI.safeTransferFrom(msg.sender, address(this), amountDFIDesired);
        secondToken.safeTransferFrom(
            msg.sender,
            address(this),
            amountsecondTokenDesired
        );
        // amountDFI: actual amount of DFI sent to the pair
        // amountsecondToken: actual amount of secondToken sent to the pair
        (amountDFI, amountsecondToken, liquidity) = router.addLiquidity(
            address(DFI),
            address(secondToken),
            amountDFIDesired,
            amountsecondTokenDesired,
            amountDFIMin,
            amountsecondTokenMin,
            address(this),
            deadline
        );
        _addLiquidity(msg.sender, liquidity);
        uint256 returnDFI = amountDFIDesired - amountDFI;
        uint256 returnsecondToken = amountsecondTokenDesired -
            amountsecondToken;
        if (returnDFI > 0) DFI.safeTransfer(msg.sender, returnDFI);
        if (returnsecondToken > 0)
            secondToken.safeTransfer(msg.sender, returnsecondToken);
        emit LIQUIDITY_ADDED(msg.sender, liquidity);
    }

    /**
     * @notice remove liquidity from the pool, user is going to receive
     * their share of DFI + secondToken from the DFI-secondToken  pool and DFI rewards thanks to liquidity mining
     * @param liquidity the amount of LP tokens that is going to be unstaked
     * @param amountDFIMin the minimum DFI tokens that is going to be returned to staker (from the Uniswap DFI-secondToken pool)
     * @param amountsecondTokenMin minimum secondToken tokens that is going to be returned to staker (from the Uniswap DFI-secondToken pool)
     * @param deadline the deadline for this action to be performed
     */
    function removeLiquidity(
        uint256 liquidity,
        uint256 amountDFIMin,
        uint256 amountsecondTokenMin,
        uint256 deadline
    )
        external
        nonReentrant
        returns (uint256 amountDFI, uint256 amountsecondToken)
    {
        require(
            stakingMap[msg.sender] >= liquidity,
            "User does not have enough liquidity"
        );
        beforeHook(msg.sender);
        _removeLiquidity(msg.sender, liquidity);
        _claimRewards(msg.sender);
        // router will send "liquidity" LP tokens back to the pool
        // for burning
        (amountDFI, amountsecondToken) = router.removeLiquidity(
            address(DFI),
            address(secondToken),
            liquidity,
            amountDFIMin,
            amountsecondTokenMin,
            msg.sender,
            deadline
        );
        emit LIQUIDITY_REMOVED(msg.sender, liquidity);
    }

    /**
     * @notice remove liquidity from the pool without claiming rewards
     */
    function removeLiquidityWithoutClaimingRewards(
        uint256 liquidity,
        uint256 amountDFIMin,
        uint256 amountsecondTokenMin,
        uint256 deadline
    )
        external
        nonReentrant
        returns (uint256 amountDFI, uint256 amountsecondToken)
    {
        require(
            stakingMap[msg.sender] >= liquidity,
            "User does not have enough liquidity"
        );
        beforeHook(msg.sender);
        _removeLiquidity(msg.sender, liquidity);
        // router will send "liquidity" LP tokens back to the pool
        // for burning
        (amountDFI, amountsecondToken) = router.removeLiquidity(
            address(DFI),
            address(secondToken),
            liquidity,
            amountDFIMin,
            amountsecondTokenMin,
            msg.sender,
            deadline
        );
        emit LIQUIDITY_REMOVED(msg.sender, liquidity);
    }


    /**
     * @notice remove liquidity from the pool in case of emergency
     */
    function removeLiquidityInEmergency(
        uint256 liquidity,
        uint256 amountDFIMin,
        uint256 amountsecondTokenMin,
        uint256 deadline
    )
        external
        nonReentrant
        returns (uint256 amountDFI, uint256 amountsecondToken)
    {
        require(emergency, "Not be in emergency mode yet");
        require(
            stakingMap[msg.sender] >= liquidity,
            "User does not have enough liquidity"
        );
        _removeLiquidity(msg.sender, liquidity);
        // router will send "liquidity" LP tokens back to the pool
        // for burning
        (amountDFI, amountsecondToken) = router.removeLiquidity(
            address(DFI),
            address(secondToken),
            liquidity,
            amountDFIMin,
            amountsecondTokenMin,
            msg.sender,
            deadline
        );
        emit LIQUIDITY_REMOVED(msg.sender, liquidity);
    }

    /**
     * @notice reset the allowance for the router by this contract, 
     * in case the allowances are too low
     */
    function resetAllowances() external {
        address routerAddr = address(router);
        DFI.safeApprove(routerAddr, 0);
        DFI.safeApprove(routerAddr, MAX_INT);
        secondToken.safeApprove(routerAddr, 0);
        secondToken.safeApprove(routerAddr, MAX_INT);
        pair.safeApprove(routerAddr, 0);
        pair.safeApprove(routerAddr, MAX_INT);
    }
}

File 2 of 16 : IUniswapV2Router02.sol
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 3 of 16 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 4 of 16 : LiquidityMiningLogic.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.8.15;
import "@openzeppelin/contracts/interfaces/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

contract LiquidityMiningLogic is AccessControl {
    struct MarketState {
        uint256 index; // sum of reward_at_block_i / total_stake_at_block_i (i is the block number) before the current block
        uint256 lastBlockNum;
        uint256 epoch;
    }
    using SafeERC20 for IERC20;
    enum STAGE { NO_REWARD_PERIOD, COLD_START, AFTER_COLD_START, END_REWARD_PERIOD}


    uint256 constant MAX_INT = type(uint256).max;
    // every week, the reward per block will be decreased by 4 percent, so we need this constant
    uint256 constant BLOCKS_PER_WEEK = 6000 * 7;
    uint256 public rewardSpeed;
    uint256 public totalStake;
    uint256 public endColdStartBlockNum;
    uint256 public admin_speed;
    uint256 public totalRewardAccrued;
    bool public emergency;

    STAGE public contract_stage;
    MarketState public marketState;
    IERC20 public immutable DFI;

    mapping(address => uint256) public stakingMap;
    mapping(address => uint256) public rewardAccrueds;
    mapping(address => uint256) public recipientIndexes;

    event REWARD_CLAIMED(
        address indexed recipient,
        uint256 amount,
        bool hasDFILeft
    );
    event LIQUIDITY_ADDED(address indexed user, uint256 liquidityAdded);
    event LIQUIDITY_REMOVED(address indexed user, uint256 liquidityRemoved);

    constructor(address _DFI, uint256 _admin_speed) {
        DFI = IERC20(_DFI);
        marketState = MarketState({
            index: 0,
            lastBlockNum: block.number,
            epoch: 0
        });
        admin_speed = _admin_speed;
        contract_stage = STAGE.NO_REWARD_PERIOD;
        _grantRole(DEFAULT_ADMIN_ROLE, _msgSender());
        _setRoleAdmin(DEFAULT_ADMIN_ROLE, DEFAULT_ADMIN_ROLE);
    }

    /**
     * @notice Update the sum of reward per stake up to before the current block
     * (by leveraging the periods of constant total stake)
     * State vars to be updated: 
     * - rewardSpeed
     * - marketState.index 
     * - marketState.epoch
     * - marketState.lastBlockNum
     * - totalRewardAccrued
     */
    function _updateRewardIndex() internal {
        uint256 blockNumber = block.number;
        uint256 rewardAccrued;
        if (contract_stage == STAGE.COLD_START) {
            rewardAccrued =
                rewardSpeed *
                (blockNumber - marketState.lastBlockNum);
        } else if (contract_stage == STAGE.AFTER_COLD_START) {
            uint256 updateEpoch = (blockNumber - endColdStartBlockNum) /
                BLOCKS_PER_WEEK;
            if (updateEpoch > marketState.epoch) {
                uint256 checkPoint = (marketState.epoch + 1) *
                    BLOCKS_PER_WEEK +
                    endColdStartBlockNum;
                uint256 rewardAccruedBeforeFirstEpochEnds = rewardSpeed *
                    (checkPoint - marketState.lastBlockNum);
                checkPoint += BLOCKS_PER_WEEK;
                uint256 _rewardSpeed = rewardSpeed;
                while (checkPoint <= blockNumber) {
                    _rewardSpeed = (_rewardSpeed * 96) / 100;
                    rewardAccrued += _rewardSpeed * BLOCKS_PER_WEEK;
                    checkPoint += BLOCKS_PER_WEEK;
                }
                _rewardSpeed = (_rewardSpeed * 96) / 100;
                uint256 rewardAccruedInTheFinalEpoch = _rewardSpeed *
                    (blockNumber + BLOCKS_PER_WEEK - checkPoint);
                rewardAccrued +=
                    rewardAccruedBeforeFirstEpochEnds +
                    rewardAccruedInTheFinalEpoch;
                marketState.epoch = updateEpoch;
                rewardSpeed = _rewardSpeed;
            } else
                rewardAccrued =
                    rewardSpeed *
                    (blockNumber - marketState.lastBlockNum);
        }
        
        marketState.lastBlockNum = blockNumber;
        if (totalStake != 0) {
            marketState.index += (rewardAccrued * 1e18) / totalStake;
            totalRewardAccrued += rewardAccrued;
        }
    }

    /**
     * @notice Update the accrued reward of a recipient
     * @param recipient The recipient of the reward
     */
    function _distributeRewards(address recipient) internal {
        uint256 marketIndex = marketState.index;
        uint256 deltaIndex = marketIndex - recipientIndexes[recipient];
        recipientIndexes[recipient] = marketIndex;

        uint256 recipientDelta = (stakingMap[recipient] * deltaIndex) / 1e18;
        rewardAccrueds[recipient] += recipientDelta;
    }

    /**
     * @notice used to update the reward index and
     * and update the reward accrued of the recipient
     * @param recipient the recipient of the reward
     */
    function beforeHook(address recipient) public notInEmergency {
        // if beforeHook fails, addliquidity/ removeliquidity functions will fail (except for removeLiquidity that is enabled in emergency mode)
        // and claimRewards will also fail
        // calculate the index up to before the current block
        _updateRewardIndex();
        // distribute reward to the recipient (reward is calculated up to before the current block)
        _distributeRewards(recipient);
    }

    /**
     * @notice Claim rewards and transfer these DFI rewards to recipient
     * anyone can call this function
     * @param recipient the recipient of the reward
     */
    function claimRewards(address recipient) external {
        beforeHook(recipient);
        _claimRewards(recipient);
    }

    /**
     * @notice internal function to claim rewards
     * @param recipient the recipient of the DFI rewards
     */
    function _claimRewards(address recipient) internal {
        if (rewardAccrueds[recipient] == 0) return;
        uint256 proxyBalance = DFI.balanceOf(address(this));
        if (proxyBalance == 0) return;
        if (proxyBalance > rewardAccrueds[recipient]) {
            uint256 rewardToTransfer = rewardAccrueds[recipient];
            rewardAccrueds[recipient] = 0;
            DFI.safeTransfer(recipient, rewardToTransfer);
            emit REWARD_CLAIMED(recipient, rewardToTransfer, true);
        } else {
            rewardAccrueds[recipient] -= proxyBalance;
            DFI.safeTransfer(recipient, proxyBalance);
            emit REWARD_CLAIMED(recipient, proxyBalance, false);
        }
    }

    /**
     * @notice internal function to add liquidity
     * @param requester requester of the addition of liquidity
     * @param liquidity the LP tokens added to the smart contract
     */
    function _addLiquidity(address requester, uint256 liquidity) internal {
        stakingMap[requester] += liquidity;
        totalStake += liquidity;
    }

    /**
     * @notice internal function to remove liquidity
     * @param requester requester of the removal of liquidity
     * @param liquidity the LP tokens to be removed from the smart contract
     */
    function _removeLiquidity(address requester, uint256 liquidity) internal {
        stakingMap[requester] -= liquidity;
        totalStake -= liquidity;
    }

    /**
     * @notice Enter Emergency mode, in case our rewardMechanism fails
     */
    function enterEmergencyMode() external onlyRole(DEFAULT_ADMIN_ROLE) {
        emergency = true;
        DFI.safeTransfer(msg.sender, DFI.balanceOf(address(this)));
    }

    /**
     * @notice For the contract to enter the next stage 
     * 1. enter stage COLD_START when we want to start accruing liquidity mining rewards to users (1%)
     * 2. enter stage AFTER_COLD_START when we want to start normal liquidity mining campaign
     * 3. enter stage END_REWARD_PERIOD when we want to end the accrual of Liquidity Mining rewards to users,
     */
    function enterNextStage() external notInEmergency onlyRole(DEFAULT_ADMIN_ROLE) {
        _updateRewardIndex();
        if (contract_stage == STAGE.NO_REWARD_PERIOD) { 
            rewardSpeed = admin_speed/100;
            contract_stage = STAGE.COLD_START;
        }
        else if (contract_stage == STAGE.COLD_START) {
            rewardSpeed = admin_speed;
            endColdStartBlockNum = block.number;
            contract_stage = STAGE.AFTER_COLD_START;            
        }
        else if (contract_stage == STAGE.AFTER_COLD_START) {
            rewardSpeed = 0;
            contract_stage = STAGE.END_REWARD_PERIOD;
        }
    }

    /**
     * @notice modifier in case of emergency
     */
    modifier notInEmergency() {
        require(!emergency, "In emergency mode now");
        _;
    }

    /**
    * @notice a function to check reward related matters of the contract
    * @param recipient the address we want to check the reward on
    * @return _rewardForRecipient an estimate of reward claimable by a recipient up till now
    * @return _totalRewardAccrued an estimate of totalReward that the contract accrue to all of its users (including the tokens that have been claimed by users)
    */ 
    function checkReward(address recipient) external view returns(uint256 _rewardForRecipient, uint256 _totalRewardAccrued) {
        uint256 blockNumber = block.number;
        uint256 rewardAccrued;
        uint256 _rewardSpeed = rewardSpeed;
        uint256 _marketIndex = marketState.index;
        _totalRewardAccrued = totalRewardAccrued;

        if (contract_stage == STAGE.COLD_START) {
            rewardAccrued =
                _rewardSpeed *
                (blockNumber - marketState.lastBlockNum);
        } else if (contract_stage == STAGE.AFTER_COLD_START) {
            uint256 updateEpoch = (blockNumber - endColdStartBlockNum) /
                BLOCKS_PER_WEEK;
            if (updateEpoch > marketState.epoch) {
                uint256 checkPoint = (marketState.epoch + 1) *
                    BLOCKS_PER_WEEK +
                    endColdStartBlockNum;
                uint256 rewardAccruedBeforeFirstEpochEnds = _rewardSpeed *
                    (checkPoint - marketState.lastBlockNum);
                checkPoint += BLOCKS_PER_WEEK;
                while (checkPoint <= blockNumber) {
                    _rewardSpeed = (_rewardSpeed * 96) / 100;
                    rewardAccrued += _rewardSpeed * BLOCKS_PER_WEEK;
                    checkPoint += BLOCKS_PER_WEEK;
                }
                _rewardSpeed = (_rewardSpeed * 96) / 100;
                uint256 rewardAccruedInTheFinalEpoch = _rewardSpeed *
                    (blockNumber + BLOCKS_PER_WEEK - checkPoint);
                rewardAccrued +=
                    rewardAccruedBeforeFirstEpochEnds +
                    rewardAccruedInTheFinalEpoch;
            } else
                rewardAccrued =
                    _rewardSpeed *
                    (blockNumber - marketState.lastBlockNum);
        }
        if (totalStake != 0) {
            _marketIndex += (rewardAccrued * 1e18) / totalStake;
            _totalRewardAccrued += rewardAccrued;
        }

        uint256 deltaIndex = _marketIndex - recipientIndexes[recipient];

        uint256 recipientDelta = (stakingMap[recipient] * deltaIndex) / 1e18;
        _rewardForRecipient = rewardAccrueds[recipient] + recipientDelta;
    }
}

File 5 of 16 : 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 6 of 16 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)

pragma solidity ^0.8.0;

import "../token/ERC20/IERC20.sol";

File 7 of 16 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 8 of 16 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

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

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

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

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

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

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

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

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

File 9 of 16 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
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 amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

File 10 of 16 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 11 of 16 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @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;
    }
}

File 12 of 16 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

File 13 of 16 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 14 of 16 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 15 of 16 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 16 of 16 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"router_","type":"address"},{"internalType":"address","name":"_DFI","type":"address"},{"internalType":"address","name":"_secondToken","type":"address"},{"internalType":"address","name":"_pair","type":"address"},{"internalType":"uint256","name":"_admin_speed","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"liquidityAdded","type":"uint256"}],"name":"LIQUIDITY_ADDED","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"liquidityRemoved","type":"uint256"}],"name":"LIQUIDITY_REMOVED","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bool","name":"hasDFILeft","type":"bool"}],"name":"REWARD_CLAIMED","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DFI","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountDFIDesired","type":"uint256"},{"internalType":"uint256","name":"amountsecondTokenDesired","type":"uint256"},{"internalType":"uint256","name":"amountDFIMin","type":"uint256"},{"internalType":"uint256","name":"amountsecondTokenMin","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidity","outputs":[{"internalType":"uint256","name":"amountDFI","type":"uint256"},{"internalType":"uint256","name":"amountsecondToken","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"admin_speed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"beforeHook","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"checkReward","outputs":[{"internalType":"uint256","name":"_rewardForRecipient","type":"uint256"},{"internalType":"uint256","name":"_totalRewardAccrued","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contract_stage","outputs":[{"internalType":"enum LiquidityMiningLogic.STAGE","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emergency","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endColdStartBlockNum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enterEmergencyMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enterNextStage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"marketState","outputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"lastBlockNum","type":"uint256"},{"internalType":"uint256","name":"epoch","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pair","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"recipientIndexes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountDFIMin","type":"uint256"},{"internalType":"uint256","name":"amountsecondTokenMin","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidity","outputs":[{"internalType":"uint256","name":"amountDFI","type":"uint256"},{"internalType":"uint256","name":"amountsecondToken","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountDFIMin","type":"uint256"},{"internalType":"uint256","name":"amountsecondTokenMin","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidityInEmergency","outputs":[{"internalType":"uint256","name":"amountDFI","type":"uint256"},{"internalType":"uint256","name":"amountsecondToken","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountDFIMin","type":"uint256"},{"internalType":"uint256","name":"amountsecondTokenMin","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidityWithoutClaimingRewards","outputs":[{"internalType":"uint256","name":"amountDFI","type":"uint256"},{"internalType":"uint256","name":"amountsecondToken","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resetAllowances","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewardAccrueds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardSpeed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"secondToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakingMap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRewardAccrued","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

6101006040523480156200001257600080fd5b5060405162002a8b38038062002a8b833981016040819052620000359162000600565b6001600160a01b0384166080526040805160608101825260008082524360208301819052919092018290526007829055600855600981905560048290556006805461ff0019169055849082906200008d903362000131565b6200009a600080620001d2565b50506001600d556001600160a01b0385811660a05283811660c05282811660e052620000d8908516866000196200021d602090811b620011db17901c565b620000ff85600019856001600160a01b03166200021d60201b620011db179092919060201c565b6200012685600019846001600160a01b03166200021d60201b620011db179092919060201c565b50505050506200072b565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620001ce576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556200018d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b8015806200029b5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa15801562000273573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000299919062000667565b155b620003135760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084015b60405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b179091526200036b9185916200037016565b505050565b6000620003cc826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166200044e60201b62001323179092919060201c565b8051909150156200036b5780806020019051810190620003ed919062000681565b6200036b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016200030a565b60606200045f848460008562000469565b90505b9392505050565b606082471015620004cc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016200030a565b6001600160a01b0385163b620005255760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016200030a565b600080866001600160a01b03168587604051620005439190620006d8565b60006040518083038185875af1925050503d806000811462000582576040519150601f19603f3d011682016040523d82523d6000602084013e62000587565b606091505b5090925090506200059a828286620005a5565b979650505050505050565b60608315620005b657508162000462565b825115620005c75782518084602001fd5b8160405162461bcd60e51b81526004016200030a9190620006f6565b80516001600160a01b0381168114620005fb57600080fd5b919050565b600080600080600060a086880312156200061957600080fd5b6200062486620005e3565b94506200063460208701620005e3565b93506200064460408701620005e3565b92506200065460608701620005e3565b9150608086015190509295509295909350565b6000602082840312156200067a57600080fd5b5051919050565b6000602082840312156200069457600080fd5b815180151581146200046257600080fd5b60005b83811015620006c2578181015183820152602001620006a8565b83811115620006d2576000848401525b50505050565b60008251620006ec818460208701620006a5565b9190910192915050565b602081526000825180602084015262000717816040850160208701620006a5565b601f01601f19169190910160400192915050565b60805160a05160c05160e05161228c620007ff6000396000818161041d01528181610852015261088701526000818161033f01528181610624015281816107e70152818161081c01528181610b6601528181610bcc0152610d050152600081816104bb0152818161066e015281816107500152610c1d015260008181610266015281816105fc0152818161077c015281816107b1015281816109f101528181610a6601528181610b3101528181610ba401528181610ccb01528181611829015281816118ef015261199a015261228c6000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c80639844afd21161010f578063c1d74eae116100a2578063d547741f11610071578063d547741f14610490578063ef5cfb8c146104a3578063f887ea40146104b6578063f88bf15a146104dd57600080fd5b8063c1d74eae14610448578063c2f4172214610450578063c3c90e6414610470578063caa6fea41461048357600080fd5b8063a360501c116100de578063a360501c146103fc578063a55c13661461040f578063a8aa1b3114610418578063bfc4ac441461043f57600080fd5b80639844afd2146103b95780639ab3f49f146103c15780639ea0a124146103e1578063a217fddf146103f457600080fd5b80633505b09f116101875780636bee43f1116101565780636bee43f11461036a5780638663592a1461037d5780638b0e9f3f1461039d57806391d14854146103a657600080fd5b80633505b09f1461031f57806336568abe146103275780633bfd49da1461033a5780635c0f6bd11461036157600080fd5b80631cbf4aad116101c35780631cbf4aad146102a057806323809dcd146102bf578063248a9ca3146102e75780632f2ff15d1461030a57600080fd5b806301ffc9a7146101f557806308fb1b771461021d5780630cc0741f1461024a57806314f78f1f14610261575b600080fd5b610208610203366004611e45565b6104f0565b60405190151581526020015b60405180910390f35b60075460085460095461022f92919083565b60408051938452602084019290925290820152606001610214565b61025360045481565b604051908152602001610214565b6102887f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610214565b6006546102b290610100900460ff1681565b6040516102149190611e85565b6102d26102cd366004611ead565b610527565b60408051928352602083019190915201610214565b6102536102f5366004611edf565b60009081526020819052604090206001015490565b61031d610318366004611f14565b610724565b005b61031d61074e565b61031d610335366004611f14565b6108b3565b6102887f000000000000000000000000000000000000000000000000000000000000000081565b61025360015481565b61031d610378366004611f40565b610931565b61025361038b366004611f40565b600b6020526000908152604090205481565b61025360025481565b6102086103b4366004611f14565b61098d565b61031d6109b6565b6102536103cf366004611f40565b600a6020526000908152604090205481565b6102d26103ef366004611ead565b610a8d565b610253600081565b61022f61040a366004611f5b565b610aef565b61025360035481565b6102887f000000000000000000000000000000000000000000000000000000000000000081565b61025360055481565b61031d610d76565b61025361045e366004611f40565b600c6020526000908152604090205481565b6102d261047e366004611f40565b610e9e565b6006546102089060ff1681565b61031d61049e366004611f14565b61112f565b61031d6104b1366004611f40565b611154565b6102887f000000000000000000000000000000000000000000000000000000000000000081565b6102d26104eb366004611ead565b611166565b60006001600160e01b03198216637965db0b60e01b148061052157506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000806002600d54036105555760405162461bcd60e51b815260040161054c90611f96565b60405180910390fd5b6002600d5560065460ff166105ac5760405162461bcd60e51b815260206004820152601c60248201527f4e6f7420626520696e20656d657267656e6379206d6f64652079657400000000604482015260640161054c565b336000908152600a60205260409020548611156105db5760405162461bcd60e51b815260040161054c90611fcd565b6105e5338761133c565b604051635d5155ef60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301527f0000000000000000000000000000000000000000000000000000000000000000811660248301526044820188905260648201879052608482018690523360a483015260c482018590527f0000000000000000000000000000000000000000000000000000000000000000169063baa2abde9060e40160408051808303816000875af11580156106b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106da9190612010565b604051888152919350915033907f694363adc1b990b18523323354e5915d0075ce34c937062c35cd70651bde999b9060200160405180910390a26001600d55909590945092505050565b60008281526020819052604090206001015461073f81611386565b6107498383611390565b505050565b7f00000000000000000000000000000000000000000000000000000000000000006107a46001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168260006111db565b6107da6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016826000196111db565b61080f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168260006111db565b6108456001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016826000196111db565b61087a6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168260006111db565b6108b06001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016826000196111db565b50565b6001600160a01b03811633146109235760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161054c565b61092d8282611414565b5050565b60065460ff161561097c5760405162461bcd60e51b8152602060048201526015602482015274496e20656d657267656e6379206d6f6465206e6f7760581b604482015260640161054c565b610984611479565b6108b081611699565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60006109c181611386565b6006805460ff191660011790556040516370a0823160e01b81523060048201526108b09033906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610a38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5c9190612034565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169190611740565b6000806002600d5403610ab25760405162461bcd60e51b815260040161054c90611f96565b6002600d55336000908152600a6020526040902054861115610ae65760405162461bcd60e51b815260040161054c90611fcd565b6105db33610931565b60008060006002600d5403610b165760405162461bcd60e51b815260040161054c90611f96565b6002600d55610b2433610931565b610b596001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308b611770565b610b8e6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308a611770565b60405162e8e33760e81b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301527f000000000000000000000000000000000000000000000000000000000000000081166024830152604482018a9052606482018990526084820188905260a482018790523060c483015260e482018690527f0000000000000000000000000000000000000000000000000000000000000000169063e8e3370090610104016060604051808303816000875af1158015610c67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8b919061204d565b91945092509050610c9c33826117ae565b6000610ca8848a612091565b90506000610cb6848a612091565b90508115610cf257610cf26001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163384611740565b8015610d2c57610d2c6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163383611740565b60405183815233907fcd5be368eced75f02b27bf6c7e70d6dcd4bf21feb0253696c905ef019723b13e9060200160405180910390a250506001600d81905550955095509592505050565b60065460ff1615610dc15760405162461bcd60e51b8152602060048201526015602482015274496e20656d657267656e6379206d6f6465206e6f7760581b604482015260640161054c565b6000610dcc81611386565b610dd4611479565b6000600654610100900460ff166003811115610df257610df2611e6f565b03610e21576064600454610e0691906120a8565b60019081556006805461ff001916610100835b021790555050565b6001600654610100900460ff166003811115610e3f57610e3f611e6f565b03610e645760045460015543600355600680546002919061ff00191661010083610e19565b6002600654610100900460ff166003811115610e8257610e82611e6f565b036108b0575060006001556006805461ff001916610300179055565b60018054600754600554600093909243928592600654610100900460ff166003811115610ecd57610ecd611e6f565b03610ef057600854610edf9085612091565b610ee990836120ca565b925061105c565b6002600654610100900460ff166003811115610f0e57610f0e611e6f565b0361105c57600061a41060035486610f269190612091565b610f3091906120a8565b60095490915081111561104057600060035461a4106007600201546001610f5791906120e9565b610f6191906120ca565b610f6b91906120e9565b600854909150600090610f7e9083612091565b610f8890866120ca565b9050610f9661a410836120e9565b91505b868211610fe4576064610fad8660606120ca565b610fb791906120a8565b9450610fc561a410866120ca565b610fcf90876120e9565b9550610fdd61a410836120e9565b9150610f99565b6064610ff18660606120ca565b610ffb91906120a8565b945060008261100c61a4108a6120e9565b6110169190612091565b61102090876120ca565b905061102c81836120e9565b61103690886120e9565b965050505061105a565b60085461104d9086612091565b61105790846120ca565b93505b505b6002541561109c5760025461107984670de0b6b3a76400006120ca565b61108391906120a8565b61108d90826120e9565b905061109983866120e9565b94505b6001600160a01b0387166000908152600c60205260408120546110bf9083612091565b6001600160a01b0389166000908152600a602052604081205491925090670de0b6b3a7640000906110f19084906120ca565b6110fb91906120a8565b6001600160a01b038a166000908152600b60205260409020549091506111229082906120e9565b9750505050505050915091565b60008281526020819052604090206001015461114a81611386565b6107498383611414565b61115d81610931565b6108b0816117ef565b6000806002600d540361118b5760405162461bcd60e51b815260040161054c90611f96565b6002600d55336000908152600a60205260409020548611156111bf5760405162461bcd60e51b815260040161054c90611fcd565b6111c833610931565b6111d2338761133c565b6105e5336117ef565b8015806112555750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa15801561122f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112539190612034565b155b6112c05760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161054c565b6040516001600160a01b03831660248201526044810182905261074990849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611a09565b60606113328484600085611adb565b90505b9392505050565b6001600160a01b0382166000908152600a602052604081208054839290611364908490612091565b92505081905550806002600082825461137d9190612091565b90915550505050565b6108b08133611c0c565b61139a828261098d565b61092d576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556113d03390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61141e828261098d565b1561092d576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b4360006001600654610100900460ff16600381111561149a5761149a611e6f565b036114c0576008546114ac9083612091565b6001546114b991906120ca565b9050611642565b6002600654610100900460ff1660038111156114de576114de611e6f565b0361164257600061a410600354846114f69190612091565b61150091906120a8565b60095490915081111561162357600060035461a410600760020154600161152791906120e9565b61153191906120ca565b61153b91906120e9565b60085490915060009061154e9083612091565b60015461155b91906120ca565b905061156961a410836120e9565b6001549092505b8583116115bb5760646115848260606120ca565b61158e91906120a8565b905061159c61a410826120ca565b6115a690866120e9565b94506115b461a410846120e9565b9250611570565b60646115c88260606120ca565b6115d291906120a8565b90506000836115e361a410896120e9565b6115ed9190612091565b6115f790836120ca565b905061160381846120e9565b61160d90876120e9565b6009869055600192909255509350611640915050565b6008546116309084612091565b60015461163d91906120ca565b91505b505b60088290556002541561092d5760025461166482670de0b6b3a76400006120ca565b61166e91906120a8565b600780546000906116809084906120e9565b92505081905550806005600082825461137d91906120e9565b6007546001600160a01b0382166000908152600c60205260408120546116bf9083612091565b6001600160a01b0384166000908152600c60209081526040808320869055600a90915281205491925090670de0b6b3a7640000906116fe9084906120ca565b61170891906120a8565b6001600160a01b0385166000908152600b60205260408120805492935083929091906117359084906120e9565b909155505050505050565b6040516001600160a01b03831660248201526044810182905261074990849063a9059cbb60e01b906064016112ec565b6040516001600160a01b03808516602483015283166044820152606481018290526117a89085906323b872dd60e01b906084016112ec565b50505050565b6001600160a01b0382166000908152600a6020526040812080548392906117d69084906120e9565b92505081905550806002600082825461137d91906120e9565b6001600160a01b0381166000908152600b602052604081205490036118115750565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611878573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189c9190612034565b9050806000036118aa575050565b6001600160a01b0382166000908152600b602052604090205481111561195f576001600160a01b038083166000908152600b60205260408120805491905590611916907f0000000000000000000000000000000000000000000000000000000000000000168483611740565b60408051828152600160208201526001600160a01b038516917fa28f1f3546f32985703a5a32cbf18677dc0ece9c4db31ae416084d68aeb7d0db910160405180910390a2505050565b6001600160a01b0382166000908152600b602052604081208054839290611987908490612091565b909155506119c190506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168383611740565b60408051828152600060208201526001600160a01b038416917fa28f1f3546f32985703a5a32cbf18677dc0ece9c4db31ae416084d68aeb7d0db910160405180910390a25050565b6000611a5e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113239092919063ffffffff16565b8051909150156107495780806020019051810190611a7c9190612101565b6107495760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161054c565b606082471015611b3c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161054c565b6001600160a01b0385163b611b935760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161054c565b600080866001600160a01b03168587604051611baf919061214f565b60006040518083038185875af1925050503d8060008114611bec576040519150601f19603f3d011682016040523d82523d6000602084013e611bf1565b606091505b5091509150611c01828286611c70565b979650505050505050565b611c16828261098d565b61092d57611c2e816001600160a01b03166014611ca9565b611c39836020611ca9565b604051602001611c4a92919061216b565b60408051601f198184030181529082905262461bcd60e51b825261054c916004016121e0565b60608315611c7f575081611335565b825115611c8f5782518084602001fd5b8160405162461bcd60e51b815260040161054c91906121e0565b60606000611cb88360026120ca565b611cc39060026120e9565b67ffffffffffffffff811115611cdb57611cdb612213565b6040519080825280601f01601f191660200182016040528015611d05576020820181803683370190505b509050600360fc1b81600081518110611d2057611d20612229565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611d4f57611d4f612229565b60200101906001600160f81b031916908160001a9053506000611d738460026120ca565b611d7e9060016120e9565b90505b6001811115611df6576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611db257611db2612229565b1a60f81b828281518110611dc857611dc8612229565b60200101906001600160f81b031916908160001a90535060049490941c93611def8161223f565b9050611d81565b5083156113355760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161054c565b600060208284031215611e5757600080fd5b81356001600160e01b03198116811461133557600080fd5b634e487b7160e01b600052602160045260246000fd5b6020810160048310611ea757634e487b7160e01b600052602160045260246000fd5b91905290565b60008060008060808587031215611ec357600080fd5b5050823594602084013594506040840135936060013592509050565b600060208284031215611ef157600080fd5b5035919050565b80356001600160a01b0381168114611f0f57600080fd5b919050565b60008060408385031215611f2757600080fd5b82359150611f3760208401611ef8565b90509250929050565b600060208284031215611f5257600080fd5b61133582611ef8565b600080600080600060a08688031215611f7357600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526023908201527f5573657220646f6573206e6f74206861766520656e6f756768206c697175696460408201526269747960e81b606082015260800190565b6000806040838503121561202357600080fd5b505080516020909101519092909150565b60006020828403121561204657600080fd5b5051919050565b60008060006060848603121561206257600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052601160045260246000fd5b6000828210156120a3576120a361207b565b500390565b6000826120c557634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156120e4576120e461207b565b500290565b600082198211156120fc576120fc61207b565b500190565b60006020828403121561211357600080fd5b8151801515811461133557600080fd5b60005b8381101561213e578181015183820152602001612126565b838111156117a85750506000910152565b60008251612161818460208701612123565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516121a3816017850160208801612123565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516121d4816028840160208801612123565b01602801949350505050565b60208152600082518060208401526121ff816040850160208701612123565b601f01601f19169190910160400192915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008161224e5761224e61207b565b50600019019056fea26469706673582212202d03ce8aad11b48c37407ebe752d13c98ca5ea9559b8c0135a181d8fe6c9753764736f6c634300080f00330000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d0000000000000000000000008fc8f8269ebca376d046ce292dc7eac40c8d358a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000009e251daeb17981477509779612dc2ffa8075aa8e00000000000000000000000000000000000000000000000000000000017d7840

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101f05760003560e01c80639844afd21161010f578063c1d74eae116100a2578063d547741f11610071578063d547741f14610490578063ef5cfb8c146104a3578063f887ea40146104b6578063f88bf15a146104dd57600080fd5b8063c1d74eae14610448578063c2f4172214610450578063c3c90e6414610470578063caa6fea41461048357600080fd5b8063a360501c116100de578063a360501c146103fc578063a55c13661461040f578063a8aa1b3114610418578063bfc4ac441461043f57600080fd5b80639844afd2146103b95780639ab3f49f146103c15780639ea0a124146103e1578063a217fddf146103f457600080fd5b80633505b09f116101875780636bee43f1116101565780636bee43f11461036a5780638663592a1461037d5780638b0e9f3f1461039d57806391d14854146103a657600080fd5b80633505b09f1461031f57806336568abe146103275780633bfd49da1461033a5780635c0f6bd11461036157600080fd5b80631cbf4aad116101c35780631cbf4aad146102a057806323809dcd146102bf578063248a9ca3146102e75780632f2ff15d1461030a57600080fd5b806301ffc9a7146101f557806308fb1b771461021d5780630cc0741f1461024a57806314f78f1f14610261575b600080fd5b610208610203366004611e45565b6104f0565b60405190151581526020015b60405180910390f35b60075460085460095461022f92919083565b60408051938452602084019290925290820152606001610214565b61025360045481565b604051908152602001610214565b6102887f0000000000000000000000008fc8f8269ebca376d046ce292dc7eac40c8d358a81565b6040516001600160a01b039091168152602001610214565b6006546102b290610100900460ff1681565b6040516102149190611e85565b6102d26102cd366004611ead565b610527565b60408051928352602083019190915201610214565b6102536102f5366004611edf565b60009081526020819052604090206001015490565b61031d610318366004611f14565b610724565b005b61031d61074e565b61031d610335366004611f14565b6108b3565b6102887f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec781565b61025360015481565b61031d610378366004611f40565b610931565b61025361038b366004611f40565b600b6020526000908152604090205481565b61025360025481565b6102086103b4366004611f14565b61098d565b61031d6109b6565b6102536103cf366004611f40565b600a6020526000908152604090205481565b6102d26103ef366004611ead565b610a8d565b610253600081565b61022f61040a366004611f5b565b610aef565b61025360035481565b6102887f0000000000000000000000009e251daeb17981477509779612dc2ffa8075aa8e81565b61025360055481565b61031d610d76565b61025361045e366004611f40565b600c6020526000908152604090205481565b6102d261047e366004611f40565b610e9e565b6006546102089060ff1681565b61031d61049e366004611f14565b61112f565b61031d6104b1366004611f40565b611154565b6102887f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b6102d26104eb366004611ead565b611166565b60006001600160e01b03198216637965db0b60e01b148061052157506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000806002600d54036105555760405162461bcd60e51b815260040161054c90611f96565b60405180910390fd5b6002600d5560065460ff166105ac5760405162461bcd60e51b815260206004820152601c60248201527f4e6f7420626520696e20656d657267656e6379206d6f64652079657400000000604482015260640161054c565b336000908152600a60205260409020548611156105db5760405162461bcd60e51b815260040161054c90611fcd565b6105e5338761133c565b604051635d5155ef60e11b81526001600160a01b037f0000000000000000000000008fc8f8269ebca376d046ce292dc7eac40c8d358a811660048301527f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7811660248301526044820188905260648201879052608482018690523360a483015260c482018590527f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d169063baa2abde9060e40160408051808303816000875af11580156106b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106da9190612010565b604051888152919350915033907f694363adc1b990b18523323354e5915d0075ce34c937062c35cd70651bde999b9060200160405180910390a26001600d55909590945092505050565b60008281526020819052604090206001015461073f81611386565b6107498383611390565b505050565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6107a46001600160a01b037f0000000000000000000000008fc8f8269ebca376d046ce292dc7eac40c8d358a168260006111db565b6107da6001600160a01b037f0000000000000000000000008fc8f8269ebca376d046ce292dc7eac40c8d358a16826000196111db565b61080f6001600160a01b037f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7168260006111db565b6108456001600160a01b037f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec716826000196111db565b61087a6001600160a01b037f0000000000000000000000009e251daeb17981477509779612dc2ffa8075aa8e168260006111db565b6108b06001600160a01b037f0000000000000000000000009e251daeb17981477509779612dc2ffa8075aa8e16826000196111db565b50565b6001600160a01b03811633146109235760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161054c565b61092d8282611414565b5050565b60065460ff161561097c5760405162461bcd60e51b8152602060048201526015602482015274496e20656d657267656e6379206d6f6465206e6f7760581b604482015260640161054c565b610984611479565b6108b081611699565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60006109c181611386565b6006805460ff191660011790556040516370a0823160e01b81523060048201526108b09033906001600160a01b037f0000000000000000000000008fc8f8269ebca376d046ce292dc7eac40c8d358a16906370a0823190602401602060405180830381865afa158015610a38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5c9190612034565b6001600160a01b037f0000000000000000000000008fc8f8269ebca376d046ce292dc7eac40c8d358a169190611740565b6000806002600d5403610ab25760405162461bcd60e51b815260040161054c90611f96565b6002600d55336000908152600a6020526040902054861115610ae65760405162461bcd60e51b815260040161054c90611fcd565b6105db33610931565b60008060006002600d5403610b165760405162461bcd60e51b815260040161054c90611f96565b6002600d55610b2433610931565b610b596001600160a01b037f0000000000000000000000008fc8f8269ebca376d046ce292dc7eac40c8d358a1633308b611770565b610b8e6001600160a01b037f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec71633308a611770565b60405162e8e33760e81b81526001600160a01b037f0000000000000000000000008fc8f8269ebca376d046ce292dc7eac40c8d358a811660048301527f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec781166024830152604482018a9052606482018990526084820188905260a482018790523060c483015260e482018690527f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d169063e8e3370090610104016060604051808303816000875af1158015610c67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8b919061204d565b91945092509050610c9c33826117ae565b6000610ca8848a612091565b90506000610cb6848a612091565b90508115610cf257610cf26001600160a01b037f0000000000000000000000008fc8f8269ebca376d046ce292dc7eac40c8d358a163384611740565b8015610d2c57610d2c6001600160a01b037f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7163383611740565b60405183815233907fcd5be368eced75f02b27bf6c7e70d6dcd4bf21feb0253696c905ef019723b13e9060200160405180910390a250506001600d81905550955095509592505050565b60065460ff1615610dc15760405162461bcd60e51b8152602060048201526015602482015274496e20656d657267656e6379206d6f6465206e6f7760581b604482015260640161054c565b6000610dcc81611386565b610dd4611479565b6000600654610100900460ff166003811115610df257610df2611e6f565b03610e21576064600454610e0691906120a8565b60019081556006805461ff001916610100835b021790555050565b6001600654610100900460ff166003811115610e3f57610e3f611e6f565b03610e645760045460015543600355600680546002919061ff00191661010083610e19565b6002600654610100900460ff166003811115610e8257610e82611e6f565b036108b0575060006001556006805461ff001916610300179055565b60018054600754600554600093909243928592600654610100900460ff166003811115610ecd57610ecd611e6f565b03610ef057600854610edf9085612091565b610ee990836120ca565b925061105c565b6002600654610100900460ff166003811115610f0e57610f0e611e6f565b0361105c57600061a41060035486610f269190612091565b610f3091906120a8565b60095490915081111561104057600060035461a4106007600201546001610f5791906120e9565b610f6191906120ca565b610f6b91906120e9565b600854909150600090610f7e9083612091565b610f8890866120ca565b9050610f9661a410836120e9565b91505b868211610fe4576064610fad8660606120ca565b610fb791906120a8565b9450610fc561a410866120ca565b610fcf90876120e9565b9550610fdd61a410836120e9565b9150610f99565b6064610ff18660606120ca565b610ffb91906120a8565b945060008261100c61a4108a6120e9565b6110169190612091565b61102090876120ca565b905061102c81836120e9565b61103690886120e9565b965050505061105a565b60085461104d9086612091565b61105790846120ca565b93505b505b6002541561109c5760025461107984670de0b6b3a76400006120ca565b61108391906120a8565b61108d90826120e9565b905061109983866120e9565b94505b6001600160a01b0387166000908152600c60205260408120546110bf9083612091565b6001600160a01b0389166000908152600a602052604081205491925090670de0b6b3a7640000906110f19084906120ca565b6110fb91906120a8565b6001600160a01b038a166000908152600b60205260409020549091506111229082906120e9565b9750505050505050915091565b60008281526020819052604090206001015461114a81611386565b6107498383611414565b61115d81610931565b6108b0816117ef565b6000806002600d540361118b5760405162461bcd60e51b815260040161054c90611f96565b6002600d55336000908152600a60205260409020548611156111bf5760405162461bcd60e51b815260040161054c90611fcd565b6111c833610931565b6111d2338761133c565b6105e5336117ef565b8015806112555750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa15801561122f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112539190612034565b155b6112c05760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161054c565b6040516001600160a01b03831660248201526044810182905261074990849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611a09565b60606113328484600085611adb565b90505b9392505050565b6001600160a01b0382166000908152600a602052604081208054839290611364908490612091565b92505081905550806002600082825461137d9190612091565b90915550505050565b6108b08133611c0c565b61139a828261098d565b61092d576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556113d03390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61141e828261098d565b1561092d576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b4360006001600654610100900460ff16600381111561149a5761149a611e6f565b036114c0576008546114ac9083612091565b6001546114b991906120ca565b9050611642565b6002600654610100900460ff1660038111156114de576114de611e6f565b0361164257600061a410600354846114f69190612091565b61150091906120a8565b60095490915081111561162357600060035461a410600760020154600161152791906120e9565b61153191906120ca565b61153b91906120e9565b60085490915060009061154e9083612091565b60015461155b91906120ca565b905061156961a410836120e9565b6001549092505b8583116115bb5760646115848260606120ca565b61158e91906120a8565b905061159c61a410826120ca565b6115a690866120e9565b94506115b461a410846120e9565b9250611570565b60646115c88260606120ca565b6115d291906120a8565b90506000836115e361a410896120e9565b6115ed9190612091565b6115f790836120ca565b905061160381846120e9565b61160d90876120e9565b6009869055600192909255509350611640915050565b6008546116309084612091565b60015461163d91906120ca565b91505b505b60088290556002541561092d5760025461166482670de0b6b3a76400006120ca565b61166e91906120a8565b600780546000906116809084906120e9565b92505081905550806005600082825461137d91906120e9565b6007546001600160a01b0382166000908152600c60205260408120546116bf9083612091565b6001600160a01b0384166000908152600c60209081526040808320869055600a90915281205491925090670de0b6b3a7640000906116fe9084906120ca565b61170891906120a8565b6001600160a01b0385166000908152600b60205260408120805492935083929091906117359084906120e9565b909155505050505050565b6040516001600160a01b03831660248201526044810182905261074990849063a9059cbb60e01b906064016112ec565b6040516001600160a01b03808516602483015283166044820152606481018290526117a89085906323b872dd60e01b906084016112ec565b50505050565b6001600160a01b0382166000908152600a6020526040812080548392906117d69084906120e9565b92505081905550806002600082825461137d91906120e9565b6001600160a01b0381166000908152600b602052604081205490036118115750565b6040516370a0823160e01b81523060048201526000907f0000000000000000000000008fc8f8269ebca376d046ce292dc7eac40c8d358a6001600160a01b0316906370a0823190602401602060405180830381865afa158015611878573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189c9190612034565b9050806000036118aa575050565b6001600160a01b0382166000908152600b602052604090205481111561195f576001600160a01b038083166000908152600b60205260408120805491905590611916907f0000000000000000000000008fc8f8269ebca376d046ce292dc7eac40c8d358a168483611740565b60408051828152600160208201526001600160a01b038516917fa28f1f3546f32985703a5a32cbf18677dc0ece9c4db31ae416084d68aeb7d0db910160405180910390a2505050565b6001600160a01b0382166000908152600b602052604081208054839290611987908490612091565b909155506119c190506001600160a01b037f0000000000000000000000008fc8f8269ebca376d046ce292dc7eac40c8d358a168383611740565b60408051828152600060208201526001600160a01b038416917fa28f1f3546f32985703a5a32cbf18677dc0ece9c4db31ae416084d68aeb7d0db910160405180910390a25050565b6000611a5e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113239092919063ffffffff16565b8051909150156107495780806020019051810190611a7c9190612101565b6107495760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161054c565b606082471015611b3c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161054c565b6001600160a01b0385163b611b935760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161054c565b600080866001600160a01b03168587604051611baf919061214f565b60006040518083038185875af1925050503d8060008114611bec576040519150601f19603f3d011682016040523d82523d6000602084013e611bf1565b606091505b5091509150611c01828286611c70565b979650505050505050565b611c16828261098d565b61092d57611c2e816001600160a01b03166014611ca9565b611c39836020611ca9565b604051602001611c4a92919061216b565b60408051601f198184030181529082905262461bcd60e51b825261054c916004016121e0565b60608315611c7f575081611335565b825115611c8f5782518084602001fd5b8160405162461bcd60e51b815260040161054c91906121e0565b60606000611cb88360026120ca565b611cc39060026120e9565b67ffffffffffffffff811115611cdb57611cdb612213565b6040519080825280601f01601f191660200182016040528015611d05576020820181803683370190505b509050600360fc1b81600081518110611d2057611d20612229565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611d4f57611d4f612229565b60200101906001600160f81b031916908160001a9053506000611d738460026120ca565b611d7e9060016120e9565b90505b6001811115611df6576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611db257611db2612229565b1a60f81b828281518110611dc857611dc8612229565b60200101906001600160f81b031916908160001a90535060049490941c93611def8161223f565b9050611d81565b5083156113355760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161054c565b600060208284031215611e5757600080fd5b81356001600160e01b03198116811461133557600080fd5b634e487b7160e01b600052602160045260246000fd5b6020810160048310611ea757634e487b7160e01b600052602160045260246000fd5b91905290565b60008060008060808587031215611ec357600080fd5b5050823594602084013594506040840135936060013592509050565b600060208284031215611ef157600080fd5b5035919050565b80356001600160a01b0381168114611f0f57600080fd5b919050565b60008060408385031215611f2757600080fd5b82359150611f3760208401611ef8565b90509250929050565b600060208284031215611f5257600080fd5b61133582611ef8565b600080600080600060a08688031215611f7357600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526023908201527f5573657220646f6573206e6f74206861766520656e6f756768206c697175696460408201526269747960e81b606082015260800190565b6000806040838503121561202357600080fd5b505080516020909101519092909150565b60006020828403121561204657600080fd5b5051919050565b60008060006060848603121561206257600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052601160045260246000fd5b6000828210156120a3576120a361207b565b500390565b6000826120c557634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156120e4576120e461207b565b500290565b600082198211156120fc576120fc61207b565b500190565b60006020828403121561211357600080fd5b8151801515811461133557600080fd5b60005b8381101561213e578181015183820152602001612126565b838111156117a85750506000910152565b60008251612161818460208701612123565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516121a3816017850160208801612123565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516121d4816028840160208801612123565b01602801949350505050565b60208152600082518060208401526121ff816040850160208701612123565b601f01601f19169190910160400192915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008161224e5761224e61207b565b50600019019056fea26469706673582212202d03ce8aad11b48c37407ebe752d13c98ca5ea9559b8c0135a181d8fe6c9753764736f6c634300080f0033

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

0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d0000000000000000000000008fc8f8269ebca376d046ce292dc7eac40c8d358a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000009e251daeb17981477509779612dc2ffa8075aa8e00000000000000000000000000000000000000000000000000000000017d7840

-----Decoded View---------------
Arg [0] : router_ (address): 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
Arg [1] : _DFI (address): 0x8Fc8f8269ebca376D046Ce292dC7eaC40c8D358A
Arg [2] : _secondToken (address): 0xdAC17F958D2ee523a2206206994597C13D831ec7
Arg [3] : _pair (address): 0x9e251daEB17981477509779612dC2FFa8075AA8E
Arg [4] : _admin_speed (uint256): 25000000

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d
Arg [1] : 0000000000000000000000008fc8f8269ebca376d046ce292dc7eac40c8d358a
Arg [2] : 000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7
Arg [3] : 0000000000000000000000009e251daeb17981477509779612dc2ffa8075aa8e
Arg [4] : 00000000000000000000000000000000000000000000000000000000017d7840


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  ]

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.