Sonic Blaze Testnet

Contract

0xC2d1a940A4173eba099022b727fC7cf438a81C7b

Overview

S Balance

Sonic Blaze LogoSonic Blaze LogoSonic Blaze Logo0 S

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
53282802024-12-19 12:34:0031 mins ago1734611640
0xC2d1a940...438a81C7b
0 S
53282802024-12-19 12:34:0031 mins ago1734611640
0xC2d1a940...438a81C7b
0 S
53282802024-12-19 12:34:0031 mins ago1734611640
0xC2d1a940...438a81C7b
0 S
53282802024-12-19 12:34:0031 mins ago1734611640
0xC2d1a940...438a81C7b
0 S
53282802024-12-19 12:34:0031 mins ago1734611640
0xC2d1a940...438a81C7b
0 S
53282802024-12-19 12:34:0031 mins ago1734611640
0xC2d1a940...438a81C7b
0 S
53282802024-12-19 12:34:0031 mins ago1734611640
0xC2d1a940...438a81C7b
0 S
53282802024-12-19 12:34:0031 mins ago1734611640
0xC2d1a940...438a81C7b
0 S
53223762024-12-19 12:03:011 hr ago1734609781
0xC2d1a940...438a81C7b
0 S
53223762024-12-19 12:03:011 hr ago1734609781
0xC2d1a940...438a81C7b
0 S
53223762024-12-19 12:03:011 hr ago1734609781
0xC2d1a940...438a81C7b
0 S
53223762024-12-19 12:03:011 hr ago1734609781
0xC2d1a940...438a81C7b
0 S
53223762024-12-19 12:03:011 hr ago1734609781
0xC2d1a940...438a81C7b
0 S
53223762024-12-19 12:03:011 hr ago1734609781
0xC2d1a940...438a81C7b
0 S
53223762024-12-19 12:03:011 hr ago1734609781
0xC2d1a940...438a81C7b
0 S
53223762024-12-19 12:03:011 hr ago1734609781
0xC2d1a940...438a81C7b
0 S
53169332024-12-19 11:33:011 hr ago1734607981
0xC2d1a940...438a81C7b
0 S
53169332024-12-19 11:33:011 hr ago1734607981
0xC2d1a940...438a81C7b
0 S
53169332024-12-19 11:33:011 hr ago1734607981
0xC2d1a940...438a81C7b
0 S
53169332024-12-19 11:33:011 hr ago1734607981
0xC2d1a940...438a81C7b
0 S
53169332024-12-19 11:33:011 hr ago1734607981
0xC2d1a940...438a81C7b
0 S
53169332024-12-19 11:33:011 hr ago1734607981
0xC2d1a940...438a81C7b
0 S
53169332024-12-19 11:33:011 hr ago1734607981
0xC2d1a940...438a81C7b
0 S
53169332024-12-19 11:33:011 hr ago1734607981
0xC2d1a940...438a81C7b
0 S
53120102024-12-19 11:03:002 hrs ago1734606180
0xC2d1a940...438a81C7b
0 S
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PairFactoryUpgradeable

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 13 : PairFactoryUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

import '../interfaces/IPairFactory.sol';
import '../Pair.sol';

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

contract PairFactoryUpgradeable is IPairFactory, OwnableUpgradeable {

    bool public isPaused;

    uint256 public stableFee;
    uint256 public volatileFee;
    uint256 public stakingNFTFee;
    uint256 public MAX_TREASURY_FEE;
    uint256 public constant MAX_FEE = 300; // 3%

    address public feeManager;
    address public pendingFeeManager;
    address public dibs;                // treasury fee handler
    address public stakingFeeHandler;   // staking fee handler

    mapping(address => mapping(address => mapping(bool => address))) public getPair;
    address[] public allPairs;
    mapping(address => bool) public isPair; // simplified check if its a pair, given that `stable` flag might not be available in peripherals

    address internal _temp0;
    address internal _temp1;
    bool internal _temp;

    event PairCreated(address indexed token0, address indexed token1, bool stable, address pair, uint);

    modifier onlyManager() {
        require(msg.sender == feeManager);
        _;
    }

    constructor() {}
    function initialize() initializer  public {
        __Ownable_init();
        isPaused = false;
        feeManager = msg.sender;
        stableFee = 1; // 0.01%
        volatileFee = 18; // 0.18%
        stakingNFTFee = 2000; // 20% of stable/volatileFee
        MAX_TREASURY_FEE = 400; // 4%
    }


    function allPairsLength() external view returns (uint) {
        return allPairs.length;
    }

    function pairs() external view returns(address[] memory ){
        return allPairs;
    }

    function setPause(bool _state) external {
        require(msg.sender == owner());
        isPaused = _state;
    }

    function setFeeManager(address _feeManager) external onlyManager{
        pendingFeeManager = _feeManager;
    }

    function acceptFeeManager() external {
        require(msg.sender == pendingFeeManager);
        feeManager = pendingFeeManager;
    }


    function setStakingFees(uint256 _newFee) external onlyManager {
        require(_newFee <= 3000);
        stakingNFTFee = _newFee;
    }

    function setStakingFeeAddress(address _feehandler) external onlyManager {
        require(_feehandler != address(0));
        stakingFeeHandler = _feehandler;
    }

    function setDibs(address _dibs) external onlyManager {
        require(_dibs != address(0));
        dibs = _dibs;
    }

    function setTreasuryFee(uint256 _tresFee) external onlyManager {
        MAX_TREASURY_FEE = _tresFee;
    }


    function setFee(bool _stable, uint256 _fee) external onlyManager {
        require(_fee <= MAX_FEE, 'fee');
        require(_fee != 0);
        if (_stable) {
            stableFee = _fee;
        } else {
            volatileFee = _fee;
        }
    }

    function getFee(bool _stable) public view returns(uint256) {
        return _stable ? stableFee : volatileFee;
    }

    function pairCodeHash() external pure returns (bytes32) {
        return keccak256(type(Pair).creationCode);
    }

    function getInitializable() external view returns (address, address, bool) {
        return (_temp0, _temp1, _temp);
    }

    function createPair(address tokenA, address tokenB, bool stable) external returns (address pair) {
        require(tokenA != tokenB, 'IA'); // Pair: IDENTICAL_ADDRESSES
        (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
        require(token0 != address(0), 'ZA'); // Pair: ZERO_ADDRESS
        require(getPair[token0][token1][stable] == address(0), 'PE'); // Pair: PAIR_EXISTS - single check is sufficient
        bytes32 salt = keccak256(abi.encodePacked(token0, token1, stable)); // notice salt includes stable as well, 3 parameters
        (_temp0, _temp1, _temp) = (token0, token1, stable);
        pair = address(new Pair{salt:salt}());
        getPair[token0][token1][stable] = pair;
        getPair[token1][token0][stable] = pair; // populate mapping in the reverse direction
        allPairs.push(pair);
        isPair[pair] = true;
        emit PairCreated(token0, token1, stable, pair, allPairs.length);
    }
}

File 2 of 13 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 3 of 13 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @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 proxied contracts do not make use of 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.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * 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.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

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

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Internal function that returns the initialized version. Returns `_initialized`
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Internal function that returns the initialized version. Returns `_initializing`
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 4 of 13 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 5 of 13 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

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 onlyInitializing {
    }

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 6 of 13 : IDibs.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;


interface IDibs {
    function reward(address user,bytes32 parentCode,
                    uint256 totalFees,uint256 totalVolume,
                    address token) external returns(uint256 referralFee);

    function findTotalRewardFor(address _user, uint _totalFees) external view returns(uint256 _referralFeeAmount);
}

File 7 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

interface IERC20 {
    function totalSupply() external view returns (uint256);
    function transfer(address recipient, uint amount) external returns (bool);
    function decimals() external view returns (uint8);
    function symbol() external view returns (string memory);
    function balanceOf(address) external view returns (uint);
    function transferFrom(address sender, address recipient, uint amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint);
    function approve(address spender, uint value) external returns (bool);

    event Transfer(address indexed from, address indexed to, uint value);
    event Approval(address indexed owner, address indexed spender, uint value);
}

File 8 of 13 : IPair.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

interface IPair {
    function metadata() external view returns (uint dec0, uint dec1, uint r0, uint r1, bool st, address t0, address t1);
    function claimFees() external returns (uint, uint);
    function tokens() external view returns (address, address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function transferFrom(address src, address dst, uint amount) external returns (bool);
    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function burn(address to) external returns (uint amount0, uint amount1);
    function mint(address to) external returns (uint liquidity);
    function getReserves() external view returns (uint _reserve0, uint _reserve1, uint _blockTimestampLast);
    function getAmountOut(uint, address) external view returns (uint);

    function name() external view returns(string memory);
    function symbol() external view returns(string memory);
    function totalSupply() external view returns (uint);
    function decimals() external view returns (uint8);

    function claimable0(address _user) external view returns (uint);
    function claimable1(address _user) external view returns (uint);

    function isStable() external view returns(bool);


}

File 9 of 13 : IPairCallee.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

interface IPairCallee {
    function hook(address sender, uint amount0, uint amount1, bytes calldata data) external;
}

File 10 of 13 : IPairFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

interface IPairFactory {
    function allPairsLength() external view returns (uint);
    function isPair(address pair) external view returns (bool);
    function allPairs(uint index) external view returns (address);
    function stakingFeeHandler() external view returns (address);
    function dibs() external view returns (address);
    function MAX_TREASURY_FEE() external view returns (uint256);
    function stakingNFTFee() external view returns (uint256);
    function isPaused() external view returns (bool);
    function pairCodeHash() external pure returns (bytes32);
    function getPair(address tokenA, address token, bool stable) external view returns (address);
    function createPair(address tokenA, address tokenB, bool stable) external returns (address pair);
    function getInitializable() external view returns (address, address, bool);
    function getFee(bool _stable) external view returns(uint256);
}

File 11 of 13 : Math.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

library Math {
    function max(uint a, uint b) internal pure returns (uint) {
        return a >= b ? a : b;
    }
    function min(uint a, uint b) internal pure returns (uint) {
        return a < b ? a : b;
    }
    function sqrt(uint y) internal pure returns (uint z) {
        if (y > 3) {
            z = y;
            uint x = y / 2 + 1;
            while (x < z) {
                z = x;
                x = (y / x + x) / 2;
            }
        } else if (y != 0) {
            z = 1;
        }
    }
    function cbrt(uint256 n) internal pure returns (uint256) { unchecked {
        uint256 x = 0;
        for (uint256 y = 1 << 255; y > 0; y >>= 3) {
            x <<= 1;
            uint256 z = 3 * x * (x + 1) + 1;
            if (n / y >= z) {
                n -= y * z;
                x += 1;
            }
        }
        return x;
    }}
}

File 12 of 13 : Pair.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

import "./libraries/Math.sol";
import "./interfaces/IERC20.sol";
import "./interfaces/IPair.sol";
import "./interfaces/IDibs.sol";
import "./interfaces/IPairCallee.sol";
import "./interfaces/IPairFactory.sol";
import "./PairFees.sol";

// The base pair of pools, either stable or volatile
contract Pair is IPair {
    string public name;
    string public symbol;
    uint8 public constant decimals = 18;

    // Used to denote stable or volatile pair, not immutable since construction happens in the initialize method for CREATE2 deterministic addresses
    bool public immutable stable;

    uint public totalSupply = 0;

    mapping(address => mapping(address => uint)) public allowance;
    mapping(address => uint) public balanceOf;

    bytes32 internal DOMAIN_SEPARATOR;
    // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
    bytes32 internal constant PERMIT_TYPEHASH =
        0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
    mapping(address => uint) public nonces;

    uint internal constant MINIMUM_LIQUIDITY = 10 ** 3;

    address public immutable token0;
    address public immutable token1;
    address public immutable fees;
    address immutable factory;

    // Structure to capture time period obervations every 30 minutes, used for local oracles
    struct Observation {
        uint timestamp;
        uint reserve0Cumulative;
        uint reserve1Cumulative;
    }

    // Capture oracle reading every 30 minutes
    uint constant periodSize = 1800;

    Observation[] public observations;

    uint internal immutable decimals0;
    uint internal immutable decimals1;

    uint public reserve0;
    uint public reserve1;
    uint public blockTimestampLast;

    uint public reserve0CumulativeLast;
    uint public reserve1CumulativeLast;

    // index0 and index1 are used to accumulate fees, this is split out from normal trades to keep the swap "clean"
    // this further allows LP holders to easily claim fees for tokens they have/staked
    uint public index0 = 0;
    uint public index1 = 0;

    // position assigned to each LP to track their current index0 & index1 vs the global position
    mapping(address => uint) public supplyIndex0;
    mapping(address => uint) public supplyIndex1;

    // tracks the amount of unclaimed, but claimable tokens off of fees for token0 and token1
    mapping(address => uint) public claimable0;
    mapping(address => uint) public claimable1;

    event Fees(address indexed sender, uint amount0, uint amount1);
    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(
        address indexed sender,
        uint amount0,
        uint amount1,
        address indexed to
    );
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint reserve0, uint reserve1);
    event Claim(
        address indexed sender,
        address indexed recipient,
        uint amount0,
        uint amount1
    );

    event Transfer(address indexed from, address indexed to, uint amount);
    event Approval(address indexed owner, address indexed spender, uint amount);

    constructor() {
        factory = msg.sender;
        (address _token0, address _token1, bool _stable) = IPairFactory(
            msg.sender
        ).getInitializable();
        (token0, token1, stable) = (_token0, _token1, _stable);
        fees = address(new PairFees(_token0, _token1));
        if (_stable) {
            name = string(
                abi.encodePacked(
                    "StableV1 AMM - ",
                    IERC20(_token0).symbol(),
                    "/",
                    IERC20(_token1).symbol()
                )
            );
            symbol = string(
                abi.encodePacked(
                    "sAMM-",
                    IERC20(_token0).symbol(),
                    "/",
                    IERC20(_token1).symbol()
                )
            );
        } else {
            name = string(
                abi.encodePacked(
                    "VolatileV1 AMM - ",
                    IERC20(_token0).symbol(),
                    "/",
                    IERC20(_token1).symbol()
                )
            );
            symbol = string(
                abi.encodePacked(
                    "vAMM-",
                    IERC20(_token0).symbol(),
                    "/",
                    IERC20(_token1).symbol()
                )
            );
        }

        decimals0 = 10 ** IERC20(_token0).decimals();
        decimals1 = 10 ** IERC20(_token1).decimals();

        observations.push(Observation(block.timestamp, 0, 0));
    }

    // simple re-entrancy check
    uint internal _unlocked = 1;
    modifier lock() {
        require(_unlocked == 1);
        _unlocked = 2;
        _;
        _unlocked = 1;
    }

    function observationLength() external view returns (uint) {
        return observations.length;
    }

    function lastObservation() public view returns (Observation memory) {
        return observations[observations.length - 1];
    }

    function metadata()
        external
        view
        returns (
            uint dec0,
            uint dec1,
            uint r0,
            uint r1,
            bool st,
            address t0,
            address t1
        )
    {
        return (
            decimals0,
            decimals1,
            reserve0,
            reserve1,
            stable,
            token0,
            token1
        );
    }

    function tokens() external view returns (address, address) {
        return (token0, token1);
    }

    function isStable() external view returns (bool) {
        return stable;
    }

    // claim accumulated but unclaimed fees (viewable via claimable0 and claimable1)
    function claimFees() external returns (uint claimed0, uint claimed1) {
        _updateFor(msg.sender);

        claimed0 = claimable0[msg.sender];
        claimed1 = claimable1[msg.sender];

        if (claimed0 > 0 || claimed1 > 0) {
            claimable0[msg.sender] = 0;
            claimable1[msg.sender] = 0;

            PairFees(fees).claimFeesFor(msg.sender, claimed0, claimed1);

            emit Claim(msg.sender, msg.sender, claimed0, claimed1);
        }
    }

    function claimStakingFees() external {
        address _feehandler = IPairFactory(factory).stakingFeeHandler();
        PairFees(fees).withdrawStakingFees(_feehandler);
    }

    // Accrue fees on token0
    function _update0(uint amount) internal {
        // get referral fee
        address _dibs = IPairFactory(factory).dibs();
        uint256 _maxRef = IPairFactory(factory).MAX_TREASURY_FEE();
        uint256 _referralFee = (amount * _maxRef) / 10000;
        _safeTransfer(token0, _dibs, _referralFee); // transfer the fees out to PairFees
        // amount -= _referralFee;

        // get lp and staking fee
        uint256 _stakingNftFee = (amount *
            IPairFactory(factory).stakingNFTFee()) / 10000;
        PairFees(fees).processStakingFees(_stakingNftFee, true);
        _safeTransfer(token0, fees, amount - _referralFee); // transfer the fees out to PairFees

        // remove staking fees from lpfees
        amount -= (_stakingNftFee + _referralFee);
        uint256 _ratio = (amount * 1e18) / totalSupply; // 1e18 adjustment is removed during claim
        if (_ratio > 0) {
            index0 += _ratio;
        }
        emit Fees(msg.sender, amount + _stakingNftFee + _referralFee, 0);
    }

    // Accrue fees on token1
    function _update1(uint amount) internal {
        // get referral fee
        address _dibs = IPairFactory(factory).dibs();
        uint256 _maxRef = IPairFactory(factory).MAX_TREASURY_FEE();
        uint256 _referralFee = (amount * _maxRef) / 10000;
        _safeTransfer(token1, _dibs, _referralFee); // transfer the fees out to PairFees
        // amount -= _referralFee;

        // get lp and staking fee
        uint256 _stakingNftFee = (amount *
            IPairFactory(factory).stakingNFTFee()) / 10000;
        PairFees(fees).processStakingFees(_stakingNftFee, false);
        _safeTransfer(token1, fees, amount - _referralFee); // transfer the fees out to PairFees

        // remove staking fees from lpfees
        amount -= (_stakingNftFee + _referralFee);

        uint256 _ratio = (amount * 1e18) / totalSupply;

        if (_ratio > 0) {
            index1 += _ratio;
        }

        emit Fees(msg.sender, 0, amount + _stakingNftFee + _referralFee);
    }

    // this function MUST be called on any balance changes, otherwise can be used to infinitely claim fees
    // Fees are segregated from core funds, so fees can never put liquidity at risk
    function _updateFor(address recipient) internal {
        uint _supplied = balanceOf[recipient]; // get LP balance of `recipient`
        if (_supplied > 0) {
            uint _supplyIndex0 = supplyIndex0[recipient]; // get last adjusted index0 for recipient
            uint _supplyIndex1 = supplyIndex1[recipient];
            uint _index0 = index0; // get global index0 for accumulated fees
            uint _index1 = index1;
            supplyIndex0[recipient] = _index0; // update user current position to global position
            supplyIndex1[recipient] = _index1;
            uint _delta0 = _index0 - _supplyIndex0; // see if there is any difference that need to be accrued
            uint _delta1 = _index1 - _supplyIndex1;
            if (_delta0 > 0) {
                uint _share = (_supplied * _delta0) / 1e18; // add accrued difference for each supplied token
                claimable0[recipient] += _share;
            }
            if (_delta1 > 0) {
                uint _share = (_supplied * _delta1) / 1e18;
                claimable1[recipient] += _share;
            }
        } else {
            supplyIndex0[recipient] = index0; // new users are set to the default global state
            supplyIndex1[recipient] = index1;
        }
    }

    function getReserves()
        public
        view
        returns (uint _reserve0, uint _reserve1, uint _blockTimestampLast)
    {
        _reserve0 = reserve0;
        _reserve1 = reserve1;
        _blockTimestampLast = blockTimestampLast;
    }

    // update reserves and, on the first call per block, price accumulators
    function _update(
        uint balance0,
        uint balance1,
        uint _reserve0,
        uint _reserve1
    ) internal {
        uint blockTimestamp = block.timestamp;
        uint timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired
        if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) {
            reserve0CumulativeLast += _reserve0 * timeElapsed;
            reserve1CumulativeLast += _reserve1 * timeElapsed;
        }

        Observation memory _point = lastObservation();
        timeElapsed = blockTimestamp - _point.timestamp; // compare the last observation with current timestamp, if greater than 30 minutes, record a new event
        if (timeElapsed > periodSize) {
            observations.push(
                Observation(
                    blockTimestamp,
                    reserve0CumulativeLast,
                    reserve1CumulativeLast
                )
            );
        }
        reserve0 = balance0;
        reserve1 = balance1;
        blockTimestampLast = blockTimestamp;
        emit Sync(reserve0, reserve1);
    }

    // produces the cumulative price using counterfactuals to save gas and avoid a call to sync.
    function currentCumulativePrices()
        public
        view
        returns (
            uint reserve0Cumulative,
            uint reserve1Cumulative,
            uint blockTimestamp
        )
    {
        blockTimestamp = block.timestamp;
        reserve0Cumulative = reserve0CumulativeLast;
        reserve1Cumulative = reserve1CumulativeLast;

        // if time has elapsed since the last update on the pair, mock the accumulated price values
        (
            uint _reserve0,
            uint _reserve1,
            uint _blockTimestampLast
        ) = getReserves();
        if (_blockTimestampLast != blockTimestamp) {
            // subtraction overflow is desired
            uint timeElapsed = blockTimestamp - _blockTimestampLast;
            reserve0Cumulative += _reserve0 * timeElapsed;
            reserve1Cumulative += _reserve1 * timeElapsed;
        }
    }

    // gives the current twap price measured from amountIn * tokenIn gives amountOut
    function current(
        address tokenIn,
        uint amountIn
    ) external view returns (uint amountOut) {
        Observation memory _observation = lastObservation();
        (
            uint reserve0Cumulative,
            uint reserve1Cumulative,

        ) = currentCumulativePrices();
        if (block.timestamp == _observation.timestamp) {
            _observation = observations[observations.length - 2];
        }

        uint timeElapsed = block.timestamp - _observation.timestamp;
        uint _reserve0 = (reserve0Cumulative -
            _observation.reserve0Cumulative) / timeElapsed;
        uint _reserve1 = (reserve1Cumulative -
            _observation.reserve1Cumulative) / timeElapsed;
        amountOut = _getAmountOut(amountIn, tokenIn, _reserve0, _reserve1);
    }

    // as per `current`, however allows user configured granularity, up to the full window size
    function quote(
        address tokenIn,
        uint amountIn,
        uint granularity
    ) external view returns (uint amountOut) {
        uint[] memory _prices = sample(tokenIn, amountIn, granularity, 1);
        uint priceAverageCumulative;
        for (uint i = 0; i < _prices.length; i++) {
            priceAverageCumulative += _prices[i];
        }
        return priceAverageCumulative / granularity;
    }

    // returns a memory set of twap prices
    function prices(
        address tokenIn,
        uint amountIn,
        uint points
    ) external view returns (uint[] memory) {
        return sample(tokenIn, amountIn, points, 1);
    }

    function sample(
        address tokenIn,
        uint amountIn,
        uint points,
        uint window
    ) public view returns (uint[] memory) {
        uint[] memory _prices = new uint[](points);

        uint length = observations.length - 1;
        uint i = length - (points * window);
        uint nextIndex = 0;
        uint index = 0;

        for (; i < length; i += window) {
            nextIndex = i + window;
            uint timeElapsed = observations[nextIndex].timestamp -
                observations[i].timestamp;
            uint _reserve0 = (observations[nextIndex].reserve0Cumulative -
                observations[i].reserve0Cumulative) / timeElapsed;
            uint _reserve1 = (observations[nextIndex].reserve1Cumulative -
                observations[i].reserve1Cumulative) / timeElapsed;
            _prices[index] = _getAmountOut(
                amountIn,
                tokenIn,
                _reserve0,
                _reserve1
            );
            // index < length; length cannot overflow
            unchecked {
                index = index + 1;
            }
        }
        return _prices;
    }

    // this low-level function should be called by addLiquidity functions in Router.sol, which performs important safety checks
    // standard uniswap v2 implementation
    function mint(address to) external lock returns (uint liquidity) {
        (uint _reserve0, uint _reserve1) = (reserve0, reserve1);
        uint _balance0 = IERC20(token0).balanceOf(address(this));
        uint _balance1 = IERC20(token1).balanceOf(address(this));
        uint _amount0 = _balance0 - _reserve0;
        uint _amount1 = _balance1 - _reserve1;

        uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
        if (_totalSupply == 0) {
            liquidity = Math.sqrt(_amount0 * _amount1) - MINIMUM_LIQUIDITY;
            _mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
        } else {
            liquidity = Math.min(
                (_amount0 * _totalSupply) / _reserve0,
                (_amount1 * _totalSupply) / _reserve1
            );
        }
        require(liquidity > 0, "ILM"); // Pair: INSUFFICIENT_LIQUIDITY_MINTED
        _mint(to, liquidity);

        _update(_balance0, _balance1, _reserve0, _reserve1);
        emit Mint(msg.sender, _amount0, _amount1);
    }

    // this low-level function should be called from a contract which performs important safety checks
    // standard uniswap v2 implementation
    function burn(
        address to
    ) external lock returns (uint amount0, uint amount1) {
        (uint _reserve0, uint _reserve1) = (reserve0, reserve1);
        (address _token0, address _token1) = (token0, token1);
        uint _balance0 = IERC20(_token0).balanceOf(address(this));
        uint _balance1 = IERC20(_token1).balanceOf(address(this));
        uint _liquidity = balanceOf[address(this)];

        uint _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee
        amount0 = (_liquidity * _balance0) / _totalSupply; // using balances ensures pro-rata distribution
        amount1 = (_liquidity * _balance1) / _totalSupply; // using balances ensures pro-rata distribution
        require(amount0 > 0 && amount1 > 0, "ILB"); // Pair: INSUFFICIENT_LIQUIDITY_BURNED
        _burn(address(this), _liquidity);
        _safeTransfer(_token0, to, amount0);
        _safeTransfer(_token1, to, amount1);
        _balance0 = IERC20(_token0).balanceOf(address(this));
        _balance1 = IERC20(_token1).balanceOf(address(this));

        _update(_balance0, _balance1, _reserve0, _reserve1);
        emit Burn(msg.sender, amount0, amount1, to);
    }

    // this low-level function should be called from a contract which performs important safety checks
    function swap(
        uint amount0Out,
        uint amount1Out,
        address to,
        bytes calldata data
    ) external lock {
        require(!IPairFactory(factory).isPaused());
        require(amount0Out > 0 || amount1Out > 0, "IOA"); // Pair: INSUFFICIENT_OUTPUT_AMOUNT
        (uint _reserve0, uint _reserve1) = (reserve0, reserve1);
        require(amount0Out < _reserve0 && amount1Out < _reserve1, "IL"); // Pair: INSUFFICIENT_LIQUIDITY

        uint _balance0;
        uint _balance1;
        {
            // scope for _token{0,1}, avoids stack too deep errors
            (address _token0, address _token1) = (token0, token1);
            require(to != _token0 && to != _token1, "IT"); // Pair: INVALID_TO
            if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); // optimistically transfer tokens
            if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); // optimistically transfer tokens
            if (data.length > 0)
                IPairCallee(to).hook(msg.sender, amount0Out, amount1Out, data); // callback, used for flash loans
            _balance0 = IERC20(_token0).balanceOf(address(this));
            _balance1 = IERC20(_token1).balanceOf(address(this));
        }

        uint amount0In = _balance0 > _reserve0 - amount0Out
            ? _balance0 - (_reserve0 - amount0Out)
            : 0;
        uint amount1In = _balance1 > _reserve1 - amount1Out
            ? _balance1 - (_reserve1 - amount1Out)
            : 0;
        require(amount0In > 0 || amount1In > 0, "IIA"); // Pair: INSUFFICIENT_INPUT_AMOUNT

        {
            // scope for reserve{0,1}Adjusted, avoids stack too deep errors
            (address _token0, address _token1) = (token0, token1);
            if (amount0In > 0)
                _update0(
                    (amount0In * IPairFactory(factory).getFee(stable)) / 10000
                ); // accrue fees for token0 and move them out of pool
            if (amount1In > 0)
                _update1(
                    (amount1In * IPairFactory(factory).getFee(stable)) / 10000
                ); // accrue fees for token1 and move them out of pool
            _balance0 = IERC20(_token0).balanceOf(address(this)); // since we removed tokens, we need to reconfirm balances, can also simply use previous balance - amountIn/ 10000, but doing balanceOf again as safety check
            _balance1 = IERC20(_token1).balanceOf(address(this));
            // The curve, either x3y+y3x for stable pools, or x*y for volatile pools
            require(_k(_balance0, _balance1) >= _k(_reserve0, _reserve1), "K"); // Pair: K
        }

        _update(_balance0, _balance1, _reserve0, _reserve1);
        emit Swap(msg.sender, amount0In, amount1In, amount0Out, amount1Out, to);
    }

    // force balances to match reserves
    function skim(address to) external lock {
        (address _token0, address _token1) = (token0, token1);
        _safeTransfer(
            _token0,
            to,
            IERC20(_token0).balanceOf(address(this)) - (reserve0)
        );
        _safeTransfer(
            _token1,
            to,
            IERC20(_token1).balanceOf(address(this)) - (reserve1)
        );
    }

    // force reserves to match balances
    function sync() external lock {
        _update(
            IERC20(token0).balanceOf(address(this)),
            IERC20(token1).balanceOf(address(this)),
            reserve0,
            reserve1
        );
    }

    function _f(uint x0, uint y) internal pure returns (uint) {
        return
            (x0 * ((((y * y) / 1e18) * y) / 1e18)) /
            1e18 +
            (((((x0 * x0) / 1e18) * x0) / 1e18) * y) /
            1e18;
    }

    function _d(uint x0, uint y) internal pure returns (uint) {
        return
            (3 * x0 * ((y * y) / 1e18)) /
            1e18 +
            ((((x0 * x0) / 1e18) * x0) / 1e18);
    }

    function _get_y(uint x0, uint xy, uint y) internal pure returns (uint) {
        for (uint i = 0; i < 255; i++) {
            uint y_prev = y;
            uint k = _f(x0, y);
            if (k < xy) {
                uint dy = ((xy - k) * 1e18) / _d(x0, y);
                y = y + dy;
            } else {
                uint dy = ((k - xy) * 1e18) / _d(x0, y);
                y = y - dy;
            }
            if (y > y_prev) {
                if (y - y_prev <= 1) {
                    return y;
                }
            } else {
                if (y_prev - y <= 1) {
                    return y;
                }
            }
        }
        return y;
    }

    function getAmountOut(
        uint amountIn,
        address tokenIn
    ) external view returns (uint) {
        (uint _reserve0, uint _reserve1) = (reserve0, reserve1);
        amountIn -= (amountIn * IPairFactory(factory).getFee(stable)) / 10000; // remove fee from amount received
        return _getAmountOut(amountIn, tokenIn, _reserve0, _reserve1);
    }

    function _getAmountOut(
        uint amountIn,
        address tokenIn,
        uint _reserve0,
        uint _reserve1
    ) internal view returns (uint) {
        if (stable) {
            uint xy = _k(_reserve0, _reserve1);
            _reserve0 = (_reserve0 * 1e18) / decimals0;
            _reserve1 = (_reserve1 * 1e18) / decimals1;
            (uint reserveA, uint reserveB) = tokenIn == token0
                ? (_reserve0, _reserve1)
                : (_reserve1, _reserve0);
            amountIn = tokenIn == token0
                ? (amountIn * 1e18) / decimals0
                : (amountIn * 1e18) / decimals1;
            uint y = reserveB - _get_y(amountIn + reserveA, xy, reserveB);
            return (y * (tokenIn == token0 ? decimals1 : decimals0)) / 1e18;
        } else {
            (uint reserveA, uint reserveB) = tokenIn == token0
                ? (_reserve0, _reserve1)
                : (_reserve1, _reserve0);
            return (amountIn * reserveB) / (reserveA + amountIn);
        }
    }

    function _k(uint x, uint y) internal view returns (uint) {
        if (stable) {
            uint _x = (x * 1e18) / decimals0;
            uint _y = (y * 1e18) / decimals1;
            uint _a = (_x * _y) / 1e18;
            uint _b = ((_x * _x) / 1e18 + (_y * _y) / 1e18);
            return (_a * _b) / 1e18; // x3y+y3x >= k
        } else {
            return x * y; // xy >= k
        }
    }

    function _mint(address dst, uint amount) internal {
        _updateFor(dst); // balances must be updated on mint/burn/transfer
        totalSupply += amount;
        balanceOf[dst] += amount;
        emit Transfer(address(0), dst, amount);
    }

    function _burn(address dst, uint amount) internal {
        _updateFor(dst);
        totalSupply -= amount;
        balanceOf[dst] -= amount;
        emit Transfer(dst, address(0), amount);
    }

    function approve(address spender, uint amount) external returns (bool) {
        allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);
        return true;
    }

    function permit(
        address owner,
        address spender,
        uint value,
        uint deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external {
        require(deadline >= block.timestamp, "Pair: EXPIRED");
        DOMAIN_SEPARATOR = keccak256(
            abi.encode(
                keccak256(
                    "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
                ),
                keccak256(bytes(name)),
                keccak256(bytes("1")),
                block.chainid,
                address(this)
            )
        );
        bytes32 digest = keccak256(
            abi.encodePacked(
                "\x19\x01",
                DOMAIN_SEPARATOR,
                keccak256(
                    abi.encode(
                        PERMIT_TYPEHASH,
                        owner,
                        spender,
                        value,
                        nonces[owner]++,
                        deadline
                    )
                )
            )
        );
        address recoveredAddress = ecrecover(digest, v, r, s);
        require(
            recoveredAddress != address(0) && recoveredAddress == owner,
            "Pair: INVALID_SIGNATURE"
        );
        allowance[owner][spender] = value;

        emit Approval(owner, spender, value);
    }

    function transfer(address dst, uint amount) external returns (bool) {
        _transferTokens(msg.sender, dst, amount);
        return true;
    }

    function transferFrom(
        address src,
        address dst,
        uint amount
    ) external returns (bool) {
        address spender = msg.sender;
        uint spenderAllowance = allowance[src][spender];

        if (spender != src && spenderAllowance != type(uint).max) {
            uint newAllowance = spenderAllowance - amount;
            allowance[src][spender] = newAllowance;

            emit Approval(src, spender, newAllowance);
        }

        _transferTokens(src, dst, amount);
        return true;
    }

    function _transferTokens(address src, address dst, uint amount) internal {
        _updateFor(src); // update fee position for src
        _updateFor(dst); // update fee position for dst

        balanceOf[src] -= amount;
        balanceOf[dst] += amount;

        emit Transfer(src, dst, amount);
    }

    function _safeTransfer(address token, address to, uint256 value) internal {
        require(token.code.length > 0);
        (bool success, bytes memory data) = token.call(
            abi.encodeWithSelector(IERC20.transfer.selector, to, value)
        );
        require(success && (data.length == 0 || abi.decode(data, (bool))));
    }

    function _safeApprove(
        address token,
        address spender,
        uint256 value
    ) internal {
        require(token.code.length > 0);
        require(
            (value == 0) ||
                (IERC20(token).allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        (bool success, bytes memory data) = token.call(
            abi.encodeWithSelector(IERC20.approve.selector, spender, value)
        );
        require(success && (data.length == 0 || abi.decode(data, (bool))));
    }
}

File 13 of 13 : PairFees.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;

import './interfaces/IERC20.sol';

// Pair Fees contract is used as a 1:1 pair relationship to split out fees, this ensures that the curve does not need to be modified for LP shares
contract PairFees {

    address internal immutable pair; // The pair it is bonded to
    address internal immutable token0; // token0 of pair, saved localy and statically for gas optimization
    address internal immutable token1; // Token1 of pair, saved localy and statically for gas optimization

    uint256 public toStake0;
    uint256 public toStake1;

    constructor(address _token0, address _token1) {
        pair = msg.sender;
        token0 = _token0;
        token1 = _token1;
    }

    function _safeTransfer(address token,address to,uint256 value) internal {
        require(token.code.length > 0);
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))));
    }

    // Allow the pair to transfer fees to users
    function claimFeesFor(address recipient, uint amount0, uint amount1) external {
        require(msg.sender == pair);
        if (amount0 > 0) _safeTransfer(token0, recipient, amount0);
        if (amount1 > 0) _safeTransfer(token1, recipient, amount1);
    }

   

    function processStakingFees(uint amount, bool isTokenZero) external {
        require(msg.sender == pair);
        if(amount > 0 && isTokenZero){
            toStake0 += amount;
        }
    
        if(amount > 0 && !isTokenZero){
            toStake1 += amount;
        }

    }

    function withdrawStakingFees(address recipient) external {
        require(msg.sender == pair);
        if (toStake0 > 0){
            _safeTransfer(token0, recipient, toStake0);
            toStake0 = 0;
        } 
        if (toStake1 > 0){
            _safeTransfer(token1, recipient, toStake1);
            toStake1 = 0;
        }
    }

      

}

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

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token0","type":"address"},{"indexed":true,"internalType":"address","name":"token1","type":"address"},{"indexed":false,"internalType":"bool","name":"stable","type":"bool"},{"indexed":false,"internalType":"address","name":"pair","type":"address"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"}],"name":"PairCreated","type":"event"},{"inputs":[],"name":"MAX_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_TREASURY_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptFeeManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"allPairs","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allPairsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"bool","name":"stable","type":"bool"}],"name":"createPair","outputs":[{"internalType":"address","name":"pair","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dibs","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_stable","type":"bool"}],"name":"getFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getInitializable","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"bool","name":"","type":"bool"}],"name":"getPair","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isPair","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pairCodeHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"pairs","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingFeeManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_dibs","type":"address"}],"name":"setDibs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_stable","type":"bool"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeManager","type":"address"}],"name":"setFeeManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feehandler","type":"address"}],"name":"setStakingFeeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newFee","type":"uint256"}],"name":"setStakingFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tresFee","type":"uint256"}],"name":"setTreasuryFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stableFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingFeeHandler","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingNFTFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"volatileFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50615faf806100206000396000f3fe60806040523480156200001157600080fd5b50600436106200020d5760003560e01c80638a4fa0d21162000125578063d0fb020311620000af578063f2b3c809116200007a578063f2b3c8091462000492578063f2fde38b146200049c578063f94c53c714620004b3578063ffb0a4a014620004bd57600080fd5b8063d0fb02031462000408578063e1f76b44146200041c578063e5e31b131462000433578063eb13c4cf146200045957600080fd5b8063b187bd2611620000f0578063b187bd2614620003b4578063bc063e1a14620003d3578063bedb86fb14620003dd578063c124a4a214620003f457600080fd5b80638a4fa0d2146200037a5780638da5cb5b146200038e578063956f94a114620003a05780639aab924814620003aa57600080fd5b8063512b45ea11620001a757806377e741c7116200017257806377e741c7146200032e5780637be1623e14620003455780638129fc1c146200035957806382dfdce4146200036357600080fd5b8063512b45ea14620002c7578063574f2ba314620002de5780636801cc3014620002e7578063715018a6146200032457600080fd5b806340bbd77511620001e857806340bbd7751462000276578063472d35b9146200028f578063482a8d0714620002a65780635084ed0314620002bd57600080fd5b80630c74db1214620002125780631e3dd18b146200022b5780634091cb77146200025f575b600080fd5b620002296200022336600462000db9565b620004d6565b005b620002426200023c36600462000dde565b62000524565b6040516001600160a01b0390911681526020015b60405180910390f35b620002296200027036600462000db9565b6200054f565b6200028060665481565b60405190815260200162000256565b62000229620002a036600462000db9565b6200059d565b62000229620002b736600462000dde565b620005d7565b6200028060675481565b62000280620002d836600462000e09565b62000604565b606f5462000280565b62000242620002f836600462000e27565b606e6020908152600093845260408085208252928452828420905282529020546001600160a01b031681565b620002296200061f565b620002296200033f36600462000dde565b62000637565b606c5462000242906001600160a01b031681565b6200022962000654565b620002426200037436600462000e27565b620007a4565b606b5462000242906001600160a01b031681565b6033546001600160a01b031662000242565b6200028060685481565b6200028062000a8f565b606554620003c29060ff1681565b604051901515815260200162000256565b6200028061012c81565b62000229620003ee36600462000e09565b62000ac3565b606d5462000242906001600160a01b031681565b606a5462000242906001600160a01b031681565b620002296200042d36600462000e71565b62000aee565b620003c26200044436600462000db9565b60706020526000908152604090205460ff1681565b607154607254604080516001600160a01b0393841681529282166020840152600160a01b90910460ff1615159082015260600162000256565b6200028060695481565b62000229620004ad36600462000db9565b62000b61565b6200022962000bdd565b620004c762000c19565b60405162000256919062000e9e565b606a546001600160a01b03163314620004ee57600080fd5b6001600160a01b0381166200050257600080fd5b606c80546001600160a01b0319166001600160a01b0392909216919091179055565b606f81815481106200053557600080fd5b6000918252602090912001546001600160a01b0316905081565b606a546001600160a01b031633146200056757600080fd5b6001600160a01b0381166200057b57600080fd5b606d80546001600160a01b0319166001600160a01b0392909216919091179055565b606a546001600160a01b03163314620005b557600080fd5b606b80546001600160a01b0319166001600160a01b0392909216919091179055565b606a546001600160a01b03163314620005ef57600080fd5b610bb8811115620005ff57600080fd5b606855565b600081620006155760675462000619565b6066545b92915050565b6200062962000c7d565b62000635600062000cd9565b565b606a546001600160a01b031633146200064f57600080fd5b606955565b600054610100900460ff1615808015620006755750600054600160ff909116105b80620006915750303b15801562000691575060005460ff166001145b620006fa5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff1916600117905580156200071e576000805461ff0019166101001790555b6200072862000d2b565b6065805460ff19169055606a80546001600160a01b03191633179055600160665560126067556107d06068556101906069558015620007a1576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b6000826001600160a01b0316846001600160a01b031603620007ee5760405162461bcd60e51b8152602060048201526002602482015261494160f01b6044820152606401620006f1565b600080846001600160a01b0316866001600160a01b0316106200081357848662000816565b85855b90925090506001600160a01b038216620008585760405162461bcd60e51b81526020600482015260026024820152615a4160f01b6044820152606401620006f1565b6001600160a01b038281166000908152606e602090815260408083208585168452825280832088151584529091529020541615620008be5760405162461bcd60e51b8152602060048201526002602482015261504560f01b6044820152606401620006f1565b6040516bffffffffffffffffffffffff19606084811b8216602084015283901b16603482015284151560f81b604882015260009060490160408051601f19818403018152908290528051602090910120607280546001600160a01b038087166001600160a01b03198b1515600160a01b0281166001600160a81b03199094169390931717909255607180549288169290911691909117905591508190620009659062000d8e565b8190604051809103906000f590508015801562000986573d6000803e3d6000fd5b506001600160a01b038481166000818152606e602081815260408084208987168086529083528185208d15158087529084528286208054988a166001600160a01b0319998a168117909155828752948452828620878752845282862081875284528286208054891686179055606f8054600181810183557f39f2babe526038520877fc7c33d81accf578af4a06c5fa6b0d038cae36e127119091018054909a1687179099558587526070855295839020805460ff1916909817909755935481519687529186019290925290840152929650907fc4805696c66d7cf352fc1d6bb633ad5ee82f6cb577c453024b6e0eb8306c6fc99060600160405180910390a35050509392505050565b60006040518060200162000aa39062000d8e565b6020820181038252601f19601f8201166040525080519060200120905090565b6033546001600160a01b0316331462000adb57600080fd5b6065805460ff1916911515919091179055565b606a546001600160a01b0316331462000b0657600080fd5b61012c81111562000b405760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401620006f1565b8060000362000b4e57600080fd5b811562000b5b5760665550565b60675550565b62000b6b62000c7d565b6001600160a01b03811662000bd25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620006f1565b620007a18162000cd9565b606b546001600160a01b0316331462000bf557600080fd5b606b54606a80546001600160a01b0319166001600160a01b03909216919091179055565b6060606f80548060200260200160405190810160405280929190818152602001828054801562000c7357602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162000c54575b5050505050905090565b6033546001600160a01b03163314620006355760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620006f1565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1662000d555760405162461bcd60e51b8152600401620006f19062000eed565b62000635600054610100900460ff1662000d835760405162461bcd60e51b8152600401620006f19062000eed565b620006353362000cd9565b6150418062000f3983390190565b80356001600160a01b038116811462000db457600080fd5b919050565b60006020828403121562000dcc57600080fd5b62000dd78262000d9c565b9392505050565b60006020828403121562000df157600080fd5b5035919050565b8035801515811462000db457600080fd5b60006020828403121562000e1c57600080fd5b62000dd78262000df8565b60008060006060848603121562000e3d57600080fd5b62000e488462000d9c565b925062000e586020850162000d9c565b915062000e686040850162000df8565b90509250925092565b6000806040838503121562000e8557600080fd5b62000e908362000df8565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b8181101562000ee15783516001600160a01b03168352928401929184019160010162000eba565b50909695505050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fe61016060405260006002556000600d556000600e5560016013553480156200002657600080fd5b50336001600160a01b0316610100816001600160a01b0316815250506000806000336001600160a01b031663eb13c4cf6040518163ffffffff1660e01b8152600401606060405180830381865afa15801562000086573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000ac9190620007c8565b8015156080526001600160a01b0380831660c052831660a052604051929550909350915083908390620000df90620006f7565b6001600160a01b03928316815291166020820152604001604051809103906000f08015801562000113573d6000803e3d6000fd5b506001600160a01b031660e05280156200034557826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000166573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000190919081019062000863565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620001cf573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620001f9919081019062000863565b6040516020016200020c9291906200091b565b604051602081830303815290604052600090805190602001906200023292919062000705565b50826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000272573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200029c919081019062000863565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620002db573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000305919081019062000863565b6040516020016200031892919062000976565b604051602081830303815290604052600190805190602001906200033e92919062000705565b506200055e565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000384573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620003ae919081019062000863565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620003ed573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000417919081019062000863565b6040516020016200042a929190620009c7565b604051602081830303815290604052600090805190602001906200045092919062000705565b50826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000490573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620004ba919081019062000863565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620004f9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000523919081019062000863565b6040516020016200053692919062000a24565b604051602081830303815290604052600190805190602001906200055c92919062000705565b505b826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200059d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620005c3919062000a46565b620005d090600a62000b87565b6101208181525050816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000617573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200063d919062000a46565b6200064a90600a62000b87565b6101405250506040805160608101825242815260006020820181815292820181815260078054600181018255925291517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68860039092029182015591517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689830155517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a909101555062000bd4565b6105c58062004a7c83390190565b828054620007139062000b98565b90600052602060002090601f01602090048101928262000737576000855562000782565b82601f106200075257805160ff191683800117855562000782565b8280016001018555821562000782579182015b828111156200078257825182559160200191906001019062000765565b506200079092915062000794565b5090565b5b8082111562000790576000815560010162000795565b80516001600160a01b0381168114620007c357600080fd5b919050565b600080600060608486031215620007de57600080fd5b620007e984620007ab565b9250620007f960208501620007ab565b9150604084015180151581146200080f57600080fd5b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200084d57818101518382015260200162000833565b838111156200085d576000848401525b50505050565b6000602082840312156200087657600080fd5b81516001600160401b03808211156200088e57600080fd5b818401915084601f830112620008a357600080fd5b815181811115620008b857620008b86200081a565b604051601f8201601f19908116603f01168101908382118183101715620008e357620008e36200081a565b81604052828152876020848701011115620008fd57600080fd5b6200091083602083016020880162000830565b979650505050505050565b6e029ba30b13632ab189020a6a690169608d1b8152600083516200094781600f85016020880162000830565b602f60f81b600f9184019182015283516200096a81601084016020880162000830565b01601001949350505050565b6473414d4d2d60d81b8152600083516200099881600585016020880162000830565b602f60f81b6005918401918201528351620009bb81600684016020880162000830565b01600601949350505050565b7002b37b630ba34b632ab189020a6a690169607d1b815260008351620009f581601185016020880162000830565b602f60f81b601191840191820152835162000a1881601284016020880162000830565b01601201949350505050565b6476414d4d2d60d81b8152600083516200099881600585016020880162000830565b60006020828403121562000a5957600080fd5b815160ff8116811462000a6b57600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111562000ac957816000190482111562000aad5762000aad62000a72565b8085161562000abb57918102915b93841c939080029062000a8d565b509250929050565b60008262000ae25750600162000b81565b8162000af15750600062000b81565b816001811462000b0a576002811462000b155762000b35565b600191505062000b81565b60ff84111562000b295762000b2962000a72565b50506001821b62000b81565b5060208310610133831016604e8410600b841016171562000b5a575081810a62000b81565b62000b66838362000a88565b806000190482111562000b7d5762000b7d62000a72565b0290505b92915050565b600062000a6b60ff84168362000ad1565b600181811c9082168062000bad57607f821691505b60208210810362000bce57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e051610100516101205161014051613ccc62000db06000396000818161046901528181612bbf01528181612ea901528181612f6b015261307601526000818161044601528181612b7e01528181612e6a01528181612fad01526130500152600081816107f801528181610c4701528181610d1801528181612064015281816121ad0152818161247b01528181612501015281816125d0015281816127ed01528181612873015261294201526000818161062a01528181611cba01528181612106015281816126840152818161270e015281816129f60152612a800152600081816104f30152818161067f0152818161074c0152818161093301528181610bdb0152818161154f0152818161173a01528181611b610152818161230a015281816129150152612a5f015260008181610331015281816104cb0152818161065a0152818161091201528181610bba015281816114b90152818161171801528181611b3f01528181612282015281816125a3015281816126ed01528181612eeb01528181612f320152818161301701526130ba0152600081816102e9015281816103cf0152818161049b01528181610c0f01528181610ce00152818161217c01528181612b560152612e360152613ccc6000f3fe608060405234801561001057600080fd5b506004361061028a5760003560e01c80637ecebe001161015c578063bda39cad116100ce578063d505accf11610087578063d505accf14610776578063dd62ed3e14610789578063ebeb31db146107b4578063f083be3b146107bc578063f140a35a146107c4578063fff6cae9146107d757600080fd5b8063bda39cad14610723578063bf944dbc1461072c578063c245febc14610735578063c5700a021461073e578063d21220a714610747578063d294f0931461076e57600080fd5b80639d63848a116101205780639d63848a1461064c5780639e8cc04b146106aa5780639f767c88146106bd578063a1ac4d13146106dd578063a9059cbb146106fd578063bc25cf771461071057600080fd5b80637ecebe00146105ab57806389afcb44146105cb5780638a7b8cf2146105f357806395d89b411461061d5780639af1d35a1461062557600080fd5b806323b872dd116102005780634d5a9f8a116101b95780634d5a9f8a14610529578063517b3f82146105495780635881c4751461055c5780635a76f25e1461056f5780636a6278421461057857806370a082311461058b57600080fd5b806323b872dd146103f1578063252c09d714610404578063313ce5671461041757806332c0defd14610431578063392f37e91461043a578063443cb4bc1461052057600080fd5b80630dfe1681116102525780630dfe16811461032c57806313345fe11461036b57806318160ddd1461038b5780631df8c717146103a2578063205aabf1146103aa57806322be3de1146103ca57600080fd5b8063022c0d9f1461028f57806306fdde03146102a45780630902f1ac146102c257806309047bdd146102e7578063095ea7b314610319575b600080fd5b6102a261029d366004613717565b6107df565b005b6102ac610f2c565b6040516102b991906137dd565b60405180910390f35b600854600954600a545b604080519384526020840192909252908201526060016102b9565b7f00000000000000000000000000000000000000000000000000000000000000005b60405190151581526020016102b9565b610309610327366004613810565b610fba565b6103537f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016102b9565b61037e61037936600461383c565b611027565b6040516102b99190613877565b61039460025481565b6040519081526020016102b9565b6102cc611223565b6103946103b83660046138bb565b60106020526000908152604090205481565b6103097f000000000000000000000000000000000000000000000000000000000000000081565b6103096103ff3660046138d8565b611292565b6102cc610412366004613919565b61135b565b61041f601281565b60405160ff90911681526020016102b9565b610394600d5481565b600854600954604080517f000000000000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060208201529081019290925260608201527f0000000000000000000000000000000000000000000000000000000000000000151560808201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660a08301527f00000000000000000000000000000000000000000000000000000000000000001660c082015260e0016102b9565b61039460085481565b6103946105373660046138bb565b60116020526000908152604090205481565b610394610557366004613810565b61138e565b61037e61056a366004613932565b611476565b61039460095481565b6103946105863660046138bb565b611485565b6103946105993660046138bb565b60046020526000908152604090205481565b6103946105b93660046138bb565b60066020526000908152604090205481565b6105de6105d93660046138bb565b6116e6565b604080519283526020830191909152016102b9565b6105fb611a03565b60408051825181526020808401519082015291810151908201526060016102b9565b6102ac611a83565b6103537f000000000000000000000000000000000000000000000000000000000000000081565b604080516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811682527f0000000000000000000000000000000000000000000000000000000000000000166020820152016102b9565b6103946106b8366004613932565b611a90565b6103946106cb3660046138bb565b600f6020526000908152604090205481565b6103946106eb3660046138bb565b60126020526000908152604090205481565b61030961070b366004613810565b611afd565b6102a261071e3660046138bb565b611b13565b610394600e5481565b610394600b5481565b610394600c5481565b610394600a5481565b6103537f000000000000000000000000000000000000000000000000000000000000000081565b6105de611c31565b6102a2610784366004613967565b611d58565b6103946107973660046139de565b600360209081526000928352604080842090915290825290205481565b600754610394565b6102a2612060565b6103946107d2366004613a17565b612167565b6102a2612255565b6013546001146107ee57600080fd5b60026013819055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b187bd266040518163ffffffff1660e01b8152600401602060405180830381865afa158015610854573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108789190613a3c565b1561088257600080fd5b60008511806108915750600084115b6108c85760405162461bcd60e51b8152602060048201526003602482015262494f4160e81b60448201526064015b60405180910390fd5b60085460095481871080156108dc57508086105b61090d5760405162461bcd60e51b8152602060048201526002602482015261125360f21b60448201526064016108bf565b6000807f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03898116908316148015906109805750806001600160a01b0316896001600160a01b031614155b6109b15760405162461bcd60e51b8152602060048201526002602482015261125560f21b60448201526064016108bf565b8a156109c2576109c2828a8d61238f565b89156109d3576109d3818a8c61238f565b8615610a4057604051639a7bff7960e01b81526001600160a01b038a1690639a7bff7990610a0d9033908f908f908e908e90600401613a5e565b600060405180830381600087803b158015610a2757600080fd5b505af1158015610a3b573d6000803e3d6000fd5b505050505b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610a84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa89190613aaa565b6040516370a0823160e01b81523060048201529094506001600160a01b038216906370a0823190602401602060405180830381865afa158015610aef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b139190613aaa565b9250505060008985610b259190613ad9565b8311610b32576000610b46565b610b3c8a86613ad9565b610b469084613ad9565b90506000610b548a86613ad9565b8311610b61576000610b75565b610b6b8a86613ad9565b610b759084613ad9565b90506000821180610b865750600081115b610bb85760405162461bcd60e51b815260206004820152600360248201526249494160e81b60448201526064016108bf565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008315610ccb57604051632895a2f560e11b81527f000000000000000000000000000000000000000000000000000000000000000015156004820152610ccb90612710906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063512b45ea90602401602060405180830381865afa158015610c8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb29190613aaa565b610cbc9087613af0565b610cc69190613b0f565b612477565b8215610d9c57604051632895a2f560e11b81527f000000000000000000000000000000000000000000000000000000000000000015156004820152610d9c90612710906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063512b45ea90602401602060405180830381865afa158015610d5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d839190613aaa565b610d8d9086613af0565b610d979190613b0f565b6127e9565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610de0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e049190613aaa565b6040516370a0823160e01b81523060048201529096506001600160a01b038216906370a0823190602401602060405180830381865afa158015610e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6f9190613aaa565b9450610e7b8888612b52565b610e858787612b52565b1015610eb75760405162461bcd60e51b81526020600482015260016024820152604b60f81b60448201526064016108bf565b5050610ec584848888612c9e565b60408051838152602081018390529081018c9052606081018b90526001600160a01b038a169033907fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229060800160405180910390a350506001601355505050505050505050565b60008054610f3990613b31565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6590613b31565b8015610fb25780601f10610f8757610100808354040283529160200191610fb2565b820191906000526020600020905b815481529060010190602001808311610f9557829003601f168201915b505050505081565b3360008181526003602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906110159086815260200190565b60405180910390a35060015b92915050565b606060008367ffffffffffffffff81111561104457611044613b65565b60405190808252806020026020018201604052801561106d578160200160208202803683370190505b5060075490915060009061108390600190613ad9565b905060006110918587613af0565b61109b9083613ad9565b90506000805b83831015611213576110b38784613b7b565b91506000600784815481106110ca576110ca613b93565b906000526020600020906003020160000154600784815481106110ef576110ef613b93565b90600052602060002090600302016000015461110b9190613ad9565b90506000816007868154811061112357611123613b93565b9060005260206000209060030201600101546007868154811061114857611148613b93565b9060005260206000209060030201600101546111649190613ad9565b61116e9190613b0f565b90506000826007878154811061118657611186613b93565b906000526020600020906003020160020154600787815481106111ab576111ab613b93565b9060005260206000209060030201600201546111c79190613ad9565b6111d19190613b0f565b90506111df8c8e8484612e32565b8885815181106111f1576111f1613b93565b602090810291909101015250505060010161120c8784613b7b565b92506110a1565b509293505050505b949350505050565b600b54600c544260008080611241600854600954600a549192909190565b92509250925083811461128a57600061125a8286613ad9565b90506112668185613af0565b6112709088613b7b565b965061127c8184613af0565b6112869087613b7b565b9550505b505050909192565b6001600160a01b0383166000818152600360209081526040808320338085529252822054919290919082148015906112cc57506000198114155b156113425760006112dd8583613ad9565b6001600160a01b038881166000818152600360209081526040808320948916808452948252918290208590559051848152939450919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505b61134d868686613127565b6001925050505b9392505050565b6007818154811061136b57600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b600080611399611a03565b90506000806113a6611223565b5084519193509150420361140e57600780546113c490600290613ad9565b815481106113d4576113d4613b93565b9060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505092505b825160009061141d9042613ad9565b90506000818560200151856114329190613ad9565b61143c9190613b0f565b90506000828660400151856114519190613ad9565b61145b9190613b0f565b9050611469888a8484612e32565b9998505050505050505050565b606061121b8484846001611027565b600060135460011461149657600080fd5b60026013556008546009546040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611508573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152c9190613aaa565b6040516370a0823160e01b81523060048201529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015611596573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ba9190613aaa565b905060006115c88584613ad9565b905060006115d68584613ad9565b6002549091506000819003611618576103e86115fa6115f58486613af0565b6131e7565b6116049190613ad9565b975061161360006103e8613257565b61164d565b61164a876116268386613af0565b6116309190613b0f565b8761163b8486613af0565b6116459190613b0f565b6132ea565b97505b600088116116835760405162461bcd60e51b8152602060048201526003602482015262494c4d60e81b60448201526064016108bf565b61168d8989613257565b61169985858989612c9e565b604080518481526020810184905233917f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f910160405180910390a250506001601355509395945050505050565b6000806013546001146116f857600080fd5b60026013556008546009546040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000906000906001600160a01b038416906370a0823190602401602060405180830381865afa15801561178e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b29190613aaa565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156117fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118209190613aaa565b3060009081526004602052604090205460025491925090806118428584613af0565b61184c9190613b0f565b9950806118598484613af0565b6118639190613b0f565b985060008a1180156118755750600089115b6118a75760405162461bcd60e51b815260206004820152600360248201526224a62160e91b60448201526064016108bf565b6118b13083613300565b6118bc868c8c61238f565b6118c7858c8b61238f565b6040516370a0823160e01b81523060048201526001600160a01b038716906370a0823190602401602060405180830381865afa15801561190b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061192f9190613aaa565b6040516370a0823160e01b81523060048201529094506001600160a01b038616906370a0823190602401602060405180830381865afa158015611976573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061199a9190613aaa565b92506119a884848a8a612c9e565b604080518b8152602081018b90526001600160a01b038d169133917fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496910160405180910390a350505050505050506001601381905550915091565b611a2760405180606001604052806000815260200160008152602001600081525090565b60078054611a3790600190613ad9565b81548110611a4757611a47613b93565b90600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050905090565b60018054610f3990613b31565b600080611aa08585856001611027565b90506000805b8251811015611ae857828181518110611ac157611ac1613b93565b602002602001015182611ad49190613b7b565b915080611ae081613ba9565b915050611aa6565b50611af38482613b0f565b9695505050505050565b6000611b0a338484613127565b50600192915050565b601354600114611b2257600080fd5b60026013556008546040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000917f000000000000000000000000000000000000000000000000000000000000000091611bef9184918691906001600160a01b038416906370a08231906024015b602060405180830381865afa158015611bbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611be09190613aaa565b611bea9190613ad9565b61238f565b6009546040516370a0823160e01b8152306004820152611c279183918691906001600160a01b038416906370a0823190602401611b9f565b5050600160135550565b600080611c3d3361338b565b50503360009081526011602090815260408083205460129092529091205481151580611c695750600081115b15611d54573360008181526011602090815260408083208390556012909152808220919091555163299e7ae760e11b8152600481019190915260248101839052604481018290526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063533cf5ce90606401600060405180830381600087803b158015611cfe57600080fd5b505af1158015611d12573d6000803e3d6000fd5b505060408051858152602081018590523393508392507f865ca08d59f5cb456e85cd2f7ef63664ea4f73327414e9d8152c4158b0e94645910160405180910390a35b9091565b42841015611d985760405162461bcd60e51b815260206004820152600d60248201526c14185a5c8e8811561412549151609a1b60448201526064016108bf565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051611dc89190613bc2565b60408051918290038220828201825260018352603160f81b6020938401528151928301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160408051601f19818403018152918152815160209283012060058190556001600160a01b038a166000908152600690935290822080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918b918b918b919087611e9383613ba9565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810187905260e00160405160208183030381529060405280519060200120604051602001611f0c92919061190160f01b81526002810192909252602282015260420190565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa158015611f77573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590611fad5750886001600160a01b0316816001600160a01b0316145b611ff95760405162461bcd60e51b815260206004820152601760248201527f506169723a20494e56414c49445f5349474e415455524500000000000000000060448201526064016108bf565b6001600160a01b038981166000818152600360209081526040808320948d16808452948252918290208b905590518a81527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c124a4a26040518163ffffffff1660e01b8152600401602060405180830381865afa1580156120c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120e49190613c5d565b60405163f8518b8960e01b81526001600160a01b0380831660048301529192507f00000000000000000000000000000000000000000000000000000000000000009091169063f8518b8990602401600060405180830381600087803b15801561214c57600080fd5b505af1158015612160573d6000803e3d6000fd5b5050505050565b600854600954604051632895a2f560e11b81527f0000000000000000000000000000000000000000000000000000000000000000151560048201526000929190612710907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063512b45ea90602401602060405180830381865afa1580156121fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122209190613aaa565b61222a9087613af0565b6122349190613b0f565b61223e9086613ad9565b945061224c85858484612e32565b95945050505050565b60135460011461226457600080fd5b60026013556040516370a0823160e01b8152306004820152612388907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156122d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122f59190613aaa565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015612359573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061237d9190613aaa565b600854600954612c9e565b6001601355565b6000836001600160a01b03163b116123a657600080fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916124029190613c7a565b6000604051808303816000865af19150503d806000811461243f576040519150601f19603f3d011682016040523d82523d6000602084013e612444565b606091505b509150915081801561246e57508051158061246e57508080602001905181019061246e9190613a3c565b61216057600080fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637be1623e6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156124d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124fb9190613c5d565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663f2b3c8096040518163ffffffff1660e01b8152600401602060405180830381865afa15801561255d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125819190613aaa565b905060006127106125928386613af0565b61259c9190613b0f565b90506125c97f0000000000000000000000000000000000000000000000000000000000000000848361238f565b60006127107f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663956f94a16040518163ffffffff1660e01b8152600401602060405180830381865afa15801561262c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126509190613aaa565b61265a9087613af0565b6126649190613b0f565b604051638d4dabff60e01b815260048101829052600160248201529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690638d4dabff90604401600060405180830381600087803b1580156126d057600080fd5b505af11580156126e4573d6000803e3d6000fd5b505050506127397f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008488611bea9190613ad9565b6127438282613b7b565b61274d9086613ad9565b9450600060025486670de0b6b3a76400006127689190613af0565b6127729190613b0f565b905080156127925780600d600082825461278c9190613b7b565b90915550505b337f112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a8602846127bf858a613b7b565b6127c99190613b7b565b6040805191825260006020830152015b60405180910390a2505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637be1623e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612849573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061286d9190613c5d565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663f2b3c8096040518163ffffffff1660e01b8152600401602060405180830381865afa1580156128cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128f39190613aaa565b905060006127106129048386613af0565b61290e9190613b0f565b905061293b7f0000000000000000000000000000000000000000000000000000000000000000848361238f565b60006127107f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663956f94a16040518163ffffffff1660e01b8152600401602060405180830381865afa15801561299e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129c29190613aaa565b6129cc9087613af0565b6129d69190613b0f565b604051638d4dabff60e01b815260048101829052600060248201529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690638d4dabff90604401600060405180830381600087803b158015612a4257600080fd5b505af1158015612a56573d6000803e3d6000fd5b50505050612aab7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008488611bea9190613ad9565b612ab58282613b7b565b612abf9086613ad9565b9450600060025486670de0b6b3a7640000612ada9190613af0565b612ae49190613b0f565b90508015612b045780600e6000828254612afe9190613b7b565b90915550505b337f112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a8602600085612b33868b613b7b565b612b3d9190613b7b565b604080519283526020830191909152016127d9565b60007f000000000000000000000000000000000000000000000000000000000000000015612c8d5760007f0000000000000000000000000000000000000000000000000000000000000000612baf85670de0b6b3a7640000613af0565b612bb99190613b0f565b905060007f0000000000000000000000000000000000000000000000000000000000000000612bf085670de0b6b3a7640000613af0565b612bfa9190613b0f565b90506000670de0b6b3a7640000612c118385613af0565b612c1b9190613b0f565b90506000670de0b6b3a7640000612c328480613af0565b612c3c9190613b0f565b670de0b6b3a7640000612c4f8680613af0565b612c599190613b0f565b612c639190613b7b565b9050670de0b6b3a7640000612c788284613af0565b612c829190613b0f565b945050505050611021565b612c978284613af0565b9050611021565b600a544290600090612cb09083613ad9565b9050600081118015612cc157508315155b8015612ccc57508215155b15612d1357612cdb8185613af0565b600b6000828254612cec9190613b7b565b90915550612cfc90508184613af0565b600c6000828254612d0d9190613b7b565b90915550505b6000612d1d611a03565b8051909150612d2c9084613ad9565b9150610708821115612de15760408051606081018252848152600b5460208201908152600c549282019283526007805460018101825560009190915291517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688600390930292830155517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68982015590517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a909101555b60088790556009869055600a83905560408051888152602081018890527fcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a910160405180910390a150505050505050565b60007f0000000000000000000000000000000000000000000000000000000000000000156130b5576000612e668484612b52565b90507f0000000000000000000000000000000000000000000000000000000000000000612e9b85670de0b6b3a7640000613af0565b612ea59190613b0f565b93507f0000000000000000000000000000000000000000000000000000000000000000612eda84670de0b6b3a7640000613af0565b612ee49190613b0f565b92506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b031614612f29578486612f2c565b85855b915091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b031614612fab577f0000000000000000000000000000000000000000000000000000000000000000612f9c89670de0b6b3a7640000613af0565b612fa69190613b0f565b612fe8565b7f0000000000000000000000000000000000000000000000000000000000000000612fde89670de0b6b3a7640000613af0565b612fe89190613b0f565b97506000613000612ff9848b613b7b565b85846134eb565b61300a9083613ad9565b9050670de0b6b3a76400007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316896001600160a01b031614613074577f0000000000000000000000000000000000000000000000000000000000000000613096565b7f00000000000000000000000000000000000000000000000000000000000000005b6130a09083613af0565b6130aa9190613b0f565b94505050505061121b565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b0316146130f85783856130fb565b84845b909250905061310a8783613b7b565b6131148289613af0565b61311e9190613b0f565b9250505061121b565b6131308361338b565b6131398261338b565b6001600160a01b03831660009081526004602052604081208054839290613161908490613ad9565b90915550506001600160a01b0382166000908152600460205260408120805483929061318e908490613b7b565b92505081905550816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516131da91815260200190565b60405180910390a3505050565b600060038211156132485750806000613201600283613b0f565b61320c906001613b7b565b90505b81811015613242579050806002816132278186613b0f565b6132319190613b7b565b61323b9190613b0f565b905061320f565b50919050565b8115613252575060015b919050565b6132608261338b565b80600260008282546132729190613b7b565b90915550506001600160a01b0382166000908152600460205260408120805483929061329f908490613b7b565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a35050565b60008183106132f95781611354565b5090919050565b6133098261338b565b806002600082825461331b9190613ad9565b90915550506001600160a01b03821660009081526004602052604081208054839290613348908490613ad9565b90915550506040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016132de565b6001600160a01b03811660009081526004602052604090205480156134b9576001600160a01b0382166000908152600f60209081526040808320805460108085529285208054600d54600e549481905594909552829055936133ed8584613ad9565b905060006133fb8584613ad9565b90508115613456576000670de0b6b3a7640000613418848a613af0565b6134229190613b0f565b6001600160a01b038a1660009081526011602052604081208054929350839290919061344f908490613b7b565b9091555050505b80156134af576000670de0b6b3a7640000613471838a613af0565b61347b9190613b0f565b6001600160a01b038a166000908152601260205260408120805492935083929091906134a8908490613b7b565b9091555050505b5050505050505050565b600d546001600160a01b0383166000908152600f6020908152604080832093909355600e546010909152919020555050565b6000805b60ff8110156135f15782600061350587836135fa565b90508581101561355557600061351b8887613697565b6135258389613ad9565b61353790670de0b6b3a7640000613af0565b6135419190613b0f565b905061354d8187613b7b565b955050613597565b60006135618887613697565b61356b8884613ad9565b61357d90670de0b6b3a7640000613af0565b6135879190613b0f565b90506135938187613ad9565b9550505b818511156135c05760016135ab8387613ad9565b116135bb57849350505050611354565b6135dc565b60016135cc8684613ad9565b116135dc57849350505050611354565b505080806135e990613ba9565b9150506134ef565b50909392505050565b6000670de0b6b3a7640000828185816136138280613af0565b61361d9190613b0f565b6136279190613af0565b6136319190613b0f565b61363b9190613af0565b6136459190613b0f565b670de0b6b3a764000080848161365b8280613af0565b6136659190613b0f565b61366f9190613af0565b6136799190613b0f565b6136839086613af0565b61368d9190613b0f565b6113549190613b7b565b6000670de0b6b3a764000083816136ae8280613af0565b6136b89190613b0f565b6136c29190613af0565b6136cc9190613b0f565b670de0b6b3a7640000806136e08580613af0565b6136ea9190613b0f565b6136f5866003613af0565b6136839190613af0565b6001600160a01b038116811461371457600080fd5b50565b60008060008060006080868803121561372f57600080fd5b85359450602086013593506040860135613748816136ff565b9250606086013567ffffffffffffffff8082111561376557600080fd5b818801915088601f83011261377957600080fd5b81358181111561378857600080fd5b89602082850101111561379a57600080fd5b9699959850939650602001949392505050565b60005b838110156137c85781810151838201526020016137b0565b838111156137d7576000848401525b50505050565b60208152600082518060208401526137fc8160408501602087016137ad565b601f01601f19169190910160400192915050565b6000806040838503121561382357600080fd5b823561382e816136ff565b946020939093013593505050565b6000806000806080858703121561385257600080fd5b843561385d816136ff565b966020860135965060408601359560600135945092505050565b6020808252825182820181905260009190848201906040850190845b818110156138af57835183529284019291840191600101613893565b50909695505050505050565b6000602082840312156138cd57600080fd5b8135611354816136ff565b6000806000606084860312156138ed57600080fd5b83356138f8816136ff565b92506020840135613908816136ff565b929592945050506040919091013590565b60006020828403121561392b57600080fd5b5035919050565b60008060006060848603121561394757600080fd5b8335613952816136ff565b95602085013595506040909401359392505050565b600080600080600080600060e0888a03121561398257600080fd5b873561398d816136ff565b9650602088013561399d816136ff565b95506040880135945060608801359350608088013560ff811681146139c157600080fd5b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156139f157600080fd5b82356139fc816136ff565b91506020830135613a0c816136ff565b809150509250929050565b60008060408385031215613a2a57600080fd5b823591506020830135613a0c816136ff565b600060208284031215613a4e57600080fd5b8151801515811461135457600080fd5b60018060a01b038616815284602082015283604082015260806060820152816080820152818360a0830137600081830160a090810191909152601f909201601f19160101949350505050565b600060208284031215613abc57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082821015613aeb57613aeb613ac3565b500390565b6000816000190483118215151615613b0a57613b0a613ac3565b500290565b600082613b2c57634e487b7160e01b600052601260045260246000fd5b500490565b600181811c90821680613b4557607f821691505b60208210810361324257634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60008219821115613b8e57613b8e613ac3565b500190565b634e487b7160e01b600052603260045260246000fd5b600060018201613bbb57613bbb613ac3565b5060010190565b600080835481600182811c915080831680613bde57607f831692505b60208084108203613bfd57634e487b7160e01b86526022600452602486fd5b818015613c115760018114613c2257613c4f565b60ff19861689528489019650613c4f565b60008a81526020902060005b86811015613c475781548b820152908501908301613c2e565b505084890196505b509498975050505050505050565b600060208284031215613c6f57600080fd5b8151611354816136ff565b60008251613c8c8184602087016137ad565b919091019291505056fea2646970667358221220c75056062a4c8f43c9a06e22a6e6664823a5d5655a394872a20b39ca7889b58864736f6c634300080d003360e060405234801561001057600080fd5b506040516105c53803806105c583398101604081905261002f91610066565b336080526001600160a01b0391821660a0521660c052610099565b80516001600160a01b038116811461006157600080fd5b919050565b6000806040838503121561007957600080fd5b6100828361004a565b91506100906020840161004a565b90509250929050565b60805160a05160c0516104e36100e26000396000818161012c015261026001526000818160fb015261022601526000818160c60152818161016201526101ef01526104e36000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063533cf5ce1461005c5780635b3c924814610071578063651d83f91461008c5780638d4dabff14610095578063f8518b89146100a8575b600080fd5b61006f61006a36600461039c565b6100bb565b005b61007a60015481565b60405190815260200160405180910390f35b61007a60005481565b61006f6100a33660046103dd565b610157565b61006f6100b636600461040d565b6101e4565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146100f057600080fd5b8115610121576101217f00000000000000000000000000000000000000000000000000000000000000008484610291565b8015610152576101527f00000000000000000000000000000000000000000000000000000000000000008483610291565b505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461018c57600080fd5b6000821180156101995750805b156101b557816000808282546101af919061042f565b90915550505b6000821180156101c3575080155b156101e05781600160008282546101da919061042f565b90915550505b5050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461021957600080fd5b600054156102535761024e7f000000000000000000000000000000000000000000000000000000000000000082600054610291565b600080555b6001541561028e576102887f000000000000000000000000000000000000000000000000000000000000000082600154610291565b60006001555b50565b6000836001600160a01b03163b116102a857600080fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916103049190610455565b6000604051808303816000865af19150503d8060008114610341576040519150601f19603f3d011682016040523d82523d6000602084013e610346565b606091505b50915091508180156103705750805115806103705750808060200190518101906103709190610490565b61037957600080fd5b5050505050565b80356001600160a01b038116811461039757600080fd5b919050565b6000806000606084860312156103b157600080fd5b6103ba84610380565b95602085013595506040909401359392505050565b801515811461028e57600080fd5b600080604083850312156103f057600080fd5b823591506020830135610402816103cf565b809150509250929050565b60006020828403121561041f57600080fd5b61042882610380565b9392505050565b6000821982111561045057634e487b7160e01b600052601160045260246000fd5b500190565b6000825160005b81811015610476576020818601810151858301520161045c565b81811115610485576000828501525b509190910192915050565b6000602082840312156104a257600080fd5b8151610428816103cf56fea2646970667358221220bc7b7ba3ed402e2260b246b969b2950543e1b823ed680664b9cd4f6bee8131dd64736f6c634300080d0033a2646970667358221220c856f6404b5819c3212050e394c73858e206a2b136bf86b5fd54682cff65c70864736f6c634300080d0033

Deployed Bytecode

0x60806040523480156200001157600080fd5b50600436106200020d5760003560e01c80638a4fa0d21162000125578063d0fb020311620000af578063f2b3c809116200007a578063f2b3c8091462000492578063f2fde38b146200049c578063f94c53c714620004b3578063ffb0a4a014620004bd57600080fd5b8063d0fb02031462000408578063e1f76b44146200041c578063e5e31b131462000433578063eb13c4cf146200045957600080fd5b8063b187bd2611620000f0578063b187bd2614620003b4578063bc063e1a14620003d3578063bedb86fb14620003dd578063c124a4a214620003f457600080fd5b80638a4fa0d2146200037a5780638da5cb5b146200038e578063956f94a114620003a05780639aab924814620003aa57600080fd5b8063512b45ea11620001a757806377e741c7116200017257806377e741c7146200032e5780637be1623e14620003455780638129fc1c146200035957806382dfdce4146200036357600080fd5b8063512b45ea14620002c7578063574f2ba314620002de5780636801cc3014620002e7578063715018a6146200032457600080fd5b806340bbd77511620001e857806340bbd7751462000276578063472d35b9146200028f578063482a8d0714620002a65780635084ed0314620002bd57600080fd5b80630c74db1214620002125780631e3dd18b146200022b5780634091cb77146200025f575b600080fd5b620002296200022336600462000db9565b620004d6565b005b620002426200023c36600462000dde565b62000524565b6040516001600160a01b0390911681526020015b60405180910390f35b620002296200027036600462000db9565b6200054f565b6200028060665481565b60405190815260200162000256565b62000229620002a036600462000db9565b6200059d565b62000229620002b736600462000dde565b620005d7565b6200028060675481565b62000280620002d836600462000e09565b62000604565b606f5462000280565b62000242620002f836600462000e27565b606e6020908152600093845260408085208252928452828420905282529020546001600160a01b031681565b620002296200061f565b620002296200033f36600462000dde565b62000637565b606c5462000242906001600160a01b031681565b6200022962000654565b620002426200037436600462000e27565b620007a4565b606b5462000242906001600160a01b031681565b6033546001600160a01b031662000242565b6200028060685481565b6200028062000a8f565b606554620003c29060ff1681565b604051901515815260200162000256565b6200028061012c81565b62000229620003ee36600462000e09565b62000ac3565b606d5462000242906001600160a01b031681565b606a5462000242906001600160a01b031681565b620002296200042d36600462000e71565b62000aee565b620003c26200044436600462000db9565b60706020526000908152604090205460ff1681565b607154607254604080516001600160a01b0393841681529282166020840152600160a01b90910460ff1615159082015260600162000256565b6200028060695481565b62000229620004ad36600462000db9565b62000b61565b6200022962000bdd565b620004c762000c19565b60405162000256919062000e9e565b606a546001600160a01b03163314620004ee57600080fd5b6001600160a01b0381166200050257600080fd5b606c80546001600160a01b0319166001600160a01b0392909216919091179055565b606f81815481106200053557600080fd5b6000918252602090912001546001600160a01b0316905081565b606a546001600160a01b031633146200056757600080fd5b6001600160a01b0381166200057b57600080fd5b606d80546001600160a01b0319166001600160a01b0392909216919091179055565b606a546001600160a01b03163314620005b557600080fd5b606b80546001600160a01b0319166001600160a01b0392909216919091179055565b606a546001600160a01b03163314620005ef57600080fd5b610bb8811115620005ff57600080fd5b606855565b600081620006155760675462000619565b6066545b92915050565b6200062962000c7d565b62000635600062000cd9565b565b606a546001600160a01b031633146200064f57600080fd5b606955565b600054610100900460ff1615808015620006755750600054600160ff909116105b80620006915750303b15801562000691575060005460ff166001145b620006fa5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff1916600117905580156200071e576000805461ff0019166101001790555b6200072862000d2b565b6065805460ff19169055606a80546001600160a01b03191633179055600160665560126067556107d06068556101906069558015620007a1576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b6000826001600160a01b0316846001600160a01b031603620007ee5760405162461bcd60e51b8152602060048201526002602482015261494160f01b6044820152606401620006f1565b600080846001600160a01b0316866001600160a01b0316106200081357848662000816565b85855b90925090506001600160a01b038216620008585760405162461bcd60e51b81526020600482015260026024820152615a4160f01b6044820152606401620006f1565b6001600160a01b038281166000908152606e602090815260408083208585168452825280832088151584529091529020541615620008be5760405162461bcd60e51b8152602060048201526002602482015261504560f01b6044820152606401620006f1565b6040516bffffffffffffffffffffffff19606084811b8216602084015283901b16603482015284151560f81b604882015260009060490160408051601f19818403018152908290528051602090910120607280546001600160a01b038087166001600160a01b03198b1515600160a01b0281166001600160a81b03199094169390931717909255607180549288169290911691909117905591508190620009659062000d8e565b8190604051809103906000f590508015801562000986573d6000803e3d6000fd5b506001600160a01b038481166000818152606e602081815260408084208987168086529083528185208d15158087529084528286208054988a166001600160a01b0319998a168117909155828752948452828620878752845282862081875284528286208054891686179055606f8054600181810183557f39f2babe526038520877fc7c33d81accf578af4a06c5fa6b0d038cae36e127119091018054909a1687179099558587526070855295839020805460ff1916909817909755935481519687529186019290925290840152929650907fc4805696c66d7cf352fc1d6bb633ad5ee82f6cb577c453024b6e0eb8306c6fc99060600160405180910390a35050509392505050565b60006040518060200162000aa39062000d8e565b6020820181038252601f19601f8201166040525080519060200120905090565b6033546001600160a01b0316331462000adb57600080fd5b6065805460ff1916911515919091179055565b606a546001600160a01b0316331462000b0657600080fd5b61012c81111562000b405760405162461bcd60e51b815260206004820152600360248201526266656560e81b6044820152606401620006f1565b8060000362000b4e57600080fd5b811562000b5b5760665550565b60675550565b62000b6b62000c7d565b6001600160a01b03811662000bd25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401620006f1565b620007a18162000cd9565b606b546001600160a01b0316331462000bf557600080fd5b606b54606a80546001600160a01b0319166001600160a01b03909216919091179055565b6060606f80548060200260200160405190810160405280929190818152602001828054801562000c7357602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162000c54575b5050505050905090565b6033546001600160a01b03163314620006355760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620006f1565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1662000d555760405162461bcd60e51b8152600401620006f19062000eed565b62000635600054610100900460ff1662000d835760405162461bcd60e51b8152600401620006f19062000eed565b620006353362000cd9565b6150418062000f3983390190565b80356001600160a01b038116811462000db457600080fd5b919050565b60006020828403121562000dcc57600080fd5b62000dd78262000d9c565b9392505050565b60006020828403121562000df157600080fd5b5035919050565b8035801515811462000db457600080fd5b60006020828403121562000e1c57600080fd5b62000dd78262000df8565b60008060006060848603121562000e3d57600080fd5b62000e488462000d9c565b925062000e586020850162000d9c565b915062000e686040850162000df8565b90509250925092565b6000806040838503121562000e8557600080fd5b62000e908362000df8565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b8181101562000ee15783516001600160a01b03168352928401929184019160010162000eba565b50909695505050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fe61016060405260006002556000600d556000600e5560016013553480156200002657600080fd5b50336001600160a01b0316610100816001600160a01b0316815250506000806000336001600160a01b031663eb13c4cf6040518163ffffffff1660e01b8152600401606060405180830381865afa15801562000086573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000ac9190620007c8565b8015156080526001600160a01b0380831660c052831660a052604051929550909350915083908390620000df90620006f7565b6001600160a01b03928316815291166020820152604001604051809103906000f08015801562000113573d6000803e3d6000fd5b506001600160a01b031660e05280156200034557826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000166573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000190919081019062000863565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620001cf573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620001f9919081019062000863565b6040516020016200020c9291906200091b565b604051602081830303815290604052600090805190602001906200023292919062000705565b50826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000272573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200029c919081019062000863565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620002db573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000305919081019062000863565b6040516020016200031892919062000976565b604051602081830303815290604052600190805190602001906200033e92919062000705565b506200055e565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000384573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620003ae919081019062000863565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620003ed573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000417919081019062000863565b6040516020016200042a929190620009c7565b604051602081830303815290604052600090805190602001906200045092919062000705565b50826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000490573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620004ba919081019062000863565b826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa158015620004f9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000523919081019062000863565b6040516020016200053692919062000a24565b604051602081830303815290604052600190805190602001906200055c92919062000705565b505b826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200059d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620005c3919062000a46565b620005d090600a62000b87565b6101208181525050816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000617573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200063d919062000a46565b6200064a90600a62000b87565b6101405250506040805160608101825242815260006020820181815292820181815260078054600181018255925291517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68860039092029182015591517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689830155517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a909101555062000bd4565b6105c58062004a7c83390190565b828054620007139062000b98565b90600052602060002090601f01602090048101928262000737576000855562000782565b82601f106200075257805160ff191683800117855562000782565b8280016001018555821562000782579182015b828111156200078257825182559160200191906001019062000765565b506200079092915062000794565b5090565b5b8082111562000790576000815560010162000795565b80516001600160a01b0381168114620007c357600080fd5b919050565b600080600060608486031215620007de57600080fd5b620007e984620007ab565b9250620007f960208501620007ab565b9150604084015180151581146200080f57600080fd5b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200084d57818101518382015260200162000833565b838111156200085d576000848401525b50505050565b6000602082840312156200087657600080fd5b81516001600160401b03808211156200088e57600080fd5b818401915084601f830112620008a357600080fd5b815181811115620008b857620008b86200081a565b604051601f8201601f19908116603f01168101908382118183101715620008e357620008e36200081a565b81604052828152876020848701011115620008fd57600080fd5b6200091083602083016020880162000830565b979650505050505050565b6e029ba30b13632ab189020a6a690169608d1b8152600083516200094781600f85016020880162000830565b602f60f81b600f9184019182015283516200096a81601084016020880162000830565b01601001949350505050565b6473414d4d2d60d81b8152600083516200099881600585016020880162000830565b602f60f81b6005918401918201528351620009bb81600684016020880162000830565b01600601949350505050565b7002b37b630ba34b632ab189020a6a690169607d1b815260008351620009f581601185016020880162000830565b602f60f81b601191840191820152835162000a1881601284016020880162000830565b01601201949350505050565b6476414d4d2d60d81b8152600083516200099881600585016020880162000830565b60006020828403121562000a5957600080fd5b815160ff8116811462000a6b57600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111562000ac957816000190482111562000aad5762000aad62000a72565b8085161562000abb57918102915b93841c939080029062000a8d565b509250929050565b60008262000ae25750600162000b81565b8162000af15750600062000b81565b816001811462000b0a576002811462000b155762000b35565b600191505062000b81565b60ff84111562000b295762000b2962000a72565b50506001821b62000b81565b5060208310610133831016604e8410600b841016171562000b5a575081810a62000b81565b62000b66838362000a88565b806000190482111562000b7d5762000b7d62000a72565b0290505b92915050565b600062000a6b60ff84168362000ad1565b600181811c9082168062000bad57607f821691505b60208210810362000bce57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e051610100516101205161014051613ccc62000db06000396000818161046901528181612bbf01528181612ea901528181612f6b015261307601526000818161044601528181612b7e01528181612e6a01528181612fad01526130500152600081816107f801528181610c4701528181610d1801528181612064015281816121ad0152818161247b01528181612501015281816125d0015281816127ed01528181612873015261294201526000818161062a01528181611cba01528181612106015281816126840152818161270e015281816129f60152612a800152600081816104f30152818161067f0152818161074c0152818161093301528181610bdb0152818161154f0152818161173a01528181611b610152818161230a015281816129150152612a5f015260008181610331015281816104cb0152818161065a0152818161091201528181610bba015281816114b90152818161171801528181611b3f01528181612282015281816125a3015281816126ed01528181612eeb01528181612f320152818161301701526130ba0152600081816102e9015281816103cf0152818161049b01528181610c0f01528181610ce00152818161217c01528181612b560152612e360152613ccc6000f3fe608060405234801561001057600080fd5b506004361061028a5760003560e01c80637ecebe001161015c578063bda39cad116100ce578063d505accf11610087578063d505accf14610776578063dd62ed3e14610789578063ebeb31db146107b4578063f083be3b146107bc578063f140a35a146107c4578063fff6cae9146107d757600080fd5b8063bda39cad14610723578063bf944dbc1461072c578063c245febc14610735578063c5700a021461073e578063d21220a714610747578063d294f0931461076e57600080fd5b80639d63848a116101205780639d63848a1461064c5780639e8cc04b146106aa5780639f767c88146106bd578063a1ac4d13146106dd578063a9059cbb146106fd578063bc25cf771461071057600080fd5b80637ecebe00146105ab57806389afcb44146105cb5780638a7b8cf2146105f357806395d89b411461061d5780639af1d35a1461062557600080fd5b806323b872dd116102005780634d5a9f8a116101b95780634d5a9f8a14610529578063517b3f82146105495780635881c4751461055c5780635a76f25e1461056f5780636a6278421461057857806370a082311461058b57600080fd5b806323b872dd146103f1578063252c09d714610404578063313ce5671461041757806332c0defd14610431578063392f37e91461043a578063443cb4bc1461052057600080fd5b80630dfe1681116102525780630dfe16811461032c57806313345fe11461036b57806318160ddd1461038b5780631df8c717146103a2578063205aabf1146103aa57806322be3de1146103ca57600080fd5b8063022c0d9f1461028f57806306fdde03146102a45780630902f1ac146102c257806309047bdd146102e7578063095ea7b314610319575b600080fd5b6102a261029d366004613717565b6107df565b005b6102ac610f2c565b6040516102b991906137dd565b60405180910390f35b600854600954600a545b604080519384526020840192909252908201526060016102b9565b7f00000000000000000000000000000000000000000000000000000000000000005b60405190151581526020016102b9565b610309610327366004613810565b610fba565b6103537f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016102b9565b61037e61037936600461383c565b611027565b6040516102b99190613877565b61039460025481565b6040519081526020016102b9565b6102cc611223565b6103946103b83660046138bb565b60106020526000908152604090205481565b6103097f000000000000000000000000000000000000000000000000000000000000000081565b6103096103ff3660046138d8565b611292565b6102cc610412366004613919565b61135b565b61041f601281565b60405160ff90911681526020016102b9565b610394600d5481565b600854600954604080517f000000000000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060208201529081019290925260608201527f0000000000000000000000000000000000000000000000000000000000000000151560808201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660a08301527f00000000000000000000000000000000000000000000000000000000000000001660c082015260e0016102b9565b61039460085481565b6103946105373660046138bb565b60116020526000908152604090205481565b610394610557366004613810565b61138e565b61037e61056a366004613932565b611476565b61039460095481565b6103946105863660046138bb565b611485565b6103946105993660046138bb565b60046020526000908152604090205481565b6103946105b93660046138bb565b60066020526000908152604090205481565b6105de6105d93660046138bb565b6116e6565b604080519283526020830191909152016102b9565b6105fb611a03565b60408051825181526020808401519082015291810151908201526060016102b9565b6102ac611a83565b6103537f000000000000000000000000000000000000000000000000000000000000000081565b604080516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811682527f0000000000000000000000000000000000000000000000000000000000000000166020820152016102b9565b6103946106b8366004613932565b611a90565b6103946106cb3660046138bb565b600f6020526000908152604090205481565b6103946106eb3660046138bb565b60126020526000908152604090205481565b61030961070b366004613810565b611afd565b6102a261071e3660046138bb565b611b13565b610394600e5481565b610394600b5481565b610394600c5481565b610394600a5481565b6103537f000000000000000000000000000000000000000000000000000000000000000081565b6105de611c31565b6102a2610784366004613967565b611d58565b6103946107973660046139de565b600360209081526000928352604080842090915290825290205481565b600754610394565b6102a2612060565b6103946107d2366004613a17565b612167565b6102a2612255565b6013546001146107ee57600080fd5b60026013819055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b187bd266040518163ffffffff1660e01b8152600401602060405180830381865afa158015610854573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108789190613a3c565b1561088257600080fd5b60008511806108915750600084115b6108c85760405162461bcd60e51b8152602060048201526003602482015262494f4160e81b60448201526064015b60405180910390fd5b60085460095481871080156108dc57508086105b61090d5760405162461bcd60e51b8152602060048201526002602482015261125360f21b60448201526064016108bf565b6000807f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03898116908316148015906109805750806001600160a01b0316896001600160a01b031614155b6109b15760405162461bcd60e51b8152602060048201526002602482015261125560f21b60448201526064016108bf565b8a156109c2576109c2828a8d61238f565b89156109d3576109d3818a8c61238f565b8615610a4057604051639a7bff7960e01b81526001600160a01b038a1690639a7bff7990610a0d9033908f908f908e908e90600401613a5e565b600060405180830381600087803b158015610a2757600080fd5b505af1158015610a3b573d6000803e3d6000fd5b505050505b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610a84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa89190613aaa565b6040516370a0823160e01b81523060048201529094506001600160a01b038216906370a0823190602401602060405180830381865afa158015610aef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b139190613aaa565b9250505060008985610b259190613ad9565b8311610b32576000610b46565b610b3c8a86613ad9565b610b469084613ad9565b90506000610b548a86613ad9565b8311610b61576000610b75565b610b6b8a86613ad9565b610b759084613ad9565b90506000821180610b865750600081115b610bb85760405162461bcd60e51b815260206004820152600360248201526249494160e81b60448201526064016108bf565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008315610ccb57604051632895a2f560e11b81527f000000000000000000000000000000000000000000000000000000000000000015156004820152610ccb90612710906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063512b45ea90602401602060405180830381865afa158015610c8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb29190613aaa565b610cbc9087613af0565b610cc69190613b0f565b612477565b8215610d9c57604051632895a2f560e11b81527f000000000000000000000000000000000000000000000000000000000000000015156004820152610d9c90612710906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063512b45ea90602401602060405180830381865afa158015610d5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d839190613aaa565b610d8d9086613af0565b610d979190613b0f565b6127e9565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610de0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e049190613aaa565b6040516370a0823160e01b81523060048201529096506001600160a01b038216906370a0823190602401602060405180830381865afa158015610e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6f9190613aaa565b9450610e7b8888612b52565b610e858787612b52565b1015610eb75760405162461bcd60e51b81526020600482015260016024820152604b60f81b60448201526064016108bf565b5050610ec584848888612c9e565b60408051838152602081018390529081018c9052606081018b90526001600160a01b038a169033907fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229060800160405180910390a350506001601355505050505050505050565b60008054610f3990613b31565b80601f0160208091040260200160405190810160405280929190818152602001828054610f6590613b31565b8015610fb25780601f10610f8757610100808354040283529160200191610fb2565b820191906000526020600020905b815481529060010190602001808311610f9557829003601f168201915b505050505081565b3360008181526003602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906110159086815260200190565b60405180910390a35060015b92915050565b606060008367ffffffffffffffff81111561104457611044613b65565b60405190808252806020026020018201604052801561106d578160200160208202803683370190505b5060075490915060009061108390600190613ad9565b905060006110918587613af0565b61109b9083613ad9565b90506000805b83831015611213576110b38784613b7b565b91506000600784815481106110ca576110ca613b93565b906000526020600020906003020160000154600784815481106110ef576110ef613b93565b90600052602060002090600302016000015461110b9190613ad9565b90506000816007868154811061112357611123613b93565b9060005260206000209060030201600101546007868154811061114857611148613b93565b9060005260206000209060030201600101546111649190613ad9565b61116e9190613b0f565b90506000826007878154811061118657611186613b93565b906000526020600020906003020160020154600787815481106111ab576111ab613b93565b9060005260206000209060030201600201546111c79190613ad9565b6111d19190613b0f565b90506111df8c8e8484612e32565b8885815181106111f1576111f1613b93565b602090810291909101015250505060010161120c8784613b7b565b92506110a1565b509293505050505b949350505050565b600b54600c544260008080611241600854600954600a549192909190565b92509250925083811461128a57600061125a8286613ad9565b90506112668185613af0565b6112709088613b7b565b965061127c8184613af0565b6112869087613b7b565b9550505b505050909192565b6001600160a01b0383166000818152600360209081526040808320338085529252822054919290919082148015906112cc57506000198114155b156113425760006112dd8583613ad9565b6001600160a01b038881166000818152600360209081526040808320948916808452948252918290208590559051848152939450919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505b61134d868686613127565b6001925050505b9392505050565b6007818154811061136b57600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b600080611399611a03565b90506000806113a6611223565b5084519193509150420361140e57600780546113c490600290613ad9565b815481106113d4576113d4613b93565b9060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505092505b825160009061141d9042613ad9565b90506000818560200151856114329190613ad9565b61143c9190613b0f565b90506000828660400151856114519190613ad9565b61145b9190613b0f565b9050611469888a8484612e32565b9998505050505050505050565b606061121b8484846001611027565b600060135460011461149657600080fd5b60026013556008546009546040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611508573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152c9190613aaa565b6040516370a0823160e01b81523060048201529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015611596573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ba9190613aaa565b905060006115c88584613ad9565b905060006115d68584613ad9565b6002549091506000819003611618576103e86115fa6115f58486613af0565b6131e7565b6116049190613ad9565b975061161360006103e8613257565b61164d565b61164a876116268386613af0565b6116309190613b0f565b8761163b8486613af0565b6116459190613b0f565b6132ea565b97505b600088116116835760405162461bcd60e51b8152602060048201526003602482015262494c4d60e81b60448201526064016108bf565b61168d8989613257565b61169985858989612c9e565b604080518481526020810184905233917f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f910160405180910390a250506001601355509395945050505050565b6000806013546001146116f857600080fd5b60026013556008546009546040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000906000906001600160a01b038416906370a0823190602401602060405180830381865afa15801561178e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b29190613aaa565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156117fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118209190613aaa565b3060009081526004602052604090205460025491925090806118428584613af0565b61184c9190613b0f565b9950806118598484613af0565b6118639190613b0f565b985060008a1180156118755750600089115b6118a75760405162461bcd60e51b815260206004820152600360248201526224a62160e91b60448201526064016108bf565b6118b13083613300565b6118bc868c8c61238f565b6118c7858c8b61238f565b6040516370a0823160e01b81523060048201526001600160a01b038716906370a0823190602401602060405180830381865afa15801561190b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061192f9190613aaa565b6040516370a0823160e01b81523060048201529094506001600160a01b038616906370a0823190602401602060405180830381865afa158015611976573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061199a9190613aaa565b92506119a884848a8a612c9e565b604080518b8152602081018b90526001600160a01b038d169133917fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496910160405180910390a350505050505050506001601381905550915091565b611a2760405180606001604052806000815260200160008152602001600081525090565b60078054611a3790600190613ad9565b81548110611a4757611a47613b93565b90600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050905090565b60018054610f3990613b31565b600080611aa08585856001611027565b90506000805b8251811015611ae857828181518110611ac157611ac1613b93565b602002602001015182611ad49190613b7b565b915080611ae081613ba9565b915050611aa6565b50611af38482613b0f565b9695505050505050565b6000611b0a338484613127565b50600192915050565b601354600114611b2257600080fd5b60026013556008546040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000917f000000000000000000000000000000000000000000000000000000000000000091611bef9184918691906001600160a01b038416906370a08231906024015b602060405180830381865afa158015611bbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611be09190613aaa565b611bea9190613ad9565b61238f565b6009546040516370a0823160e01b8152306004820152611c279183918691906001600160a01b038416906370a0823190602401611b9f565b5050600160135550565b600080611c3d3361338b565b50503360009081526011602090815260408083205460129092529091205481151580611c695750600081115b15611d54573360008181526011602090815260408083208390556012909152808220919091555163299e7ae760e11b8152600481019190915260248101839052604481018290526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063533cf5ce90606401600060405180830381600087803b158015611cfe57600080fd5b505af1158015611d12573d6000803e3d6000fd5b505060408051858152602081018590523393508392507f865ca08d59f5cb456e85cd2f7ef63664ea4f73327414e9d8152c4158b0e94645910160405180910390a35b9091565b42841015611d985760405162461bcd60e51b815260206004820152600d60248201526c14185a5c8e8811561412549151609a1b60448201526064016108bf565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051611dc89190613bc2565b60408051918290038220828201825260018352603160f81b6020938401528151928301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160408051601f19818403018152918152815160209283012060058190556001600160a01b038a166000908152600690935290822080547f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918b918b918b919087611e9383613ba9565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810187905260e00160405160208183030381529060405280519060200120604051602001611f0c92919061190160f01b81526002810192909252602282015260420190565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa158015611f77573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590611fad5750886001600160a01b0316816001600160a01b0316145b611ff95760405162461bcd60e51b815260206004820152601760248201527f506169723a20494e56414c49445f5349474e415455524500000000000000000060448201526064016108bf565b6001600160a01b038981166000818152600360209081526040808320948d16808452948252918290208b905590518a81527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c124a4a26040518163ffffffff1660e01b8152600401602060405180830381865afa1580156120c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120e49190613c5d565b60405163f8518b8960e01b81526001600160a01b0380831660048301529192507f00000000000000000000000000000000000000000000000000000000000000009091169063f8518b8990602401600060405180830381600087803b15801561214c57600080fd5b505af1158015612160573d6000803e3d6000fd5b5050505050565b600854600954604051632895a2f560e11b81527f0000000000000000000000000000000000000000000000000000000000000000151560048201526000929190612710907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063512b45ea90602401602060405180830381865afa1580156121fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122209190613aaa565b61222a9087613af0565b6122349190613b0f565b61223e9086613ad9565b945061224c85858484612e32565b95945050505050565b60135460011461226457600080fd5b60026013556040516370a0823160e01b8152306004820152612388907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156122d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122f59190613aaa565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015612359573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061237d9190613aaa565b600854600954612c9e565b6001601355565b6000836001600160a01b03163b116123a657600080fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916124029190613c7a565b6000604051808303816000865af19150503d806000811461243f576040519150601f19603f3d011682016040523d82523d6000602084013e612444565b606091505b509150915081801561246e57508051158061246e57508080602001905181019061246e9190613a3c565b61216057600080fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637be1623e6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156124d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124fb9190613c5d565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663f2b3c8096040518163ffffffff1660e01b8152600401602060405180830381865afa15801561255d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125819190613aaa565b905060006127106125928386613af0565b61259c9190613b0f565b90506125c97f0000000000000000000000000000000000000000000000000000000000000000848361238f565b60006127107f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663956f94a16040518163ffffffff1660e01b8152600401602060405180830381865afa15801561262c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126509190613aaa565b61265a9087613af0565b6126649190613b0f565b604051638d4dabff60e01b815260048101829052600160248201529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690638d4dabff90604401600060405180830381600087803b1580156126d057600080fd5b505af11580156126e4573d6000803e3d6000fd5b505050506127397f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008488611bea9190613ad9565b6127438282613b7b565b61274d9086613ad9565b9450600060025486670de0b6b3a76400006127689190613af0565b6127729190613b0f565b905080156127925780600d600082825461278c9190613b7b565b90915550505b337f112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a8602846127bf858a613b7b565b6127c99190613b7b565b6040805191825260006020830152015b60405180910390a2505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637be1623e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612849573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061286d9190613c5d565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663f2b3c8096040518163ffffffff1660e01b8152600401602060405180830381865afa1580156128cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128f39190613aaa565b905060006127106129048386613af0565b61290e9190613b0f565b905061293b7f0000000000000000000000000000000000000000000000000000000000000000848361238f565b60006127107f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663956f94a16040518163ffffffff1660e01b8152600401602060405180830381865afa15801561299e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129c29190613aaa565b6129cc9087613af0565b6129d69190613b0f565b604051638d4dabff60e01b815260048101829052600060248201529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690638d4dabff90604401600060405180830381600087803b158015612a4257600080fd5b505af1158015612a56573d6000803e3d6000fd5b50505050612aab7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008488611bea9190613ad9565b612ab58282613b7b565b612abf9086613ad9565b9450600060025486670de0b6b3a7640000612ada9190613af0565b612ae49190613b0f565b90508015612b045780600e6000828254612afe9190613b7b565b90915550505b337f112c256902bf554b6ed882d2936687aaeb4225e8cd5b51303c90ca6cf43a8602600085612b33868b613b7b565b612b3d9190613b7b565b604080519283526020830191909152016127d9565b60007f000000000000000000000000000000000000000000000000000000000000000015612c8d5760007f0000000000000000000000000000000000000000000000000000000000000000612baf85670de0b6b3a7640000613af0565b612bb99190613b0f565b905060007f0000000000000000000000000000000000000000000000000000000000000000612bf085670de0b6b3a7640000613af0565b612bfa9190613b0f565b90506000670de0b6b3a7640000612c118385613af0565b612c1b9190613b0f565b90506000670de0b6b3a7640000612c328480613af0565b612c3c9190613b0f565b670de0b6b3a7640000612c4f8680613af0565b612c599190613b0f565b612c639190613b7b565b9050670de0b6b3a7640000612c788284613af0565b612c829190613b0f565b945050505050611021565b612c978284613af0565b9050611021565b600a544290600090612cb09083613ad9565b9050600081118015612cc157508315155b8015612ccc57508215155b15612d1357612cdb8185613af0565b600b6000828254612cec9190613b7b565b90915550612cfc90508184613af0565b600c6000828254612d0d9190613b7b565b90915550505b6000612d1d611a03565b8051909150612d2c9084613ad9565b9150610708821115612de15760408051606081018252848152600b5460208201908152600c549282019283526007805460018101825560009190915291517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688600390930292830155517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68982015590517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a909101555b60088790556009869055600a83905560408051888152602081018890527fcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a910160405180910390a150505050505050565b60007f0000000000000000000000000000000000000000000000000000000000000000156130b5576000612e668484612b52565b90507f0000000000000000000000000000000000000000000000000000000000000000612e9b85670de0b6b3a7640000613af0565b612ea59190613b0f565b93507f0000000000000000000000000000000000000000000000000000000000000000612eda84670de0b6b3a7640000613af0565b612ee49190613b0f565b92506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b031614612f29578486612f2c565b85855b915091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b031614612fab577f0000000000000000000000000000000000000000000000000000000000000000612f9c89670de0b6b3a7640000613af0565b612fa69190613b0f565b612fe8565b7f0000000000000000000000000000000000000000000000000000000000000000612fde89670de0b6b3a7640000613af0565b612fe89190613b0f565b97506000613000612ff9848b613b7b565b85846134eb565b61300a9083613ad9565b9050670de0b6b3a76400007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316896001600160a01b031614613074577f0000000000000000000000000000000000000000000000000000000000000000613096565b7f00000000000000000000000000000000000000000000000000000000000000005b6130a09083613af0565b6130aa9190613b0f565b94505050505061121b565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b0316146130f85783856130fb565b84845b909250905061310a8783613b7b565b6131148289613af0565b61311e9190613b0f565b9250505061121b565b6131308361338b565b6131398261338b565b6001600160a01b03831660009081526004602052604081208054839290613161908490613ad9565b90915550506001600160a01b0382166000908152600460205260408120805483929061318e908490613b7b565b92505081905550816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516131da91815260200190565b60405180910390a3505050565b600060038211156132485750806000613201600283613b0f565b61320c906001613b7b565b90505b81811015613242579050806002816132278186613b0f565b6132319190613b7b565b61323b9190613b0f565b905061320f565b50919050565b8115613252575060015b919050565b6132608261338b565b80600260008282546132729190613b7b565b90915550506001600160a01b0382166000908152600460205260408120805483929061329f908490613b7b565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a35050565b60008183106132f95781611354565b5090919050565b6133098261338b565b806002600082825461331b9190613ad9565b90915550506001600160a01b03821660009081526004602052604081208054839290613348908490613ad9565b90915550506040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016132de565b6001600160a01b03811660009081526004602052604090205480156134b9576001600160a01b0382166000908152600f60209081526040808320805460108085529285208054600d54600e549481905594909552829055936133ed8584613ad9565b905060006133fb8584613ad9565b90508115613456576000670de0b6b3a7640000613418848a613af0565b6134229190613b0f565b6001600160a01b038a1660009081526011602052604081208054929350839290919061344f908490613b7b565b9091555050505b80156134af576000670de0b6b3a7640000613471838a613af0565b61347b9190613b0f565b6001600160a01b038a166000908152601260205260408120805492935083929091906134a8908490613b7b565b9091555050505b5050505050505050565b600d546001600160a01b0383166000908152600f6020908152604080832093909355600e546010909152919020555050565b6000805b60ff8110156135f15782600061350587836135fa565b90508581101561355557600061351b8887613697565b6135258389613ad9565b61353790670de0b6b3a7640000613af0565b6135419190613b0f565b905061354d8187613b7b565b955050613597565b60006135618887613697565b61356b8884613ad9565b61357d90670de0b6b3a7640000613af0565b6135879190613b0f565b90506135938187613ad9565b9550505b818511156135c05760016135ab8387613ad9565b116135bb57849350505050611354565b6135dc565b60016135cc8684613ad9565b116135dc57849350505050611354565b505080806135e990613ba9565b9150506134ef565b50909392505050565b6000670de0b6b3a7640000828185816136138280613af0565b61361d9190613b0f565b6136279190613af0565b6136319190613b0f565b61363b9190613af0565b6136459190613b0f565b670de0b6b3a764000080848161365b8280613af0565b6136659190613b0f565b61366f9190613af0565b6136799190613b0f565b6136839086613af0565b61368d9190613b0f565b6113549190613b7b565b6000670de0b6b3a764000083816136ae8280613af0565b6136b89190613b0f565b6136c29190613af0565b6136cc9190613b0f565b670de0b6b3a7640000806136e08580613af0565b6136ea9190613b0f565b6136f5866003613af0565b6136839190613af0565b6001600160a01b038116811461371457600080fd5b50565b60008060008060006080868803121561372f57600080fd5b85359450602086013593506040860135613748816136ff565b9250606086013567ffffffffffffffff8082111561376557600080fd5b818801915088601f83011261377957600080fd5b81358181111561378857600080fd5b89602082850101111561379a57600080fd5b9699959850939650602001949392505050565b60005b838110156137c85781810151838201526020016137b0565b838111156137d7576000848401525b50505050565b60208152600082518060208401526137fc8160408501602087016137ad565b601f01601f19169190910160400192915050565b6000806040838503121561382357600080fd5b823561382e816136ff565b946020939093013593505050565b6000806000806080858703121561385257600080fd5b843561385d816136ff565b966020860135965060408601359560600135945092505050565b6020808252825182820181905260009190848201906040850190845b818110156138af57835183529284019291840191600101613893565b50909695505050505050565b6000602082840312156138cd57600080fd5b8135611354816136ff565b6000806000606084860312156138ed57600080fd5b83356138f8816136ff565b92506020840135613908816136ff565b929592945050506040919091013590565b60006020828403121561392b57600080fd5b5035919050565b60008060006060848603121561394757600080fd5b8335613952816136ff565b95602085013595506040909401359392505050565b600080600080600080600060e0888a03121561398257600080fd5b873561398d816136ff565b9650602088013561399d816136ff565b95506040880135945060608801359350608088013560ff811681146139c157600080fd5b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156139f157600080fd5b82356139fc816136ff565b91506020830135613a0c816136ff565b809150509250929050565b60008060408385031215613a2a57600080fd5b823591506020830135613a0c816136ff565b600060208284031215613a4e57600080fd5b8151801515811461135457600080fd5b60018060a01b038616815284602082015283604082015260806060820152816080820152818360a0830137600081830160a090810191909152601f909201601f19160101949350505050565b600060208284031215613abc57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082821015613aeb57613aeb613ac3565b500390565b6000816000190483118215151615613b0a57613b0a613ac3565b500290565b600082613b2c57634e487b7160e01b600052601260045260246000fd5b500490565b600181811c90821680613b4557607f821691505b60208210810361324257634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60008219821115613b8e57613b8e613ac3565b500190565b634e487b7160e01b600052603260045260246000fd5b600060018201613bbb57613bbb613ac3565b5060010190565b600080835481600182811c915080831680613bde57607f831692505b60208084108203613bfd57634e487b7160e01b86526022600452602486fd5b818015613c115760018114613c2257613c4f565b60ff19861689528489019650613c4f565b60008a81526020902060005b86811015613c475781548b820152908501908301613c2e565b505084890196505b509498975050505050505050565b600060208284031215613c6f57600080fd5b8151611354816136ff565b60008251613c8c8184602087016137ad565b919091019291505056fea2646970667358221220c75056062a4c8f43c9a06e22a6e6664823a5d5655a394872a20b39ca7889b58864736f6c634300080d003360e060405234801561001057600080fd5b506040516105c53803806105c583398101604081905261002f91610066565b336080526001600160a01b0391821660a0521660c052610099565b80516001600160a01b038116811461006157600080fd5b919050565b6000806040838503121561007957600080fd5b6100828361004a565b91506100906020840161004a565b90509250929050565b60805160a05160c0516104e36100e26000396000818161012c015261026001526000818160fb015261022601526000818160c60152818161016201526101ef01526104e36000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063533cf5ce1461005c5780635b3c924814610071578063651d83f91461008c5780638d4dabff14610095578063f8518b89146100a8575b600080fd5b61006f61006a36600461039c565b6100bb565b005b61007a60015481565b60405190815260200160405180910390f35b61007a60005481565b61006f6100a33660046103dd565b610157565b61006f6100b636600461040d565b6101e4565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146100f057600080fd5b8115610121576101217f00000000000000000000000000000000000000000000000000000000000000008484610291565b8015610152576101527f00000000000000000000000000000000000000000000000000000000000000008483610291565b505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461018c57600080fd5b6000821180156101995750805b156101b557816000808282546101af919061042f565b90915550505b6000821180156101c3575080155b156101e05781600160008282546101da919061042f565b90915550505b5050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461021957600080fd5b600054156102535761024e7f000000000000000000000000000000000000000000000000000000000000000082600054610291565b600080555b6001541561028e576102887f000000000000000000000000000000000000000000000000000000000000000082600154610291565b60006001555b50565b6000836001600160a01b03163b116102a857600080fd5b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916103049190610455565b6000604051808303816000865af19150503d8060008114610341576040519150601f19603f3d011682016040523d82523d6000602084013e610346565b606091505b50915091508180156103705750805115806103705750808060200190518101906103709190610490565b61037957600080fd5b5050505050565b80356001600160a01b038116811461039757600080fd5b919050565b6000806000606084860312156103b157600080fd5b6103ba84610380565b95602085013595506040909401359392505050565b801515811461028e57600080fd5b600080604083850312156103f057600080fd5b823591506020830135610402816103cf565b809150509250929050565b60006020828403121561041f57600080fd5b61042882610380565b9392505050565b6000821982111561045057634e487b7160e01b600052601160045260246000fd5b500190565b6000825160005b81811015610476576020818601810151858301520161045c565b81811115610485576000828501525b509190910192915050565b6000602082840312156104a257600080fd5b8151610428816103cf56fea2646970667358221220bc7b7ba3ed402e2260b246b969b2950543e1b823ed680664b9cd4f6bee8131dd64736f6c634300080d0033a2646970667358221220c856f6404b5819c3212050e394c73858e206a2b136bf86b5fd54682cff65c70864736f6c634300080d0033

Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.