Contract 0xd4e908fd628f7f16336919d28b0efd44687c0e3e 1

Contract Overview

Balance:
0 BNB
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xc27111e602a2bbedbe290e9036763ae395bf6796e7428ab5ce82e5b0fc24e31a0x60806040106912282021-07-18 6:10:53186 days 23 hrs ago0xbee397129374d0b4db7bf1654936951e5bdfe5a6 IN  Create: QToken0 BNB0.0445759
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x06d50ac2e8f862ae6a368b166d7b85e7896e18784cc57da026e8f405eaaf1041114059232021-08-12 5:01:06162 days 44 mins ago 0x80d1486ef600cc56d4df9ed33baf53c60d5a629b 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x06d50ac2e8f862ae6a368b166d7b85e7896e18784cc57da026e8f405eaaf1041114059232021-08-12 5:01:06162 days 44 mins ago 0x80d1486ef600cc56d4df9ed33baf53c60d5a629b 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0xe8dcf30b96c5781cb6f2b337cbbb2dae8f79b999f05afbef7101abee1b796ffa114059122021-08-12 5:00:33162 days 45 mins ago 0x80d1486ef600cc56d4df9ed33baf53c60d5a629b 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0xe8dcf30b96c5781cb6f2b337cbbb2dae8f79b999f05afbef7101abee1b796ffa114059122021-08-12 5:00:33162 days 45 mins ago 0x80d1486ef600cc56d4df9ed33baf53c60d5a629b 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0xe8dcf30b96c5781cb6f2b337cbbb2dae8f79b999f05afbef7101abee1b796ffa114059122021-08-12 5:00:33162 days 45 mins ago 0x80d1486ef600cc56d4df9ed33baf53c60d5a629b 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x3f67f94571d4b42d27da6cab3a77b5c8d6a7106d822b616c006456b270a2311c114055692021-08-12 4:43:24162 days 1 hr ago 0xb8243be1d145a528687479723b394485ce3ce773 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x3f67f94571d4b42d27da6cab3a77b5c8d6a7106d822b616c006456b270a2311c114055692021-08-12 4:43:24162 days 1 hr ago 0xb8243be1d145a528687479723b394485ce3ce773 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x3f67f94571d4b42d27da6cab3a77b5c8d6a7106d822b616c006456b270a2311c114055692021-08-12 4:43:24162 days 1 hr ago 0xb8243be1d145a528687479723b394485ce3ce773 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x3f67f94571d4b42d27da6cab3a77b5c8d6a7106d822b616c006456b270a2311c114055692021-08-12 4:43:24162 days 1 hr ago 0xb8243be1d145a528687479723b394485ce3ce773 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x57ab0386c1f339d1cba47efddc64946f167953e47f3a3d70c7b7bb1c26838fa9114055642021-08-12 4:43:09162 days 1 hr ago 0xb8243be1d145a528687479723b394485ce3ce773 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x57ab0386c1f339d1cba47efddc64946f167953e47f3a3d70c7b7bb1c26838fa9114055642021-08-12 4:43:09162 days 1 hr ago 0xb8243be1d145a528687479723b394485ce3ce773 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x57ab0386c1f339d1cba47efddc64946f167953e47f3a3d70c7b7bb1c26838fa9114055642021-08-12 4:43:09162 days 1 hr ago 0xb8243be1d145a528687479723b394485ce3ce773 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x57ab0386c1f339d1cba47efddc64946f167953e47f3a3d70c7b7bb1c26838fa9114055642021-08-12 4:43:09162 days 1 hr ago 0xb8243be1d145a528687479723b394485ce3ce773 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x57ab0386c1f339d1cba47efddc64946f167953e47f3a3d70c7b7bb1c26838fa9114055642021-08-12 4:43:09162 days 1 hr ago 0xb8243be1d145a528687479723b394485ce3ce773 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x57ab0386c1f339d1cba47efddc64946f167953e47f3a3d70c7b7bb1c26838fa9114055642021-08-12 4:43:09162 days 1 hr ago 0x38e2ab4cadd92b87739aa5a71847e0b70bd4e631 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x57ab0386c1f339d1cba47efddc64946f167953e47f3a3d70c7b7bb1c26838fa9114055642021-08-12 4:43:09162 days 1 hr ago 0x67b806ab830801348ce719e0705cc2f2718117a1 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x57ab0386c1f339d1cba47efddc64946f167953e47f3a3d70c7b7bb1c26838fa9114055642021-08-12 4:43:09162 days 1 hr ago 0x80d1486ef600cc56d4df9ed33baf53c60d5a629b 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x57ab0386c1f339d1cba47efddc64946f167953e47f3a3d70c7b7bb1c26838fa9114055642021-08-12 4:43:09162 days 1 hr ago 0xb8243be1d145a528687479723b394485ce3ce773 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x57ab0386c1f339d1cba47efddc64946f167953e47f3a3d70c7b7bb1c26838fa9114055642021-08-12 4:43:09162 days 1 hr ago 0x38e2ab4cadd92b87739aa5a71847e0b70bd4e631 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x57ab0386c1f339d1cba47efddc64946f167953e47f3a3d70c7b7bb1c26838fa9114055642021-08-12 4:43:09162 days 1 hr ago 0x67b806ab830801348ce719e0705cc2f2718117a1 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x57ab0386c1f339d1cba47efddc64946f167953e47f3a3d70c7b7bb1c26838fa9114055642021-08-12 4:43:09162 days 1 hr ago 0x80d1486ef600cc56d4df9ed33baf53c60d5a629b 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x57ab0386c1f339d1cba47efddc64946f167953e47f3a3d70c7b7bb1c26838fa9114055642021-08-12 4:43:09162 days 1 hr ago 0xb8243be1d145a528687479723b394485ce3ce773 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x6184cb3f10c22346ea1b3aea30ddf6170829abef43a62e6fc13b86aeee70f628114055542021-08-12 4:42:39162 days 1 hr ago 0x38e2ab4cadd92b87739aa5a71847e0b70bd4e631 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x6184cb3f10c22346ea1b3aea30ddf6170829abef43a62e6fc13b86aeee70f628114055542021-08-12 4:42:39162 days 1 hr ago 0x38e2ab4cadd92b87739aa5a71847e0b70bd4e631 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
0x6184cb3f10c22346ea1b3aea30ddf6170829abef43a62e6fc13b86aeee70f628114055542021-08-12 4:42:39162 days 1 hr ago 0x38e2ab4cadd92b87739aa5a71847e0b70bd4e631 0xd4e908fd628f7f16336919d28b0efd44687c0e3e0 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
QToken

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 19 : QToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

