S Price: $0.536413 (-10.14%)

Contract

0xea40ee96c97EFaA0c81b2dd020F3877b751e31a2

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ProxyLOBBatch

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 200 runs

Other Settings:
cancun EvmVersion, BSL 1.1 license
File 1 of 9 : ProxyLOBBatch.sol
// SPDX-License-Identifier: BUSL-1.1
// (c) Long Gamma Labs, 2024.
pragma solidity ^0.8.28;


import { IPyth } from "@pythnetwork/pyth-sdk-solidity/IPyth.sol";
import { Errors } from "@onchainclob/contracts/Errors.sol";


import { ILPManager } from "./interfaces/ILPManager.sol";
import { IProxyLOB } from "./interfaces/IProxyLOB.sol";
import { ErrorReporter } from "./ErrorReporter.sol";
import { PythPriceHelper } from "./utils/PythPriceHelper.sol";


contract ProxyLOBBatch {
    IPyth immutable pyth;

    constructor(address pythAddress) {
        require(pythAddress != address(0), ErrorReporter.ZeroAddress());
        pyth = IPyth(pythAddress);
    }

    function batchChangeOrder(
        address lpManagerAddress,
        uint8 lobId,
        uint64[] memory orderIds,
        uint128[] memory quantities,
        uint72[] memory prices,
        uint128 maxCommissionPerOrder,
        bool postOnly,
        uint256 expires,
        bytes[] calldata priceUpdateData
    ) external payable returns (uint64[] memory newOrderIds) {
        require(
            orderIds.length == quantities.length && orderIds.length == prices.length,
            Errors.ArrayLengthMismatch()
        );

        ILPManager lpManager = ILPManager(payable(lpManagerAddress));
        require(lpManager.marketMakers(msg.sender), ErrorReporter.InvalidTrader());

        PythPriceHelper.updatePrices(pyth, priceUpdateData);

        IProxyLOB proxyLOB = IProxyLOB(payable(lpManagerAddress));

        newOrderIds = new uint64[](orderIds.length);

        for (uint i = 0; i < orderIds.length; ++i) {
            if (orderIds[i] > 1) {
                proxyLOB.claimOrder(lobId, orderIds[i], false, expires);
            }

            if (quantities[i] > 0) {
                (uint64 newOrderId) = proxyLOB.placeOrder(
                    lobId,
                    _isAsk(orderIds[i]),
                    quantities[i] ,
                    prices[i],
                    maxCommissionPerOrder,
                    false,
                    postOnly,
                    expires,
                    new bytes[](0)
                );

                newOrderIds[i] = newOrderId;
            }
        }
    }

    function _isAsk(uint64 orderId) internal pure returns (bool) {
        return (orderId & uint64(0x1)) == 0x1;
    }
}

File 2 of 9 : IPyth.sol
// 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/consumers/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 does not store the price updates on-chain.
    ///
    /// 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);
}

File 3 of 9 : Errors.sol
// SPDX-License-Identifier: BUSL-1.1
// Central Limit Order Book (CLOB) exchange
// (c) Long Gamma Labs, 2023.
pragma solidity ^0.8.26;


contract Errors {
    error AddressIsZero();
    error ArrayLengthMismatch();
    error ChainIsUnstableForTrades();
    error ClaimNotAllowed();
    error CommissionParamTooHigh();
    error Disabled();
    error EmptyOrderError();
    error ExcessiveSignificantFigures();
    error Expired();
    error Forbidden();
    error FractionalNumbersNotAllowed();
    error InsufficientTokenXBalance();
    error InsufficientTokenYBalance();
    error InvalidCommissionRate();
    error InvalidFloatingPointRepresentation();
    error InvalidMarketMaker();
    error InvalidPriceRange();
    error InvalidTransfer();
    error MarketOnlyAndPostOnlyFlagsConflict();
    error MaxCommissionFailure();
    error NativeETHDisabled();
    error NonceExhaustedFailure();
    error NotImplementedYet();
    error OnlyOwnerCanCancelOrders();
    error PointerAlreadyFreed();
    error PriceExceedsMaximumAllowedValue();
    error TransferFailed();
    error UnknownOrderId();
    error UnknownTrader();
    error WrongOwner();
    error ZeroMaxDelayNotAllowed();
    error ZeroRecoveryTimeNotAllowed();
    error ZeroTokenTransferNotAllowed();
}

