ETH Price: $3,339.69 (-1.06%)
Gas: 7 Gwei

Token

Peapods Blue Chips (Unweighted) (ppBLUE)
 

Overview

Max Total Supply

443.66268354979392923 ppBLUE

Holders

18

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Balance
2.260381942252566964 ppBLUE

Value
$0.00
0xd0970bfafc1db39f800bb80df5e8503cb1d12b34
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
UnweightedIndex

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 33 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () {
        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;
    }
}

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

pragma solidity ^0.7.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

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

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

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

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

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

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

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

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

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

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

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

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

File 3 of 33 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

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

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20 {
    using SafeMath for uint256;

    mapping (address => uint256) private _balances;

    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _decimals = 18;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
     * called.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual returns (uint8) {
        return _decimals;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal virtual {
        _decimals = decimals_;
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}

File 4 of 33 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

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

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

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

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

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

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

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

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

File 5 of 33 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.7.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 7 of 33 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

File 8 of 33 : IUniswapV3SwapCallback.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Callback for IUniswapV3PoolActions#swap
/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface
interface IUniswapV3SwapCallback {
    /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.
    /// @dev In the implementation you must pay the pool tokens owed for the swap.
    /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
    /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.
    /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.
    /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.
    /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call
    function uniswapV3SwapCallback(
        int256 amount0Delta,
        int256 amount1Delta,
        bytes calldata data
    ) external;
}

File 9 of 33 : IUniswapV3Pool.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

import './pool/IUniswapV3PoolImmutables.sol';
import './pool/IUniswapV3PoolState.sol';
import './pool/IUniswapV3PoolDerivedState.sol';
import './pool/IUniswapV3PoolActions.sol';
import './pool/IUniswapV3PoolOwnerActions.sol';
import './pool/IUniswapV3PoolEvents.sol';

/// @title The interface for a Uniswap V3 Pool
/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform
/// to the ERC20 specification
/// @dev The pool interface is broken up into many smaller pieces
interface IUniswapV3Pool is
    IUniswapV3PoolImmutables,
    IUniswapV3PoolState,
    IUniswapV3PoolDerivedState,
    IUniswapV3PoolActions,
    IUniswapV3PoolOwnerActions,
    IUniswapV3PoolEvents
{

}

File 10 of 33 : IUniswapV3PoolActions.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Permissionless pool actions
/// @notice Contains pool methods that can be called by anyone
interface IUniswapV3PoolActions {
    /// @notice Sets the initial price for the pool
    /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value
    /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96
    function initialize(uint160 sqrtPriceX96) external;

    /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position
    /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback
    /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends
    /// on tickLower, tickUpper, the amount of liquidity, and the current price.
    /// @param recipient The address for which the liquidity will be created
    /// @param tickLower The lower tick of the position in which to add liquidity
    /// @param tickUpper The upper tick of the position in which to add liquidity
    /// @param amount The amount of liquidity to mint
    /// @param data Any data that should be passed through to the callback
    /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback
    /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback
    function mint(
        address recipient,
        int24 tickLower,
        int24 tickUpper,
        uint128 amount,
        bytes calldata data
    ) external returns (uint256 amount0, uint256 amount1);

    /// @notice Collects tokens owed to a position
    /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.
    /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or
    /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the
    /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.
    /// @param recipient The address which should receive the fees collected
    /// @param tickLower The lower tick of the position for which to collect fees
    /// @param tickUpper The upper tick of the position for which to collect fees
    /// @param amount0Requested How much token0 should be withdrawn from the fees owed
    /// @param amount1Requested How much token1 should be withdrawn from the fees owed
    /// @return amount0 The amount of fees collected in token0
    /// @return amount1 The amount of fees collected in token1
    function collect(
        address recipient,
        int24 tickLower,
        int24 tickUpper,
        uint128 amount0Requested,
        uint128 amount1Requested
    ) external returns (uint128 amount0, uint128 amount1);

    /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position
    /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0
    /// @dev Fees must be collected separately via a call to #collect
    /// @param tickLower The lower tick of the position for which to burn liquidity
    /// @param tickUpper The upper tick of the position for which to burn liquidity
    /// @param amount How much liquidity to burn
    /// @return amount0 The amount of token0 sent to the recipient
    /// @return amount1 The amount of token1 sent to the recipient
    function burn(
        int24 tickLower,
        int24 tickUpper,
        uint128 amount
    ) external returns (uint256 amount0, uint256 amount1);

    /// @notice Swap token0 for token1, or token1 for token0
    /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback
    /// @param recipient The address to receive the output of the swap
    /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0
    /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
    /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this
    /// value after the swap. If one for zero, the price cannot be greater than this value after the swap
    /// @param data Any data to be passed through to the callback
    /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive
    /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive
    function swap(
        address recipient,
        bool zeroForOne,
        int256 amountSpecified,
        uint160 sqrtPriceLimitX96,
        bytes calldata data
    ) external returns (int256 amount0, int256 amount1);

    /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback
    /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback
    /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling
    /// with 0 amount{0,1} and sending the donation amount(s) from the callback
    /// @param recipient The address which will receive the token0 and token1 amounts
    /// @param amount0 The amount of token0 to send
    /// @param amount1 The amount of token1 to send
    /// @param data Any data to be passed through to the callback
    function flash(
        address recipient,
        uint256 amount0,
        uint256 amount1,
        bytes calldata data
    ) external;

    /// @notice Increase the maximum number of price and liquidity observations that this pool will store
    /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to
    /// the input observationCardinalityNext.
    /// @param observationCardinalityNext The desired minimum number of observations for the pool to store
    function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;
}

File 11 of 33 : IUniswapV3PoolDerivedState.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Pool state that is not stored
/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the
/// blockchain. The functions here may have variable gas costs.
interface IUniswapV3PoolDerivedState {
    /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp
    /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing
    /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,
    /// you must call it with secondsAgos = [3600, 0].
    /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in
    /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.
    /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned
    /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp
    /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block
    /// timestamp
    function observe(uint32[] calldata secondsAgos)
        external
        view
        returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);

    /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range
    /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.
    /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first
    /// snapshot is taken and the second snapshot is taken.
    /// @param tickLower The lower tick of the range
    /// @param tickUpper The upper tick of the range
    /// @return tickCumulativeInside The snapshot of the tick accumulator for the range
    /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range
    /// @return secondsInside The snapshot of seconds per liquidity for the range
    function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
        external
        view
        returns (
            int56 tickCumulativeInside,
            uint160 secondsPerLiquidityInsideX128,
            uint32 secondsInside
        );
}

File 12 of 33 : IUniswapV3PoolEvents.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Events emitted by a pool
/// @notice Contains all events emitted by the pool
interface IUniswapV3PoolEvents {
    /// @notice Emitted exactly once by a pool when #initialize is first called on the pool
    /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize
    /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96
    /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool
    event Initialize(uint160 sqrtPriceX96, int24 tick);

    /// @notice Emitted when liquidity is minted for a given position
    /// @param sender The address that minted the liquidity
    /// @param owner The owner of the position and recipient of any minted liquidity
    /// @param tickLower The lower tick of the position
    /// @param tickUpper The upper tick of the position
    /// @param amount The amount of liquidity minted to the position range
    /// @param amount0 How much token0 was required for the minted liquidity
    /// @param amount1 How much token1 was required for the minted liquidity
    event Mint(
        address sender,
        address indexed owner,
        int24 indexed tickLower,
        int24 indexed tickUpper,
        uint128 amount,
        uint256 amount0,
        uint256 amount1
    );

    /// @notice Emitted when fees are collected by the owner of a position
    /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees
    /// @param owner The owner of the position for which fees are collected
    /// @param tickLower The lower tick of the position
    /// @param tickUpper The upper tick of the position
    /// @param amount0 The amount of token0 fees collected
    /// @param amount1 The amount of token1 fees collected
    event Collect(
        address indexed owner,
        address recipient,
        int24 indexed tickLower,
        int24 indexed tickUpper,
        uint128 amount0,
        uint128 amount1
    );

    /// @notice Emitted when a position's liquidity is removed
    /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect
    /// @param owner The owner of the position for which liquidity is removed
    /// @param tickLower The lower tick of the position
    /// @param tickUpper The upper tick of the position
    /// @param amount The amount of liquidity to remove
    /// @param amount0 The amount of token0 withdrawn
    /// @param amount1 The amount of token1 withdrawn
    event Burn(
        address indexed owner,
        int24 indexed tickLower,
        int24 indexed tickUpper,
        uint128 amount,
        uint256 amount0,
        uint256 amount1
    );

    /// @notice Emitted by the pool for any swaps between token0 and token1
    /// @param sender The address that initiated the swap call, and that received the callback
    /// @param recipient The address that received the output of the swap
    /// @param amount0 The delta of the token0 balance of the pool
    /// @param amount1 The delta of the token1 balance of the pool
    /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96
    /// @param liquidity The liquidity of the pool after the swap
    /// @param tick The log base 1.0001 of price of the pool after the swap
    event Swap(
        address indexed sender,
        address indexed recipient,
        int256 amount0,
        int256 amount1,
        uint160 sqrtPriceX96,
        uint128 liquidity,
        int24 tick
    );

    /// @notice Emitted by the pool for any flashes of token0/token1
    /// @param sender The address that initiated the swap call, and that received the callback
    /// @param recipient The address that received the tokens from flash
    /// @param amount0 The amount of token0 that was flashed
    /// @param amount1 The amount of token1 that was flashed
    /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee
    /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee
    event Flash(
        address indexed sender,
        address indexed recipient,
        uint256 amount0,
        uint256 amount1,
        uint256 paid0,
        uint256 paid1
    );

    /// @notice Emitted by the pool for increases to the number of observations that can be stored
    /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index
    /// just before a mint/swap/burn.
    /// @param observationCardinalityNextOld The previous value of the next observation cardinality
    /// @param observationCardinalityNextNew The updated value of the next observation cardinality
    event IncreaseObservationCardinalityNext(
        uint16 observationCardinalityNextOld,
        uint16 observationCardinalityNextNew
    );

    /// @notice Emitted when the protocol fee is changed by the pool
    /// @param feeProtocol0Old The previous value of the token0 protocol fee
    /// @param feeProtocol1Old The previous value of the token1 protocol fee
    /// @param feeProtocol0New The updated value of the token0 protocol fee
    /// @param feeProtocol1New The updated value of the token1 protocol fee
    event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);

    /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner
    /// @param sender The address that collects the protocol fees
    /// @param recipient The address that receives the collected protocol fees
    /// @param amount0 The amount of token0 protocol fees that is withdrawn
    /// @param amount0 The amount of token1 protocol fees that is withdrawn
    event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);
}

File 13 of 33 : IUniswapV3PoolImmutables.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Pool state that never changes
/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values
interface IUniswapV3PoolImmutables {
    /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface
    /// @return The contract address
    function factory() external view returns (address);

    /// @notice The first of the two tokens of the pool, sorted by address
    /// @return The token contract address
    function token0() external view returns (address);

    /// @notice The second of the two tokens of the pool, sorted by address
    /// @return The token contract address
    function token1() external view returns (address);

    /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6
    /// @return The fee
    function fee() external view returns (uint24);

    /// @notice The pool tick spacing
    /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive
    /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...
    /// This value is an int24 to avoid casting even though it is always positive.
    /// @return The tick spacing
    function tickSpacing() external view returns (int24);

    /// @notice The maximum amount of position liquidity that can use any tick in the range
    /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and
    /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool
    /// @return The max amount of liquidity per tick
    function maxLiquidityPerTick() external view returns (uint128);
}

File 14 of 33 : IUniswapV3PoolOwnerActions.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Permissioned pool actions
/// @notice Contains pool methods that may only be called by the factory owner
interface IUniswapV3PoolOwnerActions {
    /// @notice Set the denominator of the protocol's % share of the fees
    /// @param feeProtocol0 new protocol fee for token0 of the pool
    /// @param feeProtocol1 new protocol fee for token1 of the pool
    function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;

    /// @notice Collect the protocol fee accrued to the pool
    /// @param recipient The address to which collected protocol fees should be sent
    /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1
    /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0
    /// @return amount0 The protocol fee collected in token0
    /// @return amount1 The protocol fee collected in token1
    function collectProtocol(
        address recipient,
        uint128 amount0Requested,
        uint128 amount1Requested
    ) external returns (uint128 amount0, uint128 amount1);
}

File 15 of 33 : IUniswapV3PoolState.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Pool state that can change
/// @notice These methods compose the pool's state, and can change with any frequency including multiple times
/// per transaction
interface IUniswapV3PoolState {
    /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas
    /// when accessed externally.
    /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
    /// tick The current tick of the pool, i.e. according to the last tick transition that was run.
    /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick
    /// boundary.
    /// observationIndex The index of the last oracle observation that was written,
    /// observationCardinality The current maximum number of observations stored in the pool,
    /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.
    /// feeProtocol The protocol fee for both tokens of the pool.
    /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0
    /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.
    /// unlocked Whether the pool is currently locked to reentrancy
    function slot0()
        external
        view
        returns (
            uint160 sqrtPriceX96,
            int24 tick,
            uint16 observationIndex,
            uint16 observationCardinality,
            uint16 observationCardinalityNext,
            uint8 feeProtocol,
            bool unlocked
        );

    /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool
    /// @dev This value can overflow the uint256
    function feeGrowthGlobal0X128() external view returns (uint256);

    /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool
    /// @dev This value can overflow the uint256
    function feeGrowthGlobal1X128() external view returns (uint256);

    /// @notice The amounts of token0 and token1 that are owed to the protocol
    /// @dev Protocol fees will never exceed uint128 max in either token
    function protocolFees() external view returns (uint128 token0, uint128 token1);

    /// @notice The currently in range liquidity available to the pool
    /// @dev This value has no relationship to the total liquidity across all ticks
    function liquidity() external view returns (uint128);

    /// @notice Look up information about a specific tick in the pool
    /// @param tick The tick to look up
    /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or
    /// tick upper,
    /// liquidityNet how much liquidity changes when the pool price crosses the tick,
    /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,
    /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,
    /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick
    /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,
    /// secondsOutside the seconds spent on the other side of the tick from the current tick,
    /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.
    /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.
    /// In addition, these values are only relative and must be used only in comparison to previous snapshots for
    /// a specific position.
    function ticks(int24 tick)
        external
        view
        returns (
            uint128 liquidityGross,
            int128 liquidityNet,
            uint256 feeGrowthOutside0X128,
            uint256 feeGrowthOutside1X128,
            int56 tickCumulativeOutside,
            uint160 secondsPerLiquidityOutsideX128,
            uint32 secondsOutside,
            bool initialized
        );

    /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information
    function tickBitmap(int16 wordPosition) external view returns (uint256);

    /// @notice Returns the information about a position by the position's key
    /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper
    /// @return _liquidity The amount of liquidity in the position,
    /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,
    /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,
    /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,
    /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke
    function positions(bytes32 key)
        external
        view
        returns (
            uint128 _liquidity,
            uint256 feeGrowthInside0LastX128,
            uint256 feeGrowthInside1LastX128,
            uint128 tokensOwed0,
            uint128 tokensOwed1
        );

    /// @notice Returns data about a specific observation index
    /// @param index The element of the observations array to fetch
    /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time
    /// ago, rather than at a specific index in the array.
    /// @return blockTimestamp The timestamp of the observation,
    /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,
    /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,
    /// Returns initialized whether the observation has been initialized and the values are safe to use
    function observations(uint256 index)
        external
        view
        returns (
            uint32 blockTimestamp,
            int56 tickCumulative,
            uint160 secondsPerLiquidityCumulativeX128,
            bool initialized
        );
}

File 16 of 33 : FixedPoint96.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.4.0;

/// @title FixedPoint96
/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)
/// @dev Used in SqrtPriceMath.sol
library FixedPoint96 {
    uint8 internal constant RESOLUTION = 96;
    uint256 internal constant Q96 = 0x1000000000000000000000000;
}

File 17 of 33 : IPeripheryImmutableState.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Immutable state
/// @notice Functions that return immutable state of the router
interface IPeripheryImmutableState {
    /// @return Returns the address of the Uniswap V3 factory
    function factory() external view returns (address);

    /// @return Returns the address of WETH9
    function WETH9() external view returns (address);
}

File 18 of 33 : ISwapRouter.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;

import '@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol';

/// @title Router token swapping functionality
/// @notice Functions for swapping tokens via Uniswap V3
interface ISwapRouter is IUniswapV3SwapCallback {
    struct ExactInputSingleParams {
        address tokenIn;
        address tokenOut;
        uint24 fee;
        address recipient;
        uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
        uint160 sqrtPriceLimitX96;
    }

    /// @notice Swaps `amountIn` of one token for as much as possible of another token
    /// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut);

    struct ExactInputParams {
        bytes path;
        address recipient;
        uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
    }

    /// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut);

    struct ExactOutputSingleParams {
        address tokenIn;
        address tokenOut;
        uint24 fee;
        address recipient;
        uint256 deadline;
        uint256 amountOut;
        uint256 amountInMaximum;
        uint160 sqrtPriceLimitX96;
    }

    /// @notice Swaps as little as possible of one token for `amountOut` of another token
    /// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata
    /// @return amountIn The amount of the input token
    function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn);

    struct ExactOutputParams {
        bytes path;
        address recipient;
        uint256 deadline;
        uint256 amountOut;
        uint256 amountInMaximum;
    }

    /// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)
    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata
    /// @return amountIn The amount of the input token
    function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn);
}

File 19 of 33 : PoolAddress.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Provides functions for deriving a pool address from the factory, tokens, and the fee
library PoolAddress {
    bytes32 internal constant POOL_INIT_CODE_HASH = 0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54;

    /// @notice The identifying key of the pool
    struct PoolKey {
        address token0;
        address token1;
        uint24 fee;
    }

    /// @notice Returns PoolKey: the ordered tokens with the matched fee levels
    /// @param tokenA The first token of a pool, unsorted
    /// @param tokenB The second token of a pool, unsorted
    /// @param fee The fee level of the pool
    /// @return Poolkey The pool details with ordered token0 and token1 assignments
    function getPoolKey(
        address tokenA,
        address tokenB,
        uint24 fee
    ) internal pure returns (PoolKey memory) {
        if (tokenA > tokenB) (tokenA, tokenB) = (tokenB, tokenA);
        return PoolKey({token0: tokenA, token1: tokenB, fee: fee});
    }

    /// @notice Deterministically computes the pool address given the factory and PoolKey
    /// @param factory The Uniswap V3 factory contract address
    /// @param key The PoolKey
    /// @return pool The contract address of the V3 pool
    function computeAddress(address factory, PoolKey memory key) internal pure returns (address pool) {
        require(key.token0 < key.token1);
        pool = address(
            uint256(
                keccak256(
                    abi.encodePacked(
                        hex'ff',
                        factory,
                        keccak256(abi.encode(key.token0, key.token1, key.fee)),
                        POOL_INIT_CODE_HASH
                    )
                )
            )
        );
    }
}

File 20 of 33 : DecentralizedIndex.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
import './interfaces/IDecentralizedIndex.sol';
import './interfaces/IERC20Metadata.sol';
import './interfaces/IFlashLoanRecipient.sol';
import './interfaces/ITokenRewards.sol';
import './interfaces/IUniswapV2Factory.sol';
import './interfaces/IUniswapV2Router02.sol';
import './StakingPoolToken.sol';