/*
      ___       ___       ___       ___       ___
     /\  \     /\__\     /\  \     /\  \     /\  \
    /::\  \   /:/ _/_   /::\  \   _\:\  \    \:\  \
    \:\:\__\ /:/_/\__\ /::\:\__\ /\/::\__\   /::\__\
     \::/  / \:\/:/  / \:\::/  / \::/\/__/  /:/\/__/
     /:/  /   \::/  /   \::/  /   \:\__\    \/__/
     \/__/     \/__/     \/__/     \/__/

*
* MIT License
* ===========
*
* Copyright (c) 2021 QubitFinance
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/

import "@openzeppelin/contracts/math/Math.sol";

import "../interfaces/IPancakeRouter02.sol";
import "../interfaces/IQDistributor.sol";
import "../library/QConstant.sol";
import "../library/SafeToken.sol";
import "./QMarket.sol";


contract QToken is QMarket {
    using SafeMath for uint;
    using SafeToken for address;

    /* ========== CONSTANT ========== */

    IQDistributor public constant qDistributor = IQDistributor(0xA2897BEDE359e56F67D06F42C39869719E59bEcc);

    /* ========== STATE VARIABLES ========== */

    string public name;
    string public symbol;
    uint8 public decimals;

    mapping(address => mapping(address => uint)) private _transferAllowances;

    /* ========== EVENT ========== */

    event Mint(address minter, uint mintAmount);
    event Redeem(address account, uint underlyingAmount, uint qTokenAmount);

    event Borrow(address account, uint ammount, uint accountBorrow);
    event RepayBorrow(address payer, address borrower, uint amount, uint accountBorrow);
    event LiquidateBorrow(address liquidator, address borrower, uint amount, address qTokenCollateral, uint seizeAmount);

    event Transfer(address indexed from, address indexed to, uint amount);
    event Approval(address indexed owner, address indexed spender, uint amount);

    /* ========== INITIALIZER ========== */

    function initialize(string memory _name, string memory _symbol, uint8 _decimals) external initializer {
        __QMarket_init();

        name = _name;
        symbol = _symbol;
        decimals = _decimals;
    }

    /* ========== VIEWS ========== */

    function allowance(address account, address spender) external view override returns (uint) {
        return _transferAllowances[account][spender];
    }

    function getOwner() external view returns (address) {
        return owner();
    }

    /* ========== MUTATIVE FUNCTIONS ========== */

    function transfer(address dst, uint amount) external override accrue nonReentrant returns (bool) {
        _transferTokens(msg.sender, msg.sender, dst, amount);
        return true;
    }

    function transferFrom(address src, address dst, uint amount) external override accrue nonReentrant returns (bool) {
        _transferTokens(msg.sender, src, dst, amount);
        return true;
    }

    function approve(address spender, uint amount) external override returns (bool) {
        _transferAllowances[msg.sender][spender] = amount;
        emit Approval(msg.sender, spender, amount);
        return true;
    }

    /* ========== RESTRICTED FUNCTIONS ========== */

    function supply(address account, uint uAmount) payable external override accrue onlyQore nonReentrant returns (uint) {
        uint exchangeRate = exchangeRate();
        uAmount = underlying == address(WBNB) ? msg.value : uAmount;
        uAmount = _doTransferIn(account, uAmount);
        uint qAmount = uAmount.mul(1e18).div(exchangeRate);

        totalSupply = totalSupply.add(qAmount);
        accountBalances[account] = accountBalances[account].add(qAmount);

        emit Mint(account, qAmount);
        emit Transfer(address(this), account, qAmount);
        return qAmount;
    }

    function redeemToken(address redeemer, uint qAmount) external override accrue onlyQore nonReentrant returns (uint) {
        return _redeem(redeemer, qAmount, 0);
    }

    function redeemUnderlying(address redeemer, uint uAmount) external override accrue onlyQore nonReentrant returns (uint) {
        return _redeem(redeemer, 0, uAmount);
    }

    function borrow(address account, uint amount) external override accrue onlyQore nonReentrant returns (uint) {
        require(getCash() >= amount, "QToken: borrow amount exceeds cash");
        updateBorrowInfo(account, amount, 0);
        _doTransferOut(account, amount);

        emit Borrow(account, amount, borrowBalanceOf(account));
        return amount;
    }

    function repayBorrow(address account, uint amount) external payable override accrue onlyQore nonReentrant returns (uint) {
        if (amount == uint(-1)) {
            amount = borrowBalanceOf(account);
        }
        return _repay(account, account, underlying == address(WBNB) ? msg.value : amount);
    }

    function repayBorrowBehalf(address payer, address borrower, uint amount) external payable override accrue onlyQore nonReentrant returns (uint) {
        if (amount == uint(-1)) {
            amount = borrowBalanceOf(borrower);
        }
        return _repay(payer, borrower, underlying == address(WBNB) ? msg.value : amount);
    }

    function liquidateBorrow(address qTokenCollateral, address liquidator, address borrower, uint amount) external payable override accrue onlyQore nonReentrant returns (uint qAmountToSeize) {
        require(borrower != liquidator, "QToken: cannot liquidate yourself");

        amount = underlying == address(WBNB) ? msg.value : amount;
        amount = _repay(liquidator, borrower, amount);
        require(amount > 0 && amount < uint(- 1), "QToken: invalid repay amount");

        qAmountToSeize = IQValidator(qore.qValidator()).qTokenAmountToSeize(address(this), qTokenCollateral, amount);
        require(IQToken(payable(qTokenCollateral)).balanceOf(borrower) >= qAmountToSeize, "QToken: too much seize amount");
        emit LiquidateBorrow(liquidator, borrower, amount, qTokenCollateral, qAmountToSeize);
    }

    function seize(address liquidator, address borrower, uint qAmount) external override accrue onlyQore nonReentrant {
        accountBalances[borrower] = accountBalances[borrower].sub(qAmount);
        accountBalances[liquidator] = accountBalances[liquidator].add(qAmount);
        qDistributor.notifyTransferred(address(this), borrower, liquidator);
        emit Transfer(borrower, liquidator, qAmount);
    }

    /* ========== PRIVATE FUNCTIONS ========== */

    function _transferTokens(address spender, address src, address dst, uint amount) private {
        require(src != dst && IQValidator(qore.qValidator()).redeemAllowed(address(this), src, amount), "QToken: cannot transfer");
        require(amount != 0, "QToken: zero amount");

        uint _allowance = spender == src ? uint(- 1) : _transferAllowances[src][spender];
        uint _allowanceNew = _allowance.sub(amount, 'QToken: transfer amount exceeds allowance');

        accountBalances[src] = accountBalances[src].sub(amount);
        accountBalances[dst] = accountBalances[dst].add(amount);

        qDistributor.notifyTransferred(address(this), src, dst);

        if (_allowance != uint(- 1)) {
            _transferAllowances[src][msg.sender] = _allowanceNew;
        }
        emit Transfer(src, dst, amount);
    }

    function _doTransferIn(address from, uint amount) private returns (uint) {
        if (underlying == address(WBNB)) {
            require(msg.value >= amount, "QToken: value mismatch");
            return Math.min(msg.value, amount);
        } else {
            uint balanceBefore = IBEP20(underlying).balanceOf(address(this));
            underlying.safeTransferFrom(from, address(this), amount);
            return IBEP20(underlying).balanceOf(address(this)).sub(balanceBefore);
        }
    }

    function _doTransferOut(address to, uint amount) private {
        if (underlying == address(WBNB)) {
            SafeToken.safeTransferETH(to, amount);
        } else {
            underlying.safeTransfer(to, amount);
        }
    }

    function _redeem(address account, uint qAmountIn, uint uAmountIn) private returns (uint) {
        require(qAmountIn == 0 || uAmountIn == 0, "QToken: one of qAmountIn or uAmountIn must be zero");
        require(totalSupply >= qAmountIn, "QToken: not enough total supply");
        require(getCash() >= uAmountIn || uAmountIn == 0, "QToken: not enough underlying");
        require(getCash() >= qAmountIn.mul(exchangeRate()).div(1e18) || qAmountIn == 0, "QToken: not enough underlying");

        uint qAmountToRedeem = qAmountIn > 0 ? qAmountIn : uAmountIn.mul(1e18).div(exchangeRate());
        uint uAmountToRedeem = qAmountIn > 0 ? qAmountIn.mul(exchangeRate()).div(1e18) : uAmountIn;

        require(IQValidator(qore.qValidator()).redeemAllowed(address(this), account, qAmountToRedeem), "QToken: cannot redeem");

        totalSupply = totalSupply.sub(qAmountToRedeem);
        accountBalances[account] = accountBalances[account].sub(qAmountToRedeem);
        _doTransferOut(account, uAmountToRedeem);

        emit Transfer(account, address(this), qAmountToRedeem);
        emit Redeem(account, uAmountToRedeem, qAmountToRedeem);
        return uAmountToRedeem;
    }

    function _repay(address payer, address borrower, uint amount) private returns (uint) {
        uint borrowBalance = borrowBalanceOf(borrower);
        uint repayAmount = Math.min(borrowBalance, amount);
        repayAmount = _doTransferIn(payer, repayAmount);
        updateBorrowInfo(borrower, 0, repayAmount);

        if (underlying == address(WBNB)) {
            uint refundAmount = amount > repayAmount ? amount.sub(repayAmount) : 0;
            if (refundAmount > 0) {
                _doTransferOut(payer, refundAmount);
            }
        }

        emit RepayBorrow(payer, borrower, repayAmount, borrowBalanceOf(borrower));
        return repayAmount;
    }
}

File 2 of 19 : 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 3 of 19 : IPancakeRouter02.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2;

import './IPancakeRouter01.sol';

interface IPancakeRouter02 is IPancakeRouter01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountETH);
    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}

File 4 of 19 : IQDistributor.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

