false
false
100

Contract Address Details

0x9A4C95A434adb0c9cBfb08aE61A5F19c1D992D94

Contract Name
PhotonStrategySushiCons..Product
Creator
0x2cb572–a2d739 at 0xf73b7a–9aa614
Balance
0 KAVA ( )
Tokens
Fetching tokens...
Transactions
Fetching transactions...
Transfers
Fetching transfers...
Gas Used
Fetching gas used...
Last Balance Update
11603210
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
PhotonStrategySushiConstantProduct




Optimization enabled
true
Compiler version
v0.8.15+commit.e14f2714




Optimization runs
200
EVM Version
default




Verified at
2022-10-20T17:29:28.824911Z

Constructor Arguments

00000000000000000000000088395b86cf9787e131d2fb5462a22b44056bf5740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f731202a3cf7efa9368c2d7bd613926f7a144db5000000000000000000000000c35dadb65012ec5796536bd9864ed8773abc74c4000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000003400000000000000000000000007851aa52d57730e9c8f7c5475d4fe77b590ebf56000000000000000000000000be811a0d44e2553d25d11cb8dc0d3f0d0e6430e60000000000000000000000004de13550be2864af04c95adb46b7c110652fd44c00000000000000000000000056d1cf278031fec41be07d81f205f469258a08d3000000000000000000000000a7e9c3c9aa809521293da39cabc5b73a34203286000000000000000000000000dc8f42f6f5b3fe12e310561603cc65f229548f5f000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000020000000000000000000000007c598c96d02398d89fbcb9d41eab3df0c16f227d000000000000000000000000c86c7c0efbd6a49b35e8714c5f59d99de09a225b0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c86c7c0efbd6a49b35e8714c5f59d99de09a225b0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c86c7c0efbd6a49b35e8714c5f59d99de09a225b0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c86c7c0efbd6a49b35e8714c5f59d99de09a225b000000000000000000000000fa9343c3897324496a05fc75abed6bac29f8a40f000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000100000000000000000000000052089cd962a5665498aea8d57576e2d3f68eb47d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000088395b86cf9787e131d2fb5462a22b44056bf574
              

Contract source code

// Sources flattened with hardhat v2.8.3 https://hardhat.org

// File @openzeppelin-4/contracts/token/ERC20/IERC20.sol@v4.7.2


// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev 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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from,
        address to,
        uint256 amount
    ) external returns (bool);
}


// File @openzeppelin-4/contracts/token/ERC20/extensions/IERC20Metadata.sol@v4.7.2


// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

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


// File @openzeppelin-4/contracts/utils/Context.sol@v4.7.2


// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^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 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) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}


// File @openzeppelin-4/contracts/token/ERC20/ERC20.sol@v4.7.2


// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;