abstract contract DecentralizedIndex is IDecentralizedIndex, ERC20 {
  using SafeERC20 for IERC20;

  uint256 public constant override FLASH_FEE_DAI = 10; // 10 DAI
  uint256 public immutable override BOND_FEE;
  uint256 public immutable override DEBOND_FEE;
  address immutable V2_ROUTER;
  address immutable V2_POOL;
  address immutable DAI;
  address immutable WETH;
  IV3TwapUtilities immutable V3_TWAP_UTILS;

  IndexType public override indexType;
  uint256 public override created;
  address public override lpStakingPool;
  address public override lpRewardsToken;

  IndexAssetInfo[] public indexTokens;
  mapping(address => bool) _isTokenInIndex;
  mapping(address => uint256) _fundTokenIdx;

  bool _swapping;
  bool _swapOn = true;

  event FlashLoan(
    address indexed executor,
    address indexed recipient,
    address token,
    uint256 amount
  );

  modifier noSwap() {
    _swapOn = false;
    _;
    _swapOn = true;
  }

  constructor(
    string memory _name,
    string memory _symbol,
    uint256 _bondFee,
    uint256 _debondFee,
    address _lpRewardsToken,
    address _v2Router,
    address _dai,
    bool _stakeRestriction,
    IV3TwapUtilities _v3TwapUtilities
  ) ERC20(_name, _symbol) {
    created = block.timestamp;
    BOND_FEE = _bondFee;
    DEBOND_FEE = _debondFee;
    lpRewardsToken = _lpRewardsToken;
    V2_ROUTER = _v2Router;
    address _v2Pool = IUniswapV2Factory(IUniswapV2Router02(_v2Router).factory())
      .createPair(address(this), _dai);
    lpStakingPool = address(
      new StakingPoolToken(
        string(abi.encodePacked('Staked ', _name)),
        string(abi.encodePacked('s', _symbol)),
        _dai,
        _v2Pool,
        lpRewardsToken,
        _stakeRestriction ? _msgSender() : address(0),
        _v3TwapUtilities
      )
    );
    V2_POOL = _v2Pool;
    DAI = _dai;
    WETH = IUniswapV2Router02(_v2Router).WETH();
    V3_TWAP_UTILS = _v3TwapUtilities;
    emit Create(address(this), _msgSender());
  }

  function _transfer(
    address _from,
    address _to,
    uint256 _amount
  ) internal virtual override {
    if (_swapOn && !_swapping) {
      uint256 _bal = balanceOf(address(this));
      uint256 _min = totalSupply() / 10000; // 0.01%
      if (_from != V2_POOL && _bal >= _min && balanceOf(V2_POOL) > 0) {
        _swapping = true;
        _feeSwap(
          _bal >= _min * 100 ? _min * 100 : _bal >= _min * 20 ? _min * 20 : _min
        );
        _swapping = false;
      }
    }
    super._transfer(_from, _to, _amount);
  }

  function _feeSwap(uint256 _amount) internal {
    address[] memory path = new address[](2);
    path[0] = address(this);
    path[1] = DAI;
    _approve(address(this), V2_ROUTER, _amount);
    address _rewards = StakingPoolToken(lpStakingPool).poolRewards();
    IUniswapV2Router02(V2_ROUTER)
      .swapExactTokensForTokensSupportingFeeOnTransferTokens(
        _amount,
        0,
        path,
        _rewards,
        block.timestamp
      );
    uint256 _rewardsDAIBal = IERC20(DAI).balanceOf(_rewards);
    if (_rewardsDAIBal > 0) {
      ITokenRewards(_rewards).depositFromDAI(0);
    }
  }

  function _transferAndValidate(
    IERC20 _token,
    address _sender,
    uint256 _amount
  ) internal {
    uint256 _balanceBefore = _token.balanceOf(address(this));
    _token.safeTransferFrom(_sender, address(this), _amount);
    require(
      _token.balanceOf(address(this)) >= _balanceBefore + _amount,
      'TFRVAL'
    );
  }

  function _isFirstIn() internal view returns (bool) {
    return totalSupply() == 0;
  }

  function _isLastOut(uint256 _debondAmount) internal view returns (bool) {
    return _debondAmount >= (totalSupply() * 98) / 100;
  }

  function isAsset(address _token) public view override returns (bool) {
    return _isTokenInIndex[_token];
  }

  function getAllAssets()
    external
    view
    override
    returns (IndexAssetInfo[] memory)
  {
    return indexTokens;
  }

  function addLiquidityV2(
    uint256 _idxLPTokens,
    uint256 _daiLPTokens,
    uint256 _slippage // 100 == 10%, 1000 == 100%
  ) external override noSwap {
    uint256 _idxTokensBefore = balanceOf(address(this));
    uint256 _daiBefore = IERC20(DAI).balanceOf(address(this));

    _transfer(_msgSender(), address(this), _idxLPTokens);
    _approve(address(this), V2_ROUTER, _idxLPTokens);

    IERC20(DAI).safeTransferFrom(_msgSender(), address(this), _daiLPTokens);
    IERC20(DAI).safeIncreaseAllowance(V2_ROUTER, _daiLPTokens);

    IUniswapV2Router02(V2_ROUTER).addLiquidity(
      address(this),
      DAI,
      _idxLPTokens,
      _daiLPTokens,
      (_idxLPTokens * (1000 - _slippage)) / 1000,
      (_daiLPTokens * (1000 - _slippage)) / 1000,
      _msgSender(),
      block.timestamp
    );

    // check & refund excess tokens from LPing
    if (balanceOf(address(this)) > _idxTokensBefore) {
      _transfer(
        address(this),
        _msgSender(),
        balanceOf(address(this)) - _idxTokensBefore
      );
    }
    if (IERC20(DAI).balanceOf(address(this)) > _daiBefore) {
      IERC20(DAI).safeTransfer(
        _msgSender(),
        IERC20(DAI).balanceOf(address(this)) - _daiBefore
      );
    }
    emit AddLiquidity(_msgSender(), _idxLPTokens, _daiLPTokens);
  }

  function removeLiquidityV2(
    uint256 _lpTokens,
    uint256 _minIdxTokens, // 0 == 100% slippage
    uint256 _minDAI // 0 == 100% slippage
  ) external override noSwap {
    _lpTokens = _lpTokens == 0
      ? IERC20(V2_POOL).balanceOf(_msgSender())
      : _lpTokens;
    require(_lpTokens > 0, 'LPREM');

    uint256 _balBefore = IERC20(V2_POOL).balanceOf(address(this));
    IERC20(V2_POOL).safeTransferFrom(_msgSender(), address(this), _lpTokens);
    IERC20(V2_POOL).safeIncreaseAllowance(V2_ROUTER, _lpTokens);
    IUniswapV2Router02(V2_ROUTER).removeLiquidity(
      address(this),
      DAI,
      _lpTokens,
      _minIdxTokens,
      _minDAI,
      _msgSender(),
      block.timestamp
    );
    if (IERC20(V2_POOL).balanceOf(address(this)) > _balBefore) {
      IERC20(V2_POOL).safeTransfer(
        _msgSender(),
        IERC20(V2_POOL).balanceOf(address(this)) - _balBefore
      );
    }
    emit RemoveLiquidity(_msgSender(), _lpTokens);
  }

  function flash(
    address _recipient,
    address _token,
    uint256 _amount,
    bytes calldata _data
  ) external override {
    address _rewards = StakingPoolToken(lpStakingPool).poolRewards();
    IERC20(DAI).safeTransferFrom(
      _msgSender(),
      _rewards,
      FLASH_FEE_DAI * 10 ** IERC20Metadata(DAI).decimals()
    );
    uint256 _balance = IERC20(_token).balanceOf(address(this));
    IERC20(_token).safeTransfer(_recipient, _amount);
    IFlashLoanRecipient(_recipient).callback(_data);
    require(IERC20(_token).balanceOf(address(this)) >= _balance, 'FLASHAFTER');
    emit FlashLoan(_msgSender(), _recipient, _token, _amount);
  }

  function rescueERC20(address _token) external {
    // cannot withdraw tokens/assets that belong to the index
    require(!isAsset(_token) && _token != address(this), 'UNAVAILABLE');
    IERC20(_token).safeTransfer(
      Ownable(address(V3_TWAP_UTILS)).owner(),
      IERC20(_token).balanceOf(address(this))
    );
  }

  function rescueETH() external {
    require(address(this).balance > 0, 'NOETH');
    _rescueETH(address(this).balance);
  }

  function _rescueETH(uint256 _amount) internal {
    if (_amount == 0) {
      return;
    }
    (bool _sent, ) = Ownable(address(V3_TWAP_UTILS)).owner().call{
      value: _amount
    }('');
    require(_sent, 'SENT');
  }

  receive() external payable {
    _rescueETH(msg.value);
  }
}

File 21 of 33 : IDecentralizedIndex.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

import '@openzeppelin/contracts/token/ERC20/IERC20.sol';

interface IDecentralizedIndex is IERC20 {
  enum IndexType {
    WEIGHTED,
    UNWEIGHTED
  }

  struct IndexAssetInfo {
    address token;
    uint256 weighting;
    uint256 basePriceUSDX96;
    address c1; // arbitrary contract/address field we can use for an index
    uint256 q1; // arbitrary quantity/number field we can use for an index
  }

  event Create(address indexed newIdx, address indexed wallet);
  event Bond(
    address indexed wallet,
    address indexed token,
    uint256 amountTokensBonded,
    uint256 amountTokensMinted
  );
  event Debond(address indexed wallet, uint256 amountDebonded);
  event AddLiquidity(
    address indexed wallet,
    uint256 amountTokens,
    uint256 amountDAI
  );
  event RemoveLiquidity(address indexed wallet, uint256 amountLiquidity);

  function FLASH_FEE_DAI() external view returns (uint256);

  function BOND_FEE() external view returns (uint256); // 1 == 0.01%, 10 == 0.1%, 100 == 1%

  function DEBOND_FEE() external view returns (uint256); // 1 == 0.01%, 10 == 0.1%, 100 == 1%

  function indexType() external view returns (IndexType);

  function created() external view returns (uint256);

  function lpStakingPool() external view returns (address);

  function lpRewardsToken() external view returns (address);

  function getIdxPriceUSDX96() external view returns (uint256, uint256);

  function isAsset(address token) external view returns (bool);

  function getAllAssets() external view returns (IndexAssetInfo[] memory);

  function getTokenPriceUSDX96(address token) external view returns (uint256);

  function bond(address token, uint256 amount) external;

  function debond(
    uint256 amount,
    address[] memory token,
    uint8[] memory percentage
  ) external;

  function addLiquidityV2(
    uint256 idxTokens,
    uint256 daiTokens,
    uint256 slippage
  ) external;

  function removeLiquidityV2(
    uint256 lpTokens,
    uint256 minTokens,
    uint256 minDAI
  ) external;

  function flash(
    address recipient,
    address token,
    uint256 amount,
    bytes calldata data
  ) external;
}

File 22 of 33 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

interface IERC20Metadata {
  function decimals() external view returns (uint8);
}

File 23 of 33 : IFlashLoanRecipient.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

interface IFlashLoanRecipient {
  function callback(bytes calldata data) external;
}

File 24 of 33 : IPEAS.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

import '@openzeppelin/contracts/token/ERC20/IERC20.sol';

interface IPEAS is IERC20 {
  event Burn(address indexed user, uint256 amount);

  function burn(uint256 amount) external;
}

File 25 of 33 : IStakingPoolToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

interface IStakingPoolToken {
  event Stake(address indexed executor, address indexed user, uint256 amount);

  event Unstake(address indexed user, uint256 amount);

  function indexFund() external view returns (address);

  function stakingToken() external view returns (address);

  function poolRewards() external view returns (address);

  function stakeUserRestriction() external view returns (address);

  function stake(address user, uint256 amount) external;

  function unstake(uint256 amount) external;
}

File 26 of 33 : ITokenRewards.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

interface ITokenRewards {
  event AddShares(address indexed wallet, uint256 amount);

  event RemoveShares(address indexed wallet, uint256 amount);

  event ClaimReward(address indexed wallet);

  event DistributeReward(address indexed wallet, uint256 amount);

  event DepositRewards(address indexed wallet, uint256 amount);

  function totalShares() external view returns (uint256);

  function totalStakers() external view returns (uint256);

  function rewardsToken() external view returns (address);

  function trackingToken() external view returns (address);

  function depositFromDAI(uint256 amount) external;

  function depositRewards(uint256 amount) external;

  function claimReward(address wallet) external;

  function setShares(
    address wallet,
    uint256 amount,
    bool sharesRemoving
  ) external;
}

File 27 of 33 : IUniswapV2Factory.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;

interface IUniswapV2Factory {
  function createPair(
    address tokenA,
    address tokenB
  ) external returns (address pair);

  function getPair(
    address tokenA,
    address tokenB
  ) external view returns (address pair);
}

File 28 of 33 : IUniswapV2Router02.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;

interface IUniswapV2Router02 {
  function factory() external view returns (address);

  function WETH() external view returns (address);

  function addLiquidity(
    address tokenA,
    address tokenB,
    uint amountADesired,
    uint amountBDesired,
    uint amountAMin,
    uint amountBMin,
    address to,
    uint deadline
  ) external returns (uint amountA, uint amountB, uint liquidity);

  function removeLiquidity(
    address tokenA,
    address tokenB,
    uint liquidity,
    uint amountAMin,
    uint amountBMin,
    address to,
    uint deadline
  ) external returns (uint amountA, uint amountB);

  function swapETHForExactTokens(
    uint256 amountOut,
    address[] calldata path,
    address to,
    uint256 deadline
  ) external payable returns (uint256[] memory amounts);

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

File 29 of 33 : IV3TwapUtilities.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

interface IV3TwapUtilities {
  function getV3Pool(
    address v3Factory,
    address token0,
    address token1,
    uint24 poolFee
  ) external view returns (address);

  function getPoolPriceUSDX96(
    address pricePool,
    address nativeStablePool,
    address WETH9
  ) external view returns (uint256);

  function sqrtPriceX96FromPoolAndInterval(
    address pool
  ) external view returns (uint160);