/*
      ___       ___       ___       ___       ___
     /\  \     /\__\     /\  \     /\  \     /\  \
    /::\  \   /:/ _/_   /::\  \   _\:\  \    \:\  \
    \:\:\__\ /:/_/\__\ /::\:\__\ /\/::\__\   /::\__\
     \::/  / \:\/:/  / \:\::/  / \::/\/__/  /:/\/__/
     /:/  /   \::/  /   \::/  /   \:\__\    \/__/
     \/__/     \/__/     \/__/     \/__/

*
* MIT License
* ===========
*
* Copyright (c) 2021 QubitFinance
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/

interface IQDistributor {

    struct UserInfo {
        uint accruedQubit;
        uint boostedSupply;    // effective(boosted) supply balance of user  (since last_action)
        uint boostedBorrow;    // effective(boosted) borrow balance of user  (since last_action)
        uint accPerShareSupply;  // Last integral value of Qubit rewards per share. ∫(qubitRate(t) / totalShare(t) dt) from 0 till (last_action)
        uint accPerShareBorrow;  // Last integral value of Qubit rewards per share. ∫(qubitRate(t) / totalShare(t) dt) from 0 till (last_action)
    }

    struct DistributionInfo {
        uint supplyRate;
        uint borrowRate;
        uint totalBoostedSupply;
        uint totalBoostedBorrow;
        uint accPerShareSupply;
        uint accPerShareBorrow;
        uint accruedAt;
    }

    function accruedQubit(address market, address user) external view returns (uint);
    function qubitRatesOf(address market) external view returns (uint supplyRate, uint borrowRate);
    function totalBoosted(address market) external view returns (uint boostedSupply, uint boostedBorrow);
    function boostedBalanceOf(address market, address account) external view returns (uint boostedSupply, uint boostedBorrow);

    function notifySupplyUpdated(address market, address user) external;
    function notifyBorrowUpdated(address market, address user) external;
    function notifyTransferred(address qToken, address sender, address receiver) external;
    function claimQubit(address user) external;
    function kick(address user) external;
}

File 5 of 19 : QConstant.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;

/*
      ___       ___       ___       ___       ___
     /\  \     /\__\     /\  \     /\  \     /\  \
    /::\  \   /:/ _/_   /::\  \   _\:\  \    \:\  \
    \:\:\__\ /:/_/\__\ /::\:\__\ /\/::\__\   /::\__\
     \::/  / \:\/:/  / \:\::/  / \::/\/__/  /:/\/__/
     /:/  /   \::/  /   \::/  /   \:\__\    \/__/
     \/__/     \/__/     \/__/     \/__/

*
* MIT License
* ===========
*
* Copyright (c) 2021 QubitFinance
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/


library QConstant {
    uint public constant CLOSE_FACTOR_MIN = 5e16;
    uint public constant CLOSE_FACTOR_MAX = 9e17;
    uint public constant COLLATERAL_FACTOR_MAX = 9e17;

    struct MarketInfo {
        bool isListed;
        uint borrowCap;
        uint collateralFactor;
    }

    struct BorrowInfo {
        uint borrow;
        uint interestIndex;
    }

    struct AccountSnapshot {
        uint qTokenBalance;
        uint borrowBalance;
        uint exchangeRate;
    }

    struct AccrueSnapshot {
        uint totalBorrow;
        uint totalReserve;
        uint accInterestIndex;
    }
}

File 6 of 19 : SafeToken.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.12;

interface ERC20Interface {
    function balanceOf(address user) external view returns (uint256);
}

library SafeToken {
    function myBalance(address token) internal view returns (uint256) {
        return ERC20Interface(token).balanceOf(address(this));
    }

    function balanceOf(address token, address user) internal view returns (uint256) {
        return ERC20Interface(token).balanceOf(user);
    }

    function safeApprove(address token, address to, uint256 value) internal {
        // bytes4(keccak256(bytes('approve(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), "!safeApprove");
    }

    function safeTransfer(address token, address to, uint256 value) internal {
        // bytes4(keccak256(bytes('transfer(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), "!safeTransfer");
    }

    function safeTransferFrom(address token, address from, address to, uint256 value) internal {
        // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), "!safeTransferFrom");
    }

    function safeTransferETH(address to, uint256 value) internal {
        (bool success, ) = to.call{ value: value }(new bytes(0));
        require(success, "!safeTransferETH");
    }
}

File 7 of 19 : QMarket.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

/*
      ___       ___       ___       ___       ___
     /\  \     /\__\     /\  \     /\  \     /\  \
    /::\  \   /:/ _/_   /::\  \   _\:\  \    \:\  \
    \:\:\__\ /:/_/\__\ /::\:\__\ /\/::\__\   /::\__\
     \::/  / \:\/:/  / \:\::/  / \::/\/__/  /:/\/__/
     /:/  /   \::/  /   \::/  /   \:\__\    \/__/
     \/__/     \/__/     \/__/     \/__/

*
* MIT License
* ===========
*
* Copyright (c) 2021 QubitFinance
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
import "@pancakeswap/pancake-swap-lib/contracts/token/BEP20/IBEP20.sol";

import "../interfaces/IQValidator.sol";
import "../interfaces/IRateModel.sol";
import "../interfaces/IQToken.sol";
import "../interfaces/IQore.sol";
import "../library/QConstant.sol";


abstract contract QMarket is IQToken, OwnableUpgradeable, ReentrancyGuardUpgradeable {
    using SafeMath for uint;

    /* ========== CONSTANT VARIABLES ========== */

    uint internal constant RESERVE_FACTOR_MAX = 1e18;
    uint internal constant DUST = 1000;

    address internal constant WBNB = 0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd;
    address internal constant BUSD = 0x78867BbEeF44f2326bF8DDd1941a4439382EF2A7;

    /* ========== STATE VARIABLES ========== */

    IQore public qore;
    IRateModel public rateModel;
    address public override underlying;

    uint public override totalSupply;
    uint public totalReserve;
    uint private _totalBorrow;

    mapping(address => uint) internal accountBalances;
    mapping(address => QConstant.BorrowInfo) internal accountBorrows;

    uint public reserveFactor;
    uint private lastAccruedTime;
    uint private accInterestIndex;

    /* ========== INITIALIZER ========== */

    receive() payable external {}

    function __QMarket_init() internal initializer {
        __Ownable_init();
        __ReentrancyGuard_init();

        lastAccruedTime = block.timestamp;
        accInterestIndex = 1e18;
    }

    /* ========== MODIFIERS ========== */

    modifier accrue {
        if (block.timestamp > lastAccruedTime && address(rateModel) != address(0)) {
            uint borrowRate = rateModel.getBorrowRate(getCashPrior(), _totalBorrow, totalReserve);
            uint interestFactor = borrowRate.mul(block.timestamp.sub(lastAccruedTime));
            uint pendingInterest = _totalBorrow.mul(interestFactor).div(1e18);

            _totalBorrow = _totalBorrow.add(pendingInterest);
            totalReserve = totalReserve.add(pendingInterest.mul(reserveFactor).div(1e18));
            accInterestIndex = accInterestIndex.add(interestFactor.mul(accInterestIndex).div(1e18));
            lastAccruedTime = block.timestamp;
        }
        _;
    }

    modifier onlyQore {
        require(msg.sender == address(qore), "QToken: only Qore Contract");
        _;
    }

    /* ========== RESTRICTED FUNCTIONS ========== */

    function setQore(address _qore) public onlyOwner {
        require(_qore != address(0), "QMarket: invalid qore address");
        qore = IQore(_qore);
    }

    function setUnderlying(address _underlying) public onlyOwner {
        require(_underlying != address(0), "QMarket: invalid underlying address");
        require(underlying == address(0), "QMarket: set underlying already");
        underlying = _underlying;
    }

    function setRateModel(address _rateModel) public accrue onlyOwner {
        require(_rateModel != address(0), "QMarket: invalid rate model address");
        rateModel = IRateModel(_rateModel);
    }

    function setReserveFactor(uint _reserveFactor) public accrue onlyOwner {
        require(_reserveFactor <= RESERVE_FACTOR_MAX, "QMarket: invalid reserve factor");
        reserveFactor = _reserveFactor;
    }

    /* ========== VIEWS ========== */

    function balanceOf(address account) external view override returns (uint) {
        return accountBalances[account];
    }

    function accountSnapshot(address account) external view override returns (QConstant.AccountSnapshot memory) {
        QConstant.AccountSnapshot memory snapshot;
        snapshot.qTokenBalance = accountBalances[account];
        snapshot.borrowBalance = borrowBalanceOf(account);
        snapshot.exchangeRate = exchangeRate();
        return snapshot;
    }

    function underlyingBalanceOf(address account) external view override returns (uint) {
        return accountBalances[account].mul(exchangeRate()).div(1e18);
    }

    function borrowBalanceOf(address account) public view override returns (uint) {
        QConstant.AccrueSnapshot memory snapshot = pendingAccrueSnapshot();
        QConstant.BorrowInfo storage info = accountBorrows[account];

        if (info.borrow == 0) return 0;
        return info.borrow.mul(snapshot.accInterestIndex).div(info.interestIndex);
    }

    function borrowRatePerSec() external view override returns (uint) {
        QConstant.AccrueSnapshot memory snapshot = pendingAccrueSnapshot();
        return rateModel.getBorrowRate(getCashPrior(), snapshot.totalBorrow, snapshot.totalReserve);
    }

    function supplyRatePerSec() external view override returns (uint) {
        QConstant.AccrueSnapshot memory snapshot = pendingAccrueSnapshot();
        return rateModel.getSupplyRate(getCashPrior(), snapshot.totalBorrow, snapshot.totalReserve, reserveFactor);
    }

    function totalBorrow() public view override returns (uint) {
        QConstant.AccrueSnapshot memory snapshot = pendingAccrueSnapshot();
        return snapshot.totalBorrow;
    }

    function exchangeRate() public view override returns (uint) {
        if (totalSupply == 0) return 1e18;
        QConstant.AccrueSnapshot memory snapshot = pendingAccrueSnapshot();
        return getCashPrior().add(snapshot.totalBorrow).sub(snapshot.totalReserve).mul(1e18).div(totalSupply);
    }

    function getCash() public view override returns (uint) {
        return getCashPrior();
    }

    function getAccInterestIndex() public view override returns (uint) {
        QConstant.AccrueSnapshot memory snapshot = pendingAccrueSnapshot();
        return snapshot.accInterestIndex;
    }

    /* ========== MUTATIVE FUNCTIONS ========== */

    function accruedAccountSnapshot(address account) external override accrue returns (QConstant.AccountSnapshot memory) {
        QConstant.AccountSnapshot memory snapshot;
        snapshot.qTokenBalance = accountBalances[account];
        snapshot.borrowBalance = accountBorrows[account].borrow;
        snapshot.exchangeRate = exchangeRate();
        return snapshot;
    }

    function accruedUnderlyingBalanceOf(address account) external override accrue returns (uint) {
        return accountBalances[account].mul(exchangeRate()).div(1e18);
    }

    function accruedBorrowBalanceOf(address account) external override accrue returns (uint) {
        QConstant.BorrowInfo storage info = accountBorrows[account];
        info.borrow = info.borrow.mul(accInterestIndex).div(info.interestIndex);
        info.interestIndex = accInterestIndex;
        return info.borrow;
    }

    function accruedTotalBorrow() external override accrue returns (uint) {
        return _totalBorrow;
    }

    function accruedExchangeRate() external override accrue returns (uint) {
        return exchangeRate();
    }

    /* ========== INTERNAL FUNCTIONS ========== */

    function updateBorrowInfo(address account, uint addAmount, uint subAmount) internal {
        QConstant.BorrowInfo storage info = accountBorrows[account];
        if (info.interestIndex == 0) {
            info.interestIndex = accInterestIndex;
        }

        info.borrow = info.borrow.mul(accInterestIndex).div(info.interestIndex).add(addAmount).sub(subAmount);
        info.interestIndex = accInterestIndex;
        _totalBorrow = _totalBorrow.add(addAmount).sub(subAmount);

        info.borrow = (info.borrow < DUST) ? 0 : info.borrow;
        _totalBorrow = (_totalBorrow < DUST) ? 0 : _totalBorrow;
    }

    function updateSupplyInfo(address account, uint addAmount, uint subAmount) internal {
        accountBalances[account] = accountBalances[account].add(addAmount).sub(subAmount);
        totalSupply = totalSupply.add(addAmount).sub(subAmount);

        totalSupply = (totalSupply < DUST) ? 0 : totalSupply;
    }

    function getCashPrior() internal view returns (uint) {
        return underlying == address(WBNB) ? address(this).balance.sub(msg.value) : IBEP20(underlying).balanceOf(address(this));
    }

    function pendingAccrueSnapshot() internal view returns (QConstant.AccrueSnapshot memory) {
        QConstant.AccrueSnapshot memory snapshot;
        snapshot.totalBorrow = _totalBorrow;
        snapshot.totalReserve = totalReserve;
        snapshot.accInterestIndex = accInterestIndex;

        if (block.timestamp > lastAccruedTime && _totalBorrow > 0) {
            uint borrowRate = rateModel.getBorrowRate(getCashPrior(), _totalBorrow, totalReserve);
            uint interestFactor = borrowRate.mul(block.timestamp.sub(lastAccruedTime));
            uint pendingInterest = _totalBorrow.mul(interestFactor).div(1e18);

            snapshot.totalBorrow = _totalBorrow.add(pendingInterest);
            snapshot.totalReserve = totalReserve.add(pendingInterest.mul(reserveFactor).div(1e18));
            snapshot.accInterestIndex = accInterestIndex.add(interestFactor.mul(accInterestIndex).div(1e18));
        }
        return snapshot;
    }
}

File 8 of 19 : IPancakeRouter01.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2;

interface IPancakeRouter01 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
    external
    payable
    returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
    external
    returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
    external
    returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
    external
    payable
    returns (uint[] memory amounts);

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

File 9 of 19 : 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, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

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

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

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

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

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

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

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

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

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

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

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

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

