ETH Price: $3,281.28 (-0.43%)

Contract

0x36f1F4125B4066cA4b768F9F5f9a737Bd4FA8f62
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw124231882021-05-13 1:58:331339 days ago1620871113IN
0x36f1F412...Bd4FA8f62
0 ETH0.14963034168.1
Withdraw121525212021-04-01 8:25:571381 days ago1617265557IN
0x36f1F412...Bd4FA8f62
0 ETH0.14618644185
Multi Withdraw120108212021-03-10 12:33:301403 days ago1615379610IN
0x36f1F412...Bd4FA8f62
0 ETH0.0958677390
Multi Withdraw119678572021-03-03 21:59:011409 days ago1614808741IN
0x36f1F412...Bd4FA8f62
0 ETH0.19030104180
Multi Withdraw119654472021-03-03 13:04:201410 days ago1614776660IN
0x36f1F412...Bd4FA8f62
0 ETH0.11472839107
Multi Withdraw119603292021-03-02 17:55:551411 days ago1614707755IN
0x36f1F412...Bd4FA8f62
0 ETH0.13483366128
Multi Withdraw119414502021-02-27 20:19:221413 days ago1614457162IN
0x36f1F412...Bd4FA8f62
0 ETH0.13370382122
Multi Withdraw119414412021-02-27 20:18:101413 days ago1614457090IN
0x36f1F412...Bd4FA8f62
0 ETH0.15832704121
Multi Withdraw119393362021-02-27 12:22:251414 days ago1614428545IN
0x36f1F412...Bd4FA8f62
0 ETH0.0949991389
Withdraw119390322021-02-27 11:18:151414 days ago1614424695IN
0x36f1F412...Bd4FA8f62
0 ETH0.0987098191.3
Multi Withdraw119386262021-02-27 9:49:041414 days ago1614419344IN
0x36f1F412...Bd4FA8f62
0 ETH0.11453338109
Multi Withdraw119374382021-02-27 5:22:341414 days ago1614403354IN
0x36f1F412...Bd4FA8f62
0 ETH0.0930869186
Multi Withdraw119372212021-02-27 4:33:061414 days ago1614400386IN
0x36f1F412...Bd4FA8f62
0 ETH0.0995547690
Multi Withdraw119344762021-02-26 18:30:001415 days ago1614364200IN
0x36f1F412...Bd4FA8f62
0 ETH0.12441559113
Multi Withdraw119343542021-02-26 18:01:571415 days ago1614362517IN
0x36f1F412...Bd4FA8f62
0 ETH0.18749186168
Multi Withdraw119343472021-02-26 18:00:421415 days ago1614362442IN
0x36f1F412...Bd4FA8f62
0 ETH0.20088414180
Multi Withdraw119343432021-02-26 17:59:501415 days ago1614362390IN
0x36f1F412...Bd4FA8f62
0 ETH0.21943334189
Deposit119338432021-02-26 16:07:591415 days ago1614355679IN
0x36f1F412...Bd4FA8f62
0 ETH0.13562727122
Withdraw119337742021-02-26 15:54:381415 days ago1614354878IN
0x36f1F412...Bd4FA8f62
0 ETH0.12040145130
Multi Withdraw119336692021-02-26 15:30:281415 days ago1614353428IN
0x36f1F412...Bd4FA8f62
0 ETH0.10314916105
Multi Withdraw119308402021-02-26 5:11:521415 days ago1614316312IN
0x36f1F412...Bd4FA8f62
0 ETH0.11725764120
Multi Withdraw119305262021-02-26 3:55:281415 days ago1614311728IN
0x36f1F412...Bd4FA8f62
0 ETH0.1073819100
Multi Withdraw119278952021-02-25 18:20:491416 days ago1614277249IN
0x36f1F412...Bd4FA8f62
0 ETH0.1634673150
Multi Withdraw119278262021-02-25 18:06:151416 days ago1614276375IN
0x36f1F412...Bd4FA8f62
0 ETH0.2463199195
Withdraw119254882021-02-25 9:20:251416 days ago1614244825IN
0x36f1F412...Bd4FA8f62
0 ETH0.14175991133
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:
DaiLpPool

Compiler Version
v0.6.6+commit.6c089d02

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 13 : DaiLpPool.sol
// SPDX-License-Identifier: MIT
/*

██████╗ ███████╗██████╗  █████╗ ███████╗███████╗
██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔════╝██╔════╝
██║  ██║█████╗  ██████╔╝███████║███████╗█████╗  
██║  ██║██╔══╝  ██╔══██╗██╔══██║╚════██║██╔══╝  
██████╔╝███████╗██████╔╝██║  ██║███████║███████╗
╚═════╝ ╚══════╝╚═════╝ ╚═╝  ╚═╝╚══════╝╚══════╝
                                               

* Debase: DaiLpPool.sol
* Description:
* Farm DEBASE-DAI Uni V2 LP token to get DEBASE, DAI, MPH rewards.
* Coded by: Ryuhei Matsuda
*/

pragma solidity >=0.6.6;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/Math.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "./interfaces/IUniswapV2Pair.sol";
import "./interfaces/IDInterest.sol";
import "./interfaces/IReward.sol";

struct Vest {
    uint256 amount;
    uint256 vestPeriodInSeconds;
    uint256 creationTimestamp;
    uint256 withdrawnAmount;
}

interface IVesting {
    function withdrawVested(address account, uint256 vestIdx)
        external
        returns (uint256);

    function getVestWithdrawableAmount(address account, uint256 vestIdx)
        external
        view
        returns (uint256);

    function accountVestList(address account, uint256 vestIdx)
        external
        view
        returns (Vest memory);
}