  function priceX96FromSqrtPriceX96(
    uint160 sqrtPriceX96
  ) external pure returns (uint256);
}

File 30 of 33 : BokkyPooBahsDateTimeLibrary.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

// ----------------------------------------------------------------------------
// BokkyPooBah's DateTime Library v1.00
//
// A gas-efficient Solidity date and time library
//
// https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary
//
// Tested date range 1970/01/01 to 2345/12/31
//
// Conventions:
// Unit      | Range         | Notes
// :-------- |:-------------:|:-----
// timestamp | >= 0          | Unix timestamp, number of seconds since 1970/01/01 00:00:00 UTC
// year      | 1970 ... 2345 |
// month     | 1 ... 12      |
// day       | 1 ... 31      |
// hour      | 0 ... 23      |
// minute    | 0 ... 59      |
// second    | 0 ... 59      |
// dayOfWeek | 1 ... 7       | 1 = Monday, ..., 7 = Sunday
//
//
// Enjoy. (c) BokkyPooBah / Bok Consulting Pty Ltd 2018.
//
// GNU Lesser General Public License 3.0
// https://www.gnu.org/licenses/lgpl-3.0.en.html
// ----------------------------------------------------------------------------

library BokkyPooBahsDateTimeLibrary {
  uint constant SECONDS_PER_DAY = 24 * 60 * 60;
  int constant OFFSET19700101 = 2440588;

  // ------------------------------------------------------------------------
  // Calculate year/month/day from the number of days since 1970/01/01 using
  // the date conversion algorithm from
  //   http://aa.usno.navy.mil/faq/docs/JD_Formula.php
  // and adding the offset 2440588 so that 1970/01/01 is day 0
  //
  // int L = days + 68569 + offset
  // int N = 4 * L / 146097
  // L = L - (146097 * N + 3) / 4
  // year = 4000 * (L + 1) / 1461001
  // L = L - 1461 * year / 4 + 31
  // month = 80 * L / 2447
  // dd = L - 2447 * month / 80
  // L = month / 11
  // month = month + 2 - 12 * L
  // year = 100 * (N - 49) + year + L
  // ------------------------------------------------------------------------
  function _daysToDate(
    uint _days
  ) internal pure returns (uint year, uint month, uint day) {
    int __days = int(_days);

    int L = __days + 68569 + OFFSET19700101;
    int N = (4 * L) / 146097;
    L = L - (146097 * N + 3) / 4;
    int _year = (4000 * (L + 1)) / 1461001;
    L = L - (1461 * _year) / 4 + 31;
    int _month = (80 * L) / 2447;
    int _day = L - (2447 * _month) / 80;
    L = _month / 11;
    _month = _month + 2 - 12 * L;
    _year = 100 * (N - 49) + _year + L;

    year = uint(_year);
    month = uint(_month);
    day = uint(_day);
  }

  function timestampToDate(
    uint timestamp
  ) internal pure returns (uint year, uint month, uint day) {
    (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY);
  }
}

File 31 of 33 : StakingPoolToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
import './interfaces/IStakingPoolToken.sol';
import './TokenRewards.sol';

contract StakingPoolToken is IStakingPoolToken, ERC20 {
  using SafeERC20 for IERC20;

  address public override indexFund;
  address public override stakingToken;
  address public override poolRewards;
  address public override stakeUserRestriction;

  modifier onlyRestricted() {
    require(_msgSender() == stakeUserRestriction, 'RESUSERAUTH');
    _;
  }

  constructor(
    string memory _name,
    string memory _symbol,
    address _dai,
    address _stakingToken,
    address _rewardsToken,
    address _stakeUserRestriction,
    IV3TwapUtilities _v3TwapUtilities
  ) ERC20(_name, _symbol) {
    indexFund = _msgSender();
    stakingToken = _stakingToken;
    stakeUserRestriction = _stakeUserRestriction;
    poolRewards = address(
      new TokenRewards(_v3TwapUtilities, _dai, address(this), _rewardsToken)
    );
  }

  function stake(address _user, uint256 _amount) external override {
    if (stakeUserRestriction != address(0)) {
      require(_user == stakeUserRestriction, 'RESTRICT');
    }
    _mint(_user, _amount);
    IERC20(stakingToken).safeTransferFrom(_msgSender(), address(this), _amount);
    emit Stake(_msgSender(), _user, _amount);
  }

  function unstake(uint256 _amount) external override {
    _burn(_msgSender(), _amount);
    IERC20(stakingToken).safeTransfer(_msgSender(), _amount);
    emit Unstake(_msgSender(), _amount);
  }

  function removeStakeUserRestriction() external onlyRestricted {
    stakeUserRestriction = address(0);
  }

  function setStakeUserRestriction(address _user) external onlyRestricted {
    stakeUserRestriction = _user;
  }

  function _transfer(
    address _from,
    address _to,
    uint256 _amount
  ) internal virtual override {
    super._transfer(_from, _to, _amount);
    _afterTokenTransfer(_from, _to, _amount);
  }

  function _mint(address _to, uint256 _amount) internal override {
    super._mint(_to, _amount);
    _afterTokenTransfer(address(0), _to, _amount);
  }

  function _burn(address _from, uint256 _amount) internal override {
    super._burn(_from, _amount);
    _afterTokenTransfer(_from, address(0), _amount);
  }

  function _afterTokenTransfer(
    address _from,
    address _to,
    uint256 _amount
  ) internal {
    if (_from != address(0) && _from != address(0xdead)) {
      TokenRewards(poolRewards).setShares(_from, _amount, true);
    }
    if (_to != address(0) && _to != address(0xdead)) {
      TokenRewards(poolRewards).setShares(_to, _amount, false);
    }
  }
}

File 32 of 33 : TokenRewards.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
import '@openzeppelin/contracts/utils/Context.sol';
import '@uniswap/v3-core/contracts/libraries/FixedPoint96.sol';
import '@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol';
import '@uniswap/v3-periphery/contracts/interfaces/IPeripheryImmutableState.sol';
import '@uniswap/v3-periphery/contracts/libraries/PoolAddress.sol';
import './libraries/BokkyPooBahsDateTimeLibrary.sol';
import './interfaces/IPEAS.sol';
import './interfaces/ITokenRewards.sol';
import './interfaces/IV3TwapUtilities.sol';

contract TokenRewards is ITokenRewards, Context {
  using SafeERC20 for IERC20;

  address constant V3_ROUTER = 0xE592427A0AEce92De3Edee1F18E0157C05861564;
  uint256 constant PRECISION = 10 ** 36;
  uint24 constant REWARDS_POOL_FEE = 10000; // 1%
  address immutable DAI;
  IV3TwapUtilities immutable V3_TWAP_UTILS;

  struct Reward {
    uint256 excluded;
    uint256 realized;
  }

  address public override trackingToken;
  address public override rewardsToken;
  uint256 public override totalShares;
  uint256 public override totalStakers;
  mapping(address => uint256) public shares;
  mapping(address => Reward) public rewards;

  uint256 _rewardsSwapSlippage = 10; // 1%
  uint256 _rewardsPerShare;
  uint256 public rewardsDistributed;
  uint256 public rewardsDeposited;
  mapping(uint256 => uint256) public rewardsDepMonthly;

  modifier onlyTrackingToken() {
    require(_msgSender() == trackingToken, 'UNAUTHORIZED');
    _;
  }

  constructor(
    IV3TwapUtilities _v3TwapUtilities,
    address _dai,
    address _trackingToken,
    address _rewardsToken
  ) {
    V3_TWAP_UTILS = _v3TwapUtilities;
    DAI = _dai;
    trackingToken = _trackingToken;
    rewardsToken = _rewardsToken;
  }

  function setShares(
    address _wallet,
    uint256 _amount,
    bool _sharesRemoving
  ) external override onlyTrackingToken {
    _setShares(_wallet, _amount, _sharesRemoving);
  }

  function _setShares(
    address _wallet,
    uint256 _amount,
    bool _sharesRemoving
  ) internal {
    if (_sharesRemoving) {
      _removeShares(_wallet, _amount);
      emit RemoveShares(_wallet, _amount);
    } else {
      _addShares(_wallet, _amount);
      emit AddShares(_wallet, _amount);
    }
  }

  function _addShares(address _wallet, uint256 _amount) internal {
    if (shares[_wallet] > 0) {
      _distributeReward(_wallet);
    }
    uint256 sharesBefore = shares[_wallet];
    totalShares += _amount;
    shares[_wallet] += _amount;
    if (sharesBefore == 0 && shares[_wallet] > 0) {
      totalStakers++;
    }
    rewards[_wallet].excluded = _cumulativeRewards(shares[_wallet]);
  }

  function _removeShares(address _wallet, uint256 _amount) internal {
    require(shares[_wallet] > 0 && _amount <= shares[_wallet], 'REMOVE');
    _distributeReward(_wallet);
    totalShares -= _amount;
    shares[_wallet] -= _amount;
    if (shares[_wallet] == 0) {
      totalStakers--;
    }
    rewards[_wallet].excluded = _cumulativeRewards(shares[_wallet]);
  }

  function depositFromDAI(uint256 _amountDAIDepositing) external override {
    if (_amountDAIDepositing > 0) {
      IERC20(DAI).safeTransferFrom(
        _msgSender(),
        address(this),
        _amountDAIDepositing
      );
    }
    uint256 _amountDAI = IERC20(DAI).balanceOf(address(this));
    require(_amountDAI > 0, 'NEEDDAI');
    (address _token0, address _token1) = DAI < rewardsToken
      ? (DAI, rewardsToken)
      : (rewardsToken, DAI);
    PoolAddress.PoolKey memory _poolKey = PoolAddress.PoolKey({
      token0: _token0,
      token1: _token1,
      fee: REWARDS_POOL_FEE
    });
    address _pool = PoolAddress.computeAddress(
      IPeripheryImmutableState(V3_ROUTER).factory(),
      _poolKey
    );
    uint160 _rewardsSqrtPriceX96 = V3_TWAP_UTILS
      .sqrtPriceX96FromPoolAndInterval(_pool);
    uint256 _rewardsPriceX96 = V3_TWAP_UTILS.priceX96FromSqrtPriceX96(
      _rewardsSqrtPriceX96
    );
    uint256 _amountOut = _token0 == DAI
      ? (_rewardsPriceX96 * _amountDAI) / FixedPoint96.Q96
      : (_amountDAI * FixedPoint96.Q96) / _rewardsPriceX96;

    uint256 _rewardsBalBefore = IERC20(rewardsToken).balanceOf(address(this));
    IERC20(DAI).safeIncreaseAllowance(V3_ROUTER, _amountDAI);
    try
      ISwapRouter(V3_ROUTER).exactInputSingle(
        ISwapRouter.ExactInputSingleParams({
          tokenIn: DAI,
          tokenOut: rewardsToken,
          fee: REWARDS_POOL_FEE,
          recipient: address(this),
          deadline: block.timestamp,
          amountIn: _amountDAI,
          amountOutMinimum: (_amountOut * (1000 - _rewardsSwapSlippage)) / 1000,
          sqrtPriceLimitX96: 0
        })
      )
    {
      _rewardsSwapSlippage = 10;
      _depositRewards(
        IERC20(rewardsToken).balanceOf(address(this)) - _rewardsBalBefore
      );
    } catch {
      _rewardsSwapSlippage += 10;
      IERC20(DAI).safeDecreaseAllowance(V3_ROUTER, _amountDAI);
    }
  }

  function depositRewards(uint256 _amount) external override {
    require(_amount > 0, 'DEPAM');
    uint256 _rewardsBalBefore = IERC20(rewardsToken).balanceOf(address(this));
    IERC20(rewardsToken).safeTransferFrom(_msgSender(), address(this), _amount);
    _depositRewards(
      IERC20(rewardsToken).balanceOf(address(this)) - _rewardsBalBefore
    );
  }

  function _depositRewards(uint256 _amountTotal) internal {
    if (_amountTotal == 0) {
      return;
    }
    if (totalShares == 0) {
      _burnRewards(_amountTotal);
      return;
    }

    uint256 _burnAmount = _amountTotal / 10;
    uint256 _depositAmount = _amountTotal - _burnAmount;
    _burnRewards(_burnAmount);
    rewardsDeposited += _depositAmount;
    rewardsDepMonthly[beginningOfMonth(block.timestamp)] += _depositAmount;
    _rewardsPerShare += (PRECISION * _depositAmount) / totalShares;
    emit DepositRewards(_msgSender(), _depositAmount);
  }

  function _distributeReward(address _wallet) internal {
    if (shares[_wallet] == 0) {
      return;
    }
    uint256 _amount = getUnpaid(_wallet);
    rewards[_wallet].realized += _amount;
    rewards[_wallet].excluded = _cumulativeRewards(shares[_wallet]);
    if (_amount > 0) {
      rewardsDistributed += _amount;
      IERC20(rewardsToken).safeTransfer(_wallet, _amount);
      emit DistributeReward(_wallet, _amount);
    }
  }

  function _burnRewards(uint256 _burnAmount) internal {
    try IPEAS(rewardsToken).burn(_burnAmount) {} catch {
      IERC20(rewardsToken).safeTransfer(address(0xdead), _burnAmount);
    }
  }

  function beginningOfMonth(uint256 _timestamp) public pure returns (uint256) {
    (, , uint256 _dayOfMonth) = BokkyPooBahsDateTimeLibrary.timestampToDate(
      _timestamp
    );
    return _timestamp - ((_dayOfMonth - 1) * 1 days) - (_timestamp % 1 days);
  }

  function claimReward(address _wallet) external override {
    _distributeReward(_wallet);
    emit ClaimReward(_wallet);
  }

  function getUnpaid(address _wallet) public view returns (uint256) {
    if (shares[_wallet] == 0) {
      return 0;
    }
    uint256 earnedRewards = _cumulativeRewards(shares[_wallet]);
    uint256 rewardsExcluded = rewards[_wallet].excluded;
    if (earnedRewards <= rewardsExcluded) {
      return 0;
    }
    return earnedRewards - rewardsExcluded;
  }

  function _cumulativeRewards(uint256 _share) internal view returns (uint256) {
    return (_share * _rewardsPerShare) / PRECISION;
  }
}

File 33 of 33 : UnweightedIndex.sol
// https://peapods.finance

// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

import '@openzeppelin/contracts/access/Ownable.sol';
import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol';
import '@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol';
import './interfaces/IERC20Metadata.sol';
import './interfaces/IV3TwapUtilities.sol';
import './DecentralizedIndex.sol';

contract UnweightedIndex is DecentralizedIndex, Ownable {
  using SafeERC20 for IERC20;

  address constant V3_ROUTER = 0xE592427A0AEce92De3Edee1F18E0157C05861564;
  address immutable V3_WETH_STABLE_POOL;

  uint256 public rebalanceSlippage = 10; // 10 == 1%, 100 == 10%
  uint256 public rebalanceMinSwapUSDX96 = FixedPoint96.Q96; // $1

  event Rebalance();

  constructor(
    string memory _name,
    string memory _symbol,
    uint256 _bondFee,
    uint256 _debondFee,
    address[] memory _pools,
    address _lpRewardsToken,
    address _v2Router,
    address _v3StableWETHPool,
    address _dai,
    bool _stakeRestriction,
    IV3TwapUtilities _v3TwapUtilities
  )
    DecentralizedIndex(
      _name,
      _symbol,
      _bondFee,
      _debondFee,
      _lpRewardsToken,
      _v2Router,
      _dai,
      _stakeRestriction,
      _v3TwapUtilities
    )
  {
    indexType = IndexType.UNWEIGHTED;
    V3_WETH_STABLE_POOL = _v3StableWETHPool;
    address _weth9 = IUniswapV2Router02(_v2Router).WETH();
    for (uint256 _i; _i < _pools.length; _i++) {
      IUniswapV3Pool _pool = IUniswapV3Pool(_pools[_i]);
      uint256 _basePriceUSDX96 = _v3TwapUtilities.getPoolPriceUSDX96(
        _pools[_i],
        _v3StableWETHPool,
        _weth9
      );
      address _token0 = _pool.token0();
      address _nonNativeToken = _pools[_i] == _v3StableWETHPool
        ? _weth9
        : _token0 == _weth9
        ? _pool.token1()
        : _token0;
      indexTokens.push(
        IndexAssetInfo({
          token: _nonNativeToken,
          basePriceUSDX96: _basePriceUSDX96,
          weighting: 0,
          c1: _pools[_i],
          q1: 0
        })
      );
      _fundTokenIdx[_nonNativeToken] = _i;
      _isTokenInIndex[_nonNativeToken] = true;
    }
  }

  function _swapIndexToken0ForToken1(
    address _token0,
    address _token1,
    uint256 _price0USDX96,
    uint256 _price1USDX96,
    uint256 _valueNeededUSDX96
  ) internal {
    uint256 _amountIn = (_valueNeededUSDX96 *
      10 ** IERC20Metadata(_token0).decimals()) / _price0USDX96;
    if (_amountIn == 0) {
      return;
    }
    uint256 _amountOutMin = (_valueNeededUSDX96 *
      10 ** IERC20Metadata(_token1).decimals()) / _price1USDX96;
    uint256 _token0Bal = IERC20(_token0).balanceOf(address(this));
    uint256 _amountInFinal = _token0Bal < _amountIn ? _token0Bal : _amountIn;
    uint256 _amountOutMinFinal = (_amountInFinal * _amountOutMin) / _amountIn;
    if (_amountInFinal == 0 || _amountOutMinFinal == 0) {
      return;
    }
    _v3SwapTokensForTokens(
      _token0,
      _token1,
      _amountInFinal,
      (_amountOutMinFinal * (1000 - rebalanceSlippage)) / 1000
    );
  }

  function _v3SwapTokensForTokens(
    address _tokenIn,
    address _tokenOut,
    uint256 _amountIn,
    uint256 _amountOutMin
  ) internal {
    IUniswapV3Pool _pool0 = IUniswapV3Pool(
      indexTokens[_fundTokenIdx[_tokenIn]].c1
    );
    IUniswapV3Pool _pool1 = IUniswapV3Pool(
      indexTokens[_fundTokenIdx[_tokenOut]].c1
    );
    IERC20(_tokenIn).safeIncreaseAllowance(V3_ROUTER, _amountIn);
    bytes memory _path = abi.encodePacked(
      _tokenIn,
      _pool0.fee(),
      WETH,
      _pool1.fee(),
      _tokenOut
    );
    if (_tokenIn == WETH) {
      _path = abi.encodePacked(_tokenIn, _pool1.fee(), _tokenOut);
    } else if (_tokenOut == WETH) {
      _path = abi.encodePacked(_tokenIn, _pool0.fee(), _tokenOut);
    }
    ISwapRouter(V3_ROUTER).exactInput(
      ISwapRouter.ExactInputParams({
        path: _path,
        recipient: address(this),
        deadline: block.timestamp,
        amountIn: _amountIn,
        amountOutMinimum: _amountOutMin
      })
    );
  }

  function _rebalance() internal {
    uint256[] memory _balances = new uint256[](indexTokens.length);
    uint256[] memory _pricesUSDX96 = new uint256[](indexTokens.length);
    uint256[] memory _currentValueUSDX96 = new uint256[](indexTokens.length);
    uint256[] memory _perTokenRatioInIdxX96 = new uint256[](indexTokens.length);
    uint256 _totalValueUSDX96;
    uint256 _ratioSumX96;
    for (uint256 _i; _i < indexTokens.length; _i++) {
      (
        _balances[_i],
        _pricesUSDX96[_i],
        _currentValueUSDX96[_i]
      ) = _getTokenBalPriceAndCurrentValueUSDX96(indexTokens[_i]);
      _totalValueUSDX96 += _currentValueUSDX96[_i];
      _perTokenRatioInIdxX96[_i] =
        (FixedPoint96.Q96 * _pricesUSDX96[_i]) /
        indexTokens[_i].basePriceUSDX96;
      _ratioSumX96 += _perTokenRatioInIdxX96[_i];
    }

    for (uint256 _i; _i < indexTokens.length; _i++) {
      uint256 _valuePerIUSDX96 = (_totalValueUSDX96 *
        _perTokenRatioInIdxX96[_i]) / _ratioSumX96;
      if (
        _currentValueUSDX96[_i] < _valuePerIUSDX96 &&
        _valuePerIUSDX96 - _currentValueUSDX96[_i] > rebalanceMinSwapUSDX96
      ) {
        for (uint256 _j; _j < indexTokens.length; _j++) {
          if (_i == _j) {
            continue;
          }
          uint256 _valuePerJUSDX96 = (_totalValueUSDX96 *
            _perTokenRatioInIdxX96[_j]) / _ratioSumX96;
          if (
            _currentValueUSDX96[_j] > _valuePerJUSDX96 &&
            _currentValueUSDX96[_j] - _valuePerJUSDX96 > rebalanceMinSwapUSDX96
          ) {
            _swapIndexToken0ForToken1(
              indexTokens[_j].token,
              indexTokens[_i].token,
              _pricesUSDX96[_j],
              _pricesUSDX96[_i],
              _currentValueUSDX96[_j] - _valuePerJUSDX96
            );
            (
              _balances[_j],
              _pricesUSDX96[_j],
              _currentValueUSDX96[_j]
            ) = _getTokenBalPriceAndCurrentValueUSDX96(indexTokens[_j]);
            (
              _balances[_i],
              _pricesUSDX96[_i],
              _currentValueUSDX96[_i]
            ) = _getTokenBalPriceAndCurrentValueUSDX96(indexTokens[_i]);
            if (_currentValueUSDX96[_i] >= _valuePerIUSDX96) {
              break;
            }
          }
        }
      }
    }
    emit Rebalance();
  }

  function _getTokenBalPriceAndCurrentValueUSDX96(
    IndexAssetInfo memory _poolConf
  )
    internal
    view
    returns (uint256 _balance, uint256 _priceX96, uint256 _valueUSDX96)
  {
    _priceX96 = V3_TWAP_UTILS.getPoolPriceUSDX96(
      _poolConf.c1,
      V3_WETH_STABLE_POOL,
      WETH
    );
    _balance = IERC20(_poolConf.token).balanceOf(address(this));
    _valueUSDX96 =
      (_balance * _priceX96) /
      10 ** IERC20Metadata(_poolConf.token).decimals();
  }

  function rebalance() external {
    _rebalance();
  }

  function bond(address _token, uint256 _amount) external override noSwap {
    require(_isTokenInIndex[_token], 'INVALIDTOKEN');
    _transferAndValidate(IERC20(_token), _msgSender(), _amount);
    uint256 _tokenPriceUSDX96 = V3_TWAP_UTILS.getPoolPriceUSDX96(
      indexTokens[_fundTokenIdx[_token]].c1,
      V3_WETH_STABLE_POOL,
      WETH
    );
    (, uint256 _currentIdxPriceUSDX96) = getIdxPriceUSDX96();
    uint256 _tokensMinted = (_tokenPriceUSDX96 * _amount * 10 ** decimals()) /
      _currentIdxPriceUSDX96 /
      10 ** IERC20Metadata(_token).decimals();
    uint256 _feeTokens = _isFirstIn() ? 0 : (_tokensMinted * BOND_FEE) / 10000;
    _mint(_msgSender(), _tokensMinted - _feeTokens);
    if (_feeTokens > 0) {
      _mint(address(this), _feeTokens);
    }
    _rebalance();
    emit Bond(_msgSender(), _token, _amount, _tokensMinted);
  }

  function debond(
    uint256 _amount,
    address[] memory _token,
    uint8[] memory _percentage // 1 - 100%
  ) external override noSwap {
    require(_token.length == _percentage.length, 'INSYNC');
    uint256 _amountAfterFee = _isLastOut(_amount)
      ? _amount
      : (_amount * (10000 - DEBOND_FEE)) / 10000;
    _transfer(_msgSender(), address(this), _amount);
    _burn(address(this), _amountAfterFee);
    (, uint256 _currentIdxPriceUSDX96) = getIdxPriceUSDX96();
    uint256 _usdToDebondX96 = (_currentIdxPriceUSDX96 * _amountAfterFee) /
      10 ** decimals();
    uint8 _totalPercentage;
    for (uint256 _i; _i < _token.length; _i++) {
      require(_isTokenInIndex[_token[_i]], 'INVALIDTOKEN');
      _totalPercentage += _percentage[_i];
      uint256 _usdX96 = (_usdToDebondX96 * _percentage[_i]) / 100;
      uint256 _poolIdx = _fundTokenIdx[_token[_i]];
      IERC20(_token[_i]).safeTransfer(
        _msgSender(),
        (_usdX96 * 10 ** IERC20Metadata(_token[_i]).decimals()) /
          V3_TWAP_UTILS.getPoolPriceUSDX96(
            indexTokens[_poolIdx].c1,
            V3_WETH_STABLE_POOL,
            WETH
          )
      );
    }
    require(_totalPercentage == 100, 'TOTAL');
    _rebalance();
    emit Debond(_msgSender(), _amount);
  }

  function getTokenPriceUSDX96(
    address _token
  ) external view override returns (uint256) {
    require(_isTokenInIndex[_token], 'EXISTS');
    uint256 _idx = _fundTokenIdx[_token];
    return
      V3_TWAP_UTILS.getPoolPriceUSDX96(
        indexTokens[_idx].c1,
        V3_WETH_STABLE_POOL,
        WETH
      );
  }

  function getIdxPriceUSDX96() public view override returns (uint256, uint256) {
    uint256 _ratioSumX96;
    for (uint256 _i; _i < indexTokens.length; _i++) {
      _ratioSumX96 +=
        (FixedPoint96.Q96 *
          V3_TWAP_UTILS.getPoolPriceUSDX96(
            indexTokens[_i].c1,
            V3_WETH_STABLE_POOL,
            WETH
          )) /
        indexTokens[_i].basePriceUSDX96;
    }
    return (_ratioSumX96, _ratioSumX96 / indexTokens.length);
  }

  function setRebalanceSlippage(uint256 _slippage) external onlyOwner {
    rebalanceSlippage = _slippage;
  }

  function setRebalanceMinSwapUSDX96(uint256 _usdX96) external onlyOwner {
    rebalanceMinSwapUSDX96 = _usdX96;
  }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint256","name":"_bondFee","type":"uint256"},{"internalType":"uint256","name":"_debondFee","type":"uint256"},{"internalType":"address[]","name":"_pools","type":"address[]"},{"internalType":"address","name":"_lpRewardsToken","type":"address"},{"internalType":"address","name":"_v2Router","type":"address"},{"internalType":"address","name":"_v3StableWETHPool","type":"address"},{"internalType":"address","name":"_dai","type":"address"},{"internalType":"bool","name":"_stakeRestriction","type":"bool"},{"internalType":"contract IV3TwapUtilities","name":"_v3TwapUtilities","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountTokens","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountDAI","type":"uint256"}],"name":"AddLiquidity","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"wallet","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountTokensBonded","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountTokensMinted","type":"uint256"}],"name":"Bond","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newIdx","type":"address"},{"indexed":true,"internalType":"address","name":"wallet","type":"address"}],"name":"Create","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountDebonded","type":"uint256"}],"name":"Debond","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"executor","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FlashLoan","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[],"name":"Rebalance","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"wallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountLiquidity","type":"uint256"}],"name":"RemoveLiquidity","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"BOND_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEBOND_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FLASH_FEE_DAI","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_idxLPTokens","type":"uint256"},{"internalType":"uint256","name":"_daiLPTokens","type":"uint256"},{"internalType":"uint256","name":"_slippage","type":"uint256"}],"name":"addLiquidityV2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"bond","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"created","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address[]","name":"_token","type":"address[]"},{"internalType":"uint8[]","name":"_percentage","type":"uint8[]"}],"name":"debond","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"flash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAllAssets","outputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"weighting","type":"uint256"},{"internalType":"uint256","name":"basePriceUSDX96","type":"uint256"},{"internalType":"address","name":"c1","type":"address"},{"internalType":"uint256","name":"q1","type":"uint256"}],"internalType":"struct IDecentralizedIndex.IndexAssetInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getIdxPriceUSDX96","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"getTokenPriceUSDX96","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"indexTokens","outputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"weighting","type":"uint256"},{"internalType":"uint256","name":"basePriceUSDX96","type":"uint256"},{"internalType":"address","name":"c1","type":"address"},{"internalType":"uint256","name":"q1","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"indexType","outputs":[{"internalType":"enum IDecentralizedIndex.IndexType","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"isAsset","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lpRewardsToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lpStakingPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rebalanceMinSwapUSDX96","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebalanceSlippage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lpTokens","type":"uint256"},{"internalType":"uint256","name":"_minIdxTokens","type":"uint256"},{"internalType":"uint256","name":"_minDAI","type":"uint256"}],"name":"removeLiquidityV2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"rescueERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rescueETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_usdX96","type":"uint256"}],"name":"setRebalanceMinSwapUSDX96","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slippage","type":"uint256"}],"name":"setRebalanceSlippage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