File 10 of 19 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal initializer {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal initializer {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual 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;
    }
    uint256[49] private __gap;
}

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

pragma solidity >=0.6.0 <0.8.0;
import "../proxy/Initializable.sol";

/**
 * @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 ReentrancyGuardUpgradeable is Initializable {
    // 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;

    function __ReentrancyGuard_init() internal initializer {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal initializer {
        _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;
    }
    uint256[49] private __gap;
}

File 12 of 19 : IBEP20.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity >=0.4.0;

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

    /**
     * @dev Returns the token decimals.
     */
    function decimals() external view returns (uint8);

    /**
     * @dev Returns the token symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the token name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the bep token owner.
     */
    function getOwner() external view returns (address);

    /**
     * @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 13 of 19 : IQValidator.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

/*
      ___       ___       ___       ___       ___
     /\  \     /\__\     /\  \     /\  \     /\  \
    /::\  \   /:/ _/_   /::\  \   _\:\  \    \:\  \
    \:\:\__\ /:/_/\__\ /::\:\__\ /\/::\__\   /::\__\
     \::/  / \:\/:/  / \:\::/  / \::/\/__/  /:/\/__/
     /:/  /   \::/  /   \::/  /   \:\__\    \/__/
     \/__/     \/__/     \/__/     \/__/

*
* MIT License
* ===========
*
* Copyright (c) 2021 QubitFinance
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/


interface IQValidator {
    function redeemAllowed(address qToken, address redeemer, uint redeemAmount) external returns (bool);
    function borrowAllowed(address qToken, address borrower, uint borrowAmount) external returns (bool);
    function liquidateAllowed(address qTokenBorrowed, address borrower, uint repayAmount, uint closeFactor) external returns (bool);
    function qTokenAmountToSeize(address qTokenBorrowed, address qTokenCollateral, uint actualRepayAmount) external returns (uint qTokenAmount);
    function getAccountLiquidity(address account, address qToken, uint redeemAmount, uint borrowAmount) external view returns (uint liquidity, uint shortfall);
    function getAccountLiquidityValue(address account) external view returns (uint collateralUSD, uint borrowUSD);
}

File 14 of 19 : IRateModel.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;

/*
      ___       ___       ___       ___       ___
     /\  \     /\__\     /\  \     /\  \     /\  \
    /::\  \   /:/ _/_   /::\  \   _\:\  \    \:\  \
    \:\:\__\ /:/_/\__\ /::\:\__\ /\/::\__\   /::\__\
     \::/  / \:\/:/  / \:\::/  / \::/\/__/  /:/\/__/
     /:/  /   \::/  /   \::/  /   \:\__\    \/__/
     \/__/     \/__/     \/__/     \/__/

*
* MIT License
* ===========
*
* Copyright (c) 2021 QubitFinance
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/

interface IRateModel {
    function getBorrowRate(uint cash, uint borrows, uint reserves) external view returns (uint);
    function getSupplyRate(uint cash, uint borrows, uint reserves, uint reserveFactor) external view returns (uint);
}

File 15 of 19 : IQToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

/*
      ___       ___       ___       ___       ___
     /\  \     /\__\     /\  \     /\  \     /\  \
    /::\  \   /:/ _/_   /::\  \   _\:\  \    \:\  \
    \:\:\__\ /:/_/\__\ /::\:\__\ /\/::\__\   /::\__\
     \::/  / \:\/:/  / \:\::/  / \::/\/__/  /:/\/__/
     /:/  /   \::/  /   \::/  /   \:\__\    \/__/
     \/__/     \/__/     \/__/     \/__/

*
* MIT License
* ===========
*
* Copyright (c) 2021 QubitFinance
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/

import "../library/QConstant.sol";


interface IQToken {
    function underlying() external view returns (address);
    function totalSupply() external view returns (uint);

    function accountSnapshot(address account) external view returns (QConstant.AccountSnapshot memory);
    function underlyingBalanceOf(address account) external view returns (uint);
    function borrowBalanceOf(address account) external view returns (uint);
    function borrowRatePerSec() external view returns (uint);
    function supplyRatePerSec() external view returns (uint);
    function totalBorrow() external view returns (uint);
    function exchangeRate() external view returns (uint);
    function getCash() external view returns (uint);
    function getAccInterestIndex() external view returns (uint);

    function accruedAccountSnapshot(address account) external returns (QConstant.AccountSnapshot memory);
    function accruedUnderlyingBalanceOf(address account) external returns (uint);
    function accruedBorrowBalanceOf(address account) external returns (uint);
    function accruedTotalBorrow() external returns (uint);
    function accruedExchangeRate() external returns (uint);

    function approve(address spender, uint amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint);
    function balanceOf(address account) external view returns (uint);
    function transfer(address dst, uint amount) external returns (bool);
    function transferFrom(address src, address dst, uint amount) external returns (bool);

    function supply(address account, uint underlyingAmount) external payable returns (uint);
    function redeemToken(address account, uint qTokenAmount) external returns (uint);
    function redeemUnderlying(address account, uint underlyingAmount) external returns (uint);

    function borrow(address account, uint amount) external returns (uint);
    function repayBorrow(address account, uint amount) external payable returns (uint);
    function repayBorrowBehalf(address payer, address borrower, uint amount) external payable returns (uint);

    function liquidateBorrow(address qTokenCollateral, address liquidator, address borrower, uint amount) payable external returns (uint qAmountToSeize);
    function seize(address liquidator, address borrower, uint qTokenAmount) external;
}

File 16 of 19 : IQore.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

import "../library/QConstant.sol";


interface IQore {
    function qValidator() external view returns (address);
    function getTotalUserList() external view returns (address[] memory);

    function allMarkets() external view returns (address[] memory);
    function marketListOf(address account) external view returns (address[] memory);
    function marketInfoOf(address qToken) external view returns (QConstant.MarketInfo memory);
    function liquidationIncentive() external view returns (uint);
    function checkMembership(address account, address qToken) external view returns (bool);

    function enterMarkets(address[] memory qTokens) external;
    function exitMarket(address qToken) external;

    function supply(address qToken, uint underlyingAmount) external payable returns (uint);
    function redeemToken(address qToken, uint qTokenAmount) external returns (uint);
    function redeemUnderlying(address qToken, uint underlyingAmount) external returns (uint);

    function borrow(address qToken, uint amount) external;

    function repayBorrow(address qToken, uint amount) external payable;
    function repayBorrowBehalf(address qToken, address borrower, uint amount) external payable;

    function liquidateBorrow(address qTokenBorrowed, address qTokenCollateral, address borrower, uint amount) external payable;
}

File 17 of 19 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;
import "../proxy/Initializable.sol";

/*
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal initializer {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal initializer {
    }
    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;
    }
    uint256[50] private __gap;
}

File 18 of 19 : Initializable.sol
// SPDX-License-Identifier: MIT

// solhint-disable-next-line compiler-version
pragma solidity >=0.4.24 <0.8.0;

import "../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract contract Initializable {

    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /// @dev Returns true if and only if the function is running in the constructor
    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 19 of 19 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @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
{
  "evmVersion": "istanbul",
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"ammount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"accountBorrow","type":"uint256"}],"name":"Borrow","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"liquidator","type":"address"},{"indexed":false,"internalType":"address","name":"borrower","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"qTokenCollateral","type":"address"},{"indexed":false,"internalType":"uint256","name":"seizeAmount","type":"uint256"}],"name":"LiquidateBorrow","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"uint256","name":"mintAmount","type":"uint256"}],"name":"Mint","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":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"underlyingAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"qTokenAmount","type":"uint256"}],"name":"Redeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"payer","type":"address"},{"indexed":false,"internalType":"address","name":"borrower","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"accountBorrow","type":"uint256"}],"name":"RepayBorrow","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"accountSnapshot","outputs":[{"components":[{"internalType":"uint256","name":"qTokenBalance","type":"uint256"},{"internalType":"uint256","name":"borrowBalance","type":"uint256"},{"internalType":"uint256","name":"exchangeRate","type":"uint256"}],"internalType":"struct QConstant.AccountSnapshot","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"accruedAccountSnapshot","outputs":[{"components":[{"internalType":"uint256","name":"qTokenBalance","type":"uint256"},{"internalType":"uint256","name":"borrowBalance","type":"uint256"},{"internalType":"uint256","name":"exchangeRate","type":"uint256"}],"internalType":"struct QConstant.AccountSnapshot","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"accruedBorrowBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"accruedExchangeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"accruedTotalBorrow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"accruedUnderlyingBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"borrow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"borrowBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"borrowRatePerSec","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exchangeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAccInterestIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCash","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"_decimals","type":"uint8"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"qTokenCollateral","type":"address"},{"internalType":"address","name":"liquidator","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"liquidateBorrow","outputs":[{"internalType":"uint256","name":"qAmountToSeize","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"qDistributor","outputs":[{"internalType":"contract IQDistributor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"qore","outputs":[{"internalType":"contract IQore","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rateModel","outputs":[{"internalType":"contract IRateModel","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"redeemer","type":"address"},{"internalType":"uint256","name":"qAmount","type":"uint256"}],"name":"redeemToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"redeemer","type":"address"},{"internalType":"uint256","name":"uAmount","type":"uint256"}],"name":"redeemUnderlying","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"repayBorrow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"payer","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"repayBorrowBehalf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"reserveFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"liquidator","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"qAmount","type":"uint256"}],"name":"seize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_qore","type":"address"}],"name":"setQore","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rateModel","type":"address"}],"name":"setRateModel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_reserveFactor","type":"uint256"}],"name":"setReserveFactor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_underlying","type":"address"}],"name":"setUnderlying","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"uAmount","type":"uint256"}],"name":"supply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"supplyRatePerSec","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalBorrow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"underlying","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"underlyingBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b50614fb1806100206000396000f3fe6080604052600436106102815760003560e01c80638285ef401161014f578063a1088459116100c1578063d88c3f221161007a578063d88c3f22146106fb578063dd62ed3e14610710578063e61604cf14610730578063ecdaff7e14610743578063f2b9fdb814610758578063f2fde38b1461076b57610288565b8063a10884591461065e578063a9059cbb14610673578063a95d02d314610693578063abdb5ea8146106a8578063b2a02ff1146106bb578063bdb2321f146106db57610288565b80638b9db037116101135780638b9db037146105bf5780638da5cb5b146105d457806392fa4e8e146105e9578063935a8b841461060957806395d89b4114610629578063962941781461063e57610288565b80638285ef4014610535578063830cbbbd1461054a5780638399c0ba1461056a57806388d9394e1461058a578063893d20e8146105aa57610288565b80634322b714116101f35780636aaa8033116101ac5780636aaa8033146104895780636f307dc3146104a957806370a08231146104cb578063715018a6146104eb5780637bc2c30e146105005780637f9028c81461051557610288565b80634322b714146104025780634b8a3529146104175780634c68df671461043757806356150b411461044c578063587a5e501461046157806359086a5e1461047657610288565b80631c446983116102455780631c4469831461035657806323b872dd14610376578063313ce56714610396578063374c49b4146103b85780633b1d21a2146103d85780633ba0b9a9146103ed57610288565b8063014a296f1461028d57806306fdde03146102c3578063095ea7b3146102e55780631624f6c61461031257806318160ddd1461033457610288565b3661028857005b600080fd5b34801561029957600080fd5b506102ad6102a8366004614510565b61078b565b6040516102ba9190614e88565b60405180910390f35b3480156102cf57600080fd5b506102d86107d9565b6040516102ba919061481d565b3480156102f157600080fd5b50610305610300366004614610565b610867565b6040516102ba9190614812565b34801561031e57600080fd5b5061033261032d36600461465b565b6108d2565b005b34801561034057600080fd5b506103496109a0565b6040516102ba9190614ea9565b34801561036257600080fd5b506103326103713660046146d5565b6109a6565b34801561038257600080fd5b506103056103913660046145d0565b610b83565b3480156103a257600080fd5b506103ab610d19565b6040516102ba9190614ee3565b3480156103c457600080fd5b506103496103d3366004614510565b610d22565b3480156103e457600080fd5b50610349610d84565b3480156103f957600080fd5b50610349610d94565b34801561040e57600080fd5b50610349610e04565b34801561042357600080fd5b50610349610432366004614610565b610e0a565b34801561044357600080fd5b5061034961103b565b34801561045857600080fd5b50610349611041565b34801561046d57600080fd5b506103496110e9565b6103496104843660046145d0565b611145565b34801561049557600080fd5b506103496104a4366004614510565b611349565b3480156104b557600080fd5b506104be6114d3565b6040516102ba9190614721565b3480156104d757600080fd5b506103496104e6366004614510565b6114e2565b3480156104f757600080fd5b506103326114fd565b34801561050c57600080fd5b506104be611586565b34801561052157600080fd5b50610332610530366004614510565b61159e565b34801561054157600080fd5b50610349611777565b34801561055657600080fd5b50610349610565366004614610565b611790565b34801561057657600080fd5b50610349610585366004614510565b61194e565b34801561059657600080fd5b506103326105a5366004614510565b611ae8565b3480156105b657600080fd5b506104be611b6f565b3480156105cb57600080fd5b50610349611b79565b3480156105e057600080fd5b506104be611cd5565b3480156105f557600080fd5b506102ad610604366004614510565b611ce4565b34801561061557600080fd5b50610349610624366004614510565b611e7b565b34801561063557600080fd5b506102d8611e94565b34801561064a57600080fd5b50610349610659366004614610565b611eef565b34801561066a57600080fd5b506104be6120a1565b34801561067f57600080fd5b5061030561068e366004614610565b6120b0565b34801561069f57600080fd5b506104be612245565b6103496106b6366004614610565b612254565b3480156106c757600080fd5b506103326106d63660046145d0565b612444565b3480156106e757600080fd5b506103326106f6366004614510565b612706565b34801561070757600080fd5b506103496127b6565b34801561071c57600080fd5b5061034961072b366004614548565b6127d2565b61034961073e366004614580565b6127fd565b34801561074f57600080fd5b50610349612c29565b610349610766366004614610565b612d84565b34801561077757600080fd5b50610332610786366004614510565b61305d565b6107936143de565b61079b6143de565b6001600160a01b0383166000908152609d602052604090205481526107bf83610d22565b60208201526107cc610d94565b604082015290505b919050565b60a2805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561085f5780601f106108345761010080835404028352916020019161085f565b820191906000526020600020905b81548152906001019060200180831161084257829003601f168201915b505050505081565b33600081815260a5602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906108c0908690614ea9565b60405180910390a35060015b92915050565b600054610100900460ff16806108eb57506108eb61311e565b806108f9575060005460ff16155b61091e5760405162461bcd60e51b815260040161091590614b5b565b60405180910390fd5b600054610100900460ff16158015610949576000805460ff1961ff0019909116610100171660011790555b61095161312f565b83516109649060a29060208701906143ff565b5082516109789060a39060208601906143ff565b5060a4805460ff191660ff8416179055801561099a576000805461ff00191690555b50505050565b609a5481565b60a054421180156109c157506098546001600160a01b031615155b15610b17576098546000906001600160a01b03166315f240536109e26131d2565b609c54609b546040518463ffffffff1660e01b8152600401610a0693929190614eb2565b60206040518083038186803b158015610a1e57600080fd5b505afa158015610a32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5691906146ed565b90506000610a79610a7260a0544261328690919063ffffffff16565b83906132ae565b90506000610aa4670de0b6b3a7640000610a9e84609c546132ae90919063ffffffff16565b906132ef565b609c54909150610ab49082613321565b609c55609f54610ae090610ad790670de0b6b3a764000090610a9e9085906132ae565b609b5490613321565b609b5560a154610b0c90610b0390670de0b6b3a764000090610a9e9086906132ae565b60a15490613321565b60a15550504260a055505b610b1f613346565b6001600160a01b0316610b30611cd5565b6001600160a01b031614610b565760405162461bcd60e51b815260040161091590614c48565b670de0b6b3a7640000811115610b7e5760405162461bcd60e51b815260040161091590614aed565b609f55565b600060a05442118015610ba057506098546001600160a01b031615155b15610cd7576098546000906001600160a01b03166315f24053610bc16131d2565b609c54609b546040518463ffffffff1660e01b8152600401610be593929190614eb2565b60206040518083038186803b158015610bfd57600080fd5b505afa158015610c11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3591906146ed565b90506000610c51610a7260a0544261328690919063ffffffff16565b90506000610c76670de0b6b3a7640000610a9e84609c546132ae90919063ffffffff16565b609c54909150610c869082613321565b609c55609f54610ca990610ad790670de0b6b3a764000090610a9e9085906132ae565b609b5560a154610ccc90610b0390670de0b6b3a764000090610a9e9086906132ae565b60a15550504260a055505b60026065541415610cfa5760405162461bcd60e51b815260040161091590614da8565b6002606555610d0b3385858561334a565b506001806065559392505050565b60a45460ff1681565b6000610d2c6143de565b610d34613669565b6001600160a01b0384166000908152609e60205260409020805491925090610d61576000925050506107d4565b600181015460408301518254610d7c9291610a9e91906132ae565b949350505050565b6000610d8e6131d2565b90505b90565b6000609a5460001415610db05750670de0b6b3a7640000610d91565b610db86143de565b610dc0613669565b9050610dfe609a54610a9e670de0b6b3a7640000610df88560200151610df28760000151610dec6131d2565b90613321565b90613286565b906132ae565b91505090565b609f5481565b600060a05442118015610e2757506098546001600160a01b031615155b15610f5e576098546000906001600160a01b03166315f24053610e486131d2565b609c54609b546040518463ffffffff1660e01b8152600401610e6c93929190614eb2565b60206040518083038186803b158015610e8457600080fd5b505afa158015610e98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ebc91906146ed565b90506000610ed8610a7260a0544261328690919063ffffffff16565b90506000610efd670de0b6b3a7640000610a9e84609c546132ae90919063ffffffff16565b609c54909150610f0d9082613321565b609c55609f54610f3090610ad790670de0b6b3a764000090610a9e9085906132ae565b609b5560a154610f5390610b0390670de0b6b3a764000090610a9e9086906132ae565b60a15550504260a055505b6097546001600160a01b03163314610f885760405162461bcd60e51b815260040161091590614ddf565b60026065541415610fab5760405162461bcd60e51b815260040161091590614da8565b600260655581610fb9610d84565b1015610fd75760405162461bcd60e51b815260040161091590614e46565b610fe3838360006137db565b610fed8383613883565b7fe1979fe4c35e0cef342fef5668e2c8e7a7e9f5d5d1ca8fee0ac6c427fa4153af838361101986610d22565b604051611028939291906147f1565b60405180910390a1506001606555919050565b609b5481565b600061104b6143de565b611053613669565b6098549091506001600160a01b03166315f2405361106f6131d2565b835160208501516040516001600160e01b031960e086901b16815261109993929190600401614eb2565b60206040518083038186803b1580156110b157600080fd5b505afa1580156110c5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfe91906146ed565b60006110f36143de565b6110fb613669565b6098549091506001600160a01b031663b81688166111176131d2565b83516020850151609f546040516001600160e01b031960e087901b1681526110999493929190600401614ec8565b600060a0544211801561116257506098546001600160a01b031615155b15611299576098546000906001600160a01b03166315f240536111836131d2565b609c54609b546040518463ffffffff1660e01b81526004016111a793929190614eb2565b60206040518083038186803b1580156111bf57600080fd5b505afa1580156111d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f791906146ed565b90506000611213610a7260a0544261328690919063ffffffff16565b90506000611238670de0b6b3a7640000610a9e84609c546132ae90919063ffffffff16565b609c549091506112489082613321565b609c55609f5461126b90610ad790670de0b6b3a764000090610a9e9085906132ae565b609b5560a15461128e90610b0390670de0b6b3a764000090610a9e9086906132ae565b60a15550504260a055505b6097546001600160a01b031633146112c35760405162461bcd60e51b815260040161091590614ddf565b600260655414156112e65760405162461bcd60e51b815260040161091590614da8565b6002606555600019821415611301576112fe83610d22565b91505b60995461133c90859085906001600160a01b031673ae13d989dac2f0debff460ac112a837c89baa7cd146113355784611337565b345b6138d4565b6001606555949350505050565b600060a0544211801561136657506098546001600160a01b031615155b1561149d576098546000906001600160a01b03166315f240536113876131d2565b609c54609b546040518463ffffffff1660e01b81526004016113ab93929190614eb2565b60206040518083038186803b1580156113c357600080fd5b505afa1580156113d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fb91906146ed565b90506000611417610a7260a0544261328690919063ffffffff16565b9050600061143c670de0b6b3a7640000610a9e84609c546132ae90919063ffffffff16565b609c5490915061144c9082613321565b609c55609f5461146f90610ad790670de0b6b3a764000090610a9e9085906132ae565b609b5560a15461149290610b0390670de0b6b3a764000090610a9e9086906132ae565b60a15550504260a055505b6108cc670de0b6b3a7640000610a9e6114b4610d94565b6001600160a01b0386166000908152609d6020526040902054906132ae565b6099546001600160a01b031681565b6001600160a01b03166000908152609d602052604090205490565b611505613346565b6001600160a01b0316611516611cd5565b6001600160a01b03161461153c5760405162461bcd60e51b815260040161091590614c48565b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b73a2897bede359e56f67d06f42c39869719e59becc81565b60a054421180156115b957506098546001600160a01b031615155b156116f0576098546000906001600160a01b03166315f240536115da6131d2565b609c54609b546040518463ffffffff1660e01b81526004016115fe93929190614eb2565b60206040518083038186803b15801561161657600080fd5b505afa15801561162a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061164e91906146ed565b9050600061166a610a7260a0544261328690919063ffffffff16565b9050600061168f670de0b6b3a7640000610a9e84609c546132ae90919063ffffffff16565b609c5490915061169f9082613321565b609c55609f546116c290610ad790670de0b6b3a764000090610a9e9085906132ae565b609b5560a1546116e590610b0390670de0b6b3a764000090610a9e9086906132ae565b60a15550504260a055505b6116f8613346565b6001600160a01b0316611709611cd5565b6001600160a01b03161461172f5760405162461bcd60e51b815260040161091590614c48565b6001600160a01b0381166117555760405162461bcd60e51b815260040161091590614ce8565b609880546001600160a01b0319166001600160a01b0392909216919091179055565b60006117816143de565b611789613669565b5191505090565b600060a054421180156117ad57506098546001600160a01b031615155b156118e4576098546000906001600160a01b03166315f240536117ce6131d2565b609c54609b546040518463ffffffff1660e01b81526004016117f293929190614eb2565b60206040518083038186803b15801561180a57600080fd5b505afa15801561181e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184291906146ed565b9050600061185e610a7260a0544261328690919063ffffffff16565b90506000611883670de0b6b3a7640000610a9e84609c546132ae90919063ffffffff16565b609c549091506118939082613321565b609c55609f546118b690610ad790670de0b6b3a764000090610a9e9085906132ae565b609b5560a1546118d990610b0390670de0b6b3a764000090610a9e9086906132ae565b60a15550504260a055505b6097546001600160a01b0316331461190e5760405162461bcd60e51b815260040161091590614ddf565b600260655414156119315760405162461bcd60e51b815260040161091590614da8565b6002606555611942838360006139ab565b60016065559392505050565b600060a0544211801561196b57506098546001600160a01b031615155b15611aa2576098546000906001600160a01b03166315f2405361198c6131d2565b609c54609b546040518463ffffffff1660e01b81526004016119b093929190614eb2565b60206040518083038186803b1580156119c857600080fd5b505afa1580156119dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a0091906146ed565b90506000611a1c610a7260a0544261328690919063ffffffff16565b90506000611a41670de0b6b3a7640000610a9e84609c546132ae90919063ffffffff16565b609c54909150611a519082613321565b609c55609f54611a7490610ad790670de0b6b3a764000090610a9e9085906132ae565b609b5560a154611a9790610b0390670de0b6b3a764000090610a9e9086906132ae565b60a15550504260a055505b6001600160a01b0382166000908152609e60205260409020600181015460a1548254611ad39291610a9e91906132ae565b80825560a15460019092019190915592915050565b611af0613346565b6001600160a01b0316611b01611cd5565b6001600160a01b031614611b275760405162461bcd60e51b815260040161091590614c48565b6001600160a01b038116611b4d5760405162461bcd60e51b815260040161091590614a48565b609780546001600160a01b0319166001600160a01b0392909216919091179055565b6000610d8e611cd5565b600060a05442118015611b9657506098546001600160a01b031615155b15611ccd576098546000906001600160a01b03166315f24053611bb76131d2565b609c54609b546040518463ffffffff1660e01b8152600401611bdb93929190614eb2565b60206040518083038186803b158015611bf357600080fd5b505afa158015611c07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2b91906146ed565b90506000611c47610a7260a0544261328690919063ffffffff16565b90506000611c6c670de0b6b3a7640000610a9e84609c546132ae90919063ffffffff16565b609c54909150611c7c9082613321565b609c55609f54611c9f90610ad790670de0b6b3a764000090610a9e9085906132ae565b609b5560a154611cc290610b0390670de0b6b3a764000090610a9e9086906132ae565b60a15550504260a055505b610d8e610d94565b6033546001600160a01b031690565b611cec6143de565b60a05442118015611d0757506098546001600160a01b031615155b15611e3e576098546000906001600160a01b03166315f24053611d286131d2565b609c54609b546040518463ffffffff1660e01b8152600401611d4c93929190614eb2565b60206040518083038186803b158015611d6457600080fd5b505afa158015611d78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d9c91906146ed565b90506000611db8610a7260a0544261328690919063ffffffff16565b90506000611ddd670de0b6b3a7640000610a9e84609c546132ae90919063ffffffff16565b609c54909150611ded9082613321565b609c55609f54611e1090610ad790670de0b6b3a764000090610a9e9085906132ae565b609b5560a154611e3390610b0390670de0b6b3a764000090610a9e9086906132ae565b60a15550504260a055505b611e466143de565b6001600160a01b0383166000818152609d60209081526040808320548552928252609e815291902054908201526107cc610d94565b60006108cc670de0b6b3a7640000610a9e6114b4610d94565b60a3805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561085f5780601f106108345761010080835404028352916020019161085f565b600060a05442118015611f0c57506098546001600160a01b031615155b15612043576098546000906001600160a01b03166315f24053611f2d6131d2565b609c54609b546040518463ffffffff1660e01b8152600401611f5193929190614eb2565b60206040518083038186803b158015611f6957600080fd5b505afa158015611f7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa191906146ed565b90506000611fbd610a7260a0544261328690919063ffffffff16565b90506000611fe2670de0b6b3a7640000610a9e84609c546132ae90919063ffffffff16565b609c54909150611ff29082613321565b609c55609f5461201590610ad790670de0b6b3a764000090610a9e9085906132ae565b609b5560a15461203890610b0390670de0b6b3a764000090610a9e9086906132ae565b60a15550504260a055505b6097546001600160a01b0316331461206d5760405162461bcd60e51b815260040161091590614ddf565b600260655414156120905760405162461bcd60e51b815260040161091590614da8565b6002606555611942836000846139ab565b6098546001600160a01b031681565b600060a054421180156120cd57506098546001600160a01b031615155b15612204576098546000906001600160a01b03166315f240536120ee6131d2565b609c54609b546040518463ffffffff1660e01b815260040161211293929190614eb2565b60206040518083038186803b15801561212a57600080fd5b505afa15801561213e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061216291906146ed565b9050600061217e610a7260a0544261328690919063ffffffff16565b905060006121a3670de0b6b3a7640000610a9e84609c546132ae90919063ffffffff16565b609c549091506121b39082613321565b609c55609f546121d690610ad790670de0b6b3a764000090610a9e9085906132ae565b609b5560a1546121f990610b0390670de0b6b3a764000090610a9e9086906132ae565b60a15550504260a055505b600260655414156122275760405162461bcd60e51b815260040161091590614da8565b60026065556122383380858561334a565b5060018060655592915050565b6097546001600160a01b031681565b600060a0544211801561227157506098546001600160a01b031615155b156123a8576098546000906001600160a01b03166315f240536122926131d2565b609c54609b546040518463ffffffff1660e01b81526004016122b693929190614eb2565b60206040518083038186803b1580156122ce57600080fd5b505afa1580156122e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061230691906146ed565b90506000612322610a7260a0544261328690919063ffffffff16565b90506000612347670de0b6b3a7640000610a9e84609c546132ae90919063ffffffff16565b609c549091506123579082613321565b609c55609f5461237a90610ad790670de0b6b3a764000090610a9e9085906132ae565b609b5560a15461239d90610b0390670de0b6b3a764000090610a9e9086906132ae565b60a15550504260a055505b6097546001600160a01b031633146123d25760405162461bcd60e51b815260040161091590614ddf565b600260655414156123f55760405162461bcd60e51b815260040161091590614da8565b60026065556000198214156124105761240d83610d22565b91505b60995461194290849081906001600160a01b031673ae13d989dac2f0debff460ac112a837c89baa7cd146113355784611337565b60a0544211801561245f57506098546001600160a01b031615155b15612596576098546000906001600160a01b03166315f240536124806131d2565b609c54609b546040518463ffffffff1660e01b81526004016124a493929190614eb2565b60206040518083038186803b1580156124bc57600080fd5b505afa1580156124d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124f491906146ed565b90506000612510610a7260a0544261328690919063ffffffff16565b90506000612535670de0b6b3a7640000610a9e84609c546132ae90919063ffffffff16565b609c549091506125459082613321565b609c55609f5461256890610ad790670de0b6b3a764000090610a9e9085906132ae565b609b5560a15461258b90610b0390670de0b6b3a764000090610a9e9086906132ae565b60a15550504260a055505b6097546001600160a01b031633146125c05760405162461bcd60e51b815260040161091590614ddf565b600260655414156125e35760405162461bcd60e51b815260040161091590614da8565b60026065556001600160a01b0382166000908152609d602052604090205461260b9082613286565b6001600160a01b038084166000908152609d6020526040808220939093559085168152205461263a9082613321565b6001600160a01b0384166000908152609d602052604090819020919091555163dd9aba1b60e01b815273a2897bede359e56f67d06f42c39869719e59becc9063dd9aba1b9061269190309086908890600401614735565b600060405180830381600087803b1580156126ab57600080fd5b505af11580156126bf573d6000803e3d6000fd5b50505050826001600160a01b0316826001600160a01b0316600080516020614f33833981519152836040516126f49190614ea9565b60405180910390a35050600160655550565b61270e613346565b6001600160a01b031661271f611cd5565b6001600160a01b0316146127455760405162461bcd60e51b815260040161091590614c48565b6001600160a01b03811661276b5760405162461bcd60e51b8152600401610915906148c3565b6099546001600160a01b0316156127945760405162461bcd60e51b815260040161091590614ab6565b609980546001600160a01b0319166001600160a01b0392909216919091179055565b60006127c06143de565b6127c8613669565b6040015191505090565b6001600160a01b03918216600090815260a56020908152604080832093909416825291909152205490565b600060a0544211801561281a57506098546001600160a01b031615155b15612951576098546000906001600160a01b03166315f2405361283b6131d2565b609c54609b546040518463ffffffff1660e01b815260040161285f93929190614eb2565b60206040518083038186803b15801561287757600080fd5b505afa15801561288b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128af91906146ed565b905060006128cb610a7260a0544261328690919063ffffffff16565b905060006128f0670de0b6b3a7640000610a9e84609c546132ae90919063ffffffff16565b609c549091506129009082613321565b609c55609f5461292390610ad790670de0b6b3a764000090610a9e9085906132ae565b609b5560a15461294690610b0390670de0b6b3a764000090610a9e9086906132ae565b60a15550504260a055505b6097546001600160a01b0316331461297b5760405162461bcd60e51b815260040161091590614ddf565b6002606554141561299e5760405162461bcd60e51b815260040161091590614da8565b60026065556001600160a01b0383811690851614156129cf5760405162461bcd60e51b815260040161091590614c7d565b6099546001600160a01b031673ae13d989dac2f0debff460ac112a837c89baa7cd146129fb57816129fd565b345b9150612a0a8484846138d4565b9150600082118015612a1d575060001982105b612a395760405162461bcd60e51b8152600401610915906149da565b609760009054906101000a90046001600160a01b03166001600160a01b031663940ced9e6040518163ffffffff1660e01b815260040160206040518083038186803b158015612a8757600080fd5b505afa158015612a9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612abf919061452c565b6001600160a01b031663092ac6903087856040518463ffffffff1660e01b8152600401612aee93929190614758565b602060405180830381600087803b158015612b0857600080fd5b505af1158015612b1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b4091906146ed565b905080856001600160a01b03166370a08231856040518263ffffffff1660e01b8152600401612b6f9190614721565b60206040518083038186803b158015612b8757600080fd5b505afa158015612b9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bbf91906146ed565b1015612bdd5760405162461bcd60e51b815260040161091590614ba9565b7f298637f684da70674f26509b10f07ec2fbc77a335ab1e7d6215a4b2484d8bb528484848885604051612c1495949392919061477c565b60405180910390a16001606555949350505050565b600060a05442118015612c4657506098546001600160a01b031615155b15612d7d576098546000906001600160a01b03166315f24053612c676131d2565b609c54609b546040518463ffffffff1660e01b8152600401612c8b93929190614eb2565b60206040518083038186803b158015612ca357600080fd5b505afa158015612cb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cdb91906146ed565b90506000612cf7610a7260a0544261328690919063ffffffff16565b90506000612d1c670de0b6b3a7640000610a9e84609c546132ae90919063ffffffff16565b609c54909150612d2c9082613321565b609c55609f54612d4f90610ad790670de0b6b3a764000090610a9e9085906132ae565b609b5560a154612d7290610b0390670de0b6b3a764000090610a9e9086906132ae565b60a15550504260a055505b50609c5490565b600060a05442118015612da157506098546001600160a01b031615155b15612ed8576098546000906001600160a01b03166315f24053612dc26131d2565b609c54609b546040518463ffffffff1660e01b8152600401612de693929190614eb2565b60206040518083038186803b158015612dfe57600080fd5b505afa158015612e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e3691906146ed565b90506000612e52610a7260a0544261328690919063ffffffff16565b90506000612e77670de0b6b3a7640000610a9e84609c546132ae90919063ffffffff16565b609c54909150612e879082613321565b609c55609f54612eaa90610ad790670de0b6b3a764000090610a9e9085906132ae565b609b5560a154612ecd90610b0390670de0b6b3a764000090610a9e9086906132ae565b60a15550504260a055505b6097546001600160a01b03163314612f025760405162461bcd60e51b815260040161091590614ddf565b60026065541415612f255760405162461bcd60e51b815260040161091590614da8565b60026065556000612f34610d94565b6099549091506001600160a01b031673ae13d989dac2f0debff460ac112a837c89baa7cd14612f635782612f65565b345b9250612f718484613cb6565b92506000612f8b82610a9e86670de0b6b3a76400006132ae565b609a54909150612f9b9082613321565b609a556001600160a01b0385166000908152609d6020526040902054612fc19082613321565b6001600160a01b0386166000908152609d60205260409081902091909155517f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859061300f90879084906147d8565b60405180910390a1846001600160a01b0316306001600160a01b0316600080516020614f33833981519152836040516130489190614ea9565b60405180910390a36001606555949350505050565b613065613346565b6001600160a01b0316613076611cd5565b6001600160a01b03161461309c5760405162461bcd60e51b815260040161091590614c48565b6001600160a01b0381166130c25760405162461bcd60e51b81526004016109159061487d565b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b600061312930613e3b565b15905090565b600054610100900460ff1680613148575061314861311e565b80613156575060005460ff16155b6131725760405162461bcd60e51b815260040161091590614b5b565b600054610100900460ff1615801561319d576000805460ff1961ff0019909116610100171660011790555b6131a5613e41565b6131ad613ed3565b4260a055670de0b6b3a764000060a15580156131cf576000805461ff00191690555b50565b6099546000906001600160a01b031673ae13d989dac2f0debff460ac112a837c89baa7cd14613280576099546040516370a0823160e01b81526001600160a01b03909116906370a082319061322b903090600401614721565b60206040518083038186803b15801561324357600080fd5b505afa158015613257573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061327b91906146ed565b610d8e565b610d8e47345b6000828211156132a85760405162461bcd60e51b815260040161091590614a11565b50900390565b6000826132bd575060006108cc565b828202828482816132ca57fe5b04146132e85760405162461bcd60e51b815260040161091590614be0565b9392505050565b60008082116133105760405162461bcd60e51b815260040161091590614a7f565b81838161331957fe5b049392505050565b6000828201838110156132e85760405162461bcd60e51b815260040161091590614906565b3390565b816001600160a01b0316836001600160a01b03161415801561346e5750609760009054906101000a90046001600160a01b03166001600160a01b031663940ced9e6040518163ffffffff1660e01b815260040160206040518083038186803b1580156133b557600080fd5b505afa1580156133c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133ed919061452c565b6001600160a01b031663eabe7d913085846040518463ffffffff1660e01b815260040161341c93929190614758565b602060405180830381600087803b15801561343657600080fd5b505af115801561344a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061346e919061463b565b61348a5760405162461bcd60e51b815260040161091590614b24565b806134a75760405162461bcd60e51b815260040161091590614850565b6000836001600160a01b0316856001600160a01b0316146134ed576001600160a01b03808516600090815260a560209081526040808320938916835292905220546134f1565b6000195b9050600061351a83604051806060016040528060298152602001614f5360299139849190613f49565b6001600160a01b0386166000908152609d60205260409020549091506135409084613286565b6001600160a01b038087166000908152609d6020526040808220939093559086168152205461356f9084613321565b6001600160a01b0385166000908152609d602052604090819020919091555163dd9aba1b60e01b815273a2897bede359e56f67d06f42c39869719e59becc9063dd9aba1b906135c690309089908990600401614735565b600060405180830381600087803b1580156135e057600080fd5b505af11580156135f4573d6000803e3d6000fd5b505050506000198214613628576001600160a01b038516600090815260a56020908152604080832033845290915290208190555b836001600160a01b0316856001600160a01b0316600080516020614f33833981519152856040516136599190614ea9565b60405180910390a3505050505050565b6136716143de565b6136796143de565b609c548152609b54602082015260a154604082015260a054421180156136a157506000609c54115b15610d8e576098546000906001600160a01b03166315f240536136c26131d2565b609c54609b546040518463ffffffff1660e01b81526004016136e693929190614eb2565b60206040518083038186803b1580156136fe57600080fd5b505afa158015613712573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061373691906146ed565b90506000613752610a7260a0544261328690919063ffffffff16565b90506000613777670de0b6b3a7640000610a9e84609c546132ae90919063ffffffff16565b609c549091506137879082613321565b8452609f546137a990610ad790670de0b6b3a764000090610a9e9085906132ae565b602085015260a1546137ce90610b0390670de0b6b3a764000090610a9e9086906132ae565b6040850152505050905090565b6001600160a01b0383166000908152609e6020526040902060018101546138055760a15460018201555b61382e82610df285610dec8560010154610a9e60a15488600001546132ae90919063ffffffff16565b815560a1546001820155609c5461384b908390610df29086613321565b609c5580546103e81161385f578054613862565b60005b8155609c546103e81161387757609c5461387a565b60005b609c5550505050565b6099546001600160a01b031673ae13d989dac2f0debff460ac112a837c89baa7cd14156138b9576138b48282613f75565b6138d0565b6099546138d0906001600160a01b03168383614007565b5050565b6000806138e084610d22565b905060006138ee82856140f5565b90506138fa8682613cb6565b9050613908856000836137db565b6099546001600160a01b031673ae13d989dac2f0debff460ac112a837c89baa7cd141561395d57600081851161393f576000613949565b6139498583613286565b9050801561395b5761395b8782613883565b505b7fa9a154237a69922f8860321d1fec1624a5dbe8a8af89a3dd3d7a759f6c8080d886868361398a89610d22565b60405161399a94939291906147af565b60405180910390a195945050505050565b60008215806139b8575081155b6139d45760405162461bcd60e51b815260040161091590614d2b565b82609a5410156139f65760405162461bcd60e51b81526004016109159061496c565b816139ff610d84565b101580613a0a575081155b613a265760405162461bcd60e51b8152600401610915906149a3565b613a44670de0b6b3a7640000610a9e613a3d610d94565b86906132ae565b613a4c610d84565b101580613a57575082155b613a735760405162461bcd60e51b8152600401610915906149a3565b6000808411613a9e57613a99613a87610d94565b610a9e85670de0b6b3a76400006132ae565b613aa0565b835b90506000808511613ab15783613acf565b613acf670de0b6b3a7640000610a9e613ac8610d94565b88906132ae565b9050609760009054906101000a90046001600160a01b03166001600160a01b031663940ced9e6040518163ffffffff1660e01b815260040160206040518083038186803b158015613b1f57600080fd5b505afa158015613b33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b57919061452c565b6001600160a01b031663eabe7d913088856040518463ffffffff1660e01b8152600401613b8693929190614758565b602060405180830381600087803b158015613ba057600080fd5b505af1158015613bb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bd8919061463b565b613bf45760405162461bcd60e51b81526004016109159061493d565b609a54613c019083613286565b609a556001600160a01b0386166000908152609d6020526040902054613c279083613286565b6001600160a01b0387166000908152609d6020526040902055613c4a8682613883565b306001600160a01b0316866001600160a01b0316600080516020614f3383398151915284604051613c7b9190614ea9565b60405180910390a37fe5b754fb1abb7f01b499791d0b820ae3b6af3424ac1c59768edb53f4ec31a92986828460405161399a939291906147f1565b6099546000906001600160a01b031673ae13d989dac2f0debff460ac112a837c89baa7cd1415613d115781341015613d005760405162461bcd60e51b815260040161091590614e16565b613d0a34836140f5565b90506108cc565b6099546040516370a0823160e01b81526000916001600160a01b0316906370a0823190613d42903090600401614721565b60206040518083038186803b158015613d5a57600080fd5b505afa158015613d6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d9291906146ed565b609954909150613dad906001600160a01b031685308661410b565b6099546040516370a0823160e01b8152613e339183916001600160a01b03909116906370a0823190613de3903090600401614721565b60206040518083038186803b158015613dfb57600080fd5b505afa158015613e0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df291906146ed565b9150506108cc565b3b151590565b600054610100900460ff1680613e5a5750613e5a61311e565b80613e68575060005460ff16155b613e845760405162461bcd60e51b815260040161091590614b5b565b600054610100900460ff16158015613eaf576000805460ff1961ff0019909116610100171660011790555b613eb76141fc565b613ebf61427d565b80156131cf576000805461ff001916905550565b600054610100900460ff1680613eec5750613eec61311e565b80613efa575060005460ff16155b613f165760405162461bcd60e51b815260040161091590614b5b565b600054610100900460ff16158015613f41576000805460ff1961ff0019909116610100171660011790555b613ebf614357565b60008184841115613f6d5760405162461bcd60e51b8152600401610915919061481d565b505050900390565b604080516000808252602082019092526001600160a01b038416908390604051613f9f9190614705565b60006040518083038185875af1925050503d8060008114613fdc576040519150601f19603f3d011682016040523d82523d6000602084013e613fe1565b606091505b50509050806140025760405162461bcd60e51b815260040161091590614cbe565b505050565b60006060846001600160a01b031663a9059cbb858560405160240161402d9291906147d8565b6040516020818303038152906040529060e01b6020820180516001600160e01b0383818316178352505050506040516140669190614705565b6000604051808303816000865af19150503d80600081146140a3576040519150601f19603f3d011682016040523d82523d6000602084013e6140a8565b606091505b50915091508180156140d25750805115806140d25750808060200190518101906140d2919061463b565b6140ee5760405162461bcd60e51b815260040161091590614c21565b5050505050565b600081831061410457816132e8565b5090919050565b60006060856001600160a01b03166323b872dd86868660405160240161413393929190614758565b6040516020818303038152906040529060e01b6020820180516001600160e01b03838183161783525050505060405161416c9190614705565b6000604051808303816000865af19150503d80600081146141a9576040519150601f19603f3d011682016040523d82523d6000602084013e6141ae565b606091505b50915091508180156141d85750805115806141d85750808060200190518101906141d8919061463b565b6141f45760405162461bcd60e51b815260040161091590614d7d565b505050505050565b600054610100900460ff1680614215575061421561311e565b80614223575060005460ff16155b61423f5760405162461bcd60e51b815260040161091590614b5b565b600054610100900460ff16158015613ebf576000805460ff1961ff00199091166101001716600117905580156131cf576000805461ff001916905550565b600054610100900460ff1680614296575061429661311e565b806142a4575060005460ff16155b6142c05760405162461bcd60e51b815260040161091590614b5b565b600054610100900460ff161580156142eb576000805460ff1961ff0019909116610100171660011790555b60006142f5613346565b603380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35080156131cf576000805461ff001916905550565b600054610100900460ff1680614370575061437061311e565b8061437e575060005460ff16155b61439a5760405162461bcd60e51b815260040161091590614b5b565b600054610100900460ff161580156143c5576000805460ff1961ff0019909116610100171660011790555b600160655580156131cf576000805461ff001916905550565b60405180606001604052806000815260200160008152602001600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061444057805160ff191683800117855561446d565b8280016001018555821561446d579182015b8281111561446d578251825591602001919060010190614452565b5061447992915061447d565b5090565b5b80821115614479576000815560010161447e565b600082601f8301126144a2578081fd5b813567ffffffffffffffff808211156144b9578283fd5b604051601f8301601f1916810160200182811182821017156144d9578485fd5b6040528281529250828483016020018610156144f457600080fd5b8260208601602083013760006020848301015250505092915050565b600060208284031215614521578081fd5b81356132e881614f1d565b60006020828403121561453d578081fd5b81516132e881614f1d565b6000806040838503121561455a578081fd5b823561456581614f1d565b9150602083013561457581614f1d565b809150509250929050565b60008060008060808587031215614595578182fd5b84356145a081614f1d565b935060208501356145b081614f1d565b925060408501356145c081614f1d565b9396929550929360600135925050565b6000806000606084860312156145e4578283fd5b83356145ef81614f1d565b925060208401356145ff81614f1d565b929592945050506040919091013590565b60008060408385031215614622578182fd5b823561462d81614f1d565b946020939093013593505050565b60006020828403121561464c578081fd5b815180151581146132e8578182fd5b60008060006060848603121561466f578283fd5b833567ffffffffffffffff80821115614686578485fd5b61469287838801614492565b945060208601359150808211156146a7578384fd5b506146b486828701614492565b925050604084013560ff811681146146ca578182fd5b809150509250925092565b6000602082840312156146e6578081fd5b5035919050565b6000602082840312156146fe578081fd5b5051919050565b60008251614717818460208701614ef1565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0393841681529183166020830152909116604082015260600190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b039586168152938516602085015260408401929092529092166060820152608081019190915260a00190565b6001600160a01b0394851681529290931660208301526040820152606081019190915260800190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039390931683526020830191909152604082015260600190565b901515815260200190565b600060208252825180602084015261483c816040850160208701614ef1565b601f01601f19169190910160400192915050565b60208082526013908201527214551bdad95b8e881e995c9bc8185b5bdd5b9d606a1b604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526023908201527f514d61726b65743a20696e76616c696420756e6465726c79696e67206164647260408201526265737360e81b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526015908201527451546f6b656e3a2063616e6e6f742072656465656d60581b604082015260600190565b6020808252601f908201527f51546f6b656e3a206e6f7420656e6f75676820746f74616c20737570706c7900604082015260600190565b6020808252601d908201527f51546f6b656e3a206e6f7420656e6f75676820756e6465726c79696e67000000604082015260600190565b6020808252601c908201527f51546f6b656e3a20696e76616c696420726570617920616d6f756e7400000000604082015260600190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b6020808252601d908201527f514d61726b65743a20696e76616c696420716f72652061646472657373000000604082015260600190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b6020808252601f908201527f514d61726b65743a2073657420756e6465726c79696e6720616c726561647900604082015260600190565b6020808252601f908201527f514d61726b65743a20696e76616c6964207265736572766520666163746f7200604082015260600190565b60208082526017908201527f51546f6b656e3a2063616e6e6f74207472616e73666572000000000000000000604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252601d908201527f51546f6b656e3a20746f6f206d756368207365697a6520616d6f756e74000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252600d908201526c10b9b0b332aa3930b739b332b960991b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526021908201527f51546f6b656e3a2063616e6e6f74206c697175696461746520796f757273656c6040820152603360f91b606082015260800190565b60208082526010908201526f042e6c2cccaa8e4c2dce6cccae48aa8960831b604082015260600190565b60208082526023908201527f514d61726b65743a20696e76616c69642072617465206d6f64656c206164647260408201526265737360e81b606082015260800190565b60208082526032908201527f51546f6b656e3a206f6e65206f662071416d6f756e74496e206f722075416d6f604082015271756e74496e206d757374206265207a65726f60701b606082015260800190565b60208082526011908201527021736166655472616e7366657246726f6d60781b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601a908201527f51546f6b656e3a206f6e6c7920516f726520436f6e7472616374000000000000604082015260600190565b6020808252601690820152750a2a8ded6cadc7440ecc2d8eaca40dad2e6dac2e8c6d60531b604082015260600190565b60208082526022908201527f51546f6b656e3a20626f72726f7720616d6f756e7420657863656564732063616040820152610e6d60f31b606082015260800190565b81518152602080830151908201526040918201519181019190915260600190565b90815260200190565b9283526020830191909152604082015260600190565b93845260208401929092526040830152606082015260800190565b60ff91909116815260200190565b60005b83811015614f0c578181015183820152602001614ef4565b8381111561099a5750506000910152565b6001600160a01b03811681146131cf57600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef51546f6b656e3a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fe09cb9f3b0199fa5af751442c61ef6ddee4f3ecdea0f048c804305468f3847064736f6c634300060c0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading