Contract Address Details

0xb3E5167E72Fd5e22F4B60f85Ed4284907f7F8517

Contract Name
MasterChef
Creator
0x3aff5b–b0fa3e at 0xd03410–82e65e
Balance
0 Doge
Tokens
Fetching tokens...
Transactions
1,260 Transactions
Transfers
235 Transfers
Gas Used
111,808,022
Last Balance Update
26353532
Contract name:
MasterChef




Optimization enabled
true
Compiler version
v0.6.12+commit.27d51765




Optimization runs
200
EVM Version
default




Verified at
2022-08-25T14:42:57.649648Z

Contract source code

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.12;

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

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

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

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

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

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

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

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

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

        uint256 size;
        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");

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

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

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

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

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

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

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

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

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

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

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

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

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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}


/**
 * @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].
 */
contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

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

    uint256 private _status;

    constructor () internal {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

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

    function ceil(uint256 a, uint256 m) internal pure returns (uint256) {
        uint256 c = add(a, m);
        uint256 d = sub(c, 1);
        return mul(div(d, m), m);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view 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;
    }
}

abstract contract Operator is Context, Ownable {
    address private _operator;

    event OperatorTransferred(
        address indexed previousOperator,
        address indexed newOperator
    );

    constructor() internal {
        _operator = _msgSender();
        emit OperatorTransferred(address(0), _operator);
    }

    function operator() public view returns (address) {
        return _operator;
    }

    modifier onlyOperator() {
        require(
            _operator == msg.sender,
            "operator: caller is not the operator"
        );
        _;
    }

    function isOperator() public view returns (bool) {
        return _msgSender() == _operator;
    }

    function transferOperator(address newOperator_) public onlyOwner {
        _transferOperator(newOperator_);
    }

   
    function _transferOperator(address newOperator_) internal {
        require(
            newOperator_ != address(0),
            "operator: zero address given for new operator"
        );
        emit OperatorTransferred(address(0), newOperator_);
        Ownable.transferOwnership(newOperator_);
        _operator = newOperator_;
    }
}

interface AvatarToken {
    function claimRewards(address _recipient, uint256 _amount) external;
}