File 4 of 9 : ILPManager.sol
// SPDX-License-Identifier: BUSL-1.1
// (c) Long Gamma Labs, 2024.
pragma solidity ^0.8.28;

struct FeeConfig {
    /// @notice Enable or disable dynamic fees adjustment based on token weight imbalances.
    bool dynamicFeesEnabled;
    /// @notice Admin fee for minting LP tokens (100 = 1%, maximum 1000 = 10%).
    uint16 adminMintLPFeeBps;
    /// @notice Admin fee for burning LP tokens (100 = 1%, maximum 1000 = 10%).
    uint16 adminBurnLPFeeBps;
    /// @notice Base protocol fee (100 = 1%, maximum 1000 = 10%).
    uint16 feeBasisBps;
    /// @notice Additional tax fee for imbalanced operations (100 = 1%, maximum 1000 = 10%).
    uint16 taxBasisBps;
    /// @notice Performance fee in basis points charged when LP token price reaches new high-water mark (100 = 1%, maximum 3000 = 30%).
    uint16 perfFeeBps;
    /// @notice Admin's share of the performance fee in basis points (100 = 1%, maximum 10000 = 100%).
    uint16 adminPerfFeeBps;
    /// @notice The address that will receive the admin fees.
    address adminFeeRecipient;
}

struct LiquidityConfig {
    /// @notice Lockup period after adding liquidity in seconds
    ///         during which removeLiquidity and LP token transfers are blocked
    ///         (maximum 16 777 215 seconds ≈ 194 days)
    uint24 cooldownDuration;
    /// @notice Minimum liquidity value in USD (scaled by 1e18).
    uint128 minLiquidityValueUsd;
    /// @notice Maximum liquidity value in USD (scaled by 1e18).
    uint128 maxLiquidityValueUsd;
}

struct MarketMakerConfig {
    /// @notice Enable or disable minimum market maker share in LP tokens.
    bool marketMakerLPShareEnabled;
    /// @notice Minimum market maker share in LP tokens (100 = 1%, maximum 10000 = 100%).
    uint16 marketMakerLPShareBps;
}

struct NativeTokenConfig {
    /// @notice Flag to enable or disable the use of the native GAS token for transactions.
    bool enabled;
    /// @notice The index of the token in the tokens array that is used as the native GAS token, if enabled.
    uint8 tokenId;
}

struct PriceConfig {
    /// @notice Maximum allowable age of oracle price data in seconds.
    uint16 maxOracleAge;
    /// @notice The period in seconds for which the LP token price is considered valid.
    uint24 priceValidityPeriod;
    /// @notice Base multiplier for calculating the allowed LP token price deviation (scaled by 1e18).
    uint64 baseMultiplier;
    /// @notice The maximum allowed deviation of the LP token price from the previous valid price.
    uint64 maxAllowedPriceDeviation;
}

interface ILPManager {
    // governance
    function setConfig(
        FeeConfig calldata feeConfig,
        LiquidityConfig calldata liquidityConfig,
        MarketMakerConfig calldata mmConfig,
        NativeTokenConfig calldata nativeConfig,
        PriceConfig calldata priceConfig
    ) external;

    function getConfig() external view returns (
        FeeConfig memory feeConfig,
        LiquidityConfig memory liquidityConfig,
        MarketMakerConfig memory mmConfig,
        NativeTokenConfig memory nativeConfig,
        PriceConfig memory priceConfig,
        bool slashingStatus
    );

    function changeToken(
        address tokenAddress,
        bool isActive,
        uint16 targetWeight,
        uint16 lowerBoundWeight,
        uint16 upperBoundWeight,
        uint8 decimals,
        uint24 oracleConfRel,
        bytes32 oraclePriceId
    ) external;

