Contract 0x8582bf142be76fef830d23f590a2587f2ad7c216 2

 
Txn Hash Method
Block
From
To
Value
0x901d53213f80985efbb9c80af84d25a1034d483f14f46db3ef4d620ffcdbce950x60a0604021465242022-01-09 15:51:34809 days 21 hrs ago0x88215a2794ddc031439c72922ec8983bde831c78 IN  Create: GUniPool0 ETH0.0670260996220.001
[ Download CSV Export 
View more zero value Internal Transactions in Advanced View mode
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
GUniPool

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 1 runs

Other Settings:
default evmVersion, GNU GPLv3 license
File 1 of 27 : Initializable.sol
// SPDX-License-Identifier: MIT

// solhint-disable-next-line compiler-version
pragma solidity ^0.8.0;

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

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

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

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

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

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }
}

File 2 of 27 : ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

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

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

    uint256 private _status;

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

    function __ReentrancyGuard_init_unchained() internal initializer {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 3 of 27 : ERC20Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC20Upgradeable.sol";
import "./extensions/IERC20MetadataUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../proxy/utils/Initializable.sol";

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

    function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {
        _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:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

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

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

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

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        _approve(sender, _msgSender(), currentAllowance - 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) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][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) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        _approve(_msgSender(), spender, currentAllowance - subtractedValue);

        return true;
    }

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

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        _balances[sender] = senderBalance - amount;
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);
    }

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

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

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

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

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

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

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

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

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

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