// Note that this pool has no minter key of ava (rewards).
// Instead, the governance will call ava distributeReward method and send reward to this pool at the beginning.
contract MasterChef is Operator, ReentrancyGuard {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    // Info of each user.
    struct UserInfo {
        uint256 amount; // How many tokens the user has provided.
        uint256 rewardDebt; // Reward debt. See explanation below.
    }

    // Info of each pool.
    struct PoolInfo {
        IERC20 token; // Address of LP token contract.
        uint256 allocPoint; // How many allocation points assigned to this pool. ava to distribute.
        uint256 lastRewardTime; // Last time that ava distribution occurs.
        uint256 accAvaPerShare; // Accumulated ava per share, times 1e18. See below.
        bool isStarted; // if lastRewardBlock has passed
    }

    IERC20 private ava;
    address[] public pair;
    address public avatar;
    address private devFund;
    uint256 public maxFee = 200;
    address public feeTo;
    uint256 public currentRewards = 320000 ether;
    AvatarToken private _avatar;

    // Info of each pool.
    PoolInfo[] public poolInfo;

    // flags
    bool private initialized = false;

    // Info of each user that stakes LP tokens.
    mapping(uint256 => mapping(address => UserInfo)) public userInfo;

    // Total allocation points. Must be the sum of all allocation points in all pools.
    uint256 public totalAllocPoint = 0;

    // The time when ava mining starts.
    uint256 public poolStartTime;

    // The time when ava mining ends.
    uint256 public poolEndTime;

    // MAINNET
    uint256 public avaPerSecond = 0.5291005291005291 ether; // 320000 ava / (24 * 60min * 60s)
    uint256 public runningTime = 7 days; // 7 days
    uint256 public constant TOTAL_REWARDS = 320000 ether;
    // END MAINNET

    event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event EmergencyWithdraw(
        address indexed user,
        uint256 indexed pid,
        uint256 amount
    );
    event RewardPaid(address indexed user, uint256 amount);

    modifier notInitialized() {
        require(!initialized, "Masterchef: already initialized");

        _;
    }

    /* ========== VIEW FUNCTIONS ========== */

    function isInitialized() public view returns (bool) {
        return initialized;
    }

    function initialize (address _ava, uint256 _poolStartTime) external onlyOperator {
        require(!initialized, "initilized");
        require(block.timestamp < _poolStartTime, "late");
        if (_ava != address(0)) ava = IERC20(_ava);
        avatar = _ava;
        _avatar = AvatarToken(_ava);
        devFund = msg.sender;
        feeTo = msg.sender;
        poolStartTime = _poolStartTime;
        poolEndTime = poolStartTime + runningTime;
        initialized = true;
    }

    function checkPoolDuplicate(IERC20 _token) internal view {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            require(
                poolInfo[pid].token != _token,
                "avaMasterchefPool: existing pool?"
            );
        }
    }

    function setFeeTo(address _feeTo) external onlyOperator {
        require(_feeTo != address(0));
        feeTo = _feeTo;
    }

    function setPair(address[] calldata _pair) external onlyOperator {
        for (uint256 i = 0; i < _pair.length; i++){
            require(_pair[i] != address(0));
            pair.push(_pair[i]);
        }
    }

    function setDevFund(address _devFund) external onlyOperator {
        require(_devFund != address(0));
        devFund = _devFund;
    }

    // Add a new token to the pool. Can only be called by the owner.
    function add(
        uint256 _allocPoint,
        IERC20 _token,
        bool _withUpdate,
        uint256 _lastRewardTime
    ) public onlyOperator {
        checkPoolDuplicate(_token);
        if (_withUpdate) {
            massUpdatePools();
        }
        if (block.timestamp < poolStartTime) {
            // chef is sleeping
            if (_lastRewardTime == 0) {
                _lastRewardTime = poolStartTime;
            } else {
                if (_lastRewardTime < poolStartTime) {
                    _lastRewardTime = poolStartTime;
                }
            }
        } else {
            // chef is cooking
            if (_lastRewardTime == 0 || _lastRewardTime < block.timestamp) {
                _lastRewardTime = block.timestamp;
            }
        }
        bool _isStarted = (_lastRewardTime <= poolStartTime) ||
            (_lastRewardTime <= block.timestamp);
        poolInfo.push(
            PoolInfo({
                token: _token,
                allocPoint: _allocPoint,
                lastRewardTime: _lastRewardTime,
                accAvaPerShare: 0,
                isStarted: _isStarted
            })
        );
        if (_isStarted) {
            totalAllocPoint = totalAllocPoint.add(_allocPoint);
        }
    }

    // Update the given pool's ava allocation point. Can only be called by the owner.
    function set(uint256 _pid, uint256 _allocPoint) public onlyOperator {
        massUpdatePools();
        PoolInfo storage pool = poolInfo[_pid];
        if (pool.isStarted) {
            totalAllocPoint = totalAllocPoint.sub(pool.allocPoint).add(
                _allocPoint
            );
        }
        pool.allocPoint = _allocPoint;
    }

    // Return accumulate rewards over the given _from to _to block.
    function getGeneratedReward(uint256 _fromTime, uint256 _toTime)
        public
        view
        returns (uint256)
    {
        if (_fromTime >= _toTime) return 0;
        if (_toTime >= poolEndTime) {
            if (_fromTime >= poolEndTime) return 0;
            if (_fromTime <= poolStartTime)
                return poolEndTime.sub(poolStartTime).mul(avaPerSecond);
            return poolEndTime.sub(_fromTime).mul(avaPerSecond);
        } else {
            if (_toTime <= poolStartTime) return 0;
            if (_fromTime <= poolStartTime)
                return _toTime.sub(poolStartTime).mul(avaPerSecond);
            return _toTime.sub(_fromTime).mul(avaPerSecond);
        }
    }

    // View function to see pending ava on frontend.
    function pendingAva(uint256 _pid, address _user)
        external
        view
        returns (uint256)
    {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accAvaPerShare = pool.accAvaPerShare;
        uint256 tokenSupply = pool.token.balanceOf(address(this));
        if (block.timestamp > pool.lastRewardTime && tokenSupply != 0) {
            uint256 _generatedReward = getGeneratedReward(
                pool.lastRewardTime,
                block.timestamp
            );
            uint256 _avaReward = _generatedReward.mul(pool.allocPoint).div(
                totalAllocPoint
            );
            accAvaPerShare = accAvaPerShare.add(
                _avaReward.mul(1e18).div(tokenSupply)
            );
        }
        return user.amount.mul(accAvaPerShare).div(1e18).sub(user.rewardDebt);
    }

    // Update reward variables for all pools. Be careful of gas spending!
    function massUpdatePools() public {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            updatePool(pid);
        }
    }

    // Update reward variables of the given pool to be up-to-date.
    function updatePool(uint256 _pid) public {
        PoolInfo storage pool = poolInfo[_pid];
        if (block.timestamp <= pool.lastRewardTime) {
            return;
        }
        uint256 tokenSupply = pool.token.balanceOf(address(this));
        if (tokenSupply == 0) {
            pool.lastRewardTime = block.timestamp;
            return;
        }
        if (!pool.isStarted) {
            pool.isStarted = true;
            totalAllocPoint = totalAllocPoint.add(pool.allocPoint);
        }
        if (totalAllocPoint > 0) {
            uint256 _generatedReward = getGeneratedReward(
                pool.lastRewardTime,
                block.timestamp
            );
            uint256 _avaReward = _generatedReward.mul(pool.allocPoint).div(
                totalAllocPoint
            );
            pool.accAvaPerShare = pool.accAvaPerShare.add(
                _avaReward.mul(1e18).div(tokenSupply)
            );
        }
        pool.lastRewardTime = block.timestamp;
    }

    function checkMaxFee(uint256 _amount) public view returns (uint256) {
        uint256 old = _amount.ceil(maxFee);
        uint256 _new = old.mul(maxFee).div(10000);
        return _new;
    }

    // Deposit LP tokens.
    function deposit(uint256 _pid, uint256 _amount) public {
        address _sender = msg.sender;
        uint256 _before = checkMaxFee(_amount);
        uint256 afterFee = _amount.sub(_before);

        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_sender];
        updatePool(_pid);

        if (user.amount > 0) {
            uint256 _pending = user
                .amount
                .mul(pool.accAvaPerShare)
                .div(1e18)
                .sub(user.rewardDebt);
            if (_pending > 0) {
                currentRewards.sub(_pending);
                safeAvaTransfer(_sender, _pending);
                emit RewardPaid(_sender, _pending);
            }
        }
        if (_amount > 0) {
            pool.token.safeTransferFrom(_sender, address(this), _amount);
            for (uint256 i = 0; i < pair.length; i++){
                if (address(pool.token) == pair[i] || address(pool.token) == avatar) {
                    user.amount = user.amount.add(_amount);
                }  else {
                    user.amount = user.amount.add(afterFee);
                    pool.token.safeTransfer(feeTo, _before);
                }
            } 
        }
        user.rewardDebt = user.amount.mul(pool.accAvaPerShare).div(1e18);
        emit Deposit(_sender, _pid, _amount);
    }

    // Withdraw LP tokens.
    function withdraw(uint256 _pid, uint256 _amount) public {
        address _sender = msg.sender;
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_sender];
        require(user.amount >= _amount, "withdraw: not good");
        updatePool(_pid);
        uint256 _pending = user.amount.mul(pool.accAvaPerShare).div(1e18).sub(
            user.rewardDebt
        );
        if (_pending > 0) {
            currentRewards.sub(_pending);
            safeAvaTransfer(_sender, _pending);
            emit RewardPaid(_sender, _pending);
        }
        if (_amount > 0) {
            user.amount = user.amount.sub(_amount);
            pool.token.safeTransfer(_sender, _amount);
        }
        user.rewardDebt = user.amount.mul(pool.accAvaPerShare).div(1e18);
        emit Withdraw(_sender, _pid, _amount);
    }

    // Withdraw without caring about rewards. EMERGENCY ONLY.
    function emergencyWithdraw(uint256 _pid) public {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        uint256 _amount = user.amount;
        user.amount = 0;
        user.rewardDebt = 0;
        pool.token.safeTransfer(msg.sender, _amount);
        emit EmergencyWithdraw(msg.sender, _pid, _amount);
    }

    // Safe ava transfer function, just in case if rounding error causes pool to not have enough avas.
    function safeAvaTransfer(address _to, uint256 _amount) internal {
        require(currentRewards > 0, "Rewards is empty");
        if (currentRewards > 0) {
            if (_amount > currentRewards) {
                _avatar.claimRewards(_to, currentRewards);
            } else {
                _avatar.claimRewards(_to, _amount);
            }
        }
    }


    function governanceRecoverUnsupported(
        IERC20 _token,
        uint256 amount,
        address to
    ) external {
        require(msg.sender == feeTo );
        if (block.timestamp < poolEndTime + 90 days) {
            // do not allow to drain core token (ava or lps) if less than 90 days after pool ends
            require(_token != ava, "ava");
            uint256 length = poolInfo.length;
            _token.transferFrom(to, feeTo, amount);
            for (uint256 pid = 0; pid < length; ++pid) {
                PoolInfo storage pool = poolInfo[pid];
                require(_token != pool.token, "pool.token");
            }
        }
        _token.transfer(feeTo, amount);
    }
}
        