    function changeLob(
        address lobAddress,
        bool isActive,
        uint8 tokenIdX,
        uint8 tokenIdY,
        uint16 maxOrderDistanceBps
    ) external;

    function slashMakersShares(uint256 amount) external;
    function disableSlashingStatus() external;
    function pause() external;
    function validateLPPriceAndDistributeFees(bytes[] calldata priceUpdateData) payable external;

    // client entries
    function addLiquidity(
        uint8 tokenID,
        uint256 amount,
        uint256 minUsdValue,
        uint256 minLPMinted,
        uint256 expires,
        bytes[] calldata priceUpdateData
    ) external payable returns (uint256);

    function removeLiquidity(
        uint8 tokenID,
        uint256 burnLP,
        uint256 minUsdValue,
        uint256 minTokenGet,
        uint256 expires,
        bytes[] calldata priceUpdateData
    ) external payable returns (uint256);

    function collectFees() external;

    // views
    function getFeeBasisPoints(
        uint256 totalValue,
        uint256 initialTokenValue,
        uint256 nextTokenValue,
        uint16 targetTokenWeight
    ) external view returns (uint256);
    function tokens(uint256 index) external view returns (
        address tokenAddress,
        bool isActive,
        uint16 targetWeight,
        uint16 lowerBoundWeight,
        uint16 upperBoundWeight,
        uint8 decimals,
        uint24 oracleConfRel,
        bytes32 oraclePriceId
    );
    function lastAddedAt(address account) external view returns (uint256);
    function totalWeight() external view returns (uint24);
    function checkCooldown(address account) external view;
    function getTokensCount() external view returns (uint256);
    function marketMakers(address account) external view returns (bool);
    function primaryMarketMaker() external view returns (address);
    function validateMarketMakerLPShare() external view;
    function ensureNotPartiallyPaused() external view;
    function lobs(uint256 index) external view returns (
        address lobAddress,
        uint8 tokenIdX,
        uint8 tokenIdY,
        bool isActive,
        uint16 maxOrderDistanceBps
    );
}

File 5 of 9 : IProxyLOB.sol
// SPDX-License-Identifier: BUSL-1.1
// (c) Long Gamma Labs, 2024.
pragma solidity ^0.8.28;


interface IProxyLOB {
    function lobReservesByTokenId(uint8 tokenId) external view returns (uint256);
    function getPriceOf(uint8 tokenId) external view returns (uint256, int32);
    function placeOrder(
        uint8 lobId,
        bool isAsk,
        uint128 quantity,
        uint72 price,
        uint128 maxCommission,
        bool marketOnly,
        bool postOnly,
        uint256 expires,
        bytes[] calldata priceUpdateData
    ) external payable returns (uint64 orderId);
    function claimOrder(uint8 lobId, uint64 orderId, bool onlyClaim, uint256 expires) external;
}

File 6 of 9 : ErrorReporter.sol
// SPDX-License-Identifier: BUSL-1.1
// (c) Long Gamma Labs, 2024.
pragma solidity ^0.8.28;