File 4 of 27 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 5 of 27 : IERC20MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20MetadataUpgradeable is IERC20Upgradeable {
    /**
     * @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 6 of 27 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

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

    function __Context_init_unchained() internal initializer {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

File 7 of 27 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 8 of 27 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + 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));
        }
    }

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

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

File 9 of 27 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 10 of 27 : SafeCast.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCast {
    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        require(value < 2**128, "SafeCast: value doesn\'t fit in 128 bits");
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        require(value < 2**64, "SafeCast: value doesn\'t fit in 64 bits");
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        require(value < 2**32, "SafeCast: value doesn\'t fit in 32 bits");
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        require(value < 2**16, "SafeCast: value doesn\'t fit in 16 bits");
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        require(value < 2**8, "SafeCast: value doesn\'t fit in 8 bits");
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        require(value >= 0, "SafeCast: value must be positive");
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v3.1._
     */
    function toInt128(int256 value) internal pure returns (int128) {
        require(value >= -2**127 && value < 2**127, "SafeCast: value doesn\'t fit in 128 bits");
        return int128(value);
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v3.1._
     */
    function toInt64(int256 value) internal pure returns (int64) {
        require(value >= -2**63 && value < 2**63, "SafeCast: value doesn\'t fit in 64 bits");
        return int64(value);
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v3.1._
     */
    function toInt32(int256 value) internal pure returns (int32) {
        require(value >= -2**31 && value < 2**31, "SafeCast: value doesn\'t fit in 32 bits");
        return int32(value);
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v3.1._
     */
    function toInt16(int256 value) internal pure returns (int16) {
        require(value >= -2**15 && value < 2**15, "SafeCast: value doesn\'t fit in 16 bits");
        return int16(value);
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     *
     * _Available since v3.1._
     */
    function toInt8(int256 value) internal pure returns (int8) {
        require(value >= -2**7 && value < 2**7, "SafeCast: value doesn\'t fit in 8 bits");
        return int8(value);
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        require(value < 2**255, "SafeCast: value doesn't fit in an int256");
        return int256(value);
    }
}

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

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

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

}

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

/// @title Callback for IUniswapV3PoolActions#mint
/// @notice Any contract that calls IUniswapV3PoolActions#mint must implement this interface
interface IUniswapV3MintCallback {
    /// @notice Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.
    /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.
    /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
    /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity
    /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity
    /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#mint call
    function uniswapV3MintCallback(
        uint256 amount0Owed,
        uint256 amount1Owed,
        bytes calldata data
    ) external;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 21 of 27 : GUniPool.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.4;

import {
    IUniswapV3MintCallback
} from "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol";
import {
    IUniswapV3SwapCallback
} from "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol";
import {GUniPoolStorage} from "./abstract/GUniPoolStorage.sol";
import {
    IUniswapV3Pool
} from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";
import {TickMath} from "./vendor/uniswap/TickMath.sol";
import {
    IERC20,
    SafeERC20
} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol";
import {
    FullMath,
    LiquidityAmounts
} from "./vendor/uniswap/LiquidityAmounts.sol";

contract GUniPool is
    IUniswapV3MintCallback,
    IUniswapV3SwapCallback,
    GUniPoolStorage
{
    using SafeERC20 for IERC20;
    using TickMath for int24;

    event Minted(
        address receiver,
        uint256 mintAmount,
        uint256 amount0In,
        uint256 amount1In,
        uint128 liquidityMinted
    );

    event Burned(
        address receiver,
        uint256 burnAmount,
        uint256 amount0Out,
        uint256 amount1Out,
        uint128 liquidityBurned
    );

    event Rebalance(
        int24 lowerTick_,
        int24 upperTick_,
        uint128 liquidityBefore,
        uint128 liquidityAfter
    );

    event FeesEarned(uint256 feesEarned0, uint256 feesEarned1);

    // solhint-disable-next-line max-line-length
    constructor(address payable _gelato) GUniPoolStorage(_gelato) {} // solhint-disable-line no-empty-blocks

    /// @notice Uniswap V3 callback fn, called back on pool.mint
    function uniswapV3MintCallback(
        uint256 amount0Owed,
        uint256 amount1Owed,
        bytes calldata /*_data*/
    ) external override {
        require(msg.sender == address(pool), "callback caller");

        if (amount0Owed > 0) token0.safeTransfer(msg.sender, amount0Owed);
        if (amount1Owed > 0) token1.safeTransfer(msg.sender, amount1Owed);
    }

    /// @notice Uniswap v3 callback fn, called back on pool.swap
    function uniswapV3SwapCallback(
        int256 amount0Delta,
        int256 amount1Delta,
        bytes calldata /*data*/
    ) external override {
        require(msg.sender == address(pool), "callback caller");

        if (amount0Delta > 0)
            token0.safeTransfer(msg.sender, uint256(amount0Delta));
        else if (amount1Delta > 0)
            token1.safeTransfer(msg.sender, uint256(amount1Delta));
    }

    // User functions => Should be called via a Router

    /// @notice mint fungible G-UNI tokens, fractional shares of a Uniswap V3 position
    /// @dev to compute the amouint of tokens necessary to mint `mintAmount` see getMintAmounts
    /// @param mintAmount The number of G-UNI tokens to mint
    /// @param receiver The account to receive the minted tokens
    /// @return amount0 amount of token0 transferred from msg.sender to mint `mintAmount`
    /// @return amount1 amount of token1 transferred from msg.sender to mint `mintAmount`
    /// @return liquidityMinted amount of liquidity added to the underlying Uniswap V3 position
    // solhint-disable-next-line function-max-lines, code-complexity
    function mint(uint256 mintAmount, address receiver)
        external
        nonReentrant
        returns (
            uint256 amount0,
            uint256 amount1,
            uint128 liquidityMinted
        )
    {
        require(mintAmount > 0, "mint 0");

        uint256 totalSupply = totalSupply();

        (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();

        if (totalSupply > 0) {
            (uint256 amount0Current, uint256 amount1Current) =
                getUnderlyingBalances();

            amount0 = FullMath.mulDivRoundingUp(
                amount0Current,
                mintAmount,
                totalSupply
            );
            amount1 = FullMath.mulDivRoundingUp(
                amount1Current,
                mintAmount,
                totalSupply
            );
        } else {
            // if supply is 0 mintAmount == liquidity to deposit
            (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(
                sqrtRatioX96,
                lowerTick.getSqrtRatioAtTick(),
                upperTick.getSqrtRatioAtTick(),
                SafeCast.toUint128(mintAmount)
            );
        }

        // transfer amounts owed to contract
        if (amount0 > 0) {
            token0.safeTransferFrom(msg.sender, address(this), amount0);
        }
        if (amount1 > 0) {
            token1.safeTransferFrom(msg.sender, address(this), amount1);
        }

        // deposit as much new liquidity as possible
        liquidityMinted = LiquidityAmounts.getLiquidityForAmounts(
            sqrtRatioX96,
            lowerTick.getSqrtRatioAtTick(),
            upperTick.getSqrtRatioAtTick(),
            amount0,
            amount1
        );

        pool.mint(address(this), lowerTick, upperTick, liquidityMinted, "");

        _mint(receiver, mintAmount);
        emit Minted(receiver, mintAmount, amount0, amount1, liquidityMinted);
    }

    /// @notice burn G-UNI tokens (fractional shares of a Uniswap V3 position) and receive tokens
    /// @param burnAmount The number of G-UNI tokens to burn
    /// @param receiver The account to receive the underlying amounts of token0 and token1
    /// @return amount0 amount of token0 transferred to receiver for burning `burnAmount`
    /// @return amount1 amount of token1 transferred to receiver for burning `burnAmount`
    /// @return liquidityBurned amount of liquidity removed from the underlying Uniswap V3 position
    // solhint-disable-next-line function-max-lines
    function burn(uint256 burnAmount, address receiver)
        external
        nonReentrant
        returns (
            uint256 amount0,
            uint256 amount1,
            uint128 liquidityBurned
        )
    {
        require(burnAmount > 0, "burn 0");

        uint256 totalSupply = totalSupply();

        (uint128 liquidity, , , , ) = pool.positions(_getPositionID());

        _burn(msg.sender, burnAmount);

        uint256 liquidityBurned_ =
            FullMath.mulDiv(burnAmount, liquidity, totalSupply);
        liquidityBurned = SafeCast.toUint128(liquidityBurned_);
        (uint256 burn0, uint256 burn1, uint256 fee0, uint256 fee1) =
            _withdraw(lowerTick, upperTick, liquidityBurned);
        _applyFees(fee0, fee1);
        (fee0, fee1) = _subtractAdminFees(fee0, fee1);
        emit FeesEarned(fee0, fee1);

        amount0 =
            burn0 +
            FullMath.mulDiv(
                token0.balanceOf(address(this)) -
                    burn0 -
                    managerBalance0 -
                    gelatoBalance0,
                burnAmount,
                totalSupply
            );
        amount1 =
            burn1 +
            FullMath.mulDiv(
                token1.balanceOf(address(this)) -
                    burn1 -
                    managerBalance1 -
                    gelatoBalance1,
                burnAmount,
                totalSupply
            );

        if (amount0 > 0) {
            token0.safeTransfer(receiver, amount0);
        }

        if (amount1 > 0) {
            token1.safeTransfer(receiver, amount1);
        }

        emit Burned(receiver, burnAmount, amount0, amount1, liquidityBurned);
    }

    // Manager Functions => Called by Pool Manager

    /// @notice Change the range of underlying UniswapV3 position, only manager can call
    /// @dev When changing the range the inventory of token0 and token1 may be rebalanced
    /// with a swap to deposit as much liquidity as possible into the new position. Swap parameters
    /// can be computed by simulating the whole operation: remove all liquidity, deposit as much
    /// as possible into new position, then observe how much of token0 or token1 is leftover.
    /// Swap a proportion of this leftover to deposit more liquidity into the position, since
    /// any leftover will be unused and sit idle until the next rebalance.
    /// @param newLowerTick The new lower bound of the position's range
    /// @param newUpperTick The new upper bound of the position's range
    /// @param swapThresholdPrice slippage parameter on the swap as a max or min sqrtPriceX96
    /// @param swapAmountBPS amount of token to swap as proportion of total. Pass 0 to ignore swap.
    /// @param zeroForOne Which token to input into the swap (true = token0, false = token1)
    // solhint-disable-next-line function-max-lines
    function executiveRebalance(
        int24 newLowerTick,
        int24 newUpperTick,
        uint160 swapThresholdPrice,
        uint256 swapAmountBPS,
        bool zeroForOne
    ) external onlyManager {
        uint128 liquidity;
        uint128 newLiquidity;
        if (totalSupply() > 0) {
            (liquidity, , , , ) = pool.positions(_getPositionID());
            if (liquidity > 0) {
                (, , uint256 fee0, uint256 fee1) =
                    _withdraw(lowerTick, upperTick, liquidity);

                _applyFees(fee0, fee1);
                (fee0, fee1) = _subtractAdminFees(fee0, fee1);
                emit FeesEarned(fee0, fee1);
            }

            lowerTick = newLowerTick;
            upperTick = newUpperTick;

            uint256 reinvest0 =
                token0.balanceOf(address(this)) -
                    managerBalance0 -
                    gelatoBalance0;
            uint256 reinvest1 =
                token1.balanceOf(address(this)) -
                    managerBalance1 -
                    gelatoBalance1;

            _deposit(
                newLowerTick,
                newUpperTick,
                reinvest0,
                reinvest1,
                swapThresholdPrice,
                swapAmountBPS,
                zeroForOne
            );

            (newLiquidity, , , , ) = pool.positions(_getPositionID());
            require(newLiquidity > 0, "new position 0");
        } else {
            lowerTick = newLowerTick;
            upperTick = newUpperTick;
        }

        emit Rebalance(newLowerTick, newUpperTick, liquidity, newLiquidity);
    }

    // Gelatofied functions => Automatically called by Gelato

    /// @notice Reinvest fees earned into underlying position, only gelato executors can call
    /// Position bounds CANNOT be altered by gelato, only manager may via executiveRebalance.
    /// Frequency of rebalance configured with gelatoRebalanceBPS, alterable by manager.
    function rebalance(
        uint160 swapThresholdPrice,
        uint256 swapAmountBPS,
        bool zeroForOne,
        uint256 feeAmount,
        address paymentToken
    ) external gelatofy(feeAmount, paymentToken) {
        if (swapAmountBPS > 0) {
            _checkSlippage(swapThresholdPrice, zeroForOne);
        }
        (uint128 liquidity, , , , ) = pool.positions(_getPositionID());
        _rebalance(
            liquidity,
            swapThresholdPrice,
            swapAmountBPS,
            zeroForOne,
            feeAmount,
            paymentToken
        );

        (uint128 newLiquidity, , , , ) = pool.positions(_getPositionID());
        require(newLiquidity > liquidity, "liquidity must increase");

        emit Rebalance(lowerTick, upperTick, liquidity, newLiquidity);
    }

    /// @notice withdraw manager fees accrued, only gelato executors can call.
    /// Target account to receive fees is managerTreasury, alterable by manager.
    /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.
    function withdrawManagerBalance(uint256 feeAmount, address feeToken)
        external
        gelatofy(feeAmount, feeToken)
    {
        (uint256 amount0, uint256 amount1) =
            _balancesToWithdraw(
                managerBalance0,
                managerBalance1,
                feeAmount,
                feeToken
            );

        managerBalance0 = 0;
        managerBalance1 = 0;

        if (amount0 > 0) {
            token0.safeTransfer(managerTreasury, amount0);
        }

        if (amount1 > 0) {
            token1.safeTransfer(managerTreasury, amount1);
        }
    }

    /// @notice withdraw gelato fees accrued, only gelato executors can call.
    /// Frequency of withdrawals configured with gelatoWithdrawBPS, alterable by manager.
    function withdrawGelatoBalance(uint256 feeAmount, address feeToken)
        external
        gelatofy(feeAmount, feeToken)
    {
        (uint256 amount0, uint256 amount1) =
            _balancesToWithdraw(
                gelatoBalance0,
                gelatoBalance1,
                feeAmount,
                feeToken
            );

        gelatoBalance0 = 0;
        gelatoBalance1 = 0;

        if (amount0 > 0) {
            token0.safeTransfer(GELATO, amount0);
        }

        if (amount1 > 0) {
            token1.safeTransfer(GELATO, amount1);
        }
    }

    function _balancesToWithdraw(
        uint256 balance0,
        uint256 balance1,
        uint256 feeAmount,
        address feeToken
    ) internal view returns (uint256 amount0, uint256 amount1) {
        if (feeToken == address(token0)) {
            require(
                (balance0 * gelatoWithdrawBPS) / 10000 >= feeAmount,
                "high fee"
            );
            amount0 = balance0 - feeAmount;
            amount1 = balance1;
        } else if (feeToken == address(token1)) {
            require(
                (balance1 * gelatoWithdrawBPS) / 10000 >= feeAmount,
                "high fee"
            );
            amount1 = balance1 - feeAmount;
            amount0 = balance0;
        } else {
            revert("wrong token");
        }
    }

    // View functions

    /// @notice compute maximum G-UNI tokens that can be minted from `amount0Max` and `amount1Max`
    /// @param amount0Max The maximum amount of token0 to forward on mint
    /// @param amount0Max The maximum amount of token1 to forward on mint
    /// @return amount0 actual amount of token0 to forward when minting `mintAmount`
    /// @return amount1 actual amount of token1 to forward when minting `mintAmount`
    /// @return mintAmount maximum number of G-UNI tokens to mint
    function getMintAmounts(uint256 amount0Max, uint256 amount1Max)
        external
        view
        returns (
            uint256 amount0,
            uint256 amount1,
            uint256 mintAmount
        )
    {
        uint256 totalSupply = totalSupply();
        if (totalSupply > 0) {
            (amount0, amount1, mintAmount) = _computeMintAmounts(
                totalSupply,
                amount0Max,
                amount1Max
            );
        } else {
            (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();
            uint128 newLiquidity =
                LiquidityAmounts.getLiquidityForAmounts(
                    sqrtRatioX96,
                    lowerTick.getSqrtRatioAtTick(),
                    upperTick.getSqrtRatioAtTick(),
                    amount0Max,
                    amount1Max
                );
            mintAmount = uint256(newLiquidity);
            (amount0, amount1) = LiquidityAmounts.getAmountsForLiquidity(
                sqrtRatioX96,
                lowerTick.getSqrtRatioAtTick(),
                upperTick.getSqrtRatioAtTick(),
                newLiquidity
            );
        }
    }

    /// @notice compute total underlying holdings of the G-UNI token supply
    /// includes current liquidity invested in uniswap position, current fees earned
    /// and any uninvested leftover (but does not include manager or gelato fees accrued)
    /// @return amount0Current current total underlying balance of token0
    /// @return amount1Current current total underlying balance of token1
    function getUnderlyingBalances()
        public
        view
        returns (uint256 amount0Current, uint256 amount1Current)
    {
        (uint160 sqrtRatioX96, int24 tick, , , , , ) = pool.slot0();
        return _getUnderlyingBalances(sqrtRatioX96, tick);
    }

    function getUnderlyingBalancesAtPrice(uint160 sqrtRatioX96)
        external
        view
        returns (uint256 amount0Current, uint256 amount1Current)
    {
        (, int24 tick, , , , , ) = pool.slot0();
        return _getUnderlyingBalances(sqrtRatioX96, tick);
    }

    // solhint-disable-next-line function-max-lines
    function _getUnderlyingBalances(uint160 sqrtRatioX96, int24 tick)
        internal
        view
        returns (uint256 amount0Current, uint256 amount1Current)
    {
        (
            uint128 liquidity,
            uint256 feeGrowthInside0Last,
            uint256 feeGrowthInside1Last,
            uint128 tokensOwed0,
            uint128 tokensOwed1
        ) = pool.positions(_getPositionID());

        // compute current holdings from liquidity
        (amount0Current, amount1Current) = LiquidityAmounts
            .getAmountsForLiquidity(
            sqrtRatioX96,
            lowerTick.getSqrtRatioAtTick(),
            upperTick.getSqrtRatioAtTick(),
            liquidity
        );

        // compute current fees earned
        uint256 fee0 =
            _computeFeesEarned(true, feeGrowthInside0Last, tick, liquidity) +
                uint256(tokensOwed0);
        uint256 fee1 =
            _computeFeesEarned(false, feeGrowthInside1Last, tick, liquidity) +
                uint256(tokensOwed1);

        (fee0, fee1) = _subtractAdminFees(fee0, fee1);

        // add any leftover in contract to current holdings
        amount0Current +=
            fee0 +
            token0.balanceOf(address(this)) -
            managerBalance0 -
            gelatoBalance0;
        amount1Current +=
            fee1 +
            token1.balanceOf(address(this)) -
            managerBalance1 -
            gelatoBalance1;
    }

    // Private functions

    // solhint-disable-next-line function-max-lines
    function _rebalance(
        uint128 liquidity,
        uint160 swapThresholdPrice,
        uint256 swapAmountBPS,
        bool zeroForOne,
        uint256 feeAmount,
        address paymentToken
    ) private {
        uint256 leftover0 =
            token0.balanceOf(address(this)) - managerBalance0 - gelatoBalance0;
        uint256 leftover1 =
            token1.balanceOf(address(this)) - managerBalance1 - gelatoBalance1;

        (, , uint256 feesEarned0, uint256 feesEarned1) =
            _withdraw(lowerTick, upperTick, liquidity);
        _applyFees(feesEarned0, feesEarned1);
        (feesEarned0, feesEarned1) = _subtractAdminFees(
            feesEarned0,
            feesEarned1
        );
        emit FeesEarned(feesEarned0, feesEarned1);
        feesEarned0 += leftover0;
        feesEarned1 += leftover1;

        if (paymentToken == address(token0)) {
            require(
                (feesEarned0 * gelatoRebalanceBPS) / 10000 >= feeAmount,
                "high fee"
            );
            leftover0 =
                token0.balanceOf(address(this)) -
                managerBalance0 -
                gelatoBalance0 -
                feeAmount;
            leftover1 =
                token1.balanceOf(address(this)) -
                managerBalance1 -
                gelatoBalance1;
        } else if (paymentToken == address(token1)) {
            require(
                (feesEarned1 * gelatoRebalanceBPS) / 10000 >= feeAmount,
                "high fee"
            );
            leftover0 =
                token0.balanceOf(address(this)) -
                managerBalance0 -
                gelatoBalance0;
            leftover1 =
                token1.balanceOf(address(this)) -
                managerBalance1 -
                gelatoBalance1 -
                feeAmount;
        } else {
            revert("wrong token");
        }

        _deposit(
            lowerTick,
            upperTick,
            leftover0,
            leftover1,
            swapThresholdPrice,
            swapAmountBPS,
            zeroForOne
        );
    }

    // solhint-disable-next-line function-max-lines
    function _withdraw(
        int24 lowerTick_,
        int24 upperTick_,
        uint128 liquidity
    )
        private
        returns (
            uint256 burn0,
            uint256 burn1,
            uint256 fee0,
            uint256 fee1
        )
    {
        uint256 preBalance0 = token0.balanceOf(address(this));
        uint256 preBalance1 = token1.balanceOf(address(this));

        (burn0, burn1) = pool.burn(lowerTick_, upperTick_, liquidity);

        pool.collect(
            address(this),
            lowerTick_,
            upperTick_,
            type(uint128).max,
            type(uint128).max
        );

        fee0 = token0.balanceOf(address(this)) - preBalance0 - burn0;
        fee1 = token1.balanceOf(address(this)) - preBalance1 - burn1;
    }

    // solhint-disable-next-line function-max-lines
    function _deposit(
        int24 lowerTick_,
        int24 upperTick_,
        uint256 amount0,
        uint256 amount1,
        uint160 swapThresholdPrice,
        uint256 swapAmountBPS,
        bool zeroForOne
    ) private {
        (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();
        // First, deposit as much as we can
        uint128 baseLiquidity =
            LiquidityAmounts.getLiquidityForAmounts(
                sqrtRatioX96,
                lowerTick_.getSqrtRatioAtTick(),
                upperTick_.getSqrtRatioAtTick(),
                amount0,
                amount1
            );
        if (baseLiquidity > 0) {
            (uint256 amountDeposited0, uint256 amountDeposited1) =
                pool.mint(
                    address(this),
                    lowerTick_,
                    upperTick_,
                    baseLiquidity,
                    ""
                );

            amount0 -= amountDeposited0;
            amount1 -= amountDeposited1;
        }
        int256 swapAmount =
            SafeCast.toInt256(
                ((zeroForOne ? amount0 : amount1) * swapAmountBPS) / 10000
            );
        if (swapAmount > 0) {
            _swapAndDeposit(
                lowerTick_,
                upperTick_,
                amount0,
                amount1,
                swapAmount,
                swapThresholdPrice,
                zeroForOne
            );
        }
    }

    function _swapAndDeposit(
        int24 lowerTick_,
        int24 upperTick_,
        uint256 amount0,
        uint256 amount1,
        int256 swapAmount,
        uint160 swapThresholdPrice,
        bool zeroForOne
    ) private returns (uint256 finalAmount0, uint256 finalAmount1) {
        (int256 amount0Delta, int256 amount1Delta) =
            pool.swap(
                address(this),
                zeroForOne,
                swapAmount,
                swapThresholdPrice,
                ""
            );
        finalAmount0 = uint256(SafeCast.toInt256(amount0) - amount0Delta);
        finalAmount1 = uint256(SafeCast.toInt256(amount1) - amount1Delta);

        // Add liquidity a second time
        (uint160 sqrtRatioX96, , , , , , ) = pool.slot0();
        uint128 liquidityAfterSwap =
            LiquidityAmounts.getLiquidityForAmounts(
                sqrtRatioX96,
                lowerTick_.getSqrtRatioAtTick(),
                upperTick_.getSqrtRatioAtTick(),
                finalAmount0,
                finalAmount1
            );
        if (liquidityAfterSwap > 0) {
            pool.mint(
                address(this),
                lowerTick_,
                upperTick_,
                liquidityAfterSwap,
                ""
            );
        }
    }

    // solhint-disable-next-line function-max-lines, code-complexity
    function _computeMintAmounts(
        uint256 totalSupply,
        uint256 amount0Max,
        uint256 amount1Max
    )
        private
        view
        returns (
            uint256 amount0,
            uint256 amount1,
            uint256 mintAmount
        )
    {
        (uint256 amount0Current, uint256 amount1Current) =
            getUnderlyingBalances();

        // compute proportional amount of tokens to mint
        if (amount0Current == 0 && amount1Current > 0) {
            mintAmount = FullMath.mulDiv(
                amount1Max,
                totalSupply,
                amount1Current
            );
        } else if (amount1Current == 0 && amount0Current > 0) {
            mintAmount = FullMath.mulDiv(
                amount0Max,
                totalSupply,
                amount0Current
            );
        } else if (amount0Current == 0 && amount1Current == 0) {
            revert("");
        } else {
            // only if both are non-zero
            uint256 amount0Mint =
                FullMath.mulDiv(amount0Max, totalSupply, amount0Current);
            uint256 amount1Mint =
                FullMath.mulDiv(amount1Max, totalSupply, amount1Current);
            require(amount0Mint > 0 && amount1Mint > 0, "mint 0");

            mintAmount = amount0Mint < amount1Mint ? amount0Mint : amount1Mint;
        }

        // compute amounts owed to contract
        amount0 = FullMath.mulDivRoundingUp(
            mintAmount,
            amount0Current,
            totalSupply
        );
        amount1 = FullMath.mulDivRoundingUp(
            mintAmount,
            amount1Current,
            totalSupply
        );
    }

    // solhint-disable-next-line function-max-lines
    function _computeFeesEarned(
        bool isZero,
        uint256 feeGrowthInsideLast,
        int24 tick,
        uint128 liquidity
    ) private view returns (uint256 fee) {
        uint256 feeGrowthOutsideLower;
        uint256 feeGrowthOutsideUpper;
        uint256 feeGrowthGlobal;
        if (isZero) {
            feeGrowthGlobal = pool.feeGrowthGlobal0X128();
            (, , feeGrowthOutsideLower, , , , , ) = pool.ticks(lowerTick);
            (, , feeGrowthOutsideUpper, , , , , ) = pool.ticks(upperTick);
        } else {
            feeGrowthGlobal = pool.feeGrowthGlobal1X128();
            (, , , feeGrowthOutsideLower, , , , ) = pool.ticks(lowerTick);
            (, , , feeGrowthOutsideUpper, , , , ) = pool.ticks(upperTick);
        }

        unchecked {
            // calculate fee growth below
            uint256 feeGrowthBelow;
            if (tick >= lowerTick) {
                feeGrowthBelow = feeGrowthOutsideLower;
            } else {
                feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;
            }

            // calculate fee growth above
            uint256 feeGrowthAbove;
            if (tick < upperTick) {
                feeGrowthAbove = feeGrowthOutsideUpper;
            } else {
                feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;
            }

            uint256 feeGrowthInside =
                feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;
            fee = FullMath.mulDiv(
                liquidity,
                feeGrowthInside - feeGrowthInsideLast,
                0x100000000000000000000000000000000
            );
        }
    }

    function _applyFees(uint256 _fee0, uint256 _fee1) private {
        gelatoBalance0 += (_fee0 * gelatoFeeBPS) / 10000;
        gelatoBalance1 += (_fee1 * gelatoFeeBPS) / 10000;
        managerBalance0 += (_fee0 * managerFeeBPS) / 10000;
        managerBalance1 += (_fee1 * managerFeeBPS) / 10000;
    }

    function _subtractAdminFees(uint256 rawFee0, uint256 rawFee1)
        private
        view
        returns (uint256 fee0, uint256 fee1)
    {
        uint256 deduct0 = (rawFee0 * (gelatoFeeBPS + managerFeeBPS)) / 10000;
        uint256 deduct1 = (rawFee1 * (gelatoFeeBPS + managerFeeBPS)) / 10000;
        fee0 = rawFee0 - deduct0;
        fee1 = rawFee1 - deduct1;
    }

    function _checkSlippage(uint160 swapThresholdPrice, bool zeroForOne)
        private
        view
    {
        uint32[] memory secondsAgo = new uint32[](2);
        secondsAgo[0] = gelatoSlippageInterval;
        secondsAgo[1] = 0;

        (int56[] memory tickCumulatives, ) = pool.observe(secondsAgo);

        require(tickCumulatives.length == 2, "array len");
        uint160 avgSqrtRatioX96;
        unchecked {
            int24 avgTick =
                int24(
                    (tickCumulatives[1] - tickCumulatives[0]) /
                        int56(uint56(gelatoSlippageInterval))
                );
            avgSqrtRatioX96 = avgTick.getSqrtRatioAtTick();
        }

        uint160 maxSlippage = (avgSqrtRatioX96 * gelatoSlippageBPS) / 10000;
        if (zeroForOne) {
            require(
                swapThresholdPrice >= avgSqrtRatioX96 - maxSlippage,
                "high slippage"
            );
        } else {
            require(
                swapThresholdPrice <= avgSqrtRatioX96 + maxSlippage,
                "high slippage"
            );
        }
    }
}

File 22 of 27 : GUniPoolStorage.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.4;

import {Gelatofied} from "./Gelatofied.sol";
import {OwnableUninitialized} from "./OwnableUninitialized.sol";
import {
    IUniswapV3Pool
} from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {
    ReentrancyGuardUpgradeable
} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import {
    ERC20Upgradeable
} from "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";

/// @dev Single Global upgradeable state var storage base: APPEND ONLY
/// @dev Add all inherited contracts with state vars here: APPEND ONLY
/// @dev ERC20Upgradable Includes Initialize
// solhint-disable-next-line max-states-count
abstract contract GUniPoolStorage is
    ERC20Upgradeable, /* XXXX DONT MODIFY ORDERING XXXX */
    ReentrancyGuardUpgradeable,
    OwnableUninitialized,
    Gelatofied
    // APPEND ADDITIONAL BASE WITH STATE VARS BELOW:
    // XXXX DONT MODIFY ORDERING XXXX
{
    // solhint-disable-next-line const-name-snakecase
    string public constant version = "1.0.0";
    // solhint-disable-next-line const-name-snakecase
    uint16 public constant gelatoFeeBPS = 250;

    // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX
    int24 public lowerTick;
    int24 public upperTick;

    uint16 public gelatoRebalanceBPS;
    uint16 public gelatoWithdrawBPS;
    uint16 public gelatoSlippageBPS;
    uint32 public gelatoSlippageInterval;

    uint16 public managerFeeBPS;
    address public managerTreasury;

    uint256 public managerBalance0;
    uint256 public managerBalance1;
    uint256 public gelatoBalance0;
    uint256 public gelatoBalance1;

    IUniswapV3Pool public pool;
    IERC20 public token0;
    IERC20 public token1;
    // APPPEND ADDITIONAL STATE VARS BELOW:
    // XXXXXXXX DO NOT MODIFY ORDERING XXXXXXXX

    event UpdateAdminTreasury(
        address oldAdminTreasury,
        address newAdminTreasury
    );

    event UpdateGelatoParams(
        uint16 gelatoRebalanceBPS,
        uint16 gelatoWithdrawBPS,
        uint16 gelatoSlippageBPS,
        uint32 gelatoSlippageInterval
    );

    event SetManagerFee(uint16 managerFee);

    // solhint-disable-next-line max-line-length
    constructor(address payable _gelato) Gelatofied(_gelato) {} // solhint-disable-line no-empty-blocks

    /// @notice initialize storage variables on a new G-UNI pool, only called once
    /// @param _name name of G-UNI token
    /// @param _symbol symbol of G-UNI token
    /// @param _pool address of Uniswap V3 pool
    /// @param _managerFeeBPS proportion of fees earned that go to manager treasury
    /// note that the 4 above params are NOT UPDATEABLE AFTER INILIALIZATION
    /// @param _lowerTick initial lowerTick (only changeable with executiveRebalance)
    /// @param _lowerTick initial upperTick (only changeable with executiveRebalance)
    /// @param _manager_ address of manager (ownership can be transferred)
    function initialize(
        string memory _name,
        string memory _symbol,
        address _pool,
        uint16 _managerFeeBPS,
        int24 _lowerTick,
        int24 _upperTick,
        address _manager_
    ) external initializer {
        require(_managerFeeBPS <= 10000 - gelatoFeeBPS, "mBPS");

        // these variables are immutable after initialization
        pool = IUniswapV3Pool(_pool);
        token0 = IERC20(pool.token0());
        token1 = IERC20(pool.token1());
        managerFeeBPS = _managerFeeBPS; // if set to 0 here manager can still initialize later

        // these variables can be udpated by the manager
        gelatoSlippageInterval = 5 minutes; // default: last five minutes;
        gelatoSlippageBPS = 500; // default: 5% slippage
        gelatoWithdrawBPS = 100; // default: only auto withdraw if tx fee is lt 1% withdrawn
        gelatoRebalanceBPS = 200; // default: only rebalance if tx fee is lt 2% reinvested
        managerTreasury = _manager_; // default: treasury is admin
        lowerTick = _lowerTick;
        upperTick = _upperTick;
        _manager = _manager_;

        // e.g. "Gelato Uniswap V3 USDC/DAI LP" and "G-UNI"
        __ERC20_init(_name, _symbol);
        __ReentrancyGuard_init();
    }

    /// @notice change configurable parameters, only manager can call
    /// @param newRebalanceBPS controls frequency of gelato rebalances: gas fee to execute
    /// rebalance can be gelatoRebalanceBPS proportion of fees earned since last rebalance
    /// @param newWithdrawBPS controls frequency of gelato withdrawals: gas fee to execute
    /// withdrawal can be gelatoWithdrawBPS proportion of fees accrued since last withdraw
    /// @param newSlippageBPS maximum slippage on swaps during gelato rebalance
    /// @param newSlippageInterval length of time for TWAP used in computing slippage on swaps
    /// @param newTreasury address where managerFee withdrawals are sent
    // solhint-disable-next-line code-complexity
    function updateGelatoParams(
        uint16 newRebalanceBPS,
        uint16 newWithdrawBPS,
        uint16 newSlippageBPS,
        uint32 newSlippageInterval,
        address newTreasury
    ) external onlyManager {
        require(newWithdrawBPS <= 10000, "BPS");
        require(newRebalanceBPS <= 10000, "BPS");
        require(newSlippageBPS <= 10000, "BPS");
        emit UpdateGelatoParams(
            newRebalanceBPS,
            newWithdrawBPS,
            newSlippageBPS,
            newSlippageInterval
        );
        if (newRebalanceBPS != 0) gelatoRebalanceBPS = newRebalanceBPS;
        if (newWithdrawBPS != 0) gelatoWithdrawBPS = newWithdrawBPS;
        if (newSlippageBPS != 0) gelatoSlippageBPS = newSlippageBPS;
        if (newSlippageInterval != 0)
            gelatoSlippageInterval = newSlippageInterval;
        if (newTreasury != address(0)) managerTreasury = newTreasury;
    }

    /// @notice initializeManagerFee sets a managerFee, only manager can call.
    /// If a manager fee was not set in the initialize function it can be set here
    /// but ONLY ONCE- after it is set to a non-zero value, managerFee can never be set again.
    /// @param _managerFeeBPS proportion of fees earned that are credited to manager in Basis Points
    function initializeManagerFee(uint16 _managerFeeBPS) external onlyManager {
        require(managerFeeBPS == 0, "fee");
        require(
            _managerFeeBPS > 0 && _managerFeeBPS <= 10000 - gelatoFeeBPS,
            "mBPS"
        );
        emit SetManagerFee(_managerFeeBPS);
        managerFeeBPS = _managerFeeBPS;
    }

    function renounceOwnership() public virtual override onlyManager {
        managerTreasury = address(0);
        managerFeeBPS = 0;
        managerBalance0 = 0;
        managerBalance1 = 0;
        super.renounceOwnership();
    }

    function getPositionID() external view returns (bytes32 positionID) {
        return _getPositionID();
    }

    function _getPositionID() internal view returns (bytes32 positionID) {
        return keccak256(abi.encodePacked(address(this), lowerTick, upperTick));
    }
}

File 23 of 27 : Gelatofied.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.4;

import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {
    IERC20,
    SafeERC20
} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage
/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage
abstract contract Gelatofied {
    using Address for address payable;
    using SafeERC20 for IERC20;

    // solhint-disable-next-line var-name-mixedcase
    address payable public immutable GELATO;

    address private constant _ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    constructor(address payable _gelato) {
        GELATO = _gelato;
    }

    modifier gelatofy(uint256 _amount, address _paymentToken) {
        require(msg.sender == GELATO, "Gelatofied: Only gelato");
        _;
        if (_paymentToken == _ETH) GELATO.sendValue(_amount);
        else IERC20(_paymentToken).safeTransfer(GELATO, _amount);
    }
}

File 24 of 27 : OwnableUninitialized.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.8.4;

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an manager) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the manager 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
 * `onlyManager`, which can be applied to your functions to restrict their use to
 * the manager.
 */
/// @dev DO NOT ADD STATE VARIABLES - APPEND THEM TO GelatoUniV3PoolStorage
/// @dev DO NOT ADD BASE CONTRACTS WITH STATE VARS - APPEND THEM TO GelatoUniV3PoolStorage
abstract contract OwnableUninitialized {
    address internal _manager;

    event OwnershipTransferred(
        address indexed previousManager,
        address indexed newManager
    );

    /// @dev Initializes the contract setting the deployer as the initial manager.
    /// CONSTRUCTOR EMPTY - USE INITIALIZIABLE INSTEAD
    // solhint-disable-next-line no-empty-blocks
    constructor() {}

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

    /**
     * @dev Throws if called by any account other than the manager.
     */
    modifier onlyManager() {
        require(manager() == msg.sender, "Ownable: caller is not the manager");
        _;
    }

    /**
     * @dev Leaves the contract without manager. It will not be possible to call
     * `onlyManager` functions anymore. Can only be called by the current manager.
     *
     * NOTE: Renouncing ownership will leave the contract without an manager,
     * thereby removing any functionality that is only available to the manager.
     */
    function renounceOwnership() public virtual onlyManager {
        emit OwnershipTransferred(_manager, address(0));
        _manager = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current manager.
     */
    function transferOwnership(address newOwner) public virtual onlyManager {
        require(
            newOwner != address(0),
            "Ownable: new manager is the zero address"
        );
        emit OwnershipTransferred(_manager, newOwner);
        _manager = newOwner;
    }
}

File 25 of 27 : FullMath.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.4;

/// @title Contains 512-bit math functions
/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision
/// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits
library FullMath {
    /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
    /// @param a The multiplicand
    /// @param b The multiplier
    /// @param denominator The divisor
    /// @return result The 256-bit result
    /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv
    function mulDiv(
        uint256 a,
        uint256 b,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = a * b
            // Compute the product mod 2**256 and mod 2**256 - 1
            // then use the Chinese Remainder Theorem to reconstruct
            // the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2**256 + prod0
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(a, b, not(0))
                prod0 := mul(a, b)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division
            if (prod1 == 0) {
                require(denominator > 0);
                assembly {
                    result := div(prod0, denominator)
                }
                return result;
            }

            // Make sure the result is less than 2**256.
            // Also prevents denominator == 0
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0]
            // Compute remainder using mulmod
            uint256 remainder;
            assembly {
                remainder := mulmod(a, b, denominator)
            }
            // Subtract 256 bit number from 512 bit number
            assembly {
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator
            // Compute largest power of two divisor of denominator.
            // Always >= 1.
            // EDIT for 0.8 compatibility:
            // see: https://ethereum.stackexchange.com/questions/96642/unary-operator-cannot-be-applied-to-type-uint256
            uint256 twos = denominator & (~denominator + 1);

            // Divide denominator by power of two
            assembly {
                denominator := div(denominator, twos)
            }

            // Divide [prod1 prod0] by the factors of two
            assembly {
                prod0 := div(prod0, twos)
            }
            // Shift in bits from prod1 into prod0. For this we need
            // to flip `twos` such that it is 2**256 / twos.
            // If twos is zero, then it becomes one
            assembly {
                twos := add(div(sub(0, twos), twos), 1)
            }
            prod0 |= prod1 * twos;

            // Invert denominator mod 2**256
            // Now that denominator is an odd number, it has an inverse
            // modulo 2**256 such that denominator * inv = 1 mod 2**256.
            // Compute the inverse by starting with a seed that is correct
            // correct for four bits. That is, denominator * inv = 1 mod 2**4
            uint256 inv = (3 * denominator) ^ 2;
            // Now use Newton-Raphson iteration to improve the precision.
            // Thanks to Hensel's lifting lemma, this also works in modular
            // arithmetic, doubling the correct bits in each step.
            inv *= 2 - denominator * inv; // inverse mod 2**8
            inv *= 2 - denominator * inv; // inverse mod 2**16
            inv *= 2 - denominator * inv; // inverse mod 2**32
            inv *= 2 - denominator * inv; // inverse mod 2**64
            inv *= 2 - denominator * inv; // inverse mod 2**128
            inv *= 2 - denominator * inv; // inverse mod 2**256

            // Because the division is now exact we can divide by multiplying
            // with the modular inverse of denominator. This will give us the
            // correct result modulo 2**256. Since the precoditions guarantee
            // that the outcome is less than 2**256, this is the final result.
            // We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inv;
            return result;
        }
    }

    /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
    /// @param a The multiplicand
    /// @param b The multiplier
    /// @param denominator The divisor
    /// @return result The 256-bit result
    function mulDivRoundingUp(
        uint256 a,
        uint256 b,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        result = mulDiv(a, b, denominator);
        if (mulmod(a, b, denominator) > 0) {
            require(result < type(uint256).max);
            result++;
        }
    }
}

File 26 of 27 : LiquidityAmounts.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.5.0;

import {FullMath} from "./FullMath.sol";
import "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol";

/// @title Liquidity amount functions
/// @notice Provides functions for computing liquidity amounts from token amounts and prices
library LiquidityAmounts {
    function toUint128(uint256 x) private pure returns (uint128 y) {
        require((y = uint128(x)) == x);
    }

    /// @notice Computes the amount of liquidity received for a given amount of token0 and price range
    /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)).
    /// @param sqrtRatioAX96 A sqrt price
    /// @param sqrtRatioBX96 Another sqrt price
    /// @param amount0 The amount0 being sent in
    /// @return liquidity The amount of returned liquidity
    function getLiquidityForAmount0(
        uint160 sqrtRatioAX96,
        uint160 sqrtRatioBX96,
        uint256 amount0
    ) internal pure returns (uint128 liquidity) {
        if (sqrtRatioAX96 > sqrtRatioBX96)
            (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
        uint256 intermediate =
            FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, FixedPoint96.Q96);
        return
            toUint128(
                FullMath.mulDiv(
                    amount0,
                    intermediate,
                    sqrtRatioBX96 - sqrtRatioAX96
                )
            );
    }

    /// @notice Computes the amount of liquidity received for a given amount of token1 and price range
    /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).
    /// @param sqrtRatioAX96 A sqrt price
    /// @param sqrtRatioBX96 Another sqrt price
    /// @param amount1 The amount1 being sent in
    /// @return liquidity The amount of returned liquidity
    function getLiquidityForAmount1(
        uint160 sqrtRatioAX96,
        uint160 sqrtRatioBX96,
        uint256 amount1
    ) internal pure returns (uint128 liquidity) {
        if (sqrtRatioAX96 > sqrtRatioBX96)
            (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
        return
            toUint128(
                FullMath.mulDiv(
                    amount1,
                    FixedPoint96.Q96,
                    sqrtRatioBX96 - sqrtRatioAX96
                )
            );
    }

    /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current
    /// pool prices and the prices at the tick boundaries
    function getLiquidityForAmounts(
        uint160 sqrtRatioX96,
        uint160 sqrtRatioAX96,
        uint160 sqrtRatioBX96,
        uint256 amount0,
        uint256 amount1
    ) internal pure returns (uint128 liquidity) {
        if (sqrtRatioAX96 > sqrtRatioBX96)
            (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);

        if (sqrtRatioX96 <= sqrtRatioAX96) {
            liquidity = getLiquidityForAmount0(
                sqrtRatioAX96,
                sqrtRatioBX96,
                amount0
            );
        } else if (sqrtRatioX96 < sqrtRatioBX96) {
            uint128 liquidity0 =
                getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);
            uint128 liquidity1 =
                getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);

            liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1;
        } else {
            liquidity = getLiquidityForAmount1(
                sqrtRatioAX96,
                sqrtRatioBX96,
                amount1
            );
        }
    }

    /// @notice Computes the amount of token0 for a given amount of liquidity and a price range
    /// @param sqrtRatioAX96 A sqrt price
    /// @param sqrtRatioBX96 Another sqrt price
    /// @param liquidity The liquidity being valued
    /// @return amount0 The amount0
    function getAmount0ForLiquidity(
        uint160 sqrtRatioAX96,
        uint160 sqrtRatioBX96,
        uint128 liquidity
    ) internal pure returns (uint256 amount0) {
        if (sqrtRatioAX96 > sqrtRatioBX96)
            (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);

        return
            FullMath.mulDiv(
                uint256(liquidity) << FixedPoint96.RESOLUTION,
                sqrtRatioBX96 - sqrtRatioAX96,
                sqrtRatioBX96
            ) / sqrtRatioAX96;
    }

    /// @notice Computes the amount of token1 for a given amount of liquidity and a price range
    /// @param sqrtRatioAX96 A sqrt price
    /// @param sqrtRatioBX96 Another sqrt price
    /// @param liquidity The liquidity being valued
    /// @return amount1 The amount1
    function getAmount1ForLiquidity(
        uint160 sqrtRatioAX96,
        uint160 sqrtRatioBX96,
        uint128 liquidity
    ) internal pure returns (uint256 amount1) {
        if (sqrtRatioAX96 > sqrtRatioBX96)
            (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);

        return
            FullMath.mulDiv(
                liquidity,
                sqrtRatioBX96 - sqrtRatioAX96,
                FixedPoint96.Q96
            );
    }

    /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current
    /// pool prices and the prices at the tick boundaries
    function getAmountsForLiquidity(
        uint160 sqrtRatioX96,
        uint160 sqrtRatioAX96,
        uint160 sqrtRatioBX96,
        uint128 liquidity
    ) internal pure returns (uint256 amount0, uint256 amount1) {
        if (sqrtRatioAX96 > sqrtRatioBX96)
            (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);

        if (sqrtRatioX96 <= sqrtRatioAX96) {
            amount0 = getAmount0ForLiquidity(
                sqrtRatioAX96,
                sqrtRatioBX96,
                liquidity
            );
        } else if (sqrtRatioX96 < sqrtRatioBX96) {
            amount0 = getAmount0ForLiquidity(
                sqrtRatioX96,
                sqrtRatioBX96,
                liquidity
            );
            amount1 = getAmount1ForLiquidity(
                sqrtRatioAX96,
                sqrtRatioX96,
                liquidity
            );
        } else {
            amount1 = getAmount1ForLiquidity(
                sqrtRatioAX96,
                sqrtRatioBX96,
                liquidity
            );
        }
    }
}

File 27 of 27 : TickMath.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.4;

/// @title Math library for computing sqrt prices from ticks and vice versa
/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports
/// prices between 2**-128 and 2**128
library TickMath {
    /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128
    int24 internal constant MIN_TICK = -887272;
    /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128
    int24 internal constant MAX_TICK = -MIN_TICK;

    /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)
    uint160 internal constant MIN_SQRT_RATIO = 4295128739;
    /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)
    uint160 internal constant MAX_SQRT_RATIO =
        1461446703485210103287273052203988822378723970342;

    /// @notice Calculates sqrt(1.0001^tick) * 2^96
    /// @dev Throws if |tick| > max tick
    /// @param tick The input tick for the above formula
    /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)
    /// at the given tick
    function getSqrtRatioAtTick(int24 tick)
        internal
        pure
        returns (uint160 sqrtPriceX96)
    {
        uint256 absTick =
            tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));

        // EDIT: 0.8 compatibility
        require(absTick <= uint256(int256(MAX_TICK)), "T");

        uint256 ratio =
            absTick & 0x1 != 0
                ? 0xfffcb933bd6fad37aa2d162d1a594001
                : 0x100000000000000000000000000000000;
        if (absTick & 0x2 != 0)
            ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;
        if (absTick & 0x4 != 0)
            ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;
        if (absTick & 0x8 != 0)
            ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;
        if (absTick & 0x10 != 0)
            ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;
        if (absTick & 0x20 != 0)
            ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;
        if (absTick & 0x40 != 0)
            ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;
        if (absTick & 0x80 != 0)
            ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;
        if (absTick & 0x100 != 0)
            ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;
        if (absTick & 0x200 != 0)
            ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;
        if (absTick & 0x400 != 0)
            ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;
        if (absTick & 0x800 != 0)
            ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;
        if (absTick & 0x1000 != 0)
            ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;
        if (absTick & 0x2000 != 0)
            ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;
        if (absTick & 0x4000 != 0)
            ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;
        if (absTick & 0x8000 != 0)
            ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;
        if (absTick & 0x10000 != 0)
            ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;
        if (absTick & 0x20000 != 0)
            ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;
        if (absTick & 0x40000 != 0)
            ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;
        if (absTick & 0x80000 != 0)
            ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;

        if (tick > 0) ratio = type(uint256).max / ratio;

        // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.
        // we then downcast because we know the result always fits within 160 bits due to our tick input constraint
        // we round up in the division so getTickAtSqrtRatio of the output price is always consistent
        sqrtPriceX96 = uint160(
            (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)
        );
    }

    /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio
    /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may
    /// ever return.
    /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96
    /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio
    function getTickAtSqrtRatio(uint160 sqrtPriceX96)
        internal
        pure
        returns (int24 tick)
    {
        // second inequality must be < because the price can never reach the price at the max tick
        require(
            sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,
            "R"
        );
        uint256 ratio = uint256(sqrtPriceX96) << 32;

        uint256 r = ratio;
        uint256 msb = 0;

        assembly {
            let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(5, gt(r, 0xFFFFFFFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(4, gt(r, 0xFFFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(3, gt(r, 0xFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(2, gt(r, 0xF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(1, gt(r, 0x3))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := gt(r, 0x1)
            msb := or(msb, f)
        }

        if (msb >= 128) r = ratio >> (msb - 127);
        else r = ratio << (127 - msb);

        int256 log_2 = (int256(msb) - 128) << 64;

        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(63, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(62, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(61, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(60, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(59, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(58, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(57, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(56, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(55, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(54, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(53, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(52, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(51, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(50, f))
        }

        int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number

        int24 tickLow =
            int24(
                (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128
            );
        int24 tickHi =
            int24(
                (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128
            );

        tick = tickLow == tickHi
            ? tickLow
            : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96
            ? tickHi
            : tickLow;
    }
}

Settings
{
  "evmVersion": "istanbul",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 1
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address payable","name":"_gelato","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"burnAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount0Out","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1Out","type":"uint256"},{"indexed":false,"internalType":"uint128","name":"liquidityBurned","type":"uint128"}],"name":"Burned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"feesEarned0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feesEarned1","type":"uint256"}],"name":"FeesEarned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"mintAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount0In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1In","type":"uint256"},{"indexed":false,"internalType":"uint128","name":"liquidityMinted","type":"uint128"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousManager","type":"address"},{"indexed":true,"internalType":"address","name":"newManager","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"int24","name":"lowerTick_","type":"int24"},{"indexed":false,"internalType":"int24","name":"upperTick_","type":"int24"},{"indexed":false,"internalType":"uint128","name":"liquidityBefore","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"liquidityAfter","type":"uint128"}],"name":"Rebalance","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"managerFee","type":"uint16"}],"name":"SetManagerFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAdminTreasury","type":"address"},{"indexed":false,"internalType":"address","name":"newAdminTreasury","type":"address"}],"name":"UpdateAdminTreasury","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"gelatoRebalanceBPS","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"gelatoWithdrawBPS","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"gelatoSlippageBPS","type":"uint16"},{"indexed":false,"internalType":"uint32","name":"gelatoSlippageInterval","type":"uint32"}],"name":"UpdateGelatoParams","type":"event"},{"inputs":[],"name":"GELATO","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"burnAmount","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"burn","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"},{"internalType":"uint128","name":"liquidityBurned","type":"uint128"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int24","name":"newLowerTick","type":"int24"},{"internalType":"int24","name":"newUpperTick","type":"int24"},{"internalType":"uint160","name":"swapThresholdPrice","type":"uint160"},{"internalType":"uint256","name":"swapAmountBPS","type":"uint256"},{"internalType":"bool","name":"zeroForOne","type":"bool"}],"name":"executiveRebalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gelatoBalance0","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gelatoBalance1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gelatoFeeBPS","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gelatoRebalanceBPS","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gelatoSlippageBPS","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gelatoSlippageInterval","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gelatoWithdrawBPS","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount0Max","type":"uint256"},{"internalType":"uint256","name":"amount1Max","type":"uint256"}],"name":"getMintAmounts","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"},{"internalType":"uint256","name":"mintAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPositionID","outputs":[{"internalType":"bytes32","name":"positionID","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUnderlyingBalances","outputs":[{"internalType":"uint256","name":"amount0Current","type":"uint256"},{"internalType":"uint256","name":"amount1Current","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint160","name":"sqrtRatioX96","type":"uint160"}],"name":"getUnderlyingBalancesAtPrice","outputs":[{"internalType":"uint256","name":"amount0Current","type":"uint256"},{"internalType":"uint256","name":"amount1Current","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_pool","type":"address"},{"internalType":"uint16","name":"_managerFeeBPS","type":"uint16"},{"internalType":"int24","name":"_lowerTick","type":"int24"},{"internalType":"int24","name":"_upperTick","type":"int24"},{"internalType":"address","name":"_manager_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_managerFeeBPS","type":"uint16"}],"name":"initializeManagerFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lowerTick","outputs":[{"internalType":"int24","name":"","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"managerBalance0","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"managerBalance1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"managerFeeBPS","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"managerTreasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintAmount","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"},{"internalType":"uint128","name":"liquidityMinted","type":"uint128"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pool","outputs":[{"internalType":"contract IUniswapV3Pool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint160","name":"swapThresholdPrice","type":"uint160"},{"internalType":"uint256","name":"swapAmountBPS","type":"uint256"},{"internalType":"bool","name":"zeroForOne","type":"bool"},{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"address","name":"paymentToken","type":"address"}],"name":"rebalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token0","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token1","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount0Owed","type":"uint256"},{"internalType":"uint256","name":"amount1Owed","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"uniswapV3MintCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int256","name":"amount0Delta","type":"int256"},{"internalType":"int256","name":"amount1Delta","type":"int256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"uniswapV3SwapCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"newRebalanceBPS","type":"uint16"},{"internalType":"uint16","name":"newWithdrawBPS","type":"uint16"},{"internalType":"uint16","name":"newSlippageBPS","type":"uint16"},{"internalType":"uint32","name":"newSlippageInterval","type":"uint32"},{"internalType":"address","name":"newTreasury","type":"address"}],"name":"updateGelatoParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"upperTick","outputs":[{"internalType":"int24","name":"","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"address","name":"feeToken","type":"address"}],"name":"withdrawGelatoBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"feeAmount","type":"uint256"},{"internalType":"address","name":"feeToken","type":"address"}],"name":"withdrawManagerBalance","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a06040523480156200001157600080fd5b50604051620060d1380380620060d183398101604081905262000034916200004a565b60601b6001600160601b0319166080526200007a565b6000602082840312156200005c578081fd5b81516001600160a01b038116811462000073578182fd5b9392505050565b60805160601c615ff9620000d8600039600081816105f801528181610d3f01528181610e2801528181610e620152818161154901528181611795015281816117cf015281816118b10152818161192801526119650152615ff96000f3fe608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d9190615a02565b61026e610269366004615353565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d91906158ef565b6102a66106fb565b60405161023d929190615bfa565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd366004615313565b6107a4565b6102f56102f036600461545d565b61085c565b005b6102ff60fa81565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f366004615353565b610c96565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610ccd565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b13660046152a3565b6001600160a01b031660009081526033602052604090205490565b6102f5610cdc565b6097546103e890600160b81b900460020b81565b60405161023d91906159c6565b6102f561040336600461588e565b610d32565b61041b61041636600461588e565b610e8d565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e611173565b61045a6104553660046158b2565b611182565b6040805193845260208401929092529082015260600161023d565b6102f5610483366004615814565b6112d4565b6097546103e890600160a01b900460020b81565b61026e6104aa366004615353565b611494565b6097546102ff90600160d01b900461ffff1681565b61026e6104d2366004615353565b61152f565b6102f56104e53660046157c4565b61153c565b610233609b5481565b6102a66105013660046152a3565b6117fd565b6102f561051436600461588e565b6118a4565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f56105723660046154e7565b61198a565b6097546102ff90600160f01b900461ffff1681565b61023361059a3660046152db565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6102336119ee565b6102f56105db366004615537565b6119fd565b6102f56105ee366004615718565b611c9a565b6102917f000000000000000000000000000000000000000000000000000000000000000081565b6102f56106283660046152a3565b611da7565b6102f561063b3660046154e7565b611e87565b61041b61064e36600461588e565b611ef1565b60606036805461066290615e08565b80601f016020809104026020016040519081016040528092919081815260200182805461068e90615e08565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f233848461222a565b50600192915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561074f57600080fd5b505afa158015610763573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107879190615734565b50505050509150915061079a828261234f565b9350935050509091565b60006107b1848484612600565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561083b5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61084f853361084a8685615dc5565b61222a565b60019150505b9392505050565b33610865610ccd565b6001600160a01b03161461088b5760405162461bcd60e51b815260040161083290615b61565b600080600061089960355490565b1115610c1d57609d546001600160a01b031663514ea4bf6108b86127c6565b6040518263ffffffff1660e01b81526004016108d691815260200190565b60a06040518083038186803b1580156108ee57600080fd5b505afa158015610902573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092691906156c2565b5092945050506001600160801b0383161590506109af57609754600090819061096590600160a01b8104600290810b91600160b81b9004900b8661282c565b9350935050506109758282612bb9565b61097f8282612c92565b6040519193509150600080516020615fa4833981519152906109a49084908490615bfa565b60405180910390a150505b60978054600288810b62ffffff908116600160b81b0262ffffff60b81b19928c900b909116600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a2c9030906004016158ef565b60206040518083038186803b158015610a4457600080fd5b505afa158015610a58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7c9190615876565b610a869190615dc5565b610a909190615dc5565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610acc9030906004016158ef565b60206040518083038186803b158015610ae457600080fd5b505afa158015610af8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1c9190615876565b610b269190615dc5565b610b309190615dc5565b9050610b41898984848b8b8b612d2d565b609d546001600160a01b031663514ea4bf610b5a6127c6565b6040518263ffffffff1660e01b8152600401610b7891815260200190565b60a06040518083038186803b158015610b9057600080fd5b505afa158015610ba4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc891906156c2565b509295505050506001600160801b038316610c165760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610832565b5050610c62565b60978054600288810b62ffffff908116600160b81b0262ffffff60b81b19928c900b909116600160a01b029190911665ffffffffffff60a01b19909216919091171790555b600080516020615f4483398151915287878484604051610c8594939291906159d4565b60405180910390a150505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061084a908690615ca3565b6097546001600160a01b031690565b33610ce5610ccd565b6001600160a01b031614610d0b5760405162461bcd60e51b815260040161083290615b61565b60988054600160201b600160d01b031916905560006099819055609a55610d30612eec565b565b8181336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d7c5760405162461bcd60e51b815260040161083290615a35565b600080610d8f609954609a548888612f53565b60006099819055609a5590925090508115610dc957609854609e54610dc9916001600160a01b0391821691600160301b9091041684613077565b8015610df457609854609f54610df4916001600160a01b0391821691600160301b9091041683613077565b50506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610e5357610e4e6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016836130df565b610e87565b610e876001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084613077565b50505050565b600080600060026065541415610eb55760405162461bcd60e51b815260040161083290615bc3565b600260655584610ed75760405162461bcd60e51b815260040161083290615ba3565b6000610ee260355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015610f3457600080fd5b505afa158015610f48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6c9190615734565b50505050505090506000821115610fad57600080610f886106fb565b91509150610f97828a866131f5565b9650610fa4818a866131f5565b95505050610ffa565b610ff481610fcc609760149054906101000a900460020b60020b61324c565b609754610fe690600160b81b9004600290810b900b61324c565b610fef8b61365e565b6136c7565b90955093505b841561101857609e54611018906001600160a01b0316333088613762565b831561103657609f54611036906001600160a01b0316333087613762565b61107681611055609760149054906101000a900460020b60020b61324c565b60975461106f90600160b81b9004600290810b900b61324c565b888861379a565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d916110c6913091600160a01b8104600290810b92600160b81b909204900b908990600401615903565b6040805180830381600087803b1580156110df57600080fd5b505af11580156110f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111791906154c4565b5050611123868861385c565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e7868887878760405161115a959493929190615945565b60405180910390a1505060016065819055509250925092565b60606037805461066290615e08565b60008060008061119160355490565b905080156111b0576111a4818787613929565b919550935091506112cc565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b1580156111f557600080fd5b505afa158015611209573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122d9190615734565b5050505050509050600061127782611256609760149054906101000a900460020b60020b61324c565b60975461127090600160b81b9004600290810b900b61324c565b8b8b61379a565b9050806001600160801b031693506112c4826112a4609760149054906101000a900460020b60020b61324c565b6097546112be90600160b81b9004600290810b900b61324c565b846136c7565b909650945050505b509250925092565b336112dd610ccd565b6001600160a01b0316146113035760405162461bcd60e51b815260040161083290615b61565b6127108461ffff1611156113295760405162461bcd60e51b815260040161083290615b44565b6127108561ffff16111561134f5760405162461bcd60e51b815260040161083290615b44565b6127108361ffff1611156113755760405162461bcd60e51b815260040161083290615b44565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff8516156113ec576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff841615611411576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561143757609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff821615611459576098805463ffffffff191663ffffffff84161790555b6001600160a01b0381161561148d5760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156115165760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610832565b611525338561084a8685615dc5565b5060019392505050565b60006106f2338484612600565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146115865760405162461bcd60e51b815260040161083290615a35565b8515611596576115968786613a38565b609d546000906001600160a01b031663514ea4bf6115b26127c6565b6040518263ffffffff1660e01b81526004016115d091815260200190565b60a06040518083038186803b1580156115e857600080fd5b505afa1580156115fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162091906156c2565b505050509050611634818989898989613ce6565b609d546000906001600160a01b031663514ea4bf6116506127c6565b6040518263ffffffff1660e01b815260040161166e91815260200190565b60a06040518083038186803b15801561168657600080fd5b505afa15801561169a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116be91906156c2565b505050509050816001600160801b0316816001600160801b03161161171f5760405162461bcd60e51b81526020600482015260176024820152766c6971756964697479206d75737420696e63726561736560481b6044820152606401610832565b609754604051600080516020615f448339815191529161175991600160a01b8204600290810b92600160b81b9004900b90869086906159d4565b60405180910390a150506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156117c0576117bb6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016836130df565b6117f4565b6117f46001600160a01b0382167f000000000000000000000000000000000000000000000000000000000000000084613077565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561185057600080fd5b505afa158015611864573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118889190615734565b505050505091505061189a848261234f565b9250925050915091565b8181336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118ee5760405162461bcd60e51b815260040161083290615a35565b600080611901609b54609c548888612f53565b6000609b819055609c559092509050811561194d57609e5461194d906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000084613077565b8015610df457609f54610df4906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083613077565b609d546001600160a01b031633146119b45760405162461bcd60e51b815260040161083290615a84565b83156119d157609e546119d1906001600160a01b03163386613077565b8215610e8757609f54610e87906001600160a01b03163385613077565b60006119f86127c6565b905090565b600054610100900460ff1680611a16575060005460ff16155b611a325760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015611a54576000805461ffff19166101011790555b611a6160fa612710615d82565b61ffff168561ffff161115611a885760405162461bcd60e51b815260040161083290615a66565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe168191600480820192602092909190829003018186803b158015611adc57600080fd5b505afa158015611af0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1491906152bf565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a7916004808301926020929190829003018186803b158015611b6d57600080fd5b505afa158015611b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba591906152bf565b609f80546001600160a01b03199081166001600160a01b0393841617909155609880546097805461012c65ffffffffffff19909316600160201b61ffff8d160263ffffffff19161792909217600160301b600160d01b031916600160301b95881695860217909255643e800c801960d31b600165ffffff00000160a01b03909116600160a01b60028a810b62ffffff908116929092029290921792909217600165ffffff00000160a01b031916600160b81b9189900b9290921602909216919091179091179055611c768888614208565b611c7e614287565b8015611c90576000805461ff00191690555b5050505050505050565b33611ca3610ccd565b6001600160a01b031614611cc95760405162461bcd60e51b815260040161083290615b61565b609854600160201b900461ffff1615611d0a5760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610832565b60008161ffff16118015611d325750611d2660fa612710615d82565b61ffff168161ffff1611155b611d4e5760405162461bcd60e51b815260040161083290615a66565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611db0610ccd565b6001600160a01b031614611dd65760405162461bcd60e51b815260040161083290615b61565b6001600160a01b038116611e3d5760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610832565b6097546040516001600160a01b03808416921690600080516020615f6483398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611eb15760405162461bcd60e51b815260040161083290615a84565b6000841315611ed157609e54610e4e906001600160a01b03163386613077565b6000831315610e8757609f54610e87906001600160a01b03163385613077565b600080600060026065541415611f195760405162461bcd60e51b815260040161083290615bc3565b600260655584611f545760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610832565b6000611f5f60355490565b609d549091506000906001600160a01b031663514ea4bf611f7e6127c6565b6040518263ffffffff1660e01b8152600401611f9c91815260200190565b60a06040518083038186803b158015611fb457600080fd5b505afa158015611fc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fec91906156c2565b505050509050611ffc33886142fb565b600061201288836001600160801b031685614438565b905061201d8161365e565b60975490945060009081908190819061204c90600160a01b8104600290810b91600160b81b9004900b8a61282c565b935093509350935061205e8282612bb9565b6120688282612c92565b6040519193509150600080516020615fa48339815191529061208d9084908490615bfa565b60405180910390a1609b54609954609e546040516370a0823160e01b815261214893929188916001600160a01b03909116906370a08231906120d39030906004016158ef565b60206040518083038186803b1580156120eb57600080fd5b505afa1580156120ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121239190615876565b61212d9190615dc5565b6121379190615dc5565b6121419190615dc5565b8d89614438565b6121529085615ca3565b609c54609a54609f546040516370a0823160e01b8152939d5061218f9387916001600160a01b0316906370a08231906120d39030906004016158ef565b6121999084615ca3565b985089156121b857609e546121b8906001600160a01b03168c8c613077565b88156121d557609f546121d5906001600160a01b03168c8b613077565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c60405161220c959493929190615945565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b03831661228c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610832565b6001600160a01b0382166122ed5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610832565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf6123776127c6565b6040518263ffffffff1660e01b815260040161239591815260200190565b60a06040518083038186803b1580156123ad57600080fd5b505afa1580156123c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e591906156c2565b9450945094509450945061242e8961240e609760149054906101000a900460020b60020b61324c565b60975461242890600160b81b9004600290810b900b61324c565b886136c7565b909750955060006001600160801b03831661244c6001878c8a6144e7565b6124569190615ca3565b90506000826001600160801b03166124716000878d8b6144e7565b61247b9190615ca3565b90506124878282612c92565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a08231906124c59030906004016158ef565b60206040518083038186803b1580156124dd57600080fd5b505afa1580156124f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125159190615876565b61251f9085615ca3565b6125299190615dc5565b6125339190615dc5565b61253d908a615ca3565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a08231906125789030906004016158ef565b60206040518083038186803b15801561259057600080fd5b505afa1580156125a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c89190615876565b6125d29084615ca3565b6125dc9190615dc5565b6125e69190615dc5565b6125f09089615ca3565b9750505050505050509250929050565b6001600160a01b0383166126645760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610832565b6001600160a01b0382166126c65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610832565b6001600160a01b0383166000908152603360205260409020548181101561273e5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610832565b6127488282615dc5565b6001600160a01b03808616600090815260336020526040808220939093559085168152908120805484929061277e908490615ca3565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615f84833981519152846040516127b891815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b8204600290810b810b60e890811b6034840152600160b81b909304810b900b90911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a08231906128659030906004016158ef565b60206040518083038186803b15801561287d57600080fd5b505afa158015612891573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b59190615876565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a08231906128eb9030906004016158ef565b60206040518083038186803b15801561290357600080fd5b505afa158015612917573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293b9190615876565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a7906064016040805180830381600087803b15801561299b57600080fd5b505af11580156129af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d391906154c4565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a4016040805180830381600087803b158015612a4157600080fd5b505af1158015612a55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a799190615690565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612aaf9030906004016158ef565b60206040518083038186803b158015612ac757600080fd5b505afa158015612adb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aff9190615876565b612b099190615dc5565b612b139190615dc5565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a0823190612b489030906004016158ef565b60206040518083038186803b158015612b6057600080fd5b505afa158015612b74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b989190615876565b612ba29190615dc5565b612bac9190615dc5565b9250505093509350935093565b612710612bc760fa84615d24565b612bd19190615ce1565b609b6000828254612be29190615ca3565b909155506127109050612bf660fa83615d24565b612c009190615ce1565b609c6000828254612c119190615ca3565b909155505060985461271090612c3290600160201b900461ffff1684615d24565b612c3c9190615ce1565b60996000828254612c4d9190615ca3565b909155505060985461271090612c6e90600160201b900461ffff1683615d24565b612c789190615ce1565b609a6000828254612c899190615ca3565b90915550505050565b6000806000612710609860049054906101000a900461ffff1660fa612cb79190615c5b565b612cc59061ffff1687615d24565b612ccf9190615ce1565b60985490915060009061271090612cf290600160201b900461ffff1660fa615c5b565b612d009061ffff1687615d24565b612d0a9190615ce1565b9050612d168287615dc5565b9350612d228186615dc5565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b158015612d7257600080fd5b505afa158015612d86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612daa9190615734565b50505050505090506000612dd782612dc48b60020b61324c565b612dd08b60020b61324c565b8a8a61379a565b90506001600160801b03811615612e9457609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612e239030908f908f908990600401615903565b6040805180830381600087803b158015612e3c57600080fd5b505af1158015612e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7491906154c4565b9092509050612e83828a615dc5565b9850612e8f8189615dc5565b975050505b6000612ec36127108686612ea85789612eaa565b8a5b612eb49190615d24565b612ebe9190615ce1565b6148f3565b90506000811315612ee057612edd8a8a8a8a858b8a614959565b50505b50505050505050505050565b33612ef5610ccd565b6001600160a01b031614612f1b5760405162461bcd60e51b815260040161083290615b61565b6097546040516000916001600160a01b031690600080516020615f64833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0384811691161415612fc857609754849061271090612f8c90600160e01b900461ffff1689615d24565b612f969190615ce1565b1015612fb45760405162461bcd60e51b815260040161083290615afb565b612fbe8487615dc5565b915084905061306e565b609f546001600160a01b038481169116141561303857609754849061271090612ffc90600160e01b900461ffff1688615d24565b6130069190615ce1565b10156130245760405162461bcd60e51b815260040161083290615afb565b61302e8486615dc5565b905085915061306e565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610832565b94509492505050565b6040516001600160a01b0383166024820152604481018290526130da90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614ba2565b505050565b8047101561312f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610832565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461317c576040519150601f19603f3d011682016040523d82523d6000602084013e613181565b606091505b50509050806130da5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610832565b6000613202848484614438565b90506000828061322257634e487b7160e01b600052601260045260246000fd5b848609111561085557600019811061323957600080fd5b8061324381615e43565b95945050505050565b60008060008360020b12613263578260020b613270565b8260020b61327090615e93565b905061327f620d89e719615e72565b60020b8111156132b55760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610832565b6000600182166132c957600160801b6132db565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561331057608061330b826ffff97272373d413259a46990580e213a615d24565b901c90505b600482161561333a576080613335826ffff2e50f5f656932ef12357cf3c7fdcc615d24565b901c90505b600882161561336457608061335f826fffe5caca7e10e4e61c3624eaa0941cd0615d24565b901c90505b601082161561338e576080613389826fffcb9843d60f6159c9db58835c926644615d24565b901c90505b60208216156133b85760806133b3826fff973b41fa98c081472e6896dfb254c0615d24565b901c90505b60408216156133e25760806133dd826fff2ea16466c96a3843ec78b326b52861615d24565b901c90505b608082161561340c576080613407826ffe5dee046a99a2a811c461f1969c3053615d24565b901c90505b610100821615613437576080613432826ffcbe86c7900a88aedcffc83b479aa3a4615d24565b901c90505b61020082161561346257608061345d826ff987a7253ac413176f2b074cf7815e54615d24565b901c90505b61040082161561348d576080613488826ff3392b0822b70005940c7a398e4b70f3615d24565b901c90505b6108008216156134b85760806134b3826fe7159475a2c29b7443b29c7fa6e889d9615d24565b901c90505b6110008216156134e35760806134de826fd097f3bdfd2022b8845ad8f792aa5825615d24565b901c90505b61200082161561350e576080613509826fa9f746462d870fdf8a65dc1f90e061e5615d24565b901c90505b614000821615613539576080613534826f70d869a156d2a1b890bb3df62baf32f7615d24565b901c90505b61800082161561356457608061355f826f31be135f97d08fd981231505542fcfa6615d24565b901c90505b6201000082161561359057608061358b826f09aa508b5b7a84e1c677de54f3e99bc9615d24565b901c90505b620200008216156135bb5760806135b6826e5d6af8dedb81196699c329225ee604615d24565b901c90505b620400008216156135e55760806135e0826d2216e584f5fa1ea926041bedfe98615d24565b901c90505b6208000082161561360d576080613608826b048a170391f7dc42444e8fa2615d24565b901c90505b60008460020b13156136285761362581600019615ce1565b90505b613636600160201b82615e5e565b15613642576001613645565b60005b6136569060ff16602083901c615ca3565b949350505050565b6000600160801b82106136c35760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610832565b5090565b600080836001600160a01b0316856001600160a01b031611156136e8579293925b846001600160a01b0316866001600160a01b0316116137135761370c858585614c74565b915061306e565b836001600160a01b0316866001600160a01b0316101561374c57613738868585614c74565b9150613745858785614cde565b905061306e565b613757858585614cde565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e879085906323b872dd60e01b906084016130a3565b6000836001600160a01b0316856001600160a01b031611156137ba579293925b846001600160a01b0316866001600160a01b0316116137e5576137de858585614d28565b9050613243565b836001600160a01b0316866001600160a01b0316101561384757600061380c878686614d28565b9050600061381b878986614d92565b9050806001600160801b0316826001600160801b03161061383c578061383e565b815b92505050613243565b613852858584614d92565b9695505050505050565b6001600160a01b0382166138b25760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610832565b80603560008282546138c49190615ca3565b90915550506001600160a01b038216600090815260336020526040812080548392906138f1908490615ca3565b90915550506040518181526001600160a01b03831690600090600080516020615f848339815191529060200160405180910390a35050565b60008060008060006139396106fb565b9150915081600014801561394d5750600081115b156139645761395d868983614438565b9250613a13565b801580156139725750600082115b156139825761395d878984614438565b8115801561398e575080155b156139b55760405162461bcd60e51b81526020600482015260006024820152604401610832565b60006139c2888a85614438565b905060006139d1888b85614438565b90506000821180156139e35750600081115b6139ff5760405162461bcd60e51b815260040161083290615ba3565b808210613a0c5780613a0e565b815b945050505b613a1e83838a6131f5565b9450613a2b83828a6131f5565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff1691839150600090613a8457634e487b7160e01b600052603260045260246000fd5b602002602001019063ffffffff16908163ffffffff1681525050600081600181518110613ac157634e487b7160e01b600052603260045260246000fd5b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613b0790859060040161597c565b60006040518083038186803b158015613b1f57600080fd5b505afa158015613b33573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613b5b919081019061537e565b5090508051600214613b9b5760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610832565b6098548151600091829163ffffffff90911660060b9084908390613bcf57634e487b7160e01b600052603260045260246000fd5b602002602001015184600181518110613bf857634e487b7160e01b600052603260045260246000fd5b60200260200101510360060b81613c1f57634e487b7160e01b600052601260045260246000fd5b059050613c2e8160020b61324c565b6097549092506000915061271090613c5190600160f01b900461ffff1684615cf5565b613c5b9190615cbb565b90508415613ca357613c6d8183615da5565b6001600160a01b0316866001600160a01b03161015613c9e5760405162461bcd60e51b815260040161083290615b1d565b613cde565b613cad8183615c81565b6001600160a01b0316866001600160a01b03161115613cde5760405162461bcd60e51b815260040161083290615b1d565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613d1f9030906004016158ef565b60206040518083038186803b158015613d3757600080fd5b505afa158015613d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d6f9190615876565b613d799190615dc5565b613d839190615dc5565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613dbf9030906004016158ef565b60206040518083038186803b158015613dd757600080fd5b505afa158015613deb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e0f9190615876565b613e199190615dc5565b613e239190615dc5565b6097549091506000908190613e4e90600160a01b8104600290810b91600160b81b9004900b8c61282c565b935093505050613e5e8282612bb9565b613e688282612c92565b6040519193509150600080516020615fa483398151915290613e8d9084908490615bfa565b60405180910390a1613e9f8483615ca3565b9150613eab8382615ca3565b609e549091506001600160a01b038681169116141561405657609754869061271090613ee290600160d01b900461ffff1685615d24565b613eec9190615ce1565b1015613f0a5760405162461bcd60e51b815260040161083290615afb565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613f429030906004016158ef565b60206040518083038186803b158015613f5a57600080fd5b505afa158015613f6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f929190615876565b613f9c9190615dc5565b613fa69190615dc5565b613fb09190615dc5565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613feb9030906004016158ef565b60206040518083038186803b15801561400357600080fd5b505afa158015614017573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061403b9190615876565b6140459190615dc5565b61404f9190615dc5565b92506141e1565b609f546001600160a01b03868116911614156130385760975486906127109061408a90600160d01b900461ffff1684615d24565b6140949190615ce1565b10156140b25760405162461bcd60e51b815260040161083290615afb565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a08231906140e89030906004016158ef565b60206040518083038186803b15801561410057600080fd5b505afa158015614114573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141389190615876565b6141429190615dc5565b61414c9190615dc5565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a08231906141879030906004016158ef565b60206040518083038186803b15801561419f57600080fd5b505afa1580156141b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141d79190615876565b61403b9190615dc5565b609754612ee090600160a01b8104600290810b91600160b81b9004900b86868d8d8d612d2d565b600054610100900460ff1680614221575060005460ff16155b61423d5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff1615801561425f576000805461ffff19166101011790555b614267614dc8565b6142718383614e32565b80156130da576000805461ff0019169055505050565b600054610100900460ff16806142a0575060005460ff16155b6142bc5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff161580156142de576000805461ffff19166101011790555b6142e6614ec7565b80156142f8576000805461ff00191690555b50565b6001600160a01b03821661435b5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610832565b6001600160a01b038216600090815260336020526040902054818110156143cf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610832565b6143d98282615dc5565b6001600160a01b03841660009081526033602052604081209190915560358054849290614407908490615dc5565b90915550506040518281526000906001600160a01b03851690600080516020615f8483398151915290602001612342565b600080806000198587098587029250828110838203039150508060001415614472576000841161446757600080fd5b508290049050610855565b80841161447e57600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b60008060008087156146b457609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b815260040160206040518083038186803b15801561454157600080fd5b505afa158015614555573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145799190615876565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba93916145b991600160a01b90910460020b906004016159c6565b6101006040518083038186803b1580156145d257600080fd5b505afa1580156145e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061460a91906155f6565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba93955061465394600160b81b90910460020b935060040191506159c69050565b6101006040518083038186803b15801561466c57600080fd5b505afa158015614680573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146a491906155f6565b5093975061486f95505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b815260040160206040518083038186803b15801561470257600080fd5b505afa158015614716573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061473a9190615876565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161477a91600160a01b90910460020b906004016159c6565b6101006040518083038186803b15801561479357600080fd5b505afa1580156147a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147cb91906155f6565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506148139450600160b81b900460020b9260040191506159c69050565b6101006040518083038186803b15801561482c57600080fd5b505afa158015614840573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061486491906155f6565b509297505050505050505b6000609760149054906101000a900460020b60020b8760020b12614894575082614899565b508281035b6000609760179054906101000a900460020b60020b8860020b12156148bf5750826148c4565b508282035b8183038190036148e46001600160801b0389168b8303600160801b614438565b9b9a5050505050505050505050565b6000600160ff1b82106136c35760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610832565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c4016040805180830381600087803b1580156149c957600080fd5b505af11580156149dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614a0191906154c4565b9150915081614a0f8a6148f3565b614a199190615d43565b935080614a25896148f3565b614a2f9190615d43565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015614a8157600080fd5b505afa158015614a95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614ab99190615734565b50505050505090506000614ae682614ad38f60020b61324c565b614adf8f60020b61324c565b898961379a565b90506001600160801b03811615614b9257609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b8152600401614b3e9493929190615903565b6040805180830381600087803b158015614b5757600080fd5b505af1158015614b6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b8f91906154c4565b50505b5050505097509795505050505050565b6000614bf7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614f379092919063ffffffff16565b8051909150156130da5780806020019051810190614c159190615441565b6130da5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610832565b6000826001600160a01b0316846001600160a01b03161115614c94579192915b6001600160a01b038416614cd4600160601b600160e01b03606085901b16614cbc8787615da5565b6001600160a01b0316866001600160a01b0316614438565b6136569190615ce1565b6000826001600160a01b0316846001600160a01b03161115614cfe579192915b6136566001600160801b038316614d158686615da5565b6001600160a01b0316600160601b614438565b6000826001600160a01b0316846001600160a01b03161115614d48579192915b6000614d6b856001600160a01b0316856001600160a01b0316600160601b614438565b9050613243614d8d8483614d7f8989615da5565b6001600160a01b0316614438565b614f46565b6000826001600160a01b0316846001600160a01b03161115614db2579192915b613656614d8d83600160601b614d7f8888615da5565b600054610100900460ff1680614de1575060005460ff16155b614dfd5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff161580156142e6576000805461ffff191661010117905580156142f8576000805461ff001916905550565b600054610100900460ff1680614e4b575060005460ff16155b614e675760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015614e89576000805461ffff19166101011790555b8251614e9c9060369060208601906150c2565b508151614eb09060379060208501906150c2565b5080156130da576000805461ff0019169055505050565b600054610100900460ff1680614ee0575060005460ff16155b614efc5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015614f1e576000805461ffff19166101011790555b600160655580156142f8576000805461ff001916905550565b60606136568484600085614f61565b806001600160801b0381168114614f5c57600080fd5b919050565b606082471015614fc25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610832565b843b6150105760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610832565b600080866001600160a01b0316858760405161502c91906158d3565b60006040518083038185875af1925050503d8060008114615069576040519150601f19603f3d011682016040523d82523d6000602084013e61506e565b606091505b509150915061507e828286615089565b979650505050505050565b60608315615098575081610855565b8251156150a85782518084602001fd5b8160405162461bcd60e51b81526004016108329190615a02565b8280546150ce90615e08565b90600052602060002090601f0160209004810192826150f05760008555615136565b82601f1061510957805160ff1916838001178555615136565b82800160010185558215615136579182015b8281111561513657825182559160200191906001019061511b565b506136c39291505b808211156136c3576000815560010161513e565b600082601f830112615162578081fd5b8151602061517761517283615c38565b615c08565b80838252828201915082860187848660051b8901011115615196578586fd5b855b858110156151bd5781516151ab81615eef565b84529284019290840190600101615198565b5090979650505050505050565b60008083601f8401126151db578182fd5b5081356001600160401b038111156151f1578182fd5b60208301915083602082850101111561520957600080fd5b9250929050565b8051600681900b8114614f5c57600080fd5b600082601f830112615232578081fd5b81356001600160401b0381111561524b5761524b615ed9565b61525e601f8201601f1916602001615c08565b818152846020838601011115615272578283fd5b816020850160208301379081016020019190915292915050565b80516001600160801b0381168114614f5c57600080fd5b6000602082840312156152b4578081fd5b813561085581615eef565b6000602082840312156152d0578081fd5b815161085581615eef565b600080604083850312156152ed578081fd5b82356152f881615eef565b9150602083013561530881615eef565b809150509250929050565b600080600060608486031215615327578081fd5b833561533281615eef565b9250602084013561534281615eef565b929592945050506040919091013590565b60008060408385031215615365578182fd5b823561537081615eef565b946020939093013593505050565b60008060408385031215615390578182fd5b82516001600160401b03808211156153a6578384fd5b818501915085601f8301126153b9578384fd5b815160206153c961517283615c38565b8083825282820191508286018a848660051b89010111156153e8578889fd5b8896505b84871015615411576153fd81615210565b8352600196909601959183019183016153ec565b509188015191965090935050508082111561542a578283fd5b5061543785828601615152565b9150509250929050565b600060208284031215615452578081fd5b815161085581615f04565b600080600080600060a08688031215615474578283fd5b853561547f81615f12565b9450602086013561548f81615f12565b9350604086013561549f81615eef565b92506060860135915060808601356154b681615f04565b809150509295509295909350565b600080604083850312156154d6578182fd5b505080516020909101519092909150565b600080600080606085870312156154fc578182fd5b843593506020850135925060408501356001600160401b0381111561551f578283fd5b61552b878288016151ca565b95989497509550505050565b600080600080600080600060e0888a031215615551578485fd5b87356001600160401b0380821115615567578687fd5b6155738b838c01615222565b985060208a0135915080821115615588578687fd5b506155958a828b01615222565b96505060408801356155a681615eef565b945060608801356155b681615f21565b935060808801356155c681615f12565b925060a08801356155d681615f12565b915060c08801356155e681615eef565b8091505092959891949750929550565b600080600080600080600080610100898b031215615612578182fd5b61561b8961528c565b9750602089015180600f0b8114615630578283fd5b60408a015160608b01519198509650945061564d60808a01615210565b935060a089015161565d81615eef565b60c08a015190935061566e81615f31565b60e08a015190925061567f81615f04565b809150509295985092959890939650565b600080604083850312156156a2578182fd5b6156ab8361528c565b91506156b96020840161528c565b90509250929050565b600080600080600060a086880312156156d9578283fd5b6156e28661528c565b945060208601519350604086015192506156fe6060870161528c565b915061570c6080870161528c565b90509295509295909350565b600060208284031215615729578081fd5b813561085581615f21565b600080600080600080600060e0888a03121561574e578081fd5b875161575981615eef565b602089015190975061576a81615f12565b604089015190965061577b81615f21565b606089015190955061578c81615f21565b608089015190945061579d81615f21565b60a089015190935060ff811681146157b3578182fd5b60c08901519092506155e681615f04565b600080600080600060a086880312156157db578283fd5b85356157e681615eef565b94506020860135935060408601356157fd81615f04565b92506060860135915060808601356154b681615eef565b600080600080600060a0868803121561582b578283fd5b853561583681615f21565b9450602086013561584681615f21565b9350604086013561585681615f21565b9250606086013561586681615f31565b915060808601356154b681615eef565b600060208284031215615887578081fd5b5051919050565b600080604083850312156158a0578182fd5b82359150602083013561530881615eef565b600080604083850312156158c4578182fd5b50508035926020909101359150565b600082516158e5818460208701615ddc565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b6020808252825182820181905260009190848201906040850190845b818110156159ba57835163ffffffff1683529284019291840191600101615998565b50909695505050505050565b60029190910b815260200190565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b6020815260008251806020840152615a21816040850160208701615ddc565b601f01601f19169190910160400192915050565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252600490820152636d42505360e01b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b602080825260089082015267686967682066656560c01b604082015260600190565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b60208082526003908201526242505360e81b604082015260600190565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b918252602082015260400190565b604051601f8201601f191681016001600160401b0381118282101715615c3057615c30615ed9565b604052919050565b60006001600160401b03821115615c5157615c51615ed9565b5060051b60200190565b600061ffff808316818516808303821115615c7857615c78615ead565b01949350505050565b60006001600160a01b03828116848216808303821115615c7857615c78615ead565b60008219821115615cb657615cb6615ead565b500190565b60006001600160a01b0383811680615cd557615cd5615ec3565b92169190910492915050565b600082615cf057615cf0615ec3565b500490565b60006001600160a01b0382811684821681151582840482111615615d1b57615d1b615ead565b02949350505050565b6000816000190483118215151615615d3e57615d3e615ead565b500290565b60008083128015600160ff1b850184121615615d6157615d61615ead565b6001600160ff1b0384018313811615615d7c57615d7c615ead565b50500390565b600061ffff83811690831681811015615d9d57615d9d615ead565b039392505050565b60006001600160a01b0383811690831681811015615d9d57615d9d615ead565b600082821015615dd757615dd7615ead565b500390565b60005b83811015615df7578181015183820152602001615ddf565b83811115610e875750506000910152565b600181811c90821680615e1c57607f821691505b60208210811415615e3d57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415615e5757615e57615ead565b5060010190565b600082615e6d57615e6d615ec3565b500690565b60008160020b627fffff19811415615e8c57615e8c615ead565b9003919050565b6000600160ff1b821415615ea957615ea9615ead565b0390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146142f857600080fd5b80151581146142f857600080fd5b8060020b81146142f857600080fd5b61ffff811681146142f857600080fd5b63ffffffff811681146142f857600080fdfec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a26469706673582212200d68bbc56177fb98dc03b8435a294744f29eb4d74dbc9371fa03141fd2efac7464736f6c6343000804003300000000000000000000000001051113d81d7d6da508462f2ad6d7fd96cf42ef

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102255760003560e01c8063065756db1461022a57806306fdde0314610246578063095ea7b31461025b5780630dfe16811461027e5780631322d9541461029e57806316f0115b146102b457806318160ddd146102c757806323b872dd146102cf57806324b8fd1b146102e257806331366be4146102f7578063313ce5671461031257806339509351146103215780633d8b30e11461033457806342fb9d4414610349578063481c6a751461035257806354fd4d501461035a578063672152bd1461037e57806370a08231146103a3578063715018a6146103cc578063727dd228146103d457806378ac6357146103f557806394bf804d1461040857806395d89b411461043f5780639894f21a1461044757806399fd808c146104755780639b1344ac14610488578063a457c2d71461049c578063a50b1fe7146104af578063a9059cbb146104c4578063b135c99f146104d7578063b536bd12146104ea578063b670ed7d146104f3578063be93dd5f14610506578063c345445914610519578063cc95353e14610522578063ccdf7a021461053c578063d21220a714610551578063d348799714610564578063d6e7ff3914610577578063dd62ed3e1461058c578063df28408a146105c5578063e25e15e3146105cd578063e4077894146105e0578063eff557a7146105f3578063f2fde38b1461061a578063fa461e331461062d578063fcd3533c14610640575b600080fd5b61023360995481565b6040519081526020015b60405180910390f35b61024e610653565b60405161023d9190615a02565b61026e610269366004615353565b6106e5565b604051901515815260200161023d565b609e54610291906001600160a01b031681565b60405161023d91906158ef565b6102a66106fb565b60405161023d929190615bfa565b609d54610291906001600160a01b031681565b603554610233565b61026e6102dd366004615313565b6107a4565b6102f56102f036600461545d565b61085c565b005b6102ff60fa81565b60405161ffff909116815260200161023d565b6040516012815260200161023d565b61026e61032f366004615353565b610c96565b6097546102ff90600160e01b900461ffff1681565b610233609a5481565b610291610ccd565b61024e604051806040016040528060058152602001640312e302e360dc1b81525081565b60985461038e9063ffffffff1681565b60405163ffffffff909116815260200161023d565b6102336103b13660046152a3565b6001600160a01b031660009081526033602052604090205490565b6102f5610cdc565b6097546103e890600160b81b900460020b81565b60405161023d91906159c6565b6102f561040336600461588e565b610d32565b61041b61041636600461588e565b610e8d565b6040805193845260208401929092526001600160801b03169082015260600161023d565b61024e611173565b61045a6104553660046158b2565b611182565b6040805193845260208401929092529082015260600161023d565b6102f5610483366004615814565b6112d4565b6097546103e890600160a01b900460020b81565b61026e6104aa366004615353565b611494565b6097546102ff90600160d01b900461ffff1681565b61026e6104d2366004615353565b61152f565b6102f56104e53660046157c4565b61153c565b610233609b5481565b6102a66105013660046152a3565b6117fd565b6102f561051436600461588e565b6118a4565b610233609c5481565b60985461029190600160301b90046001600160a01b031681565b6098546102ff90600160201b900461ffff1681565b609f54610291906001600160a01b031681565b6102f56105723660046154e7565b61198a565b6097546102ff90600160f01b900461ffff1681565b61023361059a3660046152db565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b6102336119ee565b6102f56105db366004615537565b6119fd565b6102f56105ee366004615718565b611c9a565b6102917f00000000000000000000000001051113d81d7d6da508462f2ad6d7fd96cf42ef81565b6102f56106283660046152a3565b611da7565b6102f561063b3660046154e7565b611e87565b61041b61064e36600461588e565b611ef1565b60606036805461066290615e08565b80601f016020809104026020016040519081016040528092919081815260200182805461068e90615e08565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b5050505050905090565b60006106f233848461222a565b50600192915050565b600080600080609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561074f57600080fd5b505afa158015610763573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107879190615734565b50505050509150915061079a828261234f565b9350935050509091565b60006107b1848484612600565b6001600160a01b03841660009081526034602090815260408083203384529091529020548281101561083b5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61084f853361084a8685615dc5565b61222a565b60019150505b9392505050565b33610865610ccd565b6001600160a01b03161461088b5760405162461bcd60e51b815260040161083290615b61565b600080600061089960355490565b1115610c1d57609d546001600160a01b031663514ea4bf6108b86127c6565b6040518263ffffffff1660e01b81526004016108d691815260200190565b60a06040518083038186803b1580156108ee57600080fd5b505afa158015610902573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092691906156c2565b5092945050506001600160801b0383161590506109af57609754600090819061096590600160a01b8104600290810b91600160b81b9004900b8661282c565b9350935050506109758282612bb9565b61097f8282612c92565b6040519193509150600080516020615fa4833981519152906109a49084908490615bfa565b60405180910390a150505b60978054600288810b62ffffff908116600160b81b0262ffffff60b81b19928c900b909116600160a01b029190911665ffffffffffff60a01b1990921691909117179055609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190610a2c9030906004016158ef565b60206040518083038186803b158015610a4457600080fd5b505afa158015610a58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7c9190615876565b610a869190615dc5565b610a909190615dc5565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190610acc9030906004016158ef565b60206040518083038186803b158015610ae457600080fd5b505afa158015610af8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1c9190615876565b610b269190615dc5565b610b309190615dc5565b9050610b41898984848b8b8b612d2d565b609d546001600160a01b031663514ea4bf610b5a6127c6565b6040518263ffffffff1660e01b8152600401610b7891815260200190565b60a06040518083038186803b158015610b9057600080fd5b505afa158015610ba4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc891906156c2565b509295505050506001600160801b038316610c165760405162461bcd60e51b815260206004820152600e60248201526d06e657720706f736974696f6e20360941b6044820152606401610832565b5050610c62565b60978054600288810b62ffffff908116600160b81b0262ffffff60b81b19928c900b909116600160a01b029190911665ffffffffffff60a01b19909216919091171790555b600080516020615f4483398151915287878484604051610c8594939291906159d4565b60405180910390a150505050505050565b3360008181526034602090815260408083206001600160a01b038716845290915281205490916106f291859061084a908690615ca3565b6097546001600160a01b031690565b33610ce5610ccd565b6001600160a01b031614610d0b5760405162461bcd60e51b815260040161083290615b61565b60988054600160201b600160d01b031916905560006099819055609a55610d30612eec565b565b8181336001600160a01b037f00000000000000000000000001051113d81d7d6da508462f2ad6d7fd96cf42ef1614610d7c5760405162461bcd60e51b815260040161083290615a35565b600080610d8f609954609a548888612f53565b60006099819055609a5590925090508115610dc957609854609e54610dc9916001600160a01b0391821691600160301b9091041684613077565b8015610df457609854609f54610df4916001600160a01b0391821691600160301b9091041683613077565b50506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610e5357610e4e6001600160a01b037f00000000000000000000000001051113d81d7d6da508462f2ad6d7fd96cf42ef16836130df565b610e87565b610e876001600160a01b0382167f00000000000000000000000001051113d81d7d6da508462f2ad6d7fd96cf42ef84613077565b50505050565b600080600060026065541415610eb55760405162461bcd60e51b815260040161083290615bc3565b600260655584610ed75760405162461bcd60e51b815260040161083290615ba3565b6000610ee260355490565b90506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015610f3457600080fd5b505afa158015610f48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6c9190615734565b50505050505090506000821115610fad57600080610f886106fb565b91509150610f97828a866131f5565b9650610fa4818a866131f5565b95505050610ffa565b610ff481610fcc609760149054906101000a900460020b60020b61324c565b609754610fe690600160b81b9004600290810b900b61324c565b610fef8b61365e565b6136c7565b90955093505b841561101857609e54611018906001600160a01b0316333088613762565b831561103657609f54611036906001600160a01b0316333087613762565b61107681611055609760149054906101000a900460020b60020b61324c565b60975461106f90600160b81b9004600290810b900b61324c565b888861379a565b609d54609754604051633c8a7d8d60e01b81529295506001600160a01b0390911691633c8a7d8d916110c6913091600160a01b8104600290810b92600160b81b909204900b908990600401615903565b6040805180830381600087803b1580156110df57600080fd5b505af11580156110f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111791906154c4565b5050611123868861385c565b7f55801cfe493000b734571da1694b21e7f66b11e8ce9fdaa0524ecb59105e73e7868887878760405161115a959493929190615945565b60405180910390a1505060016065819055509250925092565b60606037805461066290615e08565b60008060008061119160355490565b905080156111b0576111a4818787613929565b919550935091506112cc565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b1580156111f557600080fd5b505afa158015611209573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122d9190615734565b5050505050509050600061127782611256609760149054906101000a900460020b60020b61324c565b60975461127090600160b81b9004600290810b900b61324c565b8b8b61379a565b9050806001600160801b031693506112c4826112a4609760149054906101000a900460020b60020b61324c565b6097546112be90600160b81b9004600290810b900b61324c565b846136c7565b909650945050505b509250925092565b336112dd610ccd565b6001600160a01b0316146113035760405162461bcd60e51b815260040161083290615b61565b6127108461ffff1611156113295760405162461bcd60e51b815260040161083290615b44565b6127108561ffff16111561134f5760405162461bcd60e51b815260040161083290615b44565b6127108361ffff1611156113755760405162461bcd60e51b815260040161083290615b44565b6040805161ffff8781168252868116602083015285168183015263ffffffff8416606082015290517f0b7615006627cf7664941bc288d4641731f895e102f95cb8690583ad7508faa89181900360800190a161ffff8516156113ec576097805461ffff60d01b1916600160d01b61ffff8816021790555b61ffff841615611411576097805461ffff60e01b1916600160e01b61ffff8716021790555b61ffff83161561143757609780546001600160f01b0316600160f01b61ffff8616021790555b63ffffffff821615611459576098805463ffffffff191663ffffffff84161790555b6001600160a01b0381161561148d5760988054600160301b600160d01b031916600160301b6001600160a01b038416021790555b5050505050565b3360009081526034602090815260408083206001600160a01b0386168452909152812054828110156115165760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610832565b611525338561084a8685615dc5565b5060019392505050565b60006106f2338484612600565b8181336001600160a01b037f00000000000000000000000001051113d81d7d6da508462f2ad6d7fd96cf42ef16146115865760405162461bcd60e51b815260040161083290615a35565b8515611596576115968786613a38565b609d546000906001600160a01b031663514ea4bf6115b26127c6565b6040518263ffffffff1660e01b81526004016115d091815260200190565b60a06040518083038186803b1580156115e857600080fd5b505afa1580156115fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162091906156c2565b505050509050611634818989898989613ce6565b609d546000906001600160a01b031663514ea4bf6116506127c6565b6040518263ffffffff1660e01b815260040161166e91815260200190565b60a06040518083038186803b15801561168657600080fd5b505afa15801561169a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116be91906156c2565b505050509050816001600160801b0316816001600160801b03161161171f5760405162461bcd60e51b81526020600482015260176024820152766c6971756964697479206d75737420696e63726561736560481b6044820152606401610832565b609754604051600080516020615f448339815191529161175991600160a01b8204600290810b92600160b81b9004900b90869086906159d4565b60405180910390a150506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156117c0576117bb6001600160a01b037f00000000000000000000000001051113d81d7d6da508462f2ad6d7fd96cf42ef16836130df565b6117f4565b6117f46001600160a01b0382167f00000000000000000000000001051113d81d7d6da508462f2ad6d7fd96cf42ef84613077565b50505050505050565b6000806000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561185057600080fd5b505afa158015611864573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118889190615734565b505050505091505061189a848261234f565b9250925050915091565b8181336001600160a01b037f00000000000000000000000001051113d81d7d6da508462f2ad6d7fd96cf42ef16146118ee5760405162461bcd60e51b815260040161083290615a35565b600080611901609b54609c548888612f53565b6000609b819055609c559092509050811561194d57609e5461194d906001600160a01b03167f00000000000000000000000001051113d81d7d6da508462f2ad6d7fd96cf42ef84613077565b8015610df457609f54610df4906001600160a01b03167f00000000000000000000000001051113d81d7d6da508462f2ad6d7fd96cf42ef83613077565b609d546001600160a01b031633146119b45760405162461bcd60e51b815260040161083290615a84565b83156119d157609e546119d1906001600160a01b03163386613077565b8215610e8757609f54610e87906001600160a01b03163385613077565b60006119f86127c6565b905090565b600054610100900460ff1680611a16575060005460ff16155b611a325760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015611a54576000805461ffff19166101011790555b611a6160fa612710615d82565b61ffff168561ffff161115611a885760405162461bcd60e51b815260040161083290615a66565b609d80546001600160a01b0319166001600160a01b03881690811790915560408051630dfe168160e01b81529051630dfe168191600480820192602092909190829003018186803b158015611adc57600080fd5b505afa158015611af0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1491906152bf565b609e80546001600160a01b0319166001600160a01b03928316179055609d546040805163d21220a760e01b81529051919092169163d21220a7916004808301926020929190829003018186803b158015611b6d57600080fd5b505afa158015611b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba591906152bf565b609f80546001600160a01b03199081166001600160a01b0393841617909155609880546097805461012c65ffffffffffff19909316600160201b61ffff8d160263ffffffff19161792909217600160301b600160d01b031916600160301b95881695860217909255643e800c801960d31b600165ffffff00000160a01b03909116600160a01b60028a810b62ffffff908116929092029290921792909217600165ffffff00000160a01b031916600160b81b9189900b9290921602909216919091179091179055611c768888614208565b611c7e614287565b8015611c90576000805461ff00191690555b5050505050505050565b33611ca3610ccd565b6001600160a01b031614611cc95760405162461bcd60e51b815260040161083290615b61565b609854600160201b900461ffff1615611d0a5760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401610832565b60008161ffff16118015611d325750611d2660fa612710615d82565b61ffff168161ffff1611155b611d4e5760405162461bcd60e51b815260040161083290615a66565b60405161ffff821681527f8a1ffb520c943072e654fc414750dbefad5b6d6311339d041901c4752782fad39060200160405180910390a16098805461ffff909216600160201b0261ffff60201b19909216919091179055565b33611db0610ccd565b6001600160a01b031614611dd65760405162461bcd60e51b815260040161083290615b61565b6001600160a01b038116611e3d5760405162461bcd60e51b815260206004820152602860248201527f4f776e61626c653a206e6577206d616e6167657220697320746865207a65726f604482015267206164647265737360c01b6064820152608401610832565b6097546040516001600160a01b03808416921690600080516020615f6483398151915290600090a3609780546001600160a01b0319166001600160a01b0392909216919091179055565b609d546001600160a01b03163314611eb15760405162461bcd60e51b815260040161083290615a84565b6000841315611ed157609e54610e4e906001600160a01b03163386613077565b6000831315610e8757609f54610e87906001600160a01b03163385613077565b600080600060026065541415611f195760405162461bcd60e51b815260040161083290615bc3565b600260655584611f545760405162461bcd60e51b815260206004820152600660248201526506275726e20360d41b6044820152606401610832565b6000611f5f60355490565b609d549091506000906001600160a01b031663514ea4bf611f7e6127c6565b6040518263ffffffff1660e01b8152600401611f9c91815260200190565b60a06040518083038186803b158015611fb457600080fd5b505afa158015611fc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fec91906156c2565b505050509050611ffc33886142fb565b600061201288836001600160801b031685614438565b905061201d8161365e565b60975490945060009081908190819061204c90600160a01b8104600290810b91600160b81b9004900b8a61282c565b935093509350935061205e8282612bb9565b6120688282612c92565b6040519193509150600080516020615fa48339815191529061208d9084908490615bfa565b60405180910390a1609b54609954609e546040516370a0823160e01b815261214893929188916001600160a01b03909116906370a08231906120d39030906004016158ef565b60206040518083038186803b1580156120eb57600080fd5b505afa1580156120ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121239190615876565b61212d9190615dc5565b6121379190615dc5565b6121419190615dc5565b8d89614438565b6121529085615ca3565b609c54609a54609f546040516370a0823160e01b8152939d5061218f9387916001600160a01b0316906370a08231906120d39030906004016158ef565b6121999084615ca3565b985089156121b857609e546121b8906001600160a01b03168c8c613077565b88156121d557609f546121d5906001600160a01b03168c8b613077565b7f7239dff1718b550db7f36cbf69c665cfeb56d0e96b4fb76a5cba712961b655098b8d8c8c8c60405161220c959493929190615945565b60405180910390a15050505050505060016065819055509250925092565b6001600160a01b03831661228c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610832565b6001600160a01b0382166122ed5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610832565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b609d546000908190819081908190819081906001600160a01b031663514ea4bf6123776127c6565b6040518263ffffffff1660e01b815260040161239591815260200190565b60a06040518083038186803b1580156123ad57600080fd5b505afa1580156123c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e591906156c2565b9450945094509450945061242e8961240e609760149054906101000a900460020b60020b61324c565b60975461242890600160b81b9004600290810b900b61324c565b886136c7565b909750955060006001600160801b03831661244c6001878c8a6144e7565b6124569190615ca3565b90506000826001600160801b03166124716000878d8b6144e7565b61247b9190615ca3565b90506124878282612c92565b609b54609954609e546040516370a0823160e01b8152949650929450909290916001600160a01b0316906370a08231906124c59030906004016158ef565b60206040518083038186803b1580156124dd57600080fd5b505afa1580156124f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125159190615876565b61251f9085615ca3565b6125299190615dc5565b6125339190615dc5565b61253d908a615ca3565b609c54609a54609f546040516370a0823160e01b8152939c50919290916001600160a01b0316906370a08231906125789030906004016158ef565b60206040518083038186803b15801561259057600080fd5b505afa1580156125a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c89190615876565b6125d29084615ca3565b6125dc9190615dc5565b6125e69190615dc5565b6125f09089615ca3565b9750505050505050509250929050565b6001600160a01b0383166126645760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610832565b6001600160a01b0382166126c65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610832565b6001600160a01b0383166000908152603360205260409020548181101561273e5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610832565b6127488282615dc5565b6001600160a01b03808616600090815260336020526040808220939093559085168152908120805484929061277e908490615ca3565b92505081905550826001600160a01b0316846001600160a01b0316600080516020615f84833981519152846040516127b891815260200190565b60405180910390a350505050565b6097546040516001600160601b03193060601b166020820152600160a01b8204600290810b810b60e890811b6034840152600160b81b909304810b900b90911b6037820152600090603a0160405160208183030381529060405280519060200120905090565b609e546040516370a0823160e01b815260009182918291829182916001600160a01b0316906370a08231906128659030906004016158ef565b60206040518083038186803b15801561287d57600080fd5b505afa158015612891573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b59190615876565b609f546040516370a0823160e01b81529192506000916001600160a01b03909116906370a08231906128eb9030906004016158ef565b60206040518083038186803b15801561290357600080fd5b505afa158015612917573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293b9190615876565b609d5460405163a34123a760e01b815260028c810b60048301528b900b60248201526001600160801b038a1660448201529192506001600160a01b03169063a34123a7906064016040805180830381600087803b15801561299b57600080fd5b505af11580156129af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d391906154c4565b609d546040516309e3d67b60e31b815230600482015260028d810b60248301528c900b60448201526001600160801b036064820181905260848201529298509096506001600160a01b031690634f1eb3d89060a4016040805180830381600087803b158015612a4157600080fd5b505af1158015612a55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a799190615690565b5050609e546040516370a0823160e01b8152879184916001600160a01b03909116906370a0823190612aaf9030906004016158ef565b60206040518083038186803b158015612ac757600080fd5b505afa158015612adb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aff9190615876565b612b099190615dc5565b612b139190615dc5565b609f546040516370a0823160e01b8152919550869183916001600160a01b0316906370a0823190612b489030906004016158ef565b60206040518083038186803b158015612b6057600080fd5b505afa158015612b74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b989190615876565b612ba29190615dc5565b612bac9190615dc5565b9250505093509350935093565b612710612bc760fa84615d24565b612bd19190615ce1565b609b6000828254612be29190615ca3565b909155506127109050612bf660fa83615d24565b612c009190615ce1565b609c6000828254612c119190615ca3565b909155505060985461271090612c3290600160201b900461ffff1684615d24565b612c3c9190615ce1565b60996000828254612c4d9190615ca3565b909155505060985461271090612c6e90600160201b900461ffff1683615d24565b612c789190615ce1565b609a6000828254612c899190615ca3565b90915550505050565b6000806000612710609860049054906101000a900461ffff1660fa612cb79190615c5b565b612cc59061ffff1687615d24565b612ccf9190615ce1565b60985490915060009061271090612cf290600160201b900461ffff1660fa615c5b565b612d009061ffff1687615d24565b612d0a9190615ce1565b9050612d168287615dc5565b9350612d228186615dc5565b925050509250929050565b609d5460408051633850c7bd60e01b815290516000926001600160a01b031691633850c7bd9160048083019260e0929190829003018186803b158015612d7257600080fd5b505afa158015612d86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612daa9190615734565b50505050505090506000612dd782612dc48b60020b61324c565b612dd08b60020b61324c565b8a8a61379a565b90506001600160801b03811615612e9457609d54604051633c8a7d8d60e01b815260009182916001600160a01b0390911690633c8a7d8d90612e239030908f908f908990600401615903565b6040805180830381600087803b158015612e3c57600080fd5b505af1158015612e50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7491906154c4565b9092509050612e83828a615dc5565b9850612e8f8189615dc5565b975050505b6000612ec36127108686612ea85789612eaa565b8a5b612eb49190615d24565b612ebe9190615ce1565b6148f3565b90506000811315612ee057612edd8a8a8a8a858b8a614959565b50505b50505050505050505050565b33612ef5610ccd565b6001600160a01b031614612f1b5760405162461bcd60e51b815260040161083290615b61565b6097546040516000916001600160a01b031690600080516020615f64833981519152908390a3609780546001600160a01b0319169055565b609e5460009081906001600160a01b0384811691161415612fc857609754849061271090612f8c90600160e01b900461ffff1689615d24565b612f969190615ce1565b1015612fb45760405162461bcd60e51b815260040161083290615afb565b612fbe8487615dc5565b915084905061306e565b609f546001600160a01b038481169116141561303857609754849061271090612ffc90600160e01b900461ffff1688615d24565b6130069190615ce1565b10156130245760405162461bcd60e51b815260040161083290615afb565b61302e8486615dc5565b905085915061306e565b60405162461bcd60e51b815260206004820152600b60248201526a3bb937b733903a37b5b2b760a91b6044820152606401610832565b94509492505050565b6040516001600160a01b0383166024820152604481018290526130da90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614ba2565b505050565b8047101561312f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610832565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461317c576040519150601f19603f3d011682016040523d82523d6000602084013e613181565b606091505b50509050806130da5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610832565b6000613202848484614438565b90506000828061322257634e487b7160e01b600052601260045260246000fd5b848609111561085557600019811061323957600080fd5b8061324381615e43565b95945050505050565b60008060008360020b12613263578260020b613270565b8260020b61327090615e93565b905061327f620d89e719615e72565b60020b8111156132b55760405162461bcd60e51b81526020600482015260016024820152601560fa1b6044820152606401610832565b6000600182166132c957600160801b6132db565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b03169050600282161561331057608061330b826ffff97272373d413259a46990580e213a615d24565b901c90505b600482161561333a576080613335826ffff2e50f5f656932ef12357cf3c7fdcc615d24565b901c90505b600882161561336457608061335f826fffe5caca7e10e4e61c3624eaa0941cd0615d24565b901c90505b601082161561338e576080613389826fffcb9843d60f6159c9db58835c926644615d24565b901c90505b60208216156133b85760806133b3826fff973b41fa98c081472e6896dfb254c0615d24565b901c90505b60408216156133e25760806133dd826fff2ea16466c96a3843ec78b326b52861615d24565b901c90505b608082161561340c576080613407826ffe5dee046a99a2a811c461f1969c3053615d24565b901c90505b610100821615613437576080613432826ffcbe86c7900a88aedcffc83b479aa3a4615d24565b901c90505b61020082161561346257608061345d826ff987a7253ac413176f2b074cf7815e54615d24565b901c90505b61040082161561348d576080613488826ff3392b0822b70005940c7a398e4b70f3615d24565b901c90505b6108008216156134b85760806134b3826fe7159475a2c29b7443b29c7fa6e889d9615d24565b901c90505b6110008216156134e35760806134de826fd097f3bdfd2022b8845ad8f792aa5825615d24565b901c90505b61200082161561350e576080613509826fa9f746462d870fdf8a65dc1f90e061e5615d24565b901c90505b614000821615613539576080613534826f70d869a156d2a1b890bb3df62baf32f7615d24565b901c90505b61800082161561356457608061355f826f31be135f97d08fd981231505542fcfa6615d24565b901c90505b6201000082161561359057608061358b826f09aa508b5b7a84e1c677de54f3e99bc9615d24565b901c90505b620200008216156135bb5760806135b6826e5d6af8dedb81196699c329225ee604615d24565b901c90505b620400008216156135e55760806135e0826d2216e584f5fa1ea926041bedfe98615d24565b901c90505b6208000082161561360d576080613608826b048a170391f7dc42444e8fa2615d24565b901c90505b60008460020b13156136285761362581600019615ce1565b90505b613636600160201b82615e5e565b15613642576001613645565b60005b6136569060ff16602083901c615ca3565b949350505050565b6000600160801b82106136c35760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b6064820152608401610832565b5090565b600080836001600160a01b0316856001600160a01b031611156136e8579293925b846001600160a01b0316866001600160a01b0316116137135761370c858585614c74565b915061306e565b836001600160a01b0316866001600160a01b0316101561374c57613738868585614c74565b9150613745858785614cde565b905061306e565b613757858585614cde565b905094509492505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610e879085906323b872dd60e01b906084016130a3565b6000836001600160a01b0316856001600160a01b031611156137ba579293925b846001600160a01b0316866001600160a01b0316116137e5576137de858585614d28565b9050613243565b836001600160a01b0316866001600160a01b0316101561384757600061380c878686614d28565b9050600061381b878986614d92565b9050806001600160801b0316826001600160801b03161061383c578061383e565b815b92505050613243565b613852858584614d92565b9695505050505050565b6001600160a01b0382166138b25760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610832565b80603560008282546138c49190615ca3565b90915550506001600160a01b038216600090815260336020526040812080548392906138f1908490615ca3565b90915550506040518181526001600160a01b03831690600090600080516020615f848339815191529060200160405180910390a35050565b60008060008060006139396106fb565b9150915081600014801561394d5750600081115b156139645761395d868983614438565b9250613a13565b801580156139725750600082115b156139825761395d878984614438565b8115801561398e575080155b156139b55760405162461bcd60e51b81526020600482015260006024820152604401610832565b60006139c2888a85614438565b905060006139d1888b85614438565b90506000821180156139e35750600081115b6139ff5760405162461bcd60e51b815260040161083290615ba3565b808210613a0c5780613a0e565b815b945050505b613a1e83838a6131f5565b9450613a2b83828a6131f5565b9350505093509350939050565b6040805160028082526060820183526000926020830190803683375050609854825192935063ffffffff1691839150600090613a8457634e487b7160e01b600052603260045260246000fd5b602002602001019063ffffffff16908163ffffffff1681525050600081600181518110613ac157634e487b7160e01b600052603260045260246000fd5b63ffffffff90921660209283029190910190910152609d5460405163883bdbfd60e01b81526000916001600160a01b03169063883bdbfd90613b0790859060040161597c565b60006040518083038186803b158015613b1f57600080fd5b505afa158015613b33573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613b5b919081019061537e565b5090508051600214613b9b5760405162461bcd60e51b815260206004820152600960248201526830b93930bc903632b760b91b6044820152606401610832565b6098548151600091829163ffffffff90911660060b9084908390613bcf57634e487b7160e01b600052603260045260246000fd5b602002602001015184600181518110613bf857634e487b7160e01b600052603260045260246000fd5b60200260200101510360060b81613c1f57634e487b7160e01b600052601260045260246000fd5b059050613c2e8160020b61324c565b6097549092506000915061271090613c5190600160f01b900461ffff1684615cf5565b613c5b9190615cbb565b90508415613ca357613c6d8183615da5565b6001600160a01b0316866001600160a01b03161015613c9e5760405162461bcd60e51b815260040161083290615b1d565b613cde565b613cad8183615c81565b6001600160a01b0316866001600160a01b03161115613cde5760405162461bcd60e51b815260040161083290615b1d565b505050505050565b609b54609954609e546040516370a0823160e01b815260009392916001600160a01b0316906370a0823190613d1f9030906004016158ef565b60206040518083038186803b158015613d3757600080fd5b505afa158015613d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d6f9190615876565b613d799190615dc5565b613d839190615dc5565b609c54609a54609f546040516370a0823160e01b81529394506000936001600160a01b03909116906370a0823190613dbf9030906004016158ef565b60206040518083038186803b158015613dd757600080fd5b505afa158015613deb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e0f9190615876565b613e199190615dc5565b613e239190615dc5565b6097549091506000908190613e4e90600160a01b8104600290810b91600160b81b9004900b8c61282c565b935093505050613e5e8282612bb9565b613e688282612c92565b6040519193509150600080516020615fa483398151915290613e8d9084908490615bfa565b60405180910390a1613e9f8483615ca3565b9150613eab8382615ca3565b609e549091506001600160a01b038681169116141561405657609754869061271090613ee290600160d01b900461ffff1685615d24565b613eec9190615ce1565b1015613f0a5760405162461bcd60e51b815260040161083290615afb565b609b54609954609e546040516370a0823160e01b8152899392916001600160a01b0316906370a0823190613f429030906004016158ef565b60206040518083038186803b158015613f5a57600080fd5b505afa158015613f6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f929190615876565b613f9c9190615dc5565b613fa69190615dc5565b613fb09190615dc5565b609c54609a54609f546040516370a0823160e01b8152939750919290916001600160a01b0316906370a0823190613feb9030906004016158ef565b60206040518083038186803b15801561400357600080fd5b505afa158015614017573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061403b9190615876565b6140459190615dc5565b61404f9190615dc5565b92506141e1565b609f546001600160a01b03868116911614156130385760975486906127109061408a90600160d01b900461ffff1684615d24565b6140949190615ce1565b10156140b25760405162461bcd60e51b815260040161083290615afb565b609b54609954609e546040516370a0823160e01b81526001600160a01b03909116906370a08231906140e89030906004016158ef565b60206040518083038186803b15801561410057600080fd5b505afa158015614114573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141389190615876565b6141429190615dc5565b61414c9190615dc5565b609c54609a54609f546040516370a0823160e01b815293975089936001600160a01b03909116906370a08231906141879030906004016158ef565b60206040518083038186803b15801561419f57600080fd5b505afa1580156141b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141d79190615876565b61403b9190615dc5565b609754612ee090600160a01b8104600290810b91600160b81b9004900b86868d8d8d612d2d565b600054610100900460ff1680614221575060005460ff16155b61423d5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff1615801561425f576000805461ffff19166101011790555b614267614dc8565b6142718383614e32565b80156130da576000805461ff0019169055505050565b600054610100900460ff16806142a0575060005460ff16155b6142bc5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff161580156142de576000805461ffff19166101011790555b6142e6614ec7565b80156142f8576000805461ff00191690555b50565b6001600160a01b03821661435b5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610832565b6001600160a01b038216600090815260336020526040902054818110156143cf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610832565b6143d98282615dc5565b6001600160a01b03841660009081526033602052604081209190915560358054849290614407908490615dc5565b90915550506040518281526000906001600160a01b03851690600080516020615f8483398151915290602001612342565b600080806000198587098587029250828110838203039150508060001415614472576000841161446757600080fd5b508290049050610855565b80841161447e57600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b60008060008087156146b457609d60009054906101000a90046001600160a01b03166001600160a01b031663f30583996040518163ffffffff1660e01b815260040160206040518083038186803b15801561454157600080fd5b505afa158015614555573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145799190615876565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba93916145b991600160a01b90910460020b906004016159c6565b6101006040518083038186803b1580156145d257600080fd5b505afa1580156145e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061460a91906155f6565b5050609d5460975460405163f30dba9360e01b8152959a506001600160a01b03909116965063f30dba93955061465394600160b81b90910460020b935060040191506159c69050565b6101006040518083038186803b15801561466c57600080fd5b505afa158015614680573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146a491906155f6565b5093975061486f95505050505050565b609d60009054906101000a90046001600160a01b03166001600160a01b031663461413196040518163ffffffff1660e01b815260040160206040518083038186803b15801561470257600080fd5b505afa158015614716573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061473a9190615876565b609d5460975460405163f30dba9360e01b81529293506001600160a01b039091169163f30dba939161477a91600160a01b90910460020b906004016159c6565b6101006040518083038186803b15801561479357600080fd5b505afa1580156147a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147cb91906155f6565b5050609d5460975460405163f30dba9360e01b8152949a506001600160a01b03909116965063f30dba9395506148139450600160b81b900460020b9260040191506159c69050565b6101006040518083038186803b15801561482c57600080fd5b505afa158015614840573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061486491906155f6565b509297505050505050505b6000609760149054906101000a900460020b60020b8760020b12614894575082614899565b508281035b6000609760179054906101000a900460020b60020b8860020b12156148bf5750826148c4565b508282035b8183038190036148e46001600160801b0389168b8303600160801b614438565b9b9a5050505050505050505050565b6000600160ff1b82106136c35760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610832565b609d54604051630251596160e31b81523060048201528215156024820152604481018590526001600160a01b03848116606483015260a06084830152600060a4830181905292839283928392169063128acb089060c4016040805180830381600087803b1580156149c957600080fd5b505af11580156149dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614a0191906154c4565b9150915081614a0f8a6148f3565b614a199190615d43565b935080614a25896148f3565b614a2f9190615d43565b92506000609d60009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b158015614a8157600080fd5b505afa158015614a95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614ab99190615734565b50505050505090506000614ae682614ad38f60020b61324c565b614adf8f60020b61324c565b898961379a565b90506001600160801b03811615614b9257609d60009054906101000a90046001600160a01b03166001600160a01b0316633c8a7d8d308f8f856040518563ffffffff1660e01b8152600401614b3e9493929190615903565b6040805180830381600087803b158015614b5757600080fd5b505af1158015614b6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b8f91906154c4565b50505b5050505097509795505050505050565b6000614bf7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614f379092919063ffffffff16565b8051909150156130da5780806020019051810190614c159190615441565b6130da5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610832565b6000826001600160a01b0316846001600160a01b03161115614c94579192915b6001600160a01b038416614cd4600160601b600160e01b03606085901b16614cbc8787615da5565b6001600160a01b0316866001600160a01b0316614438565b6136569190615ce1565b6000826001600160a01b0316846001600160a01b03161115614cfe579192915b6136566001600160801b038316614d158686615da5565b6001600160a01b0316600160601b614438565b6000826001600160a01b0316846001600160a01b03161115614d48579192915b6000614d6b856001600160a01b0316856001600160a01b0316600160601b614438565b9050613243614d8d8483614d7f8989615da5565b6001600160a01b0316614438565b614f46565b6000826001600160a01b0316846001600160a01b03161115614db2579192915b613656614d8d83600160601b614d7f8888615da5565b600054610100900460ff1680614de1575060005460ff16155b614dfd5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff161580156142e6576000805461ffff191661010117905580156142f8576000805461ff001916905550565b600054610100900460ff1680614e4b575060005460ff16155b614e675760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015614e89576000805461ffff19166101011790555b8251614e9c9060369060208601906150c2565b508151614eb09060379060208501906150c2565b5080156130da576000805461ff0019169055505050565b600054610100900460ff1680614ee0575060005460ff16155b614efc5760405162461bcd60e51b815260040161083290615aad565b600054610100900460ff16158015614f1e576000805461ffff19166101011790555b600160655580156142f8576000805461ff001916905550565b60606136568484600085614f61565b806001600160801b0381168114614f5c57600080fd5b919050565b606082471015614fc25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610832565b843b6150105760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610832565b600080866001600160a01b0316858760405161502c91906158d3565b60006040518083038185875af1925050503d8060008114615069576040519150601f19603f3d011682016040523d82523d6000602084013e61506e565b606091505b509150915061507e828286615089565b979650505050505050565b60608315615098575081610855565b8251156150a85782518084602001fd5b8160405162461bcd60e51b81526004016108329190615a02565b8280546150ce90615e08565b90600052602060002090601f0160209004810192826150f05760008555615136565b82601f1061510957805160ff1916838001178555615136565b82800160010185558215615136579182015b8281111561513657825182559160200191906001019061511b565b506136c39291505b808211156136c3576000815560010161513e565b600082601f830112615162578081fd5b8151602061517761517283615c38565b615c08565b80838252828201915082860187848660051b8901011115615196578586fd5b855b858110156151bd5781516151ab81615eef565b84529284019290840190600101615198565b5090979650505050505050565b60008083601f8401126151db578182fd5b5081356001600160401b038111156151f1578182fd5b60208301915083602082850101111561520957600080fd5b9250929050565b8051600681900b8114614f5c57600080fd5b600082601f830112615232578081fd5b81356001600160401b0381111561524b5761524b615ed9565b61525e601f8201601f1916602001615c08565b818152846020838601011115615272578283fd5b816020850160208301379081016020019190915292915050565b80516001600160801b0381168114614f5c57600080fd5b6000602082840312156152b4578081fd5b813561085581615eef565b6000602082840312156152d0578081fd5b815161085581615eef565b600080604083850312156152ed578081fd5b82356152f881615eef565b9150602083013561530881615eef565b809150509250929050565b600080600060608486031215615327578081fd5b833561533281615eef565b9250602084013561534281615eef565b929592945050506040919091013590565b60008060408385031215615365578182fd5b823561537081615eef565b946020939093013593505050565b60008060408385031215615390578182fd5b82516001600160401b03808211156153a6578384fd5b818501915085601f8301126153b9578384fd5b815160206153c961517283615c38565b8083825282820191508286018a848660051b89010111156153e8578889fd5b8896505b84871015615411576153fd81615210565b8352600196909601959183019183016153ec565b509188015191965090935050508082111561542a578283fd5b5061543785828601615152565b9150509250929050565b600060208284031215615452578081fd5b815161085581615f04565b600080600080600060a08688031215615474578283fd5b853561547f81615f12565b9450602086013561548f81615f12565b9350604086013561549f81615eef565b92506060860135915060808601356154b681615f04565b809150509295509295909350565b600080604083850312156154d6578182fd5b505080516020909101519092909150565b600080600080606085870312156154fc578182fd5b843593506020850135925060408501356001600160401b0381111561551f578283fd5b61552b878288016151ca565b95989497509550505050565b600080600080600080600060e0888a031215615551578485fd5b87356001600160401b0380821115615567578687fd5b6155738b838c01615222565b985060208a0135915080821115615588578687fd5b506155958a828b01615222565b96505060408801356155a681615eef565b945060608801356155b681615f21565b935060808801356155c681615f12565b925060a08801356155d681615f12565b915060c08801356155e681615eef565b8091505092959891949750929550565b600080600080600080600080610100898b031215615612578182fd5b61561b8961528c565b9750602089015180600f0b8114615630578283fd5b60408a015160608b01519198509650945061564d60808a01615210565b935060a089015161565d81615eef565b60c08a015190935061566e81615f31565b60e08a015190925061567f81615f04565b809150509295985092959890939650565b600080604083850312156156a2578182fd5b6156ab8361528c565b91506156b96020840161528c565b90509250929050565b600080600080600060a086880312156156d9578283fd5b6156e28661528c565b945060208601519350604086015192506156fe6060870161528c565b915061570c6080870161528c565b90509295509295909350565b600060208284031215615729578081fd5b813561085581615f21565b600080600080600080600060e0888a03121561574e578081fd5b875161575981615eef565b602089015190975061576a81615f12565b604089015190965061577b81615f21565b606089015190955061578c81615f21565b608089015190945061579d81615f21565b60a089015190935060ff811681146157b3578182fd5b60c08901519092506155e681615f04565b600080600080600060a086880312156157db578283fd5b85356157e681615eef565b94506020860135935060408601356157fd81615f04565b92506060860135915060808601356154b681615eef565b600080600080600060a0868803121561582b578283fd5b853561583681615f21565b9450602086013561584681615f21565b9350604086013561585681615f21565b9250606086013561586681615f31565b915060808601356154b681615eef565b600060208284031215615887578081fd5b5051919050565b600080604083850312156158a0578182fd5b82359150602083013561530881615eef565b600080604083850312156158c4578182fd5b50508035926020909101359150565b600082516158e5818460208701615ddc565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03949094168452600292830b6020850152910b60408301526001600160801b0316606082015260a06080820181905260009082015260c00190565b6001600160a01b039590951685526020850193909352604084019190915260608301526001600160801b0316608082015260a00190565b6020808252825182820181905260009190848201906040850190845b818110156159ba57835163ffffffff1683529284019291840191600101615998565b50909695505050505050565b60029190910b815260200190565b600294850b81529290930b60208301526001600160801b039081166040830152909116606082015260800190565b6020815260008251806020840152615a21816040850160208701615ddc565b601f01601f19169190910160400192915050565b60208082526017908201527647656c61746f666965643a204f6e6c792067656c61746f60481b604082015260600190565b6020808252600490820152636d42505360e01b604082015260600190565b6020808252600f908201526e31b0b6363130b1b59031b0b63632b960891b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b602080825260089082015267686967682066656560c01b604082015260600190565b6020808252600d908201526c6869676820736c69707061676560981b604082015260600190565b60208082526003908201526242505360e81b604082015260600190565b60208082526022908201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206d616e616760408201526132b960f11b606082015260800190565b60208082526006908201526506d696e7420360d41b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b918252602082015260400190565b604051601f8201601f191681016001600160401b0381118282101715615c3057615c30615ed9565b604052919050565b60006001600160401b03821115615c5157615c51615ed9565b5060051b60200190565b600061ffff808316818516808303821115615c7857615c78615ead565b01949350505050565b60006001600160a01b03828116848216808303821115615c7857615c78615ead565b60008219821115615cb657615cb6615ead565b500190565b60006001600160a01b0383811680615cd557615cd5615ec3565b92169190910492915050565b600082615cf057615cf0615ec3565b500490565b60006001600160a01b0382811684821681151582840482111615615d1b57615d1b615ead565b02949350505050565b6000816000190483118215151615615d3e57615d3e615ead565b500290565b60008083128015600160ff1b850184121615615d6157615d61615ead565b6001600160ff1b0384018313811615615d7c57615d7c615ead565b50500390565b600061ffff83811690831681811015615d9d57615d9d615ead565b039392505050565b60006001600160a01b0383811690831681811015615d9d57615d9d615ead565b600082821015615dd757615dd7615ead565b500390565b60005b83811015615df7578181015183820152602001615ddf565b83811115610e875750506000910152565b600181811c90821680615e1c57607f821691505b60208210811415615e3d57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415615e5757615e57615ead565b5060010190565b600082615e6d57615e6d615ec3565b500690565b60008160020b627fffff19811415615e8c57615e8c615ead565b9003919050565b6000600160ff1b821415615ea957615ea9615ead565b0390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146142f857600080fd5b80151581146142f857600080fd5b8060020b81146142f857600080fd5b61ffff811681146142f857600080fd5b63ffffffff811681146142f857600080fdfec749f9ae947d4734cf1569606a8a347391ae94a063478aa853aeff48ac5f99e88be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efc28ad1de9c0c32e5394ba60323e44d8d9536312236a47231772e448a3e49de42a26469706673582212200d68bbc56177fb98dc03b8435a294744f29eb4d74dbc9371fa03141fd2efac7464736f6c63430008040033

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

00000000000000000000000001051113d81d7d6da508462f2ad6d7fd96cf42ef

-----Decoded View---------------
Arg [0] : _gelato (address): 0x01051113D81D7d6DA508462F2ad6d7fD96cF42Ef

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000001051113d81d7d6da508462f2ad6d7fd96cf42ef


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.