610180604052600c805461ff001916610100179055600a600d556c01000000000000000000000000600e553480156200003757600080fd5b5060405162008fab38038062008fab8339810160408190526200005a91620009c5565b8a8a8a8a8989888888888881600390805190602001906200007d929190620007cb565b50805162000093906004906020840190620007cb565b50506005805460ff191660121790555042600655608087905260a0869052600880546001600160a01b038088166001600160a01b0319909216919091179091556001600160601b0319606086901b1660c0526040805163c45a015560e01b8152905160009287169163c45a0155916004808301926020929190829003018186803b1580156200012157600080fd5b505afa15801562000136573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200015c91906200099f565b6001600160a01b031663c9c6539630866040518363ffffffff1660e01b81526004016200018b92919062000b87565b602060405180830381600087803b158015620001a657600080fd5b505af1158015620001bb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001e191906200099f565b905089604051602001620001f6919062000b2b565b6040516020818303038152906040528960405160200162000218919062000b5c565b60408051601f19818403018152919052600854869084906001600160a01b0316876200024657600062000250565b62000250620007c7565b876040516200025f9062000860565b62000271979695949392919062000bc4565b604051809103906000f0801580156200028e573d6000803e3d6000fd5b50600780546001600160a01b039283166001600160a01b03199091161790556001600160601b0319606083811b821660e05286901b1661010052604080516315ab88c960e31b815290519187169163ad5c464891600480820192602092909190829003018186803b1580156200030357600080fd5b505afa15801562000318573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200033e91906200099f565b6001600160601b0319606091821b8116610120529083901b166101405262000365620007c7565b6001600160a01b0316306001600160a01b03167f96b5b9b8a7193304150caccf9b80d150675fa3d6af57761d8d8ef1d6f9a1a90960405160405180910390a3505050505050505050506000620003c0620007c760201b60201c565b600c805462010000600160b01b031916620100006001600160a01b03841690810291909117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506005805461ff001916610100179055606084901b6001600160601b03191661016052604080516315ab88c960e31b815290516000916001600160a01b0388169163ad5c464891600480820192602092909190829003018186803b1580156200047f57600080fd5b505afa15801562000494573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004ba91906200099f565b905060005b8851811015620007b4576000898281518110620004d857fe5b602002602001015190506000846001600160a01b031663b5ed44638c85815181106200050057fe5b60200260200101518a876040518463ffffffff1660e01b81526004016200052a9392919062000ba1565b60206040518083038186803b1580156200054357600080fd5b505afa15801562000558573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200057e919062000ae4565b90506000826001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b158015620005bc57600080fd5b505afa158015620005d1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620005f791906200099f565b90506000896001600160a01b03168d86815181106200061257fe5b60200260200101516001600160a01b031614620006c557856001600160a01b0316826001600160a01b0316146200064a5781620006bf565b836001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156200068457600080fd5b505afa15801562000699573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620006bf91906200099f565b620006c7565b855b905060096040518060a00160405280836001600160a01b03168152602001600081526020018581526020018f8881518110620006ff57fe5b6020908102919091018101516001600160a01b0390811683526000928201839052845460018181018755958452828420855160059092020180549183166001600160a01b03199283161781558584015181880155604080870151600283015560608701516003830180549186169190941617909255608090950151600490950194909455949094168152600b8452818120889055600a909352909120805460ff191682179055939093019250620004bf915050565b5050505050505050505050505062000c99565b3390565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826200080357600085556200084e565b82601f106200081e57805160ff19168380011785556200084e565b828001600101855582156200084e579182015b828111156200084e57825182559160200191906001019062000831565b506200085c9291506200086e565b5090565b6133f98062005bb283390190565b5b808211156200085c57600081556001016200086f565b8051620008928162000c80565b919050565b600082601f830112620008a8578081fd5b815160206001600160401b03821115620008be57fe5b808202620008ce82820162000c29565b838152828101908684018388018501891015620008e9578687fd5b8693505b8584101562000918578051620009038162000c80565b835260019390930192918401918401620008ed565b50979650505050505050565b805180151581146200089257600080fd5b600082601f83011262000946578081fd5b81516001600160401b038111156200095a57fe5b6200096f601f8201601f191660200162000c29565b81815284602083860101111562000984578283fd5b6200099782602083016020870162000c4d565b949350505050565b600060208284031215620009b1578081fd5b8151620009be8162000c80565b9392505050565b60008060008060008060008060008060006101608c8e031215620009e7578687fd5b8b516001600160401b03811115620009fd578788fd5b62000a0b8e828f0162000935565b60208e0151909c5090506001600160401b0381111562000a29578788fd5b62000a378e828f0162000935565b9a505060408c0151985060608c0151975060808c015160018060401b0381111562000a60578788fd5b62000a6e8e828f0162000897565b97505062000a7f60a08d0162000885565b955062000a8f60c08d0162000885565b945062000a9f60e08d0162000885565b935062000ab06101008d0162000885565b925062000ac16101208d0162000924565b915062000ad26101408d0162000885565b90509295989b509295989b9093969950565b60006020828403121562000af6578081fd5b5051919050565b6000815180845262000b1781602086016020860162000c4d565b601f01601f19169290920160200192915050565b600066029ba30b5b2b2160cd1b8252825162000b4f81600785016020870162000c4d565b9190910160070192915050565b6000607360f81b8252825162000b7a81600185016020870162000c4d565b9190910160010192915050565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b0393841681529183166020830152909116604082015260600190565b600060e0825262000bd960e083018a62000afd565b828103602084015262000bed818a62000afd565b6001600160a01b03988916604085015296881660608401525050928516608084015290841660a083015290921660c09092019190915292915050565b6040518181016001600160401b038111828210171562000c4557fe5b604052919050565b60005b8381101562000c6a57818101518382015260200162000c50565b8381111562000c7a576000848401525b50505050565b6001600160a01b038116811462000c9657600080fd5b50565b60805160a05160c05160601c60e05160601c6101005160601c6101205160601c6101405160601c6101605160601c614dcd62000de56000398061165152806118c6528061209d528061237052806138c15250806106be52806115df528061185e5280611ebd528061203352806122fe528061388d52508061167352806118e852806120bf528061239252806138e25280613e165280613ece5280613fa3525080610a1452806111275280611215528061124a52806112c352806113bc528061146b52806114fa5280611b835280611c1c52806134a152806136385250806107ed52806108ca5280610966528061099b5280610acd5280610b7c5280610c0b528061296c52806129ba5250806109bd52806109e452806111db528061126c528061129b52806134f352806135af525080611e3d52806121a2525080611a2052806126735250614dcd6000f3fe6080604052600436106102295760003560e01c80637d7c2a1c11610123578063a9059cbb116100ab578063d757a9fb1161006f578063d757a9fb1461061b578063dd62ed3e1461063b578063ee9c79da1461065b578063f2fde38b1461067b578063ff140ca61461069b57610239565b8063a9059cbb14610586578063bdbc91ab146105a6578063bdc8d060146105c6578063c87fa42a146105db578063ccec3716146105fb57610239565b806394cc699e116100f257806394cc699e146104f957806395b3921e1461050e57806395d89b4114610531578063a457c2d714610546578063a515366a1461056657610239565b80637d7c2a1c1461049a5780638071c8ec146104af57806389fce6e6146104cf5780638da5cb5b146104e457610239565b8063313ce567116101b15780634b6f1649116101755780634b6f16491461040c57806353f504471461042157806358f4dcc31461044357806370a0823114610465578063715018a61461048557610239565b8063313ce56714610364578063325a19f114610386578063395093511461039b57806344305374146103bb5780634a437f88146103db57610239565b806320800a00116101f857806320800a00146102d857806323b872dd146102ed5780632834669b1461030d5780632acada4d1461032d5780632e688f8a1461034f57610239565b806306917a541461023e57806306fdde031461025e578063095ea7b31461028957806318160ddd146102b657610239565b3661023957610237346106b0565b005b600080fd5b34801561024a57600080fd5b50610237610259366004614611565b6107d4565b34801561026a57600080fd5b50610273610c91565b604051610280919061493f565b60405180910390f35b34801561029557600080fd5b506102a96102a43660046144a5565b610d27565b60405161028091906148e8565b3480156102c257600080fd5b506102cb610d44565b6040516102809190614936565b3480156102e457600080fd5b50610237610d4a565b3480156102f957600080fd5b506102a96103083660046143cb565b610d75565b34801561031957600080fd5b506102376103283660046144f3565b610dfd565b34801561033957600080fd5b50610342610e64565b604051610280919061486c565b34801561035b57600080fd5b506102cb610efb565b34801561037057600080fd5b50610379610f01565b6040516102809190614b72565b34801561039257600080fd5b506102cb610f0a565b3480156103a757600080fd5b506102a96103b63660046144a5565b610f10565b3480156103c757600080fd5b506102376103d63660046144f3565b610f5e565b3480156103e757600080fd5b506103fb6103f63660046144f3565b610fc5565b604051610280959493929190614839565b34801561041857600080fd5b506102cb611012565b34801561042d57600080fd5b50610436611017565b6040516102809190614922565b34801561044f57600080fd5b50610458611025565b6040516102809190614760565b34801561047157600080fd5b506102cb61048036600461435b565b611034565b34801561049157600080fd5b5061023761104f565b3480156104a657600080fd5b50610237611103565b3480156104bb57600080fd5b506102376104ca366004614611565b61110b565b3480156104db57600080fd5b506102cb611583565b3480156104f057600080fd5b50610458611589565b34801561050557600080fd5b5061045861159e565b34801561051a57600080fd5b506105236115ad565b604051610280929190614b64565b34801561053d57600080fd5b5061027361171e565b34801561055257600080fd5b506102a96105613660046144a5565b61177f565b34801561057257600080fd5b506102376105813660046144a5565b6117e7565b34801561059257600080fd5b506102a96105a13660046144a5565b611ae2565b3480156105b257600080fd5b506102376105c136600461440b565b611af6565b3480156105d257600080fd5b506102cb611e3b565b3480156105e757600080fd5b506102a96105f636600461435b565b611e5f565b34801561060757600080fd5b5061023761061636600461435b565b611e7d565b34801561062757600080fd5b506102cb61063636600461435b565b611fd9565b34801561064757600080fd5b506102cb610656366004614393565b612137565b34801561066757600080fd5b50610237610676366004614523565b612162565b34801561068757600080fd5b5061023761069636600461435b565b612560565b3480156106a757600080fd5b506102cb612671565b806106ba576107d1565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561071557600080fd5b505afa158015610729573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074d9190614377565b6001600160a01b0316826040516107639061475d565b60006040518083038185875af1925050503d80600081146107a0576040519150601f19603f3d011682016040523d82523d6000602084013e6107a5565b606091505b50509050806107cf5760405162461bcd60e51b81526004016107c690614a38565b60405180910390fd5b505b50565b600c805461ff001916905582156107eb578261088e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231610822612695565b6040518263ffffffff1660e01b815260040161083e9190614760565b60206040518083038186803b15801561085657600080fd5b505afa15801561086a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088e919061450b565b9250600083116108b05760405162461bcd60e51b81526004016107c690614a19565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a08231906108ff903090600401614760565b60206040518083038186803b15801561091757600080fd5b505afa15801561092b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094f919061450b565b905061098e61095c612695565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016903087612699565b6109e26001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f0000000000000000000000000000000000000000000000000000000000000000866126f9565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663baa2abde307f0000000000000000000000000000000000000000000000000000000000000000878787610a3e612695565b426040518863ffffffff1660e01b8152600401610a619796959493929190614774565b6040805180830381600087803b158015610a7a57600080fd5b505af1158015610a8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab291906145ee565b50506040516370a0823160e01b815281906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190610b02903090600401614760565b60206040518083038186803b158015610b1a57600080fd5b505afa158015610b2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b52919061450b565b1115610c3457610c34610b63612695565b6040516370a0823160e01b815283906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190610bb1903090600401614760565b60206040518083038186803b158015610bc957600080fd5b505afa158015610bdd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c01919061450b565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016929190036127e4565b610c3c612695565b6001600160a01b03167fdfdd120ded9b7afc0c23dd5310e93aaa3e1c3b9f75af9b805fab3030842439f285604051610c749190614936565b60405180910390a25050600c805461ff0019166101001790555050565b60038054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610d1d5780601f10610cf257610100808354040283529160200191610d1d565b820191906000526020600020905b815481529060010190602001808311610d0057829003601f168201915b5050505050905090565b6000610d3b610d34612695565b848461283b565b50600192915050565b60025490565b60004711610d6a5760405162461bcd60e51b81526004016107c690614976565b610d73476106b0565b565b6000610d82848484612927565b610df284610d8e612695565b610ded85604051806060016040528060288152602001614cc0602891396001600160a01b038a16600090815260016020526040812090610dcc612695565b6001600160a01b031681526020810191909152604001600020549190612a3e565b61283b565b5060015b9392505050565b610e05612695565b6001600160a01b0316610e16611589565b6001600160a01b031614610e5f576040805162461bcd60e51b81526020600482018190526024820152600080516020614ce8833981519152604482015290519081900360640190fd5b600e55565b60606009805480602002602001604051908101604052809291908181526020016000905b82821015610ef25760008481526020908190206040805160a0810182526005860290920180546001600160a01b0390811684526001808301548587015260028301549385019390935260038201541660608401526004015460808301529083529092019101610e88565b50505050905090565b600e5481565b60055460ff1690565b60065481565b6000610d3b610f1d612695565b84610ded8560016000610f2e612695565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490612ad5565b610f66612695565b6001600160a01b0316610f77611589565b6001600160a01b031614610fc0576040805162461bcd60e51b81526020600482018190526024820152600080516020614ce8833981519152604482015290519081900360640190fd5b600d55565b60098181548110610fd557600080fd5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b03938416955091939092169085565b600a81565b600554610100900460ff1681565b6008546001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b611057612695565b6001600160a01b0316611068611589565b6001600160a01b0316146110b1576040805162461bcd60e51b81526020600482018190526024820152600080516020614ce8833981519152604482015290519081900360640190fd5b600c546040516000916201000090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600c805462010000600160b01b0319169055565b610d73612b2f565b600c805461ff0019169055600061112130611034565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016111719190614760565b60206040518083038186803b15801561118957600080fd5b505afa15801561119d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c1919061450b565b90506111d56111ce612695565b3087612927565b611200307f00000000000000000000000000000000000000000000000000000000000000008761283b565b61123d61120b612695565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016903087612699565b6112916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f0000000000000000000000000000000000000000000000000000000000000000866126f9565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663e8e33700307f000000000000000000000000000000000000000000000000000000000000000088886103e88981038302046103e88a81038c02046112fe612695565b426040518963ffffffff1660e01b81526004016113229897969594939291906147b4565b606060405180830381600087803b15801561133c57600080fd5b505af1158015611350573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611374919061463c565b5050508161138130611034565b11156113a3576113a330611393612695565b8461139d30611034565b03612927565b6040516370a0823160e01b815281906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a08231906113f1903090600401614760565b60206040518083038186803b15801561140957600080fd5b505afa15801561141d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611441919061450b565b111561152357611523611452612695565b6040516370a0823160e01b815283906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a08231906114a0903090600401614760565b60206040518083038186803b1580156114b857600080fd5b505afa1580156114cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f0919061450b565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016929190036127e4565b61152b612695565b6001600160a01b03167f06239653922ac7bea6aa2b19dc486b9361821d37712eb796adfd38d81de278ca8686604051611565929190614b64565b60405180910390a25050600c805461ff001916610100179055505050565b600d5481565b600c546201000090046001600160a01b031690565b6007546001600160a01b031681565b6000806000805b60095481101561170657600981815481106115cb57fe5b9060005260206000209060050201600201547f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b5ed44636009848154811061161957fe5b60009182526020909120600360059092020101546040516001600160e01b031960e084901b16815261169b916001600160a01b0316907f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000906004016147fd565b60206040518083038186803b1580156116b357600080fd5b505afa1580156116c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116eb919061450b565b600160601b02816116f857fe5b0491909101906001016115b4565b506009548190818161171457fe5b0492509250509091565b60048054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610d1d5780601f10610cf257610100808354040283529160200191610d1d565b6000610d3b61178c612695565b84610ded85604051806060016040528060258152602001614d9c60259139600160006117b6612695565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190612a3e565b600c805461ff00191690556001600160a01b0382166000908152600a602052604090205460ff1661182a5760405162461bcd60e51b81526004016107c690614a56565b61183c82611836612695565b8361304f565b6001600160a01b038281166000908152600b60205260408120546009805492937f0000000000000000000000000000000000000000000000000000000000000000169263b5ed44639290811061188e57fe5b60009182526020909120600360059092020101546040516001600160e01b031960e084901b168152611910916001600160a01b0316907f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000906004016147fd565b60206040518083038186803b15801561192857600080fd5b505afa15801561193c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611960919061450b565b9050600061196c6115ad565b9150506000846001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156119aa57600080fd5b505afa1580156119be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e29190614669565b60ff16600a0a826119f1610f01565b60ff16600a0a8686020281611a0257fe5b0481611a0a57fe5b0490506000611a17613183565b611a47576127107f0000000000000000000000000000000000000000000000000000000000000000830204611a4a565b60005b9050611a5f611a57612695565b828403613193565b8015611a6f57611a6f3082613193565b611a77612b2f565b856001600160a01b0316611a89612695565b6001600160a01b03167fad49529616fd9fe4b34e00ac3f98d5cc3531e1232a95f249113b23fdf13c7e858785604051611ac3929190614b64565b60405180910390a35050600c805461ff00191661010017905550505050565b6000610d3b611aef612695565b8484612927565b600754604080516345e35f5960e11b815290516000926001600160a01b031691638bc6beb2916004808301926020929190829003018186803b158015611b3b57600080fd5b505afa158015611b4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b739190614377565b9050611c4d611b80612695565b827f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015611bda57600080fd5b505afa158015611bee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c129190614669565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692919060ff16600a90810a02612699565b6040516370a0823160e01b81526000906001600160a01b038716906370a0823190611c7c903090600401614760565b60206040518083038186803b158015611c9457600080fd5b505afa158015611ca8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ccc919061450b565b9050611ce26001600160a01b03871688876127e4565b604051633a62959560e21b81526001600160a01b0388169063e98a565490611d1090879087906004016148f3565b600060405180830381600087803b158015611d2a57600080fd5b505af1158015611d3e573d6000803e3d6000fd5b50506040516370a0823160e01b81528392506001600160a01b03891691506370a0823190611d70903090600401614760565b60206040518083038186803b158015611d8857600080fd5b505afa158015611d9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dc0919061450b565b1015611dde5760405162461bcd60e51b81526004016107c690614952565b866001600160a01b0316611df0612695565b6001600160a01b03167f5a9eeaf8949838813289046091e8ea8a9196a2265ac24841464a2d27026a85498888604051611e2a929190614820565b60405180910390a350505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6001600160a01b03166000908152600a602052604090205460ff1690565b611e8681611e5f565b158015611e9c57506001600160a01b0381163014155b611eb85760405162461bcd60e51b81526004016107c6906149d4565b6107d17f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b158015611f1457600080fd5b505afa158015611f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f4c9190614377565b6040516370a0823160e01b81526001600160a01b038416906370a0823190611f78903090600401614760565b60206040518083038186803b158015611f9057600080fd5b505afa158015611fa4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fc8919061450b565b6001600160a01b03841691906127e4565b6001600160a01b0381166000908152600a602052604081205460ff166120115760405162461bcd60e51b81526004016107c690614995565b6001600160a01b038083166000908152600b60205260409020546009805491927f0000000000000000000000000000000000000000000000000000000000000000169163b5ed446391908490811061206557fe5b60009182526020909120600360059092020101546040516001600160e01b031960e084901b1681526120e7916001600160a01b0316907f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000906004016147fd565b60206040518083038186803b1580156120ff57600080fd5b505afa158015612113573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df6919061450b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600c805461ff0019169055805182511461218e5760405162461bcd60e51b81526004016107c690614a7c565b600061219984613283565b6121cb576127107f000000000000000000000000000000000000000000000000000000000000000081038502046121cd565b835b90506121e16121da612695565b3086612927565b6121eb30826132a3565b60006121f56115ad565b9150506000612202610f01565b60ff16600a0a8383028161221257fe5b0490506000805b86518110156124d457600a600088838151811061223257fe5b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff166122755760405162461bcd60e51b81526004016107c690614a56565b85818151811061228157fe5b6020026020010151820191506000606487838151811061229d57fe5b602002602001015160ff168502816122b157fe5b0490506000600b60008a85815181106122c657fe5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000205490506124ca6122fc612695565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b5ed44636009858154811061233857fe5b60009182526020909120600360059092020101546040516001600160e01b031960e084901b1681526123ba916001600160a01b0316907f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000906004016147fd565b60206040518083038186803b1580156123d257600080fd5b505afa1580156123e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061240a919061450b565b8b868151811061241657fe5b60200260200101516001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561245657600080fd5b505afa15801561246a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061248e9190614669565b60ff16600a0a85028161249d57fe5b048b86815181106124aa57fe5b60200260200101516001600160a01b03166127e49092919063ffffffff16565b5050600101612219565b508060ff166064146124f85760405162461bcd60e51b81526004016107c6906149b5565b612500612b2f565b612508612695565b6001600160a01b03167fe4bf69c2fff7ace5eed72842e9abf52af2218a3a78cb83d7824f999dbfd75e71886040516125409190614936565b60405180910390a25050600c805461ff0019166101001790555050505050565b612568612695565b6001600160a01b0316612579611589565b6001600160a01b0316146125c2576040805162461bcd60e51b81526020600482018190526024820152600080516020614ce8833981519152604482015290519081900360640190fd5b6001600160a01b0381166126075760405162461bcd60e51b8152600401808060200182810382526026815260200180614c2c6026913960400191505060405180910390fd5b600c546040516001600160a01b038084169262010000900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600c80546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b7f000000000000000000000000000000000000000000000000000000000000000081565b3390565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526126f390859061339f565b50505050565b600061278f82856001600160a01b031663dd62ed3e30876040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b15801561275d57600080fd5b505afa158015612771573d6000803e3d6000fd5b505050506040513d602081101561278757600080fd5b505190612ad5565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b1790529091506126f390859061339f565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261283690849061339f565b505050565b6001600160a01b0383166128805760405162461bcd60e51b8152600401808060200182810382526024815260200180614d4e6024913960400191505060405180910390fd5b6001600160a01b0382166128c55760405162461bcd60e51b8152600401808060200182810382526022815260200180614c526022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600c54610100900460ff1680156129415750600c5460ff16155b15612a3357600061295130611034565b90506000612710612960610d44565b8161296757fe5b0490507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316856001600160a01b0316141580156129ac5750808210155b80156129e0575060006129de7f0000000000000000000000000000000000000000000000000000000000000000611034565b115b15612a3057600c805460ff19166001179055612a2560648202831015612a1b5781601402831015612a115781612a16565b816014025b612a20565b816064025b613450565b600c805460ff191690555b50505b61283683838361372b565b60008184841115612acd5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612a92578181015183820152602001612a7a565b50505050905090810190601f168015612abf5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610df6576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60095460009067ffffffffffffffff81118015612b4b57600080fd5b50604051908082528060200260200182016040528015612b75578160200160208202803683370190505b5060095490915060009067ffffffffffffffff81118015612b9557600080fd5b50604051908082528060200260200182016040528015612bbf578160200160208202803683370190505b5060095490915060009067ffffffffffffffff81118015612bdf57600080fd5b50604051908082528060200260200182016040528015612c09578160200160208202803683370190505b5060095490915060009067ffffffffffffffff81118015612c2957600080fd5b50604051908082528060200260200182016040528015612c53578160200160208202803683370190505b50905060008060005b600954811015612db357612cd760098281548110612c7657fe5b60009182526020918290206040805160a081018252600590930290910180546001600160a01b039081168452600182015494840194909452600281015491830191909152600381015490921660608201526004909101546080820152613886565b898481518110612ce357fe5b60200260200101898581518110612cf657fe5b60200260200101898681518110612d0957fe5b6020908102919091010192909252919052528451859082908110612d2957fe5b60200260200101518301925060098181548110612d4257fe5b906000526020600020906005020160020154868281518110612d6057fe5b6020026020010151600160601b0281612d7557fe5b04848281518110612d8257fe5b602002602001018181525050838181518110612d9a57fe5b6020026020010151820191508080600101915050612c5c565b5060005b60095481101561301d57600082858381518110612dd057fe5b6020026020010151850281612de157fe5b04905080868381518110612df157fe5b6020026020010151108015612e1c5750600e54868381518110612e1057fe5b60200260200101518203115b156130145760005b6009548110156130125780831415612e3b5761300a565b600084878381518110612e4a57fe5b6020026020010151870281612e5b57fe5b04905080888381518110612e6b57fe5b6020026020010151118015612e965750600e5481898481518110612e8b57fe5b602002602001015103115b1561300857612f3860098381548110612eab57fe5b6000918252602090912060059091020154600980546001600160a01b039092169187908110612ed657fe5b60009182526020909120600590910201548b516001600160a01b03909116908c9086908110612f0157fe5b60200260200101518c8881518110612f1557fe5b6020026020010151858d8881518110612f2a57fe5b602002602001015103613a80565b612f4860098381548110612c7657fe5b8c8581518110612f5457fe5b602002602001018c8681518110612f6757fe5b602002602001018c8781518110612f7a57fe5b60200260200101838152508381525083815250505050612fa060098581548110612c7657fe5b8c8781518110612fac57fe5b602002602001018c8881518110612fbf57fe5b602002602001018c8981518110612fd257fe5b6020026020010183815250838152508381525050505082888581518110612ff557fe5b6020026020010151106130085750613012565b505b600101612e24565b505b50600101612db7565b506040517ff57243a1fddfdc9fa2c7de26cc3503b1b94cfd4368d2b82d0970bfbb2fbce3a490600090a1505050505050565b6040516370a0823160e01b81526000906001600160a01b038516906370a082319061307e903090600401614760565b60206040518083038186803b15801561309657600080fd5b505afa1580156130aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130ce919061450b565b90506130e56001600160a01b038516843085612699565b6040516370a0823160e01b8152818301906001600160a01b038616906370a0823190613115903090600401614760565b60206040518083038186803b15801561312d57600080fd5b505afa158015613141573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613165919061450b565b10156126f35760405162461bcd60e51b81526004016107c6906149f9565b600061318d610d44565b15905090565b6001600160a01b0382166131ee576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6131fa60008383612836565b6002546132079082612ad5565b6002556001600160a01b03821660009081526020819052604090205461322d9082612ad5565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000606461328f610d44565b6062028161329957fe5b0490911015919050565b6001600160a01b0382166132e85760405162461bcd60e51b8152600401808060200182810382526021815260200180614d086021913960400191505060405180910390fd5b6132f482600083612836565b61333181604051806060016040528060228152602001614c0a602291396001600160a01b0385166000908152602081905260409020549190612a3e565b6001600160a01b0383166000908152602081905260409020556002546133579082613c80565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b60006133f4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613cdd9092919063ffffffff16565b8051909150156128365780806020019051602081101561341357600080fd5b50516128365760405162461bcd60e51b815260040180806020018281038252602a815260200180614d72602a913960400191505060405180910390fd5b604080516002808252606082018352600092602083019080368337019050509050308160008151811061347f57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000000000000000000000000000000000000000000000816001815181106134cd57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050613518307f00000000000000000000000000000000000000000000000000000000000000008461283b565b600754604080516345e35f5960e11b815290516000926001600160a01b031691638bc6beb2916004808301926020929190829003018186803b15801561355d57600080fd5b505afa158015613571573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135959190614377565b604051635c11d79560e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635c11d795906135ed908690600090879087904290600401614af4565b600060405180830381600087803b15801561360757600080fd5b505af115801561361b573d6000803e3d6000fd5b50506040516370a0823160e01b8152600092506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691506370a082319061366e908590600401614760565b60206040518083038186803b15801561368657600080fd5b505afa15801561369a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136be919061450b565b905080156126f3576040516344ab194b60e01b81526001600160a01b038316906344ab194b906136f390600090600401614936565b600060405180830381600087803b15801561370d57600080fd5b505af1158015613721573d6000803e3d6000fd5b5050505050505050565b6001600160a01b0383166137705760405162461bcd60e51b8152600401808060200182810382526025815260200180614d296025913960400191505060405180910390fd5b6001600160a01b0382166137b55760405162461bcd60e51b8152600401808060200182810382526023815260200180614be76023913960400191505060405180910390fd5b6137c0838383612836565b6137fd81604051806060016040528060268152602001614c74602691396001600160a01b0386166000908152602081905260409020549190612a3e565b6001600160a01b03808516600090815260208190526040808220939093559084168152205461382c9082612ad5565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b5ed446385606001517f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006040518463ffffffff1660e01b815260040161391f939291906147fd565b60206040518083038186803b15801561393757600080fd5b505afa15801561394b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061396f919061450b565b84516040516370a0823160e01b81529193506001600160a01b0316906370a082319061399f903090600401614760565b60206040518083038186803b1580156139b757600080fd5b505afa1580156139cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139ef919061450b565b925083600001516001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015613a2e57600080fd5b505afa158015613a42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a669190614669565b60ff16600a0a82840281613a7657fe5b0490509193909250565b600083866001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015613abc57600080fd5b505afa158015613ad0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613af49190614669565b60ff16600a0a830281613b0357fe5b04905080613b115750613c79565b600083866001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015613b4d57600080fd5b505afa158015613b61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b859190614669565b60ff16600a0a840281613b9457fe5b0490506000876001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401613bc59190614760565b60206040518083038186803b158015613bdd57600080fd5b505afa158015613bf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c15919061450b565b90506000838210613c265783613c28565b815b905060008484830281613c3757fe5b049050811580613c45575080155b15613c54575050505050613c79565b613c738a8a846103e8600d546103e803860281613c6d57fe5b04613cf4565b50505050505b5050505050565b600082821115613cd7576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6060613cec848460008561411f565b949350505050565b6001600160a01b0384166000908152600b6020526040812054600980549091908110613d1c57fe5b60009182526020808320600360059093020191909101546001600160a01b038781168452600b90925260408320546009805493909216945090918110613d5e57fe5b60009182526020909120600360059092020101546001600160a01b039081169150613da090871673e592427a0aece92de3edee1f18e0157c05861564866126f9565b600086836001600160a01b031663ddca3f436040518163ffffffff1660e01b815260040160206040518083038186803b158015613ddc57600080fd5b505afa158015613df0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e1491906144d0565b7f0000000000000000000000000000000000000000000000000000000000000000846001600160a01b031663ddca3f436040518163ffffffff1660e01b815260040160206040518083038186803b158015613e6e57600080fd5b505afa158015613e82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ea691906144d0565b89604051602001613ebb95949392919061470b565b60405160208183030381529060405290507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b03161415613fa15786826001600160a01b031663ddca3f436040518163ffffffff1660e01b815260040160206040518083038186803b158015613f4057600080fd5b505afa158015613f54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f7891906144d0565b87604051602001613f8b939291906146d0565b6040516020818303038152906040529050614072565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b031614156140725786836001600160a01b031663ddca3f436040518163ffffffff1660e01b815260040160206040518083038186803b15801561401557600080fd5b505afa158015614029573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061404d91906144d0565b87604051602001614060939291906146d0565b60405160208183030381529060405290505b6040805160a08101825282815230602082015242818301526060810187905260808101869052905163c04b8d5960e01b815273e592427a0aece92de3edee1f18e0157c058615649163c04b8d59916140cd9190600401614a9c565b602060405180830381600087803b1580156140e757600080fd5b505af11580156140fb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613721919061450b565b6060824710156141605760405162461bcd60e51b8152600401808060200182810382526026815260200180614c9a6026913960400191505060405180910390fd5b6141698561427a565b6141ba576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b602083106141f85780518252601f1990920191602091820191016141d9565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461425a576040519150601f19603f3d011682016040523d82523d6000602084013e61425f565b606091505b509150915061426f828286614280565b979650505050505050565b3b151590565b6060831561428f575081610df6565b82511561429f5782518084602001fd5b60405162461bcd60e51b8152602060048201818152845160248401528451859391928392604401919085019080838360008315612a92578181015183820152602001612a7a565b600082601f8301126142f6578081fd5b8135602061430b61430683614ba4565b614b80565b8281528181019085830183850287018401881015614327578586fd5b855b8581101561434e57813561433c81614bd7565b84529284019290840190600101614329565b5090979650505050505050565b60006020828403121561436c578081fd5b8135610df681614bc2565b600060208284031215614388578081fd5b8151610df681614bc2565b600080604083850312156143a5578081fd5b82356143b081614bc2565b915060208301356143c081614bc2565b809150509250929050565b6000806000606084860312156143df578081fd5b83356143ea81614bc2565b925060208401356143fa81614bc2565b929592945050506040919091013590565b600080600080600060808688031215614422578081fd5b853561442d81614bc2565b9450602086013561443d81614bc2565b935060408601359250606086013567ffffffffffffffff80821115614460578283fd5b818801915088601f830112614473578283fd5b813581811115614481578384fd5b896020828501011115614492578384fd5b9699959850939650602001949392505050565b600080604083850312156144b7578182fd5b82356144c281614bc2565b946020939093013593505050565b6000602082840312156144e1578081fd5b815162ffffff81168114610df6578182fd5b600060208284031215614504578081fd5b5035919050565b60006020828403121561451c578081fd5b5051919050565b600080600060608486031215614537578283fd5b8335925060208085013567ffffffffffffffff80821115614556578485fd5b818701915087601f830112614569578485fd5b813561457761430682614ba4565b81815284810190848601868402860187018c1015614593578889fd5b8895505b838610156145be5780356145aa81614bc2565b835260019590950194918601918601614597565b509650505060408701359250808311156145d6578384fd5b50506145e4868287016142e6565b9150509250925092565b60008060408385031215614600578182fd5b505080516020909101519092909150565b600080600060608486031215614625578081fd5b505081359360208301359350604090920135919050565b600080600060608486031215614650578081fd5b8351925060208401519150604084015190509250925092565b60006020828403121561467a578081fd5b8151610df681614bd7565b60008151808452815b818110156146aa5760208185018101518683018201520161468e565b818111156146bb5782602083870101525b50601f01601f19169290920160200192915050565b606093841b6bffffffffffffffffffffffff19908116825260e89390931b6001600160e81b0319166014820152921b166017820152602b0190565b6bffffffffffffffffffffffff19606096871b811682526001600160e81b031960e896871b8116601484015294871b811660178301529290941b909216602b840152921b909116602e82015260420190565b90565b6001600160a01b0391909116815260200190565b6001600160a01b039788168152958716602087015260408601949094526060850192909252608084015290921660a082015260c081019190915260e00190565b6001600160a01b039889168152968816602088015260408701959095526060860193909352608085019190915260a084015290921660c082015260e08101919091526101000190565b6001600160a01b0393841681529183166020830152909116604082015260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039586168152602081019490945260408401929092529092166060820152608081019190915260a00190565b602080825282518282018190526000919060409081850190868401855b828110156148db57815180516001600160a01b03908116865287820151888701528682015187870152606080830151909116908601526080908101519085015260a09093019290850190600101614889565b5091979650505050505050565b901515815260200190565b60006020825282602083015282846040840137818301604090810191909152601f909201601f19160101919050565b602081016002831061493057fe5b91905290565b90815260200190565b600060208252610df66020830184614685565b6020808252600a9082015269232620a9a420a32a22a960b11b604082015260600190565b60208082526005908201526409c9e8aa8960db1b604082015260600190565b60208082526006908201526545584953545360d01b604082015260600190565b6020808252600590820152641513d5105360da1b604082015260600190565b6020808252600b908201526a554e415641494c41424c4560a81b604082015260600190565b60208082526006908201526515119495905360d21b604082015260600190565b6020808252600590820152644c5052454d60d81b604082015260600190565b60208082526004908201526314d1539560e21b604082015260600190565b6020808252600c908201526b24a72b20a624a22a27a5a2a760a11b604082015260600190565b602080825260069082015265494e53594e4360d01b604082015260600190565b600060208252825160a06020840152614ab860c0840182614685565b905060018060a01b0360208501511660408401526040840151606084015260608401516080840152608084015160a08401528091505092915050565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015614b435784516001600160a01b031683529383019391830191600101614b1e565b50506001600160a01b03969096166060850152505050608001529392505050565b918252602082015260400190565b60ff91909116815260200190565b60405181810167ffffffffffffffff81118282101715614b9c57fe5b604052919050565b600067ffffffffffffffff821115614bb857fe5b5060209081020190565b6001600160a01b03811681146107d157600080fd5b60ff811681146107d157600080fdfe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa164736f6c6343000706000a60806040523480156200001157600080fd5b50604051620033f9380380620033f9833981810160405260e08110156200003757600080fd5b81019080805160405193929190846401000000008211156200005857600080fd5b9083019060208201858111156200006e57600080fd5b82516401000000008111828201881017156200008957600080fd5b82525081516020918201929091019080838360005b83811015620000b85781810151838201526020016200009e565b50505050905090810190601f168015620000e65780820380516001836020036101000a031916815260200191505b50604052602001805160405193929190846401000000008211156200010a57600080fd5b9083019060208201858111156200012057600080fd5b82516401000000008111828201881017156200013b57600080fd5b82525081516020918201929091019080838360005b838110156200016a57818101518382015260200162000150565b50505050905090810190601f168015620001985780820380516001836020036101000a031916815260200191505b506040908152602082810151918301516060840151608085015160a09095015189519497509195509392909188918891620001d991600391850190620002e2565b508051620001ef906004906020840190620002e2565b50506005805460ff191660121790555062000209620002de565b60058054610100600160a81b0319166101006001600160a01b0393841602179055600680546001600160a01b031990811687841617909155600880549091169184169190911790556040518190869030908690620002679062000377565b6001600160a01b039485168152928416602084015290831660408084019190915292166060820152905190819003608001906000f080158015620002af573d6000803e3d6000fd5b50600780546001600160a01b0319166001600160a01b0392909216919091179055506200039c95505050505050565b3390565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826200031a576000855562000365565b82601f106200033557805160ff191683800117855562000365565b8280016001018555821562000365579182015b828111156200036557825182559160200191906001019062000348565b506200037392915062000385565b5090565b611b3880620018c183390190565b5b8082111562000373576000815560010162000386565b61151580620003ac6000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c80638bc6beb2116100ad578063adc9772e11610071578063adc9772e14610356578063c56e0ad814610382578063da0e1dab1461038a578063dba802d914610392578063dd62ed3e146103b857610121565b80638bc6beb2146102e657806390eb3911146102ee57806395d89b41146102f6578063a457c2d7146102fe578063a9059cbb1461032a57610121565b80632e17de78116100f45780632e17de7814610233578063313ce56714610252578063395093511461027057806370a082311461029c57806372f702f3146102c257610121565b806306fdde0314610126578063095ea7b3146101a357806318160ddd146101e357806323b872dd146101fd575b600080fd5b61012e6103e6565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101cf600480360360408110156101b957600080fd5b506001600160a01b03813516906020013561047c565b604080519115158252519081900360200190f35b6101eb610499565b60408051918252519081900360200190f35b6101cf6004803603606081101561021357600080fd5b506001600160a01b0381358116916020810135909116906040013561049f565b6102506004803603602081101561024957600080fd5b5035610527565b005b61025a6105a1565b6040805160ff9092168252519081900360200190f35b6101cf6004803603604081101561028657600080fd5b506001600160a01b0381351690602001356105aa565b6101eb600480360360208110156102b257600080fd5b50356001600160a01b03166105f8565b6102ca610613565b604080516001600160a01b039092168252519081900360200190f35b6102ca610622565b6102ca610631565b61012e610645565b6101cf6004803603604081101561031457600080fd5b506001600160a01b0381351690602001356106a6565b6101cf6004803603604081101561034057600080fd5b506001600160a01b03813516906020013561070e565b6102506004803603604081101561036c57600080fd5b506001600160a01b038135169060200135610722565b6102506107ff565b6102ca61086e565b610250600480360360208110156103a857600080fd5b50356001600160a01b031661087d565b6101eb600480360360408110156103ce57600080fd5b506001600160a01b03813581169160200135166108fc565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104725780601f1061044757610100808354040283529160200191610472565b820191906000526020600020905b81548152906001019060200180831161045557829003601f168201915b5050505050905090565b6000610490610489610927565b848461092b565b50600192915050565b60025490565b60006104ac848484610a17565b61051c846104b8610927565b61051785604051806060016040528060288152602001611428602891396001600160a01b038a166000908152600160205260408120906104f6610927565b6001600160a01b031681526020810191909152604001600020549190610a32565b61092b565b5060015b9392505050565b610538610532610927565b82610ac9565b610556610543610927565b6006546001600160a01b03169083610ae3565b61055e610927565b6001600160a01b03167f85082129d87b2fe11527cb1b3b7a520aeb5aa6913f88a3d8757fe40d1db02fdd826040518082815260200191505060405180910390a250565b60055460ff1690565b60006104906105b7610927565b8461051785600160006105c8610927565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490610b35565b6001600160a01b031660009081526020819052604090205490565b6006546001600160a01b031681565b6007546001600160a01b031681565b60055461010090046001600160a01b031681565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104725780601f1061044757610100808354040283529160200191610472565b60006104906106b3610927565b84610517856040518060600160405280602581526020016114e460259139600160006106dd610927565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190610a32565b600061049061071b610927565b8484610a17565b6008546001600160a01b031615610780576008546001600160a01b03838116911614610780576040805162461bcd60e51b8152602060048201526008602482015267149154d5149250d560c21b604482015290519081900360640190fd5b61078a8282610b8f565b6107a9610795610927565b6006546001600160a01b0316903084610ba5565b816001600160a01b03166107bb610927565b6001600160a01b03167f99039fcf0a98f484616c5196ee8b2ecfa971babf0b519848289ea4db381f85f7836040518082815260200191505060405180910390a35050565b6008546001600160a01b0316610813610927565b6001600160a01b03161461085c576040805162461bcd60e51b815260206004820152600b60248201526a0a48aa6aaa68aa482aaa8960ab1b604482015290519081900360640190fd5b600880546001600160a01b0319169055565b6008546001600160a01b031681565b6008546001600160a01b0316610891610927565b6001600160a01b0316146108da576040805162461bcd60e51b815260206004820152600b60248201526a0a48aa6aaa68aa482aaa8960ab1b604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b0383166109705760405162461bcd60e51b81526004018080602001828103825260248152602001806114966024913960400191505060405180910390fd5b6001600160a01b0382166109b55760405162461bcd60e51b81526004018080602001828103825260228152602001806113ba6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b610a22838383610c05565b610a2d838383610d60565b505050565b60008184841115610ac15760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a86578181015183820152602001610a6e565b50505050905090810190601f168015610ab35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b610ad38282610e9c565b610adf82600083610d60565b5050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610a2d908490610f98565b600082820183811015610520576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b610b998282611049565b610adf60008383610d60565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610bff908590610f98565b50505050565b6001600160a01b038316610c4a5760405162461bcd60e51b81526004018080602001828103825260258152602001806114716025913960400191505060405180910390fd5b6001600160a01b038216610c8f5760405162461bcd60e51b81526004018080602001828103825260238152602001806113756023913960400191505060405180910390fd5b610c9a838383610a2d565b610cd7816040518060600160405280602681526020016113dc602691396001600160a01b0386166000908152602081905260409020549190610a32565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610d069082610b35565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6001600160a01b03831615801590610d8357506001600160a01b03831661dead14155b15610dfd576007546040805163d6460b4b60e01b81526001600160a01b03868116600483015260248201859052600160448301529151919092169163d6460b4b91606480830192600092919082900301818387803b158015610de457600080fd5b505af1158015610df8573d6000803e3d6000fd5b505050505b6001600160a01b03821615801590610e2057506001600160a01b03821661dead14155b15610a2d576007546040805163d6460b4b60e01b81526001600160a01b03858116600483015260248201859052600060448301819052925193169263d6460b4b9260648084019391929182900301818387803b158015610e7f57600080fd5b505af1158015610e93573d6000803e3d6000fd5b50505050505050565b6001600160a01b038216610ee15760405162461bcd60e51b81526004018080602001828103825260218152602001806114506021913960400191505060405180910390fd5b610eed82600083610a2d565b610f2a81604051806060016040528060228152602001611398602291396001600160a01b0385166000908152602081905260409020549190610a32565b6001600160a01b038316600090815260208190526040902055600254610f509082611139565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6000610fed826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166111969092919063ffffffff16565b805190915015610a2d5780806020019051602081101561100c57600080fd5b5051610a2d5760405162461bcd60e51b815260040180806020018281038252602a8152602001806114ba602a913960400191505060405180910390fd5b6001600160a01b0382166110a4576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6110b060008383610a2d565b6002546110bd9082610b35565b6002556001600160a01b0382166000908152602081905260409020546110e39082610b35565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b600082821115611190576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60606111a584846000856111ad565b949350505050565b6060824710156111ee5760405162461bcd60e51b81526004018080602001828103825260268152602001806114026026913960400191505060405180910390fd5b6111f785611308565b611248576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b602083106112865780518252601f199092019160209182019101611267565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146112e8576040519150601f19603f3d011682016040523d82523d6000602084013e6112ed565b606091505b50915091506112fd82828661130e565b979650505050505050565b3b151590565b6060831561131d575081610520565b82511561132d5782518084602001fd5b60405162461bcd60e51b8152602060048201818152845160248401528451859391928392604401919085019080838360008315610a86578181015183820152602001610a6e56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa164736f6c6343000706000a60c0604052600a6006553480156200001657600080fd5b5060405162001b3838038062001b38833981016040819052620000399162000088565b6001600160601b0319606094851b811660a0529290931b909116608052600080546001600160a01b039283166001600160a01b0319918216179091556001805492909316911617905562000108565b600080600080608085870312156200009e578384fd5b8451620000ab81620000ef565b6020860151909450620000be81620000ef565b6040860151909350620000d181620000ef565b6060860151909250620000e481620000ef565b939692955090935050565b6001600160a01b03811681146200010557600080fd5b50565b60805160601c60a05160601c6119d96200015f600039806104a3528061054352508061024252806102845280610349528061037e52806103a752806105e352806106ce528061071e528061081552506119d96000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c8063a95ae7eb11610097578063d076eabc11610066578063d076eabc146101c7578063d1af0c7d146101da578063d279c191146101e2578063d6460b4b146101f5576100f5565b8063a95ae7eb14610184578063ba32722e1461018c578063bde308181461019f578063ce7c2ac2146101b4576100f5565b806386989038116100d3578063869890381461014e57806389d96917146101565780638bdf67f2146101695780639c1454d41461017c576100f5565b80630700037d146100fa5780633a98ef391461012457806344ab194b14610139575b600080fd5b61010d610108366004611777565b610208565b60405161011b929190611930565b60405180910390f35b61012c610221565b60405161011b9190611927565b61014c6101473660046117f4565b610227565b005b61012c6108f3565b61012c610164366004611777565b6108f9565b61014c6101773660046117f4565b610978565b61012c610a74565b61012c610a7a565b61012c61019a3660046117f4565b610a80565b6101a7610a92565b60405161011b9190611824565b61012c6101c2366004611777565b610aa1565b61012c6101d53660046117f4565b610ab3565b6101a7610ae4565b61014c6101f0366004611777565b610af3565b61014c6102033660046117af565b610b33565b6005602052600090815260409020805460019091015482565b60025481565b801561026a5761026a610238610b7d565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016903084610b81565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a08231906102b9903090600401611824565b60206040518083038186803b1580156102d157600080fd5b505afa1580156102e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610309919061180c565b9050600081116103345760405162461bcd60e51b815260040161032b9061187d565b60405180910390fd5b60015460009081906001600160a01b039081167f0000000000000000000000000000000000000000000000000000000000000000909116106103a2576001546001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006103d1565b6001547f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b03165b9150915060006040518060600160405280846001600160a01b03168152602001836001600160a01b0316815260200161271062ffffff168152509050600061049d73e592427a0aece92de3edee1f18e0157c058615646001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561045f57600080fd5b505afa158015610473573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104979190611793565b83610be1565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637fb4f79d836040518263ffffffff1660e01b81526004016104ed9190611824565b60206040518083038186803b15801561050557600080fd5b505afa158015610519573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053d9190611793565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d4bf1334836040518263ffffffff1660e01b815260040161058d9190611824565b60206040518083038186803b1580156105a557600080fd5b505afa1580156105b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105dd919061180c565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b03161461062f5781600160601b89028161062957fe5b04610639565b600160601b828902045b6001546040516370a0823160e01b81529192506000916001600160a01b03909116906370a082319061066f903090600401611824565b60206040518083038186803b15801561068757600080fd5b505afa15801561069b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bf919061180c565b90506107096001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001673e592427a0aece92de3edee1f18e0157c058615648b610cc5565b60408051610100810182526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811682526001541660208201526127108183015230606082015242608082015260a081018b90526006546103e890810385020460c0820152600060e0820152905163414bf38960e01b815273e592427a0aece92de3edee1f18e0157c058615649163414bf389916107b191906004016118be565b602060405180830381600087803b1580156107cb57600080fd5b505af19250505080156107fb575060408051601f3d908101601f191682019092526107f89181019061180c565b60015b6108555760068054600a0190556108506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001673e592427a0aece92de3edee1f18e0157c058615648b610db0565b6108e7565b50600a6006556001546040516370a0823160e01b81526108e79183916001600160a01b03909116906370a0823190610891903090600401611824565b60206040518083038186803b1580156108a957600080fd5b505afa1580156108bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e1919061180c565b03610e52565b50505050505050505050565b60035481565b6001600160a01b03811660009081526004602052604081205461091e57506000610973565b6001600160a01b03821660009081526004602052604081205461094090610f25565b6001600160a01b03841660009081526005602052604090205490915080821161096e57600092505050610973565b900390505b919050565b600081116109985760405162461bcd60e51b815260040161032b90611838565b6001546040516370a0823160e01b81526000916001600160a01b0316906370a08231906109c9903090600401611824565b60206040518083038186803b1580156109e157600080fd5b505afa1580156109f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a19919061180c565b9050610a3a610a26610b7d565b6001546001600160a01b0316903085610b81565b6001546040516370a0823160e01b8152610a709183916001600160a01b03909116906370a0823190610891903090600401611824565b5050565b60085481565b60095481565b600a6020526000908152604090205481565b6000546001600160a01b031681565b60046020526000908152604090205481565b600080610abf83610f4a565b92505050620151808381610acf57fe5b06600182036201518002840303915050919050565b6001546001600160a01b031681565b610afc81610f69565b6040516001600160a01b038216907f63e32091e4445d16e29c33a6b264577c2d86694021aa4e6f4dd590048f5792e890600090a250565b6000546001600160a01b0316610b47610b7d565b6001600160a01b031614610b6d5760405162461bcd60e51b815260040161032b90611857565b610b78838383611051565b505050565b3390565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610bdb9085906110ea565b50505050565b600081602001516001600160a01b031682600001516001600160a01b031610610c0957600080fd5b50805160208083015160409384015184516001600160a01b0394851681850152939091168385015262ffffff166060808401919091528351808403820181526080840185528051908301206001600160f81b031960a085015294901b6bffffffffffffffffffffffff191660a183015260b58201939093527fe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b5460d5808301919091528251808303909101815260f5909101909152805191012090565b6000610d5b82856001600160a01b031663dd62ed3e30876040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b158015610d2957600080fd5b505afa158015610d3d573d6000803e3d6000fd5b505050506040513d6020811015610d5357600080fd5b50519061119b565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052909150610bdb9085906110ea565b6000610d5b826040518060600160405280602981526020016119546029913960408051636eb1769f60e11b81523060048201526001600160a01b03888116602483015291519189169163dd62ed3e91604480820192602092909190829003018186803b158015610e1f57600080fd5b505afa158015610e33573d6000803e3d6000fd5b505050506040513d6020811015610e4957600080fd5b505191906111fc565b80610e5c57610f22565b600254610e7157610e6c81611293565b610f22565b600a8104808203610e8182611293565b600980548201905580600a6000610e9742610ab3565b81526020810191909152604001600020805490910190556002546ec097ce7bc90715b34b9f1000000000820281610eca57fe5b60078054929091049091019055610edf610b7d565b6001600160a01b03167fb9ad861b752f80117b35bea6dec99933d8a5ae360f2839ee8784b750d561340982604051610f179190611927565b60405180910390a250505b50565b60006ec097ce7bc90715b34b9f1000000000600754830281610f4357fe5b0492915050565b60008080610f5c62015180850461130b565b9196909550909350915050565b6001600160a01b038116600090815260046020526040902054610f8b57610f22565b6000610f96826108f9565b6001600160a01b03831660009081526005602090815260408083206001018054850190556004909152902054909150610fce90610f25565b6001600160a01b0383166000908152600560205260409020558015610a7057600880548201905560015461100c906001600160a01b031683836113a1565b816001600160a01b03167fe8b160e373db99a103e0a2abfa029b9c3fc8b328984a1ead8a65ae68ae646db7826040516110459190611927565b60405180910390a25050565b80156110a75761106183836113f3565b826001600160a01b03167fae0577e1c96b26fbc0b9df702431f5470979d001d24f136eded791b8b6521d6f8360405161109a9190611927565b60405180910390a2610b78565b6110b183836114d2565b826001600160a01b03167fba8f3777cf908803bf1f3dd58e7f4b7d3de4dbe3c234c4ccab0975d98f7cd38883604051610f179190611927565b600061113f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166115999092919063ffffffff16565b805190915015610b785780806020019051602081101561115e57600080fd5b5051610b785760405162461bcd60e51b815260040180806020018281038252602a8152602001806119a3602a913960400191505060405180910390fd5b6000828201838110156111f5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6000818484111561128b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611250578181015183820152602001611238565b50505050905090810190601f16801561127d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600154604051630852cd8d60e31b81526001600160a01b03909116906342966c68906112c3908490600401611927565b600060405180830381600087803b1580156112dd57600080fd5b505af19250505080156112ee575060015b610f2257600154610e6c906001600160a01b031661dead836113a1565b60008080836226496581018262023ab1600483020590506004600362023ab18302010590910390600062164b09610fa0600185010205905060046105b58202058303601f019250600061098f846050028161136257fe5b0590506000605061098f83020585039050600b820560301994909401606402929092018301996002600c90940290910392909201975095509350505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610b789084906110ea565b6001600160a01b0382166000908152600460205260409020541580159061143257506001600160a01b0382166000908152600460205260409020548111155b61144e5760405162461bcd60e51b815260040161032b9061189e565b61145782610f69565b6002805482900390556001600160a01b038216600090815260046020526040902080548290039081905561149057600380546000190190555b6001600160a01b0382166000908152600460205260409020546114b290610f25565b6001600160a01b0390921660009081526005602052604090209190915550565b6001600160a01b038216600090815260046020526040902054156114f9576114f982610f69565b6001600160a01b038216600090815260046020526040902080546002805484019055815483019091558015801561154757506001600160a01b03831660009081526004602052604090205415155b15611556576003805460010190555b6001600160a01b03831660009081526004602052604090205461157890610f25565b6001600160a01b039093166000908152600560205260409020929092555050565b60606115a884846000856115b0565b949350505050565b6060824710156115f15760405162461bcd60e51b815260040180806020018281038252602681526020018061197d6026913960400191505060405180910390fd5b6115fa8561170b565b61164b576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b602083106116895780518252601f19909201916020918201910161166a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146116eb576040519150601f19603f3d011682016040523d82523d6000602084013e6116f0565b606091505b5091509150611700828286611711565b979650505050505050565b3b151590565b606083156117205750816111f5565b8251156117305782518084602001fd5b60405162461bcd60e51b8152602060048201818152845160248401528451859391928392604401919085019080838360008315611250578181015183820152602001611238565b600060208284031215611788578081fd5b81356111f58161193e565b6000602082840312156117a4578081fd5b81516111f58161193e565b6000806000606084860312156117c3578182fd5b83356117ce8161193e565b925060208401359150604084013580151581146117e9578182fd5b809150509250925092565b600060208284031215611805578081fd5b5035919050565b60006020828403121561181d578081fd5b5051919050565b6001600160a01b0391909116815260200190565b602080825260059082015264444550414d60d81b604082015260600190565b6020808252600c908201526b15539055551213d49256915160a21b604082015260600190565b6020808252600790820152664e45454444414960c81b604082015260600190565b60208082526006908201526552454d4f564560d01b604082015260600190565b81516001600160a01b03908116825260208084015182169083015260408084015162ffffff16908301526060808401518216908301526080808401519083015260a0838101519083015260c0808401519083015260e09283015116918101919091526101000190565b90815260200190565b918252602082015260400190565b6001600160a01b0381168114610f2257600080fdfe5361666545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a164736f6c6343000706000a000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000012c00000000000000000000000000000000000000000000000000000000000001e000000000000000000000000002f92800f57bcd74066f5709f1daa1a4302df8750000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f56400000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024ff47d552cb222b265d68c7aeb26e586d5229d000000000000000000000000000000000000000000000000000000000000001f506561706f647320426c75652043686970732028556e7765696768746564290000000000000000000000000000000000000000000000000000000000000000067070424c5545000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000004585fe77225b41b697c938b018e2ac67ac5a20c0000000000000000000000000a6cc3c2531fdaa6ae1a3ca84c2855806728693e800000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640

