Contract Address Details

0x3135f173F6e21498e685ABD536b16AD474A6337D

Contract Name
Treasury
Creator
0xe34e00–e2ffcb at 0x13dce4–2e5f97
Balance
0 CRO ( )
Tokens
Fetching tokens...
Transactions
1,558 Transactions
Transfers
155 Transfers
Gas Used
384,123,456
Last Balance Update
13548985
Contract name:
Treasury




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




Optimization runs
25000
EVM Version
default




Verified at
2022-01-16T17:20:05.091606Z

Contract source code

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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









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




interface IBoardroom {
    function balanceOf(address _member) external view returns (uint256);

    function earned(address _member) external view returns (uint256);

    function canWithdraw(address _member) external view returns (bool);

    function canClaimReward(address _member) external view returns (bool);

    function epoch() external view returns (uint256);

    function nextEpochPoint() external view returns (uint256);

    function getGaurPrice() external view returns (uint256);

    function setOperator(address _operator) external returns (bool);

    function setLockUp(uint256 _withdrawLockupEpochs, uint256 _rewardLockupEpochs) external returns (bool);

    function stake(uint256 _amount) external returns (bool);

    function withdraw(uint256 _amount) external returns (bool);

    function exit() external returns (bool);

    function claimReward() external returns (bool);

    function allocateSeigniorage(uint256 _amount) external returns (bool);

    function governanceRecoverUnsupported(
        address _token,
        uint256 _amount,
        address _to
    ) external returns (bool);
}




interface IOracle {
    function update() external;

    function consult(address _token, uint256 _amountIn) external view returns (uint144 amountOut);

    function twap(address _token, uint256 _amountIn) external view returns (uint144 _amountOut);
}




interface IBasisAsset {
    function mint(address recipient, uint256 amount) external returns (bool);

    function burn(uint256 amount) external;

    function burnFrom(address from, uint256 amount) external;

    function isOperator() external returns (bool);

    function operator() external view returns (address);

    function transferOperator(address newOperator_) external;
}





contract ContractGuard {
    mapping(uint256 => mapping(address => bool)) private _status;

    function checkSameOriginReentranted() internal view returns (bool) {
        return _status[block.number][tx.origin];
    }

    function checkSameSenderReentranted() internal view returns (bool) {
        return _status[block.number][msg.sender];
    }

    modifier onlyOneBlock() {
        require(!checkSameOriginReentranted(), "ContractGuard: one block, one function");
        require(!checkSameSenderReentranted(), "ContractGuard: one block, one function");

        _;

        _status[block.number][tx.origin] = true;
        _status[block.number][msg.sender] = true;
    }
}




