ETH Price: $3,504.90 (-0.13%)
Gas: 2 Gwei

Contract

0xF55f8b3C7d75A84C3D88148A22F6dC61D162719B
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60a06040200008922024-06-02 1:35:3549 days ago1717292135IN
 Create: IDOService
0 ETH0.022252364.59882254

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
IDOService

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
paris EvmVersion
File 1 of 24 : IDO.service.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
import "@openzeppelin-upgradeable/contracts/utils/ReentrancyGuardUpgradeable.sol";
import "../../common/Base.sol";

contract IDOService is ReentrancyGuardUpgradeable, Base {
    using ECDSA for bytes32;
    using MessageHashUtils for bytes32;
    using SafeERC20 for IERC20;

    struct ClaimCondition {
        string name;
        uint8 claimType; // 0 whitelist, 1 public
        uint64 start;
        uint64 end;
        uint256 quantity;
        address[] currencies;
        uint256 price;
        uint256 minAmount;
        uint256 maxAmount;
        uint256 maxPerWallet;
        bytes32 allocationProof;
    }

    struct PhaseCondition {
        bool removed;
        ClaimCondition claimCondition;
        uint32 totalParticipants;
        // mapping(user => nClaimed)
        mapping(address => uint256) nSpent;
        uint256 totalSpent;
        uint256[] sharedSpentPhases;
    }

    struct Investment {
        uint256 amount;
        uint256 nClaimed;
    }

    address public tokenAddress;
    address public saleRecipient;

    uint32 public kickoffPhase;
    uint32 public totalParticipants;
    uint64 public start;
    uint64 public end;
    uint256 public totalSpent;
    uint256 public totalQuantity;

    PhaseCondition[] private phasesConditions;

    mapping(address => Investment) investments;

    function __IDOService_init(
        address _tokenAddress,
        address _saleRecipient
    ) internal {
        tokenAddress = _tokenAddress;
        saleRecipient = _saleRecipient;
    }

    function initialize(
        address _registry, //
        address _deployer,
        string memory _name,
        address _tokenAddress,
        address _saleRecipient
    ) public initializer {
        _registry = 0xBF6aBDAC184653CF01f64F1C46F22482F8e717eA;
        __ReentrancyGuard_init();
        __Base_init(_registry);
        __IDOService_init(_tokenAddress, _saleRecipient);

        _transferOwnership(_deployer);

        getEmitter().fireEvent(
            keccak256("ProjectCreated"),
            // (string,address,address)
            abi.encode(_name, _tokenAddress, _saleRecipient)
        );
    }

    /* View */
    // verified
    function getPhaseCondition(
        uint256 _phaseIdx
    ) public view returns (ClaimCondition memory claimCondition) {
        PhaseCondition storage phase = phasesConditions[_phaseIdx];
        return phase.claimCondition;
    }

    // verified
    function getPhaseConditionSpent(
        uint256 _phaseIdx,
        address _user
    ) public view returns (uint256 spent) {
        PhaseCondition storage phase = phasesConditions[_phaseIdx];
        return phase.nSpent[_user];
    }

    function getTotalSpentByAccount(
        address _user
    ) public view returns (uint256 spent) {
        uint256 _totalSpent;
        for (uint256 i = 0; i < phasesConditions.length; i++) {
            _totalSpent += phasesConditions[i].nSpent[_user];
        }

        return _totalSpent;
    }

    function getTotalPhasesSpent(
        uint256[] memory _phaseIdxs
    ) public view returns (uint256 spent) {
        uint256 _totalSpent;
        for (uint256 i = 0; i < _phaseIdxs.length; i++) {
            _totalSpent += phasesConditions[_phaseIdxs[i]].totalSpent;
        }

        return _totalSpent;
    }

    // verified
    function getPhaseTotalSpent(
        uint256 _phaseIdx
    ) public view returns (uint256 spent) {
        PhaseCondition storage phase = phasesConditions[_phaseIdx];
        return phase.totalSpent;
    }

    function getTotalSpentByProject() public view returns (uint256 spent) {
        uint256 _totalSpent;
        for (uint256 i = 0; i < phasesConditions.length; i++) {
            _totalSpent += phasesConditions[i].totalSpent;
        }

        return _totalSpent;
    }

    /* User */
    function claim() external {
        address operator = msg.sender;
        require(block.timestamp > end, "Not ended");
        require(
            investments[operator].amount > investments[operator].nClaimed,
            "No investment"
        );
        require(tokenAddress != address(0), "Not supported");

        uint256 claimable = investments[operator].amount -
            investments[operator].nClaimed;

        investments[operator].nClaimed = investments[operator].amount;

        IERC20(tokenAddress).safeTransfer(operator, claimable);

        getEmitter().fireEvent(
            keccak256("TokenClaimed"),
            // (address,uint256)
            abi.encode(operator, investments[operator].nClaimed)
        );
    }

    function investTo(
        address _account,
        uint256 _phaseId,
        address _currency,
        uint256 _currencyAmount,
        uint256 _maxAmount,
        bytes memory _data
    ) external payable {
        _invest(
            msg.sender,
            _account,
            _phaseId,
            _currency,
            _currencyAmount,
            _maxAmount,
            _data
        );
    }

    // verified
    function invest(
        uint256 _phaseId,
        address _currency,
        uint256 _currencyAmount,
        uint256 _maxAmount,
        bytes memory _data
    ) external payable {
        _invest(
            msg.sender,
            msg.sender,
            _phaseId,
            _currency,
            _currencyAmount,
            _maxAmount,
            _data
        );
    }

    // verified
    function _invest(
        address _operator,
        address _account,
        uint256 _phaseId,
        address _currency,
        uint256 _currencyAmount,
        uint256 _maxAmount,
        bytes memory _data
    ) internal nonReentrant {
        require(_phaseId < phasesConditions.length, "Invalid phase");
        require(_currencyAmount > 0, "Invalid amount");
        require(!phasesConditions[_phaseId].removed, "Phase removed");

        _processFee(
            _operator,
            _currency,
            _currencyAmount
        );

        uint256 _amount = _currencyAmount / phasesConditions[_phaseId].claimCondition.price;

        if (phasesConditions[_phaseId].claimCondition.claimType == 0) {
            return
                _whitelistMint(
                    _operator,
                    _account,
                    _phaseId,
                    _currency,
                    _amount,
                    _maxAmount,
                    _data
                );
        }

        return
            _publicMint(
                _operator,
                _account,
                _phaseId,
                _currency,
                _amount,
                _maxAmount,
                _data
            );
    }

    // verified
    function _whitelistMint(
        address _operator,
        address _user,
        uint256 _phaseId,
        address _currency,
        uint256 _amount,
        uint256 _maxAmount,
        bytes memory _signature
    ) internal {
        require(
            getPhaseConditionSpent(_phaseId, _operator) + _amount <= _maxAmount,
            "Exceeds max amount"
        );
        _verifyCondition(_phaseId, _operator, _user, _currency, _amount);

        bytes32 message = keccak256(
            abi.encode(
                block.chainid,
                address(this),
                _phaseId,
                _operator,
                _maxAmount,
                phasesConditions[_phaseId].claimCondition.allocationProof
            )
        );
        _signatureVerification(message, _signature);
    }

    // verified
    function _publicMint(
        address _operator,
        address _user,
        uint256 _phaseId,
        address _currency,
        uint256 _amount,
        uint256,
        bytes memory
    ) internal {
        _verifyCondition(_phaseId, _operator, _user, _currency, _amount);
    }

    // verified
    function _verifyCondition(
        uint256 _phaseId,
        address _operator,
        address _user,
        address _currency,
        uint256 _amount
    ) internal {
        {
            ClaimCondition memory claimCondition = getPhaseCondition(_phaseId);

            require(totalSpent + _amount <= totalQuantity, "Exceeds max");

            require(
                getTotalPhasesSpent(
                    phasesConditions[_phaseId].sharedSpentPhases
                ) +
                    _amount <=
                    claimCondition.quantity,
                "Exceeds max phase"
            );

            for (uint256 i = 0; i < claimCondition.currencies.length; i++) {
                if (claimCondition.currencies[i] == _currency) {
                    break;
                }
                require(
                    i < claimCondition.currencies.length,
                    "Invalid currency"
                );
            }

            require(
                getPhaseConditionSpent(_phaseId, _operator) + _amount <=
                    claimCondition.maxPerWallet,
                "Exceeds max per wallet"
            );
            if (_currency == address(0)) {
                require(
                    _amount * claimCondition.price <= msg.value,
                    "Invalid price"
                );
            }
            require(
                _amount >= claimCondition.minAmount &&
                    _amount <= claimCondition.maxAmount,
                "Invalid amount"
            );
            require(block.timestamp >= claimCondition.start, "Not started");
            require(block.timestamp <= claimCondition.end, "Ended");
        }

        {
            if (phasesConditions[_phaseId].nSpent[_operator] == 0) {
                phasesConditions[_phaseId].totalParticipants += 1;
            }

            if (investments[_user].amount == 0) {
                totalParticipants += 1;
            }

            // update spent
            phasesConditions[_phaseId].nSpent[_operator] += _amount;
            phasesConditions[_phaseId].totalSpent += _amount;

            // update invesment
            investments[_user].amount += _amount;
            totalSpent += _amount;

            getEmitter().fireEvent(
                keccak256("PhaseTokenInvested"),
                // (uint256,address,uint256,address,uint256,uint256,uint256,uint32,uint32)
                abi.encode(
                    _phaseId,
                    _operator,
                    phasesConditions[_phaseId].nSpent[_operator],
                    _user,
                    investments[_user].amount,
                    phasesConditions[_phaseId].totalSpent,
                    totalSpent,
                    phasesConditions[_phaseId].totalParticipants,
                    totalParticipants
                )
            );
        }
    }

    // verified
    function _processFee(
        address _user,
        address _currency,
        uint256 _value
    ) internal {
        if (_value == 0) {
            return;
        }
        (uint256 fee, uint256 received) = IRegistry(registry).getFeeAmount(
            _value
        );
        if (_currency == address(0)) {
            return _processNativeToken(fee);
        }
        return _processERC20(_user, _currency, fee, received);
    }

    // verified
    function _processNativeToken(uint256 _fee) internal {
        (bool success, ) = IRegistry(registry).getPlatformFeeReceiver().call{
            value: _fee
        }("");
        require(success, "Transfer failed");
    }

    function _processERC20(
        address _user,
        address _currency,
        uint256 _fee,
        uint256 _receive
    ) internal {
        address feeReceiver = IRegistry(registry).getPlatformFeeReceiver();
        IERC20(_currency).safeTransferFrom(_user, feeReceiver, _fee);
        IERC20(_currency).safeTransferFrom(_user, address(this), _receive);
    }

    function withdrawOriginalToken() external onlyOwner nonReentrant {
        require(block.timestamp > end, "Not ended");
        require(kickoffPhase == phasesConditions.length, "Not finished");
        require(tokenAddress != address(0), "Not supported");
        require(totalQuantity > totalSpent, "No remaining token");

        uint256 remainingAmount = totalQuantity - totalSpent;

        IERC20(tokenAddress).safeTransfer(msg.sender, remainingAmount);
    }

    // verified
    function withdraw(
        address _currency,
        uint256 _amount
    ) external nonReentrant {
        require(kickoffPhase == phasesConditions.length, "Not finished");
        require(block.timestamp > end, "Not ended");
        if (tokenAddress != address(0)) {
            require(_currency != tokenAddress, "Invalid currency");
        }
        require(
            msg.sender == owner() || msg.sender == saleRecipient,
            "Not allowed"
        );
        if (_currency == address(0)) {
            return _withdrawNativeToken(_amount);
        }
        return _withdrawERC20(_currency, _amount);
    }

    // verified
    function _withdrawNativeToken(uint256 _amount) internal {
        (bool success, ) = saleRecipient.call{value: _amount}("");
        require(success, "Transfer failed");
    }

    function _withdrawERC20(address _currency, uint256 _amount) internal {
        IERC20(_currency).safeTransfer(saleRecipient, _amount);
    }

    /* Admin */
    function kickoff(uint256 _totalQuantity) external onlyOwner nonReentrant {
        require(_totalQuantity > 0, "Invalid total quantity");
        require(_totalQuantity >= totalQuantity, "Invalid total quantity");

        kickoffPhase = uint32(phasesConditions.length);

        uint256 remainingQuantity = _totalQuantity - totalQuantity;

        totalQuantity = _totalQuantity;

        if (tokenAddress != address(0)) {
            IERC20(tokenAddress).safeTransferFrom(
                msg.sender,
                address(this),
                remainingQuantity
            );
        }

        getEmitter().fireEvent(
            keccak256("ProjectStarted"),
            // (uint32,uint256,uint64,uint64)
            abi.encode(kickoffPhase, totalQuantity, start, end)
        );
    }

    /// Token
    // verified
    function setPhaseCondition(
        bytes memory _configs,
        bytes memory _signature
    ) external onlyOwner nonReentrant {
        uint256 phaseId = phasesConditions.length;
        phasesConditions.push();

        _modifyPhaseCondition(phaseId, _configs, _signature);

        getEmitter().fireEvent(
            keccak256("PhaseConditionCreated"),
            // (uint256,ClaimCondition)
            abi.encode(phaseId, phasesConditions[phaseId].claimCondition)
        );
    }

    // verified
    function updatePhaseCondition(
        uint256 _phaseId,
        bytes memory _configs,
        bytes memory _signature
    ) external onlyOwner nonReentrant {
        require(kickoffPhase <= _phaseId, "Already started");
        require(_phaseId < phasesConditions.length, "Invalid phase id");

        _modifyPhaseCondition(_phaseId, _configs, _signature);

        getEmitter().fireEvent(
            keccak256("PhaseConditionUpdated"),
            // (uint256,address)
            abi.encode(_phaseId, phasesConditions[_phaseId].claimCondition)
        );
    }

    // verified
    function _generateClaimCondition(
        bytes memory _configs
    )
        internal
        view
        returns (
            ClaimCondition memory claimCondition,
            uint256[] memory sharedSpentPhases
        )
    {
        (claimCondition, sharedSpentPhases) = abi.decode(
            _configs,
            (ClaimCondition, uint256[])
        );
        for (uint256 i = 0; i < claimCondition.currencies.length; i++) {
            require(
                IRegistry(registry).isSupportedCurrency(
                    claimCondition.currencies[i]
                ),
                "Unsupported currency"
            );
        }
        require(
            claimCondition.claimType == 0 || claimCondition.claimType == 1,
            "Invalid claim type"
        );
        require(claimCondition.start >= block.timestamp, "Invalid start time");
        require(claimCondition.end > block.timestamp, "Invalid end time");
        require(
            claimCondition.end > claimCondition.start,
            "Invalid time range"
        );
        require(
            claimCondition.maxAmount >= claimCondition.minAmount &&
                claimCondition.minAmount > 0,
            "Invalid amount range"
        );
    }

    // verified
    function _modifyPhaseCondition(
        uint256 _phaseId,
        bytes memory _configs,
        bytes memory _signature
    ) internal {
        bytes32 configHash = keccak256(_configs);
        bytes32 hashedMessage = keccak256(
            abi.encode(block.chainid, address(this), configHash)
        );
        _signatureVerification(hashedMessage, _signature);

        (
            ClaimCondition memory _claimCondition,
            uint256[] memory sharedSpentPhases
        ) = _generateClaimCondition(_configs);
        phasesConditions[_phaseId].claimCondition = _claimCondition;
        phasesConditions[_phaseId].sharedSpentPhases = sharedSpentPhases;

        if (start == 0 || start > _claimCondition.start) {
            start = _claimCondition.start;
        }

        if (end == 0 || end < _claimCondition.end) {
            end = _claimCondition.end;
        }
    }

    function deletePhaseCondition(uint256 _phaseId) external onlyOwner {
        require(kickoffPhase <= _phaseId, "Already started");
        require(_phaseId < phasesConditions.length, "Invalid phase id");
        require(!phasesConditions[_phaseId].removed, "Already removed");
        phasesConditions[_phaseId].removed = true;

        getEmitter().fireEvent(
            keccak256("PhaseConditionDeleted"),
            // (uint256)
            abi.encode(_phaseId)
        );
    }

    function _signatureVerification(
        bytes32 _messageHashed,
        bytes memory _signature
    ) internal view returns (address) {
        address signer = _messageHashed.toEthSignedMessageHash().recover(
            _signature
        );
        require(
            signer == IRegistry(registry).getVerifier(),
            "Invalid signature"
        );
        return signer;
    }
}