Deployed Bytecode

0x6080604052600436106102295760003560e01c80637d7c2a1c11610123578063a9059cbb116100ab578063d757a9fb1161006f578063d757a9fb1461061b578063dd62ed3e1461063b578063ee9c79da1461065b578063f2fde38b1461067b578063ff140ca61461069b57610239565b8063a9059cbb14610586578063bdbc91ab146105a6578063bdc8d060146105c6578063c87fa42a146105db578063ccec3716146105fb57610239565b806394cc699e116100f257806394cc699e146104f957806395b3921e1461050e57806395d89b4114610531578063a457c2d714610546578063a515366a1461056657610239565b80637d7c2a1c1461049a5780638071c8ec146104af57806389fce6e6146104cf5780638da5cb5b146104e457610239565b8063313ce567116101b15780634b6f1649116101755780634b6f16491461040c57806353f504471461042157806358f4dcc31461044357806370a0823114610465578063715018a61461048557610239565b8063313ce56714610364578063325a19f114610386578063395093511461039b57806344305374146103bb5780634a437f88146103db57610239565b806320800a00116101f857806320800a00146102d857806323b872dd146102ed5780632834669b1461030d5780632acada4d1461032d5780632e688f8a1461034f57610239565b806306917a541461023e57806306fdde031461025e578063095ea7b31461028957806318160ddd146102b657610239565b3661023957610237346106b0565b005b600080fd5b34801561024a57600080fd5b50610237610259366004614611565b6107d4565b34801561026a57600080fd5b50610273610c91565b604051610280919061493f565b60405180910390f35b34801561029557600080fd5b506102a96102a43660046144a5565b610d27565b60405161028091906148e8565b3480156102c257600080fd5b506102cb610d44565b6040516102809190614936565b3480156102e457600080fd5b50610237610d4a565b3480156102f957600080fd5b506102a96103083660046143cb565b610d75565b34801561031957600080fd5b506102376103283660046144f3565b610dfd565b34801561033957600080fd5b50610342610e64565b604051610280919061486c565b34801561035b57600080fd5b506102cb610efb565b34801561037057600080fd5b50610379610f01565b6040516102809190614b72565b34801561039257600080fd5b506102cb610f0a565b3480156103a757600080fd5b506102a96103b63660046144a5565b610f10565b3480156103c757600080fd5b506102376103d63660046144f3565b610f5e565b3480156103e757600080fd5b506103fb6103f63660046144f3565b610fc5565b604051610280959493929190614839565b34801561041857600080fd5b506102cb611012565b34801561042d57600080fd5b50610436611017565b6040516102809190614922565b34801561044f57600080fd5b50610458611025565b6040516102809190614760565b34801561047157600080fd5b506102cb61048036600461435b565b611034565b34801561049157600080fd5b5061023761104f565b3480156104a657600080fd5b50610237611103565b3480156104bb57600080fd5b506102376104ca366004614611565b61110b565b3480156104db57600080fd5b506102cb611583565b3480156104f057600080fd5b50610458611589565b34801561050557600080fd5b5061045861159e565b34801561051a57600080fd5b506105236115ad565b604051610280929190614b64565b34801561053d57600080fd5b5061027361171e565b34801561055257600080fd5b506102a96105613660046144a5565b61177f565b34801561057257600080fd5b506102376105813660046144a5565b6117e7565b34801561059257600080fd5b506102a96105a13660046144a5565b611ae2565b3480156105b257600080fd5b506102376105c136600461440b565b611af6565b3480156105d257600080fd5b506102cb611e3b565b3480156105e757600080fd5b506102a96105f636600461435b565b611e5f565b34801561060757600080fd5b5061023761061636600461435b565b611e7d565b34801561062757600080fd5b506102cb61063636600461435b565b611fd9565b34801561064757600080fd5b506102cb610656366004614393565b612137565b34801561066757600080fd5b50610237610676366004614523565b612162565b34801561068757600080fd5b5061023761069636600461435b565b612560565b3480156106a757600080fd5b506102cb612671565b806106ba576107d1565b60007f000000000000000000000000024ff47d552cb222b265d68c7aeb26e586d5229d6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561071557600080fd5b505afa158015610729573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074d9190614377565b6001600160a01b0316826040516107639061475d565b60006040518083038185875af1925050503d80600081146107a0576040519150601f19603f3d011682016040523d82523d6000602084013e6107a5565b606091505b50509050806107cf5760405162461bcd60e51b81526004016107c690614a38565b60405180910390fd5b505b50565b600c805461ff001916905582156107eb578261088e565b7f00000000000000000000000027322b10753a2c33f202f82c14a2d0b69f1bd6a86001600160a01b03166370a08231610822612695565b6040518263ffffffff1660e01b815260040161083e9190614760565b60206040518083038186803b15801561085657600080fd5b505afa15801561086a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088e919061450b565b9250600083116108b05760405162461bcd60e51b81526004016107c690614a19565b6040516370a0823160e01b81526000906001600160a01b037f00000000000000000000000027322b10753a2c33f202f82c14a2d0b69f1bd6a816906370a08231906108ff903090600401614760565b60206040518083038186803b15801561091757600080fd5b505afa15801561092b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094f919061450b565b905061098e61095c612695565b6001600160a01b037f00000000000000000000000027322b10753a2c33f202f82c14a2d0b69f1bd6a816903087612699565b6109e26001600160a01b037f00000000000000000000000027322b10753a2c33f202f82c14a2d0b69f1bd6a8167f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d866126f9565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663baa2abde307f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f878787610a3e612695565b426040518863ffffffff1660e01b8152600401610a619796959493929190614774565b6040805180830381600087803b158015610a7a57600080fd5b505af1158015610a8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab291906145ee565b50506040516370a0823160e01b815281906001600160a01b037f00000000000000000000000027322b10753a2c33f202f82c14a2d0b69f1bd6a816906370a0823190610b02903090600401614760565b60206040518083038186803b158015610b1a57600080fd5b505afa158015610b2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b52919061450b565b1115610c3457610c34610b63612695565b6040516370a0823160e01b815283906001600160a01b037f00000000000000000000000027322b10753a2c33f202f82c14a2d0b69f1bd6a816906370a0823190610bb1903090600401614760565b60206040518083038186803b158015610bc957600080fd5b505afa158015610bdd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c01919061450b565b6001600160a01b037f00000000000000000000000027322b10753a2c33f202f82c14a2d0b69f1bd6a816929190036127e4565b610c3c612695565b6001600160a01b03167fdfdd120ded9b7afc0c23dd5310e93aaa3e1c3b9f75af9b805fab3030842439f285604051610c749190614936565b60405180910390a25050600c805461ff0019166101001790555050565b60038054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610d1d5780601f10610cf257610100808354040283529160200191610d1d565b820191906000526020600020905b815481529060010190602001808311610d0057829003601f168201915b5050505050905090565b6000610d3b610d34612695565b848461283b565b50600192915050565b60025490565b60004711610d6a5760405162461bcd60e51b81526004016107c690614976565b610d73476106b0565b565b6000610d82848484612927565b610df284610d8e612695565b610ded85604051806060016040528060288152602001614cc0602891396001600160a01b038a16600090815260016020526040812090610dcc612695565b6001600160a01b031681526020810191909152604001600020549190612a3e565b61283b565b5060015b9392505050565b610e05612695565b6001600160a01b0316610e16611589565b6001600160a01b031614610e5f576040805162461bcd60e51b81526020600482018190526024820152600080516020614ce8833981519152604482015290519081900360640190fd5b600e55565b60606009805480602002602001604051908101604052809291908181526020016000905b82821015610ef25760008481526020908190206040805160a0810182526005860290920180546001600160a01b0390811684526001808301548587015260028301549385019390935260038201541660608401526004015460808301529083529092019101610e88565b50505050905090565b600e5481565b60055460ff1690565b60065481565b6000610d3b610f1d612695565b84610ded8560016000610f2e612695565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490612ad5565b610f66612695565b6001600160a01b0316610f77611589565b6001600160a01b031614610fc0576040805162461bcd60e51b81526020600482018190526024820152600080516020614ce8833981519152604482015290519081900360640190fd5b600d55565b60098181548110610fd557600080fd5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b03938416955091939092169085565b600a81565b600554610100900460ff1681565b6008546001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b611057612695565b6001600160a01b0316611068611589565b6001600160a01b0316146110b1576040805162461bcd60e51b81526020600482018190526024820152600080516020614ce8833981519152604482015290519081900360640190fd5b600c546040516000916201000090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600c805462010000600160b01b0319169055565b610d73612b2f565b600c805461ff0019169055600061112130611034565b905060007f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016111719190614760565b60206040518083038186803b15801561118957600080fd5b505afa15801561119d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c1919061450b565b90506111d56111ce612695565b3087612927565b611200307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d8761283b565b61123d61120b612695565b6001600160a01b037f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f16903087612699565b6112916001600160a01b037f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f167f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d866126f9565b6001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d1663e8e33700307f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f88886103e88981038302046103e88a81038c02046112fe612695565b426040518963ffffffff1660e01b81526004016113229897969594939291906147b4565b606060405180830381600087803b15801561133c57600080fd5b505af1158015611350573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611374919061463c565b5050508161138130611034565b11156113a3576113a330611393612695565b8461139d30611034565b03612927565b6040516370a0823160e01b815281906001600160a01b037f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f16906370a08231906113f1903090600401614760565b60206040518083038186803b15801561140957600080fd5b505afa15801561141d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611441919061450b565b111561152357611523611452612695565b6040516370a0823160e01b815283906001600160a01b037f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f16906370a08231906114a0903090600401614760565b60206040518083038186803b1580156114b857600080fd5b505afa1580156114cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f0919061450b565b6001600160a01b037f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f16929190036127e4565b61152b612695565b6001600160a01b03167f06239653922ac7bea6aa2b19dc486b9361821d37712eb796adfd38d81de278ca8686604051611565929190614b64565b60405180910390a25050600c805461ff001916610100179055505050565b600d5481565b600c546201000090046001600160a01b031690565b6007546001600160a01b031681565b6000806000805b60095481101561170657600981815481106115cb57fe5b9060005260206000209060050201600201547f000000000000000000000000024ff47d552cb222b265d68c7aeb26e586d5229d6001600160a01b031663b5ed44636009848154811061161957fe5b60009182526020909120600360059092020101546040516001600160e01b031960e084901b16815261169b916001600160a01b0316907f00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640907f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2906004016147fd565b60206040518083038186803b1580156116b357600080fd5b505afa1580156116c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116eb919061450b565b600160601b02816116f857fe5b0491909101906001016115b4565b506009548190818161171457fe5b0492509250509091565b60048054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610d1d5780601f10610cf257610100808354040283529160200191610d1d565b6000610d3b61178c612695565b84610ded85604051806060016040528060258152602001614d9c60259139600160006117b6612695565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190612a3e565b600c805461ff00191690556001600160a01b0382166000908152600a602052604090205460ff1661182a5760405162461bcd60e51b81526004016107c690614a56565b61183c82611836612695565b8361304f565b6001600160a01b038281166000908152600b60205260408120546009805492937f000000000000000000000000024ff47d552cb222b265d68c7aeb26e586d5229d169263b5ed44639290811061188e57fe5b60009182526020909120600360059092020101546040516001600160e01b031960e084901b168152611910916001600160a01b0316907f00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640907f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2906004016147fd565b60206040518083038186803b15801561192857600080fd5b505afa15801561193c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611960919061450b565b9050600061196c6115ad565b9150506000846001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156119aa57600080fd5b505afa1580156119be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e29190614669565b60ff16600a0a826119f1610f01565b60ff16600a0a8686020281611a0257fe5b0481611a0a57fe5b0490506000611a17613183565b611a47576127107f0000000000000000000000000000000000000000000000000000000000000064830204611a4a565b60005b9050611a5f611a57612695565b828403613193565b8015611a6f57611a6f3082613193565b611a77612b2f565b856001600160a01b0316611a89612695565b6001600160a01b03167fad49529616fd9fe4b34e00ac3f98d5cc3531e1232a95f249113b23fdf13c7e858785604051611ac3929190614b64565b60405180910390a35050600c805461ff00191661010017905550505050565b6000610d3b611aef612695565b8484612927565b600754604080516345e35f5960e11b815290516000926001600160a01b031691638bc6beb2916004808301926020929190829003018186803b158015611b3b57600080fd5b505afa158015611b4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b739190614377565b9050611c4d611b80612695565b827f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f6001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015611bda57600080fd5b505afa158015611bee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c129190614669565b6001600160a01b037f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f1692919060ff16600a90810a02612699565b6040516370a0823160e01b81526000906001600160a01b038716906370a0823190611c7c903090600401614760565b60206040518083038186803b158015611c9457600080fd5b505afa158015611ca8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ccc919061450b565b9050611ce26001600160a01b03871688876127e4565b604051633a62959560e21b81526001600160a01b0388169063e98a565490611d1090879087906004016148f3565b600060405180830381600087803b158015611d2a57600080fd5b505af1158015611d3e573d6000803e3d6000fd5b50506040516370a0823160e01b81528392506001600160a01b03891691506370a0823190611d70903090600401614760565b60206040518083038186803b158015611d8857600080fd5b505afa158015611d9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dc0919061450b565b1015611dde5760405162461bcd60e51b81526004016107c690614952565b866001600160a01b0316611df0612695565b6001600160a01b03167f5a9eeaf8949838813289046091e8ea8a9196a2265ac24841464a2d27026a85498888604051611e2a929190614820565b60405180910390a350505050505050565b7f000000000000000000000000000000000000000000000000000000000000012c81565b6001600160a01b03166000908152600a602052604090205460ff1690565b611e8681611e5f565b158015611e9c57506001600160a01b0381163014155b611eb85760405162461bcd60e51b81526004016107c6906149d4565b6107d17f000000000000000000000000024ff47d552cb222b265d68c7aeb26e586d5229d6001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b158015611f1457600080fd5b505afa158015611f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f4c9190614377565b6040516370a0823160e01b81526001600160a01b038416906370a0823190611f78903090600401614760565b60206040518083038186803b158015611f9057600080fd5b505afa158015611fa4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fc8919061450b565b6001600160a01b03841691906127e4565b6001600160a01b0381166000908152600a602052604081205460ff166120115760405162461bcd60e51b81526004016107c690614995565b6001600160a01b038083166000908152600b60205260409020546009805491927f000000000000000000000000024ff47d552cb222b265d68c7aeb26e586d5229d169163b5ed446391908490811061206557fe5b60009182526020909120600360059092020101546040516001600160e01b031960e084901b1681526120e7916001600160a01b0316907f00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640907f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2906004016147fd565b60206040518083038186803b1580156120ff57600080fd5b505afa158015612113573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df6919061450b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600c805461ff0019169055805182511461218e5760405162461bcd60e51b81526004016107c690614a7c565b600061219984613283565b6121cb576127107f000000000000000000000000000000000000000000000000000000000000012c81038502046121cd565b835b90506121e16121da612695565b3086612927565b6121eb30826132a3565b60006121f56115ad565b9150506000612202610f01565b60ff16600a0a8383028161221257fe5b0490506000805b86518110156124d457600a600088838151811061223257fe5b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff166122755760405162461bcd60e51b81526004016107c690614a56565b85818151811061228157fe5b6020026020010151820191506000606487838151811061229d57fe5b602002602001015160ff168502816122b157fe5b0490506000600b60008a85815181106122c657fe5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000205490506124ca6122fc612695565b7f000000000000000000000000024ff47d552cb222b265d68c7aeb26e586d5229d6001600160a01b031663b5ed44636009858154811061233857fe5b60009182526020909120600360059092020101546040516001600160e01b031960e084901b1681526123ba916001600160a01b0316907f00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640907f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2906004016147fd565b60206040518083038186803b1580156123d257600080fd5b505afa1580156123e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061240a919061450b565b8b868151811061241657fe5b60200260200101516001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561245657600080fd5b505afa15801561246a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061248e9190614669565b60ff16600a0a85028161249d57fe5b048b86815181106124aa57fe5b60200260200101516001600160a01b03166127e49092919063ffffffff16565b5050600101612219565b508060ff166064146124f85760405162461bcd60e51b81526004016107c6906149b5565b612500612b2f565b612508612695565b6001600160a01b03167fe4bf69c2fff7ace5eed72842e9abf52af2218a3a78cb83d7824f999dbfd75e71886040516125409190614936565b60405180910390a25050600c805461ff0019166101001790555050505050565b612568612695565b6001600160a01b0316612579611589565b6001600160a01b0316146125c2576040805162461bcd60e51b81526020600482018190526024820152600080516020614ce8833981519152604482015290519081900360640190fd5b6001600160a01b0381166126075760405162461bcd60e51b8152600401808060200182810382526026815260200180614c2c6026913960400191505060405180910390fd5b600c546040516001600160a01b038084169262010000900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600c80546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b7f000000000000000000000000000000000000000000000000000000000000006481565b3390565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526126f390859061339f565b50505050565b600061278f82856001600160a01b031663dd62ed3e30876040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b15801561275d57600080fd5b505afa158015612771573d6000803e3d6000fd5b505050506040513d602081101561278757600080fd5b505190612ad5565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b1790529091506126f390859061339f565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261283690849061339f565b505050565b6001600160a01b0383166128805760405162461bcd60e51b8152600401808060200182810382526024815260200180614d4e6024913960400191505060405180910390fd5b6001600160a01b0382166128c55760405162461bcd60e51b8152600401808060200182810382526022815260200180614c526022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600c54610100900460ff1680156129415750600c5460ff16155b15612a3357600061295130611034565b90506000612710612960610d44565b8161296757fe5b0490507f00000000000000000000000027322b10753a2c33f202f82c14a2d0b69f1bd6a86001600160a01b0316856001600160a01b0316141580156129ac5750808210155b80156129e0575060006129de7f00000000000000000000000027322b10753a2c33f202f82c14a2d0b69f1bd6a8611034565b115b15612a3057600c805460ff19166001179055612a2560648202831015612a1b5781601402831015612a115781612a16565b816014025b612a20565b816064025b613450565b600c805460ff191690555b50505b61283683838361372b565b60008184841115612acd5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612a92578181015183820152602001612a7a565b50505050905090810190601f168015612abf5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610df6576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60095460009067ffffffffffffffff81118015612b4b57600080fd5b50604051908082528060200260200182016040528015612b75578160200160208202803683370190505b5060095490915060009067ffffffffffffffff81118015612b9557600080fd5b50604051908082528060200260200182016040528015612bbf578160200160208202803683370190505b5060095490915060009067ffffffffffffffff81118015612bdf57600080fd5b50604051908082528060200260200182016040528015612c09578160200160208202803683370190505b5060095490915060009067ffffffffffffffff81118015612c2957600080fd5b50604051908082528060200260200182016040528015612c53578160200160208202803683370190505b50905060008060005b600954811015612db357612cd760098281548110612c7657fe5b60009182526020918290206040805160a081018252600590930290910180546001600160a01b039081168452600182015494840194909452600281015491830191909152600381015490921660608201526004909101546080820152613886565b898481518110612ce357fe5b60200260200101898581518110612cf657fe5b60200260200101898681518110612d0957fe5b6020908102919091010192909252919052528451859082908110612d2957fe5b60200260200101518301925060098181548110612d4257fe5b906000526020600020906005020160020154868281518110612d6057fe5b6020026020010151600160601b0281612d7557fe5b04848281518110612d8257fe5b602002602001018181525050838181518110612d9a57fe5b6020026020010151820191508080600101915050612c5c565b5060005b60095481101561301d57600082858381518110612dd057fe5b6020026020010151850281612de157fe5b04905080868381518110612df157fe5b6020026020010151108015612e1c5750600e54868381518110612e1057fe5b60200260200101518203115b156130145760005b6009548110156130125780831415612e3b5761300a565b600084878381518110612e4a57fe5b6020026020010151870281612e5b57fe5b04905080888381518110612e6b57fe5b6020026020010151118015612e965750600e5481898481518110612e8b57fe5b602002602001015103115b1561300857612f3860098381548110612eab57fe5b6000918252602090912060059091020154600980546001600160a01b039092169187908110612ed657fe5b60009182526020909120600590910201548b516001600160a01b03909116908c9086908110612f0157fe5b60200260200101518c8881518110612f1557fe5b6020026020010151858d8881518110612f2a57fe5b602002602001015103613a80565b612f4860098381548110612c7657fe5b8c8581518110612f5457fe5b602002602001018c8681518110612f6757fe5b602002602001018c8781518110612f7a57fe5b60200260200101838152508381525083815250505050612fa060098581548110612c7657fe5b8c8781518110612fac57fe5b602002602001018c8881518110612fbf57fe5b602002602001018c8981518110612fd257fe5b6020026020010183815250838152508381525050505082888581518110612ff557fe5b6020026020010151106130085750613012565b505b600101612e24565b505b50600101612db7565b506040517ff57243a1fddfdc9fa2c7de26cc3503b1b94cfd4368d2b82d0970bfbb2fbce3a490600090a1505050505050565b6040516370a0823160e01b81526000906001600160a01b038516906370a082319061307e903090600401614760565b60206040518083038186803b15801561309657600080fd5b505afa1580156130aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130ce919061450b565b90506130e56001600160a01b038516843085612699565b6040516370a0823160e01b8152818301906001600160a01b038616906370a0823190613115903090600401614760565b60206040518083038186803b15801561312d57600080fd5b505afa158015613141573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613165919061450b565b10156126f35760405162461bcd60e51b81526004016107c6906149f9565b600061318d610d44565b15905090565b6001600160a01b0382166131ee576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6131fa60008383612836565b6002546132079082612ad5565b6002556001600160a01b03821660009081526020819052604090205461322d9082612ad5565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000606461328f610d44565b6062028161329957fe5b0490911015919050565b6001600160a01b0382166132e85760405162461bcd60e51b8152600401808060200182810382526021815260200180614d086021913960400191505060405180910390fd5b6132f482600083612836565b61333181604051806060016040528060228152602001614c0a602291396001600160a01b0385166000908152602081905260409020549190612a3e565b6001600160a01b0383166000908152602081905260409020556002546133579082613c80565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b60006133f4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613cdd9092919063ffffffff16565b8051909150156128365780806020019051602081101561341357600080fd5b50516128365760405162461bcd60e51b815260040180806020018281038252602a815260200180614d72602a913960400191505060405180910390fd5b604080516002808252606082018352600092602083019080368337019050509050308160008151811061347f57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f816001815181106134cd57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050613518307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d8461283b565b600754604080516345e35f5960e11b815290516000926001600160a01b031691638bc6beb2916004808301926020929190829003018186803b15801561355d57600080fd5b505afa158015613571573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135959190614377565b604051635c11d79560e01b81529091506001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d1690635c11d795906135ed908690600090879087904290600401614af4565b600060405180830381600087803b15801561360757600080fd5b505af115801561361b573d6000803e3d6000fd5b50506040516370a0823160e01b8152600092506001600160a01b037f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f1691506370a082319061366e908590600401614760565b60206040518083038186803b15801561368657600080fd5b505afa15801561369a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136be919061450b565b905080156126f3576040516344ab194b60e01b81526001600160a01b038316906344ab194b906136f390600090600401614936565b600060405180830381600087803b15801561370d57600080fd5b505af1158015613721573d6000803e3d6000fd5b5050505050505050565b6001600160a01b0383166137705760405162461bcd60e51b8152600401808060200182810382526025815260200180614d296025913960400191505060405180910390fd5b6001600160a01b0382166137b55760405162461bcd60e51b8152600401808060200182810382526023815260200180614be76023913960400191505060405180910390fd5b6137c0838383612836565b6137fd81604051806060016040528060268152602001614c74602691396001600160a01b0386166000908152602081905260409020549190612a3e565b6001600160a01b03808516600090815260208190526040808220939093559084168152205461382c9082612ad5565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008060007f000000000000000000000000024ff47d552cb222b265d68c7aeb26e586d5229d6001600160a01b031663b5ed446385606001517f00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f56407f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26040518463ffffffff1660e01b815260040161391f939291906147fd565b60206040518083038186803b15801561393757600080fd5b505afa15801561394b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061396f919061450b565b84516040516370a0823160e01b81529193506001600160a01b0316906370a082319061399f903090600401614760565b60206040518083038186803b1580156139b757600080fd5b505afa1580156139cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139ef919061450b565b925083600001516001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015613a2e57600080fd5b505afa158015613a42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a669190614669565b60ff16600a0a82840281613a7657fe5b0490509193909250565b600083866001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015613abc57600080fd5b505afa158015613ad0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613af49190614669565b60ff16600a0a830281613b0357fe5b04905080613b115750613c79565b600083866001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015613b4d57600080fd5b505afa158015613b61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b859190614669565b60ff16600a0a840281613b9457fe5b0490506000876001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401613bc59190614760565b60206040518083038186803b158015613bdd57600080fd5b505afa158015613bf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c15919061450b565b90506000838210613c265783613c28565b815b905060008484830281613c3757fe5b049050811580613c45575080155b15613c54575050505050613c79565b613c738a8a846103e8600d546103e803860281613c6d57fe5b04613cf4565b50505050505b5050505050565b600082821115613cd7576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6060613cec848460008561411f565b949350505050565b6001600160a01b0384166000908152600b6020526040812054600980549091908110613d1c57fe5b60009182526020808320600360059093020191909101546001600160a01b038781168452600b90925260408320546009805493909216945090918110613d5e57fe5b60009182526020909120600360059092020101546001600160a01b039081169150613da090871673e592427a0aece92de3edee1f18e0157c05861564866126f9565b600086836001600160a01b031663ddca3f436040518163ffffffff1660e01b815260040160206040518083038186803b158015613ddc57600080fd5b505afa158015613df0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e1491906144d0565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2846001600160a01b031663ddca3f436040518163ffffffff1660e01b815260040160206040518083038186803b158015613e6e57600080fd5b505afa158015613e82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ea691906144d0565b89604051602001613ebb95949392919061470b565b60405160208183030381529060405290507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316876001600160a01b03161415613fa15786826001600160a01b031663ddca3f436040518163ffffffff1660e01b815260040160206040518083038186803b158015613f4057600080fd5b505afa158015613f54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f7891906144d0565b87604051602001613f8b939291906146d0565b6040516020818303038152906040529050614072565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316866001600160a01b031614156140725786836001600160a01b031663ddca3f436040518163ffffffff1660e01b815260040160206040518083038186803b15801561401557600080fd5b505afa158015614029573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061404d91906144d0565b87604051602001614060939291906146d0565b60405160208183030381529060405290505b6040805160a08101825282815230602082015242818301526060810187905260808101869052905163c04b8d5960e01b815273e592427a0aece92de3edee1f18e0157c058615649163c04b8d59916140cd9190600401614a9c565b602060405180830381600087803b1580156140e757600080fd5b505af11580156140fb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613721919061450b565b6060824710156141605760405162461bcd60e51b8152600401808060200182810382526026815260200180614c9a6026913960400191505060405180910390fd5b6141698561427a565b6141ba576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b602083106141f85780518252601f1990920191602091820191016141d9565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461425a576040519150601f19603f3d011682016040523d82523d6000602084013e61425f565b606091505b509150915061426f828286614280565b979650505050505050565b3b151590565b6060831561428f575081610df6565b82511561429f5782518084602001fd5b60405162461bcd60e51b8152602060048201818152845160248401528451859391928392604401919085019080838360008315612a92578181015183820152602001612a7a565b600082601f8301126142f6578081fd5b8135602061430b61430683614ba4565b614b80565b8281528181019085830183850287018401881015614327578586fd5b855b8581101561434e57813561433c81614bd7565b84529284019290840190600101614329565b5090979650505050505050565b60006020828403121561436c578081fd5b8135610df681614bc2565b600060208284031215614388578081fd5b8151610df681614bc2565b600080604083850312156143a5578081fd5b82356143b081614bc2565b915060208301356143c081614bc2565b809150509250929050565b6000806000606084860312156143df578081fd5b83356143ea81614bc2565b925060208401356143fa81614bc2565b929592945050506040919091013590565b600080600080600060808688031215614422578081fd5b853561442d81614bc2565b9450602086013561443d81614bc2565b935060408601359250606086013567ffffffffffffffff80821115614460578283fd5b818801915088601f830112614473578283fd5b813581811115614481578384fd5b896020828501011115614492578384fd5b9699959850939650602001949392505050565b600080604083850312156144b7578182fd5b82356144c281614bc2565b946020939093013593505050565b6000602082840312156144e1578081fd5b815162ffffff81168114610df6578182fd5b600060208284031215614504578081fd5b5035919050565b60006020828403121561451c578081fd5b5051919050565b600080600060608486031215614537578283fd5b8335925060208085013567ffffffffffffffff80821115614556578485fd5b818701915087601f830112614569578485fd5b813561457761430682614ba4565b81815284810190848601868402860187018c1015614593578889fd5b8895505b838610156145be5780356145aa81614bc2565b835260019590950194918601918601614597565b509650505060408701359250808311156145d6578384fd5b50506145e4868287016142e6565b9150509250925092565b60008060408385031215614600578182fd5b505080516020909101519092909150565b600080600060608486031215614625578081fd5b505081359360208301359350604090920135919050565b600080600060608486031215614650578081fd5b8351925060208401519150604084015190509250925092565b60006020828403121561467a578081fd5b8151610df681614bd7565b60008151808452815b818110156146aa5760208185018101518683018201520161468e565b818111156146bb5782602083870101525b50601f01601f19169290920160200192915050565b606093841b6bffffffffffffffffffffffff19908116825260e89390931b6001600160e81b0319166014820152921b166017820152602b0190565b6bffffffffffffffffffffffff19606096871b811682526001600160e81b031960e896871b8116601484015294871b811660178301529290941b909216602b840152921b909116602e82015260420190565b90565b6001600160a01b0391909116815260200190565b6001600160a01b039788168152958716602087015260408601949094526060850192909252608084015290921660a082015260c081019190915260e00190565b6001600160a01b039889168152968816602088015260408701959095526060860193909352608085019190915260a084015290921660c082015260e08101919091526101000190565b6001600160a01b0393841681529183166020830152909116604082015260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039586168152602081019490945260408401929092529092166060820152608081019190915260a00190565b602080825282518282018190526000919060409081850190868401855b828110156148db57815180516001600160a01b03908116865287820151888701528682015187870152606080830151909116908601526080908101519085015260a09093019290850190600101614889565b5091979650505050505050565b901515815260200190565b60006020825282602083015282846040840137818301604090810191909152601f909201601f19160101919050565b602081016002831061493057fe5b91905290565b90815260200190565b600060208252610df66020830184614685565b6020808252600a9082015269232620a9a420a32a22a960b11b604082015260600190565b60208082526005908201526409c9e8aa8960db1b604082015260600190565b60208082526006908201526545584953545360d01b604082015260600190565b6020808252600590820152641513d5105360da1b604082015260600190565b6020808252600b908201526a554e415641494c41424c4560a81b604082015260600190565b60208082526006908201526515119495905360d21b604082015260600190565b6020808252600590820152644c5052454d60d81b604082015260600190565b60208082526004908201526314d1539560e21b604082015260600190565b6020808252600c908201526b24a72b20a624a22a27a5a2a760a11b604082015260600190565b602080825260069082015265494e53594e4360d01b604082015260600190565b600060208252825160a06020840152614ab860c0840182614685565b905060018060a01b0360208501511660408401526040840151606084015260608401516080840152608084015160a08401528091505092915050565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015614b435784516001600160a01b031683529383019391830191600101614b1e565b50506001600160a01b03969096166060850152505050608001529392505050565b918252602082015260400190565b60ff91909116815260200190565b60405181810167ffffffffffffffff81118282101715614b9c57fe5b604052919050565b600067ffffffffffffffff821115614bb857fe5b5060209081020190565b6001600160a01b03811681146107d157600080fd5b60ff811681146107d157600080fdfe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa164736f6c6343000706000a

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