library Babylonian {
    function sqrt(uint256 y) internal pure returns (uint256 z) {
        if (y > 3) {
            z = y;
            uint256 x = y / 2 + 1;
            while (x < z) {
                z = x;
                x = (y / x + x) / 2;
            }
        } else if (y != 0) {
            z = 1;
        }
        // else z = 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);
    }
}











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





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

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

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

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

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

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

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

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

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

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

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

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(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);
            }
        }
    }
}


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

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

    uint256 private _status;

    constructor () internal {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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








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



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 returns (bool) {
        _transferOperator(newOperator_);
        return true;
    }

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







contract Treasury is ContractGuard {
    using SafeERC20 for IERC20;
    using Address for address;
    using SafeMath for uint256;

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

    uint256 public constant PERIOD = 6 hours;
    uint256 public constant GAUR_PRICE_ONE = 1e15;

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

    // governance
    address public operator;

    // flags
    bool public initialized = false;

    // epoch
    uint256 public startTime;
    uint256 public epoch = 0;
    uint256 public epochSupplyContractionLeft = 0;

    // exclusions from total supply
    address[] public excludedFromTotalSupply = [
        address(0xbfa1aB731372aF995b3423D652D0b41C74969145), // GaurGenesisPool
        address(0x78d572258590a3bc9a59C3803434581714492078) // new GaurRewardPool
    ];

    // core components
    address public gaur;
    address public gbond;
    address public gshare;

    address public boardroom;
    address public gaurOracle;

    // price
    uint256 public gaurPriceCeiling;

    uint256 public seigniorageSaved;

    uint256[] public supplyTiers;
    uint256[] public maxExpansionTiers;

    uint256 public maxSupplyExpansionPercent;
    uint256 public bondDepletionFloorPercent;
    uint256 public seigniorageExpansionFloorPercent;
    uint256 public maxSupplyContractionPercent;
    uint256 public maxDebtRatioPercent;

    // 28 first epochs (1 week) with 4.5% expansion regardless of GAUR price
    uint256 public bootstrapEpochs;
    uint256 public bootstrapSupplyExpansionPercent;

    /* =================== Added variables =================== */
    uint256 public previousEpochGaurPrice;
    uint256 public maxDiscountRate; // when purchasing bond
    uint256 public maxPremiumRate; // when redeeming bond
    uint256 public discountPercent;
    uint256 public premiumThreshold;
    uint256 public premiumPercent;
    uint256 public mintingFactorForPayingDebt; // print extra GAUR during debt phase

    address public daoFund;
    uint256 public daoFundSharedPercent;

    address public devFund;
    uint256 public devFundSharedPercent;

    /* =================== Events =================== */

    event Initialized(address indexed executor, uint256 at);
    event BurnedBonds(address indexed from, uint256 bondAmount);
    event RedeemedBonds(address indexed from, uint256 gaurAmount, uint256 bondAmount, uint256 epochNumber);
    event BoughtBonds(address indexed from, uint256 gaurAmount, uint256 bondAmount, uint256 epochNumber);
    event TreasuryFunded(uint256 timestamp, uint256 seigniorage, uint256 epochNumber);
    event BoardroomFunded(uint256 timestamp, uint256 seigniorage, uint256 epochNumber);
    event DaoFundFunded(uint256 timestamp, uint256 seigniorage, uint256 epochNumber);
    event DevFundFunded(uint256 timestamp, uint256 seigniorage, uint256 epochNumber);

    /* =================== Modifier =================== */

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

    modifier checkCondition() {
        require(now >= startTime, "Treasury: not started yet");

        _;
    }

    modifier checkEpoch() {
        require(now >= nextEpochPoint(), "Treasury: not opened yet");

        _;

        epoch = epoch.add(1);
        epochSupplyContractionLeft = (getGaurPrice() > gaurPriceCeiling) ? 0 : getGaurCirculatingSupply().mul(maxSupplyContractionPercent).div(10000);
    }

    modifier checkOperator() {
        require(
            IBasisAsset(gaur).operator() == address(this) &&
                IBasisAsset(gbond).operator() == address(this) &&
                IBasisAsset(gshare).operator() == address(this) &&
                Operator(boardroom).operator() == address(this),
            "Treasury: need more permission"
        );

        _;
    }

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

        _;
    }

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

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

    // epoch
    function nextEpochPoint() public view returns (uint256) {
        return startTime.add(epoch.mul(PERIOD));
    }

    // oracle
    function getGaurPrice() public view returns (uint256 gaurPrice) {
        try IOracle(gaurOracle).consult(gaur, 1e18) returns (uint144 price) {
            return uint256(price);
        } catch {
            revert("Treasury: failed to consult GAUR price from the oracle");
        }
    }

    function getGaurUpdatedPrice() external view returns (uint256 _gaurPrice) {
        try IOracle(gaurOracle).twap(gaur, 1e18) returns (uint144 price) {
            return uint256(price);
        } catch {
            revert("Treasury: failed to consult GAUR price from the oracle");
        }
    }

    // budget
    function getReserve() external view returns (uint256) {
        return seigniorageSaved;
    }

    function getBurnableGaurLeft() external view returns (uint256 _burnableGaurLeft) {
        uint256 _gaurPrice = getGaurPrice();
        if (_gaurPrice <= GAUR_PRICE_ONE) {
            uint256 _gaurSupply = getGaurCirculatingSupply();
            uint256 _bondMaxSupply = _gaurSupply.mul(maxDebtRatioPercent).div(10000);
            uint256 _bondSupply = IERC20(gbond).totalSupply();
            if (_bondMaxSupply > _bondSupply) {
                uint256 _maxMintableBond = _bondMaxSupply.sub(_bondSupply);
                uint256 _maxBurnableGaur = _maxMintableBond.mul(_gaurPrice).div(1e15);
                _burnableGaurLeft = Math.min(epochSupplyContractionLeft, _maxBurnableGaur);
            }
        }
    }

    function getRedeemableBonds() external view returns (uint256 _redeemableBonds) {
        uint256 _gaurPrice = getGaurPrice();
        if (_gaurPrice > gaurPriceCeiling) {
            uint256 _totalGaur = IERC20(gaur).balanceOf(address(this));
            uint256 _rate = getBondPremiumRate();
            if (_rate > 0) {
                _redeemableBonds = _totalGaur.mul(1e15).div(_rate);
            }
        }
    }

    function getBondDiscountRate() public view returns (uint256 _rate) {
        uint256 _gaurPrice = getGaurPrice();
        if (_gaurPrice <= GAUR_PRICE_ONE) {
            if (discountPercent == 0) {
                // no discount
                _rate = GAUR_PRICE_ONE;
            } else {
                uint256 _bondAmount = GAUR_PRICE_ONE.mul(1e18).div(_gaurPrice); // to burn 1 GAUR
                uint256 _discountAmount = _bondAmount.sub(GAUR_PRICE_ONE).mul(discountPercent).div(10000);
                _rate = GAUR_PRICE_ONE.add(_discountAmount);
                if (maxDiscountRate > 0 && _rate > maxDiscountRate) {
                    _rate = maxDiscountRate;
                }
            }
        }
    }

    function getBondPremiumRate() public view returns (uint256 _rate) {
        uint256 _gaurPrice = getGaurPrice();
        if (_gaurPrice > gaurPriceCeiling) {
            uint256 _gaurPricePremiumThreshold = GAUR_PRICE_ONE.mul(premiumThreshold).div(100);
            if (_gaurPrice >= _gaurPricePremiumThreshold) {
                //Price > 1.10
                uint256 _premiumAmount = _gaurPrice.sub(GAUR_PRICE_ONE).mul(premiumPercent).div(10000);
                _rate = GAUR_PRICE_ONE.add(_premiumAmount);
                if (maxPremiumRate > 0 && _rate > maxPremiumRate) {
                    _rate = maxPremiumRate;
                }
            } else {
                // no premium bonus
                _rate = GAUR_PRICE_ONE;
            }
        }
    }

    /* ========== GOVERNANCE ========== */

    function initialize(
        address _gaur,
        address _gbond,
        address _gshare,
        address _gaurOracle,
        address _boardroom,
        uint256 _startTime
    ) external notInitialized returns (bool) {
        gaur = _gaur;
        gbond = _gbond;
        gshare = _gshare;
        gaurOracle = _gaurOracle;
        boardroom = _boardroom;
        startTime = _startTime;

        gaurPriceCeiling = GAUR_PRICE_ONE.mul(101).div(100);

        // Dynamic max expansion percent
        supplyTiers = [0 ether, 500000 ether, 1000000 ether, 1500000 ether, 2000000 ether, 5000000 ether, 10000000 ether, 20000000 ether, 50000000 ether];
        maxExpansionTiers = [450, 400, 350, 300, 250, 200, 150, 125, 100];

        maxSupplyExpansionPercent = 400; // Upto 4.0% supply for expansion

        bondDepletionFloorPercent = 10000; // 100% of Bond supply for depletion floor
        seigniorageExpansionFloorPercent = 3500; // At least 35% of expansion reserved for boardroom
        maxSupplyContractionPercent = 300; // Upto 3.0% supply for contraction (to burn GAUR and mint tBOND)
        maxDebtRatioPercent = 3500; // Upto 35% supply of tBOND to purchase

        premiumThreshold = 110;
        premiumPercent = 7000;

        // First 28 epochs with 4.5% expansion
        bootstrapEpochs = 28;
        bootstrapSupplyExpansionPercent = 450;

        // set seigniorageSaved to it's balance
        seigniorageSaved = IERC20(gaur).balanceOf(address(this));

        initialized = true;
        operator = msg.sender;
        emit Initialized(msg.sender, block.number);
        return true;
    }

    function setOperator(address _operator) external onlyOperator returns (bool) {
        operator = _operator;
        return true;
    }

    function setBoardroom(address _boardroom) external onlyOperator returns (bool) {
        boardroom = _boardroom;
        return true;
    }

    function setGaurOracle(address _gaurOracle) external onlyOperator returns (bool) {
        gaurOracle = _gaurOracle;
        return true;
    }

    function setGaurPriceCeiling(uint256 _gaurPriceCeiling) external onlyOperator returns (bool) {
        require(_gaurPriceCeiling >= GAUR_PRICE_ONE && _gaurPriceCeiling <= GAUR_PRICE_ONE.mul(120).div(100), "out of range"); // [$1.0, $1.2]
        gaurPriceCeiling = _gaurPriceCeiling;
        return true;
    }

    function setMaxSupplyExpansionPercents(uint256 _maxSupplyExpansionPercent) external onlyOperator returns (bool) {
        require(_maxSupplyExpansionPercent >= 10 && _maxSupplyExpansionPercent <= 1000, "_maxSupplyExpansionPercent: out of range"); // [0.1%, 10%]
        maxSupplyExpansionPercent = _maxSupplyExpansionPercent;
        return true;
    }

    function setSupplyTiersEntry(uint8 _index, uint256 _value) external onlyOperator returns (bool) {
        require(_index >= 0, "Index has to be higher than 0");
        require(_index < 9, "Index has to be lower than count of tiers");
        if (_index > 0) {
            require(_value > supplyTiers[_index - 1]);
        }
        if (_index < 8) {
            require(_value < supplyTiers[_index + 1]);
        }
        supplyTiers[_index] = _value;
        return true;
    }

    function setMaxExpansionTiersEntry(uint8 _index, uint256 _value) external onlyOperator returns (bool) {
        require(_index >= 0, "Index has to be higher than 0");
        require(_index < 9, "Index has to be lower than count of tiers");
        require(_value >= 10 && _value <= 1000, "_value: out of range"); // [0.1%, 10%]
        maxExpansionTiers[_index] = _value;
        return true;
    }

    function setBondDepletionFloorPercent(uint256 _bondDepletionFloorPercent) external onlyOperator returns (bool) {
        require(_bondDepletionFloorPercent >= 500 && _bondDepletionFloorPercent <= 10000, "out of range"); // [5%, 100%]
        bondDepletionFloorPercent = _bondDepletionFloorPercent;
        return true;
    }

    function setMaxSupplyContractionPercent(uint256 _maxSupplyContractionPercent) external onlyOperator returns (bool) {
        require(_maxSupplyContractionPercent >= 100 && _maxSupplyContractionPercent <= 1500, "out of range"); // [0.1%, 15%]
        maxSupplyContractionPercent = _maxSupplyContractionPercent;
        return true;
    }

    function setMaxDebtRatioPercent(uint256 _maxDebtRatioPercent) external onlyOperator returns (bool) {
        require(_maxDebtRatioPercent >= 1000 && _maxDebtRatioPercent <= 10000, "out of range"); // [10%, 100%]
        maxDebtRatioPercent = _maxDebtRatioPercent;
        return true;
    }

    function setBootstrap(uint256 _bootstrapEpochs, uint256 _bootstrapSupplyExpansionPercent) external onlyOperator returns (bool) {
        require(_bootstrapEpochs <= 120, "_bootstrapEpochs: out of range"); // <= 1 month
        require(_bootstrapSupplyExpansionPercent >= 100 && _bootstrapSupplyExpansionPercent <= 1000, "_bootstrapSupplyExpansionPercent: out of range"); // [1%, 10%]
        bootstrapEpochs = _bootstrapEpochs;
        bootstrapSupplyExpansionPercent = _bootstrapSupplyExpansionPercent;
        return true;
    }

    function setExtraFunds(
        address _daoFund,
        uint256 _daoFundSharedPercent,
        address _devFund,
        uint256 _devFundSharedPercent
    ) external onlyOperator returns (bool) {
        require(_daoFund != address(0), "zero");
        require(_daoFundSharedPercent <= 3000, "out of range"); // <= 30%
        require(_devFund != address(0), "zero");
        require(_devFundSharedPercent <= 1000, "out of range"); // <= 10%
        daoFund = _daoFund;
        daoFundSharedPercent = _daoFundSharedPercent;
        devFund = _devFund;
        devFundSharedPercent = _devFundSharedPercent;
        return true;
    }

    function setMaxDiscountRate(uint256 _maxDiscountRate) external onlyOperator returns (bool) {
        maxDiscountRate = _maxDiscountRate;
        return true;
    }

    function setMaxPremiumRate(uint256 _maxPremiumRate) external onlyOperator returns (bool) {
        maxPremiumRate = _maxPremiumRate;
        return true;
    }

    function setDiscountPercent(uint256 _discountPercent) external onlyOperator returns (bool) {
        require(_discountPercent <= 20000, "_discountPercent is over 200%");
        discountPercent = _discountPercent;
        return true;
    }

    function setPremiumThreshold(uint256 _premiumThreshold) external onlyOperator returns (bool) {
        require(_premiumThreshold >= gaurPriceCeiling, "_premiumThreshold exceeds gaurPriceCeiling");
        require(_premiumThreshold <= 150, "_premiumThreshold is higher than 1.5");
        premiumThreshold = _premiumThreshold;
        return true;
    }

    function setPremiumPercent(uint256 _premiumPercent) external onlyOperator returns (bool) {
        require(_premiumPercent <= 20000, "_premiumPercent is over 200%");
        premiumPercent = _premiumPercent;
        return true;
    }

    function setMintingFactorForPayingDebt(uint256 _mintingFactorForPayingDebt) external onlyOperator returns (bool) {
        require(_mintingFactorForPayingDebt >= 10000 && _mintingFactorForPayingDebt <= 20000, "_mintingFactorForPayingDebt: out of range"); // [100%, 200%]
        mintingFactorForPayingDebt = _mintingFactorForPayingDebt;
        return true;
    }

    /* ========== MUTABLE FUNCTIONS ========== */

    function _updateGaurPrice() internal {
        try IOracle(gaurOracle).update() {} catch {}
    }

    function getGaurCirculatingSupply() public view returns (uint256) {
        IERC20 gaurErc20 = IERC20(gaur);
        uint256 totalSupply = gaurErc20.totalSupply();
        uint256 balanceExcluded = 0;
        for (uint8 entryId = 0; entryId < excludedFromTotalSupply.length; ++entryId) {
            balanceExcluded = balanceExcluded.add(gaurErc20.balanceOf(excludedFromTotalSupply[entryId]));
        }
        return totalSupply.sub(balanceExcluded);
    }

    function buyBonds(
        uint256 _gaurAmount,
        uint256 targetPrice
    ) external onlyOneBlock checkCondition checkOperator returns (bool) {
        require(_gaurAmount > 0, "Treasury: cannot purchase bonds with zero amount");

        uint256 gaurPrice = getGaurPrice();
        require(gaurPrice == targetPrice, "Treasury: GAUR price moved");
        require(
            gaurPrice < GAUR_PRICE_ONE, // price < $1
            "Treasury: gaurPrice not eligible for bond purchase"
        );

        require(_gaurAmount <= epochSupplyContractionLeft, "Treasury: not enough bond left to purchase");

        uint256 _rate = getBondDiscountRate();
        require(_rate > 0, "Treasury: invalid bond rate");

        uint256 _bondAmount = _gaurAmount.mul(_rate).div(1e15);
        uint256 gaurSupply = getGaurCirculatingSupply();
        uint256 newBondSupply = IERC20(gbond).totalSupply().add(_bondAmount);
        require(newBondSupply <= gaurSupply.mul(maxDebtRatioPercent).div(10000), "over max debt ratio");

        IBasisAsset(gaur).burnFrom(msg.sender, _gaurAmount);
        IBasisAsset(gbond).mint(msg.sender, _bondAmount);

        epochSupplyContractionLeft = epochSupplyContractionLeft.sub(_gaurAmount);
        _updateGaurPrice();

        emit BoughtBonds(msg.sender, _gaurAmount, _bondAmount, epoch);
        return true;
    }

    function redeemBonds(
        uint256 _bondAmount,
        uint256 targetPrice
    ) external onlyOneBlock checkCondition checkOperator returns (bool) {
        require(_bondAmount > 0, "Treasury: cannot redeem bonds with zero amount");

        uint256 gaurPrice = getGaurPrice();
        require(gaurPrice == targetPrice, "Treasury: GAUR price moved");
        require(
            gaurPrice > gaurPriceCeiling, // price > $1.01
            "Treasury: gaurPrice not eligible for bond purchase"
        );

        uint256 _rate = getBondPremiumRate();
        require(_rate > 0, "Treasury: invalid bond rate");

        uint256 _gaurAmount = _bondAmount.mul(_rate).div(1e15);
        require(IERC20(gaur).balanceOf(address(this)) >= _gaurAmount, "Treasury: treasury has no more budget");

        seigniorageSaved = seigniorageSaved.sub(Math.min(seigniorageSaved, _gaurAmount));

        IBasisAsset(gbond).burnFrom(msg.sender, _bondAmount);
        IERC20(gaur).safeTransfer(msg.sender, _gaurAmount);

        _updateGaurPrice();

        emit RedeemedBonds(msg.sender, _gaurAmount, _bondAmount, epoch);
        return true;
    }

    function _sendToBoardroom(uint256 _amount) internal {
        IBasisAsset(gaur).mint(address(this), _amount);

        uint256 _daoFundSharedAmount = 0;
        if (daoFundSharedPercent > 0) {
            _daoFundSharedAmount = _amount.mul(daoFundSharedPercent).div(10000);
            IERC20(gaur).transfer(daoFund, _daoFundSharedAmount);
            emit DaoFundFunded(now, _daoFundSharedAmount, epoch);
        }

        uint256 _devFundSharedAmount = 0;
        if (devFundSharedPercent > 0) {
            _devFundSharedAmount = _amount.mul(devFundSharedPercent).div(10000);
            IERC20(gaur).transfer(devFund, _devFundSharedAmount);
            emit DevFundFunded(now, _devFundSharedAmount, epoch);
        }

        _amount = _amount.sub(_daoFundSharedAmount).sub(_devFundSharedAmount);

        IERC20(gaur).safeApprove(boardroom, 0);
        IERC20(gaur).safeApprove(boardroom, _amount);
        IBoardroom(boardroom).allocateSeigniorage(_amount);
        emit BoardroomFunded(now, _amount, epoch);
    }

    function _calculateMaxSupplyExpansionPercent(uint256 _gaurSupply) internal returns (uint256) {
        for (uint8 tierId = 8; tierId >= 0; --tierId) {
            if (_gaurSupply >= supplyTiers[tierId]) {
                maxSupplyExpansionPercent = maxExpansionTiers[tierId];
                break;
            }
        }
        return maxSupplyExpansionPercent;
    }

    function allocateSeigniorage() external onlyOneBlock checkCondition checkEpoch checkOperator onlyOperator returns (
        bool
    ) {
        _updateGaurPrice();
        previousEpochGaurPrice = getGaurPrice();
        uint256 gaurSupply = getGaurCirculatingSupply().sub(seigniorageSaved);
        if (epoch < bootstrapEpochs) {
            // 28 first epochs with 4.5% expansion
            _sendToBoardroom(gaurSupply.mul(bootstrapSupplyExpansionPercent).div(10000));
        } else {
            if (previousEpochGaurPrice > gaurPriceCeiling) {
                // Expansion ($GAUR Price > 1 $ETH): there is some seigniorage to be allocated
                uint256 bondSupply = IERC20(gbond).totalSupply();
                uint256 _percentage = previousEpochGaurPrice.sub(GAUR_PRICE_ONE);
                uint256 _savedForBond;
                uint256 _savedForBoardroom;
                uint256 _mse = _calculateMaxSupplyExpansionPercent(gaurSupply).mul(1e14);
                if (_percentage > _mse) {
                    _percentage = _mse;
                }
                if (seigniorageSaved >= bondSupply.mul(bondDepletionFloorPercent).div(10000)) {
                    // saved enough to pay debt, mint as usual rate
                    _savedForBoardroom = gaurSupply.mul(_percentage).div(1e15);
                } else {
                    // have not saved enough to pay debt, mint more
                    uint256 _seigniorage = gaurSupply.mul(_percentage).div(1e15);
                    _savedForBoardroom = _seigniorage.mul(seigniorageExpansionFloorPercent).div(10000);
                    _savedForBond = _seigniorage.sub(_savedForBoardroom);
                    if (mintingFactorForPayingDebt > 0) {
                        _savedForBond = _savedForBond.mul(mintingFactorForPayingDebt).div(10000);
                    }
                }
                if (_savedForBoardroom > 0) {
                    _sendToBoardroom(_savedForBoardroom);
                }
                if (_savedForBond > 0) {
                    seigniorageSaved = seigniorageSaved.add(_savedForBond);
                    IBasisAsset(gaur).mint(address(this), _savedForBond);
                    emit TreasuryFunded(now, _savedForBond, epoch);
                }
            }
        }
        return true;
    }

    function governanceRecoverUnsupported(
        IERC20 _token,
        uint256 _amount,
        address _to
    ) external onlyOperator returns (bool) {
        // do not allow to drain core tokens
        require(address(_token) != address(gaur), "gaur");
        require(address(_token) != address(gbond), "bond");
        require(address(_token) != address(gshare), "share");
        _token.safeTransfer(_to, _amount);
        return true;
    }

    function boardroomSetOperator(address _operator) external onlyOperator returns (bool) {
        return IBoardroom(boardroom).setOperator(_operator);
    }

    function boardroomSetLockUp(
        uint256 _withdrawLockupEpochs,
        uint256 _rewardLockupEpochs
    ) external onlyOperator returns (bool) {
        return IBoardroom(boardroom).setLockUp(_withdrawLockupEpochs, _rewardLockupEpochs);
    }

    function boardroomAllocateSeigniorage(uint256 amount) external onlyOperator returns (bool) {
        return IBoardroom(boardroom).allocateSeigniorage(amount);
    }

    function boardroomGovernanceRecoverUnsupported(
        address _token,
        uint256 _amount,
        address _to
    ) external onlyOperator returns (bool) {
        return IBoardroom(boardroom).governanceRecoverUnsupported(_token, _amount, _to);
    }
}
        

