S Price: $0.070281 (-0.90%)
Gas: 55 Gwei

Contract

0x19c27cb300A33b9e7f6BbF1ea17559869cf82a41

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OrderExecutor

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
london EvmVersion, MIT license
// SPDX-License-Identifier: MIT
import "./interfaces/IPriceManager.sol";
import "./interfaces/IPositionVault.sol";
import "./interfaces/IOperators.sol";
import "./interfaces/IOrderVault.sol";
import "./interfaces/ILiquidateVault.sol";
import "./interfaces/IExtentedPyth.sol";
import "./interfaces/IVault.sol";

import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

pragma solidity 0.8.9;

contract OrderExecutor is Initializable {
    IOperators public operators;

    IPriceManager private priceManager;
    IPositionVault private positionVault;
    IOrderVault private orderVault;
    ILiquidateVault private liquidateVault;
    uint256 internal constant BASIS_POINTS_DIVISOR = 100000;

    function initialize(IPriceManager _priceManager,
        IPositionVault _positionVault,
        IOrderVault _orderVault,
        IOperators _operators,
        ILiquidateVault _liquidateVault
    ) public initializer {
        require(AddressUpgradeable.isContract(address(_priceManager)), "priceManager invalid");
        require(AddressUpgradeable.isContract(address(_positionVault)), "positionVault invalid");
        require(AddressUpgradeable.isContract(address(_orderVault)), "orderVault invalid");
        require(AddressUpgradeable.isContract(address(_operators)), "operators is invalid");
        require(AddressUpgradeable.isContract(address(_liquidateVault)), "liquidateVault is invalid");

        priceManager = _priceManager;
        orderVault = _orderVault;
        positionVault = _positionVault;
        operators = _operators;
        liquidateVault = _liquidateVault;
    }

    modifier onlyOperator(uint256 level) {
        _onlyOperator(level);
        _;
    }

    function _onlyOperator(uint256 level) private view {
        require(operators.getOperatorLevel(msg.sender) >= level, "invalid operator");
    }

    modifier setPrice(uint256[] memory _assets, uint256[] memory _prices, uint256 _timestamp, bytes[] calldata _updateData) {
        require(_assets.length == _prices.length, 'invalid length');
        uint256 _ts = block.timestamp >= _timestamp ? _timestamp : block.timestamp;
        if (_updateData.length > 0) {
            priceManager.pyth().updatePriceFeeds{value : msg.value}(_updateData);
        }
        for (uint256 i = 0; i < _assets.length; i++) {
            priceManager.setPrice(_assets[i], _prices[i], _ts);
        }
        _;
    }


    function setPricesAndExecuteOrders(
        uint256[] memory _assets,
        uint256[] memory _prices,
        uint256 _timestamp,
        uint256 _numPositions,
        bytes[] calldata _updateData
    ) external payable onlyOperator(1) setPrice(_assets, _prices, _timestamp, _updateData) {
        positionVault.executeOrders(_numPositions);
    }

    function setPricesAndExecuteOrders(
        uint256[] memory _assets,
        uint256[] memory _prices,
        uint256 _timestamp,
        uint256 _numPositions,
        uint256 _queueIndex,
        bytes[] calldata _updateData
    ) external payable onlyOperator(1) setPrice(_assets, _prices, _timestamp, _updateData) {
        require(positionVault.queueIndex() == _queueIndex, "invalid queueIndex");
        positionVault.executeOrders(_numPositions);
    }


    function setPricesAndTriggerForOpenOrders(
        uint256[] memory _assets,
        uint256[] memory _prices,
        uint256 _timestamp,
        uint256[] memory _posIds,
        bytes[] calldata _updateData
    ) external payable onlyOperator(1) setPrice(_assets, _prices, _timestamp, _updateData) {
        for (uint256 i = 0; i < _posIds.length; i++) {
            orderVault.triggerForOpenOrders(_posIds[i]);
        }
    }


    function setPricesAndForceClosePosition(
        uint256[] memory _assets,
        uint256[] memory _prices,
        uint256 _timestamp,
        address _vault,
        uint256[] memory _posIds,
        bytes[] calldata _updateData
    ) external payable onlyOperator(1) setPrice(_assets, _prices, _timestamp, _updateData) {
        for (uint256 i = 0; i < _posIds.length; i++) {
            IVault(_vault).forceClosePosition(_posIds[i]);
        }
    }

    function setPricesAndUpdateTrailingStops(
        uint256[] memory _assets,
        uint256[] memory _prices,
        uint256 _timestamp,
        uint256[] memory _posIds,
        bytes[] calldata _updateData
    ) external payable onlyOperator(1) setPrice(_assets, _prices, _timestamp, _updateData) {
        for (uint256 i = 0; i < _posIds.length; i++) {
            orderVault.updateTrailingStop(_posIds[i]);
        }
    }

    function setPricesAndTriggerForTPSL(
        uint256[] memory _assets,
        uint256[] memory _prices,
        uint256 _timestamp,
        uint256[] memory _tpslPosIds,
        bytes[] calldata _updateData
    ) external payable onlyOperator(1) setPrice(_assets, _prices, _timestamp, _updateData) {
        for (uint256 i = 0; i < _tpslPosIds.length; i++) {
            orderVault.triggerForTPSL(_tpslPosIds[i]);
        }
    }

    function setPricesAndTrigger(
        uint256[] memory _assets,
        uint256[] memory _prices,
        uint256 _timestamp,
        uint256[] memory _posIds,
        uint256[] memory _tpslPosIds,
        uint256[] memory _trailingStopPosIds,
        bytes[] calldata _updateData
    ) external payable onlyOperator(1) setPrice(_assets, _prices, _timestamp, _updateData) {
        for (uint256 i = 0; i < _posIds.length; i++) {
            orderVault.triggerForOpenOrders(_posIds[i]);
        }
        for (uint256 i = 0; i < _tpslPosIds.length; i++) {
            orderVault.triggerForTPSL(_tpslPosIds[i]);
        }
        for (uint256 i = 0; i < _trailingStopPosIds.length; i++) {
            orderVault.updateTrailingStop(_trailingStopPosIds[i]);
        }
    }

    function setPricesAndLiquidatePositions(
        uint256[] memory _assets,
        uint256[] memory _prices,
        uint256 _timestamp,
        uint256[] memory _posIds,
        bytes[] calldata _updateData
    ) external payable onlyOperator(1) setPrice(_assets, _prices, _timestamp, _updateData) {
        for (uint256 i = 0; i < _posIds.length; i++) {
            liquidateVault.liquidatePosition(_posIds[i]);
        }
    }

    function getUpdateFee(
        bytes[] calldata updateData
    ) external view returns (uint feeAmount) {
        IPyth pyth = priceManager.pyth();
        return pyth.getUpdateFee(updateData);
    }

    function getListInvalidPythPrice(
        uint256[] memory _assets,
        uint256[] memory _prices) public view returns (bool[] memory results, bytes32[] memory pythIds) {
        return getListInvalidPythPrice(_assets, _prices, block.timestamp);
    }
    function getListInvalidPythPrice(
        uint256[] memory _assets,
        uint256[] memory _prices,
        uint256 _timestamp
        ) public view returns (bool[] memory results, bytes32[] memory pythIds) {
        pythIds = new bytes32[](_assets.length);
        results = new bool[](_assets.length);
        IPyth pyth = priceManager.pyth();
        for (uint256 i = 0; i < _assets.length; i++) {
            uint256 _assetId = _assets[i];
            uint256 _price = _prices[i];
            bytes32 pythId;
            uint256 allowedStaleness;
            uint256 allowedDeviation;
            (, pythId,,,allowedStaleness,allowedDeviation,,) = priceManager.assets(_assetId);
            bool needUpdate = false;
            if (pythId != bytes32(0)) {

                if (IExtentedPyth(address(pyth)).priceFeedExists(pythId)) {
                    PythStructs.Price memory priceInfo = pyth.getPriceUnsafe(pythId);
                    if (_timestamp > priceInfo.publishTime + allowedStaleness) {
                        needUpdate = true;
                    } else {
                        uint256 priceOnChain = priceManager.getPythLastPrice(_assetId, false);
                        uint256 deviation = _price > priceOnChain
                        ? ((_price - priceOnChain) * BASIS_POINTS_DIVISOR) / priceOnChain
                        : ((priceOnChain - _price) * BASIS_POINTS_DIVISOR) / priceOnChain;
                        needUpdate = deviation > allowedDeviation;
                    }
                } else {
                    needUpdate = true;
                }
            }
            pythIds[i] = pythId;
            results[i] = needUpdate;
        }
    }


    function getTokenIdsOfUnExecuteOrders(uint256 maxNumOfOrders) public view returns (uint256, uint256[] memory) {
        uint256 _num = positionVault.getNumOfUnexecuted();
        uint256 numOfOrders = _num > maxNumOfOrders ? maxNumOfOrders : _num;
        uint256 index = positionVault.queueIndex();
        uint256 endIndex = index + numOfOrders;
        uint256 length = positionVault.getNumOfUnexecuted() + index;
        if (endIndex > length) endIndex = length;
        uint256[] memory tokenIds = new uint256[](endIndex - index);
        uint256 p = 0;
        while (index < endIndex) {
            uint256 t = positionVault.queuePosIds(index);
            uint256 posId = t % 2 ** 128;
            tokenIds[p] = positionVault.getPosition(posId).tokenId;
            ++index;
            ++p;
        }
        return (numOfOrders, tokenIds);
    }

    function getUnExecutePosition(uint256 maxNumOfOrders) public view returns (uint256, uint256, Position[] memory) {
        uint256 _num = positionVault.getNumOfUnexecuted();
        uint256 numOfOrders = _num > maxNumOfOrders ? maxNumOfOrders : _num;
        uint256 queueIndex = positionVault.queueIndex();
        uint256 index = queueIndex;
        uint256 endIndex = index + numOfOrders;
        uint256 length = positionVault.getNumOfUnexecuted() + index;
        if (endIndex > length) endIndex = length;
        Position[] memory positions = new Position[](endIndex - index);
        uint256 p = 0;
        while (index < endIndex) {
            uint256 t = positionVault.queuePosIds(index);
            uint256 posId = t % 2 ** 128;
            positions[p] = positionVault.getPosition(posId);
            ++index;
            ++p;
        }
        return (queueIndex, numOfOrders, positions);
    }



}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

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

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```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 Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://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.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

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

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

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

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

import "./PythStructs.sol";
import "./IPythEvents.sol";

/// @title Consume prices from the Pyth Network (https://pyth.network/).
/// @dev Please refer to the guidance at https://docs.pyth.network/documentation/pythnet-price-feeds/best-practices for how to consume prices safely.
/// @author Pyth Data Association
interface IPyth is IPythEvents {
    /// @notice Returns the period (in seconds) that a price feed is considered valid since its publish time
    function getValidTimePeriod() external view returns (uint validTimePeriod);

    /// @notice Returns the price and confidence interval.
    /// @dev Reverts if the price has not been updated within the last `getValidTimePeriod()` seconds.
    /// @param id The Pyth Price Feed ID of which to fetch the price and confidence interval.
    /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.
    function getPrice(
        bytes32 id
    ) external view returns (PythStructs.Price memory price);

    /// @notice Returns the exponentially-weighted moving average price and confidence interval.
    /// @dev Reverts if the EMA price is not available.
    /// @param id The Pyth Price Feed ID of which to fetch the EMA price and confidence interval.
    /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.
    function getEmaPrice(
        bytes32 id
    ) external view returns (PythStructs.Price memory price);

    /// @notice Returns the price of a price feed without any sanity checks.
    /// @dev This function returns the most recent price update in this contract without any recency checks.
    /// This function is unsafe as the returned price update may be arbitrarily far in the past.
    ///
    /// Users of this function should check the `publishTime` in the price to ensure that the returned price is
    /// sufficiently recent for their application. If you are considering using this function, it may be
    /// safer / easier to use either `getPrice` or `getPriceNoOlderThan`.
    /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.
    function getPriceUnsafe(
        bytes32 id
    ) external view returns (PythStructs.Price memory price);

    /// @notice Returns the price that is no older than `age` seconds of the current time.
    /// @dev This function is a sanity-checked version of `getPriceUnsafe` which is useful in
    /// applications that require a sufficiently-recent price. Reverts if the price wasn't updated sufficiently
    /// recently.
    /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.
    function getPriceNoOlderThan(
        bytes32 id,
        uint age
    ) external view returns (PythStructs.Price memory price);

    /// @notice Returns the exponentially-weighted moving average price of a price feed without any sanity checks.
    /// @dev This function returns the same price as `getEmaPrice` in the case where the price is available.
    /// However, if the price is not recent this function returns the latest available price.
    ///
    /// The returned price can be from arbitrarily far in the past; this function makes no guarantees that
    /// the returned price is recent or useful for any particular application.
    ///
    /// Users of this function should check the `publishTime` in the price to ensure that the returned price is
    /// sufficiently recent for their application. If you are considering using this function, it may be
    /// safer / easier to use either `getEmaPrice` or `getEmaPriceNoOlderThan`.
    /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.
    function getEmaPriceUnsafe(
        bytes32 id
    ) external view returns (PythStructs.Price memory price);

    /// @notice Returns the exponentially-weighted moving average price that is no older than `age` seconds
    /// of the current time.
    /// @dev This function is a sanity-checked version of `getEmaPriceUnsafe` which is useful in
    /// applications that require a sufficiently-recent price. Reverts if the price wasn't updated sufficiently
    /// recently.
    /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.
    function getEmaPriceNoOlderThan(
        bytes32 id,
        uint age
    ) external view returns (PythStructs.Price memory price);

    /// @notice Update price feeds with given update messages.
    /// This method requires the caller to pay a fee in wei; the required fee can be computed by calling
    /// `getUpdateFee` with the length of the `updateData` array.
    /// Prices will be updated if they are more recent than the current stored prices.
    /// The call will succeed even if the update is not the most recent.
    /// @dev Reverts if the transferred fee is not sufficient or the updateData is invalid.
    /// @param updateData Array of price update data.
    function updatePriceFeeds(bytes[] calldata updateData) external payable;

    /// @notice Wrapper around updatePriceFeeds that rejects fast if a price update is not necessary. A price update is
    /// necessary if the current on-chain publishTime is older than the given publishTime. It relies solely on the
    /// given `publishTimes` for the price feeds and does not read the actual price update publish time within `updateData`.
    ///
    /// This method requires the caller to pay a fee in wei; the required fee can be computed by calling
    /// `getUpdateFee` with the length of the `updateData` array.
    ///
    /// `priceIds` and `publishTimes` are two arrays with the same size that correspond to senders known publishTime
    /// of each priceId when calling this method. If all of price feeds within `priceIds` have updated and have
    /// a newer or equal publish time than the given publish time, it will reject the transaction to save gas.
    /// Otherwise, it calls updatePriceFeeds method to update the prices.
    ///
    /// @dev Reverts if update is not needed or the transferred fee is not sufficient or the updateData is invalid.
    /// @param updateData Array of price update data.
    /// @param priceIds Array of price ids.
    /// @param publishTimes Array of publishTimes. `publishTimes[i]` corresponds to known `publishTime` of `priceIds[i]`
    function updatePriceFeedsIfNecessary(
        bytes[] calldata updateData,
        bytes32[] calldata priceIds,
        uint64[] calldata publishTimes
    ) external payable;

    /// @notice Returns the required fee to update an array of price updates.
    /// @param updateData Array of price update data.
    /// @return feeAmount The required fee in Wei.
    function getUpdateFee(
        bytes[] calldata updateData
    ) external view returns (uint feeAmount);

    /// @notice Parse `updateData` and return price feeds of the given `priceIds` if they are all published
    /// within `minPublishTime` and `maxPublishTime`.
    ///
    /// You can use this method if you want to use a Pyth price at a fixed time and not the most recent price;
    /// otherwise, please consider using `updatePriceFeeds`. This method may store the price updates on-chain, if they
    /// are more recent than the current stored prices.
    ///
    /// This method requires the caller to pay a fee in wei; the required fee can be computed by calling
    /// `getUpdateFee` with the length of the `updateData` array.
    ///
    ///
    /// @dev Reverts if the transferred fee is not sufficient or the updateData is invalid or there is
    /// no update for any of the given `priceIds` within the given time range.
    /// @param updateData Array of price update data.
    /// @param priceIds Array of price ids.
    /// @param minPublishTime minimum acceptable publishTime for the given `priceIds`.
    /// @param maxPublishTime maximum acceptable publishTime for the given `priceIds`.
    /// @return priceFeeds Array of the price feeds corresponding to the given `priceIds` (with the same order).
    function parsePriceFeedUpdates(
        bytes[] calldata updateData,
        bytes32[] calldata priceIds,
        uint64 minPublishTime,
        uint64 maxPublishTime
    ) external payable returns (PythStructs.PriceFeed[] memory priceFeeds);

    /// @notice Similar to `parsePriceFeedUpdates` but ensures the updates returned are
    /// the first updates published in minPublishTime. That is, if there are multiple updates for a given timestamp,
    /// this method will return the first update. This method may store the price updates on-chain, if they
    /// are more recent than the current stored prices.
    ///
    ///
    /// @dev Reverts if the transferred fee is not sufficient or the updateData is invalid or there is
    /// no update for any of the given `priceIds` within the given time range and uniqueness condition.
    /// @param updateData Array of price update data.
    /// @param priceIds Array of price ids.
    /// @param minPublishTime minimum acceptable publishTime for the given `priceIds`.
    /// @param maxPublishTime maximum acceptable publishTime for the given `priceIds`.
    /// @return priceFeeds Array of the price feeds corresponding to the given `priceIds` (with the same order).
    function parsePriceFeedUpdatesUnique(
        bytes[] calldata updateData,
        bytes32[] calldata priceIds,
        uint64 minPublishTime,
        uint64 maxPublishTime
    ) external payable returns (PythStructs.PriceFeed[] memory priceFeeds);
}

File 5 of 14 : IPythEvents.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/// @title IPythEvents contains the events that Pyth contract emits.
/// @dev This interface can be used for listening to the updates for off-chain and testing purposes.
interface IPythEvents {
    /// @dev Emitted when the price feed with `id` has received a fresh update.
    /// @param id The Pyth Price Feed ID.
    /// @param publishTime Publish time of the given price update.
    /// @param price Price of the given price update.
    /// @param conf Confidence interval of the given price update.
    event PriceFeedUpdate(
        bytes32 indexed id,
        uint64 publishTime,
        int64 price,
        uint64 conf
    );

    /// @dev Emitted when a batch price update is processed successfully.
    /// @param chainId ID of the source chain that the batch price update comes from.
    /// @param sequenceNumber Sequence number of the batch price update.
    event BatchPriceFeedUpdate(uint16 chainId, uint64 sequenceNumber);
}

File 6 of 14 : PythStructs.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

contract PythStructs {
    // A price with a degree of uncertainty, represented as a price +- a confidence interval.
    //
    // The confidence interval roughly corresponds to the standard error of a normal distribution.
    // Both the price and confidence are stored in a fixed-point numeric representation,
    // `x * (10^expo)`, where `expo` is the exponent.
    //
    // Please refer to the documentation at https://docs.pyth.network/documentation/pythnet-price-feeds/best-practices for how
    // to how this price safely.
    struct Price {
        // Price
        int64 price;
        // Confidence interval around the price
        uint64 conf;
        // Price exponent
        int32 expo;
        // Unix timestamp describing when the price was published
        uint publishTime;
    }

    // PriceFeed represents a current aggregate price from pyth publisher feeds.
    struct PriceFeed {
        // The price ID.
        bytes32 id;
        // Latest available price
        Price price;
        // Latest available exponentially-weighted moving average price
        Price emaPrice;
    }
}

// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;


interface IExtentedPyth {
    function priceFeedExists(bytes32 id) external view returns (bool);
}

// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

import {Position, Order, OrderType} from "../structs.sol";

interface ILiquidateVault {
    function validateLiquidationWithPosid(uint256 _posId) external view returns (bool, int256, int256, int256);
    function liquidatePosition(uint256 _posId) external;
}

// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

interface IOperators {
    function getOperatorLevel(address op) external view returns (uint256);
}

// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

import {Order, OrderType, OrderStatus, AddPositionOrder, DecreasePositionOrder, PositionTrigger} from "../structs.sol";

interface IOrderVault {
    function addTrailingStop(address _account, uint256 _posId, uint256[] memory _params) external;

    function addTriggerOrders(
        uint256 _posId,
        address _account,
        bool[] memory _isTPs,
        uint256[] memory _prices,
        uint256[] memory _amountPercents
    ) external;

    function cancelPendingOrder(address _account, uint256 _posId) external;

    function updateOrder(
        uint256 _posId,
        uint256 _positionType,
        uint256 _collateral,
        uint256 _size,
        OrderStatus _status
    ) external;

    function cancelMarketOrder(uint256 _posId) external;

    function createNewOrder(
        uint256 _posId,
        address _accout,
        bool _isLong,
        uint256 _tokenId,
        uint256 _positionType,
        uint256[] memory _params,
        address _refer
    ) external;

    function createAddPositionOrder(
        address _owner,
        uint256 _posId,
        uint256 _collateralDelta,
        uint256 _sizeDelta,
        uint256 _allowedPrice,
        uint256 _fee
    ) external;

    function createDecreasePositionOrder(uint256 _posId, uint256 _sizeDelta, uint256 _allowedPrice) external;

    function cancelAddPositionOrder(uint256 _posId) external;

    function deleteAddPositionOrder(uint256 _posId) external;

    function deleteDecreasePositionOrder(uint256 _posId) external;

    function getOrder(uint256 _posId) external view returns (Order memory);

    function getAddPositionOrder(uint256 _posId) external view returns (AddPositionOrder memory);

    function getDecreasePositionOrder(uint256 _posId) external view returns (DecreasePositionOrder memory);

    function getTriggerOrderInfo(uint256 _posId) external view returns (PositionTrigger memory);
    function triggerForOpenOrders(uint256 _posId) external;
    function triggerForTPSL(uint256 _posId) external;
    function updateTrailingStop(uint256 _posId) external;

}

// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

import {Position, Order, OrderType, PaidFees} from "../structs.sol";

interface IPositionVault {
    function newPositionOrder(
        address _account,
        uint256 _tokenId,
        bool _isLong,
        OrderType _orderType,
        uint256[] memory _params,
        address _refer
    ) external;

    function addOrRemoveCollateral(address _account, uint256 _posId, bool isPlus, uint256 _amount) external;

    function createAddPositionOrder(
        address _account,
        uint256 _posId,
        uint256 _collateralDelta,
        uint256 _sizeDelta,
        uint256 _allowedPrice
    ) external;

    function createDecreasePositionOrder(
        uint256 _posId,
        address _account,
        uint256 _sizeDelta,
        uint256 _allowedPrice
    ) external;

    function increasePosition(
        uint256 _posId,
        address _account,
        uint256 _tokenId,
        bool _isLong,
        uint256 _price,
        uint256 _collateralDelta,
        uint256 _sizeDelta,
        uint256 _fee
    ) external;

    function decreasePosition(uint256 _posId, uint256 _price, uint256 _sizeDelta) external;

    function decreasePositionByOrderVault(uint256 _posId, uint256 _price, uint256 _sizeDelta) external;

    function removeUserAlivePosition(address _user, uint256 _posId) external;

    function removeUserOpenOrder(address _user, uint256 _posId) external;

    function lastPosId() external view returns (uint256);
    function queueIndex() external view returns (uint256);
    function getNumOfUnexecuted() external view returns (uint256);
    function queuePosIds(uint256 _id) external view returns (uint256);

    function getPosition(uint256 _posId) external view returns (Position memory);

    function getUserPositionIds(address _account) external view returns (uint256[] memory);

    function getUserOpenOrderIds(address _account) external view returns (uint256[] memory);

    function getPaidFees(uint256 _posId) external view returns (PaidFees memory);

    function getVaultUSDBalance() external view returns (uint256);
    function executeOrders(uint256 numOfOrders) external;
}

// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;
import "@pythnetwork/pyth-sdk-solidity/IPyth.sol";

interface IPriceManager {
    function assets(uint256 _assetId) external view returns (
        string memory symbol,
        bytes32 pythId,
        uint256 price,
        uint256 timestamp,
        uint256 allowedStaleness,
        uint256 allowedDeviation,
        uint256 maxLeverage,
        uint256 tokenDecimals
    );
    function getLastPrice(uint256 _tokenId) external view returns (uint256);
    function getPythLastPrice(uint256 _assetId, bool _requireFreshness) external view returns (uint256);
    function pyth() external view returns (IPyth);

    function maxLeverage(uint256 _tokenId) external view returns (uint256);

    function tokenToUsd(address _token, uint256 _tokenAmount) external view returns (uint256);

    function usdToToken(address _token, uint256 _usdAmount) external view returns (uint256);
    function setPrice(uint256 _assetId, uint256 _price, uint256 _ts) external;
}

// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

interface IVault {
    function accountDeltaIntoTotalUSD(bool _isIncrease, uint256 _delta) external;

    function distributeFee(uint256 _fee, address _refer, address _trader) external;

    function takeNSUSDIn(address _account, uint256 _amount) external;

    function takeNSUSDOut(address _account, uint256 _amount) external;

    function lastStakedAt(address _account) external view returns (uint256);

    function getVaultUSDBalance() external view returns (uint256);

    function getNSLPPrice() external view returns (uint256);
    function forceClosePosition(uint256 _posId) external;
}

File 14 of 14 : structs.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.9;

enum OrderType {
    MARKET,
    LIMIT,
    STOP,
    STOP_LIMIT
}

enum OrderStatus {
    NONE,
    PENDING,
    FILLED,
    CANCELED
}

enum TriggerStatus {
    NONE,
    PENDING,
    OPEN,
    TRIGGERED,
    CANCELLED
}

struct Order {
    OrderStatus status;
    uint256 lmtPrice;
    uint256 size;
    uint256 collateral;
    uint256 positionType;
    uint256 stepAmount;
    uint256 stepType;
    uint256 stpPrice;
    uint256 timestamp;
}

struct AddPositionOrder {
    address owner;
    uint256 collateral;
    uint256 size;
    uint256 allowedPrice;
    uint256 timestamp;
    uint256 fee;
}

struct DecreasePositionOrder {
    uint256 size;
    uint256 allowedPrice;
    uint256 timestamp;
}

struct Position {
    address owner;
    address refer;
    bool isLong;
    uint256 tokenId;
    uint256 averagePrice;
    uint256 collateral;
    int256 fundingIndex;
    uint256 lastIncreasedTime;
    uint256 size;
    uint256 accruedBorrowFee;
}

struct PaidFees {
    uint256 paidPositionFee;
    uint256 paidBorrowFee;
    int256 paidFundingFee;
}

struct Temp {
    uint256 a;
    uint256 b;
    uint256 c;
    uint256 d;
    uint256 e;
}

struct TriggerInfo {
    bool isTP;
    uint256 amountPercent;
    uint256 createdAt;
    uint256 price;
    uint256 triggeredAmount;
    uint256 triggeredAt;
    TriggerStatus status;
}

struct PositionTrigger {
    TriggerInfo[] triggers;
}

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

Contract Security Audit

Contract ABI

API
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"inputs":[{"internalType":"uint256[]","name":"_assets","type":"uint256[]"},{"internalType":"uint256[]","name":"_prices","type":"uint256[]"}],"name":"getListInvalidPythPrice","outputs":[{"internalType":"bool[]","name":"results","type":"bool[]"},{"internalType":"bytes32[]","name":"pythIds","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_assets","type":"uint256[]"},{"internalType":"uint256[]","name":"_prices","type":"uint256[]"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"getListInvalidPythPrice","outputs":[{"internalType":"bool[]","name":"results","type":"bool[]"},{"internalType":"bytes32[]","name":"pythIds","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxNumOfOrders","type":"uint256"}],"name":"getTokenIdsOfUnExecuteOrders","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxNumOfOrders","type":"uint256"}],"name":"getUnExecutePosition","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"refer","type":"address"},{"internalType":"bool","name":"isLong","type":"bool"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"averagePrice","type":"uint256"},{"internalType":"uint256","name":"collateral","type":"uint256"},{"internalType":"int256","name":"fundingIndex","type":"int256"},{"internalType":"uint256","name":"lastIncreasedTime","type":"uint256"},{"internalType":"uint256","name":"size","type":"uint256"},{"internalType":"uint256","name":"accruedBorrowFee","type":"uint256"}],"internalType":"struct Position[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"updateData","type":"bytes[]"}],"name":"getUpdateFee","outputs":[{"internalType":"uint256","name":"feeAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IPriceManager","name":"_priceManager","type":"address"},{"internalType":"contract IPositionVault","name":"_positionVault","type":"address"},{"internalType":"contract IOrderVault","name":"_orderVault","type":"address"},{"internalType":"contract IOperators","name":"_operators","type":"address"},{"internalType":"contract ILiquidateVault","name":"_liquidateVault","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"operators","outputs":[{"internalType":"contract IOperators","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_assets","type":"uint256[]"},{"internalType":"uint256[]","name":"_prices","type":"uint256[]"},{"internalType":"uint256","name":"_timestamp","type":"uint256"},{"internalType":"uint256","name":"_numPositions","type":"uint256"},{"internalType":"uint256","name":"_queueIndex","type":"uint256"},{"internalType":"bytes[]","name":"_updateData","type":"bytes[]"}],"name":"setPricesAndExecuteOrders","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_assets","type":"uint256[]"},{"internalType":"uint256[]","name":"_prices","type":"uint256[]"},{"internalType":"uint256","name":"_timestamp","type":"uint256"},{"internalType":"uint256","name":"_numPositions","type":"uint256"},{"internalType":"bytes[]","name":"_updateData","type":"bytes[]"}],"name":"setPricesAndExecuteOrders","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_assets","type":"uint256[]"},{"internalType":"uint256[]","name":"_prices","type":"uint256[]"},{"internalType":"uint256","name":"_timestamp","type":"uint256"},{"internalType":"address","name":"_vault","type":"address"},{"internalType":"uint256[]","name":"_posIds","type":"uint256[]"},{"internalType":"bytes[]","name":"_updateData","type":"bytes[]"}],"name":"setPricesAndForceClosePosition","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_assets","type":"uint256[]"},{"internalType":"uint256[]","name":"_prices","type":"uint256[]"},{"internalType":"uint256","name":"_timestamp","type":"uint256"},{"internalType":"uint256[]","name":"_posIds","type":"uint256[]"},{"internalType":"bytes[]","name":"_updateData","type":"bytes[]"}],"name":"setPricesAndLiquidatePositions","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_assets","type":"uint256[]"},{"internalType":"uint256[]","name":"_prices","type":"uint256[]"},{"internalType":"uint256","name":"_timestamp","type":"uint256"},{"internalType":"uint256[]","name":"_posIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_tpslPosIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_trailingStopPosIds","type":"uint256[]"},{"internalType":"bytes[]","name":"_updateData","type":"bytes[]"}],"name":"setPricesAndTrigger","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_assets","type":"uint256[]"},{"internalType":"uint256[]","name":"_prices","type":"uint256[]"},{"internalType":"uint256","name":"_timestamp","type":"uint256"},{"internalType":"uint256[]","name":"_posIds","type":"uint256[]"},{"internalType":"bytes[]","name":"_updateData","type":"bytes[]"}],"name":"setPricesAndTriggerForOpenOrders","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_assets","type":"uint256[]"},{"internalType":"uint256[]","name":"_prices","type":"uint256[]"},{"internalType":"uint256","name":"_timestamp","type":"uint256"},{"internalType":"uint256[]","name":"_tpslPosIds","type":"uint256[]"},{"internalType":"bytes[]","name":"_updateData","type":"bytes[]"}],"name":"setPricesAndTriggerForTPSL","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_assets","type":"uint256[]"},{"internalType":"uint256[]","name":"_prices","type":"uint256[]"},{"internalType":"uint256","name":"_timestamp","type":"uint256"},{"internalType":"uint256[]","name":"_posIds","type":"uint256[]"},{"internalType":"bytes[]","name":"_updateData","type":"bytes[]"}],"name":"setPricesAndUpdateTrailingStops","outputs":[],"stateMutability":"payable","type":"function"}]

608060405234801561001057600080fd5b50613718806100206000396000f3fe6080604052600436106100e85760003560e01c8063af55afac1161008a578063e673df8a11610059578063e673df8a14610243578063e96ce97c14610281578063f4c9ecb014610294578063f98f7553146102a757600080fd5b8063af55afac146101c0578063c06d3f3e146101d3578063c4dd055b14610202578063d47eed451461021557600080fd5b806346275e6b116100c657806346275e6b146101595780637aa17e271461016c57806389af8b581461019a578063a17686d5146101ad57600080fd5b80631459457a146100ed57806324d22e211461010f5780632844d83214610146575b600080fd5b3480156100f957600080fd5b5061010d610108366004612a91565b6102c7565b005b34801561011b57600080fd5b5061012f61012a366004612bf0565b6105cd565b60405161013d929190612c53565b60405180910390f35b61010d610154366004612d14565b6105e7565b61010d610167366004612e19565b6109da565b34801561017857600080fd5b5061018c610187366004612ed5565b610c89565b60405161013d929190612eee565b61010d6101a8366004612e19565b611018565b61010d6101bb366004612e19565b6112b7565b61010d6101ce366004612e19565b611556565b3480156101df57600080fd5b506101f36101ee366004612ed5565b6117f5565b60405161013d93929190612f2f565b61010d610210366004612ff0565b611bf8565b34801561022157600080fd5b5061023561023036600461309b565b611f23565b60405190815260200161013d565b34801561024f57600080fd5b50600054610269906201000090046001600160a01b031681565b6040516001600160a01b03909116815260200161013d565b61010d61028f3660046130ec565b612035565b61010d6102a2366004613199565b6122dd565b3480156102b357600080fd5b5061012f6102c236600461321b565b612549565b600054610100900460ff16158080156102e75750600054600160ff909116105b806103015750303b158015610301575060005460ff166001145b6103695760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801561038c576000805461ff0019166101001790555b6001600160a01b0386163b6103da5760405162461bcd60e51b81526020600482015260146024820152731c1c9a58d953585b9859d95c881a5b9d985b1a5960621b6044820152606401610360565b6001600160a01b0385163b6104295760405162461bcd60e51b81526020600482015260156024820152741c1bdcda5d1a5bdb95985d5b1d081a5b9d985b1a59605a1b6044820152606401610360565b6001600160a01b0384163b6104755760405162461bcd60e51b81526020600482015260126024820152711bdc99195c95985d5b1d081a5b9d985b1a5960721b6044820152606401610360565b6001600160a01b0383163b6104c35760405162461bcd60e51b81526020600482015260146024820152731bdc195c985d1bdc9cc81a5cc81a5b9d985b1a5960621b6044820152606401610360565b6001600160a01b0382163b61051a5760405162461bcd60e51b815260206004820152601960248201527f6c69717569646174655661756c7420697320696e76616c6964000000000000006044820152606401610360565b600180546001600160a01b03199081166001600160a01b03898116919091179092556003805482168784161790556002805482168884161790556000805462010000600160b01b03191662010000878516021790556004805490911691841691909117905580156105c5576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6060806105db848442612549565b915091505b9250929050565b60016105f2816129b7565b888888858583518551146106185760405162461bcd60e51b815260040161036090613287565b600083421015610628574261062a565b835b9050811561071957600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b15801561068057600080fd5b505afa158015610694573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b891906132af565b6001600160a01b031663ef9e5e283485856040518463ffffffff1660e01b81526004016106e69291906132fc565b6000604051808303818588803b1580156106ff57600080fd5b505af1158015610713573d6000803e3d6000fd5b50505050505b60005b86518110156107e55760015487516001600160a01b039091169063aa585d569089908490811061074e5761074e613396565b602002602001015188848151811061076857610768613396565b6020026020010151856040518463ffffffff1660e01b81526004016107a0939291909283526020830191909152604082015260600190565b600060405180830381600087803b1580156107ba57600080fd5b505af11580156107ce573d6000803e3d6000fd5b5050505080806107dd906133c2565b91505061071c565b5060005b8c51811015610886576003548d516001600160a01b03909116906396759c94908f908490811061081b5761081b613396565b60200260200101516040518263ffffffff1660e01b815260040161084191815260200190565b600060405180830381600087803b15801561085b57600080fd5b505af115801561086f573d6000803e3d6000fd5b50505050808061087e906133c2565b9150506107e9565b5060005b8b51811015610927576003548c516001600160a01b039091169063c9801068908e90849081106108bc576108bc613396565b60200260200101516040518263ffffffff1660e01b81526004016108e291815260200190565b600060405180830381600087803b1580156108fc57600080fd5b505af1158015610910573d6000803e3d6000fd5b50505050808061091f906133c2565b91505061088a565b5060005b8a518110156109c8576003548b516001600160a01b0390911690633407c8ea908d908490811061095d5761095d613396565b60200260200101516040518263ffffffff1660e01b815260040161098391815260200190565b600060405180830381600087803b15801561099d57600080fd5b505af11580156109b1573d6000803e3d6000fd5b5050505080806109c0906133c2565b91505061092b565b50505050505050505050505050505050565b60016109e5816129b7565b86868685858351855114610a0b5760405162461bcd60e51b815260040161036090613287565b600083421015610a1b5742610a1d565b835b90508115610b0c57600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7357600080fd5b505afa158015610a87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aab91906132af565b6001600160a01b031663ef9e5e283485856040518463ffffffff1660e01b8152600401610ad99291906132fc565b6000604051808303818588803b158015610af257600080fd5b505af1158015610b06573d6000803e3d6000fd5b50505050505b60005b8651811015610bd85760015487516001600160a01b039091169063aa585d5690899084908110610b4157610b41613396565b6020026020010151888481518110610b5b57610b5b613396565b6020026020010151856040518463ffffffff1660e01b8152600401610b93939291909283526020830191909152604082015260600190565b600060405180830381600087803b158015610bad57600080fd5b505af1158015610bc1573d6000803e3d6000fd5b505050508080610bd0906133c2565b915050610b0f565b5060005b8a51811015610c79576003548b516001600160a01b0390911690633407c8ea908d9084908110610c0e57610c0e613396565b60200260200101516040518263ffffffff1660e01b8152600401610c3491815260200190565b600060405180830381600087803b158015610c4e57600080fd5b505af1158015610c62573d6000803e3d6000fd5b505050508080610c71906133c2565b915050610bdc565b5050505050505050505050505050565b600060606000600260009054906101000a90046001600160a01b03166001600160a01b031663bf902b846040518163ffffffff1660e01b815260040160206040518083038186803b158015610cdd57600080fd5b505afa158015610cf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1591906133dd565b90506000848211610d265781610d28565b845b90506000600260009054906101000a90046001600160a01b03166001600160a01b031663f71978db6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d7a57600080fd5b505afa158015610d8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db291906133dd565b90506000610dc083836133f6565b9050600082600260009054906101000a90046001600160a01b03166001600160a01b031663bf902b846040518163ffffffff1660e01b815260040160206040518083038186803b158015610e1357600080fd5b505afa158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b91906133dd565b610e5591906133f6565b905080821115610e63578091505b6000610e6f848461340e565b6001600160401b03811115610e8657610e86612b02565b604051908082528060200260200182016040528015610eaf578160200160208202803683370190505b50905060005b838510156110085760025460405163f3ad896160e01b8152600481018790526000916001600160a01b03169063f3ad89619060240160206040518083038186803b158015610f0257600080fd5b505afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a91906133dd565b90506000610f4c600160801b8361343b565b60025460405163eb02c30160e01b8152600481018390529192506001600160a01b03169063eb02c301906024016101406040518083038186803b158015610f9257600080fd5b505afa158015610fa6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fca919061346a565b60600151848481518110610fe057610fe0613396565b6020908102919091010152610ff4876133c2565b9650610fff836133c2565b92505050610eb5565b5093989397509295505050505050565b6001611023816129b7565b868686858583518551146110495760405162461bcd60e51b815260040161036090613287565b600083421015611059574261105b565b835b9050811561114a57600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b1580156110b157600080fd5b505afa1580156110c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e991906132af565b6001600160a01b031663ef9e5e283485856040518463ffffffff1660e01b81526004016111179291906132fc565b6000604051808303818588803b15801561113057600080fd5b505af1158015611144573d6000803e3d6000fd5b50505050505b60005b86518110156112165760015487516001600160a01b039091169063aa585d569089908490811061117f5761117f613396565b602002602001015188848151811061119957611199613396565b6020026020010151856040518463ffffffff1660e01b81526004016111d1939291909283526020830191909152604082015260600190565b600060405180830381600087803b1580156111eb57600080fd5b505af11580156111ff573d6000803e3d6000fd5b50505050808061120e906133c2565b91505061114d565b5060005b8a51811015610c79576003548b516001600160a01b03909116906396759c94908d908490811061124c5761124c613396565b60200260200101516040518263ffffffff1660e01b815260040161127291815260200190565b600060405180830381600087803b15801561128c57600080fd5b505af11580156112a0573d6000803e3d6000fd5b5050505080806112af906133c2565b91505061121a565b60016112c2816129b7565b868686858583518551146112e85760405162461bcd60e51b815260040161036090613287565b6000834210156112f857426112fa565b835b905081156113e957600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b15801561135057600080fd5b505afa158015611364573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138891906132af565b6001600160a01b031663ef9e5e283485856040518463ffffffff1660e01b81526004016113b69291906132fc565b6000604051808303818588803b1580156113cf57600080fd5b505af11580156113e3573d6000803e3d6000fd5b50505050505b60005b86518110156114b55760015487516001600160a01b039091169063aa585d569089908490811061141e5761141e613396565b602002602001015188848151811061143857611438613396565b6020026020010151856040518463ffffffff1660e01b8152600401611470939291909283526020830191909152604082015260600190565b600060405180830381600087803b15801561148a57600080fd5b505af115801561149e573d6000803e3d6000fd5b5050505080806114ad906133c2565b9150506113ec565b5060005b8a51811015610c79576004548b516001600160a01b039091169063cdddd4e5908d90849081106114eb576114eb613396565b60200260200101516040518263ffffffff1660e01b815260040161151191815260200190565b600060405180830381600087803b15801561152b57600080fd5b505af115801561153f573d6000803e3d6000fd5b50505050808061154e906133c2565b9150506114b9565b6001611561816129b7565b868686858583518551146115875760405162461bcd60e51b815260040161036090613287565b6000834210156115975742611599565b835b9050811561168857600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b1580156115ef57600080fd5b505afa158015611603573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162791906132af565b6001600160a01b031663ef9e5e283485856040518463ffffffff1660e01b81526004016116559291906132fc565b6000604051808303818588803b15801561166e57600080fd5b505af1158015611682573d6000803e3d6000fd5b50505050505b60005b86518110156117545760015487516001600160a01b039091169063aa585d56908990849081106116bd576116bd613396565b60200260200101518884815181106116d7576116d7613396565b6020026020010151856040518463ffffffff1660e01b815260040161170f939291909283526020830191909152604082015260600190565b600060405180830381600087803b15801561172957600080fd5b505af115801561173d573d6000803e3d6000fd5b50505050808061174c906133c2565b91505061168b565b5060005b8a51811015610c79576003548b516001600160a01b039091169063c9801068908d908490811061178a5761178a613396565b60200260200101516040518263ffffffff1660e01b81526004016117b091815260200190565b600060405180830381600087803b1580156117ca57600080fd5b505af11580156117de573d6000803e3d6000fd5b5050505080806117ed906133c2565b915050611758565b60008060606000600260009054906101000a90046001600160a01b03166001600160a01b031663bf902b846040518163ffffffff1660e01b815260040160206040518083038186803b15801561184a57600080fd5b505afa15801561185e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188291906133dd565b905060008582116118935781611895565b855b90506000600260009054906101000a90046001600160a01b03166001600160a01b031663f71978db6040518163ffffffff1660e01b815260040160206040518083038186803b1580156118e757600080fd5b505afa1580156118fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191f91906133dd565b905080600061192e84836133f6565b9050600082600260009054906101000a90046001600160a01b03166001600160a01b031663bf902b846040518163ffffffff1660e01b815260040160206040518083038186803b15801561198157600080fd5b505afa158015611995573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119b991906133dd565b6119c391906133f6565b9050808211156119d1578091505b60006119dd848461340e565b6001600160401b038111156119f4576119f4612b02565b604051908082528060200260200182016040528015611a8f57816020015b611a7c60405180610140016040528060006001600160a01b0316815260200160006001600160a01b03168152602001600015158152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b815260200190600190039081611a125790505b50905060005b83851015611be55760025460405163f3ad896160e01b8152600481018790526000916001600160a01b03169063f3ad89619060240160206040518083038186803b158015611ae257600080fd5b505afa158015611af6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1a91906133dd565b90506000611b2c600160801b8361343b565b60025460405163eb02c30160e01b8152600481018390529192506001600160a01b03169063eb02c301906024016101406040518083038186803b158015611b7257600080fd5b505afa158015611b86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611baa919061346a565b848481518110611bbc57611bbc613396565b602002602001018190525086611bd1906133c2565b9650611bdc836133c2565b92505050611a95565b50939a9499509297509295505050505050565b6001611c03816129b7565b87878785858351855114611c295760405162461bcd60e51b815260040161036090613287565b600083421015611c395742611c3b565b835b90508115611d2a57600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b158015611c9157600080fd5b505afa158015611ca5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cc991906132af565b6001600160a01b031663ef9e5e283485856040518463ffffffff1660e01b8152600401611cf79291906132fc565b6000604051808303818588803b158015611d1057600080fd5b505af1158015611d24573d6000803e3d6000fd5b50505050505b60005b8651811015611df65760015487516001600160a01b039091169063aa585d5690899084908110611d5f57611d5f613396565b6020026020010151888481518110611d7957611d79613396565b6020026020010151856040518463ffffffff1660e01b8152600401611db1939291909283526020830191909152604082015260600190565b600060405180830381600087803b158015611dcb57600080fd5b505af1158015611ddf573d6000803e3d6000fd5b505050508080611dee906133c2565b915050611d2d565b506002546040805163f71978db60e01b815290518c926001600160a01b03169163f71978db916004808301926020929190829003018186803b158015611e3b57600080fd5b505afa158015611e4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e7391906133dd565b14611eb55760405162461bcd60e51b81526020600482015260126024820152710d2dcecc2d8d2c840e2eacaeaca92dcc8caf60731b6044820152606401610360565b60025460405163269ce6bb60e11b8152600481018d90526001600160a01b0390911690634d39cd7690602401600060405180830381600087803b158015611efb57600080fd5b505af1158015611f0f573d6000803e3d6000fd5b505050505050505050505050505050505050565b600080600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b158015611f7457600080fd5b505afa158015611f88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fac91906132af565b60405163d47eed4560e01b81529091506001600160a01b0382169063d47eed4590611fdd90879087906004016132fc565b60206040518083038186803b158015611ff557600080fd5b505afa158015612009573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061202d91906133dd565b949350505050565b6001612040816129b7565b878787858583518551146120665760405162461bcd60e51b815260040161036090613287565b6000834210156120765742612078565b835b9050811561216757600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b1580156120ce57600080fd5b505afa1580156120e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061210691906132af565b6001600160a01b031663ef9e5e283485856040518463ffffffff1660e01b81526004016121349291906132fc565b6000604051808303818588803b15801561214d57600080fd5b505af1158015612161573d6000803e3d6000fd5b50505050505b60005b86518110156122335760015487516001600160a01b039091169063aa585d569089908490811061219c5761219c613396565b60200260200101518884815181106121b6576121b6613396565b6020026020010151856040518463ffffffff1660e01b81526004016121ee939291909283526020830191909152604082015260600190565b600060405180830381600087803b15801561220857600080fd5b505af115801561221c573d6000803e3d6000fd5b50505050808061222b906133c2565b91505061216a565b5060005b8a518110156122cc578b6001600160a01b0316632bc61ec48c838151811061226157612261613396565b60200260200101516040518263ffffffff1660e01b815260040161228791815260200190565b600060405180830381600087803b1580156122a157600080fd5b505af11580156122b5573d6000803e3d6000fd5b5050505080806122c4906133c2565b915050612237565b505050505050505050505050505050565b60016122e8816129b7565b8686868585835185511461230e5760405162461bcd60e51b815260040161036090613287565b60008342101561231e5742612320565b835b9050811561240f57600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b15801561237657600080fd5b505afa15801561238a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123ae91906132af565b6001600160a01b031663ef9e5e283485856040518463ffffffff1660e01b81526004016123dc9291906132fc565b6000604051808303818588803b1580156123f557600080fd5b505af1158015612409573d6000803e3d6000fd5b50505050505b60005b86518110156124db5760015487516001600160a01b039091169063aa585d569089908490811061244457612444613396565b602002602001015188848151811061245e5761245e613396565b6020026020010151856040518463ffffffff1660e01b8152600401612496939291909283526020830191909152604082015260600190565b600060405180830381600087803b1580156124b057600080fd5b505af11580156124c4573d6000803e3d6000fd5b5050505080806124d3906133c2565b915050612412565b5060025460405163269ce6bb60e11b8152600481018c90526001600160a01b0390911690634d39cd7690602401600060405180830381600087803b15801561252257600080fd5b505af1158015612536573d6000803e3d6000fd5b5050505050505050505050505050505050565b60608084516001600160401b0381111561256557612565612b02565b60405190808252806020026020018201604052801561258e578160200160208202803683370190505b50905084516001600160401b038111156125aa576125aa612b02565b6040519080825280602002602001820160405280156125d3578160200160208202803683370190505b5091506000600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b15801561262657600080fd5b505afa15801561263a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061265e91906132af565b905060005b86518110156129ad57600087828151811061268057612680613396565b60200260200101519050600087838151811061269e5761269e613396565b6020908102919091010151600154604051630cf35bdd60e41b815260048101859052919250600091829182916001600160a01b039091169063cf35bdd09060240160006040518083038186803b1580156126f757600080fd5b505afa15801561270b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526127339190810190613506565b50949850909650945060009350508515915061295090505760405163b5ec026160e01b8152600481018590526001600160a01b0389169063b5ec02619060240160206040518083038186803b15801561278b57600080fd5b505afa15801561279f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127c391906135fe565b1561294c576040516396834ad360e01b8152600481018590526000906001600160a01b038a16906396834ad39060240160806040518083038186803b15801561280b57600080fd5b505afa15801561281f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128439190613619565b905083816060015161285591906133f6565b8c11156128655760019150612946565b600154604051637988116f60e01b815260048101899052600060248201819052916001600160a01b031690637988116f9060440160206040518083038186803b1580156128b157600080fd5b505afa1580156128c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128e991906133dd565b9050600081881161291c5781620186a06129038a8361340e565b61290d91906136af565b61291791906136ce565b61293f565b81620186a061292b828b61340e565b61293591906136af565b61293f91906136ce565b8510935050505b50612950565b5060015b8389888151811061296357612963613396565b602002602001018181525050808a888151811061298257612982613396565b60200260200101901515908115158152505050505050505080806129a5906133c2565b915050612663565b5050935093915050565b60005460405163df07560560e01b815233600482015282916201000090046001600160a01b03169063df0756059060240160206040518083038186803b158015612a0057600080fd5b505afa158015612a14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a3891906133dd565b1015612a795760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b21037b832b930ba37b960811b6044820152606401610360565b50565b6001600160a01b0381168114612a7957600080fd5b600080600080600060a08688031215612aa957600080fd5b8535612ab481612a7c565b94506020860135612ac481612a7c565b93506040860135612ad481612a7c565b92506060860135612ae481612a7c565b91506080860135612af481612a7c565b809150509295509295909350565b634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b0381118282101715612b3b57612b3b612b02565b60405290565b604051601f8201601f191681016001600160401b0381118282101715612b6957612b69612b02565b604052919050565b600082601f830112612b8257600080fd5b813560206001600160401b03821115612b9d57612b9d612b02565b8160051b612bac828201612b41565b9283528481018201928281019087851115612bc657600080fd5b83870192505b84831015612be557823582529183019190830190612bcc565b979650505050505050565b60008060408385031215612c0357600080fd5b82356001600160401b0380821115612c1a57600080fd5b612c2686838701612b71565b93506020850135915080821115612c3c57600080fd5b50612c4985828601612b71565b9150509250929050565b604080825283519082018190526000906020906060840190828701845b82811015612c8e578151151584529284019290840190600101612c70565b5050508381038285015284518082528583019183019060005b81811015612cc357835183529284019291840191600101612ca7565b5090979650505050505050565b60008083601f840112612ce257600080fd5b5081356001600160401b03811115612cf957600080fd5b6020830191508360208260051b85010111156105e057600080fd5b60008060008060008060008060e0898b031215612d3057600080fd5b88356001600160401b0380821115612d4757600080fd5b612d538c838d01612b71565b995060208b0135915080821115612d6957600080fd5b612d758c838d01612b71565b985060408b0135975060608b0135915080821115612d9257600080fd5b612d9e8c838d01612b71565b965060808b0135915080821115612db457600080fd5b612dc08c838d01612b71565b955060a08b0135915080821115612dd657600080fd5b612de28c838d01612b71565b945060c08b0135915080821115612df857600080fd5b50612e058b828c01612cd0565b999c989b5096995094979396929594505050565b60008060008060008060a08789031215612e3257600080fd5b86356001600160401b0380821115612e4957600080fd5b612e558a838b01612b71565b97506020890135915080821115612e6b57600080fd5b612e778a838b01612b71565b9650604089013595506060890135915080821115612e9457600080fd5b612ea08a838b01612b71565b94506080890135915080821115612eb657600080fd5b50612ec389828a01612cd0565b979a9699509497509295939492505050565b600060208284031215612ee757600080fd5b5035919050565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015612cc357845183529383019391830191600101612f13565b60006060808301868452602086818601526040838187015282875180855260809450848801915083890160005b82811015612fdf57815180516001600160a01b039081168652878201511687860152858101511515868601528881015189860152878101518886015260a0808201519086015260c0808201519086015260e08082015190860152610100808201519086015261012090810151908501526101409093019290850190600101612f5c565b50919b9a5050505050505050505050565b600080600080600080600060c0888a03121561300b57600080fd5b87356001600160401b038082111561302257600080fd5b61302e8b838c01612b71565b985060208a013591508082111561304457600080fd5b6130508b838c01612b71565b975060408a0135965060608a0135955060808a0135945060a08a013591508082111561307b57600080fd5b506130888a828b01612cd0565b989b979a50959850939692959293505050565b600080602083850312156130ae57600080fd5b82356001600160401b038111156130c457600080fd5b6130d085828601612cd0565b90969095509350505050565b80356130e781612a7c565b919050565b600080600080600080600060c0888a03121561310757600080fd5b87356001600160401b038082111561311e57600080fd5b61312a8b838c01612b71565b985060208a013591508082111561314057600080fd5b61314c8b838c01612b71565b975060408a0135965061316160608b016130dc565b955060808a013591508082111561317757600080fd5b6131838b838c01612b71565b945060a08a013591508082111561307b57600080fd5b60008060008060008060a087890312156131b257600080fd5b86356001600160401b03808211156131c957600080fd5b6131d58a838b01612b71565b975060208901359150808211156131eb57600080fd5b6131f78a838b01612b71565b965060408901359550606089013594506080890135915080821115612eb657600080fd5b60008060006060848603121561323057600080fd5b83356001600160401b038082111561324757600080fd5b61325387838801612b71565b9450602086013591508082111561326957600080fd5b5061327686828701612b71565b925050604084013590509250925092565b6020808252600e908201526d0d2dcecc2d8d2c840d8cadccee8d60931b604082015260600190565b6000602082840312156132c157600080fd5b81516132cc81612a7c565b9392505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208082528181018390526000906040600585901b8401810190840186845b8781101561338957868403603f190183528135368a9003601e1901811261334157600080fd5b890180356001600160401b0381111561335957600080fd5b8036038b131561336857600080fd5b61337586828985016132d3565b95505050918401919084019060010161331b565b5091979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156133d6576133d66133ac565b5060010190565b6000602082840312156133ef57600080fd5b5051919050565b60008219821115613409576134096133ac565b500190565b600082821015613420576134206133ac565b500390565b634e487b7160e01b600052601260045260246000fd5b60008261344a5761344a613425565b500690565b80516130e781612a7c565b805180151581146130e757600080fd5b6000610140828403121561347d57600080fd5b613485612b18565b61348e8361344f565b815261349c6020840161344f565b60208201526134ad6040840161345a565b6040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e08201526101008084015181830152506101208084015181830152508091505092915050565b600080600080600080600080610100898b03121561352357600080fd5b88516001600160401b038082111561353a57600080fd5b818b0191508b601f83011261354e57600080fd5b81518181111561356057613560612b02565b60209150613576601f8201601f19168301612b41565b8181528d8383860101111561358a57600080fd5b60005b828110156135a857848101840151828201850152830161358d565b828111156135b95760008484840101525b50809b505050808b01519850505060408901519550606089015194506080890151935060a0890151925060c0890151915060e089015190509295985092959890939650565b60006020828403121561361057600080fd5b6132cc8261345a565b60006080828403121561362b57600080fd5b604051608081016001600160401b03828210818311171561364e5761364e612b02565b81604052845191508160070b821461366557600080fd5b908252602084015190808216821461367c57600080fd5b5060208201526040830151600381900b811461369757600080fd5b60408201526060928301519281019290925250919050565b60008160001904831182151516156136c9576136c96133ac565b500290565b6000826136dd576136dd613425565b50049056fea2646970667358221220a3be625011d52ad7c65f7bb12f2b971e402274bb4e590de15dd0c1327c57b58164736f6c63430008090033

Deployed Bytecode

0x6080604052600436106100e85760003560e01c8063af55afac1161008a578063e673df8a11610059578063e673df8a14610243578063e96ce97c14610281578063f4c9ecb014610294578063f98f7553146102a757600080fd5b8063af55afac146101c0578063c06d3f3e146101d3578063c4dd055b14610202578063d47eed451461021557600080fd5b806346275e6b116100c657806346275e6b146101595780637aa17e271461016c57806389af8b581461019a578063a17686d5146101ad57600080fd5b80631459457a146100ed57806324d22e211461010f5780632844d83214610146575b600080fd5b3480156100f957600080fd5b5061010d610108366004612a91565b6102c7565b005b34801561011b57600080fd5b5061012f61012a366004612bf0565b6105cd565b60405161013d929190612c53565b60405180910390f35b61010d610154366004612d14565b6105e7565b61010d610167366004612e19565b6109da565b34801561017857600080fd5b5061018c610187366004612ed5565b610c89565b60405161013d929190612eee565b61010d6101a8366004612e19565b611018565b61010d6101bb366004612e19565b6112b7565b61010d6101ce366004612e19565b611556565b3480156101df57600080fd5b506101f36101ee366004612ed5565b6117f5565b60405161013d93929190612f2f565b61010d610210366004612ff0565b611bf8565b34801561022157600080fd5b5061023561023036600461309b565b611f23565b60405190815260200161013d565b34801561024f57600080fd5b50600054610269906201000090046001600160a01b031681565b6040516001600160a01b03909116815260200161013d565b61010d61028f3660046130ec565b612035565b61010d6102a2366004613199565b6122dd565b3480156102b357600080fd5b5061012f6102c236600461321b565b612549565b600054610100900460ff16158080156102e75750600054600160ff909116105b806103015750303b158015610301575060005460ff166001145b6103695760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801561038c576000805461ff0019166101001790555b6001600160a01b0386163b6103da5760405162461bcd60e51b81526020600482015260146024820152731c1c9a58d953585b9859d95c881a5b9d985b1a5960621b6044820152606401610360565b6001600160a01b0385163b6104295760405162461bcd60e51b81526020600482015260156024820152741c1bdcda5d1a5bdb95985d5b1d081a5b9d985b1a59605a1b6044820152606401610360565b6001600160a01b0384163b6104755760405162461bcd60e51b81526020600482015260126024820152711bdc99195c95985d5b1d081a5b9d985b1a5960721b6044820152606401610360565b6001600160a01b0383163b6104c35760405162461bcd60e51b81526020600482015260146024820152731bdc195c985d1bdc9cc81a5cc81a5b9d985b1a5960621b6044820152606401610360565b6001600160a01b0382163b61051a5760405162461bcd60e51b815260206004820152601960248201527f6c69717569646174655661756c7420697320696e76616c6964000000000000006044820152606401610360565b600180546001600160a01b03199081166001600160a01b03898116919091179092556003805482168784161790556002805482168884161790556000805462010000600160b01b03191662010000878516021790556004805490911691841691909117905580156105c5576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6060806105db848442612549565b915091505b9250929050565b60016105f2816129b7565b888888858583518551146106185760405162461bcd60e51b815260040161036090613287565b600083421015610628574261062a565b835b9050811561071957600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b15801561068057600080fd5b505afa158015610694573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b891906132af565b6001600160a01b031663ef9e5e283485856040518463ffffffff1660e01b81526004016106e69291906132fc565b6000604051808303818588803b1580156106ff57600080fd5b505af1158015610713573d6000803e3d6000fd5b50505050505b60005b86518110156107e55760015487516001600160a01b039091169063aa585d569089908490811061074e5761074e613396565b602002602001015188848151811061076857610768613396565b6020026020010151856040518463ffffffff1660e01b81526004016107a0939291909283526020830191909152604082015260600190565b600060405180830381600087803b1580156107ba57600080fd5b505af11580156107ce573d6000803e3d6000fd5b5050505080806107dd906133c2565b91505061071c565b5060005b8c51811015610886576003548d516001600160a01b03909116906396759c94908f908490811061081b5761081b613396565b60200260200101516040518263ffffffff1660e01b815260040161084191815260200190565b600060405180830381600087803b15801561085b57600080fd5b505af115801561086f573d6000803e3d6000fd5b50505050808061087e906133c2565b9150506107e9565b5060005b8b51811015610927576003548c516001600160a01b039091169063c9801068908e90849081106108bc576108bc613396565b60200260200101516040518263ffffffff1660e01b81526004016108e291815260200190565b600060405180830381600087803b1580156108fc57600080fd5b505af1158015610910573d6000803e3d6000fd5b50505050808061091f906133c2565b91505061088a565b5060005b8a518110156109c8576003548b516001600160a01b0390911690633407c8ea908d908490811061095d5761095d613396565b60200260200101516040518263ffffffff1660e01b815260040161098391815260200190565b600060405180830381600087803b15801561099d57600080fd5b505af11580156109b1573d6000803e3d6000fd5b5050505080806109c0906133c2565b91505061092b565b50505050505050505050505050505050565b60016109e5816129b7565b86868685858351855114610a0b5760405162461bcd60e51b815260040161036090613287565b600083421015610a1b5742610a1d565b835b90508115610b0c57600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7357600080fd5b505afa158015610a87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aab91906132af565b6001600160a01b031663ef9e5e283485856040518463ffffffff1660e01b8152600401610ad99291906132fc565b6000604051808303818588803b158015610af257600080fd5b505af1158015610b06573d6000803e3d6000fd5b50505050505b60005b8651811015610bd85760015487516001600160a01b039091169063aa585d5690899084908110610b4157610b41613396565b6020026020010151888481518110610b5b57610b5b613396565b6020026020010151856040518463ffffffff1660e01b8152600401610b93939291909283526020830191909152604082015260600190565b600060405180830381600087803b158015610bad57600080fd5b505af1158015610bc1573d6000803e3d6000fd5b505050508080610bd0906133c2565b915050610b0f565b5060005b8a51811015610c79576003548b516001600160a01b0390911690633407c8ea908d9084908110610c0e57610c0e613396565b60200260200101516040518263ffffffff1660e01b8152600401610c3491815260200190565b600060405180830381600087803b158015610c4e57600080fd5b505af1158015610c62573d6000803e3d6000fd5b505050508080610c71906133c2565b915050610bdc565b5050505050505050505050505050565b600060606000600260009054906101000a90046001600160a01b03166001600160a01b031663bf902b846040518163ffffffff1660e01b815260040160206040518083038186803b158015610cdd57600080fd5b505afa158015610cf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1591906133dd565b90506000848211610d265781610d28565b845b90506000600260009054906101000a90046001600160a01b03166001600160a01b031663f71978db6040518163ffffffff1660e01b815260040160206040518083038186803b158015610d7a57600080fd5b505afa158015610d8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db291906133dd565b90506000610dc083836133f6565b9050600082600260009054906101000a90046001600160a01b03166001600160a01b031663bf902b846040518163ffffffff1660e01b815260040160206040518083038186803b158015610e1357600080fd5b505afa158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b91906133dd565b610e5591906133f6565b905080821115610e63578091505b6000610e6f848461340e565b6001600160401b03811115610e8657610e86612b02565b604051908082528060200260200182016040528015610eaf578160200160208202803683370190505b50905060005b838510156110085760025460405163f3ad896160e01b8152600481018790526000916001600160a01b03169063f3ad89619060240160206040518083038186803b158015610f0257600080fd5b505afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a91906133dd565b90506000610f4c600160801b8361343b565b60025460405163eb02c30160e01b8152600481018390529192506001600160a01b03169063eb02c301906024016101406040518083038186803b158015610f9257600080fd5b505afa158015610fa6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fca919061346a565b60600151848481518110610fe057610fe0613396565b6020908102919091010152610ff4876133c2565b9650610fff836133c2565b92505050610eb5565b5093989397509295505050505050565b6001611023816129b7565b868686858583518551146110495760405162461bcd60e51b815260040161036090613287565b600083421015611059574261105b565b835b9050811561114a57600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b1580156110b157600080fd5b505afa1580156110c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e991906132af565b6001600160a01b031663ef9e5e283485856040518463ffffffff1660e01b81526004016111179291906132fc565b6000604051808303818588803b15801561113057600080fd5b505af1158015611144573d6000803e3d6000fd5b50505050505b60005b86518110156112165760015487516001600160a01b039091169063aa585d569089908490811061117f5761117f613396565b602002602001015188848151811061119957611199613396565b6020026020010151856040518463ffffffff1660e01b81526004016111d1939291909283526020830191909152604082015260600190565b600060405180830381600087803b1580156111eb57600080fd5b505af11580156111ff573d6000803e3d6000fd5b50505050808061120e906133c2565b91505061114d565b5060005b8a51811015610c79576003548b516001600160a01b03909116906396759c94908d908490811061124c5761124c613396565b60200260200101516040518263ffffffff1660e01b815260040161127291815260200190565b600060405180830381600087803b15801561128c57600080fd5b505af11580156112a0573d6000803e3d6000fd5b5050505080806112af906133c2565b91505061121a565b60016112c2816129b7565b868686858583518551146112e85760405162461bcd60e51b815260040161036090613287565b6000834210156112f857426112fa565b835b905081156113e957600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b15801561135057600080fd5b505afa158015611364573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138891906132af565b6001600160a01b031663ef9e5e283485856040518463ffffffff1660e01b81526004016113b69291906132fc565b6000604051808303818588803b1580156113cf57600080fd5b505af11580156113e3573d6000803e3d6000fd5b50505050505b60005b86518110156114b55760015487516001600160a01b039091169063aa585d569089908490811061141e5761141e613396565b602002602001015188848151811061143857611438613396565b6020026020010151856040518463ffffffff1660e01b8152600401611470939291909283526020830191909152604082015260600190565b600060405180830381600087803b15801561148a57600080fd5b505af115801561149e573d6000803e3d6000fd5b5050505080806114ad906133c2565b9150506113ec565b5060005b8a51811015610c79576004548b516001600160a01b039091169063cdddd4e5908d90849081106114eb576114eb613396565b60200260200101516040518263ffffffff1660e01b815260040161151191815260200190565b600060405180830381600087803b15801561152b57600080fd5b505af115801561153f573d6000803e3d6000fd5b50505050808061154e906133c2565b9150506114b9565b6001611561816129b7565b868686858583518551146115875760405162461bcd60e51b815260040161036090613287565b6000834210156115975742611599565b835b9050811561168857600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b1580156115ef57600080fd5b505afa158015611603573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162791906132af565b6001600160a01b031663ef9e5e283485856040518463ffffffff1660e01b81526004016116559291906132fc565b6000604051808303818588803b15801561166e57600080fd5b505af1158015611682573d6000803e3d6000fd5b50505050505b60005b86518110156117545760015487516001600160a01b039091169063aa585d56908990849081106116bd576116bd613396565b60200260200101518884815181106116d7576116d7613396565b6020026020010151856040518463ffffffff1660e01b815260040161170f939291909283526020830191909152604082015260600190565b600060405180830381600087803b15801561172957600080fd5b505af115801561173d573d6000803e3d6000fd5b50505050808061174c906133c2565b91505061168b565b5060005b8a51811015610c79576003548b516001600160a01b039091169063c9801068908d908490811061178a5761178a613396565b60200260200101516040518263ffffffff1660e01b81526004016117b091815260200190565b600060405180830381600087803b1580156117ca57600080fd5b505af11580156117de573d6000803e3d6000fd5b5050505080806117ed906133c2565b915050611758565b60008060606000600260009054906101000a90046001600160a01b03166001600160a01b031663bf902b846040518163ffffffff1660e01b815260040160206040518083038186803b15801561184a57600080fd5b505afa15801561185e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188291906133dd565b905060008582116118935781611895565b855b90506000600260009054906101000a90046001600160a01b03166001600160a01b031663f71978db6040518163ffffffff1660e01b815260040160206040518083038186803b1580156118e757600080fd5b505afa1580156118fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191f91906133dd565b905080600061192e84836133f6565b9050600082600260009054906101000a90046001600160a01b03166001600160a01b031663bf902b846040518163ffffffff1660e01b815260040160206040518083038186803b15801561198157600080fd5b505afa158015611995573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119b991906133dd565b6119c391906133f6565b9050808211156119d1578091505b60006119dd848461340e565b6001600160401b038111156119f4576119f4612b02565b604051908082528060200260200182016040528015611a8f57816020015b611a7c60405180610140016040528060006001600160a01b0316815260200160006001600160a01b03168152602001600015158152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b815260200190600190039081611a125790505b50905060005b83851015611be55760025460405163f3ad896160e01b8152600481018790526000916001600160a01b03169063f3ad89619060240160206040518083038186803b158015611ae257600080fd5b505afa158015611af6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1a91906133dd565b90506000611b2c600160801b8361343b565b60025460405163eb02c30160e01b8152600481018390529192506001600160a01b03169063eb02c301906024016101406040518083038186803b158015611b7257600080fd5b505afa158015611b86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611baa919061346a565b848481518110611bbc57611bbc613396565b602002602001018190525086611bd1906133c2565b9650611bdc836133c2565b92505050611a95565b50939a9499509297509295505050505050565b6001611c03816129b7565b87878785858351855114611c295760405162461bcd60e51b815260040161036090613287565b600083421015611c395742611c3b565b835b90508115611d2a57600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b158015611c9157600080fd5b505afa158015611ca5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cc991906132af565b6001600160a01b031663ef9e5e283485856040518463ffffffff1660e01b8152600401611cf79291906132fc565b6000604051808303818588803b158015611d1057600080fd5b505af1158015611d24573d6000803e3d6000fd5b50505050505b60005b8651811015611df65760015487516001600160a01b039091169063aa585d5690899084908110611d5f57611d5f613396565b6020026020010151888481518110611d7957611d79613396565b6020026020010151856040518463ffffffff1660e01b8152600401611db1939291909283526020830191909152604082015260600190565b600060405180830381600087803b158015611dcb57600080fd5b505af1158015611ddf573d6000803e3d6000fd5b505050508080611dee906133c2565b915050611d2d565b506002546040805163f71978db60e01b815290518c926001600160a01b03169163f71978db916004808301926020929190829003018186803b158015611e3b57600080fd5b505afa158015611e4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e7391906133dd565b14611eb55760405162461bcd60e51b81526020600482015260126024820152710d2dcecc2d8d2c840e2eacaeaca92dcc8caf60731b6044820152606401610360565b60025460405163269ce6bb60e11b8152600481018d90526001600160a01b0390911690634d39cd7690602401600060405180830381600087803b158015611efb57600080fd5b505af1158015611f0f573d6000803e3d6000fd5b505050505050505050505050505050505050565b600080600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b158015611f7457600080fd5b505afa158015611f88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fac91906132af565b60405163d47eed4560e01b81529091506001600160a01b0382169063d47eed4590611fdd90879087906004016132fc565b60206040518083038186803b158015611ff557600080fd5b505afa158015612009573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061202d91906133dd565b949350505050565b6001612040816129b7565b878787858583518551146120665760405162461bcd60e51b815260040161036090613287565b6000834210156120765742612078565b835b9050811561216757600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b1580156120ce57600080fd5b505afa1580156120e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061210691906132af565b6001600160a01b031663ef9e5e283485856040518463ffffffff1660e01b81526004016121349291906132fc565b6000604051808303818588803b15801561214d57600080fd5b505af1158015612161573d6000803e3d6000fd5b50505050505b60005b86518110156122335760015487516001600160a01b039091169063aa585d569089908490811061219c5761219c613396565b60200260200101518884815181106121b6576121b6613396565b6020026020010151856040518463ffffffff1660e01b81526004016121ee939291909283526020830191909152604082015260600190565b600060405180830381600087803b15801561220857600080fd5b505af115801561221c573d6000803e3d6000fd5b50505050808061222b906133c2565b91505061216a565b5060005b8a518110156122cc578b6001600160a01b0316632bc61ec48c838151811061226157612261613396565b60200260200101516040518263ffffffff1660e01b815260040161228791815260200190565b600060405180830381600087803b1580156122a157600080fd5b505af11580156122b5573d6000803e3d6000fd5b5050505080806122c4906133c2565b915050612237565b505050505050505050505050505050565b60016122e8816129b7565b8686868585835185511461230e5760405162461bcd60e51b815260040161036090613287565b60008342101561231e5742612320565b835b9050811561240f57600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b15801561237657600080fd5b505afa15801561238a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123ae91906132af565b6001600160a01b031663ef9e5e283485856040518463ffffffff1660e01b81526004016123dc9291906132fc565b6000604051808303818588803b1580156123f557600080fd5b505af1158015612409573d6000803e3d6000fd5b50505050505b60005b86518110156124db5760015487516001600160a01b039091169063aa585d569089908490811061244457612444613396565b602002602001015188848151811061245e5761245e613396565b6020026020010151856040518463ffffffff1660e01b8152600401612496939291909283526020830191909152604082015260600190565b600060405180830381600087803b1580156124b057600080fd5b505af11580156124c4573d6000803e3d6000fd5b5050505080806124d3906133c2565b915050612412565b5060025460405163269ce6bb60e11b8152600481018c90526001600160a01b0390911690634d39cd7690602401600060405180830381600087803b15801561252257600080fd5b505af1158015612536573d6000803e3d6000fd5b5050505050505050505050505050505050565b60608084516001600160401b0381111561256557612565612b02565b60405190808252806020026020018201604052801561258e578160200160208202803683370190505b50905084516001600160401b038111156125aa576125aa612b02565b6040519080825280602002602001820160405280156125d3578160200160208202803683370190505b5091506000600160009054906101000a90046001600160a01b03166001600160a01b031663f98d06f06040518163ffffffff1660e01b815260040160206040518083038186803b15801561262657600080fd5b505afa15801561263a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061265e91906132af565b905060005b86518110156129ad57600087828151811061268057612680613396565b60200260200101519050600087838151811061269e5761269e613396565b6020908102919091010151600154604051630cf35bdd60e41b815260048101859052919250600091829182916001600160a01b039091169063cf35bdd09060240160006040518083038186803b1580156126f757600080fd5b505afa15801561270b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526127339190810190613506565b50949850909650945060009350508515915061295090505760405163b5ec026160e01b8152600481018590526001600160a01b0389169063b5ec02619060240160206040518083038186803b15801561278b57600080fd5b505afa15801561279f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127c391906135fe565b1561294c576040516396834ad360e01b8152600481018590526000906001600160a01b038a16906396834ad39060240160806040518083038186803b15801561280b57600080fd5b505afa15801561281f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128439190613619565b905083816060015161285591906133f6565b8c11156128655760019150612946565b600154604051637988116f60e01b815260048101899052600060248201819052916001600160a01b031690637988116f9060440160206040518083038186803b1580156128b157600080fd5b505afa1580156128c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128e991906133dd565b9050600081881161291c5781620186a06129038a8361340e565b61290d91906136af565b61291791906136ce565b61293f565b81620186a061292b828b61340e565b61293591906136af565b61293f91906136ce565b8510935050505b50612950565b5060015b8389888151811061296357612963613396565b602002602001018181525050808a888151811061298257612982613396565b60200260200101901515908115158152505050505050505080806129a5906133c2565b915050612663565b5050935093915050565b60005460405163df07560560e01b815233600482015282916201000090046001600160a01b03169063df0756059060240160206040518083038186803b158015612a0057600080fd5b505afa158015612a14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a3891906133dd565b1015612a795760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b21037b832b930ba37b960811b6044820152606401610360565b50565b6001600160a01b0381168114612a7957600080fd5b600080600080600060a08688031215612aa957600080fd5b8535612ab481612a7c565b94506020860135612ac481612a7c565b93506040860135612ad481612a7c565b92506060860135612ae481612a7c565b91506080860135612af481612a7c565b809150509295509295909350565b634e487b7160e01b600052604160045260246000fd5b60405161014081016001600160401b0381118282101715612b3b57612b3b612b02565b60405290565b604051601f8201601f191681016001600160401b0381118282101715612b6957612b69612b02565b604052919050565b600082601f830112612b8257600080fd5b813560206001600160401b03821115612b9d57612b9d612b02565b8160051b612bac828201612b41565b9283528481018201928281019087851115612bc657600080fd5b83870192505b84831015612be557823582529183019190830190612bcc565b979650505050505050565b60008060408385031215612c0357600080fd5b82356001600160401b0380821115612c1a57600080fd5b612c2686838701612b71565b93506020850135915080821115612c3c57600080fd5b50612c4985828601612b71565b9150509250929050565b604080825283519082018190526000906020906060840190828701845b82811015612c8e578151151584529284019290840190600101612c70565b5050508381038285015284518082528583019183019060005b81811015612cc357835183529284019291840191600101612ca7565b5090979650505050505050565b60008083601f840112612ce257600080fd5b5081356001600160401b03811115612cf957600080fd5b6020830191508360208260051b85010111156105e057600080fd5b60008060008060008060008060e0898b031215612d3057600080fd5b88356001600160401b0380821115612d4757600080fd5b612d538c838d01612b71565b995060208b0135915080821115612d6957600080fd5b612d758c838d01612b71565b985060408b0135975060608b0135915080821115612d9257600080fd5b612d9e8c838d01612b71565b965060808b0135915080821115612db457600080fd5b612dc08c838d01612b71565b955060a08b0135915080821115612dd657600080fd5b612de28c838d01612b71565b945060c08b0135915080821115612df857600080fd5b50612e058b828c01612cd0565b999c989b5096995094979396929594505050565b60008060008060008060a08789031215612e3257600080fd5b86356001600160401b0380821115612e4957600080fd5b612e558a838b01612b71565b97506020890135915080821115612e6b57600080fd5b612e778a838b01612b71565b9650604089013595506060890135915080821115612e9457600080fd5b612ea08a838b01612b71565b94506080890135915080821115612eb657600080fd5b50612ec389828a01612cd0565b979a9699509497509295939492505050565b600060208284031215612ee757600080fd5b5035919050565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015612cc357845183529383019391830191600101612f13565b60006060808301868452602086818601526040838187015282875180855260809450848801915083890160005b82811015612fdf57815180516001600160a01b039081168652878201511687860152858101511515868601528881015189860152878101518886015260a0808201519086015260c0808201519086015260e08082015190860152610100808201519086015261012090810151908501526101409093019290850190600101612f5c565b50919b9a5050505050505050505050565b600080600080600080600060c0888a03121561300b57600080fd5b87356001600160401b038082111561302257600080fd5b61302e8b838c01612b71565b985060208a013591508082111561304457600080fd5b6130508b838c01612b71565b975060408a0135965060608a0135955060808a0135945060a08a013591508082111561307b57600080fd5b506130888a828b01612cd0565b989b979a50959850939692959293505050565b600080602083850312156130ae57600080fd5b82356001600160401b038111156130c457600080fd5b6130d085828601612cd0565b90969095509350505050565b80356130e781612a7c565b919050565b600080600080600080600060c0888a03121561310757600080fd5b87356001600160401b038082111561311e57600080fd5b61312a8b838c01612b71565b985060208a013591508082111561314057600080fd5b61314c8b838c01612b71565b975060408a0135965061316160608b016130dc565b955060808a013591508082111561317757600080fd5b6131838b838c01612b71565b945060a08a013591508082111561307b57600080fd5b60008060008060008060a087890312156131b257600080fd5b86356001600160401b03808211156131c957600080fd5b6131d58a838b01612b71565b975060208901359150808211156131eb57600080fd5b6131f78a838b01612b71565b965060408901359550606089013594506080890135915080821115612eb657600080fd5b60008060006060848603121561323057600080fd5b83356001600160401b038082111561324757600080fd5b61325387838801612b71565b9450602086013591508082111561326957600080fd5b5061327686828701612b71565b925050604084013590509250925092565b6020808252600e908201526d0d2dcecc2d8d2c840d8cadccee8d60931b604082015260600190565b6000602082840312156132c157600080fd5b81516132cc81612a7c565b9392505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208082528181018390526000906040600585901b8401810190840186845b8781101561338957868403603f190183528135368a9003601e1901811261334157600080fd5b890180356001600160401b0381111561335957600080fd5b8036038b131561336857600080fd5b61337586828985016132d3565b95505050918401919084019060010161331b565b5091979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156133d6576133d66133ac565b5060010190565b6000602082840312156133ef57600080fd5b5051919050565b60008219821115613409576134096133ac565b500190565b600082821015613420576134206133ac565b500390565b634e487b7160e01b600052601260045260246000fd5b60008261344a5761344a613425565b500690565b80516130e781612a7c565b805180151581146130e757600080fd5b6000610140828403121561347d57600080fd5b613485612b18565b61348e8361344f565b815261349c6020840161344f565b60208201526134ad6040840161345a565b6040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e08201526101008084015181830152506101208084015181830152508091505092915050565b600080600080600080600080610100898b03121561352357600080fd5b88516001600160401b038082111561353a57600080fd5b818b0191508b601f83011261354e57600080fd5b81518181111561356057613560612b02565b60209150613576601f8201601f19168301612b41565b8181528d8383860101111561358a57600080fd5b60005b828110156135a857848101840151828201850152830161358d565b828111156135b95760008484840101525b50809b505050808b01519850505060408901519550606089015194506080890151935060a0890151925060c0890151915060e089015190509295985092959890939650565b60006020828403121561361057600080fd5b6132cc8261345a565b60006080828403121561362b57600080fd5b604051608081016001600160401b03828210818311171561364e5761364e612b02565b81604052845191508160070b821461366557600080fd5b908252602084015190808216821461367c57600080fd5b5060208201526040830151600381900b811461369757600080fd5b60408201526060928301519281019290925250919050565b60008160001904831182151516156136c9576136c96133ac565b500290565b6000826136dd576136dd613425565b50049056fea2646970667358221220a3be625011d52ad7c65f7bb12f2b971e402274bb4e590de15dd0c1327c57b58164736f6c63430008090033

Block Transaction Gas Used Reward
view all blocks ##produced##

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

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.