contract DaiLpPool is Ownable, IERC721Receiver, ReentrancyGuard {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    event onDeposit(
        address indexed user,
        uint256 amount,
        uint256 maturationTimestamp,
        uint256 depositId
    );
    event onWithdraw(address indexed user, uint256 amount, uint256 depositId);
    event onEmergencyWithdraw(
        address indexed user,
        uint256 amount,
        uint256 depositId
    );

    event LogSetDebaseRewardPercentage(uint256 debaseRewardPercentage_);
    event LogDebaseRewardIssued(uint256 rewardIssued, uint256 rewardsFinishBy);
    event LogSetBlockDuration(uint256 duration_);
    event LogSetPoolEnabled(bool poolEnabled_);
    event LogStartNewDistribtionCycle(
        uint256 poolShareAdded_,
        uint256 amount_,
        uint256 rewardRate_,
        uint256 periodFinish_
    );

    struct DepositInfo {
        address owner;
        uint256 amount;
        uint256 daiAmount;
        uint256 debaseGonAmount;
        uint256 debaseReward;
        uint256 debaseRewardPerTokenPaid;
        uint256 daiDepositId;
        uint256 mphReward;
        uint256 mphVestingIdx;
        uint256 maturationTimestamp;
        bool withdrawed;
    }

    uint256 private constant MAX_UINT256 = ~uint256(0);
    uint256 private constant INITIAL_FRAGMENTS_SUPPLY = 1000000 * 10**18;
    uint256 private constant TOTAL_GONS =
        MAX_UINT256 - (MAX_UINT256 % INITIAL_FRAGMENTS_SUPPLY);

    IUniswapV2Pair public debaseDaiPair;
    IDInterest public daiFixedPool;
    IReward public mphStakePool;
    IVesting public mphVesting;
    IERC20 public dai;
    IERC20 public debase;
    IERC20 public mph;
    address public policy;

    uint256 public maxDepositLimit;
    uint256 public totalLpLimit;
    uint256 public lockPeriod;
    bool public totalLpLimitEnabled;
    bool public maxDepositLimitEnabled;

    uint256 public totalLpLocked;

    mapping(uint256 => DepositInfo) public deposits;
    mapping(address => uint256[]) public depositIds;

    mapping(address => uint256) public lpDeposits;
    mapping(uint256 => uint256) daiOffsetForMphStaking; // DAI reward offset, times 1e12.
    uint256 public depositLength;
    uint256 public daiFee = 300;
    uint256 public mphFee = 300;
    uint256 public totalMphStaked;
    address public treasury;

    uint256 public periodFinish;
    uint256 public debaseRewardRate;
    uint256 public lastUpdateBlock;
    uint256 public debaseRewardPerTokenStored;
    uint256 public debaseRewardPercentage;
    uint256 public debaseRewardDistributed;
    uint256 accDaiPerMph; // Accumulated DAI reward per staked mph, times 1e12.
    uint256 lastVestingIdx;
    uint256 firstDepositForVesting;

    // params for debase reward
    uint256 public blockDuration;
    bool public poolEnabled;
    bool public allowEmergencyWithdraw;

    modifier enabled() {
        require(poolEnabled, "Pool isn't enabled");
        _;
    }

    function _updateDebaseReward(uint256 depositId) internal {
        debaseRewardPerTokenStored = debaseRewardPerToken();
        lastUpdateBlock = _lastBlockRewardApplicable();
        if (depositId < depositLength) {
            deposits[depositId].debaseReward = earned(depositId);
            deposits[depositId]
                .debaseRewardPerTokenPaid = debaseRewardPerTokenStored;
        }
    }

    constructor(
        IUniswapV2Pair _debaseDaiPair,
        IERC20 _dai,
        IERC20 _debase,
        IERC20 _mph,
        address _policy,
        IDInterest _daiFixedPool,
        IReward _mphStakePool,
        IVesting _mphVesting,
        uint256 _lockPeriod,
        address _treasury,
        uint256 _debaseRewardPercentage,
        uint256 _blockDuration
    ) public Ownable() {
        require(_treasury != address(0), "Invalid addr");
        debaseDaiPair = _debaseDaiPair;
        dai = _dai;
        debase = _debase;
        mph = _mph;
        policy = _policy;
        daiFixedPool = _daiFixedPool;
        mphStakePool = _mphStakePool;
        mphVesting = _mphVesting;
        lockPeriod = _lockPeriod;
        treasury = _treasury;
        debaseRewardPercentage = _debaseRewardPercentage;
        blockDuration = _blockDuration;
    }

    function _depositLpToken(uint256 amount)
        internal
        returns (uint256 daiAmount, uint256 debaseAmount)
    {
        uint256 daiOldBalance = dai.balanceOf(address(this));
        uint256 debaseOldBalance = debase.balanceOf(address(this));
        debaseDaiPair.transferFrom(msg.sender, address(debaseDaiPair), amount);
        debaseDaiPair.burn(address(this));
        uint256 daiBalance = dai.balanceOf(address(this));
        uint256 debaseBalance = debase.balanceOf(address(this));

        daiAmount = daiBalance.sub(daiOldBalance);
        debaseAmount = debaseBalance.sub(debaseOldBalance);
    }

    function _depositDai(uint256 daiAmount)
        internal
        returns (uint256 daiDepositId, uint256 maturationTimestamp)
    {
        maturationTimestamp = block.timestamp.add(lockPeriod);
        dai.approve(address(daiFixedPool), daiAmount);
        daiFixedPool.deposit(daiAmount, maturationTimestamp);
        daiDepositId = daiFixedPool.depositsLength();
    }

    function _updateMphReward() internal {
        if (totalMphStaked == 0) {
            return;
        }
        uint256 daiOldBalance = dai.balanceOf(address(this));
        mphStakePool.getReward();
        uint256 daiBalance = dai.balanceOf(address(this));
        uint256 daiReward = daiBalance.sub(daiOldBalance);
        accDaiPerMph = accDaiPerMph.add(
            daiReward.mul(1e12).div(totalMphStaked)
        );
    }

    function _stakeMph(uint256 mphReward) internal {
        _updateMphReward();
        mph.approve(address(mphStakePool), mphReward);
        mphStakePool.stake(mphReward);
        totalMphStaked = totalMphStaked.add(mphReward);
    }

    function _unstakeMph(uint256 depositId)
        internal
        returns (uint256 daiReward)
    {
        _updateMphReward();
        daiReward = accDaiPerMph
            .mul(deposits[depositId].mphReward)
            .sub(daiOffsetForMphStaking[depositId])
            .div(1e12);
        mphStakePool.withdraw(deposits[depositId].mphReward);
        totalMphStaked = totalMphStaked.sub(deposits[depositId].mphReward);
    }

    function _getCurrentVestingIdx() internal view returns (uint256) {
        uint256 vestIdx = lastVestingIdx;
        Vest memory vest = mphVesting.accountVestList(address(this), vestIdx);
        while (vest.creationTimestamp < block.timestamp) {
            vestIdx = vestIdx.add(1);
            vest = mphVesting.accountVestList(address(this), vestIdx);
        }
        return vestIdx;
    }

    function _withdrawMphVested() internal {
        uint256 totalMphVested = 0;
        for (
            uint256 depositId = firstDepositForVesting;
            depositId < depositLength;
            depositId += 1
        ) {
            uint256 vested =
                mphVesting.withdrawVested(
                    address(this),
                    deposits[depositId].mphVestingIdx
                );
            if (vested > 0) {
                totalMphVested = totalMphVested.add(vested);
                deposits[depositId].mphReward = deposits[depositId]
                    .mphReward
                    .add(vested);
                daiOffsetForMphStaking[depositId] = daiOffsetForMphStaking[
                    depositId
                ]
                    .add(accDaiPerMph.mul(vested));
            }
            if (block.timestamp >= deposits[depositId].maturationTimestamp) {
                firstDepositForVesting = depositId.add(1);
            }
        }
        if (totalMphVested > 0) {
            _stakeMph(totalMphVested);
        }
    }

    function deposit(uint256 amount)
        external
        enabled
        nonReentrant
        returns (uint256)
    {
        require(
            totalLpLimitEnabled == false ||
                totalLpLocked.add(amount) <= totalLpLimit,
            "To much lp locked"
        );
        require(
            maxDepositLimitEnabled == false ||
                lpDeposits[msg.sender].add(amount) <= maxDepositLimit,
            "to much deposit for this user"
        );

        (uint256 daiAmount, uint256 debaseAmount) = _depositLpToken(amount);
        (uint256 daiDepositId, uint256 maturationTimestamp) =
            _depositDai(daiAmount);

        lpDeposits[msg.sender] = lpDeposits[msg.sender].add(amount);
        totalLpLocked = totalLpLocked.add(amount);

        _withdrawMphVested();

        uint256 vestingIdx = _getCurrentVestingIdx();

        deposits[depositLength] = DepositInfo({
            owner: msg.sender,
            amount: amount,
            daiAmount: daiAmount,
            debaseGonAmount: debaseAmount.mul(_gonsPerFragment()),
            debaseReward: 0,
            debaseRewardPerTokenPaid: 0,
            daiDepositId: daiDepositId,
            maturationTimestamp: maturationTimestamp,
            mphReward: 0,
            mphVestingIdx: vestingIdx,
            withdrawed: false
        });
        depositIds[msg.sender].push(depositLength);

        lastVestingIdx = vestingIdx.add(1);
        depositLength = depositLength.add(1);

        _updateDebaseReward(daiDepositId);
        emit onDeposit(
            msg.sender,
            amount,
            maturationTimestamp,
            depositLength.sub(1)
        );
        return depositLength.sub(1);
    }

    function userDepositLength(address user) external view returns (uint256) {
        return depositIds[user].length;
    }

    function _gonsPerFragment() internal view returns (uint256) {
        return TOTAL_GONS.div(debase.totalSupply());
    }

    function _withdrawDai(uint256 depositId, uint256 fundingId) internal {
        DepositInfo storage depositInfo = deposits[depositId];

        uint256 mphStakingDaiReward = _unstakeMph(depositId);

        uint256 mphOldBalance = mph.balanceOf(address(this));
        mph.approve(address(daiFixedPool.mphMinter()), mphOldBalance);
        uint256 daiOldBalance = dai.balanceOf(address(this));
        daiFixedPool.withdraw(depositInfo.daiDepositId, fundingId);
        mph.approve(address(daiFixedPool.mphMinter()), 0);
        uint256 mphBalance = mph.balanceOf(address(this));

        uint256 daiBalance = dai.balanceOf(address(this));
        uint256 daiAmount = daiBalance.sub(daiOldBalance);
        uint256 totalDaiReward =
            daiAmount.add(mphStakingDaiReward).sub(depositInfo.daiAmount);

        uint256 mphReward =
            depositInfo.mphReward.add(mphBalance).sub(mphOldBalance);
        uint256 daiFeeAmount = totalDaiReward.mul(daiFee).div(1000);
        uint256 mphFeeAmount = mphReward.mul(mphFee).div(1000);

        dai.transfer(
            depositInfo.owner,
            depositInfo.daiAmount.add(totalDaiReward.sub(daiFeeAmount))
        );
        mph.transfer(depositInfo.owner, mphReward.sub(mphFeeAmount));

        dai.transfer(treasury, daiFeeAmount);
        mph.transfer(treasury, mphFeeAmount);
    }

    function _emergencyWithdrawDai(uint256 depositId, uint256 fundingId)
        internal
    {
        DepositInfo storage depositInfo = deposits[depositId];

        uint256 mphStakingDaiReward = _unstakeMph(depositId);
        daiFixedPool.earlyWithdraw(depositInfo.daiDepositId, fundingId);
        dai.transfer(depositInfo.owner, depositInfo.daiAmount);
        dai.transfer(treasury, mphStakingDaiReward);
    }

    function _withdraw(
        address user,
        uint256 depositId,
        uint256 fundingId
    ) internal {
        require(depositId < depositLength, "no deposit");
        DepositInfo storage depositInfo = deposits[depositId];
        require(depositInfo.owner == user, "not owner");
        require(depositInfo.withdrawed == false, "withdrawed already");
        require(
            depositInfo.maturationTimestamp <= block.timestamp,
            "still locked"
        );

        _withdrawDai(depositId, fundingId);
        _withdrawDebase(depositId);
        depositInfo.withdrawed = true;
        lpDeposits[user] = lpDeposits[user].sub(depositInfo.amount);
        totalLpLocked = totalLpLocked.sub(depositInfo.amount);

        emit onWithdraw(user, depositInfo.amount, depositId);
    }

    function withdraw(uint256 depositId, uint256 fundingId)
        external
        nonReentrant
    {
        _withdrawMphVested();
        _withdraw(msg.sender, depositId, fundingId);
    }

    function multiWithdraw(
        uint256[] calldata depositIds,
        uint256[] calldata fundingIds
    ) external nonReentrant {
        require(depositIds.length == fundingIds.length, "incorrect length");
        _withdrawMphVested();
        for (uint256 i = 0; i < depositIds.length; i += 1) {
            _withdraw(msg.sender, depositIds[i], fundingIds[i]);
        }
    }

    function emergencyWithdraw(uint256 depositId, uint256 fundingId)
        external
        nonReentrant
    {
        require(allowEmergencyWithdraw, "emergency withdraw disabled");
        require(depositId < depositLength, "no deposit");
        _withdrawMphVested();
        DepositInfo storage depositInfo = deposits[depositId];
        require(depositInfo.owner == msg.sender, "not owner");
        require(depositInfo.withdrawed == false, "withdrawed already");

        _emergencyWithdrawDai(depositId, fundingId);
        _emergencyWithdrawDebase(depositId);
        depositInfo.withdrawed = true;
        lpDeposits[msg.sender] = lpDeposits[msg.sender].sub(depositInfo.amount);
        totalLpLocked = totalLpLocked.sub(depositInfo.amount);

        emit onEmergencyWithdraw(msg.sender, depositInfo.amount, depositId);
    }

    /**
     * @notice Function to set how much reward the stabilizer will request
     */
    function setRewardPercentage(uint256 debaseRewardPercentage_)
        external
        onlyOwner
    {
        debaseRewardPercentage = debaseRewardPercentage_;
        emit LogSetDebaseRewardPercentage(debaseRewardPercentage);
    }

    /**
     * @notice Function to set reward drop period
     */
    function setBlockDuration(uint256 blockDuration_) external onlyOwner {
        require(blockDuration_ >= 1, "invalid duration");
        blockDuration = blockDuration_;
        emit LogSetBlockDuration(blockDuration);
    }

    /**
     * @notice Function enabled or disable pool staking,withdraw
     */
    function setPoolEnabled(bool poolEnabled_) external onlyOwner {
        poolEnabled = poolEnabled_;
        emit LogSetPoolEnabled(poolEnabled);
    }

    function setDaiFee(uint256 _daiFee) external onlyOwner {
        daiFee = _daiFee;
    }

    function setMphFee(uint256 _mphFee) external onlyOwner {
        mphFee = _mphFee;
    }

    function setTreasury(address _treasury) external onlyOwner {
        require(_treasury != address(0), "Invalid addr");
        treasury = _treasury;
    }

    function setPolicy(address _policy) external onlyOwner {
        require(_policy != address(0), "Invalid addr");
        policy = _policy;
    }

    function setMaxDepositLimit(uint256 _maxDepositLimit) external onlyOwner {
        maxDepositLimit = _maxDepositLimit;
    }

    function setMaxDepositLimitEnabled(bool _maxDepositLimitEnabled)
        external
        onlyOwner
    {
        maxDepositLimitEnabled = _maxDepositLimitEnabled;
    }

    function setTotalLpLimit(uint256 _totalLpLimit) external onlyOwner {
        totalLpLimit = _totalLpLimit;
    }

    function setTotalLpLimitEnabled(bool _totalLpLimitEnabled)
        external
        onlyOwner
    {
        totalLpLimitEnabled = _totalLpLimitEnabled;
    }

    function setLockPeriod(uint256 _lockPeriod) external onlyOwner {
        require(_lockPeriod > 0, "invalid lock period");
        lockPeriod = _lockPeriod;
    }

    function setAllowEmergencyWithdraw(bool _allowEmergencyWithdraw)
        external
        onlyOwner
    {
        allowEmergencyWithdraw = _allowEmergencyWithdraw;
    }

    function _lastBlockRewardApplicable() internal view returns (uint256) {
        return Math.min(block.number, periodFinish);
    }

    function debaseRewardPerToken() public view returns (uint256) {
        if (totalLpLocked == 0) {
            return debaseRewardPerTokenStored;
        }
        return
            debaseRewardPerTokenStored.add(
                _lastBlockRewardApplicable()
                    .sub(lastUpdateBlock)
                    .mul(debaseRewardRate)
                    .mul(10**18)
                    .div(totalLpLocked)
            );
    }

    function earned(uint256 depositId) public view returns (uint256) {
        require(depositId < depositLength, "no deposit");
        return
            deposits[depositId]
                .amount
                .mul(
                debaseRewardPerToken().sub(
                    deposits[depositId].debaseRewardPerTokenPaid
                )
            )
                .div(10**18)
                .add(deposits[depositId].debaseReward);
    }

    function _withdrawDebase(uint256 depositId) internal {
        _updateDebaseReward(depositId);
        uint256 reward = earned(depositId);
        deposits[depositId].debaseReward = 0;

        uint256 rewardToClaim = debase.totalSupply().mul(reward).div(10**18);

        debase.safeTransfer(
            deposits[depositId].owner,
            rewardToClaim.add(
                deposits[depositId].debaseGonAmount.div(_gonsPerFragment())
            )
        );
        debaseRewardDistributed = debaseRewardDistributed.add(reward);
    }

    function _emergencyWithdrawDebase(uint256 depositId) internal {
        _updateDebaseReward(depositId);
        uint256 reward = earned(depositId);
        if (reward > 0) {
            deposits[depositId].debaseReward = 0;

            uint256 rewardToClaim =
                debase.totalSupply().mul(reward).div(10**18);

            debase.safeTransfer(
                deposits[depositId].owner,
                deposits[depositId].debaseGonAmount.div(_gonsPerFragment())
            );
            debase.safeTransfer(treasury, rewardToClaim);
            debaseRewardDistributed = debaseRewardDistributed.add(reward);
        }
    }

    function checkStabilizerAndGetReward(
        int256 supplyDelta_,
        int256 rebaseLag_,
        uint256 exchangeRate_,
        uint256 debasePolicyBalance
    ) external returns (uint256 rewardAmount_) {
        require(
            msg.sender == policy,
            "Only debase policy contract can call this"
        );

        if (block.number > periodFinish) {
            uint256 rewardToClaim =
                debasePolicyBalance.mul(debaseRewardPercentage).div(10**18);

            if (debasePolicyBalance >= rewardToClaim) {
                startNewDistribtionCycle(rewardToClaim);
                return rewardToClaim;
            }
        }
        return 0;
    }

    function startNewDistribtionCycle(uint256 amount) internal {
        _updateDebaseReward(depositLength);
        uint256 poolTotalShare = amount.mul(10**18).div(debase.totalSupply());

        if (block.number >= periodFinish) {
            debaseRewardRate = poolTotalShare.div(blockDuration);
        } else {
            uint256 remaining = periodFinish.sub(block.number);
            uint256 leftover = remaining.mul(debaseRewardRate);
            debaseRewardRate = poolTotalShare.add(leftover).div(blockDuration);
        }
        lastUpdateBlock = block.number;
        periodFinish = block.number.add(blockDuration);

        emit LogStartNewDistribtionCycle(
            poolTotalShare,
            amount,
            debaseRewardRate,
            periodFinish
        );
    }

    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external override returns (bytes4) {
        return 0x150b7a02;
    }
}