contract ErrorReporter {
    error CooldownDurationNotYetPassed();
    // 0x5fba365d 

    error EmptyDomainName();
    // 0x2f601761 

    error EmptyTokenName();
    // 0xe2592aed 

    error EmptyTokenSymbol();
    // 0x19c7070a 

    error Expired();
    // 0x203d82d8 

    error FeeBpsExceedsMaximum();
    // 0x132df9c5 

    error Forbidden();
    // 0xee90c468 

    error InsufficientBalance();
    // 0xf4d678b8 

    error InsufficientFeeForPythUpdate();
    // 0xe4764c6f 

    error InsufficientLiquidityValue();
    // 0x5b635d0b 

    error InsufficientMarketMakerLPShare();
    // 0x28f53493 

    error InsufficientMintedLP();
    // 0x212c18d0 

    error InsufficientTokenAmount();
    // 0x2ec48042 

    error InsufficientUSDValue();
    // 0xd6f69157 

    error InvalidFloatingPointRepresentation();
    // 0xa25f85b7 

    error InvalidLob();
    // 0xb9c44f1a 

    error InvalidLobAddress();
    // 0xec09da35 

    error InvalidOracleConfidenceLevel();
    // 0xe6b9bbad 

    error InvalidSignature();
    // 0x8baa579f 

    error InvalidTokenWeights();
    // 0x4b8072c3 

    error InvalidTrader();
    // 0xfb7595a2 

    error InvalidTransfer();
    // 0x2f352531 

    error LobDisabled();
    // 0xa6876da4 

    error MarketMakerLPShareExceedsMaximum();
    // 0x84d3d6cb 

    error MaxLiquidityValueExceeded();
    // 0x9009a2d8 

    error MaxOracleAgeExceedsMaximum();
    // 0x8b7df994

    error NativeGasTokenDisabled();
    // 0x60787531 

    error NonPositivePrice();
    // 0x13caeeae 

    error NotImplementedYet();
    // 0xf88c75b4 

    error OracleConfTooHigh();
    // 0x004f2349 

    error OrderAlreadyUsed();
    // 0x88b39043 

    error PartiallyPaused();
    // 0x1fa6172a

    error PriceTooBig();
    // 0x9bec8e38 

    error PriceTooSmall();
    // 0x8460540d 

    error SlashingUnAvailable();
    // 0xd7b45887 

    error TokenDisabled();
    // 0x1931ea85 

    error TokenWeightExceeded();
    // 0x725ad4f5 

    error TransferFailed();
    // 0x90b8ec18 

    error UnknownLob();
    // 0x0b1066eb 

    error WrongNumber();
    // 0x3546a07e 

    error WrongTokenId();
    // 0x749aeece 

    error ZeroAddress();
    // 0xd92e233d 

    error ZeroAmount();
    // 0x1f2a2005 
}

File 7 of 9 : PythPriceHelper.sol
// SPDX-License-Identifier: BUSL-1.1
// (c) Long Gamma Labs, 2024.
pragma solidity ^0.8.28;


import { IPyth } from "@pythnetwork/pyth-sdk-solidity/IPyth.sol";


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


library PythPriceHelper {
    function updatePrices(IPyth pyth, bytes[] calldata priceUpdateData) internal returns (uint256) {
        uint256 fee = 0;
        if (priceUpdateData.length != 0) {
            fee = pyth.getUpdateFee(priceUpdateData);
            require(msg.value >= fee, ErrorReporter.InsufficientFeeForPythUpdate());
            pyth.updatePriceFeeds{value: fee}(priceUpdateData);
        }

        uint256 rest;
        unchecked {
            rest = msg.value - fee;
        }
        sendGASToken(msg.sender, rest);
        return rest;
    }

    function sendGASToken(address to, uint256 value) internal {
        if (value == 0) {
            return;
        }
        (bool success, ) = to.call{value: value}("");
        require(success, ErrorReporter.TransferFailed());
    }
}

File 8 of 9 : 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/consumers/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;
    }
}

File 9 of 9 : 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);
}