Contract ABI

[{"type":"event","name":"BoardroomFunded","inputs":[{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false},{"type":"uint256","name":"seigniorage","internalType":"uint256","indexed":false},{"type":"uint256","name":"epochNumber","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"BoughtBonds","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"uint256","name":"gaurAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"bondAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"epochNumber","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"BurnedBonds","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"uint256","name":"bondAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"DaoFundFunded","inputs":[{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false},{"type":"uint256","name":"seigniorage","internalType":"uint256","indexed":false},{"type":"uint256","name":"epochNumber","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"DevFundFunded","inputs":[{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false},{"type":"uint256","name":"seigniorage","internalType":"uint256","indexed":false},{"type":"uint256","name":"epochNumber","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"type":"address","name":"executor","internalType":"address","indexed":true},{"type":"uint256","name":"at","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RedeemedBonds","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"uint256","name":"gaurAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"bondAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"epochNumber","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"TreasuryFunded","inputs":[{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false},{"type":"uint256","name":"seigniorage","internalType":"uint256","indexed":false},{"type":"uint256","name":"epochNumber","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"GAUR_PRICE_ONE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"PERIOD","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"allocateSeigniorage","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"boardroom","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"boardroomAllocateSeigniorage","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"boardroomGovernanceRecoverUnsupported","inputs":[{"type":"address","name":"_token","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"},{"type":"address","name":"_to","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"boardroomSetLockUp","inputs":[{"type":"uint256","name":"_withdrawLockupEpochs","internalType":"uint256"},{"type":"uint256","name":"_rewardLockupEpochs","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"boardroomSetOperator","inputs":[{"type":"address","name":"_operator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"bondDepletionFloorPercent","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"bootstrapEpochs","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"bootstrapSupplyExpansionPercent","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"buyBonds","inputs":[{"type":"uint256","name":"_gaurAmount","internalType":"uint256"},{"type":"uint256","name":"targetPrice","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"daoFund","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"daoFundSharedPercent","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"devFund","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"devFundSharedPercent","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"discountPercent","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"epoch","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"epochSupplyContractionLeft","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"excludedFromTotalSupply","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"gaur","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"gaurOracle","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"gaurPriceCeiling","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"gbond","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"_rate","internalType":"uint256"}],"name":"getBondDiscountRate","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"_rate","internalType":"uint256"}],"name":"getBondPremiumRate","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"_burnableGaurLeft","internalType":"uint256"}],"name":"getBurnableGaurLeft","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getGaurCirculatingSupply","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"gaurPrice","internalType":"uint256"}],"name":"getGaurPrice","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"_gaurPrice","internalType":"uint256"}],"name":"getGaurUpdatedPrice","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"_redeemableBonds","internalType":"uint256"}],"name":"getRedeemableBonds","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getReserve","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"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":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"gshare","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"initialize","inputs":[{"type":"address","name":"_gaur","internalType":"address"},{"type":"address","name":"_gbond","internalType":"address"},{"type":"address","name":"_gshare","internalType":"address"},{"type":"address","name":"_gaurOracle","internalType":"address"},{"type":"address","name":"_boardroom","internalType":"address"},{"type":"uint256","name":"_startTime","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"initialized","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isInitialized","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"maxDebtRatioPercent","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"maxDiscountRate","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"maxExpansionTiers","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"maxPremiumRate","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"maxSupplyContractionPercent","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"maxSupplyExpansionPercent","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"mintingFactorForPayingDebt","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"nextEpochPoint","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"operator","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"premiumPercent","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"premiumThreshold","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"previousEpochGaurPrice","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"redeemBonds","inputs":[{"type":"uint256","name":"_bondAmount","internalType":"uint256"},{"type":"uint256","name":"targetPrice","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"seigniorageExpansionFloorPercent","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"seigniorageSaved","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setBoardroom","inputs":[{"type":"address","name":"_boardroom","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setBondDepletionFloorPercent","inputs":[{"type":"uint256","name":"_bondDepletionFloorPercent","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setBootstrap","inputs":[{"type":"uint256","name":"_bootstrapEpochs","internalType":"uint256"},{"type":"uint256","name":"_bootstrapSupplyExpansionPercent","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setDiscountPercent","inputs":[{"type":"uint256","name":"_discountPercent","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setExtraFunds","inputs":[{"type":"address","name":"_daoFund","internalType":"address"},{"type":"uint256","name":"_daoFundSharedPercent","internalType":"uint256"},{"type":"address","name":"_devFund","internalType":"address"},{"type":"uint256","name":"_devFundSharedPercent","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setGaurOracle","inputs":[{"type":"address","name":"_gaurOracle","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setGaurPriceCeiling","inputs":[{"type":"uint256","name":"_gaurPriceCeiling","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setMaxDebtRatioPercent","inputs":[{"type":"uint256","name":"_maxDebtRatioPercent","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setMaxDiscountRate","inputs":[{"type":"uint256","name":"_maxDiscountRate","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setMaxExpansionTiersEntry","inputs":[{"type":"uint8","name":"_index","internalType":"uint8"},{"type":"uint256","name":"_value","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setMaxPremiumRate","inputs":[{"type":"uint256","name":"_maxPremiumRate","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setMaxSupplyContractionPercent","inputs":[{"type":"uint256","name":"_maxSupplyContractionPercent","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setMaxSupplyExpansionPercents","inputs":[{"type":"uint256","name":"_maxSupplyExpansionPercent","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setMintingFactorForPayingDebt","inputs":[{"type":"uint256","name":"_mintingFactorForPayingDebt","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setOperator","inputs":[{"type":"address","name":"_operator","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setPremiumPercent","inputs":[{"type":"uint256","name":"_premiumPercent","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setPremiumThreshold","inputs":[{"type":"uint256","name":"_premiumThreshold","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setSupplyTiersEntry","inputs":[{"type":"uint8","name":"_index","internalType":"uint8"},{"type":"uint256","name":"_value","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"startTime","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"supplyTiers","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]}]
            

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106104a85760003560e01c80638c664db61161026b578063b4d1d79511610150578063d4b14944116100c8578063ed18f98411610097578063f8cd4d721161007c578063f8cd4d7214610a9e578063fa35448514610ac1578063fcb6f00814610ac9576104a8565b8063ed18f98414610a8e578063f14698de14610a96576104a8565b8063d4b1494414610a50578063d98f249514610a76578063da3ed41914610a7e578063e90b245414610a86576104a8565b8063c5967c261161011f578063c8f987f311610104578063c8f987f314610a23578063cecce38e14610a2b578063d3531e6d14610a48576104a8565b8063c5967c2614610a13578063c8412d0214610a1b576104a8565b8063b4d1d795146109b4578063b8a878f9146109bc578063bcc81f19146109c4578063c56e0a9814610a0b576104a8565b8063a0487eea116101e3578063b06ce14a116101b2578063b189f60c11610197578063b189f60c14610946578063b3ab15fb1461094e578063b3ffc77714610981576104a8565b8063b06ce14a1461090b578063b125dd311461093e576104a8565b8063a0487eea14610886578063a204452b146108a3578063a3ec30fe146108c0578063a5790f4b14610903576104a8565b80639214cede1161023a57806395b6ef0c1161021f57806395b6ef0c146107f357806398b762a11461084c5780639982002514610869576104a8565b80639214cede146107c5578063940e6064146107cd576104a8565b80638c664db6146107755780638d934f7414610792578063900cf0cf1461079a57806391bbfed5146107a2576104a8565b806346af275a116103915780635b7561791161030957806372c054f9116102d857806381d11eaf116102bd57806381d11eaf1461074857806382cad83814610750578063874106cc1461076d576104a8565b806372c054f91461073857806378e9792514610740576104a8565b80635b756179146107035780635e02c51e1461070b57806361a1e6411461071357806367e42af91461071b576104a8565b806355ebdeef11610360578063591663e111610345578063591663e1146106d657806359bf5d39146106f35780635a0fc79c146106fb576104a8565b806355ebdeef146106c6578063570ca735146106ce576104a8565b806346af275a1461063b578063499f3f191461064357806354575af41461066057806354f04a11146106a3576104a8565b8063158ef93e116104245780632e9c7b65116103f35780634013a08e116103d85780634013a08e146105e557806340af7ba5146105ed5780634390d2a81461060a576104a8565b80632e9c7b65146105d5578063392e53cd146105dd576104a8565b8063158ef93e1461058a57806320eef2181461059257806322f832cd146105c557806329ef1919146105cd576104a8565b80630bc4caca1161047b5780630db7eb0b116104605780630db7eb0b14610542578063118ebbf91461054a578063154ec2db1461056d576104a8565b80630bc4caca146105325780630cf601751461053a576104a8565b806301a93783146104ad57806303be7e76146104de57806304e5c7b1146104f85780630b5bcec714610515575b600080fd5b6104ca600480360360208110156104c357600080fd5b5035610ad1565b604080519115158252519081900360200190f35b6104e6610bd0565b60408051918252519081900360200190f35b6104ca6004803603602081101561050e57600080fd5b5035610bd6565b6104ca6004803603602081101561052b57600080fd5b5035610cb9565b6104e6610d69565b6104e6610d6f565b6104e6610e2f565b6104ca6004803603604081101561056057600080fd5b5080359060200135610ee3565b6104ca6004803603602081101561058357600080fd5b5035611696565b6104ca61174f565b6104ca600480360360208110156105a857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611770565b6104e6611813565b6104e6611819565b6104e661181f565b6104ca611825565b6104e6611847565b6104ca6004803603602081101561060357600080fd5b503561184d565b610612611906565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6104e6611922565b6104ca6004803603602081101561065957600080fd5b5035611a25565b6104ca6004803603606081101561067657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359160409091013516611ad6565b6104ca600480360360408110156106b957600080fd5b5080359060200135611caf565b6104e6612560565b610612612566565b6104ca600480360360208110156106ec57600080fd5b5035612582565b6104e6612649565b6104e661264f565b6104ca612655565b610612612ea9565b6104e6612ec5565b6104ca6004803603602081101561073157600080fd5b5035613065565b6104e6613145565b6104e6613222565b6104e6613228565b6106126004803603602081101561076657600080fd5b503561322e565b6104e6613262565b6104ca6004803603602081101561078b57600080fd5b5035613268565b61061261332f565b6104e661334b565b6104ca600480360360408110156107b857600080fd5b5080359060200135613351565b6104e6613462565b6104ca600480360360408110156107e357600080fd5b5060ff813516906020013561346d565b6104ca600480360360c081101561080957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135821691604082013581169160608101358216916080820135169060a00135613595565b6104ca6004803603602081101561086257600080fd5b5035613921565b6104e66004803603602081101561087f57600080fd5b5035613983565b6104e66004803603602081101561089c57600080fd5b50356139a1565b6104ca600480360360208110156108b957600080fd5b50356139ae565b6104ca600480360360608110156108d657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359160409091013516613a10565b610612613b21565b6104ca6004803603602081101561092157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16613b3d565b6104e6613c0b565b6104e6613d30565b6104ca6004803603602081101561096457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16613d36565b6104ca6004803603602081101561099757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16613dd7565b6104e6613e7a565b6104e6613e80565b6104ca600480360360808110156109da57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135916040820135169060600135613e86565b6104e66140c2565b6104e661414a565b6104e6614174565b6104e661417a565b6104ca60048036036020811015610a4157600080fd5b5035614180565b610612614246565b6104ca60048036036040811015610a6657600080fd5b5060ff8135169060200135614262565b6104e6614372565b6104e6614378565b6104e661437e565b610612614384565b6104e66143a0565b6104ca60048036036040811015610ab457600080fd5b50803590602001356143a6565b6106126144ad565b6104e66144c9565b60015460009073ffffffffffffffffffffffffffffffffffffffff163314610b2a5760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b600954604080517f97ffe1d700000000000000000000000000000000000000000000000000000000815260048101859052905173ffffffffffffffffffffffffffffffffffffffff909216916397ffe1d7916024808201926020929091908290030181600087803b158015610b9e57600080fd5b505af1158015610bb2573d6000803e3d6000fd5b505050506040513d6020811015610bc857600080fd5b505192915050565b60205481565b60015460009073ffffffffffffffffffffffffffffffffffffffff163314610c2f5760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b600b54821015610c705760405162461bcd60e51b815260040180806020018281038252602a815260200180615218602a913960400191505060405180910390fd5b6096821115610cb05760405162461bcd60e51b81526004018080602001828103825260248152602001806151ce6024913960400191505060405180910390fd5b50601a55600190565b60015460009073ffffffffffffffffffffffffffffffffffffffff163314610d125760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b600a8210158015610d2557506103e88211155b610d605760405162461bcd60e51b81526004018080602001828103825260288152602001806153176028913960400191505060405180910390fd5b50600f55600190565b600b5481565b600080610d7a6140c2565b905066038d7ea4c680008111610e2b57601954610da05766038d7ea4c680009150610e2b565b6000610dc582610dbf66038d7ea4c68000670de0b6b3a76400006144cf565b90614528565b90506000610df5612710610dbf601954610def66038d7ea4c680008761458f90919063ffffffff16565b906144cf565b9050610e0866038d7ea4c68000826145ec565b93506000601754118015610e1d575060175484115b15610e285760175493505b50505b5090565b600080610e3a6140c2565b9050600b54811115610e2b576000610e696064610dbf601a5466038d7ea4c680006144cf90919063ffffffff16565b9050808210610ed3576000610e9a612710610dbf601b54610def66038d7ea4c680008861458f90919063ffffffff16565b9050610ead66038d7ea4c68000826145ec565b93506000601854118015610ec2575060185484115b15610ecd5760185493505b50610ede565b66038d7ea4c6800092505b505090565b6000610eed614646565b15610f295760405162461bcd60e51b81526004018080602001828103825260268152602001806153b66026913960400191505060405180910390fd5b610f31614665565b15610f6d5760405162461bcd60e51b81526004018080602001828103825260268152602001806153b66026913960400191505060405180910390fd5b600254421015610fc4576040805162461bcd60e51b815260206004820152601960248201527f54726561737572793a206e6f7420737461727465642079657400000000000000604482015290519081900360640190fd5b600654604080517f570ca7350000000000000000000000000000000000000000000000000000000081529051309273ffffffffffffffffffffffffffffffffffffffff169163570ca735916004808301926020929190829003018186803b15801561102e57600080fd5b505afa158015611042573d6000803e3d6000fd5b505050506040513d602081101561105857600080fd5b505173ffffffffffffffffffffffffffffffffffffffff161480156111265750600754604080517f570ca7350000000000000000000000000000000000000000000000000000000081529051309273ffffffffffffffffffffffffffffffffffffffff169163570ca735916004808301926020929190829003018186803b1580156110e257600080fd5b505afa1580156110f6573d6000803e3d6000fd5b505050506040513d602081101561110c57600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16145b80156111db5750600854604080517f570ca7350000000000000000000000000000000000000000000000000000000081529051309273ffffffffffffffffffffffffffffffffffffffff169163570ca735916004808301926020929190829003018186803b15801561119757600080fd5b505afa1580156111ab573d6000803e3d6000fd5b505050506040513d60208110156111c157600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16145b80156112905750600954604080517f570ca7350000000000000000000000000000000000000000000000000000000081529051309273ffffffffffffffffffffffffffffffffffffffff169163570ca735916004808301926020929190829003018186803b15801561124c57600080fd5b505afa158015611260573d6000803e3d6000fd5b505050506040513d602081101561127657600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16145b6112e1576040805162461bcd60e51b815260206004820152601e60248201527f54726561737572793a206e656564206d6f7265207065726d697373696f6e0000604482015290519081900360640190fd5b600083116113205760405162461bcd60e51b815260040180806020018281038252602e8152602001806151a0602e913960400191505060405180910390fd5b600061132a6140c2565b9050828114611380576040805162461bcd60e51b815260206004820152601a60248201527f54726561737572793a2047415552207072696365206d6f766564000000000000604482015290519081900360640190fd5b600b5481116113c05760405162461bcd60e51b815260040180806020018281038252603281526020018061516e6032913960400191505060405180910390fd5b60006113ca610e2f565b905060008111611421576040805162461bcd60e51b815260206004820152601b60248201527f54726561737572793a20696e76616c696420626f6e6420726174650000000000604482015290519081900360640190fd5b600061143866038d7ea4c68000610dbf88856144cf565b600654604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051929350839273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b1580156114ae57600080fd5b505afa1580156114c2573d6000803e3d6000fd5b505050506040513d60208110156114d857600080fd5b505110156115175760405162461bcd60e51b81526004018080602001828103825260258152602001806152426025913960400191505060405180910390fd5b61152f611526600c5483614684565b600c549061458f565b600c55600754604080517f79cc679000000000000000000000000000000000000000000000000000000000815233600482015260248101899052905173ffffffffffffffffffffffffffffffffffffffff909216916379cc67909160448082019260009290919082900301818387803b1580156115ab57600080fd5b505af11580156115bf573d6000803e3d6000fd5b50506006546115e8925073ffffffffffffffffffffffffffffffffffffffff169050338361469a565b6115f061472c565b6003546040805183815260208101899052808201929092525133917ffb022ee3f7ee9ba7d34060a1d2f8f89495c7b7c4171fefb17c3755c0257357a9919081900360600190a2505043600090815260208181526040808320328452909152808220805460017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00918216811790925533845291909220805490911682179055949350505050565b60015460009073ffffffffffffffffffffffffffffffffffffffff1633146116ef5760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b614e20821115611746576040805162461bcd60e51b815260206004820152601d60248201527f5f646973636f756e7450657263656e74206973206f7665722032303025000000604482015290519081900360640190fd5b50601955600190565b60015474010000000000000000000000000000000000000000900460ff1681565b60015460009073ffffffffffffffffffffffffffffffffffffffff1633146117c95760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b50600a805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff00000000000000000000000000000000000000009091161790556001919050565b60115481565b60195481565b60185481565b60015474010000000000000000000000000000000000000000900460ff165b90565b601c5481565b60015460009073ffffffffffffffffffffffffffffffffffffffff1633146118a65760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b614e208211156118fd576040805162461bcd60e51b815260206004820152601c60248201527f5f7072656d69756d50657263656e74206973206f766572203230302500000000604482015290519081900360640190fd5b50601b55600190565b601f5473ffffffffffffffffffffffffffffffffffffffff1681565b600a54600654604080517f6808a12800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9283166004820152670de0b6b3a7640000602482015290516000939290921691636808a12891604480820192602092909190829003018186803b1580156119aa57600080fd5b505afa9250505080156119cf57506040513d60208110156119ca57600080fd5b505160015b611a0a5760405162461bcd60e51b81526004018080602001828103825260368152602001806152886036913960400191505060405180910390fd5b71ffffffffffffffffffffffffffffffffffff169050611844565b60015460009073ffffffffffffffffffffffffffffffffffffffff163314611a7e5760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b6127108210158015611a925750614e208211155b611acd5760405162461bcd60e51b81526004018080602001828103825260298152602001806152ee6029913960400191505060405180910390fd5b50601c55600190565b60015460009073ffffffffffffffffffffffffffffffffffffffff163314611b2f5760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b60065473ffffffffffffffffffffffffffffffffffffffff85811691161415611ba1576040805162461bcd60e51b8152602060048083019190915260248201527f6761757200000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60075473ffffffffffffffffffffffffffffffffffffffff85811691161415611c13576040805162461bcd60e51b8152602060048083019190915260248201527f626f6e6400000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60085473ffffffffffffffffffffffffffffffffffffffff85811691161415611c83576040805162461bcd60e51b815260206004820152600560248201527f7368617265000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b611ca473ffffffffffffffffffffffffffffffffffffffff8516838561469a565b5060015b9392505050565b6000611cb9614646565b15611cf55760405162461bcd60e51b81526004018080602001828103825260268152602001806153b66026913960400191505060405180910390fd5b611cfd614665565b15611d395760405162461bcd60e51b81526004018080602001828103825260268152602001806153b66026913960400191505060405180910390fd5b600254421015611d90576040805162461bcd60e51b815260206004820152601960248201527f54726561737572793a206e6f7420737461727465642079657400000000000000604482015290519081900360640190fd5b600654604080517f570ca7350000000000000000000000000000000000000000000000000000000081529051309273ffffffffffffffffffffffffffffffffffffffff169163570ca735916004808301926020929190829003018186803b158015611dfa57600080fd5b505afa158015611e0e573d6000803e3d6000fd5b505050506040513d6020811015611e2457600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16148015611ef25750600754604080517f570ca7350000000000000000000000000000000000000000000000000000000081529051309273ffffffffffffffffffffffffffffffffffffffff169163570ca735916004808301926020929190829003018186803b158015611eae57600080fd5b505afa158015611ec2573d6000803e3d6000fd5b505050506040513d6020811015611ed857600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16145b8015611fa75750600854604080517f570ca7350000000000000000000000000000000000000000000000000000000081529051309273ffffffffffffffffffffffffffffffffffffffff169163570ca735916004808301926020929190829003018186803b158015611f6357600080fd5b505afa158015611f77573d6000803e3d6000fd5b505050506040513d6020811015611f8d57600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16145b801561205c5750600954604080517f570ca7350000000000000000000000000000000000000000000000000000000081529051309273ffffffffffffffffffffffffffffffffffffffff169163570ca735916004808301926020929190829003018186803b15801561201857600080fd5b505afa15801561202c573d6000803e3d6000fd5b505050506040513d602081101561204257600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16145b6120ad576040805162461bcd60e51b815260206004820152601e60248201527f54726561737572793a206e656564206d6f7265207065726d697373696f6e0000604482015290519081900360640190fd5b600083116120ec5760405162461bcd60e51b81526004018080602001828103825260308152602001806152be6030913960400191505060405180910390fd5b60006120f66140c2565b905082811461214c576040805162461bcd60e51b815260206004820152601a60248201527f54726561737572793a2047415552207072696365206d6f766564000000000000604482015290519081900360640190fd5b66038d7ea4c6800081106121915760405162461bcd60e51b815260040180806020018281038252603281526020018061516e6032913960400191505060405180910390fd5b6004548411156121d25760405162461bcd60e51b815260040180806020018281038252602a815260200180615412602a913960400191505060405180910390fd5b60006121dc610d6f565b905060008111612233576040805162461bcd60e51b815260206004820152601b60248201527f54726561737572793a20696e76616c696420626f6e6420726174650000000000604482015290519081900360640190fd5b600061224a66038d7ea4c68000610dbf88856144cf565b90506000612256612ec5565b905060006122f883600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156122c657600080fd5b505afa1580156122da573d6000803e3d6000fd5b505050506040513d60208110156122f057600080fd5b5051906145ec565b9050612315612710610dbf601354856144cf90919063ffffffff16565b811115612369576040805162461bcd60e51b815260206004820152601360248201527f6f766572206d6178206465627420726174696f00000000000000000000000000604482015290519081900360640190fd5b600654604080517f79cc6790000000000000000000000000000000000000000000000000000000008152336004820152602481018b9052905173ffffffffffffffffffffffffffffffffffffffff909216916379cc67909160448082019260009290919082900301818387803b1580156123e257600080fd5b505af11580156123f6573d6000803e3d6000fd5b5050600754604080517f40c10f1900000000000000000000000000000000000000000000000000000000815233600482015260248101889052905173ffffffffffffffffffffffffffffffffffffffff90921693506340c10f1992506044808201926020929091908290030181600087803b15801561247457600080fd5b505af1158015612488573d6000803e3d6000fd5b505050506040513d602081101561249e57600080fd5b50506004546124ad908961458f565b6004556124b861472c565b600354604080518a815260208101869052808201929092525133917fa86b4ae149813f0b5b4bae0377f5b265f21164f956d6c594b535e7b7e4522980919081900360600190a2505043600090815260208181526040808320328452909152808220805460017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009182168117909255338452919092208054909116821790559695505050505050565b601e5481565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60015460009073ffffffffffffffffffffffffffffffffffffffff1633146125db5760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b6103e882101580156125ef57506127108211155b612640576040805162461bcd60e51b815260206004820152600c60248201527f6f7574206f662072616e67650000000000000000000000000000000000000000604482015290519081900360640190fd5b50601355600190565b600c5490565b600c5481565b600061265f614646565b1561269b5760405162461bcd60e51b81526004018080602001828103825260268152602001806153b66026913960400191505060405180910390fd5b6126a3614665565b156126df5760405162461bcd60e51b81526004018080602001828103825260268152602001806153b66026913960400191505060405180910390fd5b600254421015612736576040805162461bcd60e51b815260206004820152601960248201527f54726561737572793a206e6f7420737461727465642079657400000000000000604482015290519081900360640190fd5b61273e61414a565b421015612792576040805162461bcd60e51b815260206004820152601860248201527f54726561737572793a206e6f74206f70656e6564207965740000000000000000604482015290519081900360640190fd5b600654604080517f570ca7350000000000000000000000000000000000000000000000000000000081529051309273ffffffffffffffffffffffffffffffffffffffff169163570ca735916004808301926020929190829003018186803b1580156127fc57600080fd5b505afa158015612810573d6000803e3d6000fd5b505050506040513d602081101561282657600080fd5b505173ffffffffffffffffffffffffffffffffffffffff161480156128f45750600754604080517f570ca7350000000000000000000000000000000000000000000000000000000081529051309273ffffffffffffffffffffffffffffffffffffffff169163570ca735916004808301926020929190829003018186803b1580156128b057600080fd5b505afa1580156128c4573d6000803e3d6000fd5b505050506040513d60208110156128da57600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16145b80156129a95750600854604080517f570ca7350000000000000000000000000000000000000000000000000000000081529051309273ffffffffffffffffffffffffffffffffffffffff169163570ca735916004808301926020929190829003018186803b15801561296557600080fd5b505afa158015612979573d6000803e3d6000fd5b505050506040513d602081101561298f57600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16145b8015612a5e5750600954604080517f570ca7350000000000000000000000000000000000000000000000000000000081529051309273ffffffffffffffffffffffffffffffffffffffff169163570ca735916004808301926020929190829003018186803b158015612a1a57600080fd5b505afa158015612a2e573d6000803e3d6000fd5b505050506040513d6020811015612a4457600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16145b612aaf576040805162461bcd60e51b815260206004820152601e60248201527f54726561737572793a206e656564206d6f7265207065726d697373696f6e0000604482015290519081900360640190fd5b60015473ffffffffffffffffffffffffffffffffffffffff163314612b055760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b612b0d61472c565b612b156140c2565b601655600c54600090612b3090612b2a612ec5565b9061458f565b90506014546003541015612b6657612b61612b5c612710610dbf601554856144cf90919063ffffffff16565b6147aa565b612e0a565b600b546016541115612e0a57600754604080517f18160ddd000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff16916318160ddd916004808301926020929190829003018186803b158015612bdd57600080fd5b505afa158015612bf1573d6000803e3d6000fd5b505050506040513d6020811015612c0757600080fd5b5051601654909150600090612c239066038d7ea4c6800061458f565b90506000806000612c3d655af3107a4000610def88614bcc565b905080841115612c4b578093505b612c66612710610dbf601054886144cf90919063ffffffff16565b600c5410612c8a57612c8366038d7ea4c68000610dbf88876144cf565b9150612cf5565b6000612ca166038d7ea4c68000610dbf89886144cf565b9050612cbe612710610dbf601154846144cf90919063ffffffff16565b9250612cca818461458f565b601c5490945015612cf357612cf0612710610dbf601c54876144cf90919063ffffffff16565b93505b505b8115612d0457612d04826147aa565b8215612e0457600c54612d1790846145ec565b600c55600654604080517f40c10f1900000000000000000000000000000000000000000000000000000000815230600482015260248101869052905173ffffffffffffffffffffffffffffffffffffffff909216916340c10f19916044808201926020929091908290030181600087803b158015612d9457600080fd5b505af1158015612da8573d6000803e3d6000fd5b505050506040513d6020811015612dbe57600080fd5b5050600354604080514281526020810186905280820192909252517ffb19ddad7f1f934ddc14e65f6c91a77a115c441aa314553321238688db8207349181900360600190a15b50505050505b6001915050600354612e1d9060016145ec565b600355600b54612e2b6140c2565b11612e4957612e44612710610dbf601254610def612ec5565b612e4c565b60005b60045543600090815260208181526040808320328452909152808220805460017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009182168117909255338452919092208054909116909117905590565b60095473ffffffffffffffffffffffffffffffffffffffff1681565b600654604080517f18160ddd000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff1691839183916318160ddd916004808301926020929190829003018186803b158015612f3457600080fd5b505afa158015612f48573d6000803e3d6000fd5b505050506040513d6020811015612f5e57600080fd5b505190506000805b60055460ff82161015613052576130488473ffffffffffffffffffffffffffffffffffffffff166370a0823160058460ff1681548110612fa257fe5b60009182526020918290200154604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301525160248083019392829003018186803b15801561301557600080fd5b505afa158015613029573d6000803e3d6000fd5b505050506040513d602081101561303f57600080fd5b505183906145ec565b9150600101612f66565b5061305d828261458f565b935050505090565b60015460009073ffffffffffffffffffffffffffffffffffffffff1633146130be5760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b66038d7ea4c6800082101580156130eb57506130e76064610dbf66038d7ea4c6800060786144cf565b8211155b61313c576040805162461bcd60e51b815260206004820152600c60248201527f6f7574206f662072616e67650000000000000000000000000000000000000000604482015290519081900360640190fd5b50600b55600190565b6000806131506140c2565b9050600b54811115610e2b57600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160009273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b1580156131cd57600080fd5b505afa1580156131e1573d6000803e3d6000fd5b505050506040513d60208110156131f757600080fd5b505190506000613205610e2f565b90508015610e285761305d81610dbf8466038d7ea4c680006144cf565b60025481565b60105481565b6005818154811061323b57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60155481565b60015460009073ffffffffffffffffffffffffffffffffffffffff1633146132c15760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b6101f482101580156132d557506127108211155b613326576040805162461bcd60e51b815260206004820152600c60248201527f6f7574206f662072616e67650000000000000000000000000000000000000000604482015290519081900360640190fd5b50601055600190565b601d5473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b60015460009073ffffffffffffffffffffffffffffffffffffffff1633146133aa5760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b6078831115613400576040805162461bcd60e51b815260206004820152601e60248201527f5f626f6f74737472617045706f6368733a206f7574206f662072616e67650000604482015290519081900360640190fd5b6064821015801561341357506103e88211155b61344e5760405162461bcd60e51b815260040180806020018281038252602e81526020018061543c602e913960400191505060405180910390fd5b506014829055601581905560015b92915050565b66038d7ea4c6800081565b60015460009073ffffffffffffffffffffffffffffffffffffffff1633146134c65760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b60098360ff16106135085760405162461bcd60e51b815260040180806020018281038252602981526020018061533f6029913960400191505060405180910390fd5b60ff83161561353a57600d6001840360ff168154811061352457fe5b9060005260206000200154821161353a57600080fd5b60088360ff16101561356f57600d8360010160ff168154811061355957fe5b9060005260206000200154821061356f57600080fd5b81600d8460ff168154811061358057fe5b60009182526020909120015550600192915050565b60015460009074010000000000000000000000000000000000000000900460ff1615613608576040805162461bcd60e51b815260206004820152601d60248201527f54726561737572793a20616c726561647920696e697469616c697a6564000000604482015290519081900360640190fd5b600680547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff8a811691909117909255600780548216898416179055600880548216888416179055600a8054821687841617905560098054909116918516919091179055600282905561369f6064610dbf66038d7ea4c6800060656144cf565b600b556040805161012081018252600081526969e10de76676d0800000602082015269d3c21bcecceda1000000918101919091526a013da329b633647180000060608201526a01a784379d99db4200000060808201526a0422ca8b0a00a42500000060a08201526a084595161401484a00000060c08201526a108b2a2c2802909400000060e08201526a295be96e6406697200000061010082015261374890600d9060096150c1565b5060408051610120810182526101c28152610190602082015261015e9181019190915261012c606082015260fa608082015260c860a0820152609660c0820152607d60e082015260646101008201526137a590600e906009615117565b50610190600f55612710601055610dac601181905561012c601255601355606e601a55611b58601b55601c6014556101c2601555600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b15801561384a57600080fd5b505afa15801561385e573d6000803e3d6000fd5b505050506040513d602081101561387457600080fd5b5051600c55600180547fffffffffffffffffffffffff00000000000000000000000000000000000000007fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909116740100000000000000000000000000000000000000001716339081179091556040805143815290517f25ff68dd81b34665b5ba7e553ee5511bf6812e12adb4a7e2c0d9e26b3099ce799181900360200190a25060019695505050505050565b60015460009073ffffffffffffffffffffffffffffffffffffffff16331461397a5760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b50601755600190565b600d818154811061399057fe5b600091825260209091200154905081565b600e818154811061399057fe5b60015460009073ffffffffffffffffffffffffffffffffffffffff163314613a075760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b50601855600190565b60015460009073ffffffffffffffffffffffffffffffffffffffff163314613a695760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b600954604080517f54575af400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8781166004830152602482018790528581166044830152915191909216916354575af49160648083019260209291908290030181600087803b158015613aed57600080fd5b505af1158015613b01573d6000803e3d6000fd5b505050506040513d6020811015613b1757600080fd5b5051949350505050565b60085473ffffffffffffffffffffffffffffffffffffffff1681565b60015460009073ffffffffffffffffffffffffffffffffffffffff163314613b965760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b600954604080517fb3ab15fb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301529151919092169163b3ab15fb9160248083019260209291908290030181600087803b158015610b9e57600080fd5b600080613c166140c2565b905066038d7ea4c680008111610e2b576000613c30612ec5565b90506000613c4f612710610dbf601354856144cf90919063ffffffff16565b90506000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015613cbb57600080fd5b505afa158015613ccf573d6000803e3d6000fd5b505050506040513d6020811015613ce557600080fd5b5051905080821115613d29576000613cfd838361458f565b90506000613d1666038d7ea4c68000610dbf84896144cf565b9050613d2460045482614684565b965050505b5050505090565b60165481565b60015460009073ffffffffffffffffffffffffffffffffffffffff163314613d8f5760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b506001805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116178155919050565b60015460009073ffffffffffffffffffffffffffffffffffffffff163314613e305760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b506009805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff00000000000000000000000000000000000000009091161790556001919050565b61546081565b60175481565b60015460009073ffffffffffffffffffffffffffffffffffffffff163314613edf5760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8516613f49576040805162461bcd60e51b8152602060048083019190915260248201527f7a65726f00000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b610bb8841115613fa0576040805162461bcd60e51b815260206004820152600c60248201527f6f7574206f662072616e67650000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff831661400a576040805162461bcd60e51b8152602060048083019190915260248201527f7a65726f00000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6103e8821115614061576040805162461bcd60e51b815260206004820152600c60248201527f6f7574206f662072616e67650000000000000000000000000000000000000000604482015290519081900360640190fd5b50601d80547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff96871617909155601e93909355601f805490931691909316179055602055600190565b600a54600654604080517f3ddac95300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9283166004820152670de0b6b3a7640000602482015290516000939290921691633ddac95391604480820192602092909190829003018186803b1580156119aa57600080fd5b600061416f6141666154606003546144cf90919063ffffffff16565b600254906145ec565b905090565b601b5481565b601a5481565b60015460009073ffffffffffffffffffffffffffffffffffffffff1633146141d95760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b606482101580156141ec57506105dc8211155b61423d576040805162461bcd60e51b815260206004820152600c60248201527f6f7574206f662072616e67650000000000000000000000000000000000000000604482015290519081900360640190fd5b50601255600190565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60015460009073ffffffffffffffffffffffffffffffffffffffff1633146142bb5760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b60098360ff16106142fd5760405162461bcd60e51b815260040180806020018281038252602981526020018061533f6029913960400191505060405180910390fd5b600a821015801561431057506103e88211155b614361576040805162461bcd60e51b815260206004820152601460248201527f5f76616c75653a206f7574206f662072616e6765000000000000000000000000604482015290519081900360640190fd5b81600e8460ff168154811061358057fe5b600f5481565b60135481565b60125481565b600a5473ffffffffffffffffffffffffffffffffffffffff1681565b60145481565b60015460009073ffffffffffffffffffffffffffffffffffffffff1633146143ff5760405162461bcd60e51b81526004018080602001828103825260248152602001806153686024913960400191505060405180910390fd5b600954604080517f2ffaaa090000000000000000000000000000000000000000000000000000000081526004810186905260248101859052905173ffffffffffffffffffffffffffffffffffffffff90921691632ffaaa09916044808201926020929091908290030181600087803b15801561447a57600080fd5b505af115801561448e573d6000803e3d6000fd5b505050506040513d60208110156144a457600080fd5b50519392505050565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b6000826144de5750600061345c565b828202828482816144eb57fe5b0414611ca85760405162461bcd60e51b81526004018080602001828103825260218152602001806152676021913960400191505060405180910390fd5b600080821161457e576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161458757fe5b049392505050565b6000828211156145e6576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082820183811015611ca8576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b4360009081526020818152604080832032845290915290205460ff1690565b4360009081526020818152604080832033845290915290205460ff1690565b60008183106146935781611ca8565b5090919050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052614727908490614c47565b505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a2e620456040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561479657600080fd5b505af19250505080156147a7575060015b50565b600654604080517f40c10f1900000000000000000000000000000000000000000000000000000000815230600482015260248101849052905173ffffffffffffffffffffffffffffffffffffffff909216916340c10f19916044808201926020929091908290030181600087803b15801561482457600080fd5b505af1158015614838573d6000803e3d6000fd5b505050506040513d602081101561484e57600080fd5b5050601e546000901561496757614876612710610dbf601e54856144cf90919063ffffffff16565b600654601d54604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff928316600482015260248101859052905193945091169163a9059cbb916044808201926020929091908290030181600087803b1580156148f757600080fd5b505af115801561490b573d6000803e3d6000fd5b505050506040513d602081101561492157600080fd5b5050600354604080514281526020810184905280820192909252517fdce953494e40a43cb86b65abee291f6a2db245a9e33e078c65f5ccbae02712299181900360600190a15b60205460009015614a7e5761498d612710610dbf602054866144cf90919063ffffffff16565b600654601f54604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff928316600482015260248101859052905193945091169163a9059cbb916044808201926020929091908290030181600087803b158015614a0e57600080fd5b505af1158015614a22573d6000803e3d6000fd5b505050506040513d6020811015614a3857600080fd5b5050600354604080514281526020810184905280820192909252517f2e9e3acd24a2d0f6ccfc394c595bf579e39f97d5f0c33d43b09938033de7995f9181900360600190a15b614a8c81612b2a858561458f565b600954600654919450614aba9173ffffffffffffffffffffffffffffffffffffffff90811691166000614d05565b600954600654614ae49173ffffffffffffffffffffffffffffffffffffffff918216911685614d05565b600954604080517f97ffe1d700000000000000000000000000000000000000000000000000000000815260048101869052905173ffffffffffffffffffffffffffffffffffffffff909216916397ffe1d7916024808201926020929091908290030181600087803b158015614b5857600080fd5b505af1158015614b6c573d6000803e3d6000fd5b505050506040513d6020811015614b8257600080fd5b5050600354604080514281526020810186905280820192909252517ffafa6ee62cf3956fd95e17ea4c2d04d4fcaa72de0df822daa37710f5a2f8fad19181900360600190a1505050565b600060085b600d8160ff1681548110614be157fe5b90600052602060002001548310614c1657600e8160ff1681548110614c0257fe5b600091825260209091200154600f55614c3d565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01614bd1565b5050600f54919050565b6060614ca9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16614e799092919063ffffffff16565b80519091501561472757808060200190516020811015614cc857600080fd5b50516147275760405162461bcd60e51b815260040180806020018281038252602a81526020018061538c602a913960400191505060405180910390fd5b801580614db15750604080517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b158015614d8357600080fd5b505afa158015614d97573d6000803e3d6000fd5b505050506040513d6020811015614dad57600080fd5b5051155b614dec5760405162461bcd60e51b81526004018080602001828103825260368152602001806153dc6036913960400191505060405180910390fd5b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b300000000000000000000000000000000000000000000000000000000179052614727908490614c47565b6060614e888484600085614e90565b949350505050565b606082471015614ed15760405162461bcd60e51b81526004018080602001828103825260268152602001806151f26026913960400191505060405180910390fd5b614eda85615017565b614f2b576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b60208310614f9557805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101614f58565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114614ff7576040519150601f19603f3d011682016040523d82523d6000602084013e614ffc565b606091505b509150915061500c82828661501d565b979650505050505050565b3b151590565b6060831561502c575081611ca8565b82511561503c5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561508657818101518382015260200161506e565b50505050905090810190601f1680156150b35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b82805482825590600052602060002090810192821561510b579160200282015b8281111561510b57825182906affffffffffffffffffffff169055916020019190600101906150e1565b50610e2b929150615158565b82805482825590600052602060002090810192821561510b579160200282015b8281111561510b578251829061ffff16905591602001919060010190615137565b5b80821115610e2b576000815560010161515956fe54726561737572793a20676175725072696365206e6f7420656c696769626c6520666f7220626f6e6420707572636861736554726561737572793a2063616e6e6f742072656465656d20626f6e64732077697468207a65726f20616d6f756e745f7072656d69756d5468726573686f6c6420697320686967686572207468616e20312e35416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5f7072656d69756d5468726573686f6c642065786365656473206761757250726963654365696c696e6754726561737572793a20747265617375727920686173206e6f206d6f726520627564676574536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7754726561737572793a206661696c656420746f20636f6e73756c7420474155522070726963652066726f6d20746865206f7261636c6554726561737572793a2063616e6e6f7420707572636861736520626f6e64732077697468207a65726f20616d6f756e745f6d696e74696e67466163746f72466f72506179696e67446562743a206f7574206f662072616e67655f6d6178537570706c79457870616e73696f6e50657263656e743a206f7574206f662072616e6765496e6465782068617320746f206265206c6f776572207468616e20636f756e74206f6620746965727354726561737572793a2063616c6c6572206973206e6f7420746865206f70657261746f725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564436f6e747261637447756172643a206f6e6520626c6f636b2c206f6e652066756e6374696f6e5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e636554726561737572793a206e6f7420656e6f75676820626f6e64206c65667420746f2070757263686173655f626f6f747374726170537570706c79457870616e73696f6e50657263656e743a206f7574206f662072616e6765a2646970667358221220404ef654e18dad1d8b62fd5e6026b0d3eef7a26ccf1ab1edba9993a4bddbf15564736f6c634300060c0033