/**
 * @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 Contracts guidelines: functions revert
 * instead 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, IERC20Metadata {
    mapping(address => uint256) private _balances;

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override 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 this function is
     * overridden;
     *
     * 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 override returns (uint8) {
        return 18;
    }

    /**
     * @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:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, 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}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, 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}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        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) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + 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) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This 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:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
        }
        _balances[to] += amount;

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, 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:
     *
     * - `account` 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 += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(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);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(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 Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

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

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}


// File @openzeppelin-4/contracts/token/ERC20/extensions/draft-IERC20Permit.sol@v4.7.2


// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}


// File @openzeppelin-4/contracts/utils/Address.sol@v4.7.2


// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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


// File @openzeppelin-4/contracts/token/ERC20/utils/SafeERC20.sol@v4.7.2


// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;



/**
 * @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 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'
        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) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

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

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}


// File contracts/BIFI/interfaces/sushi/ITridentRouter.sol



pragma solidity >=0.6.0 <0.9.0;
pragma experimental ABIEncoderV2;

interface ITridentRouter {
    struct Path {
        address pool;
        bytes data;
    }

    struct ExactInputParams {
        address tokenIn;
        uint256 amountIn;
        uint256 amountOutMinimum;
        Path[] path;
    }

    struct ExactInputSingleParams {
        uint256 amountIn;
        uint256 amountOutMinimum;
        address pool;
        address tokenIn;
        bytes data;
    }

    struct TokenInput {
        address token;
        bool native;
        uint256 amount;
    }

    function exactInputWithNativeToken(ExactInputParams calldata params) external returns (uint256 amountOut);

    function exactInputSingleWithNativeToken(
        ExactInputSingleParams calldata params
    ) external returns (uint256 amountOut);

    function addLiquidity(
        TokenInput[] calldata tokenInput,
        address pool,
        uint256 minLiquidity,
        bytes calldata data
    ) external returns (uint256 liquidity);

    function bento() external view returns (address);
}


// File contracts/BIFI/interfaces/sushi/IBentoPool.sol



pragma solidity ^0.8.0;

interface IBentoPool {
    struct TokenAmount {
        address token;
        uint256 amount;
    }
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getAmountOut(bytes calldata data) external view returns (uint256 finalAmountOut);
    function getNativeReserves() external view returns (
        uint256 _nativeReserve0,
        uint256 _nativeReserve1,
        uint32 _blockTimestampLast
    );
    function burn(
        bytes calldata data
    ) external returns (TokenAmount[] memory withdrawnAmounts);
}


// File contracts/BIFI/interfaces/sushi/IBentoBox.sol



pragma solidity >=0.6.0 <0.9.0;

interface IBentoBox {
    function setMasterContractApproval(
        address user,
        address masterContract,
        bool approved,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;
}


// File contracts/BIFI/interfaces/sushi/IMiniChefV2.sol



pragma solidity >0.6.0;

interface IMiniChefV2 {
    function poolLength() external view returns (uint256);
    function userInfo(uint256 _pid, address _user) external view returns (uint256, uint256);
    function pendingSushi(uint256 _pid, address _user) external view returns (uint256);
    function deposit(uint256 pid, uint256 amount, address to) external;
    function withdraw(uint256 pid, uint256 amount, address to) external;
    function harvest(uint256 pid, address to) external;
    function withdrawAndHarvest(uint256 pid, uint256 amount, address to) external;
    function emergencyWithdraw(uint256 pid, address to) external;
    function rewarder(uint256 pid) external view returns (address);
}


// File contracts/BIFI/interfaces/sushi/IRewarder.sol



pragma solidity >0.6.0;

interface IRewarder {
    function poolLength() external view returns (uint256);
    function userInfo(uint256 _pid, address _user) external view returns (uint256, uint256);
    function pendingToken(uint256 _pid, address _user) external view returns (uint256);
    function deposit(uint256 pid, uint256 amount, address to) external;
    function withdraw(uint256 pid, uint256 amount, address to) external;
    function harvest(uint256 pid, address to) external;
    function withdrawAndHarvest(uint256 pid, uint256 amount, address to) external;
    function emergencyWithdraw(uint256 pid, address to) external;
}


// File @openzeppelin-4/contracts/access/Ownable.sol@v4.7.2


// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

/**
 * @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() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        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 {
        _transferOwnership(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");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}


// File @openzeppelin-4/contracts/security/Pausable.sol@v4.7.2


// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}


// File contracts/BIFI/interfaces/common/IPhotonFeeConfig.sol



pragma solidity ^0.8.0;

interface IPhotonFeeConfig {
    struct FeeCategory {
        uint256 total;
        uint256 photon;
        uint256 call;
        uint256 strategist;
        string label;
        bool active;
    }
    function getFees(address strategy) external view returns (FeeCategory memory);
    function stratFeeId(address strategy) external view returns (uint256);
    function setStratFeeId(uint256 feeId) external;
}


// File contracts/BIFI/strategies/Common/PhotonStratFeeManager.sol



pragma solidity ^0.8.0;



contract PhotonStratFeeManager is Ownable, Pausable {

    struct CommonAddresses {
        address vault;
        address unirouter;
        address keeper;
        address strategist;
        address photonFeeRecipient;
        address photonFeeConfig;
    }

    // common addresses for the strategy
    address public vault;
    address public unirouter;
    address public keeper;
    address public strategist;
    address public photonFeeRecipient;
    IPhotonFeeConfig public photonFeeConfig;

    uint256 constant DIVISOR = 1 ether;
    uint256 constant public WITHDRAWAL_FEE_CAP = 50;
    uint256 constant public WITHDRAWAL_MAX = 10000;
    uint256 public withdrawalFee = 10;

    event SetStratFeeId(uint256 feeId);
    event SetWithdrawalFee(uint256 withdrawalFee);
    event SetVault(address vault);
    event SetUnirouter(address unirouter);
    event SetKeeper(address keeper);
    event SetStrategist(address strategist);
    event SetPhotonFeeRecipient(address photonFeeRecipient);
    event SetPhotonFeeConfig(address photonFeeConfig);

    constructor(
        CommonAddresses memory _commonAddresses
    ) {
        vault = _commonAddresses.vault;
        unirouter = _commonAddresses.unirouter;
        keeper = _commonAddresses.keeper;
        strategist = _commonAddresses.strategist;
        photonFeeRecipient = _commonAddresses.photonFeeRecipient;
        photonFeeConfig = IPhotonFeeConfig(_commonAddresses.photonFeeConfig);
    }

    // checks that caller is either owner or keeper.
    modifier onlyManager() {
        require(msg.sender == owner() || msg.sender == keeper, "!manager");
        _;
    }

    // fetch fees from config contract
    function getFees() public view returns (IPhotonFeeConfig.FeeCategory memory) {
        return photonFeeConfig.getFees(address(this));
    }

    function getStratFeeId() external view returns (uint256) {
        return photonFeeConfig.stratFeeId(address(this));
    }

    function setStratFeeId(uint256 _feeId) external onlyManager {
        photonFeeConfig.setStratFeeId(_feeId);
        emit SetStratFeeId(_feeId);
    }

    // adjust withdrawal fee
    function setWithdrawalFee(uint256 _fee) public onlyManager {
        require(_fee <= WITHDRAWAL_FEE_CAP, "!cap");
        withdrawalFee = _fee;
        emit SetWithdrawalFee(_fee);
    }

    // set new vault (only for strategy upgrades)
    function setVault(address _vault) external onlyOwner {
        vault = _vault;
        emit SetVault(_vault);
    }

    // set new unirouter
    function setUnirouter(address _unirouter) external onlyOwner {
        unirouter = _unirouter;
        emit SetUnirouter(_unirouter);
    }

    // set new keeper to manage strat
    function setKeeper(address _keeper) external onlyManager {
        keeper = _keeper;
        emit SetKeeper(_keeper);
    }

    // set new strategist address to receive strat fees
    function setStrategist(address _strategist) external {
        require(msg.sender == strategist, "!strategist");
        strategist = _strategist;
        emit SetStrategist(_strategist);
    }

    // set new photon fee address to receive photon fees
    function setPhotonFeeRecipient(address _photonFeeRecipient) external onlyOwner {
        photonFeeRecipient = _photonFeeRecipient;
        emit SetPhotonFeeRecipient(_photonFeeRecipient);
    }

    // set new fee config address to fetch fees
    function setPhotonFeeConfig(address _photonFeeConfig) external onlyOwner {
        photonFeeConfig = IPhotonFeeConfig(_photonFeeConfig);
        emit SetPhotonFeeConfig(_photonFeeConfig);
    }

    function beforeDeposit() external virtual {}
}


// File contracts/BIFI/utils/IGasPrice.sol



pragma solidity >=0.6.0 <0.9.0;

interface IGasPrice {
    function maxGasPrice() external returns (uint);
}


// File contracts/BIFI/utils/GasFeeThrottler.sol



pragma solidity ^0.8.0;


contract GasFeeThrottler {

    bool public shouldGasThrottle = true;

    address public gasprice = address(0xA43509661141F254F54D9A326E8Ec851A0b95307);

    modifier gasThrottle() {
        if (shouldGasThrottle && Address.isContract(gasprice)) {
            require(tx.gasprice <= IGasPrice(gasprice).maxGasPrice(), "gas is too high!");
        }
        _;
    }
}


// File contracts/BIFI/strategies/Sushi/PhotonStrategySushiConstantProduct.sol



pragma solidity ^0.8.0;








contract PhotonStrategySushiConstantProduct is PhotonStratFeeManager, GasFeeThrottler {
    using SafeERC20 for IERC20;

    struct Routes {
        address[] outputToNative;
        address[] rewardToNative;
        address[] nativeToLp0;
        address[] nativeToLp1;
    }

    struct Pools {
        address[] outputToNative;
        address[] rewardToNative;
        address[] nativeToLp0Pool;
        address[] nativeToLp1Pool;
    }

    struct SwapParams {
        ITridentRouter.ExactInputParams outputToNative;
        ITridentRouter.ExactInputParams rewardToNative;
        ITridentRouter.ExactInputParams nativeToLp0;
        ITridentRouter.ExactInputParams nativeToLp1;
    }

    // Tokens used
    address public native;
    address public output;
    address public reward;
    address public want;
    address public lpToken0;
    address public lpToken1;

    // Third party contracts
    address public chef;
    uint256 public poolId;
    address public bentoBox;

    bool public harvestOnDeposit;
    uint256 public lastHarvest;

    // Routes
    Routes private routes;
    Pools private pools;
    SwapParams private params;

    event StratHarvest(address indexed harvester, uint256 wantHarvested, uint256 tvl);
    event Deposit(uint256 tvl);
    event Withdraw(uint256 tvl);
    event ChargedFees(uint256 callFees, uint256 photonFees, uint256 strategistFees);

    constructor(
        address _want,
        uint256 _poolId,
        address _chef,
        address _bentoBox,
        Routes memory _routes,
        Pools memory _pools,
        CommonAddresses memory _commonAddresses
    ) PhotonStratFeeManager(_commonAddresses) {
        want = _want;
        poolId = _poolId;
        chef = _chef;
        bentoBox = _bentoBox;
        routes = _routes;
        pools = _pools;

        output = _routes.outputToNative[0];
        native = _routes.outputToNative[_routes.outputToNative.length - 1];
        assignParams(_routes.outputToNative, _pools.outputToNative, params.outputToNative);

        require(_routes.rewardToNative[_routes.rewardToNative.length - 1] == native, "rewardToNative[last] != native");
        reward = _routes.rewardToNative[0];
        assignParams(_routes.rewardToNative, _pools.rewardToNative, params.rewardToNative);

        // setup lp routing
        lpToken0 = IBentoPool(want).token0();
        require(_routes.nativeToLp0[0] == native, "nativeToLp0[0] != native");
        require(_routes.nativeToLp0[_routes.nativeToLp0.length - 1] == lpToken0, "nativeToLp0[last] != lpToken0");
        assignParams(_routes.nativeToLp0, _pools.nativeToLp0Pool, params.nativeToLp0);

        lpToken1 = IBentoPool(want).token1();
        require(_routes.nativeToLp1[0] == native, "nativeToLp1[0] != native");
        require(_routes.nativeToLp1[_routes.nativeToLp1.length - 1] == lpToken1, "nativeToLp1[last] != lpToken1");
        assignParams(_routes.nativeToLp1, _pools.nativeToLp1Pool, params.nativeToLp1);

        IBentoBox(bentoBox).setMasterContractApproval(address(this), unirouter, true, 0, bytes32(0), bytes32(0));

        _giveAllowances();
    }

    // puts the funds to work
    function deposit() public whenNotPaused {
        uint256 wantBal = IERC20(want).balanceOf(address(this));

        if (wantBal > 0) {
            IMiniChefV2(chef).deposit(poolId, wantBal, address(this));
            emit Deposit(balanceOf());
        }
    }

    function withdraw(uint256 _amount) external {
        require(msg.sender == vault, "!vault");

        uint256 wantBal = IERC20(want).balanceOf(address(this));

        if (wantBal < _amount) {
            IMiniChefV2(chef).withdraw(poolId, _amount - wantBal, address(this));
            wantBal = IERC20(want).balanceOf(address(this));
        }

        if (wantBal > _amount) {
            wantBal = _amount;
        }

        if (tx.origin != owner() && !paused()) {
            uint256 withdrawalFeeAmount = wantBal * withdrawalFee / WITHDRAWAL_MAX;
            wantBal = wantBal - withdrawalFeeAmount;
        }

        IERC20(want).safeTransfer(vault, wantBal);

        emit Withdraw(balanceOf());
    }

    function beforeDeposit() external override {
        if (harvestOnDeposit) {
            require(msg.sender == vault, "!vault");
            _harvest(tx.origin);
        }
    }

    function harvest() external gasThrottle virtual {
        _harvest(tx.origin);
    }

    function harvest(address callFeeRecipient) external gasThrottle virtual {
        _harvest(callFeeRecipient);
    }

    function managerHarvest() external onlyManager {
        _harvest(tx.origin);
    }

    // compounds earnings and charges performance fee
    function _harvest(address callFeeRecipient) internal whenNotPaused {
        IMiniChefV2(chef).harvest(poolId, address(this));
        uint256 outputBal = IERC20(output).balanceOf(address(this));
        uint256 rewardBal = IERC20(reward).balanceOf(address(this));
        if (outputBal > 0 || rewardBal > 0) {
            chargeFees(callFeeRecipient);
            addLiquidity();
            uint256 wantHarvested = balanceOfWant();
            deposit();

            lastHarvest = block.timestamp;
            emit StratHarvest(msg.sender, wantHarvested, balanceOf());
        }
    }

    // performance fees
    function chargeFees(address callFeeRecipient) internal {
        IPhotonFeeConfig.FeeCategory memory fees = getFees();

        uint256 rewardBal = IERC20(reward).balanceOf(address(this));
        if (rewardBal > 0 && reward != native) {
            ITridentRouter.ExactInputParams memory _rewardToNative = params.rewardToNative;
            _rewardToNative.amountIn = rewardBal;
            ITridentRouter(unirouter).exactInputWithNativeToken(_rewardToNative);
        }

        uint256 outputBal = IERC20(output).balanceOf(address(this));
        if (outputBal > 0) {
            ITridentRouter.ExactInputParams memory _outputToNative = params.outputToNative;
            _outputToNative.amountIn = outputBal;
            ITridentRouter(unirouter).exactInputWithNativeToken(_outputToNative);
        }

        uint256 nativeBal = IERC20(native).balanceOf(address(this)) * fees.total / DIVISOR;

        uint256 callFeeAmount = nativeBal * fees.call / DIVISOR;
        IERC20(native).safeTransfer(callFeeRecipient, callFeeAmount);

        uint256 photonFeeAmount = nativeBal * fees.photon / DIVISOR;
        IERC20(native).safeTransfer(photonFeeRecipient, photonFeeAmount);

        uint256 strategistFeeAmount = nativeBal * fees.strategist / DIVISOR;
        IERC20(native).safeTransfer(strategist, strategistFeeAmount);

        emit ChargedFees(callFeeAmount, photonFeeAmount, strategistFeeAmount);
    }

    // Adds liquidity to AMM and gets more LP tokens.
    function addLiquidity() internal {
        uint256 nativeHalf = IERC20(native).balanceOf(address(this)) / 2;

        if (lpToken0 != native) {
            ITridentRouter.ExactInputParams memory _nativeToLp0 = params.nativeToLp0;
            _nativeToLp0.amountIn = nativeHalf;
            ITridentRouter(unirouter).exactInputWithNativeToken(_nativeToLp0);
        }

        if (lpToken1 != native) {
            ITridentRouter.ExactInputParams memory _nativeToLp1 = params.nativeToLp1;
            _nativeToLp1.amountIn = nativeHalf;
            ITridentRouter(unirouter).exactInputWithNativeToken(_nativeToLp1);
        }

        ITridentRouter.TokenInput[] memory tokens = new ITridentRouter.TokenInput[](2);
        uint256 lp0Bal = IERC20(lpToken0).balanceOf(address(this));
        uint256 lp1Bal = IERC20(lpToken1).balanceOf(address(this));
        tokens[0] = ITridentRouter.TokenInput(lpToken0, true, lp0Bal);
        tokens[1] = ITridentRouter.TokenInput(lpToken1, true, lp1Bal);
        bytes memory data = abi.encode(address(this));

        ITridentRouter(unirouter).addLiquidity(tokens, want, 1, data);
    }

    // calculate the total underlaying 'want' held by the strat.
    function balanceOf() public view returns (uint256) {
        return balanceOfWant() + balanceOfPool();
    }

    // it calculates how much 'want' this contract holds.
    function balanceOfWant() public view returns (uint256) {
        return IERC20(want).balanceOf(address(this));
    }

    // it calculates how much 'want' the strategy has working in the farm.
    function balanceOfPool() public view returns (uint256) {
        (uint256 _amount, ) = IMiniChefV2(chef).userInfo(poolId, address(this));
        return _amount;
    }

    // returns rewards unharvested
    function rewardsAvailable() public view returns (uint256) {
        return IMiniChefV2(chef).pendingSushi(poolId, address(this));
    }

    // native reward amount for calling harvest
    function callReward() external view returns (uint256) {
        uint256 pendingReward;
        address rewarder = IMiniChefV2(chef).rewarder(poolId);
        if (rewarder != address(0)) {
            pendingReward = IRewarder(rewarder).pendingToken(poolId, address(this));
        }

        uint256 outputBal = rewardsAvailable();
        uint256 nativeOut;

        if (reward == native) {
            nativeOut = pendingReward;
        } else if (pendingReward > 0) {
            uint256 poolLength = params.rewardToNative.path.length;
            uint256 amount = pendingReward;
            for (uint i; i < poolLength;) {
                bytes memory data = abi.encode(routes.rewardToNative[i], amount);
                amount = IBentoPool(params.rewardToNative.path[i].pool).getAmountOut(data);
                unchecked { ++i; }
            }
            nativeOut = amount;
        }

        if (outputBal > 0) {
            bytes memory data = abi.encode(output, outputBal);
            nativeOut += IBentoPool(params.outputToNative.path[0].pool).getAmountOut(data);
        }

        IPhotonFeeConfig.FeeCategory memory fees = getFees();
        return nativeOut * fees.total / DIVISOR * fees.call / DIVISOR;
    }

    function setHarvestOnDeposit(bool _harvestOnDeposit) external onlyManager {
        harvestOnDeposit = _harvestOnDeposit;

        if (harvestOnDeposit) {
            setWithdrawalFee(0);
        } else {
            setWithdrawalFee(10);
        }
    }

    function setShouldGasThrottle(bool _shouldGasThrottle) external onlyManager {
        shouldGasThrottle = _shouldGasThrottle;
    }

    // called as part of strat migration. Sends all the available funds back to the vault.
    function retireStrat() external {
        require(msg.sender == vault, "!vault");

        IMiniChefV2(chef).emergencyWithdraw(poolId, address(this));

        uint256 wantBal = IERC20(want).balanceOf(address(this));
        IERC20(want).transfer(vault, wantBal);
    }

    // pauses deposits and withdraws all funds from third party systems.
    function panic() public onlyManager {
        pause();
        IMiniChefV2(chef).emergencyWithdraw(poolId, address(this));
    }

    function pause() public onlyManager {
        _pause();

        _removeAllowances();
    }

    function unpause() external onlyManager {
        _unpause();

        _giveAllowances();

        deposit();
    }

    function _giveAllowances() internal {
        IERC20(want).safeApprove(chef, type(uint).max);
        IERC20(output).safeApprove(bentoBox, type(uint).max);
        IERC20(native).safeApprove(bentoBox, type(uint).max);

        IERC20(lpToken0).safeApprove(bentoBox, 0);
        IERC20(lpToken0).safeApprove(bentoBox, type(uint).max);

        IERC20(lpToken1).safeApprove(bentoBox, 0);
        IERC20(lpToken1).safeApprove(bentoBox, type(uint).max);
    }

    function _removeAllowances() internal {
        IERC20(want).safeApprove(chef, 0);
        IERC20(output).safeApprove(bentoBox, 0);
        IERC20(native).safeApprove(bentoBox, 0);
        IERC20(lpToken0).safeApprove(bentoBox, 0);
        IERC20(lpToken1).safeApprove(bentoBox, 0);
    }

    function outputToNative() external view returns (address[] memory) {
        return routes.outputToNative;
    }

    function rewardToNative() external view returns (address[] memory) {
        return routes.rewardToNative;
    }

    function nativeToLp0() external view returns (address[] memory) {
        return routes.nativeToLp0;
    }

    function nativeToLp1() external view returns (address[] memory) {
        return routes.nativeToLp1;
    }

    function assignParams(address[] memory _route, address[] memory _pools, ITridentRouter.ExactInputParams storage _params) internal {
        uint256 routeLength = _route.length;
        uint256 poolLength = _pools.length;
        if (routeLength == 1) {
            return;
        }
        require (_route.length == poolLength + 1, "mismatch route pool length");
        
        bool unwrapBento;
        address destination;
        for (uint i; i < poolLength;) {
            if (i == poolLength - 1) {
                unwrapBento = true;
                destination = address(this);
            } else {
                destination = _pools[i+1];
            }
            _params.path.push(ITridentRouter.Path(_pools[i], abi.encode(_route[i], destination, unwrapBento)));
            unchecked { ++i; }
        }

        _params.tokenIn = _route[0];
        _params.amountOutMinimum = 1;
    }
}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_want","internalType":"address"},{"type":"uint256","name":"_poolId","internalType":"uint256"},{"type":"address","name":"_chef","internalType":"address"},{"type":"address","name":"_bentoBox","internalType":"address"},{"type":"tuple","name":"_routes","internalType":"struct PhotonStrategySushiConstantProduct.Routes","components":[{"type":"address[]","name":"outputToNative","internalType":"address[]"},{"type":"address[]","name":"rewardToNative","internalType":"address[]"},{"type":"address[]","name":"nativeToLp0","internalType":"address[]"},{"type":"address[]","name":"nativeToLp1","internalType":"address[]"}]},{"type":"tuple","name":"_pools","internalType":"struct PhotonStrategySushiConstantProduct.Pools","components":[{"type":"address[]","name":"outputToNative","internalType":"address[]"},{"type":"address[]","name":"rewardToNative","internalType":"address[]"},{"type":"address[]","name":"nativeToLp0Pool","internalType":"address[]"},{"type":"address[]","name":"nativeToLp1Pool","internalType":"address[]"}]},{"type":"tuple","name":"_commonAddresses","internalType":"struct PhotonStratFeeManager.CommonAddresses","components":[{"type":"address","name":"vault","internalType":"address"},{"type":"address","name":"unirouter","internalType":"address"},{"type":"address","name":"keeper","internalType":"address"},{"type":"address","name":"strategist","internalType":"address"},{"type":"address","name":"photonFeeRecipient","internalType":"address"},{"type":"address","name":"photonFeeConfig","internalType":"address"}]}]},{"type":"event","name":"ChargedFees","inputs":[{"type":"uint256","name":"callFees","internalType":"uint256","indexed":false},{"type":"uint256","name":"photonFees","internalType":"uint256","indexed":false},{"type":"uint256","name":"strategistFees","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Deposit","inputs":[{"type":"uint256","name":"tvl","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"SetKeeper","inputs":[{"type":"address","name":"keeper","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"SetPhotonFeeConfig","inputs":[{"type":"address","name":"photonFeeConfig","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"SetPhotonFeeRecipient","inputs":[{"type":"address","name":"photonFeeRecipient","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"SetStratFeeId","inputs":[{"type":"uint256","name":"feeId","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"SetStrategist","inputs":[{"type":"address","name":"strategist","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"SetUnirouter","inputs":[{"type":"address","name":"unirouter","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"SetVault","inputs":[{"type":"address","name":"vault","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"SetWithdrawalFee","inputs":[{"type":"uint256","name":"withdrawalFee","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"StratHarvest","inputs":[{"type":"address","name":"harvester","internalType":"address","indexed":true},{"type":"uint256","name":"wantHarvested","internalType":"uint256","indexed":false},{"type":"uint256","name":"tvl","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Withdraw","inputs":[{"type":"uint256","name":"tvl","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"WITHDRAWAL_FEE_CAP","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"WITHDRAWAL_MAX","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOfPool","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOfWant","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"beforeDeposit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"bentoBox","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"callReward","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"chef","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deposit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"gasprice","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct IPhotonFeeConfig.FeeCategory","components":[{"type":"uint256","name":"total","internalType":"uint256"},{"type":"uint256","name":"photon","internalType":"uint256"},{"type":"uint256","name":"call","internalType":"uint256"},{"type":"uint256","name":"strategist","internalType":"uint256"},{"type":"string","name":"label","internalType":"string"},{"type":"bool","name":"active","internalType":"bool"}]}],"name":"getFees","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getStratFeeId","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"harvest","inputs":[{"type":"address","name":"callFeeRecipient","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"harvest","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"harvestOnDeposit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"keeper","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastHarvest","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"lpToken0","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"lpToken1","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"managerHarvest","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"native","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"nativeToLp0","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"nativeToLp1","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"output","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"outputToNative","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"panic","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IPhotonFeeConfig"}],"name":"photonFeeConfig","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"photonFeeRecipient","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"poolId","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"retireStrat","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"reward","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"rewardToNative","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardsAvailable","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setHarvestOnDeposit","inputs":[{"type":"bool","name":"_harvestOnDeposit","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setKeeper","inputs":[{"type":"address","name":"_keeper","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPhotonFeeConfig","inputs":[{"type":"address","name":"_photonFeeConfig","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPhotonFeeRecipient","inputs":[{"type":"address","name":"_photonFeeRecipient","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setShouldGasThrottle","inputs":[{"type":"bool","name":"_shouldGasThrottle","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setStratFeeId","inputs":[{"type":"uint256","name":"_feeId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setStrategist","inputs":[{"type":"address","name":"_strategist","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setUnirouter","inputs":[{"type":"address","name":"_unirouter","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setVault","inputs":[{"type":"address","name":"_vault","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setWithdrawalFee","inputs":[{"type":"uint256","name":"_fee","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"shouldGasThrottle","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"strategist","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"unirouter","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"vault","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"want","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"withdrawalFee","inputs":[]}]
              

Contract Creation Code

0x6080604052600a600755600880546001600160a81b03191674a43509661141f254f54d9a326e8ec851a0b95307011790553480156200003d57600080fd5b5060405162004d7a38038062004d7a8339810160408190526200006091620011c4565b806200006c33620007ee565b6000805460ff60a01b191690558051600180546001600160a01b03199081166001600160a01b039384161790915560208084015160028054841691851691909117905560408401516003805484169185169190911790556060840151600480548416918516919091179055608084015160058054841691851691909117905560a090930151600680548316918416919091179055600c805482168b84161790556010899055600f805482168984161790556011805490911691871691909117905583518051859260139262000148928492919091019062000f56565b50602082810151805162000163926001850192019062000f56565b50604082015180516200018191600284019160209091019062000f56565b50606082015180516200019f91600384019160209091019062000f56565b505082518051849250601791620001bc9183916020019062000f56565b506020828101518051620001d7926001850192019062000f56565b5060408201518051620001f591600284019160209091019062000f56565b50606082015180516200021391600384019160209091019062000f56565b5090505082600001516000815181106200023157620002316200130a565b6020908102919091010151600a80546001600160a01b0319166001600160a01b03909216919091179055825180516200026d9060019062001336565b815181106200028057620002806200130a565b6020908102919091010151600980546001600160a01b0319166001600160a01b0390921691909117905582518251620002bc9190601b6200083e565b600954602084015180516001600160a01b0390921691620002e09060019062001336565b81518110620002f357620002f36200130a565b60200260200101516001600160a01b031614620003575760405162461bcd60e51b815260206004820152601e60248201527f726577617264546f4e61746976655b6c6173745d20213d206e6174697665000060448201526064015b60405180910390fd5b82602001516000815181106200037157620003716200130a565b6020026020010151600b60006101000a8154816001600160a01b0302191690836001600160a01b03160217905550620003be83602001518360200151601b6004016200083e60201b60201c565b600c60009054906101000a90046001600160a01b03166001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000412573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000438919062001350565b600d80546001600160a01b0319166001600160a01b03928316179055600954604085015180519190921691906000906200047657620004766200130a565b60200260200101516001600160a01b031614620004d65760405162461bcd60e51b815260206004820152601860248201527f6e6174697665546f4c70305b305d20213d206e6174697665000000000000000060448201526064016200034e565b600d54604084015180516001600160a01b0390921691620004fa9060019062001336565b815181106200050d576200050d6200130a565b60200260200101516001600160a01b0316146200056d5760405162461bcd60e51b815260206004820152601d60248201527f6e6174697665546f4c70305b6c6173745d20213d206c70546f6b656e3000000060448201526064016200034e565b6040808401519083015162000585919060236200083e565b600c60009054906101000a90046001600160a01b03166001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015620005d9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620005ff919062001350565b600e80546001600160a01b0319166001600160a01b03928316179055600954606085015180519190921691906000906200063d576200063d6200130a565b60200260200101516001600160a01b0316146200069d5760405162461bcd60e51b815260206004820152601860248201527f6e6174697665546f4c70315b305d20213d206e6174697665000000000000000060448201526064016200034e565b600e54606084015180516001600160a01b0390921691620006c19060019062001336565b81518110620006d457620006d46200130a565b60200260200101516001600160a01b031614620007345760405162461bcd60e51b815260206004820152601d60248201527f6e6174697665546f4c70315b6c6173745d20213d206c70546f6b656e3100000060448201526064016200034e565b606080840151908301516200074c919060276200083e565b60115460025460405163c0a47c9360e01b81523060048201526001600160a01b039182166024820152600160448201526000606482018190526084820181905260a482015291169063c0a47c939060c401600060405180830381600087803b158015620007b857600080fd5b505af1158015620007cd573d6000803e3d6000fd5b50505050620007e162000a5960201b60201c565b50505050505050620015a7565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b82518251600182900362000853575050505050565b620008608160016200136e565b855114620008b15760405162461bcd60e51b815260206004820152601a60248201527f6d69736d6174636820726f75746520706f6f6c206c656e67746800000000000060448201526064016200034e565b60008060005b8381101562000a0a57620008cd60018562001336565b8103620008e157600192503091506200090d565b86620008ef8260016200136e565b815181106200090257620009026200130a565b602002602001015191505b8560030160405180604001604052808984815181106200093157620009316200130a565b60200260200101516001600160a01b031681526020018a84815181106200095c576200095c6200130a565b6020026020010151858760405160200162000998939291906001600160a01b039384168152919092166020820152901515604082015260600190565b60408051808303601f1901815291905290528154600180820184556000938452602093849020835160029093020180546001600160a01b0319166001600160a01b03909316929092178255928201519192909190820190620009fb908262001417565b505050806001019050620008b7565b508660008151811062000a215762000a216200130a565b602090810291909101015185546001600160a01b0319166001600160a01b039091161785555050600160029093019290925550505050565b600f54600c5462000a86916001600160a01b03918216911660001962000b94602090811b62001c1d17901c565b601154600a5462000ab3916001600160a01b03918216911660001962000b94602090811b62001c1d17901c565b60115460095462000ae0916001600160a01b03918216911660001962000b94602090811b62001c1d17901c565b601154600d5462000b0c916001600160a01b039182169116600062000b94602090811b62001c1d17901c565b601154600d5462000b39916001600160a01b03918216911660001962000b94602090811b62001c1d17901c565b601154600e5462000b65916001600160a01b039182169116600062000b94602090811b62001c1d17901c565b601154600e5462000b92916001600160a01b03918216911660001962000b94602090811b62001c1d17901c565b565b80158062000c125750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa15801562000bea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000c109190620014e3565b155b62000c865760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084016200034e565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b1790915262000cde91859162000ce316565b505050565b600062000d3f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031662000dc160201b62001d6a179092919060201c565b80519091501562000cde578080602001905181019062000d609190620014fd565b62000cde5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016200034e565b606062000dd2848460008562000ddc565b90505b9392505050565b60608247101562000e3f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016200034e565b6001600160a01b0385163b62000e985760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016200034e565b600080866001600160a01b0316858760405162000eb6919062001554565b60006040518083038185875af1925050503d806000811462000ef5576040519150601f19603f3d011682016040523d82523d6000602084013e62000efa565b606091505b50909250905062000f0d82828662000f18565b979650505050505050565b6060831562000f2957508162000dd5565b82511562000f3a5782518084602001fd5b8160405162461bcd60e51b81526004016200034e919062001572565b82805482825590600052602060002090810192821562000fae579160200282015b8281111562000fae57825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000f77565b5062000fbc92915062000fc0565b5090565b5b8082111562000fbc576000815560010162000fc1565b80516001600160a01b038116811462000fef57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b03811182821017156200102f576200102f62000ff4565b60405290565b60405160c081016001600160401b03811182821017156200102f576200102f62000ff4565b600082601f8301126200106c57600080fd5b815160206001600160401b03808311156200108b576200108b62000ff4565b8260051b604051601f19603f83011681018181108482111715620010b357620010b362000ff4565b604052938452858101830193838101925087851115620010d257600080fd5b83870191505b8482101562000f0d57620010ec8262000fd7565b83529183019190830190620010d8565b6000608082840312156200110f57600080fd5b620011196200100a565b82519091506001600160401b03808211156200113457600080fd5b62001142858386016200105a565b835260208401519150808211156200115957600080fd5b62001167858386016200105a565b602084015260408401519150808211156200118157600080fd5b6200118f858386016200105a565b60408401526060840151915080821115620011a957600080fd5b50620011b8848285016200105a565b60608301525092915050565b6000806000806000806000878903610180811215620011e257600080fd5b620011ed8962000fd7565b9750602089015196506200120460408a0162000fd7565b95506200121460608a0162000fd7565b60808a01519095506001600160401b03808211156200123257600080fd5b620012408c838d01620010fc565b955060a08b01519150808211156200125757600080fd5b50620012668b828c01620010fc565b93505060c060bf19820112156200127c57600080fd5b506200128762001035565b6200129560c08a0162000fd7565b8152620012a560e08a0162000fd7565b6020820152620012b96101008a0162000fd7565b6040820152620012cd6101208a0162000fd7565b6060820152620012e16101408a0162000fd7565b6080820152620012f56101608a0162000fd7565b60a08201528091505092959891949750929550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000828210156200134b576200134b62001320565b500390565b6000602082840312156200136357600080fd5b62000dd58262000fd7565b6000821982111562001384576200138462001320565b500190565b600181811c908216806200139e57607f821691505b602082108103620013bf57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000cde57600081815260208120601f850160051c81016020861015620013ee5750805b601f850160051c820191505b818110156200140f57828155600101620013fa565b505050505050565b81516001600160401b0381111562001433576200143362000ff4565b6200144b8162001444845462001389565b84620013c5565b602080601f8311600181146200148357600084156200146a5750858301515b600019600386901b1c1916600185901b1785556200140f565b600085815260208120601f198616915b82811015620014b45788860151825594840194600190910190840162001493565b5085821015620014d35787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215620014f657600080fd5b5051919050565b6000602082840312156200151057600080fd5b8151801515811462000dd557600080fd5b60005b838110156200153e57818101518382015260200162001524565b838111156200154e576000848401525b50505050565b600082516200156881846020870162001521565b9190910192915050565b60208152600082518060208401526200159381604085016020870162001521565b601f01601f19169190910160400192915050565b6137c380620015b76000396000f3fe608060405234801561001057600080fd5b50600436106103835760003560e01c80638456cb59116101de578063d801d9461161010f578063ec5e8b1b116100ad578063fad4675e1161007c578063fad4675e146106c3578063fb617787146106d6578063fbadfb97146106de578063fbfa77cf146106f157600080fd5b8063ec5e8b1b14610681578063f1a392da14610694578063f20eaeb81461069d578063f2fde38b146106b057600080fd5b8063db8d55f1116100e9578063db8d55f114610654578063dfbdc43714610669578063e7a7250a14610671578063ea82eb9e1461067957600080fd5b8063d801d94614610631578063d92f3d7314610639578063da512c341461064c57600080fd5b80639ce8e1391161017c578063aced166111610156578063aced1661146105fb578063c1a3d44c1461060e578063c7b9d53014610616578063d0e30db01461062957600080fd5b80639ce8e139146105c85780639f8b5da1146105db578063ac1e5025146105e857600080fd5b80638bc7e8c4116101b85780638bc7e8c41461059e5780638cfc0250146105a75780638da5cb5b146105af57806397fd323d146105c057600080fd5b80638456cb591461056f578063877562b6146105775780638912cb8b1461058a57600080fd5b80633e55f932116102b85780635ee167c0116102565780636ec232d3116102305780636ec232d314610534578063715018a61461054c578063722713f714610554578063748747e61461055c57600080fd5b80635ee167c0146104fb5780636817031b1461050e5780636b2ace871461052157600080fd5b80634700d305116102925780634700d305146104c457806354518b1a146104cc578063573fef0a146104d55780635c975abb146104dd57600080fd5b80633e55f932146104a15780633f4ba83a146104b45780634641257d146104bc57600080fd5b80631fe4a686116103255780632e1a7d4d116102ff5780632e1a7d4d1461046a5780632ee24a5f1461047d57806337bdd204146104905780633e0dc34e1461049857600080fd5b80631fe4a68614610431578063228cb73314610444578063257ae0de1461045757600080fd5b806311b0b42d1161036157806311b0b42d146103cb57806313e120b1146103f65780631f1fcd511461040b5780631fc8bc5d1461041e57600080fd5b80630e5c011e146103885780630e8fbb5a1461039d57806311588086146103b0575b600080fd5b61039b6103963660046131be565b610704565b005b61039b6103ab3660046131e9565b6107f7565b6103b8610871565b6040519081526020015b60405180910390f35b6009546103de906001600160a01b031681565b6040516001600160a01b0390911681526020016103c2565b6103fe6108f3565b6040516103c29190613206565b600c546103de906001600160a01b031681565b600f546103de906001600160a01b031681565b6004546103de906001600160a01b031681565b600b546103de906001600160a01b031681565b6002546103de906001600160a01b031681565b61039b610478366004613253565b610958565b6005546103de906001600160a01b031681565b6103fe610ba3565b6103b860105481565b61039b6104af366004613253565b610c06565b61039b610cdf565b61039b610d38565b61039b610e23565b6103b861271081565b61039b610ed4565b600054600160a01b900460ff165b60405190151581526020016103c2565b600d546103de906001600160a01b031681565b61039b61051c3660046131be565b610f10565b6011546103de906001600160a01b031681565b6008546103de9061010090046001600160a01b031681565b61039b610f66565b6103b8610f78565b61039b61056a3660046131be565b610f99565b61039b611026565b600e546103de906001600160a01b031681565b6011546104eb90600160a01b900460ff1681565b6103b860075481565b6103b8611075565b6000546001600160a01b03166103de565b6103b86110e3565b6006546103de906001600160a01b031681565b6008546104eb9060ff1681565b61039b6105f6366004613253565b61144f565b6003546103de906001600160a01b031681565b6103b86114fd565b61039b6106243660046131be565b61152e565b61039b6115c4565b61039b6116e7565b61039b6106473660046131be565b611726565b6103fe61177c565b61065c6117df565b6040516103c291906132c4565b6103b8603281565b6103b861188a565b6103fe6118c6565b61039b61068f3660046131be565b611929565b6103b860125481565b600a546103de906001600160a01b031681565b61039b6106be3660046131be565b61197f565b61039b6106d13660046131e9565b6119f5565b61039b611a47565b61039b6106ec3660046131be565b611bc7565b6001546103de906001600160a01b031681565b60085460ff168015610726575060085461010090046001600160a01b03163b15155b156107eb57600860019054906101000a90046001600160a01b03166001600160a01b0316633de39c116040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610780573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a49190613320565b3a11156107eb5760405162461bcd60e51b815260206004820152601060248201526f67617320697320746f6f20686967682160801b60448201526064015b60405180910390fd5b6107f481611d83565b50565b6000546001600160a01b031633148061081a57506003546001600160a01b031633145b6108365760405162461bcd60e51b81526004016107e290613339565b6011805460ff60a01b1916600160a01b8315158102919091179182905560ff91041615610867576107f4600061144f565b6107f4600a61144f565b600f546010546040516393f1a40b60e01b8152600481019190915230602482015260009182916001600160a01b03909116906393f1a40b906044016040805180830381865afa1580156108c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ec919061335b565b5092915050565b6060601360000180548060200260200160405190810160405280929190818152602001828054801561094e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610930575b5050505050905090565b6001546001600160a01b031633146109825760405162461bcd60e51b81526004016107e29061337f565b600c546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156109cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ef9190613320565b905081811015610ae657600f546010546001600160a01b0390911690630ad58d2f90610a1b84866133b5565b6040516001600160e01b031960e085901b16815260048101929092526024820152306044820152606401600060405180830381600087803b158015610a5f57600080fd5b505af1158015610a73573d6000803e3d6000fd5b5050600c546040516370a0823160e01b81523060048201526001600160a01b0390911692506370a082319150602401602060405180830381865afa158015610abf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae39190613320565b90505b81811115610af15750805b6000546001600160a01b03163214801590610b165750600054600160a01b900460ff16155b15610b4857600061271060075483610b2e91906133cc565b610b3891906133eb565b9050610b4481836133b5565b9150505b600154600c54610b65916001600160a01b03918216911683611f5c565b7f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d610b8e610f78565b60405190815260200160405180910390a15050565b6060601360030180548060200260200160405190810160405280929190818152602001828054801561094e576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610930575050505050905090565b6000546001600160a01b0316331480610c2957506003546001600160a01b031633145b610c455760405162461bcd60e51b81526004016107e290613339565b600654604051631f2afc9960e11b8152600481018390526001600160a01b0390911690633e55f93290602401600060405180830381600087803b158015610c8b57600080fd5b505af1158015610c9f573d6000803e3d6000fd5b505050507f9163810ee1e29168d4ce900e48a333fb8fbd3fd070d2bef67f6d4db0846a469f81604051610cd491815260200190565b60405180910390a150565b6000546001600160a01b0316331480610d0257506003546001600160a01b031633145b610d1e5760405162461bcd60e51b81526004016107e290613339565b610d26611f8c565b610d2e611fe1565b610d366115c4565b565b60085460ff168015610d5a575060085461010090046001600160a01b03163b15155b15610e1a57600860019054906101000a90046001600160a01b03166001600160a01b0316633de39c116040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610db4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd89190613320565b3a1115610e1a5760405162461bcd60e51b815260206004820152601060248201526f67617320697320746f6f20686967682160801b60448201526064016107e2565b610d3632611d83565b6000546001600160a01b0316331480610e4657506003546001600160a01b031633145b610e625760405162461bcd60e51b81526004016107e290613339565b610e6a611026565b600f546010546040516302f940c760e41b815260048101919091523060248201526001600160a01b0390911690632f940c7090604401600060405180830381600087803b158015610eba57600080fd5b505af1158015610ece573d6000803e3d6000fd5b50505050565b601154600160a01b900460ff1615610d36576001546001600160a01b03163314610e1a5760405162461bcd60e51b81526004016107e29061337f565b610f186120b8565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527fd459c7242e23d490831b5676a611c4342d899d28f342d89ae80793e56a930f3090602001610cd4565b610f6e6120b8565b610d366000612112565b6000610f82610871565b610f8a6114fd565b610f94919061340d565b905090565b6000546001600160a01b0316331480610fbc57506003546001600160a01b031633145b610fd85760405162461bcd60e51b81526004016107e290613339565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fefb5cfa1a8690c124332ab93324539c5c9c4be03f28aeb8be86f2d8a0c9fb99b90602001610cd4565b6000546001600160a01b031633148061104957506003546001600160a01b031633145b6110655760405162461bcd60e51b81526004016107e290613339565b61106d612162565b610d366121a5565b600654604051636788231160e11b81523060048201526000916001600160a01b03169063cf104622906024015b602060405180830381865afa1580156110bf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f949190613320565b600f5460105460405163c346253d60e01b81526004810191909152600091829182916001600160a01b03169063c346253d90602401602060405180830381865afa158015611135573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111599190613425565b90506001600160a01b038116156111e0576010546040516312390ebd60e21b815260048101919091523060248201526001600160a01b038216906348e43af490604401602060405180830381865afa1580156111b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111dd9190613320565b91505b60006111ea61188a565b600954600b549192506000916001600160a01b0391821691160361120f575082611321565b8315611321576022548460005b8281101561131c5760006013600101828154811061123c5761123c613442565b60009182526020918290200154604080516001600160a01b03909216928201929092529081018490526060016040516020818303038152906040529050601b600401600301828154811061129257611292613442565b6000918252602090912060029091020154604051635478fa9760e11b81526001600160a01b039091169063a8f1f52e906112d0908490600401613458565b602060405180830381865afa1580156112ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113119190613320565b92505060010161121c565b509150505b81156113f457600a54604080516001600160a01b03909216602083015281810184905280518083038201815260609092019052601e805460009061136757611367613442565b6000918252602090912060029091020154604051635478fa9760e11b81526001600160a01b039091169063a8f1f52e906113a5908490600401613458565b602060405180830381865afa1580156113c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e69190613320565b6113f0908361340d565b9150505b60006113fe6117df565b9050670de0b6b3a76400008160400151670de0b6b3a764000083600001518561142791906133cc565b61143191906133eb565b61143b91906133cc565b61144591906133eb565b9550505050505090565b6000546001600160a01b031633148061147257506003546001600160a01b031633145b61148e5760405162461bcd60e51b81526004016107e290613339565b60328111156114c85760405162461bcd60e51b81526004016107e2906020808252600490820152630216361760e41b604082015260600190565b60078190556040518181527f3aa4413905e8f015896ec5880bdde24088ccb19b578f9fcf6800354d5320d4af90602001610cd4565b600c546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a08231906024016110a2565b6004546001600160a01b031633146115765760405162461bcd60e51b815260206004820152600b60248201526a085cdd1c985d1959da5cdd60aa1b60448201526064016107e2565b600480546001600160a01b0319166001600160a01b0383169081179091556040519081527f46d58e3fa07bf19b1d27240f0e286b27e9f7c1b0d88933333fe833b60eec541290602001610cd4565b6115cc61223b565b600c546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015611615573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116399190613320565b905080156107f457600f54601054604051638dbdbe6d60e01b81526004810191909152602481018390523060448201526001600160a01b0390911690638dbdbe6d90606401600060405180830381600087803b15801561169857600080fd5b505af11580156116ac573d6000803e3d6000fd5b505050507f4d6ce1e535dbade1c23defba91e23b8f791ce5edc0cc320257a2b364e4e384266116d9610f78565b604051908152602001610cd4565b6000546001600160a01b031633148061170a57506003546001600160a01b031633145b610e1a5760405162461bcd60e51b81526004016107e290613339565b61172e6120b8565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527f5ca6e64c4522e68e154aa9372f2c5969cd37d9640e59f66953dc472f54ee86fa90602001610cd4565b6060601360010180548060200260200160405190810160405280929190818152602001828054801561094e576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610930575050505050905090565b61181a6040518060c0016040528060008152602001600081526020016000815260200160008152602001606081526020016000151581525090565b600654604051639af608c960e01b81523060048201526001600160a01b0390911690639af608c990602401600060405180830381865afa158015611862573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f9491908101906134eb565b600f5460105460405163065509bb60e21b815260048101919091523060248201526000916001600160a01b03169063195426ec906044016110a2565b6060601360020180548060200260200160405190810160405280929190818152602001828054801561094e576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610930575050505050905090565b6119316120b8565b600680546001600160a01b0319166001600160a01b0383169081179091556040519081527f1a410ffc0036aada0a490b5843db8cbd3bb689c364cd7da3e16fc99b91e6625d90602001610cd4565b6119876120b8565b6001600160a01b0381166119ec5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107e2565b6107f481612112565b6000546001600160a01b0316331480611a1857506003546001600160a01b031633145b611a345760405162461bcd60e51b81526004016107e290613339565b6008805460ff1916911515919091179055565b6001546001600160a01b03163314611a715760405162461bcd60e51b81526004016107e29061337f565b600f546010546040516302f940c760e41b815260048101919091523060248201526001600160a01b0390911690632f940c7090604401600060405180830381600087803b158015611ac157600080fd5b505af1158015611ad5573d6000803e3d6000fd5b5050600c546040516370a0823160e01b8152306004820152600093506001600160a01b0390911691506370a0823190602401602060405180830381865afa158015611b24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b489190613320565b600c5460015460405163a9059cbb60e01b81526001600160a01b03918216600482015260248101849052929350169063a9059cbb906044016020604051808303816000875af1158015611b9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bc391906135e1565b5050565b611bcf6120b8565b600580546001600160a01b0319166001600160a01b0383169081179091556040519081527f1edbf5cd8b0472c64d28e0718c563f699b0cbe37cf4bb596f612604488a4882490602001610cd4565b801580611c975750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015611c71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c959190613320565b155b611d025760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016107e2565b6040516001600160a01b038316602482015260448101829052611d6590849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612288565b505050565b6060611d79848460008561235a565b90505b9392505050565b611d8b61223b565b600f54601054604051630c7e663b60e11b815260048101919091523060248201526001600160a01b03909116906318fccc7690604401600060405180830381600087803b158015611ddb57600080fd5b505af1158015611def573d6000803e3d6000fd5b5050600a546040516370a0823160e01b8152306004820152600093506001600160a01b0390911691506370a0823190602401602060405180830381865afa158015611e3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e629190613320565b600b546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a0823190602401602060405180830381865afa158015611eb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed49190613320565b90506000821180611ee55750600081115b15611d6557611ef38361248b565b611efb612aa3565b6000611f056114fd565b9050611f0f6115c4565b42601255337f9bc239f1724cacfb88cb1d66a2dc437467699b68a8c90d7b63110cf4b6f9241082611f3e610f78565b6040805192835260208301919091520160405180910390a250505050565b6040516001600160a01b038316602482015260448101829052611d6590849063a9059cbb60e01b90606401611d2e565b611f94613120565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600f54600c54612000916001600160a01b039182169116600019611c1d565b601154600a5461201f916001600160a01b039182169116600019611c1d565b60115460095461203e916001600160a01b039182169116600019611c1d565b601154600d5461205c916001600160a01b0391821691166000611c1d565b601154600d5461207b916001600160a01b039182169116600019611c1d565b601154600e54612099916001600160a01b0391821691166000611c1d565b601154600e54610d36916001600160a01b039182169116600019611c1d565b6000546001600160a01b03163314610d365760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107e2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61216a61223b565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611fc43390565b600f54600c546121c3916001600160a01b0391821691166000611c1d565b601154600a546121e1916001600160a01b0391821691166000611c1d565b6011546009546121ff916001600160a01b0391821691166000611c1d565b601154600d5461221d916001600160a01b0391821691166000611c1d565b601154600e54610d36916001600160a01b0391821691166000611c1d565b600054600160a01b900460ff1615610d365760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016107e2565b60006122dd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611d6a9092919063ffffffff16565b805190915015611d6557808060200190518101906122fb91906135e1565b611d655760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016107e2565b6060824710156123bb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016107e2565b6001600160a01b0385163b6124125760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107e2565b600080866001600160a01b0316858760405161242e91906135fe565b60006040518083038185875af1925050503d806000811461246b576040519150601f19603f3d011682016040523d82523d6000602084013e612470565b606091505b5091509150612480828286613170565b979650505050505050565b60006124956117df565b600b546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156124e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125079190613320565b905060008111801561252a5750600954600b546001600160a01b03908116911614155b156126d95760408051608081018252601f80546001600160a01b0316825260208054818401526021548385015260228054855181840281018401909652808652600095606086019390929190879084015b82821015612654576000848152602090819020604080518082019091526002850290910180546001600160a01b0316825260018101805492939192918401916125c39061361a565b80601f01602080910402602001604051908101604052809291908181526020018280546125ef9061361a565b801561263c5780601f106126115761010080835404028352916020019161263c565b820191906000526020600020905b81548152906001019060200180831161261f57829003601f168201915b5050505050815250508152602001906001019061257b565b50505091525050602081018390526002546040516305868d8f60e11b81529192506001600160a01b031690630b0d1b1e90612693908490600401613654565b6020604051808303816000875af11580156126b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126d69190613320565b50505b600a546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015612722573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127469190613320565b905080156128fc5760408051608081018252601b80546001600160a01b03168252601c54602080840191909152601d5483850152601e8054855181840281018401909652808652600095606086019390929190879084015b82821015612877576000848152602090819020604080518082019091526002850290910180546001600160a01b0316825260018101805492939192918401916127e69061361a565b80601f01602080910402602001604051908101604052809291908181526020018280546128129061361a565b801561285f5780601f106128345761010080835404028352916020019161285f565b820191906000526020600020905b81548152906001019060200180831161284257829003601f168201915b5050505050815250508152602001906001019061279e565b50505091525050602081018390526002546040516305868d8f60e11b81529192506001600160a01b031690630b0d1b1e906128b6908490600401613654565b6020604051808303816000875af11580156128d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128f99190613320565b50505b82516009546040516370a0823160e01b8152306004820152600092670de0b6b3a76400009290916001600160a01b03909116906370a0823190602401602060405180830381865afa158015612955573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129799190613320565b61298391906133cc565b61298d91906133eb565b90506000670de0b6b3a76400008560400151836129aa91906133cc565b6129b491906133eb565b6009549091506129ce906001600160a01b03168783611f5c565b6000670de0b6b3a76400008660200151846129e991906133cc565b6129f391906133eb565b600554600954919250612a13916001600160a01b03908116911683611f5c565b6000670de0b6b3a7640000876060015185612a2e91906133cc565b612a3891906133eb565b600454600954919250612a58916001600160a01b03908116911683611f5c565b60408051848152602081018490529081018290527fd255b592c7f268a73e534da5219a60ff911b4cf6daae21c7d20527dd657bd99a9060600160405180910390a15050505050505050565b6009546040516370a0823160e01b81523060048201526000916002916001600160a01b03909116906370a0823190602401602060405180830381865afa158015612af1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b159190613320565b612b1f91906133eb565b600954600d549192506001600160a01b03918216911614612ce85760408051608081018252602380546001600160a01b031682526024546020808401919091526025548385015260268054855181840281018401909652808652600095606086019390929190879084015b82821015612c63576000848152602090819020604080518082019091526002850290910180546001600160a01b031682526001810180549293919291840191612bd29061361a565b80601f0160208091040260200160405190810160405280929190818152602001828054612bfe9061361a565b8015612c4b5780601f10612c2057610100808354040283529160200191612c4b565b820191906000526020600020905b815481529060010190602001808311612c2e57829003601f168201915b50505050508152505081526020019060010190612b8a565b50505091525050602081018390526002546040516305868d8f60e11b81529192506001600160a01b031690630b0d1b1e90612ca2908490600401613654565b6020604051808303816000875af1158015612cc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ce59190613320565b50505b600954600e546001600160a01b03908116911614612eae5760408051608081018252602780546001600160a01b0316825260285460208084019190915260295483850152602a8054855181840281018401909652808652600095606086019390929190879084015b82821015612e29576000848152602090819020604080518082019091526002850290910180546001600160a01b031682526001810180549293919291840191612d989061361a565b80601f0160208091040260200160405190810160405280929190818152602001828054612dc49061361a565b8015612e115780601f10612de657610100808354040283529160200191612e11565b820191906000526020600020905b815481529060010190602001808311612df457829003601f168201915b50505050508152505081526020019060010190612d50565b50505091525050602081018390526002546040516305868d8f60e11b81529192506001600160a01b031690630b0d1b1e90612e68908490600401613654565b6020604051808303816000875af1158015612e87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eab9190613320565b50505b60408051600280825260608201909252600091816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181612ec657905050600d546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a0823190602401602060405180830381865afa158015612f41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f659190613320565b600e546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a0823190602401602060405180830381865afa158015612fb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fd79190613320565b60408051606081018252600d546001600160a01b0316815260016020820152908101849052845191925090849060009061301357613013613442565b60209081029190910181019190915260408051606081018252600e546001600160a01b031681526001928101839052908101839052845190918591811061305c5761305c613442565b602002602001018190525060003060405160200161308991906001600160a01b0391909116815260200190565b60408051601f1981840301815290829052600254600c54632cfcb94f60e01b84529193506001600160a01b0390811692632cfcb94f926130d592899291169060019087906004016136fe565b6020604051808303816000875af11580156130f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131189190613320565b505050505050565b600054600160a01b900460ff16610d365760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016107e2565b6060831561317f575081611d7c565b82511561318f5782518084602001fd5b8160405162461bcd60e51b81526004016107e29190613458565b6001600160a01b03811681146107f457600080fd5b6000602082840312156131d057600080fd5b8135611d7c816131a9565b80151581146107f457600080fd5b6000602082840312156131fb57600080fd5b8135611d7c816131db565b6020808252825182820181905260009190848201906040850190845b818110156132475783516001600160a01b031683529284019291840191600101613222565b50909695505050505050565b60006020828403121561326557600080fd5b5035919050565b60005b8381101561328757818101518382015260200161326f565b83811115610ece5750506000910152565b600081518084526132b081602086016020860161326c565b601f01601f19169290920160200192915050565b60208152815160208201526020820151604082015260408201516060820152606082015160808201526000608083015160c060a084015261330860e0840182613298565b905060a0840151151560c08401528091505092915050565b60006020828403121561333257600080fd5b5051919050565b60208082526008908201526710b6b0b730b3b2b960c11b604082015260600190565b6000806040838503121561336e57600080fd5b505080516020909101519092909150565b602080825260069082015265085d985d5b1d60d21b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000828210156133c7576133c761339f565b500390565b60008160001904831182151516156133e6576133e661339f565b500290565b60008261340857634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156134205761342061339f565b500190565b60006020828403121561343757600080fd5b8151611d7c816131a9565b634e487b7160e01b600052603260045260246000fd5b602081526000611d7c6020830184613298565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff811182821017156134a4576134a461346b565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156134d3576134d361346b565b604052919050565b80516134e6816131db565b919050565b600060208083850312156134fe57600080fd5b825167ffffffffffffffff8082111561351657600080fd5b9084019060c0828703121561352a57600080fd5b613532613481565b825181528383015184820152604083015160408201526060830151606082015260808301518281111561356457600080fd5b8301601f8101881361357557600080fd5b8051838111156135875761358761346b565b613599601f8201601f191687016134aa565b935080845288868284010111156135af57600080fd5b6135be8187860188850161326c565b50508160808201526135d260a084016134db565b60a08201529695505050505050565b6000602082840312156135f357600080fd5b8151611d7c816131db565b6000825161361081846020870161326c565b9190910192915050565b600181811c9082168061362e57607f821691505b60208210810361364e57634e487b7160e01b600052602260045260246000fd5b50919050565b6000602080835260a0830160018060a01b03808651168386015282860151604081818801528088015160608801526060880151915060808088015283825180865260c08901915060c08160051b8a01019550868401935060005b818110156136ef5789870360bf1901835284518051871688528801518888018590526136dc85890182613298565b97505093870193918701916001016136ae565b50949998505050505050505050565b6080808252855190820181905260009060209060a0840190828901845b8281101561375857815180516001600160a01b0316855285810151151586860152604090810151908501526060909301929084019060010161371b565b5050506001600160a01b0387168483015285604085015283810360608501526137818186613298565b9897505050505050505056fea264697066735822122003a631f65b29d5bd049322a33fef77279344370c3825bb8674c38a2a52b9594d64736f6c634300080f003300000000000000000000000088395b86cf9787e131d2fb5462a22b44056bf5740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f731202a3cf7efa9368c2d7bd613926f7a144db5000000000000000000000000c35dadb65012ec5796536bd9864ed8773abc74c4000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000003400000000000000000000000007851aa52d57730e9c8f7c5475d4fe77b590ebf56000000000000000000000000be811a0d44e2553d25d11cb8dc0d3f0d0e6430e60000000000000000000000004de13550be2864af04c95adb46b7c110652fd44c00000000000000000000000056d1cf278031fec41be07d81f205f469258a08d3000000000000000000000000a7e9c3c9aa809521293da39cabc5b73a34203286000000000000000000000000dc8f42f6f5b3fe12e310561603cc65f229548f5f000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000020000000000000000000000007c598c96d02398d89fbcb9d41eab3df0c16f227d000000000000000000000000c86c7c0efbd6a49b35e8714c5f59d99de09a225b0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c86c7c0efbd6a49b35e8714c5f59d99de09a225b0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c86c7c0efbd6a49b35e8714c5f59d99de09a225b0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c86c7c0efbd6a49b35e8714c5f59d99de09a225b000000000000000000000000fa9343c3897324496a05fc75abed6bac29f8a40f000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000100000000000000000000000052089cd962a5665498aea8d57576e2d3f68eb47d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000088395b86cf9787e131d2fb5462a22b44056bf574

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106103835760003560e01c80638456cb59116101de578063d801d9461161010f578063ec5e8b1b116100ad578063fad4675e1161007c578063fad4675e146106c3578063fb617787146106d6578063fbadfb97146106de578063fbfa77cf146106f157600080fd5b8063ec5e8b1b14610681578063f1a392da14610694578063f20eaeb81461069d578063f2fde38b146106b057600080fd5b8063db8d55f1116100e9578063db8d55f114610654578063dfbdc43714610669578063e7a7250a14610671578063ea82eb9e1461067957600080fd5b8063d801d94614610631578063d92f3d7314610639578063da512c341461064c57600080fd5b80639ce8e1391161017c578063aced166111610156578063aced1661146105fb578063c1a3d44c1461060e578063c7b9d53014610616578063d0e30db01461062957600080fd5b80639ce8e139146105c85780639f8b5da1146105db578063ac1e5025146105e857600080fd5b80638bc7e8c4116101b85780638bc7e8c41461059e5780638cfc0250146105a75780638da5cb5b146105af57806397fd323d146105c057600080fd5b80638456cb591461056f578063877562b6146105775780638912cb8b1461058a57600080fd5b80633e55f932116102b85780635ee167c0116102565780636ec232d3116102305780636ec232d314610534578063715018a61461054c578063722713f714610554578063748747e61461055c57600080fd5b80635ee167c0146104fb5780636817031b1461050e5780636b2ace871461052157600080fd5b80634700d305116102925780634700d305146104c457806354518b1a146104cc578063573fef0a146104d55780635c975abb146104dd57600080fd5b80633e55f932146104a15780633f4ba83a146104b45780634641257d146104bc57600080fd5b80631fe4a686116103255780632e1a7d4d116102ff5780632e1a7d4d1461046a5780632ee24a5f1461047d57806337bdd204146104905780633e0dc34e1461049857600080fd5b80631fe4a68614610431578063228cb73314610444578063257ae0de1461045757600080fd5b806311b0b42d1161036157806311b0b42d146103cb57806313e120b1146103f65780631f1fcd511461040b5780631fc8bc5d1461041e57600080fd5b80630e5c011e146103885780630e8fbb5a1461039d57806311588086146103b0575b600080fd5b61039b6103963660046131be565b610704565b005b61039b6103ab3660046131e9565b6107f7565b6103b8610871565b6040519081526020015b60405180910390f35b6009546103de906001600160a01b031681565b6040516001600160a01b0390911681526020016103c2565b6103fe6108f3565b6040516103c29190613206565b600c546103de906001600160a01b031681565b600f546103de906001600160a01b031681565b6004546103de906001600160a01b031681565b600b546103de906001600160a01b031681565b6002546103de906001600160a01b031681565b61039b610478366004613253565b610958565b6005546103de906001600160a01b031681565b6103fe610ba3565b6103b860105481565b61039b6104af366004613253565b610c06565b61039b610cdf565b61039b610d38565b61039b610e23565b6103b861271081565b61039b610ed4565b600054600160a01b900460ff165b60405190151581526020016103c2565b600d546103de906001600160a01b031681565b61039b61051c3660046131be565b610f10565b6011546103de906001600160a01b031681565b6008546103de9061010090046001600160a01b031681565b61039b610f66565b6103b8610f78565b61039b61056a3660046131be565b610f99565b61039b611026565b600e546103de906001600160a01b031681565b6011546104eb90600160a01b900460ff1681565b6103b860075481565b6103b8611075565b6000546001600160a01b03166103de565b6103b86110e3565b6006546103de906001600160a01b031681565b6008546104eb9060ff1681565b61039b6105f6366004613253565b61144f565b6003546103de906001600160a01b031681565b6103b86114fd565b61039b6106243660046131be565b61152e565b61039b6115c4565b61039b6116e7565b61039b6106473660046131be565b611726565b6103fe61177c565b61065c6117df565b6040516103c291906132c4565b6103b8603281565b6103b861188a565b6103fe6118c6565b61039b61068f3660046131be565b611929565b6103b860125481565b600a546103de906001600160a01b031681565b61039b6106be3660046131be565b61197f565b61039b6106d13660046131e9565b6119f5565b61039b611a47565b61039b6106ec3660046131be565b611bc7565b6001546103de906001600160a01b031681565b60085460ff168015610726575060085461010090046001600160a01b03163b15155b156107eb57600860019054906101000a90046001600160a01b03166001600160a01b0316633de39c116040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610780573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a49190613320565b3a11156107eb5760405162461bcd60e51b815260206004820152601060248201526f67617320697320746f6f20686967682160801b60448201526064015b60405180910390fd5b6107f481611d83565b50565b6000546001600160a01b031633148061081a57506003546001600160a01b031633145b6108365760405162461bcd60e51b81526004016107e290613339565b6011805460ff60a01b1916600160a01b8315158102919091179182905560ff91041615610867576107f4600061144f565b6107f4600a61144f565b600f546010546040516393f1a40b60e01b8152600481019190915230602482015260009182916001600160a01b03909116906393f1a40b906044016040805180830381865afa1580156108c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ec919061335b565b5092915050565b6060601360000180548060200260200160405190810160405280929190818152602001828054801561094e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610930575b5050505050905090565b6001546001600160a01b031633146109825760405162461bcd60e51b81526004016107e29061337f565b600c546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156109cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ef9190613320565b905081811015610ae657600f546010546001600160a01b0390911690630ad58d2f90610a1b84866133b5565b6040516001600160e01b031960e085901b16815260048101929092526024820152306044820152606401600060405180830381600087803b158015610a5f57600080fd5b505af1158015610a73573d6000803e3d6000fd5b5050600c546040516370a0823160e01b81523060048201526001600160a01b0390911692506370a082319150602401602060405180830381865afa158015610abf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae39190613320565b90505b81811115610af15750805b6000546001600160a01b03163214801590610b165750600054600160a01b900460ff16155b15610b4857600061271060075483610b2e91906133cc565b610b3891906133eb565b9050610b4481836133b5565b9150505b600154600c54610b65916001600160a01b03918216911683611f5c565b7f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d610b8e610f78565b60405190815260200160405180910390a15050565b6060601360030180548060200260200160405190810160405280929190818152602001828054801561094e576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610930575050505050905090565b6000546001600160a01b0316331480610c2957506003546001600160a01b031633145b610c455760405162461bcd60e51b81526004016107e290613339565b600654604051631f2afc9960e11b8152600481018390526001600160a01b0390911690633e55f93290602401600060405180830381600087803b158015610c8b57600080fd5b505af1158015610c9f573d6000803e3d6000fd5b505050507f9163810ee1e29168d4ce900e48a333fb8fbd3fd070d2bef67f6d4db0846a469f81604051610cd491815260200190565b60405180910390a150565b6000546001600160a01b0316331480610d0257506003546001600160a01b031633145b610d1e5760405162461bcd60e51b81526004016107e290613339565b610d26611f8c565b610d2e611fe1565b610d366115c4565b565b60085460ff168015610d5a575060085461010090046001600160a01b03163b15155b15610e1a57600860019054906101000a90046001600160a01b03166001600160a01b0316633de39c116040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610db4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd89190613320565b3a1115610e1a5760405162461bcd60e51b815260206004820152601060248201526f67617320697320746f6f20686967682160801b60448201526064016107e2565b610d3632611d83565b6000546001600160a01b0316331480610e4657506003546001600160a01b031633145b610e625760405162461bcd60e51b81526004016107e290613339565b610e6a611026565b600f546010546040516302f940c760e41b815260048101919091523060248201526001600160a01b0390911690632f940c7090604401600060405180830381600087803b158015610eba57600080fd5b505af1158015610ece573d6000803e3d6000fd5b50505050565b601154600160a01b900460ff1615610d36576001546001600160a01b03163314610e1a5760405162461bcd60e51b81526004016107e29061337f565b610f186120b8565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527fd459c7242e23d490831b5676a611c4342d899d28f342d89ae80793e56a930f3090602001610cd4565b610f6e6120b8565b610d366000612112565b6000610f82610871565b610f8a6114fd565b610f94919061340d565b905090565b6000546001600160a01b0316331480610fbc57506003546001600160a01b031633145b610fd85760405162461bcd60e51b81526004016107e290613339565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fefb5cfa1a8690c124332ab93324539c5c9c4be03f28aeb8be86f2d8a0c9fb99b90602001610cd4565b6000546001600160a01b031633148061104957506003546001600160a01b031633145b6110655760405162461bcd60e51b81526004016107e290613339565b61106d612162565b610d366121a5565b600654604051636788231160e11b81523060048201526000916001600160a01b03169063cf104622906024015b602060405180830381865afa1580156110bf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f949190613320565b600f5460105460405163c346253d60e01b81526004810191909152600091829182916001600160a01b03169063c346253d90602401602060405180830381865afa158015611135573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111599190613425565b90506001600160a01b038116156111e0576010546040516312390ebd60e21b815260048101919091523060248201526001600160a01b038216906348e43af490604401602060405180830381865afa1580156111b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111dd9190613320565b91505b60006111ea61188a565b600954600b549192506000916001600160a01b0391821691160361120f575082611321565b8315611321576022548460005b8281101561131c5760006013600101828154811061123c5761123c613442565b60009182526020918290200154604080516001600160a01b03909216928201929092529081018490526060016040516020818303038152906040529050601b600401600301828154811061129257611292613442565b6000918252602090912060029091020154604051635478fa9760e11b81526001600160a01b039091169063a8f1f52e906112d0908490600401613458565b602060405180830381865afa1580156112ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113119190613320565b92505060010161121c565b509150505b81156113f457600a54604080516001600160a01b03909216602083015281810184905280518083038201815260609092019052601e805460009061136757611367613442565b6000918252602090912060029091020154604051635478fa9760e11b81526001600160a01b039091169063a8f1f52e906113a5908490600401613458565b602060405180830381865afa1580156113c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e69190613320565b6113f0908361340d565b9150505b60006113fe6117df565b9050670de0b6b3a76400008160400151670de0b6b3a764000083600001518561142791906133cc565b61143191906133eb565b61143b91906133cc565b61144591906133eb565b9550505050505090565b6000546001600160a01b031633148061147257506003546001600160a01b031633145b61148e5760405162461bcd60e51b81526004016107e290613339565b60328111156114c85760405162461bcd60e51b81526004016107e2906020808252600490820152630216361760e41b604082015260600190565b60078190556040518181527f3aa4413905e8f015896ec5880bdde24088ccb19b578f9fcf6800354d5320d4af90602001610cd4565b600c546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a08231906024016110a2565b6004546001600160a01b031633146115765760405162461bcd60e51b815260206004820152600b60248201526a085cdd1c985d1959da5cdd60aa1b60448201526064016107e2565b600480546001600160a01b0319166001600160a01b0383169081179091556040519081527f46d58e3fa07bf19b1d27240f0e286b27e9f7c1b0d88933333fe833b60eec541290602001610cd4565b6115cc61223b565b600c546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015611615573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116399190613320565b905080156107f457600f54601054604051638dbdbe6d60e01b81526004810191909152602481018390523060448201526001600160a01b0390911690638dbdbe6d90606401600060405180830381600087803b15801561169857600080fd5b505af11580156116ac573d6000803e3d6000fd5b505050507f4d6ce1e535dbade1c23defba91e23b8f791ce5edc0cc320257a2b364e4e384266116d9610f78565b604051908152602001610cd4565b6000546001600160a01b031633148061170a57506003546001600160a01b031633145b610e1a5760405162461bcd60e51b81526004016107e290613339565b61172e6120b8565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527f5ca6e64c4522e68e154aa9372f2c5969cd37d9640e59f66953dc472f54ee86fa90602001610cd4565b6060601360010180548060200260200160405190810160405280929190818152602001828054801561094e576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610930575050505050905090565b61181a6040518060c0016040528060008152602001600081526020016000815260200160008152602001606081526020016000151581525090565b600654604051639af608c960e01b81523060048201526001600160a01b0390911690639af608c990602401600060405180830381865afa158015611862573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f9491908101906134eb565b600f5460105460405163065509bb60e21b815260048101919091523060248201526000916001600160a01b03169063195426ec906044016110a2565b6060601360020180548060200260200160405190810160405280929190818152602001828054801561094e576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610930575050505050905090565b6119316120b8565b600680546001600160a01b0319166001600160a01b0383169081179091556040519081527f1a410ffc0036aada0a490b5843db8cbd3bb689c364cd7da3e16fc99b91e6625d90602001610cd4565b6119876120b8565b6001600160a01b0381166119ec5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107e2565b6107f481612112565b6000546001600160a01b0316331480611a1857506003546001600160a01b031633145b611a345760405162461bcd60e51b81526004016107e290613339565b6008805460ff1916911515919091179055565b6001546001600160a01b03163314611a715760405162461bcd60e51b81526004016107e29061337f565b600f546010546040516302f940c760e41b815260048101919091523060248201526001600160a01b0390911690632f940c7090604401600060405180830381600087803b158015611ac157600080fd5b505af1158015611ad5573d6000803e3d6000fd5b5050600c546040516370a0823160e01b8152306004820152600093506001600160a01b0390911691506370a0823190602401602060405180830381865afa158015611b24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b489190613320565b600c5460015460405163a9059cbb60e01b81526001600160a01b03918216600482015260248101849052929350169063a9059cbb906044016020604051808303816000875af1158015611b9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bc391906135e1565b5050565b611bcf6120b8565b600580546001600160a01b0319166001600160a01b0383169081179091556040519081527f1edbf5cd8b0472c64d28e0718c563f699b0cbe37cf4bb596f612604488a4882490602001610cd4565b801580611c975750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015611c71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c959190613320565b155b611d025760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016107e2565b6040516001600160a01b038316602482015260448101829052611d6590849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612288565b505050565b6060611d79848460008561235a565b90505b9392505050565b611d8b61223b565b600f54601054604051630c7e663b60e11b815260048101919091523060248201526001600160a01b03909116906318fccc7690604401600060405180830381600087803b158015611ddb57600080fd5b505af1158015611def573d6000803e3d6000fd5b5050600a546040516370a0823160e01b8152306004820152600093506001600160a01b0390911691506370a0823190602401602060405180830381865afa158015611e3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e629190613320565b600b546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a0823190602401602060405180830381865afa158015611eb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed49190613320565b90506000821180611ee55750600081115b15611d6557611ef38361248b565b611efb612aa3565b6000611f056114fd565b9050611f0f6115c4565b42601255337f9bc239f1724cacfb88cb1d66a2dc437467699b68a8c90d7b63110cf4b6f9241082611f3e610f78565b6040805192835260208301919091520160405180910390a250505050565b6040516001600160a01b038316602482015260448101829052611d6590849063a9059cbb60e01b90606401611d2e565b611f94613120565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600f54600c54612000916001600160a01b039182169116600019611c1d565b601154600a5461201f916001600160a01b039182169116600019611c1d565b60115460095461203e916001600160a01b039182169116600019611c1d565b601154600d5461205c916001600160a01b0391821691166000611c1d565b601154600d5461207b916001600160a01b039182169116600019611c1d565b601154600e54612099916001600160a01b0391821691166000611c1d565b601154600e54610d36916001600160a01b039182169116600019611c1d565b6000546001600160a01b03163314610d365760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107e2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61216a61223b565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611fc43390565b600f54600c546121c3916001600160a01b0391821691166000611c1d565b601154600a546121e1916001600160a01b0391821691166000611c1d565b6011546009546121ff916001600160a01b0391821691166000611c1d565b601154600d5461221d916001600160a01b0391821691166000611c1d565b601154600e54610d36916001600160a01b0391821691166000611c1d565b600054600160a01b900460ff1615610d365760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016107e2565b60006122dd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611d6a9092919063ffffffff16565b805190915015611d6557808060200190518101906122fb91906135e1565b611d655760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016107e2565b6060824710156123bb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016107e2565b6001600160a01b0385163b6124125760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107e2565b600080866001600160a01b0316858760405161242e91906135fe565b60006040518083038185875af1925050503d806000811461246b576040519150601f19603f3d011682016040523d82523d6000602084013e612470565b606091505b5091509150612480828286613170565b979650505050505050565b60006124956117df565b600b546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156124e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125079190613320565b905060008111801561252a5750600954600b546001600160a01b03908116911614155b156126d95760408051608081018252601f80546001600160a01b0316825260208054818401526021548385015260228054855181840281018401909652808652600095606086019390929190879084015b82821015612654576000848152602090819020604080518082019091526002850290910180546001600160a01b0316825260018101805492939192918401916125c39061361a565b80601f01602080910402602001604051908101604052809291908181526020018280546125ef9061361a565b801561263c5780601f106126115761010080835404028352916020019161263c565b820191906000526020600020905b81548152906001019060200180831161261f57829003601f168201915b5050505050815250508152602001906001019061257b565b50505091525050602081018390526002546040516305868d8f60e11b81529192506001600160a01b031690630b0d1b1e90612693908490600401613654565b6020604051808303816000875af11580156126b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126d69190613320565b50505b600a546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015612722573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127469190613320565b905080156128fc5760408051608081018252601b80546001600160a01b03168252601c54602080840191909152601d5483850152601e8054855181840281018401909652808652600095606086019390929190879084015b82821015612877576000848152602090819020604080518082019091526002850290910180546001600160a01b0316825260018101805492939192918401916127e69061361a565b80601f01602080910402602001604051908101604052809291908181526020018280546128129061361a565b801561285f5780601f106128345761010080835404028352916020019161285f565b820191906000526020600020905b81548152906001019060200180831161284257829003601f168201915b5050505050815250508152602001906001019061279e565b50505091525050602081018390526002546040516305868d8f60e11b81529192506001600160a01b031690630b0d1b1e906128b6908490600401613654565b6020604051808303816000875af11580156128d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128f99190613320565b50505b82516009546040516370a0823160e01b8152306004820152600092670de0b6b3a76400009290916001600160a01b03909116906370a0823190602401602060405180830381865afa158015612955573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129799190613320565b61298391906133cc565b61298d91906133eb565b90506000670de0b6b3a76400008560400151836129aa91906133cc565b6129b491906133eb565b6009549091506129ce906001600160a01b03168783611f5c565b6000670de0b6b3a76400008660200151846129e991906133cc565b6129f391906133eb565b600554600954919250612a13916001600160a01b03908116911683611f5c565b6000670de0b6b3a7640000876060015185612a2e91906133cc565b612a3891906133eb565b600454600954919250612a58916001600160a01b03908116911683611f5c565b60408051848152602081018490529081018290527fd255b592c7f268a73e534da5219a60ff911b4cf6daae21c7d20527dd657bd99a9060600160405180910390a15050505050505050565b6009546040516370a0823160e01b81523060048201526000916002916001600160a01b03909116906370a0823190602401602060405180830381865afa158015612af1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b159190613320565b612b1f91906133eb565b600954600d549192506001600160a01b03918216911614612ce85760408051608081018252602380546001600160a01b031682526024546020808401919091526025548385015260268054855181840281018401909652808652600095606086019390929190879084015b82821015612c63576000848152602090819020604080518082019091526002850290910180546001600160a01b031682526001810180549293919291840191612bd29061361a565b80601f0160208091040260200160405190810160405280929190818152602001828054612bfe9061361a565b8015612c4b5780601f10612c2057610100808354040283529160200191612c4b565b820191906000526020600020905b815481529060010190602001808311612c2e57829003601f168201915b50505050508152505081526020019060010190612b8a565b50505091525050602081018390526002546040516305868d8f60e11b81529192506001600160a01b031690630b0d1b1e90612ca2908490600401613654565b6020604051808303816000875af1158015612cc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ce59190613320565b50505b600954600e546001600160a01b03908116911614612eae5760408051608081018252602780546001600160a01b0316825260285460208084019190915260295483850152602a8054855181840281018401909652808652600095606086019390929190879084015b82821015612e29576000848152602090819020604080518082019091526002850290910180546001600160a01b031682526001810180549293919291840191612d989061361a565b80601f0160208091040260200160405190810160405280929190818152602001828054612dc49061361a565b8015612e115780601f10612de657610100808354040283529160200191612e11565b820191906000526020600020905b815481529060010190602001808311612df457829003601f168201915b50505050508152505081526020019060010190612d50565b50505091525050602081018390526002546040516305868d8f60e11b81529192506001600160a01b031690630b0d1b1e90612e68908490600401613654565b6020604051808303816000875af1158015612e87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eab9190613320565b50505b60408051600280825260608201909252600091816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181612ec657905050600d546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a0823190602401602060405180830381865afa158015612f41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f659190613320565b600e546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a0823190602401602060405180830381865afa158015612fb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fd79190613320565b60408051606081018252600d546001600160a01b0316815260016020820152908101849052845191925090849060009061301357613013613442565b60209081029190910181019190915260408051606081018252600e546001600160a01b031681526001928101839052908101839052845190918591811061305c5761305c613442565b602002602001018190525060003060405160200161308991906001600160a01b0391909116815260200190565b60408051601f1981840301815290829052600254600c54632cfcb94f60e01b84529193506001600160a01b0390811692632cfcb94f926130d592899291169060019087906004016136fe565b6020604051808303816000875af11580156130f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131189190613320565b505050505050565b600054600160a01b900460ff16610d365760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016107e2565b6060831561317f575081611d7c565b82511561318f5782518084602001fd5b8160405162461bcd60e51b81526004016107e29190613458565b6001600160a01b03811681146107f457600080fd5b6000602082840312156131d057600080fd5b8135611d7c816131a9565b80151581146107f457600080fd5b6000602082840312156131fb57600080fd5b8135611d7c816131db565b6020808252825182820181905260009190848201906040850190845b818110156132475783516001600160a01b031683529284019291840191600101613222565b50909695505050505050565b60006020828403121561326557600080fd5b5035919050565b60005b8381101561328757818101518382015260200161326f565b83811115610ece5750506000910152565b600081518084526132b081602086016020860161326c565b601f01601f19169290920160200192915050565b60208152815160208201526020820151604082015260408201516060820152606082015160808201526000608083015160c060a084015261330860e0840182613298565b905060a0840151151560c08401528091505092915050565b60006020828403121561333257600080fd5b5051919050565b60208082526008908201526710b6b0b730b3b2b960c11b604082015260600190565b6000806040838503121561336e57600080fd5b505080516020909101519092909150565b602080825260069082015265085d985d5b1d60d21b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000828210156133c7576133c761339f565b500390565b60008160001904831182151516156133e6576133e661339f565b500290565b60008261340857634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156134205761342061339f565b500190565b60006020828403121561343757600080fd5b8151611d7c816131a9565b634e487b7160e01b600052603260045260246000fd5b602081526000611d7c6020830184613298565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff811182821017156134a4576134a461346b565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156134d3576134d361346b565b604052919050565b80516134e6816131db565b919050565b600060208083850312156134fe57600080fd5b825167ffffffffffffffff8082111561351657600080fd5b9084019060c0828703121561352a57600080fd5b613532613481565b825181528383015184820152604083015160408201526060830151606082015260808301518281111561356457600080fd5b8301601f8101881361357557600080fd5b8051838111156135875761358761346b565b613599601f8201601f191687016134aa565b935080845288868284010111156135af57600080fd5b6135be8187860188850161326c565b50508160808201526135d260a084016134db565b60a08201529695505050505050565b6000602082840312156135f357600080fd5b8151611d7c816131db565b6000825161361081846020870161326c565b9190910192915050565b600181811c9082168061362e57607f821691505b60208210810361364e57634e487b7160e01b600052602260045260246000fd5b50919050565b6000602080835260a0830160018060a01b03808651168386015282860151604081818801528088015160608801526060880151915060808088015283825180865260c08901915060c08160051b8a01019550868401935060005b818110156136ef5789870360bf1901835284518051871688528801518888018590526136dc85890182613298565b97505093870193918701916001016136ae565b50949998505050505050505050565b6080808252855190820181905260009060209060a0840190828901845b8281101561375857815180516001600160a01b0316855285810151151586860152604090810151908501526060909301929084019060010161371b565b5050506001600160a01b0387168483015285604085015283810360608501526137818186613298565b9897505050505050505056fea264697066735822122003a631f65b29d5bd049322a33fef77279344370c3825bb8674c38a2a52b9594d64736f6c634300080f0033