Settings
{
  "remappings": [
    "forge-std/=lib/forge-std/src/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@onchainclob/contracts/=lib/onchain-clob-contracts/src/",
    "@pythnetwork/pyth-sdk-solidity/=lib/pyth-sdk-solidity/",
    "@solmate/src/=lib/onchain-clob-contracts/lib/solmate/src/",
    "ds-test/=lib/solmate/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "onchain-clob-contracts/=lib/onchain-clob-contracts/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "pyth-sdk-solidity/=lib/pyth-sdk-solidity/",
    "solmate/=lib/solmate/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "evmVersion": "cancun",
  "viaIR": true,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"pythAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ArrayLengthMismatch","type":"error"},{"inputs":[],"name":"InsufficientFeeForPythUpdate","type":"error"},{"inputs":[],"name":"InvalidTrader","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[{"internalType":"address","name":"lpManagerAddress","type":"address"},{"internalType":"uint8","name":"lobId","type":"uint8"},{"internalType":"uint64[]","name":"orderIds","type":"uint64[]"},{"internalType":"uint128[]","name":"quantities","type":"uint128[]"},{"internalType":"uint72[]","name":"prices","type":"uint72[]"},{"internalType":"uint128","name":"maxCommissionPerOrder","type":"uint128"},{"internalType":"bool","name":"postOnly","type":"bool"},{"internalType":"uint256","name":"expires","type":"uint256"},{"internalType":"bytes[]","name":"priceUpdateData","type":"bytes[]"}],"name":"batchChangeOrder","outputs":[{"internalType":"uint64[]","name":"newOrderIds","type":"uint64[]"}],"stateMutability":"payable","type":"function"}]

60a034607c57601f61094c38819003918201601f19168301916001600160401b03831184841017608057808492602094604052833981010312607c57516001600160a01b03811690819003607c578015606d576080526040516108b7908161009582396080518161053b0152f35b63d92e233d60e01b5f5260045ffd5b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe60806040526004361015610011575f80fd5b5f5f3560e01c636cd2c81614610025575f80fd5b6101203660031901126105f9576004356001600160a01b03811691908290036105f95760243560ff81168091036105f957604435916001600160401b0383116105f957366023840112156105f95782600401356100818161073b565b9361008f6040519586610706565b8185526024602086019260051b820101903682116105f957602401915b8183106106e6575050506064356001600160401b0381116105f957366023820112156105f95780600401356100e08161073b565b916100ee6040519384610706565b8183526024602084019260051b820101903682116105f957602401915b8183106106c657505050608435946001600160401b0386116105f957366023870112156105f95785600401356101408161073b565b9661014e6040519889610706565b8188526024602089019260051b820101903682116105f957602401915b8183106106a45750505060a435956001600160801b0387168097036105f95760c435948515158096036105f95760e435610104356001600160401b0381116105f957366023820112156105f9578060040135906001600160401b0382116105f9576024810190602436918460051b0101116105f9578951875181149081610699575b501561068a5760405163f60559eb60e01b81523360048201526020816024818a5afa9081156105ee575f9161064f575b5015610640575f908261052c575b50610239915034033361081d565b87519661025e6102488961073b565b986102566040519a8b610706565b808a5261073b565b602089019990601f1901368b37875b81518110156104df5760016001600160401b0361028a8385610752565b51161161045d575b6001600160801b036102a4828a610752565b51166102b3575b60010161026d565b8b6001806102c18486610752565b5116146001600160801b036102d6848c610752565b5116908b68ffffffffffffffffff6102ee868c610752565b511691602094604051936103028786610706565b8385528694918c916040959495519788966323c9e08160e01b8852610124880194600489015260248801526044870152606486015260848501528260a48501528960c48501528a60e485015261012061010485015281518091526101448401856101448360051b870101930191845b818110610413575050505082809103918d5af191821561040857908c9392918c926103b8575b50506001600160401b036103ad83600195610752565b9116905290506102ab565b819394508092503d8311610401575b6103d18183610706565b810103126103fd57516001600160401b03811681036103fd578a91906001600160401b036103ad610397565b8980fd5b503d6103c7565b6040513d8d823e3d90fd5b9387929650966001939781809397610143198c8403018a528a518051928391828652018585015e838284010152601f80199101160101960194019101928f92918795928795610371565b6001600160401b0361046f8284610752565b5116873b156103fd57604051906368bd322f60e01b825286600483015260248201528960448201528460648201528981608481838c5af180156104d457908a916104bb575b5050610292565b816104c591610706565b6104d057885f6104b4565b8880fd5b6040513d8c823e3d90fd5b888a8c604051928392602084019060208552518091526040840192915b81811061050a575050500390f35b82516001600160401b03168452859450602093840193909201916001016104fc565b60405163d47eed4560e01b81527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031693919250906020828061057a84876004840161077a565b0381875afa9182156105ee575f9261060c575b5081938234106105fd57803b156105f957604051631df3cbc560e31b8152935f938593849283916105c1916004840161077a565b03925af180156105ee576105d7575b819061022b565b6105e49197505f90610706565b5f956102396105d0565b6040513d5f823e3d90fd5b5f80fd5b63e4764c6f60e01b5f5260045ffd5b9091506020813d602011610638575b8161062860209383610706565b810103126105f95751905f61058d565b3d915061061b565b637dbacad160e11b5f5260045ffd5b90506020813d602011610682575b8161066a60209383610706565b810103126105f9575180151581036105f9575f61021d565b3d915061065d565b63512509d360e11b5f5260045ffd5b90508551145f6101ed565b823568ffffffffffffffffff811681036105f95781526020928301920161016b565b82356001600160801b03811681036105f95781526020928301920161010b565b82356001600160401b03811681036105f9578152602092830192016100ac565b90601f801991011681019081106001600160401b0382111761072757604052565b634e487b7160e01b5f52604160045260245ffd5b6001600160401b0381116107275760051b60200190565b80518210156107665760209160051b010190565b634e487b7160e01b5f52603260045260245ffd5b9180602084016020855252604083019060408160051b85010193835f91601e1982360301905b8484106107b1575050505050505090565b90919293949596603f198282030187528735838112156105f957840190602082359201916001600160401b0381116105f95780360383136105f9576020828280600196849695859652848401375f828201840152601f01601f19160101990197019594019291906107a0565b811561087d575f80809381935af13d15610878573d6001600160401b0381116107275760405190610858601f8201601f191660200183610706565b81525f60203d92013e5b1561086957565b6312171d8360e31b5f5260045ffd5b610862565b505056fea2646970667358221220001c7f6ce44e7c8de120016b67cc6815a2d5df58035616bd211232f4628a577964736f6c634300081c00330000000000000000000000002880ab155794e7179c9ee2e38200202908c17b43

Deployed Bytecode

0x60806040526004361015610011575f80fd5b5f5f3560e01c636cd2c81614610025575f80fd5b6101203660031901126105f9576004356001600160a01b03811691908290036105f95760243560ff81168091036105f957604435916001600160401b0383116105f957366023840112156105f95782600401356100818161073b565b9361008f6040519586610706565b8185526024602086019260051b820101903682116105f957602401915b8183106106e6575050506064356001600160401b0381116105f957366023820112156105f95780600401356100e08161073b565b916100ee6040519384610706565b8183526024602084019260051b820101903682116105f957602401915b8183106106c657505050608435946001600160401b0386116105f957366023870112156105f95785600401356101408161073b565b9661014e6040519889610706565b8188526024602089019260051b820101903682116105f957602401915b8183106106a45750505060a435956001600160801b0387168097036105f95760c435948515158096036105f95760e435610104356001600160401b0381116105f957366023820112156105f9578060040135906001600160401b0382116105f9576024810190602436918460051b0101116105f9578951875181149081610699575b501561068a5760405163f60559eb60e01b81523360048201526020816024818a5afa9081156105ee575f9161064f575b5015610640575f908261052c575b50610239915034033361081d565b87519661025e6102488961073b565b986102566040519a8b610706565b808a5261073b565b602089019990601f1901368b37875b81518110156104df5760016001600160401b0361028a8385610752565b51161161045d575b6001600160801b036102a4828a610752565b51166102b3575b60010161026d565b8b6001806102c18486610752565b5116146001600160801b036102d6848c610752565b5116908b68ffffffffffffffffff6102ee868c610752565b511691602094604051936103028786610706565b8385528694918c916040959495519788966323c9e08160e01b8852610124880194600489015260248801526044870152606486015260848501528260a48501528960c48501528a60e485015261012061010485015281518091526101448401856101448360051b870101930191845b818110610413575050505082809103918d5af191821561040857908c9392918c926103b8575b50506001600160401b036103ad83600195610752565b9116905290506102ab565b819394508092503d8311610401575b6103d18183610706565b810103126103fd57516001600160401b03811681036103fd578a91906001600160401b036103ad610397565b8980fd5b503d6103c7565b6040513d8d823e3d90fd5b9387929650966001939781809397610143198c8403018a528a518051928391828652018585015e838284010152601f80199101160101960194019101928f92918795928795610371565b6001600160401b0361046f8284610752565b5116873b156103fd57604051906368bd322f60e01b825286600483015260248201528960448201528460648201528981608481838c5af180156104d457908a916104bb575b5050610292565b816104c591610706565b6104d057885f6104b4565b8880fd5b6040513d8c823e3d90fd5b888a8c604051928392602084019060208552518091526040840192915b81811061050a575050500390f35b82516001600160401b03168452859450602093840193909201916001016104fc565b60405163d47eed4560e01b81527f0000000000000000000000002880ab155794e7179c9ee2e38200202908c17b436001600160a01b031693919250906020828061057a84876004840161077a565b0381875afa9182156105ee575f9261060c575b5081938234106105fd57803b156105f957604051631df3cbc560e31b8152935f938593849283916105c1916004840161077a565b03925af180156105ee576105d7575b819061022b565b6105e49197505f90610706565b5f956102396105d0565b6040513d5f823e3d90fd5b5f80fd5b63e4764c6f60e01b5f5260045ffd5b9091506020813d602011610638575b8161062860209383610706565b810103126105f95751905f61058d565b3d915061061b565b637dbacad160e11b5f5260045ffd5b90506020813d602011610682575b8161066a60209383610706565b810103126105f9575180151581036105f9575f61021d565b3d915061065d565b63512509d360e11b5f5260045ffd5b90508551145f6101ed565b823568ffffffffffffffffff811681036105f95781526020928301920161016b565b82356001600160801b03811681036105f95781526020928301920161010b565b82356001600160401b03811681036105f9578152602092830192016100ac565b90601f801991011681019081106001600160401b0382111761072757604052565b634e487b7160e01b5f52604160045260245ffd5b6001600160401b0381116107275760051b60200190565b80518210156107665760209160051b010190565b634e487b7160e01b5f52603260045260245ffd5b9180602084016020855252604083019060408160051b85010193835f91601e1982360301905b8484106107b1575050505050505090565b90919293949596603f198282030187528735838112156105f957840190602082359201916001600160401b0381116105f95780360383136105f9576020828280600196849695859652848401375f828201840152601f01601f19160101990197019594019291906107a0565b811561087d575f80809381935af13d15610878573d6001600160401b0381116107275760405190610858601f8201601f191660200183610706565b81525f60203d92013e5b1561086957565b6312171d8360e31b5f5260045ffd5b610862565b505056fea2646970667358221220001c7f6ce44e7c8de120016b67cc6815a2d5df58035616bd211232f4628a577964736f6c634300081c0033

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

0000000000000000000000002880ab155794e7179c9ee2e38200202908c17b43

-----Decoded View---------------
Arg [0] : pythAddress (address): 0x2880aB155794e7179c9eE2e38200202908C17B43

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000002880ab155794e7179c9ee2e38200202908c17b43


Deployed Bytecode Sourcemap

454:1869:5:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;454:1869:5;;;;;;-1:-1:-1;;;;;454:1869:5;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;454:1869:5;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;454:1869:5;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;454:1869:5;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;454:1869:5;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;454:1869:5;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;454:1869:5;;;;;;;;;;;;;;;;;;;;;;;1069:36;;:72;;;;454:1869;;;;;;;-1:-1:-1;;;1282:34:5;;1305:10;454:1869;1282:34;;454:1869;;;;;1282:34;;;;;;;;454:1869;1282:34;;;454:1869;;;;;;382:27:8;;378:247;;454:1869:5;688:9:8;748:4;688:9;;;454:1869:5;1305:10;748:4:8;:::i;:::-;454:1869:5;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;:::i;:::-;;;;;;-1:-1:-1;;454:1869:5;;;;1548:10;1581:3;454:1869;;1560:19;;;;;454:1869;-1:-1:-1;;;;;1604:11:5;;;;:::i;:::-;454:1869;;1604:15;1600:109;;1581:3;-1:-1:-1;;;;;1727:13:5;;;;:::i;:::-;454:1869;;1723:461;;1581:3;454:1869;;1548:10;;1723:461;1861:11;454:1869;1861:11;;;;;:::i;:::-;454:1869;2285:21;2284:30;-1:-1:-1;;;;;1895:13:5;;;;:::i;:::-;454:1869;;1931:9;;454:1869;1931:9;;;;:::i;:::-;454:1869;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;1786:337;;454:1869;;;1786:337;454:1869;1786:337;;454:1869;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1786:337;;;;;;;;;;;;;;;;;;;;;;;;;;454:1869;2142:27;;-1:-1:-1;;;;;2142:27:5;;454:1869;2142:27;;:::i;:::-;454:1869;;;;1723:461;;;;1786:337;;;;;;;;;;;;;;;;;;:::i;:::-;;;454:1869;;;;;-1:-1:-1;;;;;454:1869:5;;;;;;1786:337;;;-1:-1:-1;;;;;2142:27:5;1786:337;;454:1869;;;;1786:337;;;;;;454:1869;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1600:109;-1:-1:-1;;;;;1666:11:5;;;;:::i;:::-;454:1869;;1639:55;;;;;454:1869;;;;;;1639:55;;;454:1869;1639:55;;454:1869;;;;;;;;;;;;;;;1639:55;;454:1869;1639:55;;;;;;;;;;;;;;1600:109;;;;;1639:55;;;;;:::i;:::-;454:1869;;1639:55;;;;454:1869;;;;1639:55;454:1869;;;;;;;;;1560:19;;;;454:1869;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;454:1869:5;;;;;-1:-1:-1;454:1869:5;;;;;;;;;;;;;378:247:8;454:1869:5;;-1:-1:-1;;;431:34:8;;1388:4:5;-1:-1:-1;;;;;454:1869:5;;;;-1:-1:-1;454:1869:5;;;;431:34:8;454:1869:5;;;431:34:8;;;:::i;:::-;;;;;;;;;;;454:1869:5;431:34:8;;;378:247;425:40;;487:9;;;:16;454:1869:5;;564:50:8;;;;;454:1869:5;;-1:-1:-1;;;564:50:8;;454:1869:5;;;;;;;;;564:50:8;;454:1869:5;564:50:8;;;:::i;:::-;;;;;;;;;;;378:247;;;;;564:50;;;;;454:1869:5;564:50:8;;:::i;:::-;454:1869:5;;748:4:8;564:50;;;454:1869:5;;;;;;;;;564:50:8;454:1869:5;;;;;;;;;;;;431:34:8;;;;454:1869:5;431:34:8;;454:1869:5;431:34:8;;;;;;454:1869:5;431:34:8;;;:::i;:::-;;;454:1869:5;;;;;431:34:8;;;;;;;-1:-1:-1;431:34:8;;454:1869:5;;;;;;;;;1282:34;;;454:1869;1282:34;;454:1869;1282:34;;;;;;454:1869;1282:34;;;:::i;:::-;;;454:1869;;;;;;;;;;;;1282:34;;;;;;-1:-1:-1;1282:34:5;;454:1869;;;;;;;;;1069:72;454:1869;;;;1109:32;1069:72;;;454:1869;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;454:1869:5;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;454:1869:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;454:1869:5;;;;;;;:::o;:::-;;;;-1:-1:-1;454:1869:5;;;;;-1:-1:-1;454:1869:5;;-1:-1:-1;;;;;454:1869:5;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;454:1869:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;454:1869:5;;;;;;;;;;;;;;;787:233:8;859:10;;855:47;;868:1;930:25;;;;;;;454:1869:5;;;;;-1:-1:-1;;;;;454:1869:5;;;;;;;;;;;-1:-1:-1;;454:1869:5;;;;;:::i;:::-;;;868:1:8;454:1869:5;;;;;;;;;787:233:8:o;454:1869:5:-;;;;868:1:8;454:1869:5;;868:1:8;454:1869:5;;;;855:47:8;885:7;;:::o

Swarm Source

ipfs://001c7f6ce44e7c8de120016b67cc6815a2d5df58035616bd211232f4628a5779

Block Transaction Gas Used Reward
view all blocks produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits

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.