000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000012c00000000000000000000000000000000000000000000000000000000000001e000000000000000000000000002f92800f57bcd74066f5709f1daa1a4302df8750000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f56400000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024ff47d552cb222b265d68c7aeb26e586d5229d000000000000000000000000000000000000000000000000000000000000001f506561706f647320426c75652043686970732028556e7765696768746564290000000000000000000000000000000000000000000000000000000000000000067070424c5545000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000004585fe77225b41b697c938b018e2ac67ac5a20c0000000000000000000000000a6cc3c2531fdaa6ae1a3ca84c2855806728693e800000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640

-----Decoded View---------------
Arg [0] : _name (string): Peapods Blue Chips (Unweighted)
Arg [1] : _symbol (string): ppBLUE
Arg [2] : _bondFee (uint256): 100
Arg [3] : _debondFee (uint256): 300
Arg [4] : _pools (address[]): 0x4585FE77225b41b697C938B018E2Ac67Ac5a20c0,0xa6Cc3C2531FdaA6Ae1A3CA84c2855806728693e8,0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640
Arg [5] : _lpRewardsToken (address): 0x02f92800F57BCD74066F5709F1Daa1A4302Df875
Arg [6] : _v2Router (address): 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
Arg [7] : _v3StableWETHPool (address): 0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640
Arg [8] : _dai (address): 0x6B175474E89094C44Da98b954EedeAC495271d0F
Arg [9] : _stakeRestriction (bool): False
Arg [10] : _v3TwapUtilities (address): 0x024ff47D552cB222b265D68C7aeB26E586D5229D

-----Encoded View---------------
19 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [1] : 00000000000000000000000000000000000000000000000000000000000001a0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000064
Arg [3] : 000000000000000000000000000000000000000000000000000000000000012c
Arg [4] : 00000000000000000000000000000000000000000000000000000000000001e0
Arg [5] : 00000000000000000000000002f92800f57bcd74066f5709f1daa1a4302df875
Arg [6] : 0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d
Arg [7] : 00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640
Arg [8] : 0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [10] : 000000000000000000000000024ff47d552cb222b265d68c7aeb26e586d5229d
Arg [11] : 000000000000000000000000000000000000000000000000000000000000001f
Arg [12] : 506561706f647320426c75652043686970732028556e77656967687465642900
Arg [13] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [14] : 7070424c55450000000000000000000000000000000000000000000000000000
Arg [15] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [16] : 0000000000000000000000004585fe77225b41b697c938b018e2ac67ac5a20c0
Arg [17] : 000000000000000000000000a6cc3c2531fdaa6ae1a3ca84c2855806728693e8
Arg [18] : 00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.