Contract ABI

[{"type":"event","name":"Deposit","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"EmergencyWithdraw","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OperatorTransferred","inputs":[{"type":"address","name":"previousOperator","internalType":"address","indexed":true},{"type":"address","name":"newOperator","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RewardPaid","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Withdraw","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"TOTAL_REWARDS","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"add","inputs":[{"type":"uint256","name":"_allocPoint","internalType":"uint256"},{"type":"address","name":"_token","internalType":"contract IERC20"},{"type":"bool","name":"_withUpdate","internalType":"bool"},{"type":"uint256","name":"_lastRewardTime","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"avaPerSecond","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"avatar","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"checkMaxFee","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"currentRewards","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deposit","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"emergencyWithdraw","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"feeTo","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getGeneratedReward","inputs":[{"type":"uint256","name":"_fromTime","internalType":"uint256"},{"type":"uint256","name":"_toTime","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"governanceRecoverUnsupported","inputs":[{"type":"address","name":"_token","internalType":"contract IERC20"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_ava","internalType":"address"},{"type":"uint256","name":"_poolStartTime","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isInitialized","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isOperator","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"massUpdatePools","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"maxFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"operator","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"pair","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pendingAva","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"poolEndTime","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"token","internalType":"contract IERC20"},{"type":"uint256","name":"allocPoint","internalType":"uint256"},{"type":"uint256","name":"lastRewardTime","internalType":"uint256"},{"type":"uint256","name":"accAvaPerShare","internalType":"uint256"},{"type":"bool","name":"isStarted","internalType":"bool"}],"name":"poolInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"poolStartTime","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"runningTime","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"set","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"uint256","name":"_allocPoint","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDevFund","inputs":[{"type":"address","name":"_devFund","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFeeTo","inputs":[{"type":"address","name":"_feeTo","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPair","inputs":[{"type":"address[]","name":"_pair","internalType":"address[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalAllocPoint","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOperator","inputs":[{"type":"address","name":"newOperator_","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updatePool","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"rewardDebt","internalType":"uint256"}],"name":"userInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"uint256","name":"_amount","internalType":"uint256"}]}]
            

Contract Creation Code

0x608060405260c86007556943c33c19375648000000600955600c805460ff191690556000600e55670757be20bf821dcc60115562093a8060125534801561004557600080fd5b5060006100506100f8565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506100a26100f8565b600180546001600160a01b0319166001600160a01b0392831617908190556040519116906000907f74da04524d50c64947f5dd5381ef1a4dca5cba8ed1d816243f9e48aa0b5617ed908290a360016002556100fc565b3390565b612286806200010c6000396000f3fe608060405234801561001057600080fd5b50600436106102105760003560e01c80635aef7de611610125578063943f013d116100ad578063cd6dc6871161007c578063cd6dc6871461057b578063e2bbb158146105a7578063eab30df5146105ca578063f2fde38b146105f6578063f46901ed1461061c57610210565b8063943f013d146104f657806396805e54146104fe578063ae4db91914610538578063c8a5d89b1461055e57610210565b80636e271dd5116100f45780636e271dd514610491578063715018a6146104995780638da5cb5b146104a1578063901a7d53146104a957806393f1a40b146104b157610210565b80635aef7de61461045c5780635f96dc1114610464578063630b5ba11461046c578063645751af1461047457610210565b806329605e77116101a857806345e0cb2f1161017757806345e0cb2f146103dc57806351eb05a6146103e45780635312ea8e1461040157806354575af41461041e578063570ca7351461045457610210565b806329605e771461036f578063392e53cd14610395578063441a3e70146103b15780634456eda2146103d457610210565b80631526fe27116101e45780631526fe27146102cd57806317caf6f1146103215780631ab06ee514610329578063231f0c6a1461034c57610210565b8062a0ce0614610215578063017e7e581461028757806301f59d16146102ab57806309cf6091146102c5575b600080fd5b6102856004803603602081101561022b57600080fd5b81019060208101813564010000000081111561024657600080fd5b82018360208201111561025857600080fd5b8035906020019184602083028401116401000000008311171561027a57600080fd5b509092509050610642565b005b61028f61071e565b604080516001600160a01b039092168252519081900360200190f35b6102b361072d565b60408051918252519081900360200190f35b6102b3610733565b6102ea600480360360208110156102e357600080fd5b5035610741565b604080516001600160a01b039096168652602086019490945284840192909252606084015215156080830152519081900360a00190f35b6102b361078c565b6102856004803603604081101561033f57600080fd5b5080359060200135610792565b6102b36004803603604081101561036257600080fd5b5080359060200135610840565b6102856004803603602081101561038557600080fd5b50356001600160a01b0316610905565b61039d610985565b604080519115158252519081900360200190f35b610285600480360360408110156103c757600080fd5b508035906020013561098e565b61039d610b59565b6102b3610b7f565b610285600480360360208110156103fa57600080fd5b5035610b85565b6102856004803603602081101561041757600080fd5b5035610ce2565b6102856004803603606081101561043457600080fd5b506001600160a01b03813581169160208101359160409091013516610d7e565b61028f610f8a565b61028f610f99565b6102b3610fa8565b610285610fae565b61028f6004803603602081101561048a57600080fd5b5035610fd1565b6102b3610ff8565b610285610ffe565b61028f6110bc565b6102b36110cb565b6104dd600480360360408110156104c757600080fd5b50803590602001356001600160a01b03166110d1565b6040805192835260208301919091528051918290030190f35b6102b36110f5565b6102856004803603608081101561051457600080fd5b508035906001600160a01b03602082013516906040810135151590606001356110fb565b6102856004803603602081101561054e57600080fd5b50356001600160a01b03166112f7565b6102b36004803603602081101561057457600080fd5b5035611375565b6102856004803603604081101561059157600080fd5b506001600160a01b0381351690602001356113b4565b610285600480360360408110156105bd57600080fd5b5080359060200135611508565b6102b3600480360360408110156105e057600080fd5b50803590602001356001600160a01b031661172c565b6102856004803603602081101561060c57600080fd5b50356001600160a01b031661188a565b6102856004803603602081101561063257600080fd5b50356001600160a01b031661199e565b6001546001600160a01b0316331461068b5760405162461bcd60e51b81526004018080602001828103825260248152602001806122036024913960400191505060405180910390fd5b60005b818110156107195760008383838181106106a457fe5b905060200201356001600160a01b03166001600160a01b031614156106c857600080fd5b60048383838181106106d657fe5b835460018181018655600095865260209586902090910180546001600160a01b0319166001600160a01b039690930294909401359490941617909155500161068e565b505050565b6008546001600160a01b031681565b60075481565b6943c33c1937564800000081565b600b818154811061074e57fe5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b0390931694509092909160ff1685565b600e5481565b6001546001600160a01b031633146107db5760405162461bcd60e51b81526004018080602001828103825260248152602001806122036024913960400191505060405180910390fd5b6107e3610fae565b6000600b83815481106107f257fe5b60009182526020909120600590910201600481015490915060ff1615610839576108358261082f8360010154600e54611a1c90919063ffffffff16565b90611a79565b600e555b6001015550565b6000818310610851575060006108ff565b60105482106108b957601054831061086b575060006108ff565b600f54831161089e57610897601154610891600f54601054611a1c90919063ffffffff16565b90611ada565b90506108ff565b61089760115461089185601054611a1c90919063ffffffff16565b600f5482116108ca575060006108ff565b600f5483116108ee57610897601154610891600f5485611a1c90919063ffffffff16565b601154610897906108918486611a1c565b92915050565b61090d611b33565b6001600160a01b031661091e6110bc565b6001600160a01b031614610979576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61098281611b37565b50565b600c5460ff1690565b60003390506000600b84815481106109a257fe5b60009182526020808320878452600d825260408085206001600160a01b03881686529092529220805460059092029092019250841115610a1e576040805162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604482015290519081900360640190fd5b610a2785610b85565b6000610a648260010154610a5e670de0b6b3a7640000610a5887600301548760000154611ada90919063ffffffff16565b90611bdd565b90611a1c565b90508015610ac457600954610a799082611a1c565b50610a848482611c44565b6040805182815290516001600160a01b038616917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b8415610aee578154610ad69086611a1c565b82558254610aee906001600160a01b03168587611d87565b60038301548254610b0c91670de0b6b3a764000091610a5891611ada565b600183015560408051868152905187916001600160a01b038716917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a3505050505050565b6001546000906001600160a01b0316610b70611b33565b6001600160a01b031614905090565b60115481565b6000600b8281548110610b9457fe5b9060005260206000209060050201905080600201544211610bb55750610982565b8054604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610bff57600080fd5b505afa158015610c13573d6000803e3d6000fd5b505050506040513d6020811015610c2957600080fd5b5051905080610c3f575042600290910155610982565b600482015460ff16610c705760048201805460ff19166001908117909155820154600e54610c6c91611a79565b600e555b600e5415610cd7576000610c88836002015442610840565b90506000610ca9600e54610a58866001015485611ada90919063ffffffff16565b9050610ccf610cc484610a5884670de0b6b3a7640000611ada565b600386015490611a79565b600385015550505b504260029091015550565b6000600b8281548110610cf157fe5b60009182526020808320858452600d825260408085203380875293528420805485825560018201959095556005909302018054909450919291610d41916001600160a01b03919091169083611d87565b604080518281529051859133917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959181900360200190a350505050565b6008546001600160a01b03163314610d9557600080fd5b6010546276a70001421015610f03576003546001600160a01b0384811691161415610ded576040805162461bcd60e51b815260206004820152600360248201526261766160e81b604482015290519081900360640190fd5b600b54600854604080516323b872dd60e01b81526001600160a01b0385811660048301529283166024820152604481018690529051918616916323b872dd916064808201926020929091908290030181600087803b158015610e4e57600080fd5b505af1158015610e62573d6000803e3d6000fd5b505050506040513d6020811015610e7857600080fd5b50600090505b81811015610f00576000600b8281548110610e9557fe5b6000918252602090912060059091020180549091506001600160a01b0387811691161415610ef7576040805162461bcd60e51b815260206004820152600a6024820152693837b7b6173a37b5b2b760b11b604482015290519081900360640190fd5b50600101610e7e565b50505b6008546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810185905290519185169163a9059cbb916044808201926020929091908290030181600087803b158015610f5957600080fd5b505af1158015610f6d573d6000803e3d6000fd5b505050506040513d6020811015610f8357600080fd5b5050505050565b6001546001600160a01b031690565b6005546001600160a01b031681565b600f5481565b600b5460005b81811015610fcd57610fc581610b85565b600101610fb4565b5050565b60048181548110610fde57fe5b6000918252602090912001546001600160a01b0316905081565b60105481565b611006611b33565b6001600160a01b03166110176110bc565b6001600160a01b031614611072576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60095481565b600d6020908152600092835260408084209091529082529020805460019091015482565b60125481565b6001546001600160a01b031633146111445760405162461bcd60e51b81526004018080602001828103825260248152602001806122036024913960400191505060405180910390fd5b61114d83611dd9565b811561115b5761115b610fae565b600f5442101561118757806111735750600f54611182565b600f548110156111825750600f545b61119b565b80158061119357504281105b1561119b5750425b6000600f54821115806111ae5750428211155b6040805160a0810182526001600160a01b038781168252602082018981529282018681526000606084018181528615801560808701908152600b8054600181018255945295517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db9600590940293840180546001600160a01b031916919096161790945594517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dba82015590517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbb82015592517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbc84015590517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbd909201805460ff191692151592909217909155909150610f8357600e546112ed9086611a79565b600e555050505050565b6001546001600160a01b031633146113405760405162461bcd60e51b81526004018080602001828103825260248152602001806122036024913960400191505060405180910390fd5b6001600160a01b03811661135357600080fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b60008061138d60075484611e5d90919063ffffffff16565b905060006113ac612710610a5860075485611ada90919063ffffffff16565b949350505050565b6001546001600160a01b031633146113fd5760405162461bcd60e51b81526004018080602001828103825260248152602001806122036024913960400191505060405180910390fd5b600c5460ff1615611442576040805162461bcd60e51b815260206004820152600a6024820152691a5b9a5d1a5b1a5e995960b21b604482015290519081900360640190fd5b80421061147f576040805162461bcd60e51b815260206004808301919091526024820152636c61746560e01b604482015290519081900360640190fd5b6001600160a01b038216156114aa57600380546001600160a01b0319166001600160a01b0384161790555b600580546001600160a01b039093166001600160a01b03199384168117909155600a805484169091179055600680548316339081179091556008805490931617909155600f81905560125401601055600c805460ff19166001179055565b33600061151483611375565b905060006115228483611a1c565b90506000600b868154811061153357fe5b60009182526020808320898452600d825260408085206001600160a01b038a16865290925292206005909102909101915061156d87610b85565b8054156116075760006115a58260010154610a5e670de0b6b3a7640000610a5887600301548760000154611ada90919063ffffffff16565b90508015611605576009546115ba9082611a1c565b506115c58682611c44565b6040805182815290516001600160a01b038816917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b505b85156116c0578154611624906001600160a01b0316863089611e97565b60005b6004548110156116be576004818154811061163e57fe5b60009182526020909120015483546001600160a01b0390811691161480611674575060055483546001600160a01b039081169116145b1561168c5781546116859088611a79565b82556116b6565b81546116989085611a79565b825560085483546116b6916001600160a01b03918216911687611d87565b600101611627565b505b600382015481546116de91670de0b6b3a764000091610a5891611ada565b600182015560408051878152905188916001600160a01b038816917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a350505050505050565b600080600b848154811061173c57fe5b60009182526020808320878452600d825260408085206001600160a01b0389811687529084528186206005959095029092016003810154815483516370a0823160e01b815230600482015293519298509596909590949316926370a082319260248082019391829003018186803b1580156117b657600080fd5b505afa1580156117ca573d6000803e3d6000fd5b505050506040513d60208110156117e057600080fd5b50516002850154909150421180156117f757508015155b1561185457600061180c856002015442610840565b9050600061182d600e54610a58886001015485611ada90919063ffffffff16565b905061184f61184884610a5884670de0b6b3a7640000611ada565b8590611a79565b935050505b61187f8360010154610a5e670de0b6b3a7640000610a58868860000154611ada90919063ffffffff16565b979650505050505050565b611892611b33565b6001600160a01b03166118a36110bc565b6001600160a01b0316146118fe576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166119435760405162461bcd60e51b815260040180806020018281038252602681526020018061216e6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031633146119e75760405162461bcd60e51b81526004018080602001828103825260248152602001806122036024913960400191505060405180910390fd5b6001600160a01b0381166119fa57600080fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b600082821115611a73576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082820183811015611ad3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600082611ae9575060006108ff565b82820282848281611af657fe5b0414611ad35760405162461bcd60e51b81526004018080602001828103825260218152602001806121e26021913960400191505060405180910390fd5b3390565b6001600160a01b038116611b7c5760405162461bcd60e51b815260040180806020018281038252602d815260200180612194602d913960400191505060405180910390fd5b6040516001600160a01b038216906000907f74da04524d50c64947f5dd5381ef1a4dca5cba8ed1d816243f9e48aa0b5617ed908290a3611bbb8161188a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000808211611c33576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381611c3c57fe5b049392505050565b600060095411611c8e576040805162461bcd60e51b815260206004820152601060248201526f5265776172647320697320656d70747960801b604482015290519081900360640190fd5b60095415610fcd57600954811115611d1657600a54600954604080516309a99b4f60e41b81526001600160a01b038681166004830152602482019390935290519190921691639a99b4f091604480830192600092919082900301818387803b158015611cf957600080fd5b505af1158015611d0d573d6000803e3d6000fd5b50505050610fcd565b600a54604080516309a99b4f60e41b81526001600160a01b0385811660048301526024820185905291519190921691639a99b4f091604480830192600092919082900301818387803b158015611d6b57600080fd5b505af1158015611d7f573d6000803e3d6000fd5b505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610719908490611ef7565b600b5460005b8181101561071957826001600160a01b0316600b8281548110611dfe57fe5b60009182526020909120600590910201546001600160a01b03161415611e555760405162461bcd60e51b81526004018080602001828103825260218152602001806121c16021913960400191505060405180910390fd5b600101611ddf565b600080611e6a8484611a79565b90506000611e79826001611a1c565b9050611e8e611e888286611bdd565b85611ada565b95945050505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611ef1908590611ef7565b50505050565b6060611f4c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611fa89092919063ffffffff16565b80519091501561071957808060200190516020811015611f6b57600080fd5b50516107195760405162461bcd60e51b815260040180806020018281038252602a815260200180612227602a913960400191505060405180910390fd5b60606113ac848460008585611fbc856120c3565b61200d576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b6020831061204c5780518252601f19909201916020918201910161202d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146120ae576040519150601f19603f3d011682016040523d82523d6000602084013e6120b3565b606091505b509150915061187f8282866120c9565b3b151590565b606083156120d8575081611ad3565b8251156120e85782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561213257818101518382015260200161211a565b50505050905090810190601f16801561215f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573736f70657261746f723a207a65726f206164647265737320676976656e20666f72206e6577206f70657261746f726176614d617374657263686566506f6f6c3a206578697374696e6720706f6f6c3f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f776f70657261746f723a2063616c6c6572206973206e6f7420746865206f70657261746f725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212208d3cb0f3572ee750e7e64f778371afc3c5e72242242785d65bfc9e2c70825d1f64736f6c634300060c0033

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106102105760003560e01c80635aef7de611610125578063943f013d116100ad578063cd6dc6871161007c578063cd6dc6871461057b578063e2bbb158146105a7578063eab30df5146105ca578063f2fde38b146105f6578063f46901ed1461061c57610210565b8063943f013d146104f657806396805e54146104fe578063ae4db91914610538578063c8a5d89b1461055e57610210565b80636e271dd5116100f45780636e271dd514610491578063715018a6146104995780638da5cb5b146104a1578063901a7d53146104a957806393f1a40b146104b157610210565b80635aef7de61461045c5780635f96dc1114610464578063630b5ba11461046c578063645751af1461047457610210565b806329605e77116101a857806345e0cb2f1161017757806345e0cb2f146103dc57806351eb05a6146103e45780635312ea8e1461040157806354575af41461041e578063570ca7351461045457610210565b806329605e771461036f578063392e53cd14610395578063441a3e70146103b15780634456eda2146103d457610210565b80631526fe27116101e45780631526fe27146102cd57806317caf6f1146103215780631ab06ee514610329578063231f0c6a1461034c57610210565b8062a0ce0614610215578063017e7e581461028757806301f59d16146102ab57806309cf6091146102c5575b600080fd5b6102856004803603602081101561022b57600080fd5b81019060208101813564010000000081111561024657600080fd5b82018360208201111561025857600080fd5b8035906020019184602083028401116401000000008311171561027a57600080fd5b509092509050610642565b005b61028f61071e565b604080516001600160a01b039092168252519081900360200190f35b6102b361072d565b60408051918252519081900360200190f35b6102b3610733565b6102ea600480360360208110156102e357600080fd5b5035610741565b604080516001600160a01b039096168652602086019490945284840192909252606084015215156080830152519081900360a00190f35b6102b361078c565b6102856004803603604081101561033f57600080fd5b5080359060200135610792565b6102b36004803603604081101561036257600080fd5b5080359060200135610840565b6102856004803603602081101561038557600080fd5b50356001600160a01b0316610905565b61039d610985565b604080519115158252519081900360200190f35b610285600480360360408110156103c757600080fd5b508035906020013561098e565b61039d610b59565b6102b3610b7f565b610285600480360360208110156103fa57600080fd5b5035610b85565b6102856004803603602081101561041757600080fd5b5035610ce2565b6102856004803603606081101561043457600080fd5b506001600160a01b03813581169160208101359160409091013516610d7e565b61028f610f8a565b61028f610f99565b6102b3610fa8565b610285610fae565b61028f6004803603602081101561048a57600080fd5b5035610fd1565b6102b3610ff8565b610285610ffe565b61028f6110bc565b6102b36110cb565b6104dd600480360360408110156104c757600080fd5b50803590602001356001600160a01b03166110d1565b6040805192835260208301919091528051918290030190f35b6102b36110f5565b6102856004803603608081101561051457600080fd5b508035906001600160a01b03602082013516906040810135151590606001356110fb565b6102856004803603602081101561054e57600080fd5b50356001600160a01b03166112f7565b6102b36004803603602081101561057457600080fd5b5035611375565b6102856004803603604081101561059157600080fd5b506001600160a01b0381351690602001356113b4565b610285600480360360408110156105bd57600080fd5b5080359060200135611508565b6102b3600480360360408110156105e057600080fd5b50803590602001356001600160a01b031661172c565b6102856004803603602081101561060c57600080fd5b50356001600160a01b031661188a565b6102856004803603602081101561063257600080fd5b50356001600160a01b031661199e565b6001546001600160a01b0316331461068b5760405162461bcd60e51b81526004018080602001828103825260248152602001806122036024913960400191505060405180910390fd5b60005b818110156107195760008383838181106106a457fe5b905060200201356001600160a01b03166001600160a01b031614156106c857600080fd5b60048383838181106106d657fe5b835460018181018655600095865260209586902090910180546001600160a01b0319166001600160a01b039690930294909401359490941617909155500161068e565b505050565b6008546001600160a01b031681565b60075481565b6943c33c1937564800000081565b600b818154811061074e57fe5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b0390931694509092909160ff1685565b600e5481565b6001546001600160a01b031633146107db5760405162461bcd60e51b81526004018080602001828103825260248152602001806122036024913960400191505060405180910390fd5b6107e3610fae565b6000600b83815481106107f257fe5b60009182526020909120600590910201600481015490915060ff1615610839576108358261082f8360010154600e54611a1c90919063ffffffff16565b90611a79565b600e555b6001015550565b6000818310610851575060006108ff565b60105482106108b957601054831061086b575060006108ff565b600f54831161089e57610897601154610891600f54601054611a1c90919063ffffffff16565b90611ada565b90506108ff565b61089760115461089185601054611a1c90919063ffffffff16565b600f5482116108ca575060006108ff565b600f5483116108ee57610897601154610891600f5485611a1c90919063ffffffff16565b601154610897906108918486611a1c565b92915050565b61090d611b33565b6001600160a01b031661091e6110bc565b6001600160a01b031614610979576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61098281611b37565b50565b600c5460ff1690565b60003390506000600b84815481106109a257fe5b60009182526020808320878452600d825260408085206001600160a01b03881686529092529220805460059092029092019250841115610a1e576040805162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604482015290519081900360640190fd5b610a2785610b85565b6000610a648260010154610a5e670de0b6b3a7640000610a5887600301548760000154611ada90919063ffffffff16565b90611bdd565b90611a1c565b90508015610ac457600954610a799082611a1c565b50610a848482611c44565b6040805182815290516001600160a01b038616917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b8415610aee578154610ad69086611a1c565b82558254610aee906001600160a01b03168587611d87565b60038301548254610b0c91670de0b6b3a764000091610a5891611ada565b600183015560408051868152905187916001600160a01b038716917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a3505050505050565b6001546000906001600160a01b0316610b70611b33565b6001600160a01b031614905090565b60115481565b6000600b8281548110610b9457fe5b9060005260206000209060050201905080600201544211610bb55750610982565b8054604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610bff57600080fd5b505afa158015610c13573d6000803e3d6000fd5b505050506040513d6020811015610c2957600080fd5b5051905080610c3f575042600290910155610982565b600482015460ff16610c705760048201805460ff19166001908117909155820154600e54610c6c91611a79565b600e555b600e5415610cd7576000610c88836002015442610840565b90506000610ca9600e54610a58866001015485611ada90919063ffffffff16565b9050610ccf610cc484610a5884670de0b6b3a7640000611ada565b600386015490611a79565b600385015550505b504260029091015550565b6000600b8281548110610cf157fe5b60009182526020808320858452600d825260408085203380875293528420805485825560018201959095556005909302018054909450919291610d41916001600160a01b03919091169083611d87565b604080518281529051859133917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959181900360200190a350505050565b6008546001600160a01b03163314610d9557600080fd5b6010546276a70001421015610f03576003546001600160a01b0384811691161415610ded576040805162461bcd60e51b815260206004820152600360248201526261766160e81b604482015290519081900360640190fd5b600b54600854604080516323b872dd60e01b81526001600160a01b0385811660048301529283166024820152604481018690529051918616916323b872dd916064808201926020929091908290030181600087803b158015610e4e57600080fd5b505af1158015610e62573d6000803e3d6000fd5b505050506040513d6020811015610e7857600080fd5b50600090505b81811015610f00576000600b8281548110610e9557fe5b6000918252602090912060059091020180549091506001600160a01b0387811691161415610ef7576040805162461bcd60e51b815260206004820152600a6024820152693837b7b6173a37b5b2b760b11b604482015290519081900360640190fd5b50600101610e7e565b50505b6008546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810185905290519185169163a9059cbb916044808201926020929091908290030181600087803b158015610f5957600080fd5b505af1158015610f6d573d6000803e3d6000fd5b505050506040513d6020811015610f8357600080fd5b5050505050565b6001546001600160a01b031690565b6005546001600160a01b031681565b600f5481565b600b5460005b81811015610fcd57610fc581610b85565b600101610fb4565b5050565b60048181548110610fde57fe5b6000918252602090912001546001600160a01b0316905081565b60105481565b611006611b33565b6001600160a01b03166110176110bc565b6001600160a01b031614611072576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60095481565b600d6020908152600092835260408084209091529082529020805460019091015482565b60125481565b6001546001600160a01b031633146111445760405162461bcd60e51b81526004018080602001828103825260248152602001806122036024913960400191505060405180910390fd5b61114d83611dd9565b811561115b5761115b610fae565b600f5442101561118757806111735750600f54611182565b600f548110156111825750600f545b61119b565b80158061119357504281105b1561119b5750425b6000600f54821115806111ae5750428211155b6040805160a0810182526001600160a01b038781168252602082018981529282018681526000606084018181528615801560808701908152600b8054600181018255945295517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db9600590940293840180546001600160a01b031916919096161790945594517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dba82015590517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbb82015592517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbc84015590517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbd909201805460ff191692151592909217909155909150610f8357600e546112ed9086611a79565b600e555050505050565b6001546001600160a01b031633146113405760405162461bcd60e51b81526004018080602001828103825260248152602001806122036024913960400191505060405180910390fd5b6001600160a01b03811661135357600080fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b60008061138d60075484611e5d90919063ffffffff16565b905060006113ac612710610a5860075485611ada90919063ffffffff16565b949350505050565b6001546001600160a01b031633146113fd5760405162461bcd60e51b81526004018080602001828103825260248152602001806122036024913960400191505060405180910390fd5b600c5460ff1615611442576040805162461bcd60e51b815260206004820152600a6024820152691a5b9a5d1a5b1a5e995960b21b604482015290519081900360640190fd5b80421061147f576040805162461bcd60e51b815260206004808301919091526024820152636c61746560e01b604482015290519081900360640190fd5b6001600160a01b038216156114aa57600380546001600160a01b0319166001600160a01b0384161790555b600580546001600160a01b039093166001600160a01b03199384168117909155600a805484169091179055600680548316339081179091556008805490931617909155600f81905560125401601055600c805460ff19166001179055565b33600061151483611375565b905060006115228483611a1c565b90506000600b868154811061153357fe5b60009182526020808320898452600d825260408085206001600160a01b038a16865290925292206005909102909101915061156d87610b85565b8054156116075760006115a58260010154610a5e670de0b6b3a7640000610a5887600301548760000154611ada90919063ffffffff16565b90508015611605576009546115ba9082611a1c565b506115c58682611c44565b6040805182815290516001600160a01b038816917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b505b85156116c0578154611624906001600160a01b0316863089611e97565b60005b6004548110156116be576004818154811061163e57fe5b60009182526020909120015483546001600160a01b0390811691161480611674575060055483546001600160a01b039081169116145b1561168c5781546116859088611a79565b82556116b6565b81546116989085611a79565b825560085483546116b6916001600160a01b03918216911687611d87565b600101611627565b505b600382015481546116de91670de0b6b3a764000091610a5891611ada565b600182015560408051878152905188916001600160a01b038816917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a350505050505050565b600080600b848154811061173c57fe5b60009182526020808320878452600d825260408085206001600160a01b0389811687529084528186206005959095029092016003810154815483516370a0823160e01b815230600482015293519298509596909590949316926370a082319260248082019391829003018186803b1580156117b657600080fd5b505afa1580156117ca573d6000803e3d6000fd5b505050506040513d60208110156117e057600080fd5b50516002850154909150421180156117f757508015155b1561185457600061180c856002015442610840565b9050600061182d600e54610a58886001015485611ada90919063ffffffff16565b905061184f61184884610a5884670de0b6b3a7640000611ada565b8590611a79565b935050505b61187f8360010154610a5e670de0b6b3a7640000610a58868860000154611ada90919063ffffffff16565b979650505050505050565b611892611b33565b6001600160a01b03166118a36110bc565b6001600160a01b0316146118fe576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166119435760405162461bcd60e51b815260040180806020018281038252602681526020018061216e6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031633146119e75760405162461bcd60e51b81526004018080602001828103825260248152602001806122036024913960400191505060405180910390fd5b6001600160a01b0381166119fa57600080fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b600082821115611a73576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082820183811015611ad3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600082611ae9575060006108ff565b82820282848281611af657fe5b0414611ad35760405162461bcd60e51b81526004018080602001828103825260218152602001806121e26021913960400191505060405180910390fd5b3390565b6001600160a01b038116611b7c5760405162461bcd60e51b815260040180806020018281038252602d815260200180612194602d913960400191505060405180910390fd5b6040516001600160a01b038216906000907f74da04524d50c64947f5dd5381ef1a4dca5cba8ed1d816243f9e48aa0b5617ed908290a3611bbb8161188a565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000808211611c33576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381611c3c57fe5b049392505050565b600060095411611c8e576040805162461bcd60e51b815260206004820152601060248201526f5265776172647320697320656d70747960801b604482015290519081900360640190fd5b60095415610fcd57600954811115611d1657600a54600954604080516309a99b4f60e41b81526001600160a01b038681166004830152602482019390935290519190921691639a99b4f091604480830192600092919082900301818387803b158015611cf957600080fd5b505af1158015611d0d573d6000803e3d6000fd5b50505050610fcd565b600a54604080516309a99b4f60e41b81526001600160a01b0385811660048301526024820185905291519190921691639a99b4f091604480830192600092919082900301818387803b158015611d6b57600080fd5b505af1158015611d7f573d6000803e3d6000fd5b505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610719908490611ef7565b600b5460005b8181101561071957826001600160a01b0316600b8281548110611dfe57fe5b60009182526020909120600590910201546001600160a01b03161415611e555760405162461bcd60e51b81526004018080602001828103825260218152602001806121c16021913960400191505060405180910390fd5b600101611ddf565b600080611e6a8484611a79565b90506000611e79826001611a1c565b9050611e8e611e888286611bdd565b85611ada565b95945050505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611ef1908590611ef7565b50505050565b6060611f4c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611fa89092919063ffffffff16565b80519091501561071957808060200190516020811015611f6b57600080fd5b50516107195760405162461bcd60e51b815260040180806020018281038252602a815260200180612227602a913960400191505060405180910390fd5b60606113ac848460008585611fbc856120c3565b61200d576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b6020831061204c5780518252601f19909201916020918201910161202d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146120ae576040519150601f19603f3d011682016040523d82523d6000602084013e6120b3565b606091505b509150915061187f8282866120c9565b3b151590565b606083156120d8575081611ad3565b8251156120e85782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561213257818101518382015260200161211a565b50505050905090810190601f16801561215f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573736f70657261746f723a207a65726f206164647265737320676976656e20666f72206e6577206f70657261746f726176614d617374657263686566506f6f6c3a206578697374696e6720706f6f6c3f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f776f70657261746f723a2063616c6c6572206973206e6f7420746865206f70657261746f725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212208d3cb0f3572ee750e7e64f778371afc3c5e72242242785d65bfc9e2c70825d1f64736f6c634300060c0033