File 2 of 13 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

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

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

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

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

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

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

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

File 3 of 13 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(_owner == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 4 of 13 : Math.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow, so we distribute
        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
    }
}

File 5 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

File 6 of 13 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

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

File 7 of 13 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4);
}

File 8 of 13 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 () internal {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

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

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

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

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

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

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

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

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

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

    function initialize(address, address) external;
}

File 10 of 13 : IDInterest.sol
pragma solidity >=0.6.6;

interface IDInterest {
    function deposit(uint256 amount, uint256 maturationTimestamp) external;
    function depositsLength() external view returns (uint256);
    function withdraw(uint256 depositID, uint256 fundingID) external;
    function earlyWithdraw(uint256 depositID, uint256 fundingID) external;
    function mphMinter() external view returns (address);
}

File 11 of 13 : IReward.sol
pragma solidity >=0.6.6;

interface IReward {
    function stake(uint256 amount) external;
    function withdraw(uint256 amount) external;
    function getReward() external;
    function balanceOf(address user) external view returns (uint);
}

File 12 of 13 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

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

pragma solidity >=0.6.2 <0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IUniswapV2Pair","name":"_debaseDaiPair","type":"address"},{"internalType":"contract IERC20","name":"_dai","type":"address"},{"internalType":"contract IERC20","name":"_debase","type":"address"},{"internalType":"contract IERC20","name":"_mph","type":"address"},{"internalType":"address","name":"_policy","type":"address"},{"internalType":"contract IDInterest","name":"_daiFixedPool","type":"address"},{"internalType":"contract IReward","name":"_mphStakePool","type":"address"},{"internalType":"contract IVesting","name":"_mphVesting","type":"address"},{"internalType":"uint256","name":"_lockPeriod","type":"uint256"},{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"uint256","name":"_debaseRewardPercentage","type":"uint256"},{"internalType":"uint256","name":"_blockDuration","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rewardIssued","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardsFinishBy","type":"uint256"}],"name":"LogDebaseRewardIssued","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"duration_","type":"uint256"}],"name":"LogSetBlockDuration","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"debaseRewardPercentage_","type":"uint256"}],"name":"LogSetDebaseRewardPercentage","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"poolEnabled_","type":"bool"}],"name":"LogSetPoolEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"poolShareAdded_","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount_","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardRate_","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"periodFinish_","type":"uint256"}],"name":"LogStartNewDistribtionCycle","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maturationTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"depositId","type":"uint256"}],"name":"onDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"depositId","type":"uint256"}],"name":"onEmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"depositId","type":"uint256"}],"name":"onWithdraw","type":"event"},{"inputs":[],"name":"allowEmergencyWithdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blockDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int256","name":"supplyDelta_","type":"int256"},{"internalType":"int256","name":"rebaseLag_","type":"int256"},{"internalType":"uint256","name":"exchangeRate_","type":"uint256"},{"internalType":"uint256","name":"debasePolicyBalance","type":"uint256"}],"name":"checkStabilizerAndGetReward","outputs":[{"internalType":"uint256","name":"rewardAmount_","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dai","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"daiFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"daiFixedPool","outputs":[{"internalType":"contract IDInterest","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"debase","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"debaseDaiPair","outputs":[{"internalType":"contract IUniswapV2Pair","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"debaseRewardDistributed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"debaseRewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"debaseRewardPerTokenStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"debaseRewardPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"debaseRewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"depositIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"deposits","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"daiAmount","type":"uint256"},{"internalType":"uint256","name":"debaseGonAmount","type":"uint256"},{"internalType":"uint256","name":"debaseReward","type":"uint256"},{"internalType":"uint256","name":"debaseRewardPerTokenPaid","type":"uint256"},{"internalType":"uint256","name":"daiDepositId","type":"uint256"},{"internalType":"uint256","name":"mphReward","type":"uint256"},{"internalType":"uint256","name":"mphVestingIdx","type":"uint256"},{"internalType":"uint256","name":"maturationTimestamp","type":"uint256"},{"internalType":"bool","name":"withdrawed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"depositId","type":"uint256"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"depositId","type":"uint256"},{"internalType":"uint256","name":"fundingId","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastUpdateBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lpDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxDepositLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxDepositLimitEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mph","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mphFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mphStakePool","outputs":[{"internalType":"contract IReward","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mphVesting","outputs":[{"internalType":"contract IVesting","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"depositIds","type":"uint256[]"},{"internalType":"uint256[]","name":"fundingIds","type":"uint256[]"}],"name":"multiWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"policy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_allowEmergencyWithdraw","type":"bool"}],"name":"setAllowEmergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"blockDuration_","type":"uint256"}],"name":"setBlockDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_daiFee","type":"uint256"}],"name":"setDaiFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lockPeriod","type":"uint256"}],"name":"setLockPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxDepositLimit","type":"uint256"}],"name":"setMaxDepositLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_maxDepositLimitEnabled","type":"bool"}],"name":"setMaxDepositLimitEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mphFee","type":"uint256"}],"name":"setMphFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_policy","type":"address"}],"name":"setPolicy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"poolEnabled_","type":"bool"}],"name":"setPoolEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"debaseRewardPercentage_","type":"uint256"}],"name":"setRewardPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_totalLpLimit","type":"uint256"}],"name":"setTotalLpLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_totalLpLimitEnabled","type":"bool"}],"name":"setTotalLpLimitEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalLpLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalLpLimitEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalLpLocked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalMphStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"userDepositLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"depositId","type":"uint256"},{"internalType":"uint256","name":"fundingId","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405261012c60145561012c6015553480156200001d57600080fd5b5060405162003f5838038062003f5883398101604081905262000040916200019c565b6000620000556001600160e01b036200018516565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600180556001600160a01b038316620000d55760405162461bcd60e51b8152600401620000cc9062000289565b60405180910390fd5b600280546001600160a01b03199081166001600160a01b039e8f16179091556006805482169c8e169c909c17909b55600780548c169a8d169a909a17909955600880548b16988c1698909817909755600980548a16968b1696909617909555600380548916948a169490941790935560048054881692891692909217909155600580548716918816919091179055600c5560178054909416941693909317909155601c91909155602155620002c8565b3390565b80516200019681620002af565b92915050565b6000806000806000806000806000806000806101808d8f031215620001bf578788fd5b8c51620001cc81620002af565b60208e0151909c50620001df81620002af565b60408e0151909b50620001f281620002af565b60608e0151909a506200020581620002af565b60808e01519099506200021881620002af565b60a08e01519098506200022b81620002af565b96506200023c8e60c08f0162000189565b95506200024d8e60e08f0162000189565b94506101008d01519350620002678e6101208f0162000189565b92506101408d015191506101608d015190509295989b509295989b509295989b565b6020808252600c908201526b24b73b30b634b21030b2323960a11b604082015260600190565b6001600160a01b0381168114620002c557600080fd5b50565b613c8080620002d86000396000f3fe608060405234801561001057600080fd5b50600436106103785760003560e01c8063715018a6116101d3578063b02c43d011610104578063dfba8e7c116100a2578063f0f442601161007c578063f0f4426014610670578063f2fde38b14610683578063f4b9fa7514610696578063fd896c881461069e57610378565b8063dfba8e7c1461064d578063dfe6083514610655578063ebe2b12b1461066857610378565b8063bcb31edc116100de578063bcb31edc14610622578063bdbe038214610635578063be46aec61461063d578063cfe46aff1461064557610378565b8063b02c43d0146105dd578063b63c44e714610607578063b6b55f251461060f57610378565b80638847c82d116101715780639be3dd171161014b5780639be3dd17146105a7578063a218141b146105ba578063aea62e3f146105c2578063af127397146105d557610378565b80638847c82d146105845780638da5cb5b14610597578063995a419c1461059f57610378565b80637a784d23116101ad5780637a784d23146105435780637d4163d314610556578063838a14ca146105695780638798a9d21461057157610378565b8063715018a614610520578063779972da1461052857806378a14fbb1461053b57610378565b8063441a3e70116102ad57806359e1a6991161024b57806361d027b31161022557806361d027b3146104f5578063628a857f146104fd5780636422380a1461051057806365616d011461051857610378565b806359e1a699146104c75780635d4c3224146104cf5780635d4f8cf1146104e257610378565b80634d6ed8c4116102875780634d6ed8c41461048657806352058a7b14610499578063529f35e9146104ac57806357394d09146104bf57610378565b8063441a3e70146104635780634480085114610476578063460f6bb11461047e57610378565b80632304aa611161031a57806335b25d17116102f457806335b25d17146104435780633fd8b02f1461044b578063403e5f64146104535780634083b9101461045b57610378565b80632304aa6114610415578063291a7f871461041d578063303ed0e91461043057610378565b8063150b7a0211610356578063150b7a02146103c55780631a26af7a146103e55780631f276b6e146103fa578063201e908e1461040d57610378565b80630505c8c91461037d578063096536741461039b578063112f719d146103b0575b600080fd5b6103856106a6565b60405161039291906136b7565b60405180910390f35b6103ae6103a9366004613627565b6106b5565b005b6103b8610733565b6040516103929190613baf565b6103d86103d336600461342c565b610739565b604051610392919061376e565b6103ed61074a565b6040516103929190613763565b6103ae610408366004613657565b610758565b6103b86108e6565b6103856108ec565b6103b861042b3660046133f4565b6108fb565b6103b861043e3660046134c9565b61090d565b6103b861093b565b6103b8610941565b6103b8610947565b61038561094d565b6103ae610471366004613657565b61095c565b6103b861099f565b6103856109a5565b6103b8610494366004613627565b6109b4565b6103ae6104a736600461355d565b610a5b565b6103ae6104ba36600461355d565b610aaa565b6103b8610b23565b6103ed610b83565b6103ae6104dd36600461355d565b610b91565b6103ae6104f0366004613627565b610be0565b610385610c1a565b6103b861050b3660046133f4565b610c29565b610385610c44565b610385610c53565b6103ae610c62565b6103ae610536366004613627565b610ce1565b6103b8610d3b565b6103ae610551366004613627565b610d41565b6103ae6105643660046133f4565b610d7b565b6103ed610df8565b6103b861057f366004613595565b610e01565b6103ae61059236600461355d565b610e82565b610385610eca565b6103b8610ed9565b6103ae6105b5366004613627565b610edf565b6103b8610f19565b6103ae6105d03660046134f4565b610f1f565b610385610fbb565b6105f06105eb366004613627565b610fca565b6040516103929b9a99989796959493929190613708565b6103b8611030565b6103b861061d366004613627565b611036565b6103ae610630366004613627565b611372565b6103b86113fd565b6103ed611403565b6103b861140c565b6103b8611412565b6103ae610663366004613627565b611418565b6103b8611452565b6103ae61067e3660046133f4565b611458565b6103ae6106913660046133f4565b6114d5565b61038561158b565b6103b861159a565b6009546001600160a01b031681565b6106bd6115a0565b6000546001600160a01b039081169116146106f35760405162461bcd60e51b81526004016106ea90613a49565b60405180910390fd5b601c8190556040517f28cf650dc6bbdd6a6fa3026f34132cba6ec966fa67dfd5fe58356839efb63be890610728908390613baf565b60405180910390a150565b601b5481565b630a85bd0160e11b95945050505050565b602254610100900460ff1681565b6002600154141561077b5760405162461bcd60e51b81526004016106ea90613b29565b6002600155602254610100900460ff166107a75760405162461bcd60e51b81526004016106ea90613857565b60135482106107c85760405162461bcd60e51b81526004016106ea906137b6565b6107d06115a4565b6000828152600f6020526040902080546001600160a01b031633146108075760405162461bcd60e51b81526004016106ea90613b60565b600a81015460ff161561082c5760405162461bcd60e51b81526004016106ea90613b83565b6108368383611724565b61083f836118c1565b600a8101805460ff19166001908117909155810154336000908152601160205260409020546108739163ffffffff611a1e16565b336000908152601160205260409020556001810154600e5461089a9163ffffffff611a1e16565b600e55600181015460405133917f5712bb005ae686d72a5551442c8cb306ec1f7fbbc1ae6e607207860ac017dc8a916108d591908790613bb8565b60405180910390a250506001805550565b60215481565b6008546001600160a01b031681565b60116020526000908152604090205481565b6010602052816000526040600020818154811061092657fe5b90600052602060002001600091509150505481565b601c5481565b600c5481565b60165481565b6004546001600160a01b031681565b6002600154141561097f5760405162461bcd60e51b81526004016106ea90613b29565b600260015561098c6115a4565b610997338383611a67565b505060018055565b601d5481565b6003546001600160a01b031681565b600060135482106109d75760405162461bcd60e51b81526004016106ea906137b6565b6000828152600f602052604090206004810154600590910154610a559190610a4990670de0b6b3a764000090610a3d90610a1f90610a13610b23565b9063ffffffff611a1e16565b6000888152600f60205260409020600101549063ffffffff611bdd16565b9063ffffffff611c1716565b9063ffffffff611c5916565b92915050565b610a636115a0565b6000546001600160a01b03908116911614610a905760405162461bcd60e51b81526004016106ea90613a49565b600d80549115156101000261ff0019909216919091179055565b610ab26115a0565b6000546001600160a01b03908116911614610adf5760405162461bcd60e51b81526004016106ea90613a49565b6022805460ff191682151517908190556040517f0fc5960ebe0d769d367a5952c3d384663054acd195413084d4c5e3a71c4a7d85916107289160ff90911690613763565b6000600e5460001415610b395750601b54610b80565b610b7d610b6e600e54610a3d670de0b6b3a7640000610b62601954610b62601a54610a13611c7e565b9063ffffffff611bdd16565b601b549063ffffffff611c5916565b90505b90565b600d54610100900460ff1681565b610b996115a0565b6000546001600160a01b03908116911614610bc65760405162461bcd60e51b81526004016106ea90613a49565b602280549115156101000261ff0019909216919091179055565b610be86115a0565b6000546001600160a01b03908116911614610c155760405162461bcd60e51b81526004016106ea90613a49565b601555565b6017546001600160a01b031681565b6001600160a01b031660009081526010602052604090205490565b6007546001600160a01b031681565b6002546001600160a01b031681565b610c6a6115a0565b6000546001600160a01b03908116911614610c975760405162461bcd60e51b81526004016106ea90613a49565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b610ce96115a0565b6000546001600160a01b03908116911614610d165760405162461bcd60e51b81526004016106ea90613a49565b60008111610d365760405162461bcd60e51b81526004016106ea9061395a565b600c55565b60155481565b610d496115a0565b6000546001600160a01b03908116911614610d765760405162461bcd60e51b81526004016106ea90613a49565b600b55565b610d836115a0565b6000546001600160a01b03908116911614610db05760405162461bcd60e51b81526004016106ea90613a49565b6001600160a01b038116610dd65760405162461bcd60e51b81526004016106ea90613934565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600d5460ff1681565b6009546000906001600160a01b03163314610e2e5760405162461bcd60e51b81526004016106ea906138eb565b601854431115610e76576000610e5b670de0b6b3a7640000610a3d601c5486611bdd90919063ffffffff16565b9050808310610e7457610e6d81611c8c565b9050610e7a565b505b5060005b949350505050565b610e8a6115a0565b6000546001600160a01b03908116911614610eb75760405162461bcd60e51b81526004016106ea90613a49565b600d805460ff1916911515919091179055565b6000546001600160a01b031690565b60195481565b610ee76115a0565b6000546001600160a01b03908116911614610f145760405162461bcd60e51b81526004016106ea90613a49565b601455565b601a5481565b60026001541415610f425760405162461bcd60e51b81526004016106ea90613b29565b6002600155828114610f665760405162461bcd60e51b81526004016106ea90613987565b610f6e6115a4565b60005b83811015610fb057610fa833868684818110610f8957fe5b90506020020135858585818110610f9c57fe5b90506020020135611a67565b600101610f71565b505060018055505050565b6005546001600160a01b031681565b600f60205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0154600a909a01546001600160a01b0390991699979896979596949593949293919290919060ff168b565b600a5481565b60225460009060ff1661105b5760405162461bcd60e51b81526004016106ea906139dc565b6002600154141561107e5760405162461bcd60e51b81526004016106ea90613b29565b6002600155600d5460ff1615806110a95750600b54600e546110a6908463ffffffff611c5916565b11155b6110c55760405162461bcd60e51b81526004016106ea906139b1565b600d54610100900460ff1615806110fd5750600a54336000908152601160205260409020546110fa908463ffffffff611c5916565b11155b6111195760405162461bcd60e51b81526004016106ea906137da565b60008061112584611e10565b915091506000806111358461215c565b33600090815260116020526040902054919350915061115a908763ffffffff611c5916565b33600090815260116020526040902055600e5461117d908763ffffffff611c5916565b600e556111886115a4565b60006111926122f0565b9050604051806101600160405280336001600160a01b031681526020018881526020018681526020016111d36111c6612430565b879063ffffffff611bdd16565b81526000602080830182905260408084018390526060808501899052608080860185905260a080870189905260c08088018b905260e0978801879052601380548852600f87528588208a5181546001600160a01b0319166001600160a01b039091161781558a8801516001808301919091558b8801516002830155958b01516003820155938a0151600485015591890151600584015588015160068301559587015160078201556101008701516008820155610120870151600982015561014090960151600a909601805460ff1916961515969096179095553383526010825282209254835480860185559383529120909101556112d2908290611c59565b601f556013546112e990600163ffffffff611c5916565b6013556112f5836124cd565b336001600160a01b03167fb49bb132260f6aa1c86e2d2a3957c097216e6ec9b5fa15867289f058b4d297ac88846113386001601354611a1e90919063ffffffff16565b60405161134793929190613bc6565b60405180910390a260135461136390600163ffffffff611a1e16565b60018055979650505050505050565b61137a6115a0565b6000546001600160a01b039081169116146113a75760405162461bcd60e51b81526004016106ea90613a49565b60018110156113c85760405162461bcd60e51b81526004016106ea90613a7e565b60218190556040517f3785ba91aa39d946a094688c634e4b7b8a68e01e6f8617958324a1099057659190610728908390613baf565b60145481565b60225460ff1681565b60135481565b600b5481565b6114206115a0565b6000546001600160a01b0390811691161461144d5760405162461bcd60e51b81526004016106ea90613a49565b600a55565b60185481565b6114606115a0565b6000546001600160a01b0390811691161461148d5760405162461bcd60e51b81526004016106ea90613a49565b6001600160a01b0381166114b35760405162461bcd60e51b81526004016106ea90613934565b601780546001600160a01b0319166001600160a01b0392909216919091179055565b6114dd6115a0565b6000546001600160a01b0390811691161461150a5760405162461bcd60e51b81526004016106ea90613a49565b6001600160a01b0381166115305760405162461bcd60e51b81526004016106ea90613811565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6006546001600160a01b031681565b600e5481565b3390565b6020546000905b601354811015611711576005546000828152600f602052604080822060080154905163cdf44dab60e01b815291926001600160a01b03169163cdf44dab916115f8913091906004016136ef565b602060405180830381600087803b15801561161257600080fd5b505af1158015611626573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061164a919061363f565b905080156116db57611662838263ffffffff611c5916565b6000838152600f6020526040902060070154909350611687908263ffffffff611c5916565b6000838152600f6020526040902060070155601e546116cb906116b0908363ffffffff611bdd16565b6000848152601260205260409020549063ffffffff611c5916565b6000838152601260205260409020555b6000828152600f602052604090206009015442106117085761170482600163ffffffff611c5916565b6020555b506001016115ab565b5080156117215761172181612518565b50565b6000828152600f602052604081209061173c84612624565b6003546006840154604051633d75ee7360e11b81529293506001600160a01b0390911691637aebdce691611774918790600401613bb8565b600060405180830381600087803b15801561178e57600080fd5b505af11580156117a2573d6000803e3d6000fd5b50506006548454600286015460405163a9059cbb60e01b81526001600160a01b03938416955063a9059cbb94506117df93909216916004016136ef565b602060405180830381600087803b1580156117f957600080fd5b505af115801561180d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118319190613579565b5060065460175460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb926118689291169085906004016136ef565b602060405180830381600087803b15801561188257600080fd5b505af1158015611896573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ba9190613579565b5050505050565b6118ca816124cd565b60006118d5826109b4565b90508015611a1a576000828152600f60209081526040808320600490810184905560075482516318160ddd60e01b8152925161197e94670de0b6b3a764000094610a3d9489946001600160a01b0316936318160ddd9383830193909290829003018186803b15801561194657600080fd5b505afa15801561195a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b62919061363f565b6000848152600f60205260409020549091506119df906001600160a01b03166119c66119a8612430565b6000878152600f60205260409020600301549063ffffffff611c1716565b6007546001600160a01b0316919063ffffffff61271016565b601754600754611a02916001600160a01b0391821691168363ffffffff61271016565b601d54611a15908363ffffffff611c5916565b601d55505b5050565b6000611a6083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061276b565b9392505050565b6013548210611a885760405162461bcd60e51b81526004016106ea906137b6565b6000828152600f6020526040902080546001600160a01b03858116911614611ac25760405162461bcd60e51b81526004016106ea90613b60565b600a81015460ff1615611ae75760405162461bcd60e51b81526004016106ea90613b83565b4281600901541115611b0b5760405162461bcd60e51b81526004016106ea906138c5565b611b158383612797565b611b1e83612f1b565b600a8101805460ff191660019081179091558101546001600160a01b038516600090815260116020526040902054611b5b9163ffffffff611a1e16565b6001600160a01b0385166000908152601160205260409020556001810154600e54611b8b9163ffffffff611a1e16565b600e5560018101546040516001600160a01b038616917f1b091269e929df55d64d6ea7e9cadbe4fb38dce5ccdc995767bc515030dbfbbf91611bcf91908790613bb8565b60405180910390a250505050565b600082611bec57506000610a55565b82820282848281611bf957fe5b0414611a605760405162461bcd60e51b81526004016106ea90613a08565b6000611a6083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ff5565b600082820183811015611a605760405162461bcd60e51b81526004016106ea9061388e565b6000610b7d4360185461302c565b611c976013546124cd565b6000611d3a600760009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015611cea57600080fd5b505afa158015611cfe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d22919061363f565b610a3d84670de0b6b3a764000063ffffffff611bdd16565b90506018544310611d6157602154611d5990829063ffffffff611c1716565b601955611db0565b601854600090611d77904363ffffffff611a1e16565b90506000611d9060195483611bdd90919063ffffffff16565b602154909150611daa90610a3d858463ffffffff611c5916565b60195550505b43601a819055602154611dc9919063ffffffff611c5916565b60188190556019546040517fcd8cc848595519a86dd1d1b2a306fe80c70459f3f6f2a87b08fe223e00cb9fee92611e04928592879290613bdc565b60405180910390a15050565b6006546040516370a0823160e01b8152600091829182916001600160a01b0316906370a0823190611e459030906004016136b7565b60206040518083038186803b158015611e5d57600080fd5b505afa158015611e71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e95919061363f565b6007546040516370a0823160e01b81529192506000916001600160a01b03909116906370a0823190611ecb9030906004016136b7565b60206040518083038186803b158015611ee357600080fd5b505afa158015611ef7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1b919061363f565b6002546040516323b872dd60e01b81529192506001600160a01b0316906323b872dd90611f5090339084908a906004016136cb565b602060405180830381600087803b158015611f6a57600080fd5b505af1158015611f7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa29190613579565b5060025460405163226bf2d160e21b81526001600160a01b03909116906389afcb4490611fd39030906004016136b7565b6040805180830381600087803b158015611fec57600080fd5b505af1158015612000573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120249190613678565b50506006546040516370a0823160e01b81526000916001600160a01b0316906370a08231906120579030906004016136b7565b60206040518083038186803b15801561206f57600080fd5b505afa158015612083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a7919061363f565b6007546040516370a0823160e01b81529192506000916001600160a01b03909116906370a08231906120dd9030906004016136b7565b60206040518083038186803b1580156120f557600080fd5b505afa158015612109573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212d919061363f565b905061213f828563ffffffff611a1e16565b9550612151818463ffffffff611a1e16565b945050505050915091565b600080612174600c5442611c5990919063ffffffff16565b60065460035460405163095ea7b360e01b81529293506001600160a01b039182169263095ea7b3926121ac92169087906004016136ef565b602060405180830381600087803b1580156121c657600080fd5b505af11580156121da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121fe9190613579565b50600354604051631c57762b60e31b81526001600160a01b039091169063e2bbb158906122319086908590600401613bb8565b600060405180830381600087803b15801561224b57600080fd5b505af115801561225f573d6000803e3d6000fd5b50505050600360009054906101000a90046001600160a01b03166001600160a01b031663f154240a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156122b157600080fd5b505afa1580156122c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122e9919061363f565b9150915091565b601f546000906122fe613383565b60055460405163df57404560e01b81526001600160a01b039091169063df5740459061233090309086906004016136ef565b60806040518083038186803b15801561234857600080fd5b505afa15801561235c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061238091906135c6565b90505b428160400151101561242a576123a082600163ffffffff611c5916565b60055460405163df57404560e01b81529193506001600160a01b03169063df574045906123d390309086906004016136ef565b60806040518083038186803b1580156123eb57600080fd5b505afa1580156123ff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061242391906135c6565b9050612383565b50905090565b6000610b7d600760009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561248357600080fd5b505afa158015612497573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124bb919061363f565b69085afffa6ff50bffffff1990611c17565b6124d5610b23565b601b556124e0611c7e565b601a55601354811015611721576124f6816109b4565b6000828152600f602052604090206004810191909155601b5460059091015550565b612520613042565b6008546004805460405163095ea7b360e01b81526001600160a01b039384169363095ea7b39361255693909116918691016136ef565b602060405180830381600087803b15801561257057600080fd5b505af1158015612584573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a89190613579565b506004805460405163534a7e1d60e11b81526001600160a01b039091169163a694fc3a916125d891859101613baf565b600060405180830381600087803b1580156125f257600080fd5b505af1158015612606573d6000803e3d6000fd5b505060165461261e925090508263ffffffff611c5916565b60165550565b600061262e613042565b600082815260126020908152604080832054600f90925290912060070154601e5461266d9264e8d4a5100092610a3d92610a139163ffffffff611bdd16565b600480546000858152600f602052604090819020600701549051632e1a7d4d60e01b81529394506001600160a01b0390911692632e1a7d4d926126b1929101613baf565b600060405180830381600087803b1580156126cb57600080fd5b505af11580156126df573d6000803e3d6000fd5b5050506000838152600f602052604090206007015460165461270892509063ffffffff611a1e16565b601655919050565b6127668363a9059cbb60e01b848460405160240161272f9291906136ef565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261320b565b505050565b6000818484111561278f5760405162461bcd60e51b81526004016106ea9190613783565b505050900390565b6000828152600f60205260408120906127af84612624565b6008546040516370a0823160e01b81529192506000916001600160a01b03909116906370a08231906127e59030906004016136b7565b60206040518083038186803b1580156127fd57600080fd5b505afa158015612811573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612835919061363f565b6008546003546040805163a832806b60e01b815290519394506001600160a01b039283169363095ea7b3939092169163a832806b91600480820192602092909190829003018186803b15801561288a57600080fd5b505afa15801561289e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c29190613410565b836040518363ffffffff1660e01b81526004016128e09291906136ef565b602060405180830381600087803b1580156128fa57600080fd5b505af115801561290e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129329190613579565b506006546040516370a0823160e01b81526000916001600160a01b0316906370a08231906129649030906004016136b7565b60206040518083038186803b15801561297c57600080fd5b505afa158015612990573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129b4919061363f565b6003546006860154604051630441a3e760e41b81529293506001600160a01b039091169163441a3e70916129ec918990600401613bb8565b600060405180830381600087803b158015612a0657600080fd5b505af1158015612a1a573d6000803e3d6000fd5b50506008546003546040805163a832806b60e01b815290516001600160a01b03938416955063095ea7b39450919092169163a832806b916004808301926020929190829003018186803b158015612a7057600080fd5b505afa158015612a84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aa89190613410565b60006040518363ffffffff1660e01b8152600401612ac79291906136ef565b602060405180830381600087803b158015612ae157600080fd5b505af1158015612af5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b199190613579565b506008546040516370a0823160e01b81526000916001600160a01b0316906370a0823190612b4b9030906004016136b7565b60206040518083038186803b158015612b6357600080fd5b505afa158015612b77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b9b919061363f565b6006546040516370a0823160e01b81529192506000916001600160a01b03909116906370a0823190612bd19030906004016136b7565b60206040518083038186803b158015612be957600080fd5b505afa158015612bfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c21919061363f565b90506000612c35828563ffffffff611a1e16565b90506000612c548860020154610a138985611c5990919063ffffffff16565b90506000612c7387610a13878c60070154611c5990919063ffffffff16565b90506000612c926103e8610a3d60145486611bdd90919063ffffffff16565b90506000612cb16103e8610a3d60155486611bdd90919063ffffffff16565b6006548c549192506001600160a01b039081169163a9059cbb9116612cf2612cdf888763ffffffff611a1e16565b8f60020154611c5990919063ffffffff16565b6040518363ffffffff1660e01b8152600401612d0f9291906136ef565b602060405180830381600087803b158015612d2957600080fd5b505af1158015612d3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d619190613579565b506008548b546001600160a01b039182169163a9059cbb9116612d8a868563ffffffff611a1e16565b6040518363ffffffff1660e01b8152600401612da79291906136ef565b602060405180830381600087803b158015612dc157600080fd5b505af1158015612dd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612df99190613579565b5060065460175460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb92612e309291169086906004016136ef565b602060405180830381600087803b158015612e4a57600080fd5b505af1158015612e5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e829190613579565b5060085460175460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb92612eb99291169085906004016136ef565b602060405180830381600087803b158015612ed357600080fd5b505af1158015612ee7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f0b9190613579565b5050505050505050505050505050565b612f24816124cd565b6000612f2f826109b4565b6000838152600f60209081526040808320600490810184905560075482516318160ddd60e01b815292519596509394612f9d94670de0b6b3a764000094610a3d9489946001600160a01b03909316936318160ddd938281019392829003018186803b15801561194657600080fd5b6000848152600f6020526040902054909150611a02906001600160a01b03166119c6612fe8612fca612430565b6000888152600f60205260409020600301549063ffffffff611c1716565b849063ffffffff611c5916565b600081836130165760405162461bcd60e51b81526004016106ea9190613783565b50600083858161302257fe5b0495945050505050565b600081831061303b5781611a60565b5090919050565b60165461304e57613209565b6006546040516370a0823160e01b81526000916001600160a01b0316906370a082319061307f9030906004016136b7565b60206040518083038186803b15801561309757600080fd5b505afa1580156130ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130cf919061363f565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316633d18b9126040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561312157600080fd5b505af1158015613135573d6000803e3d6000fd5b50506006546040516370a0823160e01b8152600093506001600160a01b0390911691506370a082319061316c9030906004016136b7565b60206040518083038186803b15801561318457600080fd5b505afa158015613198573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131bc919061363f565b905060006131d0828463ffffffff611a1e16565b90506132026131f3601654610a3d64e8d4a5100085611bdd90919063ffffffff16565b601e549063ffffffff611c5916565b601e555050505b565b6060613260826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661329a9092919063ffffffff16565b805190915015612766578080602001905181019061327e9190613579565b6127665760405162461bcd60e51b81526004016106ea90613adf565b6060610e7a8484600085856132ae85613344565b6132ca5760405162461bcd60e51b81526004016106ea90613aa8565b60006060866001600160a01b031685876040516132e7919061369b565b60006040518083038185875af1925050503d8060008114613324576040519150601f19603f3d011682016040523d82523d6000602084013e613329565b606091505b509150915061333982828661334a565b979650505050505050565b3b151590565b60608315613359575081611a60565b8251156133695782518084602001fd5b8160405162461bcd60e51b81526004016106ea9190613783565b6040518060800160405280600081526020016000815260200160008152602001600081525090565b60008083601f8401126133bc578182fd5b50813567ffffffffffffffff8111156133d3578182fd5b60208301915083602080830285010111156133ed57600080fd5b9250929050565b600060208284031215613405578081fd5b8135611a6081613c27565b600060208284031215613421578081fd5b8151611a6081613c27565b600080600080600060808688031215613443578081fd5b853561344e81613c27565b9450602086013561345e81613c27565b935060408601359250606086013567ffffffffffffffff80821115613481578283fd5b81880189601f820112613492578384fd5b80359250818311156134a2578384fd5b8960208483010111156134b3578384fd5b6020810194505050809150509295509295909350565b600080604083850312156134db578182fd5b82356134e681613c27565b946020939093013593505050565b60008060008060408587031215613509578384fd5b843567ffffffffffffffff80821115613520578586fd5b61352c888389016133ab565b90965094506020870135915080821115613544578384fd5b50613551878288016133ab565b95989497509550505050565b60006020828403121561356e578081fd5b8135611a6081613c3c565b60006020828403121561358a578081fd5b8151611a6081613c3c565b600080600080608085870312156135aa578384fd5b5050823594602084013594506040840135936060013592509050565b6000608082840312156135d7578081fd5b6040516080810181811067ffffffffffffffff821117156135f6578283fd5b8060405250825181526020830151602082015260408301516040820152606083015160608201528091505092915050565b600060208284031215613638578081fd5b5035919050565b600060208284031215613650578081fd5b5051919050565b60008060408385031215613669578182fd5b50508035926020909101359150565b6000806040838503121561368a578182fd5b505080516020909101519092909150565b600082516136ad818460208701613bf7565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039b909b168b5260208b019990995260408a01979097526060890195909552608088019390935260a087019190915260c086015260e085015261010084015261012083015215156101408201526101600190565b901515815260200190565b6001600160e01b031991909116815260200190565b60006020825282518060208401526137a2816040850160208701613bf7565b601f01601f19169190910160400192915050565b6020808252600a90820152691b9bc819195c1bdcda5d60b21b604082015260600190565b6020808252601d908201527f746f206d756368206465706f73697420666f7220746869732075736572000000604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601b908201527f656d657267656e63792077697468647261772064697361626c65640000000000604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252600c908201526b1cdd1a5b1b081b1bd8dad95960a21b604082015260600190565b60208082526029908201527f4f6e6c792064656261736520706f6c69637920636f6e74726163742063616e2060408201526863616c6c207468697360b81b606082015260800190565b6020808252600c908201526b24b73b30b634b21030b2323960a11b604082015260600190565b6020808252601390820152721a5b9d985b1a59081b1bd8dac81c195c9a5bd9606a1b604082015260600190565b60208082526010908201526f0d2dcc6dee4e4cac6e840d8cadccee8d60831b604082015260600190565b602080825260119082015270151bc81b5d58da081b1c081b1bd8dad959607a1b604082015260600190565b602080825260129082015271141bdbdb081a5cdb89dd08195b98589b195960721b604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526010908201526f34b73b30b634b210323ab930ba34b7b760811b604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252600990820152683737ba1037bbb732b960b91b604082015260600190565b6020808252601290820152717769746864726177656420616c726561647960701b604082015260600190565b90815260200190565b918252602082015260400190565b9283526020830191909152604082015260600190565b93845260208401929092526040830152606082015260800190565b60005b83811015613c12578181015183820152602001613bfa565b83811115613c21576000848401525b50505050565b6001600160a01b038116811461172157600080fd5b801515811461172157600080fdfea2646970667358221220eb855e99c6c464a42727704ae25a60038705ce244c07b1d50c936de55f3e986864736f6c63430006060033000000000000000000000000e98f89a2b3aecdbe2118202826478eb02434459a0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000009248c485b0b80f76da451f167a8db30f33c709070000000000000000000000008888801af4d980682e47f1a9036e589479e835c5000000000000000000000000989edd2e87b1706ab25b2e8d9d9480de3cc383ed000000000000000000000000dc86ac6140026267e0873b27c8629efe748e714600000000000000000000000098df8d9e56b51e4ea8aa9b57f8a5df7a044234e10000000000000000000000008943eb8f104bcf826910e7d2f4d59edfe018e0e70000000000000000000000000000000000000000000000000000000000278d00000000000000000000000000f038c1cfadace2c0e5963ab5c0794b9575e1d2c20000000000000000000000000000000000000000000000000001c6bf526340000000000000000000000000000000000000000000000000000000000000001964

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106103785760003560e01c8063715018a6116101d3578063b02c43d011610104578063dfba8e7c116100a2578063f0f442601161007c578063f0f4426014610670578063f2fde38b14610683578063f4b9fa7514610696578063fd896c881461069e57610378565b8063dfba8e7c1461064d578063dfe6083514610655578063ebe2b12b1461066857610378565b8063bcb31edc116100de578063bcb31edc14610622578063bdbe038214610635578063be46aec61461063d578063cfe46aff1461064557610378565b8063b02c43d0146105dd578063b63c44e714610607578063b6b55f251461060f57610378565b80638847c82d116101715780639be3dd171161014b5780639be3dd17146105a7578063a218141b146105ba578063aea62e3f146105c2578063af127397146105d557610378565b80638847c82d146105845780638da5cb5b14610597578063995a419c1461059f57610378565b80637a784d23116101ad5780637a784d23146105435780637d4163d314610556578063838a14ca146105695780638798a9d21461057157610378565b8063715018a614610520578063779972da1461052857806378a14fbb1461053b57610378565b8063441a3e70116102ad57806359e1a6991161024b57806361d027b31161022557806361d027b3146104f5578063628a857f146104fd5780636422380a1461051057806365616d011461051857610378565b806359e1a699146104c75780635d4c3224146104cf5780635d4f8cf1146104e257610378565b80634d6ed8c4116102875780634d6ed8c41461048657806352058a7b14610499578063529f35e9146104ac57806357394d09146104bf57610378565b8063441a3e70146104635780634480085114610476578063460f6bb11461047e57610378565b80632304aa611161031a57806335b25d17116102f457806335b25d17146104435780633fd8b02f1461044b578063403e5f64146104535780634083b9101461045b57610378565b80632304aa6114610415578063291a7f871461041d578063303ed0e91461043057610378565b8063150b7a0211610356578063150b7a02146103c55780631a26af7a146103e55780631f276b6e146103fa578063201e908e1461040d57610378565b80630505c8c91461037d578063096536741461039b578063112f719d146103b0575b600080fd5b6103856106a6565b60405161039291906136b7565b60405180910390f35b6103ae6103a9366004613627565b6106b5565b005b6103b8610733565b6040516103929190613baf565b6103d86103d336600461342c565b610739565b604051610392919061376e565b6103ed61074a565b6040516103929190613763565b6103ae610408366004613657565b610758565b6103b86108e6565b6103856108ec565b6103b861042b3660046133f4565b6108fb565b6103b861043e3660046134c9565b61090d565b6103b861093b565b6103b8610941565b6103b8610947565b61038561094d565b6103ae610471366004613657565b61095c565b6103b861099f565b6103856109a5565b6103b8610494366004613627565b6109b4565b6103ae6104a736600461355d565b610a5b565b6103ae6104ba36600461355d565b610aaa565b6103b8610b23565b6103ed610b83565b6103ae6104dd36600461355d565b610b91565b6103ae6104f0366004613627565b610be0565b610385610c1a565b6103b861050b3660046133f4565b610c29565b610385610c44565b610385610c53565b6103ae610c62565b6103ae610536366004613627565b610ce1565b6103b8610d3b565b6103ae610551366004613627565b610d41565b6103ae6105643660046133f4565b610d7b565b6103ed610df8565b6103b861057f366004613595565b610e01565b6103ae61059236600461355d565b610e82565b610385610eca565b6103b8610ed9565b6103ae6105b5366004613627565b610edf565b6103b8610f19565b6103ae6105d03660046134f4565b610f1f565b610385610fbb565b6105f06105eb366004613627565b610fca565b6040516103929b9a99989796959493929190613708565b6103b8611030565b6103b861061d366004613627565b611036565b6103ae610630366004613627565b611372565b6103b86113fd565b6103ed611403565b6103b861140c565b6103b8611412565b6103ae610663366004613627565b611418565b6103b8611452565b6103ae61067e3660046133f4565b611458565b6103ae6106913660046133f4565b6114d5565b61038561158b565b6103b861159a565b6009546001600160a01b031681565b6106bd6115a0565b6000546001600160a01b039081169116146106f35760405162461bcd60e51b81526004016106ea90613a49565b60405180910390fd5b601c8190556040517f28cf650dc6bbdd6a6fa3026f34132cba6ec966fa67dfd5fe58356839efb63be890610728908390613baf565b60405180910390a150565b601b5481565b630a85bd0160e11b95945050505050565b602254610100900460ff1681565b6002600154141561077b5760405162461bcd60e51b81526004016106ea90613b29565b6002600155602254610100900460ff166107a75760405162461bcd60e51b81526004016106ea90613857565b60135482106107c85760405162461bcd60e51b81526004016106ea906137b6565b6107d06115a4565b6000828152600f6020526040902080546001600160a01b031633146108075760405162461bcd60e51b81526004016106ea90613b60565b600a81015460ff161561082c5760405162461bcd60e51b81526004016106ea90613b83565b6108368383611724565b61083f836118c1565b600a8101805460ff19166001908117909155810154336000908152601160205260409020546108739163ffffffff611a1e16565b336000908152601160205260409020556001810154600e5461089a9163ffffffff611a1e16565b600e55600181015460405133917f5712bb005ae686d72a5551442c8cb306ec1f7fbbc1ae6e607207860ac017dc8a916108d591908790613bb8565b60405180910390a250506001805550565b60215481565b6008546001600160a01b031681565b60116020526000908152604090205481565b6010602052816000526040600020818154811061092657fe5b90600052602060002001600091509150505481565b601c5481565b600c5481565b60165481565b6004546001600160a01b031681565b6002600154141561097f5760405162461bcd60e51b81526004016106ea90613b29565b600260015561098c6115a4565b610997338383611a67565b505060018055565b601d5481565b6003546001600160a01b031681565b600060135482106109d75760405162461bcd60e51b81526004016106ea906137b6565b6000828152600f602052604090206004810154600590910154610a559190610a4990670de0b6b3a764000090610a3d90610a1f90610a13610b23565b9063ffffffff611a1e16565b6000888152600f60205260409020600101549063ffffffff611bdd16565b9063ffffffff611c1716565b9063ffffffff611c5916565b92915050565b610a636115a0565b6000546001600160a01b03908116911614610a905760405162461bcd60e51b81526004016106ea90613a49565b600d80549115156101000261ff0019909216919091179055565b610ab26115a0565b6000546001600160a01b03908116911614610adf5760405162461bcd60e51b81526004016106ea90613a49565b6022805460ff191682151517908190556040517f0fc5960ebe0d769d367a5952c3d384663054acd195413084d4c5e3a71c4a7d85916107289160ff90911690613763565b6000600e5460001415610b395750601b54610b80565b610b7d610b6e600e54610a3d670de0b6b3a7640000610b62601954610b62601a54610a13611c7e565b9063ffffffff611bdd16565b601b549063ffffffff611c5916565b90505b90565b600d54610100900460ff1681565b610b996115a0565b6000546001600160a01b03908116911614610bc65760405162461bcd60e51b81526004016106ea90613a49565b602280549115156101000261ff0019909216919091179055565b610be86115a0565b6000546001600160a01b03908116911614610c155760405162461bcd60e51b81526004016106ea90613a49565b601555565b6017546001600160a01b031681565b6001600160a01b031660009081526010602052604090205490565b6007546001600160a01b031681565b6002546001600160a01b031681565b610c6a6115a0565b6000546001600160a01b03908116911614610c975760405162461bcd60e51b81526004016106ea90613a49565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b610ce96115a0565b6000546001600160a01b03908116911614610d165760405162461bcd60e51b81526004016106ea90613a49565b60008111610d365760405162461bcd60e51b81526004016106ea9061395a565b600c55565b60155481565b610d496115a0565b6000546001600160a01b03908116911614610d765760405162461bcd60e51b81526004016106ea90613a49565b600b55565b610d836115a0565b6000546001600160a01b03908116911614610db05760405162461bcd60e51b81526004016106ea90613a49565b6001600160a01b038116610dd65760405162461bcd60e51b81526004016106ea90613934565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600d5460ff1681565b6009546000906001600160a01b03163314610e2e5760405162461bcd60e51b81526004016106ea906138eb565b601854431115610e76576000610e5b670de0b6b3a7640000610a3d601c5486611bdd90919063ffffffff16565b9050808310610e7457610e6d81611c8c565b9050610e7a565b505b5060005b949350505050565b610e8a6115a0565b6000546001600160a01b03908116911614610eb75760405162461bcd60e51b81526004016106ea90613a49565b600d805460ff1916911515919091179055565b6000546001600160a01b031690565b60195481565b610ee76115a0565b6000546001600160a01b03908116911614610f145760405162461bcd60e51b81526004016106ea90613a49565b601455565b601a5481565b60026001541415610f425760405162461bcd60e51b81526004016106ea90613b29565b6002600155828114610f665760405162461bcd60e51b81526004016106ea90613987565b610f6e6115a4565b60005b83811015610fb057610fa833868684818110610f8957fe5b90506020020135858585818110610f9c57fe5b90506020020135611a67565b600101610f71565b505060018055505050565b6005546001600160a01b031681565b600f60205260009081526040902080546001820154600283015460038401546004850154600586015460068701546007880154600889015460098a0154600a909a01546001600160a01b0390991699979896979596949593949293919290919060ff168b565b600a5481565b60225460009060ff1661105b5760405162461bcd60e51b81526004016106ea906139dc565b6002600154141561107e5760405162461bcd60e51b81526004016106ea90613b29565b6002600155600d5460ff1615806110a95750600b54600e546110a6908463ffffffff611c5916565b11155b6110c55760405162461bcd60e51b81526004016106ea906139b1565b600d54610100900460ff1615806110fd5750600a54336000908152601160205260409020546110fa908463ffffffff611c5916565b11155b6111195760405162461bcd60e51b81526004016106ea906137da565b60008061112584611e10565b915091506000806111358461215c565b33600090815260116020526040902054919350915061115a908763ffffffff611c5916565b33600090815260116020526040902055600e5461117d908763ffffffff611c5916565b600e556111886115a4565b60006111926122f0565b9050604051806101600160405280336001600160a01b031681526020018881526020018681526020016111d36111c6612430565b879063ffffffff611bdd16565b81526000602080830182905260408084018390526060808501899052608080860185905260a080870189905260c08088018b905260e0978801879052601380548852600f87528588208a5181546001600160a01b0319166001600160a01b039091161781558a8801516001808301919091558b8801516002830155958b01516003820155938a0151600485015591890151600584015588015160068301559587015160078201556101008701516008820155610120870151600982015561014090960151600a909601805460ff1916961515969096179095553383526010825282209254835480860185559383529120909101556112d2908290611c59565b601f556013546112e990600163ffffffff611c5916565b6013556112f5836124cd565b336001600160a01b03167fb49bb132260f6aa1c86e2d2a3957c097216e6ec9b5fa15867289f058b4d297ac88846113386001601354611a1e90919063ffffffff16565b60405161134793929190613bc6565b60405180910390a260135461136390600163ffffffff611a1e16565b60018055979650505050505050565b61137a6115a0565b6000546001600160a01b039081169116146113a75760405162461bcd60e51b81526004016106ea90613a49565b60018110156113c85760405162461bcd60e51b81526004016106ea90613a7e565b60218190556040517f3785ba91aa39d946a094688c634e4b7b8a68e01e6f8617958324a1099057659190610728908390613baf565b60145481565b60225460ff1681565b60135481565b600b5481565b6114206115a0565b6000546001600160a01b0390811691161461144d5760405162461bcd60e51b81526004016106ea90613a49565b600a55565b60185481565b6114606115a0565b6000546001600160a01b0390811691161461148d5760405162461bcd60e51b81526004016106ea90613a49565b6001600160a01b0381166114b35760405162461bcd60e51b81526004016106ea90613934565b601780546001600160a01b0319166001600160a01b0392909216919091179055565b6114dd6115a0565b6000546001600160a01b0390811691161461150a5760405162461bcd60e51b81526004016106ea90613a49565b6001600160a01b0381166115305760405162461bcd60e51b81526004016106ea90613811565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6006546001600160a01b031681565b600e5481565b3390565b6020546000905b601354811015611711576005546000828152600f602052604080822060080154905163cdf44dab60e01b815291926001600160a01b03169163cdf44dab916115f8913091906004016136ef565b602060405180830381600087803b15801561161257600080fd5b505af1158015611626573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061164a919061363f565b905080156116db57611662838263ffffffff611c5916565b6000838152600f6020526040902060070154909350611687908263ffffffff611c5916565b6000838152600f6020526040902060070155601e546116cb906116b0908363ffffffff611bdd16565b6000848152601260205260409020549063ffffffff611c5916565b6000838152601260205260409020555b6000828152600f602052604090206009015442106117085761170482600163ffffffff611c5916565b6020555b506001016115ab565b5080156117215761172181612518565b50565b6000828152600f602052604081209061173c84612624565b6003546006840154604051633d75ee7360e11b81529293506001600160a01b0390911691637aebdce691611774918790600401613bb8565b600060405180830381600087803b15801561178e57600080fd5b505af11580156117a2573d6000803e3d6000fd5b50506006548454600286015460405163a9059cbb60e01b81526001600160a01b03938416955063a9059cbb94506117df93909216916004016136ef565b602060405180830381600087803b1580156117f957600080fd5b505af115801561180d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118319190613579565b5060065460175460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb926118689291169085906004016136ef565b602060405180830381600087803b15801561188257600080fd5b505af1158015611896573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ba9190613579565b5050505050565b6118ca816124cd565b60006118d5826109b4565b90508015611a1a576000828152600f60209081526040808320600490810184905560075482516318160ddd60e01b8152925161197e94670de0b6b3a764000094610a3d9489946001600160a01b0316936318160ddd9383830193909290829003018186803b15801561194657600080fd5b505afa15801561195a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b62919061363f565b6000848152600f60205260409020549091506119df906001600160a01b03166119c66119a8612430565b6000878152600f60205260409020600301549063ffffffff611c1716565b6007546001600160a01b0316919063ffffffff61271016565b601754600754611a02916001600160a01b0391821691168363ffffffff61271016565b601d54611a15908363ffffffff611c5916565b601d55505b5050565b6000611a6083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061276b565b9392505050565b6013548210611a885760405162461bcd60e51b81526004016106ea906137b6565b6000828152600f6020526040902080546001600160a01b03858116911614611ac25760405162461bcd60e51b81526004016106ea90613b60565b600a81015460ff1615611ae75760405162461bcd60e51b81526004016106ea90613b83565b4281600901541115611b0b5760405162461bcd60e51b81526004016106ea906138c5565b611b158383612797565b611b1e83612f1b565b600a8101805460ff191660019081179091558101546001600160a01b038516600090815260116020526040902054611b5b9163ffffffff611a1e16565b6001600160a01b0385166000908152601160205260409020556001810154600e54611b8b9163ffffffff611a1e16565b600e5560018101546040516001600160a01b038616917f1b091269e929df55d64d6ea7e9cadbe4fb38dce5ccdc995767bc515030dbfbbf91611bcf91908790613bb8565b60405180910390a250505050565b600082611bec57506000610a55565b82820282848281611bf957fe5b0414611a605760405162461bcd60e51b81526004016106ea90613a08565b6000611a6083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ff5565b600082820183811015611a605760405162461bcd60e51b81526004016106ea9061388e565b6000610b7d4360185461302c565b611c976013546124cd565b6000611d3a600760009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015611cea57600080fd5b505afa158015611cfe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d22919061363f565b610a3d84670de0b6b3a764000063ffffffff611bdd16565b90506018544310611d6157602154611d5990829063ffffffff611c1716565b601955611db0565b601854600090611d77904363ffffffff611a1e16565b90506000611d9060195483611bdd90919063ffffffff16565b602154909150611daa90610a3d858463ffffffff611c5916565b60195550505b43601a819055602154611dc9919063ffffffff611c5916565b60188190556019546040517fcd8cc848595519a86dd1d1b2a306fe80c70459f3f6f2a87b08fe223e00cb9fee92611e04928592879290613bdc565b60405180910390a15050565b6006546040516370a0823160e01b8152600091829182916001600160a01b0316906370a0823190611e459030906004016136b7565b60206040518083038186803b158015611e5d57600080fd5b505afa158015611e71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e95919061363f565b6007546040516370a0823160e01b81529192506000916001600160a01b03909116906370a0823190611ecb9030906004016136b7565b60206040518083038186803b158015611ee357600080fd5b505afa158015611ef7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1b919061363f565b6002546040516323b872dd60e01b81529192506001600160a01b0316906323b872dd90611f5090339084908a906004016136cb565b602060405180830381600087803b158015611f6a57600080fd5b505af1158015611f7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa29190613579565b5060025460405163226bf2d160e21b81526001600160a01b03909116906389afcb4490611fd39030906004016136b7565b6040805180830381600087803b158015611fec57600080fd5b505af1158015612000573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120249190613678565b50506006546040516370a0823160e01b81526000916001600160a01b0316906370a08231906120579030906004016136b7565b60206040518083038186803b15801561206f57600080fd5b505afa158015612083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a7919061363f565b6007546040516370a0823160e01b81529192506000916001600160a01b03909116906370a08231906120dd9030906004016136b7565b60206040518083038186803b1580156120f557600080fd5b505afa158015612109573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212d919061363f565b905061213f828563ffffffff611a1e16565b9550612151818463ffffffff611a1e16565b945050505050915091565b600080612174600c5442611c5990919063ffffffff16565b60065460035460405163095ea7b360e01b81529293506001600160a01b039182169263095ea7b3926121ac92169087906004016136ef565b602060405180830381600087803b1580156121c657600080fd5b505af11580156121da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121fe9190613579565b50600354604051631c57762b60e31b81526001600160a01b039091169063e2bbb158906122319086908590600401613bb8565b600060405180830381600087803b15801561224b57600080fd5b505af115801561225f573d6000803e3d6000fd5b50505050600360009054906101000a90046001600160a01b03166001600160a01b031663f154240a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156122b157600080fd5b505afa1580156122c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122e9919061363f565b9150915091565b601f546000906122fe613383565b60055460405163df57404560e01b81526001600160a01b039091169063df5740459061233090309086906004016136ef565b60806040518083038186803b15801561234857600080fd5b505afa15801561235c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061238091906135c6565b90505b428160400151101561242a576123a082600163ffffffff611c5916565b60055460405163df57404560e01b81529193506001600160a01b03169063df574045906123d390309086906004016136ef565b60806040518083038186803b1580156123eb57600080fd5b505afa1580156123ff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061242391906135c6565b9050612383565b50905090565b6000610b7d600760009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561248357600080fd5b505afa158015612497573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124bb919061363f565b69085afffa6ff50bffffff1990611c17565b6124d5610b23565b601b556124e0611c7e565b601a55601354811015611721576124f6816109b4565b6000828152600f602052604090206004810191909155601b5460059091015550565b612520613042565b6008546004805460405163095ea7b360e01b81526001600160a01b039384169363095ea7b39361255693909116918691016136ef565b602060405180830381600087803b15801561257057600080fd5b505af1158015612584573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a89190613579565b506004805460405163534a7e1d60e11b81526001600160a01b039091169163a694fc3a916125d891859101613baf565b600060405180830381600087803b1580156125f257600080fd5b505af1158015612606573d6000803e3d6000fd5b505060165461261e925090508263ffffffff611c5916565b60165550565b600061262e613042565b600082815260126020908152604080832054600f90925290912060070154601e5461266d9264e8d4a5100092610a3d92610a139163ffffffff611bdd16565b600480546000858152600f602052604090819020600701549051632e1a7d4d60e01b81529394506001600160a01b0390911692632e1a7d4d926126b1929101613baf565b600060405180830381600087803b1580156126cb57600080fd5b505af11580156126df573d6000803e3d6000fd5b5050506000838152600f602052604090206007015460165461270892509063ffffffff611a1e16565b601655919050565b6127668363a9059cbb60e01b848460405160240161272f9291906136ef565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261320b565b505050565b6000818484111561278f5760405162461bcd60e51b81526004016106ea9190613783565b505050900390565b6000828152600f60205260408120906127af84612624565b6008546040516370a0823160e01b81529192506000916001600160a01b03909116906370a08231906127e59030906004016136b7565b60206040518083038186803b1580156127fd57600080fd5b505afa158015612811573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612835919061363f565b6008546003546040805163a832806b60e01b815290519394506001600160a01b039283169363095ea7b3939092169163a832806b91600480820192602092909190829003018186803b15801561288a57600080fd5b505afa15801561289e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c29190613410565b836040518363ffffffff1660e01b81526004016128e09291906136ef565b602060405180830381600087803b1580156128fa57600080fd5b505af115801561290e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129329190613579565b506006546040516370a0823160e01b81526000916001600160a01b0316906370a08231906129649030906004016136b7565b60206040518083038186803b15801561297c57600080fd5b505afa158015612990573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129b4919061363f565b6003546006860154604051630441a3e760e41b81529293506001600160a01b039091169163441a3e70916129ec918990600401613bb8565b600060405180830381600087803b158015612a0657600080fd5b505af1158015612a1a573d6000803e3d6000fd5b50506008546003546040805163a832806b60e01b815290516001600160a01b03938416955063095ea7b39450919092169163a832806b916004808301926020929190829003018186803b158015612a7057600080fd5b505afa158015612a84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aa89190613410565b60006040518363ffffffff1660e01b8152600401612ac79291906136ef565b602060405180830381600087803b158015612ae157600080fd5b505af1158015612af5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b199190613579565b506008546040516370a0823160e01b81526000916001600160a01b0316906370a0823190612b4b9030906004016136b7565b60206040518083038186803b158015612b6357600080fd5b505afa158015612b77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b9b919061363f565b6006546040516370a0823160e01b81529192506000916001600160a01b03909116906370a0823190612bd19030906004016136b7565b60206040518083038186803b158015612be957600080fd5b505afa158015612bfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c21919061363f565b90506000612c35828563ffffffff611a1e16565b90506000612c548860020154610a138985611c5990919063ffffffff16565b90506000612c7387610a13878c60070154611c5990919063ffffffff16565b90506000612c926103e8610a3d60145486611bdd90919063ffffffff16565b90506000612cb16103e8610a3d60155486611bdd90919063ffffffff16565b6006548c549192506001600160a01b039081169163a9059cbb9116612cf2612cdf888763ffffffff611a1e16565b8f60020154611c5990919063ffffffff16565b6040518363ffffffff1660e01b8152600401612d0f9291906136ef565b602060405180830381600087803b158015612d2957600080fd5b505af1158015612d3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d619190613579565b506008548b546001600160a01b039182169163a9059cbb9116612d8a868563ffffffff611a1e16565b6040518363ffffffff1660e01b8152600401612da79291906136ef565b602060405180830381600087803b158015612dc157600080fd5b505af1158015612dd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612df99190613579565b5060065460175460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb92612e309291169086906004016136ef565b602060405180830381600087803b158015612e4a57600080fd5b505af1158015612e5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e829190613579565b5060085460175460405163a9059cbb60e01b81526001600160a01b039283169263a9059cbb92612eb99291169085906004016136ef565b602060405180830381600087803b158015612ed357600080fd5b505af1158015612ee7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f0b9190613579565b5050505050505050505050505050565b612f24816124cd565b6000612f2f826109b4565b6000838152600f60209081526040808320600490810184905560075482516318160ddd60e01b815292519596509394612f9d94670de0b6b3a764000094610a3d9489946001600160a01b03909316936318160ddd938281019392829003018186803b15801561194657600080fd5b6000848152600f6020526040902054909150611a02906001600160a01b03166119c6612fe8612fca612430565b6000888152600f60205260409020600301549063ffffffff611c1716565b849063ffffffff611c5916565b600081836130165760405162461bcd60e51b81526004016106ea9190613783565b50600083858161302257fe5b0495945050505050565b600081831061303b5781611a60565b5090919050565b60165461304e57613209565b6006546040516370a0823160e01b81526000916001600160a01b0316906370a082319061307f9030906004016136b7565b60206040518083038186803b15801561309757600080fd5b505afa1580156130ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130cf919061363f565b9050600460009054906101000a90046001600160a01b03166001600160a01b0316633d18b9126040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561312157600080fd5b505af1158015613135573d6000803e3d6000fd5b50506006546040516370a0823160e01b8152600093506001600160a01b0390911691506370a082319061316c9030906004016136b7565b60206040518083038186803b15801561318457600080fd5b505afa158015613198573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131bc919061363f565b905060006131d0828463ffffffff611a1e16565b90506132026131f3601654610a3d64e8d4a5100085611bdd90919063ffffffff16565b601e549063ffffffff611c5916565b601e555050505b565b6060613260826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661329a9092919063ffffffff16565b805190915015612766578080602001905181019061327e9190613579565b6127665760405162461bcd60e51b81526004016106ea90613adf565b6060610e7a8484600085856132ae85613344565b6132ca5760405162461bcd60e51b81526004016106ea90613aa8565b60006060866001600160a01b031685876040516132e7919061369b565b60006040518083038185875af1925050503d8060008114613324576040519150601f19603f3d011682016040523d82523d6000602084013e613329565b606091505b509150915061333982828661334a565b979650505050505050565b3b151590565b60608315613359575081611a60565b8251156133695782518084602001fd5b8160405162461bcd60e51b81526004016106ea9190613783565b6040518060800160405280600081526020016000815260200160008152602001600081525090565b60008083601f8401126133bc578182fd5b50813567ffffffffffffffff8111156133d3578182fd5b60208301915083602080830285010111156133ed57600080fd5b9250929050565b600060208284031215613405578081fd5b8135611a6081613c27565b600060208284031215613421578081fd5b8151611a6081613c27565b600080600080600060808688031215613443578081fd5b853561344e81613c27565b9450602086013561345e81613c27565b935060408601359250606086013567ffffffffffffffff80821115613481578283fd5b81880189601f820112613492578384fd5b80359250818311156134a2578384fd5b8960208483010111156134b3578384fd5b6020810194505050809150509295509295909350565b600080604083850312156134db578182fd5b82356134e681613c27565b946020939093013593505050565b60008060008060408587031215613509578384fd5b843567ffffffffffffffff80821115613520578586fd5b61352c888389016133ab565b90965094506020870135915080821115613544578384fd5b50613551878288016133ab565b95989497509550505050565b60006020828403121561356e578081fd5b8135611a6081613c3c565b60006020828403121561358a578081fd5b8151611a6081613c3c565b600080600080608085870312156135aa578384fd5b5050823594602084013594506040840135936060013592509050565b6000608082840312156135d7578081fd5b6040516080810181811067ffffffffffffffff821117156135f6578283fd5b8060405250825181526020830151602082015260408301516040820152606083015160608201528091505092915050565b600060208284031215613638578081fd5b5035919050565b600060208284031215613650578081fd5b5051919050565b60008060408385031215613669578182fd5b50508035926020909101359150565b6000806040838503121561368a578182fd5b505080516020909101519092909150565b600082516136ad818460208701613bf7565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039b909b168b5260208b019990995260408a01979097526060890195909552608088019390935260a087019190915260c086015260e085015261010084015261012083015215156101408201526101600190565b901515815260200190565b6001600160e01b031991909116815260200190565b60006020825282518060208401526137a2816040850160208701613bf7565b601f01601f19169190910160400192915050565b6020808252600a90820152691b9bc819195c1bdcda5d60b21b604082015260600190565b6020808252601d908201527f746f206d756368206465706f73697420666f7220746869732075736572000000604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601b908201527f656d657267656e63792077697468647261772064697361626c65640000000000604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252600c908201526b1cdd1a5b1b081b1bd8dad95960a21b604082015260600190565b60208082526029908201527f4f6e6c792064656261736520706f6c69637920636f6e74726163742063616e2060408201526863616c6c207468697360b81b606082015260800190565b6020808252600c908201526b24b73b30b634b21030b2323960a11b604082015260600190565b6020808252601390820152721a5b9d985b1a59081b1bd8dac81c195c9a5bd9606a1b604082015260600190565b60208082526010908201526f0d2dcc6dee4e4cac6e840d8cadccee8d60831b604082015260600190565b602080825260119082015270151bc81b5d58da081b1c081b1bd8dad959607a1b604082015260600190565b602080825260129082015271141bdbdb081a5cdb89dd08195b98589b195960721b604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526010908201526f34b73b30b634b210323ab930ba34b7b760811b604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252600990820152683737ba1037bbb732b960b91b604082015260600190565b6020808252601290820152717769746864726177656420616c726561647960701b604082015260600190565b90815260200190565b918252602082015260400190565b9283526020830191909152604082015260600190565b93845260208401929092526040830152606082015260800190565b60005b83811015613c12578181015183820152602001613bfa565b83811115613c21576000848401525b50505050565b6001600160a01b038116811461172157600080fd5b801515811461172157600080fdfea2646970667358221220eb855e99c6c464a42727704ae25a60038705ce244c07b1d50c936de55f3e986864736f6c63430006060033

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

000000000000000000000000e98f89a2b3aecdbe2118202826478eb02434459a0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000009248c485b0b80f76da451f167a8db30f33c709070000000000000000000000008888801af4d980682e47f1a9036e589479e835c5000000000000000000000000989edd2e87b1706ab25b2e8d9d9480de3cc383ed000000000000000000000000dc86ac6140026267e0873b27c8629efe748e714600000000000000000000000098df8d9e56b51e4ea8aa9b57f8a5df7a044234e10000000000000000000000008943eb8f104bcf826910e7d2f4d59edfe018e0e70000000000000000000000000000000000000000000000000000000000278d00000000000000000000000000f038c1cfadace2c0e5963ab5c0794b9575e1d2c20000000000000000000000000000000000000000000000000001c6bf526340000000000000000000000000000000000000000000000000000000000000001964

-----Decoded View---------------
Arg [0] : _debaseDaiPair (address): 0xE98f89a2B3AeCDBE2118202826478Eb02434459A
Arg [1] : _dai (address): 0x6B175474E89094C44Da98b954EedeAC495271d0F
Arg [2] : _debase (address): 0x9248c485b0B80f76DA451f167A8db30F33C70907
Arg [3] : _mph (address): 0x8888801aF4d980682e47f1A9036e589479e835C5
Arg [4] : _policy (address): 0x989Edd2e87B1706AB25b2E8d9D9480DE3Cc383eD
Arg [5] : _daiFixedPool (address): 0xDC86AC6140026267E0873B27c8629eFE748E7146
Arg [6] : _mphStakePool (address): 0x98df8D9E56b51e4Ea8AA9b57F8A5Df7A044234e1
Arg [7] : _mphVesting (address): 0x8943eb8F104bCf826910e7d2f4D59edfe018e0e7
Arg [8] : _lockPeriod (uint256): 2592000
Arg [9] : _treasury (address): 0xf038C1cfaDAce2C0E5963Ab5C0794B9575e1D2c2
Arg [10] : _debaseRewardPercentage (uint256): 500000000000000
Arg [11] : _blockDuration (uint256): 6500

-----Encoded View---------------
12 Constructor Arguments found :
Arg [0] : 000000000000000000000000e98f89a2b3aecdbe2118202826478eb02434459a
Arg [1] : 0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f
Arg [2] : 0000000000000000000000009248c485b0b80f76da451f167a8db30f33c70907
Arg [3] : 0000000000000000000000008888801af4d980682e47f1a9036e589479e835c5
Arg [4] : 000000000000000000000000989edd2e87b1706ab25b2e8d9d9480de3cc383ed
Arg [5] : 000000000000000000000000dc86ac6140026267e0873b27c8629efe748e7146
Arg [6] : 00000000000000000000000098df8d9e56b51e4ea8aa9b57f8a5df7a044234e1
Arg [7] : 0000000000000000000000008943eb8f104bcf826910e7d2f4d59edfe018e0e7
Arg [8] : 0000000000000000000000000000000000000000000000000000000000278d00
Arg [9] : 000000000000000000000000f038c1cfadace2c0e5963ab5c0794b9575e1d2c2
Arg [10] : 0000000000000000000000000000000000000000000000000001c6bf52634000
Arg [11] : 0000000000000000000000000000000000000000000000000000000000001964


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.