File 2 of 24 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

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

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

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

File 3 of 24 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

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

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

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

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}

File 4 of 24 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.20;

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS
    }

    /**
     * @dev The signature derives the `address(0)`.
     */
    error ECDSAInvalidSignature();

    /**
     * @dev The signature has an invalid length.
     */
    error ECDSAInvalidSignatureLength(uint256 length);

    /**
     * @dev The signature has an S value that is in the upper half order.
     */
    error ECDSAInvalidSignatureS(bytes32 s);

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not
     * return address(0) without also returning an error description. Errors are documented using an enum (error type)
     * and a bytes32 providing additional information about the error.
     *
     * If no error is returned, then the address can be used for verification purposes.
     *
     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);
        _throwError(error, errorArg);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     */
    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) {
        unchecked {
            bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
            // We do not check for an overflow here since the shift operation results in 0 or 1.
            uint8 v = uint8((uint256(vs) >> 255) + 27);
            return tryRecover(hash, v, r, s);
        }
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     */
    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);
        _throwError(error, errorArg);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError, bytes32) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS, s);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature, bytes32(0));
        }

        return (signer, RecoverError.NoError, bytes32(0));
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);
        _throwError(error, errorArg);
        return recovered;
    }

    /**
     * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.
     */
    function _throwError(RecoverError error, bytes32 errorArg) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert ECDSAInvalidSignature();
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert ECDSAInvalidSignatureLength(uint256(errorArg));
        } else if (error == RecoverError.InvalidSignatureS) {
            revert ECDSAInvalidSignatureS(errorArg);
        }
    }
}

File 5 of 24 : MessageHashUtils.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MessageHashUtils.sol)

pragma solidity ^0.8.20;

import {Strings} from "../Strings.sol";

/**
 * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.
 *
 * The library provides methods for generating a hash of a message that conforms to the
 * https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
 * specifications.
 */
library MessageHashUtils {
    /**
     * @dev Returns the keccak256 digest of an EIP-191 signed data with version
     * `0x45` (`personal_sign` messages).
     *
     * The digest is calculated by prefixing a bytes32 `messageHash` with
     * `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the
     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
     *
     * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with
     * keccak256, although any bytes32 value can be safely used because the final digest will
     * be re-hashed.
     *
     * See {ECDSA-recover}.
     */
    function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash
            mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix
            digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)
        }
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-191 signed data with version
     * `0x45` (`personal_sign` messages).
     *
     * The digest is calculated by prefixing an arbitrary `message` with
     * `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the
     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
     *
     * See {ECDSA-recover}.
     */
    function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {
        return
            keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-191 signed data with version
     * `0x00` (data with intended validator).
     *
     * The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended
     * `validator` address. Then hashing the result.
     *
     * See {ECDSA-recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(hex"19_00", validator, data));
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`).
     *
     * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with
     * `\x19\x01` and hashing the result. It corresponds to the hash signed by the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.
     *
     * See {ECDSA-recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, hex"19_01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            digest := keccak256(ptr, 0x42)
        }
    }
}

File 6 of 24 : ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;
import {Initializable} from "../proxy/utils/Initializable.sol";

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

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

    /// @custom:storage-location erc7201:openzeppelin.storage.ReentrancyGuard
    struct ReentrancyGuardStorage {
        uint256 _status;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ReentrancyGuard")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant ReentrancyGuardStorageLocation = 0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00;

    function _getReentrancyGuardStorage() private pure returns (ReentrancyGuardStorage storage $) {
        assembly {
            $.slot := ReentrancyGuardStorageLocation
        }
    }

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

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

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
        $._status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if ($._status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        $._status = ENTERED;
    }

    function _nonReentrantAfter() private {
        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        $._status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
        return $._status == ENTERED;
    }
}

File 7 of 24 : Base.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import "@openzeppelin-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin-upgradeable/contracts/access/OwnableUpgradeable.sol";
import "./Constants.sol";
import "../interfaces/IRegistry.sol";
import "../interfaces/IAccessControl.sol";
import "../interfaces/IEmitter.sol";

abstract contract Base is Initializable, UUPSUpgradeable, OwnableUpgradeable {
    error InvalidSender(address sender);
    error InvalidRegistry(address registry);
    error InvalidUpgrader(address upgrader);

    address public registry;

    modifier onlyRole(bytes4 _selector) {
        if (_msgSender() == owner()) {
            _;
            return;
        }

        address accessControl = IRegistry(registry).getLatestServiceInstace(
            Constants.ACCESS_CONTROL_ID
        );

        if (
            !IAccessControl(accessControl).hasRole(
                _msgSender(),
                address(this),
                _selector
            )
        ) {
            revert InvalidSender(_msgSender());
        }

        _;
    }

    function __Base_init(address _registry) internal {
        __Ownable_init(msg.sender);
        registry = _registry;
    }

    function _authorizeUpgrade(address) internal view virtual override {
        if (
            IRegistry(registry).getLatestServiceInstace(
                Constants.UPGRADER_ID
            ) != msg.sender
        ) {
            revert InvalidUpgrader(msg.sender);
        }
    }

    function setRegistry(address _registry) public {
        if (
            IRegistry(registry).getLatestServiceInstace(
                Constants.UPGRADER_ID
            ) != msg.sender
        ) {
            revert InvalidUpgrader(msg.sender);
        }
        if (_registry == address(0)) {
            revert InvalidRegistry(_registry);
        }
        registry = _registry;
    }

    function getEmitter() public view returns (IEmitter) {
        return
            IEmitter(
                IRegistry(registry).getLatestServiceInstace(
                    Constants.EVENT_EMITTER_ID
                )
            );
    }

    uint256[50] private __gap;
}

File 8 of 24 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

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

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

File 9 of 24 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

    /**
     * @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://consensys.net/diligence/blog/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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert AddressInsufficientBalance(address(this));
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @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 or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * 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.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @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`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) 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 FailedInnerCall();
        }
    }
}

File 10 of 24 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)

pragma solidity ^0.8.20;

import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant HEX_DIGITS = "0123456789abcdef";
    uint8 private constant ADDRESS_LENGTH = 20;

    /**
     * @dev The `value` string doesn't fit in the specified `length`.
     */
    error StringsInsufficientHexLength(uint256 value, uint256 length);

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toStringSigned(int256 value) internal pure returns (string memory) {
        return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        uint256 localValue = value;
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = HEX_DIGITS[localValue & 0xf];
            localValue >>= 4;
        }
        if (localValue != 0) {
            revert StringsInsufficientHexLength(value, length);
        }
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
     * representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 11 of 24 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.20;

/**
 * @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]
 * ```solidity
 * 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 Storage of the initializable contract.
     *
     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
     * when using with upgradeable contracts.
     *
     * @custom:storage-location erc7201:openzeppelin.storage.Initializable
     */
    struct InitializableStorage {
        /**
         * @dev Indicates that the contract has been initialized.
         */
        uint64 _initialized;
        /**
         * @dev Indicates that the contract is in the process of being initialized.
         */
        bool _initializing;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;

    /**
     * @dev The contract is already initialized.
     */
    error InvalidInitialization();

    /**
     * @dev The contract is not initializing.
     */
    error NotInitializing();

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint64 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 in the context of a constructor an `initializer` may be invoked any
     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
     * production.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        // Cache values to avoid duplicated sloads
        bool isTopLevelCall = !$._initializing;
        uint64 initialized = $._initialized;

        // Allowed calls:
        // - initialSetup: the contract is not in the initializing state and no previous version was
        //                 initialized
        // - construction: the contract is initialized at version 1 (no reininitialization) and the
        //                 current contract is just being deployed
        bool initialSetup = initialized == 0 && isTopLevelCall;
        bool construction = initialized == 1 && address(this).code.length == 0;

        if (!initialSetup && !construction) {
            revert InvalidInitialization();
        }
        $._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 2**64 - 1 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint64 version) {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing || $._initialized >= version) {
            revert InvalidInitialization();
        }
        $._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() {
        _checkInitializing();
        _;
    }

    /**
     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
     */
    function _checkInitializing() internal view virtual {
        if (!_isInitializing()) {
            revert NotInitializing();
        }
    }

    /**
     * @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 {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing) {
            revert InvalidInitialization();
        }
        if ($._initialized != type(uint64).max) {
            $._initialized = type(uint64).max;
            emit Initialized(type(uint64).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint64) {
        return _getInitializableStorage()._initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _getInitializableStorage()._initializing;
    }

    /**
     * @dev Returns a pointer to the storage namespace.
     */
    // solhint-disable-next-line var-name-mixedcase
    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
        assembly {
            $.slot := INITIALIZABLE_STORAGE
        }
    }
}

File 12 of 24 : UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.20;

import {IERC1822Proxiable} from "@openzeppelin/contracts/interfaces/draft-IERC1822.sol";
import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol";
import {Initializable} from "./Initializable.sol";

/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 */
abstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable {
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    address private immutable __self = address(this);

    /**
     * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`
     * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,
     * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.
     * If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must
     * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function
     * during an upgrade.
     */
    string public constant UPGRADE_INTERFACE_VERSION = "5.0.0";

    /**
     * @dev The call is from an unauthorized context.
     */
    error UUPSUnauthorizedCallContext();

    /**
     * @dev The storage `slot` is unsupported as a UUID.
     */
    error UUPSUnsupportedProxiableUUID(bytes32 slot);

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        _checkProxy();
        _;
    }

    /**
     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be
     * callable on the implementing contract but not through proxies.
     */
    modifier notDelegated() {
        _checkNotDelegated();
        _;
    }

    function __UUPSUpgradeable_init() internal onlyInitializing {
    }

    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
     */
    function proxiableUUID() external view virtual notDelegated returns (bytes32) {
        return ERC1967Utils.IMPLEMENTATION_SLOT;
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     *
     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, data);
    }

    /**
     * @dev Reverts if the execution is not performed via delegatecall or the execution
     * context is not of a proxy with an ERC1967-compliant implementation pointing to self.
     * See {_onlyProxy}.
     */
    function _checkProxy() internal view virtual {
        if (
            address(this) == __self || // Must be called through delegatecall
            ERC1967Utils.getImplementation() != __self // Must be called through an active proxy
        ) {
            revert UUPSUnauthorizedCallContext();
        }
    }

    /**
     * @dev Reverts if the execution is performed via delegatecall.
     * See {notDelegated}.
     */
    function _checkNotDelegated() internal view virtual {
        if (address(this) != __self) {
            // Must not be called through delegatecall
            revert UUPSUnauthorizedCallContext();
        }
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;

    /**
     * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.
     *
     * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value
     * is expected to be the implementation slot in ERC1967.
     *
     * Emits an {IERC1967-Upgraded} event.
     */
    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {
        try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {
            if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {
                revert UUPSUnsupportedProxiableUUID(slot);
            }
            ERC1967Utils.upgradeToAndCall(newImplementation, data);
        } catch {
            // The implementation is not UUPS
            revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);
        }
    }
}

File 13 of 24 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {Initializable} from "../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.
 *
 * The initial owner is set to the address provided by the deployer. 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 {
    /// @custom:storage-location erc7201:openzeppelin.storage.Ownable
    struct OwnableStorage {
        address _owner;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;

    function _getOwnableStorage() private pure returns (OwnableStorage storage $) {
        assembly {
            $.slot := OwnableStorageLocation
        }
    }

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

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

    function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @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) {
        OwnableStorage storage $ = _getOwnableStorage();
        return $._owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling 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 {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

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

File 14 of 24 : Constants.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

library Constants {
    enum TokenType {
        Native,
        ERC20,
        ERC721,
        ERC1155
    }

    uint256 public constant PERCENTAGE_BASE = 10000;

    // instance ids
    string public constant UPGRADER_ID = "Upgrader";
    string public constant ACCESS_CONTROL_ID = "AccessControl";
    string public constant REGISTRY_ID = "Registry";
    string public constant EVENT_EMITTER_ID = "EventEmitter";
    string public constant FACTORY_ID = "Factory";
}

File 15 of 24 : IRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

interface IRegistry {
    function getPlatformFeeReceiver() external view returns (address);

    function getVerifier() external view returns (address);

    function getPlatformFee() external view returns (uint96);

    function feeDenominator() external view returns (uint96);

    function getFeeAmount(
        uint256 amount
    ) external view returns (uint256 fee, uint256 received);

    function getRootURI() external view returns (string memory);

    function getServiceInstance(
        string calldata _id,
        uint256 _version
    ) external view returns (address);

    function getLatestServiceInstace(
        string calldata _id
    ) external view returns (address);

    function keccakString(string memory _str) external pure returns (bytes32);

    function isSupportedCurrency(
        address _currency
    ) external view returns (bool);

    function isSupportedServiceFactory(
        string memory _id
    ) external view returns (bool);
}

File 16 of 24 : IAccessControl.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

interface IAccessControl {
    function getSelector(
        string memory _methodInfo
    ) external pure returns (bytes4);

    function encodeRole(
        address _contract,
        string memory _methodInfo
    ) external pure returns (bytes32);

    function encodeRole(
        address _contract,
        bytes4 _selector
    ) external pure returns (bytes32);

    function hasRole(
        address _account,
        address _contract,
        bytes4 _selector
    ) external view returns (bool);

    function hasRole(
        address _account,
        address _contract,
        string memory _methodInfo
    ) external view returns (bool);

    function getMembersByRole(
        address _contract,
        string memory _methodInfo
    ) external view returns (address[] memory);

    function getMemberOfRoleByIndex(
        address _contract,
        string memory _methodInfo,
        uint256 _index
    ) external view returns (address);

    function getMastersByRole(
        address _contract
    ) external view returns (address[] memory);

    function getMasterOfRoleByIndex(
        address _contract,
        uint256 _index
    ) external view returns (address);

    function grantRoles(
        address _account,
        address _contract,
        bytes4[] memory _selectors
    ) external;

    function revokeRoles(
        address _account,
        address _contract,
        bytes4[] memory _selectors
    ) external;

    function grantMaster(address _account, address _contract) external;

    function revokeMaster(address _account, address _contract) external;
}

File 17 of 24 : IEmitter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import "../common/Base.sol";

interface IEmitter {
    function fireEvent(bytes32 eventType, bytes memory data) external;
}

File 18 of 24 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

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

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

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

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

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
     * denominator == 0.
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
     * Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0 = x * y; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

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

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.
            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.

            uint256 twos = denominator & (0 - denominator);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
            // works in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

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

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
     * towards zero.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
        }
    }

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

File 19 of 24 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 20 of 24 : draft-IERC1822.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC1822.sol)

pragma solidity ^0.8.20;

/**
 * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
 * proxy whose upgrades are fully controlled by the current implementation.
 */
interface IERC1822Proxiable {
    /**
     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
     * address.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy.
     */
    function proxiableUUID() external view returns (bytes32);
}

File 21 of 24 : ERC1967Utils.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Utils.sol)

pragma solidity ^0.8.20;

import {IBeacon} from "../beacon/IBeacon.sol";
import {Address} from "../../utils/Address.sol";
import {StorageSlot} from "../../utils/StorageSlot.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 */
library ERC1967Utils {
    // We re-declare ERC-1967 events here because they can't be used directly from IERC1967.
    // This will be fixed in Solidity 0.8.21. At that point we should remove these events.
    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Emitted when the beacon is changed.
     */
    event BeaconUpgraded(address indexed beacon);

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev The `implementation` of the proxy is invalid.
     */
    error ERC1967InvalidImplementation(address implementation);

    /**
     * @dev The `admin` of the proxy is invalid.
     */
    error ERC1967InvalidAdmin(address admin);

    /**
     * @dev The `beacon` of the proxy is invalid.
     */
    error ERC1967InvalidBeacon(address beacon);

    /**
     * @dev An upgrade function sees `msg.value > 0` that may be lost.
     */
    error ERC1967NonPayable();

    /**
     * @dev Returns the current implementation address.
     */
    function getImplementation() internal view returns (address) {
        return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        if (newImplementation.code.length == 0) {
            revert ERC1967InvalidImplementation(newImplementation);
        }
        StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Performs implementation upgrade with additional setup call if data is nonempty.
     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
     * to avoid stuck value in the contract.
     *
     * Emits an {IERC1967-Upgraded} event.
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);

        if (data.length > 0) {
            Address.functionDelegateCall(newImplementation, data);
        } else {
            _checkNonPayable();
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Returns the current admin.
     *
     * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using
     * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`
     */
    function getAdmin() internal view returns (address) {
        return StorageSlot.getAddressSlot(ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        if (newAdmin == address(0)) {
            revert ERC1967InvalidAdmin(address(0));
        }
        StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {IERC1967-AdminChanged} event.
     */
    function changeAdmin(address newAdmin) internal {
        emit AdminChanged(getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1.
     */
    // solhint-disable-next-line private-vars-leading-underscore
    bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Returns the current beacon.
     */
    function getBeacon() internal view returns (address) {
        return StorageSlot.getAddressSlot(BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        if (newBeacon.code.length == 0) {
            revert ERC1967InvalidBeacon(newBeacon);
        }

        StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;

        address beaconImplementation = IBeacon(newBeacon).implementation();
        if (beaconImplementation.code.length == 0) {
            revert ERC1967InvalidImplementation(beaconImplementation);
        }
    }

    /**
     * @dev Change the beacon and trigger a setup call if data is nonempty.
     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
     * to avoid stuck value in the contract.
     *
     * Emits an {IERC1967-BeaconUpgraded} event.
     *
     * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since
     * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for
     * efficiency.
     */
    function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);

        if (data.length > 0) {
            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
        } else {
            _checkNonPayable();
        }
    }

    /**
     * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract
     * if an upgrade doesn't perform an initialization call.
     */
    function _checkNonPayable() private {
        if (msg.value > 0) {
            revert ERC1967NonPayable();
        }
    }
}

File 22 of 24 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;
import {Initializable} from "../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;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 23 of 24 : IBeacon.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.20;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeacon {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {UpgradeableBeacon} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

File 24 of 24 : StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(newImplementation.code.length > 0);
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}

Settings
{
  "remappings": [
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "none",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ECDSAInvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ECDSAInvalidSignatureS","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[{"internalType":"address","name":"registry","type":"address"}],"name":"InvalidRegistry","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"upgrader","type":"address"}],"name":"InvalidUpgrader","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"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":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_phaseId","type":"uint256"}],"name":"deletePhaseCondition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"end","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getEmitter","outputs":[{"internalType":"contract IEmitter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_phaseIdx","type":"uint256"}],"name":"getPhaseCondition","outputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint8","name":"claimType","type":"uint8"},{"internalType":"uint64","name":"start","type":"uint64"},{"internalType":"uint64","name":"end","type":"uint64"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"address[]","name":"currencies","type":"address[]"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"minAmount","type":"uint256"},{"internalType":"uint256","name":"maxAmount","type":"uint256"},{"internalType":"uint256","name":"maxPerWallet","type":"uint256"},{"internalType":"bytes32","name":"allocationProof","type":"bytes32"}],"internalType":"struct IDOService.ClaimCondition","name":"claimCondition","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_phaseIdx","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"getPhaseConditionSpent","outputs":[{"internalType":"uint256","name":"spent","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_phaseIdx","type":"uint256"}],"name":"getPhaseTotalSpent","outputs":[{"internalType":"uint256","name":"spent","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_phaseIdxs","type":"uint256[]"}],"name":"getTotalPhasesSpent","outputs":[{"internalType":"uint256","name":"spent","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getTotalSpentByAccount","outputs":[{"internalType":"uint256","name":"spent","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalSpentByProject","outputs":[{"internalType":"uint256","name":"spent","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_registry","type":"address"},{"internalType":"address","name":"_deployer","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"address","name":"_saleRecipient","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_phaseId","type":"uint256"},{"internalType":"address","name":"_currency","type":"address"},{"internalType":"uint256","name":"_currencyAmount","type":"uint256"},{"internalType":"uint256","name":"_maxAmount","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"invest","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_phaseId","type":"uint256"},{"internalType":"address","name":"_currency","type":"address"},{"internalType":"uint256","name":"_currencyAmount","type":"uint256"},{"internalType":"uint256","name":"_maxAmount","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"investTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_totalQuantity","type":"uint256"}],"name":"kickoff","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"kickoffPhase","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_configs","type":"bytes"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"setPhaseCondition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_registry","type":"address"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"start","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalParticipants","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalQuantity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSpent","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":[{"internalType":"uint256","name":"_phaseId","type":"uint256"},{"internalType":"bytes","name":"_configs","type":"bytes"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"updatePhaseCondition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_currency","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawOriginalToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a060405230608052348015601357600080fd5b5060805161573461003d600039600081816123d3015281816123fc015261272701526157346000f3fe6080604052600436106101fe5760003560e01c80639d76ea581161011d578063be9a6555116100b0578063efbe1c1c1161007f578063f3fef3a311610064578063f3fef3a314610693578063fb346eab146106b3578063fc78fd19146106c957600080fd5b8063efbe1c1c14610646578063f2fde38b1461067357600080fd5b8063be9a6555146105b6578063c5f262ec146105f0578063c616f41214610610578063ea8bbd141461062657600080fd5b8063ac4a0fb6116100ec578063ac4a0fb614610500578063ad3cb1cc14610520578063b0291adb14610576578063b302df601461059657600080fd5b80639d76ea581461044d578063a106b8121461047a578063a26dbf26146104a7578063a91ee0dc146104e057600080fd5b8063715018a6116101955780637b103999116101645780637b1039991461037957806386c7937d146103a65780638da5cb5b146103f0578063991b2f2d1461043a57600080fd5b8063715018a61461031c57806376c520fa1461033157806376e886801461035157806379aaef551461036457600080fd5b806352d1902d116101d157806352d1902d146102755780635b019b761461028a57806365203f57146102dc578063652ff6bf146102fc57600080fd5b806314919364146102035780632b0e9536146102255780634e71d92d1461024d5780634f1ef28614610262575b600080fd5b34801561020f57600080fd5b5061022361021e366004614827565b6106de565b005b34801561023157600080fd5b5061023a6109a7565b6040519081526020015b60405180910390f35b34801561025957600080fd5b506102236109f7565b6102236102703660046149ae565b610cec565b34801561028157600080fd5b5061023a610d0b565b34801561029657600080fd5b506034546102b79073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610244565b3480156102e857600080fd5b506102236102f73660046149fe565b610d3a565b34801561030857600080fd5b5061023a610317366004614a7c565b610e67565b34801561032857600080fd5b50610223610ed0565b34801561033d57600080fd5b5061023a61034c366004614b0d565b610ee4565b61022361035f366004614b3d565b610f3a565b34801561037057600080fd5b506102b7610f50565b34801561038557600080fd5b506000546102b79073ffffffffffffffffffffffffffffffffffffffff1681565b3480156103b257600080fd5b506034546103db9074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff9091168152602001610244565b3480156103fc57600080fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005473ffffffffffffffffffffffffffffffffffffffff166102b7565b610223610448366004614baa565b61101d565b34801561045957600080fd5b506033546102b79073ffffffffffffffffffffffffffffffffffffffff1681565b34801561048657600080fd5b5061049a610495366004614827565b61102c565b6040516102449190614ce8565b3480156104b357600080fd5b506034546103db907801000000000000000000000000000000000000000000000000900463ffffffff1681565b3480156104ec57600080fd5b506102236104fb366004614dd3565b611258565b34801561050c57600080fd5b5061022361051b366004614df0565b61141b565b34801561052c57600080fd5b506105696040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b6040516102449190614e8e565b34801561058257600080fd5b50610223610591366004614827565b6116d6565b3480156105a257600080fd5b5061023a6105b1366004614827565b611964565b3480156105c257600080fd5b506035546105d79067ffffffffffffffff1681565b60405167ffffffffffffffff9091168152602001610244565b3480156105fc57600080fd5b5061022361060b366004614ea1565b611995565b34801561061c57600080fd5b5061023a60375481565b34801561063257600080fd5b5061023a610641366004614dd3565b611bab565b34801561065257600080fd5b506035546105d79068010000000000000000900467ffffffffffffffff1681565b34801561067f57600080fd5b5061022361068e366004614dd3565b611c18565b34801561069f57600080fd5b506102236106ae366004614f0e565b611c79565b3480156106bf57600080fd5b5061023a60365481565b3480156106d557600080fd5b50610223611f4e565b6106e66121b9565b6106ee612247565b6000811161075d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c696420746f74616c207175616e746974790000000000000000000060448201526064015b60405180910390fd5b6037548110156107c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c696420746f74616c207175616e74697479000000000000000000006044820152606401610754565b6038546034805463ffffffff90921674010000000000000000000000000000000000000000027fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff9092169190911790556037546000906108299083614f69565b603783905560335490915073ffffffffffffffffffffffffffffffffffffffff1615610874576033546108749073ffffffffffffffffffffffffffffffffffffffff163330846122c8565b61087c610f50565b603454603754603554604080517401000000000000000000000000000000000000000090940463ffffffff16602085015283019190915267ffffffffffffffff80821660608401526801000000000000000090910416608082015273ffffffffffffffffffffffffffffffffffffffff919091169063b0c3dae6907f47202af4ea785526e0d5fcf863d44e97150d82d8547e3437966e7944163b37959060a0016040516020818303038152906040526040518363ffffffff1660e01b8152600401610948929190614f7c565b600060405180830381600087803b15801561096257600080fd5b505af1158015610976573d6000803e3d6000fd5b50505050506109a460017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b50565b60008060005b6038548110156109f157603881815481106109ca576109ca614f9d565b90600052602060002090600e0201600c0154826109e79190614fcc565b91506001016109ad565b50919050565b603554339068010000000000000000900467ffffffffffffffff164211610a7a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f7420656e64656400000000000000000000000000000000000000000000006044820152606401610754565b73ffffffffffffffffffffffffffffffffffffffff811660009081526039602052604090206001810154905411610b0d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4e6f20696e766573746d656e74000000000000000000000000000000000000006044820152606401610754565b60335473ffffffffffffffffffffffffffffffffffffffff16610b8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4e6f7420737570706f72746564000000000000000000000000000000000000006044820152606401610754565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260396020526040812060018101549054610bc29190614f69565b73ffffffffffffffffffffffffffffffffffffffff80841660009081526039602052604090208054600190910155603354919250610c029116838361237d565b610c0a610f50565b73ffffffffffffffffffffffffffffffffffffffff838116600081815260396020908152604091829020600101548251918201939093528082019290925280518083038201815260608301918290527fb0c3dae600000000000000000000000000000000000000000000000000000000909152929091169163b0c3dae691610cb6917fc92401fe39f465ce67b760f03b5e26d762b45d2cff1972e6e92f2cab2ccd003291606401614f7c565b600060405180830381600087803b158015610cd057600080fd5b505af1158015610ce4573d6000803e3d6000fd5b505050505050565b610cf46123bb565b610cfd826124bf565b610d0782826125d6565b5050565b6000610d1561270f565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b610d426121b9565b610d4a612247565b60388054600181018255600091909152610d6581848461277e565b610d6d610f50565b73ffffffffffffffffffffffffffffffffffffffff1663b0c3dae67f06ef0f4c4d6dc0376458878d077f3d5bd2ed59f6aa9710d606cb0ab5ab413c058360388581548110610dbd57610dbd614f9d565b90600052602060002090600e0201600101604051602001610ddf929190615113565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610e0b929190614f7c565b600060405180830381600087803b158015610e2557600080fd5b505af1158015610e39573d6000803e3d6000fd5b5050505050610d0760017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b60008060005b8351811015610ec9576038848281518110610e8a57610e8a614f9d565b602002602001015181548110610ea257610ea2614f9d565b90600052602060002090600e0201600c015482610ebf9190614fcc565b9150600101610e6d565b5092915050565b610ed86121b9565b610ee26000612a3c565b565b60008060388481548110610efa57610efa614f9d565b6000918252602080832073ffffffffffffffffffffffffffffffffffffffff87168452600b600e9093020191909101905260409020549150505b92915050565b610f4933338787878787612ad2565b5050505050565b60008054604080518082018252600c81527f4576656e74456d69747465720000000000000000000000000000000000000000602082015290517f0205febe00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90921691630205febe91610fd791600401614e8e565b602060405180830381865afa158015610ff4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101891906151e9565b905090565b610ce433878787878787612ad2565b6110a360405180610160016040528060608152602001600060ff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600081526020016060815260200160008152602001600081526020016000815260200160008152602001600080191681525090565b6000603883815481106110b8576110b8614f9d565b90600052602060002090600e0201905080600101604051806101600160405290816000820180546110e890614fdf565b80601f016020809104026020016040519081016040528092919081815260200182805461111490614fdf565b80156111615780601f1061113657610100808354040283529160200191611161565b820191906000526020600020905b81548152906001019060200180831161114457829003601f168201915b5050509183525050600182015460ff811660208084019190915267ffffffffffffffff6101008304811660408086019190915269010000000000000000009093041660608401526002840154608084015260038401805483518184028101840190945280845260a090940193909183018282801561121557602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116111ea575b5050505050815260200160048201548152602001600582015481526020016006820154815260200160078201548152602001600882015481525050915050919050565b600054604080518082018252600881527f5570677261646572000000000000000000000000000000000000000000000000602082015290517f0205febe000000000000000000000000000000000000000000000000000000008152339273ffffffffffffffffffffffffffffffffffffffff1691630205febe916112df9190600401614e8e565b602060405180830381865afa1580156112fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132091906151e9565b73ffffffffffffffffffffffffffffffffffffffff161461136f576040517f34c67d49000000000000000000000000000000000000000000000000000000008152336004820152602401610754565b73ffffffffffffffffffffffffffffffffffffffff81166113d4576040517f540b960100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610754565b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff166000811580156114665750825b905060008267ffffffffffffffff1660011480156114835750303b155b905081158015611491575080155b156114c8576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84547fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000016600117855583156115295784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff16680100000000000000001785555b73bf6abdac184653cf01f64f1c46f22482f8e717ea9950611548612cfd565b6115518a612d0d565b6115a987876033805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560348054929093169116179055565b6115b289612a3c565b6115ba610f50565b73ffffffffffffffffffffffffffffffffffffffff1663b0c3dae67f97c810b77f2c923c4265fa911e660f63d2674cd0bc96fe3f112d228e856a14898a8a8a60405160200161160b93929190615206565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401611637929190614f7c565b600060405180830381600087803b15801561165157600080fd5b505af1158015611665573d6000803e3d6000fd5b5050505083156116ca5784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050505050565b6116de6121b9565b60345474010000000000000000000000000000000000000000900463ffffffff16811015611768576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f416c7265616479207374617274656400000000000000000000000000000000006044820152606401610754565b60385481106117d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c6964207068617365206964000000000000000000000000000000006044820152606401610754565b603881815481106117e6576117e6614f9d565b60009182526020909120600e909102015460ff1615611861576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f416c72656164792072656d6f76656400000000000000000000000000000000006044820152606401610754565b60016038828154811061187657611876614f9d565b60009182526020909120600e9091020180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790556118bb610f50565b73ffffffffffffffffffffffffffffffffffffffff1663b0c3dae67fdcc330a2ecc3d0bb2581167014932ed487167d841ede79fdd1ad0fbdb08856878360405160200161190a91815260200190565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401611936929190614f7c565b600060405180830381600087803b15801561195057600080fd5b505af1158015610f49573d6000803e3d6000fd5b6000806038838154811061197a5761197a614f9d565b60009182526020909120600c600e9092020101549392505050565b61199d6121b9565b6119a5612247565b60345474010000000000000000000000000000000000000000900463ffffffff16831015611a2f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f416c7265616479207374617274656400000000000000000000000000000000006044820152606401610754565b6038548310611a9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c6964207068617365206964000000000000000000000000000000006044820152606401610754565b611aa583838361277e565b611aad610f50565b73ffffffffffffffffffffffffffffffffffffffff1663b0c3dae67f741f52a1fdc1fc73e6d458b06a18ac7c58abed2318ca3a2e44ec4ee4a150db178560388781548110611afd57611afd614f9d565b90600052602060002090600e0201600101604051602001611b1f929190615113565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401611b4b929190614f7c565b600060405180830381600087803b158015611b6557600080fd5b505af1158015611b79573d6000803e3d6000fd5b50505050611ba660017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b505050565b60008060005b603854811015610ec95760388181548110611bce57611bce614f9d565b6000918252602080832073ffffffffffffffffffffffffffffffffffffffff88168452600b600e909302019190910190526040902054611c0e9083614fcc565b9150600101611bb1565b611c206121b9565b73ffffffffffffffffffffffffffffffffffffffff8116611c70576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610754565b6109a481612a3c565b611c81612247565b60385460345474010000000000000000000000000000000000000000900463ffffffff1614611d0c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e6f742066696e697368656400000000000000000000000000000000000000006044820152606401610754565b60355468010000000000000000900467ffffffffffffffff164211611d8d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f7420656e64656400000000000000000000000000000000000000000000006044820152606401610754565b60335473ffffffffffffffffffffffffffffffffffffffff1615611e305760335473ffffffffffffffffffffffffffffffffffffffff90811690831603611e30576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c69642063757272656e6379000000000000000000000000000000006044820152606401610754565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005473ffffffffffffffffffffffffffffffffffffffff16331480611e8c575060345473ffffffffffffffffffffffffffffffffffffffff1633145b611ef2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f4e6f7420616c6c6f7765640000000000000000000000000000000000000000006044820152606401610754565b73ffffffffffffffffffffffffffffffffffffffff8216611f1b57611f1681612d16565b611f25565b611f258282612de6565b610d0760017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b611f566121b9565b611f5e612247565b60355468010000000000000000900467ffffffffffffffff164211611fdf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f7420656e64656400000000000000000000000000000000000000000000006044820152606401610754565b60385460345474010000000000000000000000000000000000000000900463ffffffff161461206a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e6f742066696e697368656400000000000000000000000000000000000000006044820152606401610754565b60335473ffffffffffffffffffffffffffffffffffffffff166120e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4e6f7420737570706f72746564000000000000000000000000000000000000006044820152606401610754565b60365460375411612156576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f4e6f2072656d61696e696e6720746f6b656e00000000000000000000000000006044820152606401610754565b60006036546037546121689190614f69565b60335490915061218f9073ffffffffffffffffffffffffffffffffffffffff16338361237d565b50610ee260017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b336121f87f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614610ee2576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610754565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0080547ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016122c2576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60029055565b60405173ffffffffffffffffffffffffffffffffffffffff84811660248301528381166044830152606482018390526123519186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e0d565b50505050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b60405173ffffffffffffffffffffffffffffffffffffffff838116602483015260448201839052611ba691859182169063a9059cbb9060640161230a565b3073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148061248857507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1661246f7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15610ee2576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600054604080518082018252600881527f5570677261646572000000000000000000000000000000000000000000000000602082015290517f0205febe000000000000000000000000000000000000000000000000000000008152339273ffffffffffffffffffffffffffffffffffffffff1691630205febe916125469190600401614e8e565b602060405180830381865afa158015612563573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061258791906151e9565b73ffffffffffffffffffffffffffffffffffffffff16146109a4576040517f34c67d49000000000000000000000000000000000000000000000000000000008152336004820152602401610754565b8173ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561265b575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261265891810190615246565b60015b6126a9576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610754565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8114612705576040517faa1d49a400000000000000000000000000000000000000000000000000000000815260048101829052602401610754565b611ba68383612ea3565b3073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610ee2576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81516020808401919091206040805146818501523081830152606080820184905282518083039091018152608090910190915280519201919091206127c38184612f06565b506000806127d08661306d565b9150915081603888815481106127e8576127e8614f9d565b90600052602060002090600e0201600101600082015181600001908161280e91906152a7565b506020828101516001830180546040860151606087015160ff9094167fffffffffffffffffffffffffffffffffffffffffffffff0000000000000000009092169190911761010067ffffffffffffffff92831602177fffffffffffffffffffffffffffffff0000000000000000ffffffffffffffffff16690100000000000000000091909316029190911790556080830151600283015560a083015180516128bc926003850192019061474d565b5060c0820151816004015560e08201518160050155610100820151816006015561012082015181600701556101408201518160080155905050806038888154811061290957612909614f9d565b90600052602060002090600e0201600d01908051906020019061292d9291906147d7565b5060355467ffffffffffffffff16158061295a5750604082015160355467ffffffffffffffff9182169116115b1561299d576040820151603580547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff9092169190911790555b60355468010000000000000000900467ffffffffffffffff1615806129e35750606082015160355467ffffffffffffffff91821668010000000000000000909104909116105b15612a335760608201516035805467ffffffffffffffff90921668010000000000000000027fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff9092169190911790555b50505050505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080547fffffffffffffffffffffffff0000000000000000000000000000000000000000811673ffffffffffffffffffffffffffffffffffffffff848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b612ada612247565b6038548510612b45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c6964207068617365000000000000000000000000000000000000006044820152606401610754565b60008311612baf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f496e76616c696420616d6f756e740000000000000000000000000000000000006044820152606401610754565b60388581548110612bc257612bc2614f9d565b60009182526020909120600e909102015460ff1615612c3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f50686173652072656d6f766564000000000000000000000000000000000000006044820152606401610754565b612c488785856134b6565b600060388681548110612c5d57612c5d614f9d565b90600052602060002090600e02016001016004015484612c7d91906153c1565b905060388681548110612c9257612c92614f9d565b6000918252602082206002600e90920201015460ff169003612cc357612cbd8888888885888861358b565b50612cd4565b612cd2888888888588886136c4565b505b612a3360017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b612d056136d1565b610ee2613738565b6113d433613740565b60345460405160009173ffffffffffffffffffffffffffffffffffffffff169083905b60006040518083038185875af1925050503d8060008114612d76576040519150601f19603f3d011682016040523d82523d6000602084013e612d7b565b606091505b5050905080610d07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5472616e73666572206661696c656400000000000000000000000000000000006044820152606401610754565b603454610d079073ffffffffffffffffffffffffffffffffffffffff84811691168361237d565b6000612e2f73ffffffffffffffffffffffffffffffffffffffff841683613751565b90508051600014158015612e54575080806020019051810190612e5291906153fc565b155b15611ba6576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152602401610754565b612eac8261375f565b60405173ffffffffffffffffffffffffffffffffffffffff8316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115612efe57611ba6828261382e565b610d076138b1565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c839052603c81208190612f4190846138e9565b905060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166346657fe96040518163ffffffff1660e01b8152600401602060405180830381865afa158015612fae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fd291906151e9565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614613066576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496e76616c6964207369676e61747572650000000000000000000000000000006044820152606401610754565b9392505050565b6130e460405180610160016040528060608152602001600060ff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600081526020016060815260200160008152602001600081526020016000815260200160008152602001600080191681525090565b6060828060200190518101906130fa9190615563565b909250905060005b8260a00151518110156132385760005460a0840151805173ffffffffffffffffffffffffffffffffffffffff9092169163fca8d47191908490811061314957613149614f9d565b60200260200101516040518263ffffffff1660e01b8152600401613189919073ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b602060405180830381865afa1580156131a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131ca91906153fc565b613230576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e737570706f727465642063757272656e63790000000000000000000000006044820152606401610754565b600101613102565b50602082015160ff1615806132545750816020015160ff166001145b6132ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f496e76616c696420636c61696d207479706500000000000000000000000000006044820152606401610754565b42826040015167ffffffffffffffff161015613332576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f496e76616c69642073746172742074696d6500000000000000000000000000006044820152606401610754565b42826060015167ffffffffffffffff16116133a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c696420656e642074696d65000000000000000000000000000000006044820152606401610754565b816040015167ffffffffffffffff16826060015167ffffffffffffffff161161342e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f496e76616c69642074696d652072616e676500000000000000000000000000006044820152606401610754565b8160e001518261010001511015801561344b575060008260e00151115b6134b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f496e76616c696420616d6f756e742072616e67650000000000000000000000006044820152606401610754565b915091565b806000036134c357505050565b600080546040517f9704122c00000000000000000000000000000000000000000000000000000000815260048101849052829173ffffffffffffffffffffffffffffffffffffffff1690639704122c906024016040805180830381865afa158015613532573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135569190615684565b909250905073ffffffffffffffffffffffffffffffffffffffff841661357f57610f4982613913565b610f49858584846139c4565b8183613597878a610ee4565b6135a19190614fcc565b1115613609576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f45786365656473206d617820616d6f756e7400000000000000000000000000006044820152606401610754565b6136168588888787613a9c565b60004630878a8660388b8154811061363057613630614f9d565b90600052602060002090600e0201600101600801546040516020016136979695949392919095865273ffffffffffffffffffffffffffffffffffffffff9485166020870152604086019390935292166060840152608083019190915260a082015260c00190565b6040516020818303038152906040528051906020012090506136b98183612f06565b505050505050505050565b612a338588888787613a9c565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff16610ee2576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6123576136d1565b6137486136d1565b6109a481614366565b60606130668383600061436e565b8073ffffffffffffffffffffffffffffffffffffffff163b6000036137c8576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610754565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60606000808473ffffffffffffffffffffffffffffffffffffffff168460405161385891906156a8565b600060405180830381855af49150503d8060008114613893576040519150601f19603f3d011682016040523d82523d6000602084013e613898565b606091505b50915091506138a8858383614431565b95945050505050565b3415610ee2576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806000806138f986866144c0565b925092509250613909828261450d565b5090949350505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663707d18486040518163ffffffff1660e01b8152600401602060405180830381865afa158015613981573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139a591906151e9565b73ffffffffffffffffffffffffffffffffffffffff1682604051612d39565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663707d18486040518163ffffffff1660e01b8152600401602060405180830381865afa158015613a32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a5691906151e9565b9050613a7a73ffffffffffffffffffffffffffffffffffffffff85168683866122c8565b610f4973ffffffffffffffffffffffffffffffffffffffff85168630856122c8565b6000613aa78661102c565b905060375482603654613aba9190614fcc565b1115613b22576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f45786365656473206d61780000000000000000000000000000000000000000006044820152606401610754565b806080015182613ba360388981548110613b3e57613b3e614f9d565b90600052602060002090600e0201600d01805480602002602001604051908101604052809291908181526020018280548015613b9957602002820191906000526020600020905b815481526020019060010190808311613b85575b5050505050610e67565b613bad9190614fcc565b1115613c15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f45786365656473206d61782070686173650000000000000000000000000000006044820152606401610754565b60005b8160a0015151811015613cec578373ffffffffffffffffffffffffffffffffffffffff168260a001518281518110613c5257613c52614f9d565b602002602001015173ffffffffffffffffffffffffffffffffffffffff160315613cec578160a00151518110613ce4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c69642063757272656e6379000000000000000000000000000000006044820152606401610754565b600101613c18565b5080610120015182613cfe8888610ee4565b613d089190614fcc565b1115613d70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f45786365656473206d6178207065722077616c6c6574000000000000000000006044820152606401610754565b73ffffffffffffffffffffffffffffffffffffffff8316613e0457348160c0015183613d9c91906156c4565b1115613e04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c6964207072696365000000000000000000000000000000000000006044820152606401610754565b8060e001518210158015613e1d57508061010001518211155b613e83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f496e76616c696420616d6f756e740000000000000000000000000000000000006044820152606401610754565b806040015167ffffffffffffffff16421015613efb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f4e6f7420737461727465640000000000000000000000000000000000000000006044820152606401610754565b806060015167ffffffffffffffff16421115613f73576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f456e6465640000000000000000000000000000000000000000000000000000006044820152606401610754565b5060388581548110613f8757613f87614f9d565b6000918252602080832073ffffffffffffffffffffffffffffffffffffffff88168452600b600e909302019190910190526040812054900361401f57600160388681548110613fd857613fd8614f9d565b600091825260208220600a600e9092020101805490919061400090849063ffffffff166156db565b92506101000a81548163ffffffff021916908363ffffffff1602179055505b73ffffffffffffffffffffffffffffffffffffffff8316600090815260396020526040812054900361408c576001603460188282829054906101000a900463ffffffff1661406d91906156db565b92506101000a81548163ffffffff021916908363ffffffff1602179055505b80603886815481106140a0576140a0614f9d565b90600052602060002090600e0201600b0160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546140fd9190614fcc565b92505081905550806038868154811061411857614118614f9d565b90600052602060002090600e0201600c0160008282546141389190614fcc565b909155505073ffffffffffffffffffffffffffffffffffffffff831660009081526039602052604081208054839290614172908490614fcc565b92505081905550806036600082825461418b9190614fcc565b909155506141999050610f50565b73ffffffffffffffffffffffffffffffffffffffff1663b0c3dae67f310e92ded193ec0e5247c49d1c672d225df46793bacc87e4a995a1565c9978fa878760388a815481106141ea576141ea614f9d565b6000918252602080832073ffffffffffffffffffffffffffffffffffffffff8d81168552600e9390930201600b018152604080842054928c168452603990915290912054603880548b9291908e90811061424657614246614f9d565b90600052602060002090600e0201600c015460365460388f8154811061426e5761426e614f9d565b6000918252602091829020600e9190910201600a0154603454604080519384019a909a5273ffffffffffffffffffffffffffffffffffffffff98891699830199909952606082019690965295909316608086015260a085019190915260c084015260e083015263ffffffff9081166101008301527801000000000000000000000000000000000000000000000000909204909116610120820152610140016040516020818303038152906040526040518363ffffffff1660e01b8152600401614338929190614f7c565b600060405180830381600087803b15801561435257600080fd5b505af11580156136b9573d6000803e3d6000fd5b611c206136d1565b6060814710156143ac576040517fcd786059000000000000000000000000000000000000000000000000000000008152306004820152602401610754565b6000808573ffffffffffffffffffffffffffffffffffffffff1684866040516143d591906156a8565b60006040518083038185875af1925050503d8060008114614412576040519150601f19603f3d011682016040523d82523d6000602084013e614417565b606091505b5091509150614427868383614431565b9695505050505050565b6060826144465761444182614611565b613066565b815115801561446a575073ffffffffffffffffffffffffffffffffffffffff84163b155b156144b9576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610754565b5080613066565b600080600083516041036144fa5760208401516040850151606086015160001a6144ec88828585614653565b955095509550505050614506565b50508151600091506002905b9250925092565b6000826003811115614521576145216156f8565b0361452a575050565b600182600381111561453e5761453e6156f8565b03614575576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002826003811115614589576145896156f8565b036145c3576040517ffce698f700000000000000000000000000000000000000000000000000000000815260048101829052602401610754565b60038260038111156145d7576145d76156f8565b03610d07576040517fd78bce0c00000000000000000000000000000000000000000000000000000000815260048101829052602401610754565b8051156146215780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111561468e5750600091506003905082614743565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156146e2573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661473957506000925060019150829050614743565b9250600091508190505b9450945094915050565b8280548282559060005260206000209081019282156147c7579160200282015b828111156147c757825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90911617825560209092019160019091019061476d565b506147d3929150614812565b5090565b8280548282559060005260206000209081019282156147c7579160200282015b828111156147c75782518255916020019190600101906147f7565b5b808211156147d35760008155600101614813565b60006020828403121561483957600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff811681146109a457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610160810167ffffffffffffffff811182821017156148b5576148b5614862565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561490257614902614862565b604052919050565b600067ffffffffffffffff82111561492457614924614862565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600061496361495e8461490a565b6148bb565b905082815283838301111561497757600080fd5b828260208301376000602084830101529392505050565b600082601f83011261499f57600080fd5b61306683833560208501614950565b600080604083850312156149c157600080fd5b82356149cc81614840565b9150602083013567ffffffffffffffff8111156149e857600080fd5b6149f48582860161498e565b9150509250929050565b60008060408385031215614a1157600080fd5b823567ffffffffffffffff80821115614a2957600080fd5b614a358683870161498e565b93506020850135915080821115614a4b57600080fd5b506149f48582860161498e565b600067ffffffffffffffff821115614a7257614a72614862565b5060051b60200190565b60006020808385031215614a8f57600080fd5b823567ffffffffffffffff811115614aa657600080fd5b8301601f81018513614ab757600080fd5b8035614ac561495e82614a58565b81815260059190911b82018301908381019087831115614ae457600080fd5b928401925b82841015614b0257833582529284019290840190614ae9565b979650505050505050565b60008060408385031215614b2057600080fd5b823591506020830135614b3281614840565b809150509250929050565b600080600080600060a08688031215614b5557600080fd5b853594506020860135614b6781614840565b93506040860135925060608601359150608086013567ffffffffffffffff811115614b9157600080fd5b614b9d8882890161498e565b9150509295509295909350565b60008060008060008060c08789031215614bc357600080fd5b8635614bce81614840565b9550602087013594506040870135614be581614840565b9350606087013592506080870135915060a087013567ffffffffffffffff811115614c0f57600080fd5b614c1b89828a0161498e565b9150509295509295509295565b60005b83811015614c43578181015183820152602001614c2b565b50506000910152565b60008151808452614c64816020860160208601614c28565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60008151808452602080850194506020840160005b83811015614cdd57815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101614cab565b509495945050505050565b6020815260008251610160806020850152614d07610180850183614c4c565b91506020850151614d1d604086018260ff169052565b50604085015167ffffffffffffffff8116606086015250606085015167ffffffffffffffff8116608086015250608085015160a085015260a08501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08584030160c0860152614d8d8382614c96565b60c087015160e087810191909152870151610100808801919091528701516101208088019190915287015161014080880191909152909601519190940152509192915050565b600060208284031215614de557600080fd5b813561306681614840565b600080600080600060a08688031215614e0857600080fd5b8535614e1381614840565b94506020860135614e2381614840565b9350604086013567ffffffffffffffff811115614e3f57600080fd5b8601601f81018813614e5057600080fd5b614e5f88823560208401614950565b9350506060860135614e7081614840565b91506080860135614e8081614840565b809150509295509295909350565b6020815260006130666020830184614c4c565b600080600060608486031215614eb657600080fd5b83359250602084013567ffffffffffffffff80821115614ed557600080fd5b614ee18783880161498e565b93506040860135915080821115614ef757600080fd5b50614f048682870161498e565b9150509250925092565b60008060408385031215614f2157600080fd5b8235614f2c81614840565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115610f3457610f34614f3a565b828152604060208201526000614f956040830184614c4c565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b80820180821115610f3457610f34614f3a565b600181811c90821680614ff357607f821691505b6020821081036109f1577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000815461503981614fdf565b808552602060018381168015615056576001811461508e576150bc565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008516838901528284151560051b89010195506150bc565b866000528260002060005b858110156150b45781548a8201860152908301908401615099565b890184019650505b505050505092915050565b600081548084526020808501945083600052602060002060005b83811015614cdd57815473ffffffffffffffffffffffffffffffffffffffff16875295820195600191820191016150e1565b8281526040602082015260006101608060408401526151366101a084018561502c565b600185015460ff8116606086015267ffffffffffffffff600882901c8116608087015260489190911c1660a0850152600285015460c08501528381037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160e08501526151a681600387016150c7565b9050600485015461010085015260058501546101208501526006850154610140850152600785015482850152600885015461018085015280925050509392505050565b6000602082840312156151fb57600080fd5b815161306681614840565b6060815260006152196060830186614c4c565b73ffffffffffffffffffffffffffffffffffffffff94851660208401529290931660409091015292915050565b60006020828403121561525857600080fd5b5051919050565b601f821115611ba6576000816000526020600020601f850160051c810160208610156152885750805b601f850160051c820191505b81811015610ce457828155600101615294565b815167ffffffffffffffff8111156152c1576152c1614862565b6152d5816152cf8454614fdf565b8461525f565b602080601f83116001811461532857600084156152f25750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610ce4565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561537557888601518255948401946001909101908401615356565b50858210156153b157878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b6000826153f7577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006020828403121561540e57600080fd5b8151801515811461306657600080fd5b600082601f83011261542f57600080fd5b815161543d61495e8261490a565b81815284602083860101111561545257600080fd5b614f95826020830160208701614c28565b805160ff8116811461547457600080fd5b919050565b805167ffffffffffffffff8116811461547457600080fd5b600082601f8301126154a257600080fd5b815160206154b261495e83614a58565b8083825260208201915060208460051b8701019350868411156154d457600080fd5b602086015b848110156154f95780516154ec81614840565b83529183019183016154d9565b509695505050505050565b600082601f83011261551557600080fd5b8151602061552561495e83614a58565b8083825260208201915060208460051b87010193508684111561554757600080fd5b602086015b848110156154f9578051835291830191830161554c565b6000806040838503121561557657600080fd5b825167ffffffffffffffff8082111561558e57600080fd5b9084019061016082870312156155a357600080fd5b6155ab614891565b8251828111156155ba57600080fd5b6155c68882860161541e565b8252506155d560208401615463565b60208201526155e660408401615479565b60408201526155f760608401615479565b60608201526080830151608082015260a08301518281111561561857600080fd5b61562488828601615491565b60a08301525060c0838101519082015260e0808401519082015261010080840151908201526101208084015190820152610140928301519281019290925260208501519193508082111561567757600080fd5b506149f485828601615504565b6000806040838503121561569757600080fd5b505080516020909101519092909150565b600082516156ba818460208701614c28565b9190910192915050565b8082028115828204841417610f3457610f34614f3a565b63ffffffff818116838216019080821115610ec957610ec9614f3a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea164736f6c6343000819000a

Deployed Bytecode

0x6080604052600436106101fe5760003560e01c80639d76ea581161011d578063be9a6555116100b0578063efbe1c1c1161007f578063f3fef3a311610064578063f3fef3a314610693578063fb346eab146106b3578063fc78fd19146106c957600080fd5b8063efbe1c1c14610646578063f2fde38b1461067357600080fd5b8063be9a6555146105b6578063c5f262ec146105f0578063c616f41214610610578063ea8bbd141461062657600080fd5b8063ac4a0fb6116100ec578063ac4a0fb614610500578063ad3cb1cc14610520578063b0291adb14610576578063b302df601461059657600080fd5b80639d76ea581461044d578063a106b8121461047a578063a26dbf26146104a7578063a91ee0dc146104e057600080fd5b8063715018a6116101955780637b103999116101645780637b1039991461037957806386c7937d146103a65780638da5cb5b146103f0578063991b2f2d1461043a57600080fd5b8063715018a61461031c57806376c520fa1461033157806376e886801461035157806379aaef551461036457600080fd5b806352d1902d116101d157806352d1902d146102755780635b019b761461028a57806365203f57146102dc578063652ff6bf146102fc57600080fd5b806314919364146102035780632b0e9536146102255780634e71d92d1461024d5780634f1ef28614610262575b600080fd5b34801561020f57600080fd5b5061022361021e366004614827565b6106de565b005b34801561023157600080fd5b5061023a6109a7565b6040519081526020015b60405180910390f35b34801561025957600080fd5b506102236109f7565b6102236102703660046149ae565b610cec565b34801561028157600080fd5b5061023a610d0b565b34801561029657600080fd5b506034546102b79073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610244565b3480156102e857600080fd5b506102236102f73660046149fe565b610d3a565b34801561030857600080fd5b5061023a610317366004614a7c565b610e67565b34801561032857600080fd5b50610223610ed0565b34801561033d57600080fd5b5061023a61034c366004614b0d565b610ee4565b61022361035f366004614b3d565b610f3a565b34801561037057600080fd5b506102b7610f50565b34801561038557600080fd5b506000546102b79073ffffffffffffffffffffffffffffffffffffffff1681565b3480156103b257600080fd5b506034546103db9074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff9091168152602001610244565b3480156103fc57600080fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005473ffffffffffffffffffffffffffffffffffffffff166102b7565b610223610448366004614baa565b61101d565b34801561045957600080fd5b506033546102b79073ffffffffffffffffffffffffffffffffffffffff1681565b34801561048657600080fd5b5061049a610495366004614827565b61102c565b6040516102449190614ce8565b3480156104b357600080fd5b506034546103db907801000000000000000000000000000000000000000000000000900463ffffffff1681565b3480156104ec57600080fd5b506102236104fb366004614dd3565b611258565b34801561050c57600080fd5b5061022361051b366004614df0565b61141b565b34801561052c57600080fd5b506105696040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b6040516102449190614e8e565b34801561058257600080fd5b50610223610591366004614827565b6116d6565b3480156105a257600080fd5b5061023a6105b1366004614827565b611964565b3480156105c257600080fd5b506035546105d79067ffffffffffffffff1681565b60405167ffffffffffffffff9091168152602001610244565b3480156105fc57600080fd5b5061022361060b366004614ea1565b611995565b34801561061c57600080fd5b5061023a60375481565b34801561063257600080fd5b5061023a610641366004614dd3565b611bab565b34801561065257600080fd5b506035546105d79068010000000000000000900467ffffffffffffffff1681565b34801561067f57600080fd5b5061022361068e366004614dd3565b611c18565b34801561069f57600080fd5b506102236106ae366004614f0e565b611c79565b3480156106bf57600080fd5b5061023a60365481565b3480156106d557600080fd5b50610223611f4e565b6106e66121b9565b6106ee612247565b6000811161075d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c696420746f74616c207175616e746974790000000000000000000060448201526064015b60405180910390fd5b6037548110156107c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c696420746f74616c207175616e74697479000000000000000000006044820152606401610754565b6038546034805463ffffffff90921674010000000000000000000000000000000000000000027fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff9092169190911790556037546000906108299083614f69565b603783905560335490915073ffffffffffffffffffffffffffffffffffffffff1615610874576033546108749073ffffffffffffffffffffffffffffffffffffffff163330846122c8565b61087c610f50565b603454603754603554604080517401000000000000000000000000000000000000000090940463ffffffff16602085015283019190915267ffffffffffffffff80821660608401526801000000000000000090910416608082015273ffffffffffffffffffffffffffffffffffffffff919091169063b0c3dae6907f47202af4ea785526e0d5fcf863d44e97150d82d8547e3437966e7944163b37959060a0016040516020818303038152906040526040518363ffffffff1660e01b8152600401610948929190614f7c565b600060405180830381600087803b15801561096257600080fd5b505af1158015610976573d6000803e3d6000fd5b50505050506109a460017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b50565b60008060005b6038548110156109f157603881815481106109ca576109ca614f9d565b90600052602060002090600e0201600c0154826109e79190614fcc565b91506001016109ad565b50919050565b603554339068010000000000000000900467ffffffffffffffff164211610a7a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f7420656e64656400000000000000000000000000000000000000000000006044820152606401610754565b73ffffffffffffffffffffffffffffffffffffffff811660009081526039602052604090206001810154905411610b0d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4e6f20696e766573746d656e74000000000000000000000000000000000000006044820152606401610754565b60335473ffffffffffffffffffffffffffffffffffffffff16610b8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4e6f7420737570706f72746564000000000000000000000000000000000000006044820152606401610754565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260396020526040812060018101549054610bc29190614f69565b73ffffffffffffffffffffffffffffffffffffffff80841660009081526039602052604090208054600190910155603354919250610c029116838361237d565b610c0a610f50565b73ffffffffffffffffffffffffffffffffffffffff838116600081815260396020908152604091829020600101548251918201939093528082019290925280518083038201815260608301918290527fb0c3dae600000000000000000000000000000000000000000000000000000000909152929091169163b0c3dae691610cb6917fc92401fe39f465ce67b760f03b5e26d762b45d2cff1972e6e92f2cab2ccd003291606401614f7c565b600060405180830381600087803b158015610cd057600080fd5b505af1158015610ce4573d6000803e3d6000fd5b505050505050565b610cf46123bb565b610cfd826124bf565b610d0782826125d6565b5050565b6000610d1561270f565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b610d426121b9565b610d4a612247565b60388054600181018255600091909152610d6581848461277e565b610d6d610f50565b73ffffffffffffffffffffffffffffffffffffffff1663b0c3dae67f06ef0f4c4d6dc0376458878d077f3d5bd2ed59f6aa9710d606cb0ab5ab413c058360388581548110610dbd57610dbd614f9d565b90600052602060002090600e0201600101604051602001610ddf929190615113565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610e0b929190614f7c565b600060405180830381600087803b158015610e2557600080fd5b505af1158015610e39573d6000803e3d6000fd5b5050505050610d0760017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b60008060005b8351811015610ec9576038848281518110610e8a57610e8a614f9d565b602002602001015181548110610ea257610ea2614f9d565b90600052602060002090600e0201600c015482610ebf9190614fcc565b9150600101610e6d565b5092915050565b610ed86121b9565b610ee26000612a3c565b565b60008060388481548110610efa57610efa614f9d565b6000918252602080832073ffffffffffffffffffffffffffffffffffffffff87168452600b600e9093020191909101905260409020549150505b92915050565b610f4933338787878787612ad2565b5050505050565b60008054604080518082018252600c81527f4576656e74456d69747465720000000000000000000000000000000000000000602082015290517f0205febe00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90921691630205febe91610fd791600401614e8e565b602060405180830381865afa158015610ff4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101891906151e9565b905090565b610ce433878787878787612ad2565b6110a360405180610160016040528060608152602001600060ff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600081526020016060815260200160008152602001600081526020016000815260200160008152602001600080191681525090565b6000603883815481106110b8576110b8614f9d565b90600052602060002090600e0201905080600101604051806101600160405290816000820180546110e890614fdf565b80601f016020809104026020016040519081016040528092919081815260200182805461111490614fdf565b80156111615780601f1061113657610100808354040283529160200191611161565b820191906000526020600020905b81548152906001019060200180831161114457829003601f168201915b5050509183525050600182015460ff811660208084019190915267ffffffffffffffff6101008304811660408086019190915269010000000000000000009093041660608401526002840154608084015260038401805483518184028101840190945280845260a090940193909183018282801561121557602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116111ea575b5050505050815260200160048201548152602001600582015481526020016006820154815260200160078201548152602001600882015481525050915050919050565b600054604080518082018252600881527f5570677261646572000000000000000000000000000000000000000000000000602082015290517f0205febe000000000000000000000000000000000000000000000000000000008152339273ffffffffffffffffffffffffffffffffffffffff1691630205febe916112df9190600401614e8e565b602060405180830381865afa1580156112fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132091906151e9565b73ffffffffffffffffffffffffffffffffffffffff161461136f576040517f34c67d49000000000000000000000000000000000000000000000000000000008152336004820152602401610754565b73ffffffffffffffffffffffffffffffffffffffff81166113d4576040517f540b960100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610754565b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff166000811580156114665750825b905060008267ffffffffffffffff1660011480156114835750303b155b905081158015611491575080155b156114c8576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84547fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000016600117855583156115295784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff16680100000000000000001785555b73bf6abdac184653cf01f64f1c46f22482f8e717ea9950611548612cfd565b6115518a612d0d565b6115a987876033805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560348054929093169116179055565b6115b289612a3c565b6115ba610f50565b73ffffffffffffffffffffffffffffffffffffffff1663b0c3dae67f97c810b77f2c923c4265fa911e660f63d2674cd0bc96fe3f112d228e856a14898a8a8a60405160200161160b93929190615206565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401611637929190614f7c565b600060405180830381600087803b15801561165157600080fd5b505af1158015611665573d6000803e3d6000fd5b5050505083156116ca5784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050505050565b6116de6121b9565b60345474010000000000000000000000000000000000000000900463ffffffff16811015611768576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f416c7265616479207374617274656400000000000000000000000000000000006044820152606401610754565b60385481106117d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c6964207068617365206964000000000000000000000000000000006044820152606401610754565b603881815481106117e6576117e6614f9d565b60009182526020909120600e909102015460ff1615611861576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f416c72656164792072656d6f76656400000000000000000000000000000000006044820152606401610754565b60016038828154811061187657611876614f9d565b60009182526020909120600e9091020180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169115159190911790556118bb610f50565b73ffffffffffffffffffffffffffffffffffffffff1663b0c3dae67fdcc330a2ecc3d0bb2581167014932ed487167d841ede79fdd1ad0fbdb08856878360405160200161190a91815260200190565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401611936929190614f7c565b600060405180830381600087803b15801561195057600080fd5b505af1158015610f49573d6000803e3d6000fd5b6000806038838154811061197a5761197a614f9d565b60009182526020909120600c600e9092020101549392505050565b61199d6121b9565b6119a5612247565b60345474010000000000000000000000000000000000000000900463ffffffff16831015611a2f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f416c7265616479207374617274656400000000000000000000000000000000006044820152606401610754565b6038548310611a9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c6964207068617365206964000000000000000000000000000000006044820152606401610754565b611aa583838361277e565b611aad610f50565b73ffffffffffffffffffffffffffffffffffffffff1663b0c3dae67f741f52a1fdc1fc73e6d458b06a18ac7c58abed2318ca3a2e44ec4ee4a150db178560388781548110611afd57611afd614f9d565b90600052602060002090600e0201600101604051602001611b1f929190615113565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401611b4b929190614f7c565b600060405180830381600087803b158015611b6557600080fd5b505af1158015611b79573d6000803e3d6000fd5b50505050611ba660017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b505050565b60008060005b603854811015610ec95760388181548110611bce57611bce614f9d565b6000918252602080832073ffffffffffffffffffffffffffffffffffffffff88168452600b600e909302019190910190526040902054611c0e9083614fcc565b9150600101611bb1565b611c206121b9565b73ffffffffffffffffffffffffffffffffffffffff8116611c70576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610754565b6109a481612a3c565b611c81612247565b60385460345474010000000000000000000000000000000000000000900463ffffffff1614611d0c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e6f742066696e697368656400000000000000000000000000000000000000006044820152606401610754565b60355468010000000000000000900467ffffffffffffffff164211611d8d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f7420656e64656400000000000000000000000000000000000000000000006044820152606401610754565b60335473ffffffffffffffffffffffffffffffffffffffff1615611e305760335473ffffffffffffffffffffffffffffffffffffffff90811690831603611e30576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c69642063757272656e6379000000000000000000000000000000006044820152606401610754565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005473ffffffffffffffffffffffffffffffffffffffff16331480611e8c575060345473ffffffffffffffffffffffffffffffffffffffff1633145b611ef2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f4e6f7420616c6c6f7765640000000000000000000000000000000000000000006044820152606401610754565b73ffffffffffffffffffffffffffffffffffffffff8216611f1b57611f1681612d16565b611f25565b611f258282612de6565b610d0760017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b611f566121b9565b611f5e612247565b60355468010000000000000000900467ffffffffffffffff164211611fdf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e6f7420656e64656400000000000000000000000000000000000000000000006044820152606401610754565b60385460345474010000000000000000000000000000000000000000900463ffffffff161461206a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4e6f742066696e697368656400000000000000000000000000000000000000006044820152606401610754565b60335473ffffffffffffffffffffffffffffffffffffffff166120e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4e6f7420737570706f72746564000000000000000000000000000000000000006044820152606401610754565b60365460375411612156576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f4e6f2072656d61696e696e6720746f6b656e00000000000000000000000000006044820152606401610754565b60006036546037546121689190614f69565b60335490915061218f9073ffffffffffffffffffffffffffffffffffffffff16338361237d565b50610ee260017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b336121f87f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614610ee2576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610754565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0080547ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016122c2576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60029055565b60405173ffffffffffffffffffffffffffffffffffffffff84811660248301528381166044830152606482018390526123519186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612e0d565b50505050565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b60405173ffffffffffffffffffffffffffffffffffffffff838116602483015260448201839052611ba691859182169063a9059cbb9060640161230a565b3073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000f55f8b3c7d75a84c3d88148a22f6dc61d162719b16148061248857507f000000000000000000000000f55f8b3c7d75a84c3d88148a22f6dc61d162719b73ffffffffffffffffffffffffffffffffffffffff1661246f7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15610ee2576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600054604080518082018252600881527f5570677261646572000000000000000000000000000000000000000000000000602082015290517f0205febe000000000000000000000000000000000000000000000000000000008152339273ffffffffffffffffffffffffffffffffffffffff1691630205febe916125469190600401614e8e565b602060405180830381865afa158015612563573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061258791906151e9565b73ffffffffffffffffffffffffffffffffffffffff16146109a4576040517f34c67d49000000000000000000000000000000000000000000000000000000008152336004820152602401610754565b8173ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561265b575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261265891810190615246565b60015b6126a9576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610754565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8114612705576040517faa1d49a400000000000000000000000000000000000000000000000000000000815260048101829052602401610754565b611ba68383612ea3565b3073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000f55f8b3c7d75a84c3d88148a22f6dc61d162719b1614610ee2576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81516020808401919091206040805146818501523081830152606080820184905282518083039091018152608090910190915280519201919091206127c38184612f06565b506000806127d08661306d565b9150915081603888815481106127e8576127e8614f9d565b90600052602060002090600e0201600101600082015181600001908161280e91906152a7565b506020828101516001830180546040860151606087015160ff9094167fffffffffffffffffffffffffffffffffffffffffffffff0000000000000000009092169190911761010067ffffffffffffffff92831602177fffffffffffffffffffffffffffffff0000000000000000ffffffffffffffffff16690100000000000000000091909316029190911790556080830151600283015560a083015180516128bc926003850192019061474d565b5060c0820151816004015560e08201518160050155610100820151816006015561012082015181600701556101408201518160080155905050806038888154811061290957612909614f9d565b90600052602060002090600e0201600d01908051906020019061292d9291906147d7565b5060355467ffffffffffffffff16158061295a5750604082015160355467ffffffffffffffff9182169116115b1561299d576040820151603580547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff9092169190911790555b60355468010000000000000000900467ffffffffffffffff1615806129e35750606082015160355467ffffffffffffffff91821668010000000000000000909104909116105b15612a335760608201516035805467ffffffffffffffff90921668010000000000000000027fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff9092169190911790555b50505050505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080547fffffffffffffffffffffffff0000000000000000000000000000000000000000811673ffffffffffffffffffffffffffffffffffffffff848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b612ada612247565b6038548510612b45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c6964207068617365000000000000000000000000000000000000006044820152606401610754565b60008311612baf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f496e76616c696420616d6f756e740000000000000000000000000000000000006044820152606401610754565b60388581548110612bc257612bc2614f9d565b60009182526020909120600e909102015460ff1615612c3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f50686173652072656d6f766564000000000000000000000000000000000000006044820152606401610754565b612c488785856134b6565b600060388681548110612c5d57612c5d614f9d565b90600052602060002090600e02016001016004015484612c7d91906153c1565b905060388681548110612c9257612c92614f9d565b6000918252602082206002600e90920201015460ff169003612cc357612cbd8888888885888861358b565b50612cd4565b612cd2888888888588886136c4565b505b612a3360017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0055565b612d056136d1565b610ee2613738565b6113d433613740565b60345460405160009173ffffffffffffffffffffffffffffffffffffffff169083905b60006040518083038185875af1925050503d8060008114612d76576040519150601f19603f3d011682016040523d82523d6000602084013e612d7b565b606091505b5050905080610d07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5472616e73666572206661696c656400000000000000000000000000000000006044820152606401610754565b603454610d079073ffffffffffffffffffffffffffffffffffffffff84811691168361237d565b6000612e2f73ffffffffffffffffffffffffffffffffffffffff841683613751565b90508051600014158015612e54575080806020019051810190612e5291906153fc565b155b15611ba6576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152602401610754565b612eac8261375f565b60405173ffffffffffffffffffffffffffffffffffffffff8316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115612efe57611ba6828261382e565b610d076138b1565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c839052603c81208190612f4190846138e9565b905060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166346657fe96040518163ffffffff1660e01b8152600401602060405180830381865afa158015612fae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fd291906151e9565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614613066576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496e76616c6964207369676e61747572650000000000000000000000000000006044820152606401610754565b9392505050565b6130e460405180610160016040528060608152602001600060ff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600081526020016060815260200160008152602001600081526020016000815260200160008152602001600080191681525090565b6060828060200190518101906130fa9190615563565b909250905060005b8260a00151518110156132385760005460a0840151805173ffffffffffffffffffffffffffffffffffffffff9092169163fca8d47191908490811061314957613149614f9d565b60200260200101516040518263ffffffff1660e01b8152600401613189919073ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b602060405180830381865afa1580156131a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131ca91906153fc565b613230576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e737570706f727465642063757272656e63790000000000000000000000006044820152606401610754565b600101613102565b50602082015160ff1615806132545750816020015160ff166001145b6132ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f496e76616c696420636c61696d207479706500000000000000000000000000006044820152606401610754565b42826040015167ffffffffffffffff161015613332576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f496e76616c69642073746172742074696d6500000000000000000000000000006044820152606401610754565b42826060015167ffffffffffffffff16116133a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c696420656e642074696d65000000000000000000000000000000006044820152606401610754565b816040015167ffffffffffffffff16826060015167ffffffffffffffff161161342e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f496e76616c69642074696d652072616e676500000000000000000000000000006044820152606401610754565b8160e001518261010001511015801561344b575060008260e00151115b6134b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f496e76616c696420616d6f756e742072616e67650000000000000000000000006044820152606401610754565b915091565b806000036134c357505050565b600080546040517f9704122c00000000000000000000000000000000000000000000000000000000815260048101849052829173ffffffffffffffffffffffffffffffffffffffff1690639704122c906024016040805180830381865afa158015613532573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135569190615684565b909250905073ffffffffffffffffffffffffffffffffffffffff841661357f57610f4982613913565b610f49858584846139c4565b8183613597878a610ee4565b6135a19190614fcc565b1115613609576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f45786365656473206d617820616d6f756e7400000000000000000000000000006044820152606401610754565b6136168588888787613a9c565b60004630878a8660388b8154811061363057613630614f9d565b90600052602060002090600e0201600101600801546040516020016136979695949392919095865273ffffffffffffffffffffffffffffffffffffffff9485166020870152604086019390935292166060840152608083019190915260a082015260c00190565b6040516020818303038152906040528051906020012090506136b98183612f06565b505050505050505050565b612a338588888787613a9c565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff16610ee2576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6123576136d1565b6137486136d1565b6109a481614366565b60606130668383600061436e565b8073ffffffffffffffffffffffffffffffffffffffff163b6000036137c8576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610754565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60606000808473ffffffffffffffffffffffffffffffffffffffff168460405161385891906156a8565b600060405180830381855af49150503d8060008114613893576040519150601f19603f3d011682016040523d82523d6000602084013e613898565b606091505b50915091506138a8858383614431565b95945050505050565b3415610ee2576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806000806138f986866144c0565b925092509250613909828261450d565b5090949350505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663707d18486040518163ffffffff1660e01b8152600401602060405180830381865afa158015613981573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139a591906151e9565b73ffffffffffffffffffffffffffffffffffffffff1682604051612d39565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663707d18486040518163ffffffff1660e01b8152600401602060405180830381865afa158015613a32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a5691906151e9565b9050613a7a73ffffffffffffffffffffffffffffffffffffffff85168683866122c8565b610f4973ffffffffffffffffffffffffffffffffffffffff85168630856122c8565b6000613aa78661102c565b905060375482603654613aba9190614fcc565b1115613b22576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f45786365656473206d61780000000000000000000000000000000000000000006044820152606401610754565b806080015182613ba360388981548110613b3e57613b3e614f9d565b90600052602060002090600e0201600d01805480602002602001604051908101604052809291908181526020018280548015613b9957602002820191906000526020600020905b815481526020019060010190808311613b85575b5050505050610e67565b613bad9190614fcc565b1115613c15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f45786365656473206d61782070686173650000000000000000000000000000006044820152606401610754565b60005b8160a0015151811015613cec578373ffffffffffffffffffffffffffffffffffffffff168260a001518281518110613c5257613c52614f9d565b602002602001015173ffffffffffffffffffffffffffffffffffffffff160315613cec578160a00151518110613ce4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c69642063757272656e6379000000000000000000000000000000006044820152606401610754565b600101613c18565b5080610120015182613cfe8888610ee4565b613d089190614fcc565b1115613d70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f45786365656473206d6178207065722077616c6c6574000000000000000000006044820152606401610754565b73ffffffffffffffffffffffffffffffffffffffff8316613e0457348160c0015183613d9c91906156c4565b1115613e04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c6964207072696365000000000000000000000000000000000000006044820152606401610754565b8060e001518210158015613e1d57508061010001518211155b613e83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f496e76616c696420616d6f756e740000000000000000000000000000000000006044820152606401610754565b806040015167ffffffffffffffff16421015613efb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f4e6f7420737461727465640000000000000000000000000000000000000000006044820152606401610754565b806060015167ffffffffffffffff16421115613f73576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f456e6465640000000000000000000000000000000000000000000000000000006044820152606401610754565b5060388581548110613f8757613f87614f9d565b6000918252602080832073ffffffffffffffffffffffffffffffffffffffff88168452600b600e909302019190910190526040812054900361401f57600160388681548110613fd857613fd8614f9d565b600091825260208220600a600e9092020101805490919061400090849063ffffffff166156db565b92506101000a81548163ffffffff021916908363ffffffff1602179055505b73ffffffffffffffffffffffffffffffffffffffff8316600090815260396020526040812054900361408c576001603460188282829054906101000a900463ffffffff1661406d91906156db565b92506101000a81548163ffffffff021916908363ffffffff1602179055505b80603886815481106140a0576140a0614f9d565b90600052602060002090600e0201600b0160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546140fd9190614fcc565b92505081905550806038868154811061411857614118614f9d565b90600052602060002090600e0201600c0160008282546141389190614fcc565b909155505073ffffffffffffffffffffffffffffffffffffffff831660009081526039602052604081208054839290614172908490614fcc565b92505081905550806036600082825461418b9190614fcc565b909155506141999050610f50565b73ffffffffffffffffffffffffffffffffffffffff1663b0c3dae67f310e92ded193ec0e5247c49d1c672d225df46793bacc87e4a995a1565c9978fa878760388a815481106141ea576141ea614f9d565b6000918252602080832073ffffffffffffffffffffffffffffffffffffffff8d81168552600e9390930201600b018152604080842054928c168452603990915290912054603880548b9291908e90811061424657614246614f9d565b90600052602060002090600e0201600c015460365460388f8154811061426e5761426e614f9d565b6000918252602091829020600e9190910201600a0154603454604080519384019a909a5273ffffffffffffffffffffffffffffffffffffffff98891699830199909952606082019690965295909316608086015260a085019190915260c084015260e083015263ffffffff9081166101008301527801000000000000000000000000000000000000000000000000909204909116610120820152610140016040516020818303038152906040526040518363ffffffff1660e01b8152600401614338929190614f7c565b600060405180830381600087803b15801561435257600080fd5b505af11580156136b9573d6000803e3d6000fd5b611c206136d1565b6060814710156143ac576040517fcd786059000000000000000000000000000000000000000000000000000000008152306004820152602401610754565b6000808573ffffffffffffffffffffffffffffffffffffffff1684866040516143d591906156a8565b60006040518083038185875af1925050503d8060008114614412576040519150601f19603f3d011682016040523d82523d6000602084013e614417565b606091505b5091509150614427868383614431565b9695505050505050565b6060826144465761444182614611565b613066565b815115801561446a575073ffffffffffffffffffffffffffffffffffffffff84163b155b156144b9576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610754565b5080613066565b600080600083516041036144fa5760208401516040850151606086015160001a6144ec88828585614653565b955095509550505050614506565b50508151600091506002905b9250925092565b6000826003811115614521576145216156f8565b0361452a575050565b600182600381111561453e5761453e6156f8565b03614575576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002826003811115614589576145896156f8565b036145c3576040517ffce698f700000000000000000000000000000000000000000000000000000000815260048101829052602401610754565b60038260038111156145d7576145d76156f8565b03610d07576040517fd78bce0c00000000000000000000000000000000000000000000000000000000815260048101829052602401610754565b8051156146215780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111561468e5750600091506003905082614743565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156146e2573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661473957506000925060019150829050614743565b9250600091508190505b9450945094915050565b8280548282559060005260206000209081019282156147c7579160200282015b828111156147c757825182547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90911617825560209092019160019091019061476d565b506147d3929150614812565b5090565b8280548282559060005260206000209081019282156147c7579160200282015b828111156147c75782518255916020019190600101906147f7565b5b808211156147d35760008155600101614813565b60006020828403121561483957600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff811681146109a457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610160810167ffffffffffffffff811182821017156148b5576148b5614862565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561490257614902614862565b604052919050565b600067ffffffffffffffff82111561492457614924614862565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600061496361495e8461490a565b6148bb565b905082815283838301111561497757600080fd5b828260208301376000602084830101529392505050565b600082601f83011261499f57600080fd5b61306683833560208501614950565b600080604083850312156149c157600080fd5b82356149cc81614840565b9150602083013567ffffffffffffffff8111156149e857600080fd5b6149f48582860161498e565b9150509250929050565b60008060408385031215614a1157600080fd5b823567ffffffffffffffff80821115614a2957600080fd5b614a358683870161498e565b93506020850135915080821115614a4b57600080fd5b506149f48582860161498e565b600067ffffffffffffffff821115614a7257614a72614862565b5060051b60200190565b60006020808385031215614a8f57600080fd5b823567ffffffffffffffff811115614aa657600080fd5b8301601f81018513614ab757600080fd5b8035614ac561495e82614a58565b81815260059190911b82018301908381019087831115614ae457600080fd5b928401925b82841015614b0257833582529284019290840190614ae9565b979650505050505050565b60008060408385031215614b2057600080fd5b823591506020830135614b3281614840565b809150509250929050565b600080600080600060a08688031215614b5557600080fd5b853594506020860135614b6781614840565b93506040860135925060608601359150608086013567ffffffffffffffff811115614b9157600080fd5b614b9d8882890161498e565b9150509295509295909350565b60008060008060008060c08789031215614bc357600080fd5b8635614bce81614840565b9550602087013594506040870135614be581614840565b9350606087013592506080870135915060a087013567ffffffffffffffff811115614c0f57600080fd5b614c1b89828a0161498e565b9150509295509295509295565b60005b83811015614c43578181015183820152602001614c2b565b50506000910152565b60008151808452614c64816020860160208601614c28565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60008151808452602080850194506020840160005b83811015614cdd57815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101614cab565b509495945050505050565b6020815260008251610160806020850152614d07610180850183614c4c565b91506020850151614d1d604086018260ff169052565b50604085015167ffffffffffffffff8116606086015250606085015167ffffffffffffffff8116608086015250608085015160a085015260a08501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08584030160c0860152614d8d8382614c96565b60c087015160e087810191909152870151610100808801919091528701516101208088019190915287015161014080880191909152909601519190940152509192915050565b600060208284031215614de557600080fd5b813561306681614840565b600080600080600060a08688031215614e0857600080fd5b8535614e1381614840565b94506020860135614e2381614840565b9350604086013567ffffffffffffffff811115614e3f57600080fd5b8601601f81018813614e5057600080fd5b614e5f88823560208401614950565b9350506060860135614e7081614840565b91506080860135614e8081614840565b809150509295509295909350565b6020815260006130666020830184614c4c565b600080600060608486031215614eb657600080fd5b83359250602084013567ffffffffffffffff80821115614ed557600080fd5b614ee18783880161498e565b93506040860135915080821115614ef757600080fd5b50614f048682870161498e565b9150509250925092565b60008060408385031215614f2157600080fd5b8235614f2c81614840565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115610f3457610f34614f3a565b828152604060208201526000614f956040830184614c4c565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b80820180821115610f3457610f34614f3a565b600181811c90821680614ff357607f821691505b6020821081036109f1577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000815461503981614fdf565b808552602060018381168015615056576001811461508e576150bc565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008516838901528284151560051b89010195506150bc565b866000528260002060005b858110156150b45781548a8201860152908301908401615099565b890184019650505b505050505092915050565b600081548084526020808501945083600052602060002060005b83811015614cdd57815473ffffffffffffffffffffffffffffffffffffffff16875295820195600191820191016150e1565b8281526040602082015260006101608060408401526151366101a084018561502c565b600185015460ff8116606086015267ffffffffffffffff600882901c8116608087015260489190911c1660a0850152600285015460c08501528381037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160e08501526151a681600387016150c7565b9050600485015461010085015260058501546101208501526006850154610140850152600785015482850152600885015461018085015280925050509392505050565b6000602082840312156151fb57600080fd5b815161306681614840565b6060815260006152196060830186614c4c565b73ffffffffffffffffffffffffffffffffffffffff94851660208401529290931660409091015292915050565b60006020828403121561525857600080fd5b5051919050565b601f821115611ba6576000816000526020600020601f850160051c810160208610156152885750805b601f850160051c820191505b81811015610ce457828155600101615294565b815167ffffffffffffffff8111156152c1576152c1614862565b6152d5816152cf8454614fdf565b8461525f565b602080601f83116001811461532857600084156152f25750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610ce4565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561537557888601518255948401946001909101908401615356565b50858210156153b157878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b6000826153f7577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006020828403121561540e57600080fd5b8151801515811461306657600080fd5b600082601f83011261542f57600080fd5b815161543d61495e8261490a565b81815284602083860101111561545257600080fd5b614f95826020830160208701614c28565b805160ff8116811461547457600080fd5b919050565b805167ffffffffffffffff8116811461547457600080fd5b600082601f8301126154a257600080fd5b815160206154b261495e83614a58565b8083825260208201915060208460051b8701019350868411156154d457600080fd5b602086015b848110156154f95780516154ec81614840565b83529183019183016154d9565b509695505050505050565b600082601f83011261551557600080fd5b8151602061552561495e83614a58565b8083825260208201915060208460051b87010193508684111561554757600080fd5b602086015b848110156154f9578051835291830191830161554c565b6000806040838503121561557657600080fd5b825167ffffffffffffffff8082111561558e57600080fd5b9084019061016082870312156155a357600080fd5b6155ab614891565b8251828111156155ba57600080fd5b6155c68882860161541e565b8252506155d560208401615463565b60208201526155e660408401615479565b60408201526155f760608401615479565b60608201526080830151608082015260a08301518281111561561857600080fd5b61562488828601615491565b60a08301525060c0838101519082015260e0808401519082015261010080840151908201526101208084015190820152610140928301519281019290925260208501519193508082111561567757600080fd5b506149f485828601615504565b6000806040838503121561569757600080fd5b505080516020909101519092909150565b600082516156ba818460208701614c28565b9190910192915050565b8082028115828204841417610f3457610f34614f3a565b63ffffffff818116838216019080821115610ec957610ec9614f3a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea164736f6c6343000819000a

Block Transaction Difficulty 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
Loading...
Loading
[ 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.