Contract

0xdDe460Bad702f0f0A602f223528d46033cCdbc20

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

-

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
_become8849322024-12-20 14:07:0624 hrs ago1734703626IN
0xdDe460Ba...33cCdbc20
0 S0.000058641.1

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

Contract Source Code Verified (Exact Match)

Contract Name:
RegistryV1

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 19 : RegistryV1.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

import "../interfaces/IRegistryV1.sol";
import "../interfaces/ITradingFloorV1.sol";
import "../interfaces/ChipEnumsV1.sol";

import "./RegistryStorage.sol";
import "./RegistryProxy.sol";

/**
 * @title RegistryV1
 * @dev Main administration contract for the Lynx platform, keeping track of all the system's contracts and their versions
 */
contract RegistryV1 is RegistryStorage, IRegistryV1Functionality {
  event AddressUpdated(string indexed name, address a);
  event NewVersionPublished(
    uint256 indexed version,
    bytes32 indexed contractNameHash,
    address contractImplementation
  );
  event FeesManagerSet(address indexed asset, address indexed feesManager);

  event TradingFloorSupported(address indexed tradingFloor);
  event SettlementAssetForTradingFloorAdded(
    address indexed tradingFloor,
    address indexed settlementAsset,
    address indexed lexPool,
    address poolAccountant
  );

  event ValidChipSpenderTargetByRoleSet(
    address indexed chip,
    string indexed role,
    address indexed spender
  );
  event ValidChipBurnHandlerSet(
    address indexed chip,
    address indexed burnHandler
  );

  // ***** Initialization functions *****

  /**
   * @notice Part of the Proxy mechanism
   */
  function _become(RegistryProxy registryProxy) public {
    require(msg.sender == registryProxy.admin(), "!proxy.admin");
    require(registryProxy._acceptImplementation() == 0, "fail");
  }

  // ***** Global Lock functions *****

  modifier onlyLockOwner() {
    require(msg.sender == systemLockOwner, "!LockOwner");
    _;
  }

  function lock() external override {
    require(validSystemLockOwners[msg.sender], "!ValidLocker");
    require(systemLockOwner == address(0), "AlreadyLocked");
    systemLockOwner = msg.sender;
  }

  function freeLock() external override onlyLockOwner {
    systemLockOwner = address(0);
  }

  function isTradersPortalAndLocker(
    address _address
  ) external view returns (bool) {
    return (systemLockOwner == _address) && (_address == tradersPortal);
  }

  function isTriggersAndLocker(address _address) external view returns (bool) {
    return (systemLockOwner == _address) && (_address == triggers);
  }

  function isTradersPortalOrTriggersAndLocker(
    address _address
  ) external view returns (bool) {
    return
      (systemLockOwner == _address) &&
      (_address == tradersPortal || _address == triggers);
  }

  // ***** Views *****

  /**
   * @return true if the given implementation is valid for the given proxy name
   */
  function isImplementationValidForProxy(
    bytes32 proxyNameHash,
    address _implementation
  ) external view returns (bool) {
    require(_implementation != address(0), "ZERO_ADDRESS");
    address latestImplementation = getLatestImplementationForProxyByHashInternal(
        proxyNameHash
      );
    return latestImplementation == _implementation;
  }

  /**
   * @return The address of the latest implementation version for the given proxy name hash
   */
  function getLatestImplementationForProxyByHash(
    bytes32 proxyNameHash
  ) external view returns (address) {
    return getLatestImplementationForProxyByHashInternal(proxyNameHash);
  }

  /**
   * @return The address of the latest implementation version for the given proxy name
   */
  function getLatestImplementationForProxyByName(
    string calldata proxyName
  ) external view returns (address) {
    bytes32 nameHash = keccak256(abi.encodePacked(proxyName));

    return getLatestImplementationForProxyByHashInternal(nameHash);
  }

  /**
   * @return An array of all supported trading floors
   */
  function getAllSupportedTradingFloors()
    external
    view
    returns (address[] memory)
  {
    return supportedTradingFloors;
  }

  /**
   * @return An array of all supported settlement assets
   */
  function getSettlementAssetsForTradingFloor(
    address _tradingFloor
  ) external view returns (address[] memory) {
    return settlementAssetsForTradingFloor[_tradingFloor];
  }

  /**
   * @return The address matching for the given role
   */
  function getDynamicRoleAddress(
    string calldata _role
  ) external view returns (address) {
    bytes32 roleHash = keccak256(abi.encodePacked(_role));
    return dynamicRoleAddresses[roleHash];
  }

  /**
   * @return The spender role address that is set for this chip
   */
  function getValidSpenderTargetForChipByRole(
    address chip,
    string calldata role
  ) external view returns (address) {
    bytes32 roleHash = keccak256(abi.encodePacked(role));
    return validSpenderTargetForChipByRole[chip][roleHash];
  }

  // ***** Admin Functions *****

  /**
   * Setter for any dynamic roles addresses
   */
  function setDynamicRoleAddress(
    string calldata _role,
    address _address
  ) external onlyAdmin {
    bytes32 roleHash = keccak256(abi.encodePacked(_role));
    dynamicRoleAddresses[roleHash] = _address;
    emit AddressUpdated(_role, _address);
  }

  /**
   * Setter for the 'OrderBook' contract
   */
  function setOrderBook(address _orderBook) external onlyAdmin {
    updateLockerAddressInternal(orderBook, _orderBook, "orderBook");
    orderBook = _orderBook;
  }

  /**
   * Setter for the 'TradersPortal' contract
   */
  function setTradersPortal(address _tradersPortal) external onlyAdmin {
    updateLockerAddressInternal(tradersPortal, _tradersPortal, "tradersPortal");
    tradersPortal = _tradersPortal;
  }

  /**
   * Setter for the 'Triggers' contract
   */
  function setTriggers(address _triggers) external onlyAdmin {
    updateLockerAddressInternal(triggers, _triggers, "triggers");
    triggers = _triggers;
  }

  /**
   * Setter for the 'TradeIntentsVerifier' contract
   */
  function setTradeIntentsVerifier(
    address _tradeIntentsVerifier
  ) external onlyAdmin {
    tradeIntentsVerifier = _tradeIntentsVerifier;
    emit AddressUpdated("tradeIntentsVerifier", _tradeIntentsVerifier);
  }

  /**
   * Setter for the 'LiquidityIntentsVerifier' contract
   */
  function setLiquidityIntentsVerifier(
    address _liquidityIntentsVerifier
  ) external onlyAdmin {
    liquidityIntentsVerifier = _liquidityIntentsVerifier;
    emit AddressUpdated("liquidityIntentsVerifier", _liquidityIntentsVerifier);
  }

  /**
   * Setter for the 'ChipsIntentsVerifier' contract
   */
  function setChipsIntentsVerifier(
    address _chipsIntentsVerifier
  ) external onlyAdmin {
    chipsIntentsVerifier = _chipsIntentsVerifier;
    emit AddressUpdated("chipsIntentsVerifier", _chipsIntentsVerifier);
  }

  /**
   * Sets lex proxies factory role for a specific asset
   */
  function setLexProxiesFactory(address _lexProxiesFactory) external onlyAdmin {
    lexProxiesFactory = _lexProxiesFactory;
    emit AddressUpdated("lexProxiesFactory", _lexProxiesFactory);
  }

  /**
   * Sets chips factory role for a specific asset
   */
  function setChipsFactory(address _chipsFactory) external onlyAdmin {
    chipsFactory = _chipsFactory;
    emit AddressUpdated("chipsFactory", _chipsFactory);
  }

  /**
   * Sets fee manager role for a specific asset
   */
  function setFeesManager(
    address asset,
    address feesManager
  ) external onlyAdmin {
    feesManagers[asset] = feesManager;

    emit FeesManagerSet(asset, feesManager);
  }

  /**
   * Allows setting/unsetting of valid spender targets for chips by specific roles
   */
  function setValidChipSpenderTargetByRole(
    address chip,
    string calldata role,
    address spender
  ) external onlyAdmin {
    setValidChipSpenderByRoleInternal(chip, role, spender);
  }

  /**
   * Allows setting/unsetting of valid burn handlers for chips
   */
  function setValidChipBurnHandler(
    address chip,
    address burnHandler
  ) external onlyAdmin {
    setValidChipBurnHandlerInternal(chip, burnHandler);
  }

  /**
   * Publish version for a single contract
   */
  function publishNewSystemVersionSingle(
    uint256 versionToPublish,
    bytes32 contractNameHash,
    address contractImplementation
  ) external onlyAdmin {
    publishNewSystemVersionSingleInternal(
      versionToPublish,
      contractNameHash,
      contractImplementation
    );
  }

  /**
   * Publish version for multiple contracts
   */
  function publishNewSystemVersionBatch(
    uint256 versionToPublish,
    bytes32[] calldata contractNameHashes,
    address[] calldata contractImplementations
  ) external onlyAdmin {
    require(
      contractNameHashes.length == contractImplementations.length,
      "Arrays must be 1:1"
    );

    for (uint256 i = 0; i < contractNameHashes.length; i++) {
      bytes32 contractNameHash = contractNameHashes[i];
      address contractImplementation = contractImplementations[i];

      publishNewSystemVersionSingleInternal(
        versionToPublish,
        contractNameHash,
        contractImplementation
      );
    }
  }

  /**
   * Supports a new Trading floor contract
   */
  function supportTradingFloor(address _tradingFloor) external onlyAdmin {
    isTradingFloorSupported[_tradingFloor] = true;

    supportedTradingFloors.push(_tradingFloor);

    emit TradingFloorSupported(_tradingFloor);
  }

  /**
   * Adds a new settlement asset for a trading floor
   */
  function addNewSettlementAssetInTradingFloor(
    address _tradingFloor,
    address _asset,
    address _lexPool,
    address _poolAccountant
  ) external onlyAdmin {
    require(
      _asset != address(0) &&
        _lexPool != address(0) &&
        _poolAccountant != address(0),
      "CANNOT_BE_ZERO_ADDRESS"
    );

    require(
      _asset == address(ILexPoolV1(_lexPool).underlying()),
      "LEX_UNDERLYING_MISMATCH"
    );

    require(
      address(IPoolAccountantV1(_poolAccountant).lexPool()) == _lexPool,
      "LEX_POOL_MISMATCH"
    );

    // Adds the LexPool as a valid system locker
    validSystemLockOwners[_lexPool] = true;

    // Add the settlement asset to the TradingFloor's list
    settlementAssetsForTradingFloor[_tradingFloor].push(_asset);

    // Add the settlement asset in the TradingFloor itself
    ITradingFloorV1(_tradingFloor).supportNewSettlementAsset(
      _asset,
      _lexPool,
      _poolAccountant
    );

    // Set the TradingFloor as a valid spender for the chip
    string memory tradingFloorRole = "TradingFloor";
    setValidChipSpenderByRoleInternal(_asset, tradingFloorRole, _tradingFloor);

    // Set the LexPool as a valid spender for the chip
    string memory lexPoolRole = "LexPool";
    setValidChipSpenderByRoleInternal(_asset, lexPoolRole, _lexPool);

    // Set the ChipsIntentsVerifier as a valid spender for the chip
    string memory chipsIntentsVerifierRole = "ChipsIntentsVerifier";
    setValidChipSpenderByRoleInternal(
      _asset,
      chipsIntentsVerifierRole,
      chipsIntentsVerifier
    );

    // Event
    emit SettlementAssetForTradingFloorAdded(
      _tradingFloor,
      _asset,
      _lexPool,
      _poolAccountant
    );
  }

  // ***** Internal Views *****

  function getLatestImplementationForProxyByHashInternal(
    bytes32 proxyNameHash
  ) internal view returns (address) {
    uint256 latestVersionNumber = latestVersions[proxyNameHash];
    return implementations[latestVersionNumber][proxyNameHash];
  }

  // ***** Internal Logic *****

  /**
   * Handles version publishing for a single versioned contract
   */
  function publishNewSystemVersionSingleInternal(
    uint256 versionToPublish,
    bytes32 contractNameHash,
    address contractImplementation
  ) internal {
    uint256 latestSystemVersion = latestVersions[contractNameHash];
    require(
      versionToPublish > latestSystemVersion,
      "MUST_PUBLISH_NEWER_VERSION"
    );
    require(contractImplementation != address(0), "IMPLEMENTATION_ZERO");

    latestVersions[contractNameHash] = versionToPublish;
    implementations[versionToPublish][
      contractNameHash
    ] = contractImplementation;

    emit NewVersionPublished(
      versionToPublish,
      contractNameHash,
      contractImplementation
    );
  }

  /**
   * Utility function to handle the "valid lockers" mechanism
   */
  function updateLockerAddressInternal(
    address _currentLocker,
    address _newLocker,
    string memory name
  ) internal {
    require(_newLocker != address(0), "CANNOT_BE_ZERO_ADDRESS");
    validSystemLockOwners[_currentLocker] = false;
    validSystemLockOwners[_newLocker] = true;
    emit AddressUpdated(name, _newLocker);
  }

  function setValidChipSpenderByRoleInternal(
    address chip,
    string memory role,
    address spender
  ) internal {
    bytes32 roleHash = keccak256(abi.encodePacked(role));
    address currentSpenderByRole = validSpenderTargetForChipByRole[chip][
      roleHash
    ];

    // Sanity
    require(currentSpenderByRole != spender, "ALREADY_SET");

    // Storage update
    validSpenderTargetForChipByRole[chip][roleHash] = spender;

    // Event
    emit ValidChipSpenderTargetByRoleSet(chip, role, spender);
  }

  function setValidChipBurnHandlerInternal(
    address chip,
    address burnHandler
  ) internal {
    address currentBurnHandler = validBurnHandlerForChip[chip];

    // Sanity
    require(currentBurnHandler != burnHandler, "ALREADY_SET");

    // Storage update
    validBurnHandlerForChip[chip] = burnHandler;

    // Event
    emit ValidChipBurnHandlerSet(chip, burnHandler);
  }
}

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

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

File 3 of 19 : AcceptableImplementationClaimableAdmin.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

import "./AcceptableImplementationClaimableAdminStorage.sol";

/**
 * @title SafeUpgradeableClaimableAdmin
 * @dev based on Compound's Unitroller
 * https://github.com/compound-finance/compound-protocol/blob/a3214f67b73310d547e00fc578e8355911c9d376/contracts/Unitroller.sol
 */
contract AcceptableImplementationClaimableAdmin is
  AcceptableImplementationClaimableAdminStorage
{
  /**
   * @notice Emitted when pendingImplementation is changed
   */
  event NewPendingImplementation(
    address oldPendingImplementation,
    address newPendingImplementation
  );

  /**
   * @notice Emitted when pendingImplementation is accepted, which means delegation implementation is updated
   */
  event NewImplementation(address oldImplementation, address newImplementation);

  /**
   * @notice Emitted when pendingAdmin is changed
   */
  event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);

  /**
   * @notice Emitted when pendingAdmin is accepted, which means admin is updated
   */
  event NewAdmin(address oldAdmin, address newAdmin);

  /*** Admin Functions ***/
  function _setPendingImplementation(address newPendingImplementation) public {
    require(msg.sender == admin, "not admin");
    require(
      approvePendingImplementationInternal(newPendingImplementation),
      "INVALID_IMPLEMENTATION"
    );

    address oldPendingImplementation = pendingImplementation;

    pendingImplementation = newPendingImplementation;

    emit NewPendingImplementation(
      oldPendingImplementation,
      pendingImplementation
    );
  }

  /**
   * @notice Accepts new implementation. msg.sender must be pendingImplementation
   * @dev Admin function for new implementation to accept it's role as implementation
   */
  function _acceptImplementation() public returns (uint) {
    // Check caller is pendingImplementation and pendingImplementation ≠ address(0)
    require(
      msg.sender == pendingImplementation &&
        pendingImplementation != address(0),
      "Not the EXISTING pending implementation"
    );

    // Save current values for inclusion in log
    address oldImplementation = implementation;
    address oldPendingImplementation = pendingImplementation;

    implementation = pendingImplementation;

    pendingImplementation = address(0);

    emit NewImplementation(oldImplementation, implementation);
    emit NewPendingImplementation(
      oldPendingImplementation,
      pendingImplementation
    );

    return 0;
  }

  /**
   * @notice Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.
   * @dev Admin function to begin change of admin. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.
   * @param newPendingAdmin New pending admin.
   */
  function _setPendingAdmin(address newPendingAdmin) public {
    // Check caller = admin
    require(msg.sender == admin, "Not Admin");

    // Save current value, if any, for inclusion in log
    address oldPendingAdmin = pendingAdmin;

    // Store pendingAdmin with value newPendingAdmin
    pendingAdmin = newPendingAdmin;

    // Emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin)
    emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin);
  }

  /**
   * @notice Accepts transfer of admin rights. msg.sender must be pendingAdmin
   * @dev Admin function for pending admin to accept role and update admin
   */
  function _acceptAdmin() public {
    // Check caller is pendingAdmin and pendingAdmin ≠ address(0)
    require(
      msg.sender == pendingAdmin && pendingAdmin != address(0),
      "Not the EXISTING pending admin"
    );

    // Save current values for inclusion in log
    address oldAdmin = admin;
    address oldPendingAdmin = pendingAdmin;

    // Store admin with value pendingAdmin
    admin = pendingAdmin;

    // Clear the pending value
    pendingAdmin = address(0);

    emit NewAdmin(oldAdmin, admin);
    emit NewPendingAdmin(oldPendingAdmin, pendingAdmin);
  }

  constructor(address _initialAdmin) {
    admin = _initialAdmin;
    emit NewAdmin(address(0), _initialAdmin);
  }

  /**
   * @dev Delegates execution to an implementation contract.
   * It returns to the external caller whatever the implementation returns
   * or forwards reverts.
   */
  fallback() external payable {
    // delegate all other functions to current implementation
    (bool success, ) = implementation.delegatecall(msg.data);

    assembly {
      let free_mem_ptr := mload(0x40)
      returndatacopy(free_mem_ptr, 0, returndatasize())

      switch success
      case 0 {
        revert(free_mem_ptr, returndatasize())
      }
      default {
        return(free_mem_ptr, returndatasize())
      }
    }
  }

  receive() external payable {}

  function approvePendingImplementationInternal(
    address // _implementation
  ) internal virtual returns (bool) {
    return true;
  }
}

File 4 of 19 : AcceptableImplementationClaimableAdminStorage.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

contract ClaimableAdminStorage {
  /**
   * @notice Administrator for this contract
   */
  address public admin;

  /**
   * @notice Pending administrator for this contract
   */
  address public pendingAdmin;

  /*** Modifiers ***/

  modifier onlyAdmin() {
    require(msg.sender == admin, "ONLY_ADMIN");
    _;
  }

  /*** Constructor ***/

  constructor() {
    // Set admin to caller
    admin = msg.sender;
  }
}

contract AcceptableImplementationClaimableAdminStorage is
  ClaimableAdminStorage
{
  /**
   * @notice Active logic
   */
  address public implementation;

  /**
   * @notice Pending logic
   */
  address public pendingImplementation;
}

contract AcceptableRegistryImplementationClaimableAdminStorage is
  AcceptableImplementationClaimableAdminStorage
{
  /**
   * @notice System Registry
   */
  address public registry;
}

File 5 of 19 : IContractRegistryBase.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

interface IContractRegistryBase {
  function isImplementationValidForProxy(
    bytes32 proxyNameHash,
    address _implementation
  ) external view returns (bool);
}

File 6 of 19 : ChipEnumsV1.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;

contract ChipEnumsV1 {
  enum ChipMode {
    NONE,
    LOCAL,
    REMOTE,
    HYBRID
  }
}

File 7 of 19 : IFundingRateModel.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

interface IFundingRateModel {
  // return value is the "funding paid by heavier side" in PRECISION per OI (heavier side) per second
  // e.g : (0.01 * PRECISION) = Paying (heavier) side (as a whole) pays 1% of funding per second for each OI unit
  function getFundingRate(
    uint256 pairId,
    uint256 openInterestLong,
    uint256 openInterestShort,
    uint256 pairMaxOpenInterest
  ) external view returns (uint256);
}

File 8 of 19 : IGlobalLock.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

interface IGlobalLock {
  function lock() external;
  function freeLock() external;
}

File 9 of 19 : IInterestRateModel.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

interface IInterestRateModel {
  // Returns asset/second of interest per borrowed unit
  // e.g : (0.01 * PRECISION) = 1% of interest per second
  function getBorrowRate(uint256 utilization) external view returns (uint256);
}

File 10 of 19 : ILexPoolV1.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

import "./LexErrors.sol";
import "./LexPoolAdminEnums.sol";
import "./IPoolAccountantV1.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface LexPoolStructs {
  struct PendingDeposit {
    uint256 amount;
    uint256 minAmountOut;
  }

  struct PendingRedeem {
    uint256 amount;
    uint256 minAmountOut;
    uint256 maxAmountOut;
  }
}

interface LexPoolEvents is LexPoolAdminEnums {
  event NewEpoch(
    uint256 epochId,
    int256 reportedUnrealizedPricePnL,
    uint256 exchangeRate,
    uint256 virtualUnderlyingBalance,
    uint256 totalSupply
  );

  event AddressUpdated(LexPoolAddressesEnum indexed enumCode, address a);
  event NumberUpdated(LexPoolNumbersEnum indexed enumCode, uint value);
  event DepositRequest(
    address indexed user,
    uint256 amount,
    uint256 minAmountOut,
    uint256 processingEpoch
  );
  event RedeemRequest(
    address indexed user,
    uint256 amount,
    uint256 minAmountOut,
    uint256 processingEpoch
  );
  event ProcessedDeposit(
    address indexed user,
    bool deposited,
    uint256 depositedAmount
  );
  event ProcessedRedeem(
    address indexed user,
    bool redeemed,
    uint256 withdrawnAmount // Underlying amount
  );
  event CanceledDeposit(
    address indexed user,
    uint256 epoch,
    uint256 cancelledAmount
  );
  event CanceledRedeem(
    address indexed user,
    uint256 epoch,
    uint256 cancelledAmount
  );
  event ImmediateDepositAllowedToggled(bool indexed value);
  event ImmediateDeposit(
    address indexed depositor,
    uint256 depositAmount,
    uint256 mintAmount
  );
  event ReservesWithdrawn(
    address _to,
    uint256 interestShare,
    uint256 totalFundingShare
  );
}

interface ILexPoolFunctionality is
  IERC20,
  LexPoolStructs,
  LexPoolEvents,
  LexErrors
{
  function setPoolAccountant(
    IPoolAccountantFunctionality _poolAccountant
  ) external;

  function setPnlRole(address pnl) external;

  function setMaxExtraWithdrawalAmountF(uint256 maxExtra) external;

  function setEpochsDelayDeposit(uint256 delay) external;

  function setEpochsDelayRedeem(uint256 delay) external;

  function setEpochDuration(uint256 duration) external;

  function setMinDepositAmount(uint256 amount) external;

  function toggleImmediateDepositAllowed() external;

  function reduceReserves(
    address _to
  ) external returns (uint256 interestShare, uint256 totalFundingShare);

  function requestDeposit(
    uint256 amount,
    uint256 minAmountOut,
    bytes32 domain,
    bytes32 referralCode
  ) external;

  function requestDepositViaIntent(
    address user,
    uint256 amount,
    uint256 minAmountOut,
    bytes32 domain,
    bytes32 referralCode
  ) external;

  function requestRedeem(uint256 amount, uint256 minAmountOut) external;

  function requestRedeemViaIntent(
    address user,
    uint256 amount,
    uint256 minAmountOut
  ) external;

  function processDeposit(
    address[] memory users
  )
    external
    returns (
      uint256 amountDeposited,
      uint256 amountCancelled,
      uint256 counterDeposited,
      uint256 counterCancelled
    );

  function cancelDeposits(
    address[] memory users,
    uint256[] memory epochs
  ) external;

  function processRedeems(
    address[] memory users
  )
    external
    returns (
      uint256 amountRedeemed,
      uint256 amountCancelled,
      uint256 counterDeposited,
      uint256 counterCancelled
    );

  function cancelRedeems(
    address[] memory users,
    uint256[] memory epochs
  ) external;

  function nextEpoch(
    int256 totalUnrealizedPricePnL
  ) external returns (uint256 newExchangeRate);

  function currentVirtualUtilization() external view returns (uint256);

  function currentVirtualUtilization(
    uint256 totalBorrows,
    uint256 totalReserves,
    int256 unrealizedFunding
  ) external view returns (uint256);

  function virtualBalanceForUtilization() external view returns (uint256);

  function virtualBalanceForUtilization(
    uint256 extraAmount,
    int256 unrealizedFunding
  ) external view returns (uint256);

  function underlyingBalanceForExchangeRate() external view returns (uint256);

  function sendAssetToTrader(address to, uint256 amount) external;

  function isUtilizationForLPsValid() external view returns (bool);
}

interface ILexPoolV1 is ILexPoolFunctionality {
  function name() external view returns (string memory);

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

  function SELF_UNIT_SCALE() external view returns (uint);

  function underlyingDecimals() external view returns (uint256);

  function poolAccountant() external view returns (address);

  function underlying() external view returns (IERC20);

  function tradingFloor() external view returns (address);

  function currentEpoch() external view returns (uint256);

  function currentExchangeRate() external view returns (uint256);

  function nextEpochStartMin() external view returns (uint256);

  function epochDuration() external view returns (uint256);

  function minDepositAmount() external view returns (uint256);

  function epochsDelayDeposit() external view returns (uint256);

  function epochsDelayRedeem() external view returns (uint256);

  function immediateDepositAllowed() external view returns (bool);

  function pendingDeposits(
    uint epoch,
    address account
  ) external view returns (PendingDeposit memory);

  function pendingRedeems(
    uint epoch,
    address account
  ) external view returns (PendingRedeem memory);

  function pendingDepositAmount() external view returns (uint256);

  function pendingWithdrawalAmount() external view returns (uint256);
}

File 11 of 19 : IPoolAccountantV1.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

import "./LexErrors.sol";
import "./ILexPoolV1.sol";
import "./IInterestRateModel.sol";
import "./IFundingRateModel.sol";
import "./TradingEnumsV1.sol";

interface PoolAccountantStructs {
  // @note To be used for passing information in function calls
  struct PositionRegistrationParams {
    uint256 collateral;
    uint32 leverage;
    bool long;
    uint64 openPrice;
    uint64 tp;
  }

  struct PairFunding {
    // Slot 0
    int256 accPerOiLong; // 32 bytes -- Underlying Decimals
    // Slot 1
    int256 accPerOiShort; // 32 bytes -- Underlying Decimals
    // Slot 2
    uint256 lastUpdateTimestamp; // 32 bytes
  }

  struct TradeInitialAccFees {
    // Slot 0
    uint256 borrowIndex; // 32 bytes
    // Slot 1
    int256 funding; // 32 bytes -- underlying units -- Underlying Decimals
  }

  struct PairOpenInterest {
    // Slot 0
    uint256 long; // 32 bytes -- underlying units -- Dynamic open interest for long positions
    // Slot 1
    uint256 short; // 32 bytes -- underlying units -- Dynamic open interest for short positions
  }

  // This struct is not kept in storage
  struct PairFromTo {
    string from;
    string to;
  }

  struct Pair {
    // Slot 0
    uint16 id; // 02 bytes
    uint16 groupId; // 02 bytes
    uint16 feeId; // 02 bytes
    uint32 minLeverage; // 04 bytes
    uint32 maxLeverage; // 04 bytes
    uint32 maxBorrowF; // 04 bytes -- FRACTION_SCALE (5)
    // Slot 1
    uint256 maxPositionSize; // 32 bytes -- underlying units
    // Slot 2
    uint256 maxGain; // 32 bytes -- underlying units
    // Slot 3
    uint256 maxOpenInterest; // 32 bytes -- Underlying units
    // Slot 4
    uint256 maxSkew; // 32 bytes -- underlying units
    // Slot 5
    uint256 minOpenFee; // 32 bytes -- underlying units. MAX_UINT means use the default group level value
    // Slot 6
    uint256 minPerformanceFee; // 32 bytes -- underlying units
  }

  struct Group {
    // Slot 0
    uint16 id; // 02 bytes
    uint32 minLeverage; // 04 bytes
    uint32 maxLeverage; // 04 bytes
    uint32 maxBorrowF; // 04 bytes -- FRACTION_SCALE (5)
    // Slot 1
    uint256 maxPositionSize; // 32 bytes (Underlying units)
    // Slot 2
    uint256 minOpenFee; // 32 bytes (Underlying uints). MAX_UINT means use the default global level value
  }

  struct Fee {
    // Slot 0
    uint16 id; // 02 bytes
    uint32 openFeeF; // 04 bytes -- FRACTION_SCALE (5) (Fraction of leveraged pos)
    uint32 closeFeeF; // 04 bytes -- FRACTION_SCALE (5) (Fraction of leveraged pos)
    uint32 performanceFeeF; // 04 bytes -- FRACTION_SCALE (5) (Fraction of performance)
  }
}

interface PoolAccountantEvents is PoolAccountantStructs {
  event PairAdded(
    uint256 indexed id,
    string indexed from,
    string indexed to,
    Pair pair
  );
  event PairUpdated(uint256 indexed id, Pair pair);

  event GroupAdded(uint256 indexed id, string indexed groupName, Group group);
  event GroupUpdated(uint256 indexed id, Group group);

  event FeeAdded(uint256 indexed id, string indexed name, Fee fee);
  event FeeUpdated(uint256 indexed id, Fee fee);

  event TradeInitialAccFeesStored(
    bytes32 indexed positionId,
    uint256 borrowIndex,
    // uint256 rollover,
    int256 funding
  );

  event AccrueFunding(
    uint256 indexed pairId,
    int256 valueLong,
    int256 valueShort
  );

  event ProtocolFundingShareAccrued(
    uint16 indexed pairId,
    uint256 protocolFundingShare
  );
  // event AccRolloverFeesStored(uint256 pairIndex, uint256 value);

  event FeesCharged(
    bytes32 indexed positionId,
    address indexed trader,
    uint16 indexed pairId,
    PositionRegistrationParams positionRegistrationParams,
    //        bool long,
    //        uint256 collateral, // Underlying Decimals
    //        uint256 leverage,
    int256 profitPrecision, // PRECISION
    uint256 interest,
    int256 funding, // Underlying Decimals
    uint256 closingFee,
    uint256 tradeValue
  );

  event PerformanceFeeCharging(
    bytes32 indexed positionId,
    uint256 performanceFee
  );

  event MaxOpenInterestUpdated(uint256 pairIndex, uint256 maxOpenInterest);

  event AccrueInterest(
    uint256 cash,
    uint256 totalInterestNew,
    uint256 borrowIndexNew,
    uint256 interestShareNew
  );

  event Borrow(
    uint256 indexed pairId,
    uint256 borrowAmount,
    uint256 newTotalBorrows
  );

  event Repay(
    uint256 indexed pairId,
    uint256 repayAmount,
    uint256 newTotalBorrows
  );
}

interface IPoolAccountantFunctionality is
  PoolAccountantStructs,
  PoolAccountantEvents,
  LexErrors,
  TradingEnumsV1
{
  function setTradeIncentivizer(address _tradeIncentivizer) external;

  function setMaxGainF(uint256 _maxGainF) external;

  function setFrm(IFundingRateModel _frm) external;

  function setMinOpenFee(uint256 min) external;

  function setLexPartF(uint256 partF) external;

  function setFundingRateMax(uint256 maxValue) external;

  function setLiquidationThresholdF(uint256 threshold) external;

  function setLiquidationFeeF(uint256 fee) external;

  function setIrm(IInterestRateModel _irm) external;

  function setIrmHard(IInterestRateModel _irm) external;

  function setInterestShareFactor(uint256 factor) external;
  
  function setFundingShareFactor(uint256 factor) external;

  function setBorrowRateMax(uint256 rate) external;

  function setMaxTotalBorrows(uint256 maxBorrows) external;

  function setMaxVirtualUtilization(uint256 _maxVirtualUtilization) external;

  function resetTradersPairGains(uint256 pairId) external;

  function addGroup(Group calldata _group) external;

  function updateGroup(Group calldata _group) external;

  function addFee(Fee calldata _fee) external;

  function updateFee(Fee calldata _fee) external;

  function addPair(Pair calldata _pair) external;

  function addPairs(Pair[] calldata _pairs) external;

  function updatePair(Pair calldata _pair) external;

  function readAndZeroReserves()
    external
    returns (uint256 accumulatedInterestShare,
             uint256 accFundingShare);

  function registerOpenTrade(
    bytes32 positionId,
    address trader,
    uint16 pairId,
    uint256 collateral,
    uint32 leverage,
    bool long,
    uint256 tp,
    uint256 openPrice
  ) external returns (uint256 fee, uint256 lexPartFee);

  function registerCloseTrade(
    bytes32 positionId,
    address trader,
    uint16 pairId,
    PositionRegistrationParams calldata positionRegistrationParams,
    uint256 closePrice,
    PositionCloseType positionCloseType
  )
    external
    returns (
      uint256 closingFee,
      uint256 tradeValue,
      int256 profitPrecision,
      uint finalClosePrice
    );

  function registerUpdateTp(
    bytes32 positionId,
    address trader,
    uint16 pairId,
    uint256 collateral,
    uint32 leverage,
    bool long,
    uint256 openPrice,
    uint256 oldTriggerPrice,
    uint256 triggerPrice
  ) external;

  // function registerUpdateSl(
  //     address trader,
  //     uint256 pairIndex,
  //     uint256 index,
  //     uint256 collateral,
  //     uint256 leverage,
  //     bool long,
  //     uint256 openPrice,
  //     uint256 triggerPrice
  // ) external returns (uint256 fee);

  function accrueInterest()
    external
    returns (
      uint256 totalInterestNew,
      uint256 interestShareNew,
      uint256 borrowIndexNew
    );

  // Limited only for the LexPool
  function accrueInterest(
    uint256 availableCash
  )
    external
    returns (
      uint256 totalInterestNew,
      uint256 interestShareNew,
      uint256 borrowIndexNew
    );

  function getTradeClosingValues(
    bytes32 positionId,
    uint16 pairId,
    PositionRegistrationParams calldata positionRegistrationParams,
    uint256 closePrice,
    bool isLiquidation
  )
    external
    returns (
      uint256 tradeValue, // Underlying Decimals
      uint256 safeClosingFee,
      int256 profitPrecision,
      uint256 interest,
      int256 funding
    );

  function getTradeLiquidationPrice(
    bytes32 positionId,
    uint16 pairId,
    uint256 openPrice, // PRICE_SCALE (8)
    uint256 tp,
    bool long,
    uint256 collateral, // Underlying Decimals
    uint32 leverage
  )
    external
    returns (
      uint256 // PRICE_SCALE (8)
    );

  function calcTradeDynamicFees(
    bytes32 positionId,
    uint16 pairId,
    bool long,
    uint256 collateral,
    uint32 leverage,
    uint256 openPrice,
    uint256 tp
  ) external returns (uint256 interest, int256 funding);

  function unrealizedFunding() external view returns (int256);

  function totalBorrows() external view returns (uint256);

  function interestShare() external view returns (uint256);
  
  function fundingShare() external view returns (uint256);

  function totalReservesView() external view returns (uint256);

  function borrowsAndInterestShare()
    external
    view
    returns (uint256 totalBorrows, uint256 totalInterestShare);

  function pairTotalOpenInterest(
    uint256 pairIndex
  ) external view returns (int256);

  function pricePnL(
    uint256 pairId,
    uint256 price
  ) external view returns (int256);

  function getAllSupportedPairIds() external view returns (uint16[] memory);

  function getAllSupportedGroupsIds() external view returns (uint16[] memory);

  function getAllSupportedFeeIds() external view returns (uint16[] memory);
}

interface IPoolAccountantV1 is IPoolAccountantFunctionality {
  function totalBorrows() external view returns (uint256);

  function maxTotalBorrows() external view returns (uint256);

  function pairBorrows(uint256 pairId) external view returns (uint256);

  function groupBorrows(uint256 groupId) external view returns (uint256);

  function pairMaxBorrow(uint16 pairId) external view returns (uint256);

  function groupMaxBorrow(uint16 groupId) external view returns (uint256);

  function lexPool() external view returns (ILexPoolV1);

  function maxGainF() external view returns (uint256);

  function interestShareFactor() external view returns (uint256);
  
  function fundingShareFactor() external view returns (uint256);

  function frm() external view returns (IFundingRateModel);

  function irm() external view returns (IInterestRateModel);

  function pairs(uint16 pairId) external view returns (Pair memory);

  function groups(uint16 groupId) external view returns (Group memory);

  function fees(uint16 feeId) external view returns (Fee memory);

  function openInterestInPair(
    uint pairId
  ) external view returns (PairOpenInterest memory);

  function minOpenFee() external view returns (uint256);

  function liquidationThresholdF() external view returns (uint256);

  function liquidationFeeF() external view returns (uint256);

  function lexPartF() external view returns (uint256);

  function tradersPairGains(uint256 pairId) external view returns (int256);

  function calcBorrowAmount(
    uint256 collateral,
    uint256 leverage,
    bool long,
    uint256 openPrice,
    uint256 tp
  ) external pure returns (uint256);
}

File 12 of 19 : IRegistryV1.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

import "../../AdministrationContracts/IContractRegistryBase.sol";
import "./IGlobalLock.sol";

interface IRegistryV1Functionality is IContractRegistryBase, IGlobalLock {
  // **** Locking mechanism ****

  function isTradersPortalAndLocker(
    address _address
  ) external view returns (bool);

  function isTriggersAndLocker(address _address) external view returns (bool);

  function isTradersPortalOrTriggersAndLocker(
    address _address
  ) external view returns (bool);
}

interface IRegistryV1 is IRegistryV1Functionality {
  // **** Public Storage params ****

  function feesManagers(address asset) external view returns (address);

  function orderBook() external view returns (address);

  function tradersPortal() external view returns (address);

  function triggers() external view returns (address);

  function tradeIntentsVerifier() external view returns (address);

  function liquidityIntentsVerifier() external view returns (address);

  function chipsIntentsVerifier() external view returns (address);

  function lexProxiesFactory() external view returns (address);

  function chipsFactory() external view returns (address);

  /**
   * @return An array of all supported trading floors
   */
  function getAllSupportedTradingFloors()
    external
    view
    returns (address[] memory);

  /**
   * @return An array of all supported settlement assets
   */
  function getSettlementAssetsForTradingFloor(
    address _tradingFloor
  ) external view returns (address[] memory);

  /**
   * @return The spender role address that is set for this chip
   */
  function getValidSpenderTargetForChipByRole(
    address chip,
    string calldata role
  ) external view returns (address);

  /**
   * @return the address of the valid 'burnHandler' for the chip
   */
  function validBurnHandlerForChip(
    address chip
  ) external view returns (address);

  /**
   * @return The address matching for the given role
   */
  function getDynamicRoleAddress(
    string calldata _role
  ) external view returns (address);
}

File 13 of 19 : ITradingFloorV1.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

import "./TradingFloorStructsV1.sol";
import "./IPoolAccountantV1.sol";
import "./ILexPoolV1.sol";

interface ITradingFloorV1Functionality is TradingFloorStructsV1 {
  function supportNewSettlementAsset(
    address _asset,
    address _lexPool,
    address _poolAccountant
  ) external;

  function getPositionTriggerInfo(
    bytes32 _positionId
  )
    external
    view
    returns (
      PositionPhase positionPhase,
      uint64 timestamp,
      uint16 pairId,
      bool long,
      uint32 spreadReductionF
    );

  function getPositionPortalInfo(
    bytes32 _positionId
  )
    external
    view
    returns (
      PositionPhase positionPhase,
      uint64 inPhaseSince,
      address positionTrader
    );

  function storePendingPosition(
    OpenOrderType _orderType,
    PositionRequestIdentifiers memory _requestIdentifiers,
    PositionRequestParams memory _requestParams,
    uint32 _spreadReductionF
  ) external returns (bytes32 positionId);

  function setOpenedPositionToMarketClose(
    bytes32 _positionId,
    uint64 _minPrice,
    uint64 _maxPrice
  ) external;

  function cancelPendingPosition(
    bytes32 _positionId,
    OpenOrderType _orderType,
    uint feeFraction
  ) external;

  function cancelMarketCloseForPosition(
    bytes32 _positionId,
    CloseOrderType _orderType,
    uint feeFraction
  ) external;

  function updatePendingPosition_openLimit(
    bytes32 _positionId,
    uint64 _minPrice,
    uint64 _maxPrice,
    uint64 _tp,
    uint64 _sl
  ) external;

  function openNewPosition_market(
    bytes32 _positionId,
    uint64 assetEffectivePrice,
    uint256 feeForCancellation
  ) external;

  function openNewPosition_limit(
    bytes32 _positionId,
    uint64 assetEffectivePrice,
    uint256 feeForCancellation
  ) external;

  function closeExistingPosition_Market(
    bytes32 _positionId,
    uint64 assetPrice,
    uint64 effectivePrice
  ) external;

  function closeExistingPosition_Limit(
    bytes32 _positionId,
    LimitTrigger limitTrigger,
    uint64 assetPrice,
    uint64 effectivePrice
  ) external;

  // Manage open trade
  function updateOpenedPosition(
    bytes32 _positionId,
    PositionField updateField,
    uint64 fieldValue,
    uint64 effectivePrice
  ) external;

  // Fees
  function collectFee(address _asset, FeeType _feeType, address _to) external;
}

interface ITradingFloorV1 is ITradingFloorV1Functionality {
  function PRECISION() external pure returns (uint);

  // *** Views ***

  function pairTradersArray(
    address _asset,
    uint _pairIndex
  ) external view returns (address[] memory);

  function generatePositionHashId(
    address settlementAsset,
    address trader,
    uint16 pairId,
    uint32 index
  ) external pure returns (bytes32 hashId);

  // *** Public Storage addresses ***

  function lexPoolForAsset(address asset) external view returns (ILexPoolV1);

  function poolAccountantForAsset(
    address asset
  ) external view returns (IPoolAccountantV1);

  function registry() external view returns (address);

  // *** Public Storage params ***

  function positionsById(bytes32 id) external view returns (Position memory);

  function positionIdentifiersById(
    bytes32 id
  ) external view returns (PositionIdentifiers memory);

  function positionLimitsInfoById(
    bytes32 id
  ) external view returns (PositionLimitsInfo memory);

  function triggerPricesById(
    bytes32 id
  ) external view returns (PositionTriggerPrices memory);

  function pairTradersInfo(
    address settlementAsset,
    address trader,
    uint pairId
  ) external view returns (PairTraderInfo memory);

  function spreadReductionsP(uint) external view returns (uint);

  function maxSlF() external view returns (uint);

  function maxTradesPerPair() external view returns (uint);

  function maxSanityProfitF() external view returns (uint);

  function feesMap(
    address settlementAsset,
    FeeType feeType
  ) external view returns (uint256);
}

File 14 of 19 : LexErrors.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

interface LexErrors {
  enum CapType {
    NONE, // 0
    MIN_OPEN_FEE, // 1
    MAX_POS_SIZE_PAIR, // 2
    MAX_POS_SIZE_GROUP, // 3
    MAX_LEVERAGE, // 4
    MIN_LEVERAGE, // 5
    MAX_VIRTUAL_UTILIZATION, // 6
    MAX_OPEN_INTEREST, // 7
    MAX_ABS_SKEW, // 8
    MAX_BORROW_PAIR, // 9
    MAX_BORROW_GROUP, // 10
    MIN_DEPOSIT_AMOUNT, // 11
    MAX_ACCUMULATED_GAINS, // 12
    BORROW_RATE_MAX, // 13
    FUNDING_RATE_MAX, // 14
    MAX_POTENTIAL_GAIN, // 15
    MAX_TOTAL_BORROW, // 16
    MIN_PERFORMANCE_FEE // 17
    //...
  }
  error CapError(CapType, uint256 value);
}

File 15 of 19 : LexPoolAdminEnums.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;

interface LexPoolAdminEnums {
  enum LexPoolAddressesEnum {
    none,
    poolAccountant,
    pnlRole
  }

  enum LexPoolNumbersEnum {
    none,
    maxExtraWithdrawalAmountF,
    epochsDelayDeposit,
    epochsDelayRedeem,
    epochDuration,
    minDepositAmount
  }
}

File 16 of 19 : TradingEnumsV1.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

interface TradingEnumsV1 {
  enum PositionPhase {
    NONE,
    OPEN_MARKET,
    OPEN_LIMIT,
    OPENED,
    CLOSE_MARKET,
    CLOSED
  }

  enum OpenOrderType {
    NONE,
    MARKET,
    LIMIT
  }
  enum CloseOrderType {
    NONE,
    MARKET
  }
  enum FeeType {
    NONE,
    OPEN_FEE,
    CLOSE_FEE,
    TRIGGER_FEE
  }
  enum LimitTrigger {
    NONE,
    TP,
    SL,
    LIQ
  }
  enum PositionField {
    NONE,
    TP,
    SL
  }

  enum PositionCloseType {
    NONE,
    TP,
    SL,
    LIQ,
    MARKET
  }
}

File 17 of 19 : TradingFloorStructsV1.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

import "./TradingEnumsV1.sol";

interface TradingFloorStructsV1 is TradingEnumsV1 {
  enum AdminNumericParam {
    NONE,
    MAX_TRADES_PER_PAIR,
    MAX_SL_F,
    MAX_SANITY_PROFIT_F
  }

  /**
   * @dev Memory struct for identifiers
   */
  struct PositionRequestIdentifiers {
    address trader;
    uint16 pairId;
    address settlementAsset;
    uint32 positionIndex;
  }

  struct PositionRequestParams {
    bool long;
    uint256 collateral; // Settlement Asset Decimals
    uint32 leverage;
    uint64 minPrice; // PRICE_SCALE
    uint64 maxPrice; // PRICE_SCALE
    uint64 tp; // PRICE_SCALE
    uint64 sl; // PRICE_SCALE
    uint64 tpByFraction; // FRACTION_SCALE
    uint64 slByFraction; // FRACTION_SCALE
  }

  /**
   * @dev Storage struct for identifiers
   */
  struct PositionIdentifiers {
    // Slot 0
    address settlementAsset; // 20 bytes
    uint16 pairId; // 02 bytes
    uint32 index; // 04 bytes
    // Slot 1
    address trader; // 20 bytes
  }

  struct Position {
    // Slot 0
    uint collateral; // 32 bytes -- Settlement Asset Decimals
    // Slot 1
    PositionPhase phase; // 01 bytes
    uint64 inPhaseSince; // 08 bytes
    uint32 leverage; // 04 bytes
    bool long; // 01 bytes
    uint64 openPrice; // 08 bytes -- PRICE_SCALE (8)
    uint32 spreadReductionF; // 04 bytes -- FRACTION_SCALE (5)
  }

  /**
   * Holds the non liquidation limits for the position
   */
  struct PositionLimitsInfo {
    uint64 tpLastUpdated; // 08 bytes -- timestamp
    uint64 slLastUpdated; // 08 bytes -- timestamp
    uint64 tp; // 08 bytes -- PRICE_SCALE (8)
    uint64 sl; // 08 bytes -- PRICE_SCALE (8)
  }

  /**
   * Holds the prices for opening (and market closing) of a position
   */
  struct PositionTriggerPrices {
    uint64 minPrice; // 08 bytes -- PRICE_SCALE
    uint64 maxPrice; // 08 bytes -- PRICE_SCALE
    uint64 tpByFraction; // 04 bytes -- FRACTION_SCALE
    uint64 slByFraction; // 04 bytes -- FRACTION_SCALE
  }

  /**
   * @dev administration struct, used to keep tracks on the 'PairTraders' list and
   *      to limit the amount of positions a trader can have
   */
  struct PairTraderInfo {
    uint32 positionsCounter; // 04 bytes
    uint32 positionInArray; // 04 bytes (the index + 1)
    // Note : Can add more fields here
  }
}

File 18 of 19 : RegistryProxy.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

import "../../AdministrationContracts/AcceptableImplementationClaimableAdmin.sol";

/**
 * @title RegistryProxy
 * @dev Used as the contracts registry brain of the Lynx platform
 */
contract RegistryProxy is AcceptableImplementationClaimableAdmin {
  constructor() AcceptableImplementationClaimableAdmin(msg.sender) {}
}

File 19 of 19 : RegistryStorage.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.24;

import "../../AdministrationContracts/AcceptableImplementationClaimableAdminStorage.sol";

/**
 * @title RegistryStorage
 * @dev Storage contract for the Registry
 */
contract RegistryStorage is AcceptableImplementationClaimableAdminStorage {
  uint256 public constant VERSION_SCALE = 1000; // 1,000 = 1.00, 1,120 = 1.12

  // ***** Locking mechanism *****

  // System lock
  address public systemLockOwner;

  // Address => is allowed to lock the system
  mapping(address => bool) public validSystemLockOwners;

  // ***** Versioning mechanism *****

  // contract name hash => latest version number
  mapping(bytes32 => uint256) public latestVersions;

  // version => (contract name hash => implementation)
  mapping(uint256 => mapping(bytes32 => address)) public implementations;

  // ***** Trading Floors *****

  // trading floor => is supported
  mapping(address => bool) public isTradingFloorSupported;

  // all supported trading floors
  address[] public supportedTradingFloors;

  // trading floor => supported settlement assets lists
  mapping(address => address[]) public settlementAssetsForTradingFloor;

  // ***** Roles mechanism *****

  // asset => feesManager
  mapping(address => address) public feesManagers;

  // role hash => address
  mapping(bytes32 => address) public dynamicRoleAddresses;

  address public orderBook;

  address public tradersPortal;

  address public triggers;

  address public tradeIntentsVerifier;

  address public liquidityIntentsVerifier;

  address public chipsIntentsVerifier;

  // ***** Chips *****

  // chip => role (hash) => spender
  mapping(address => mapping(bytes32 => address))
    public validSpenderTargetForChipByRole;

  // chip => valid burn handler
  mapping(address => address) public validBurnHandlerForChip;

  // ***** Factories *****

  address public lexProxiesFactory;

  address public chipsFactory;
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"address","name":"a","type":"address"}],"name":"AddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":true,"internalType":"address","name":"feesManager","type":"address"}],"name":"FeesManagerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"version","type":"uint256"},{"indexed":true,"internalType":"bytes32","name":"contractNameHash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"contractImplementation","type":"address"}],"name":"NewVersionPublished","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tradingFloor","type":"address"},{"indexed":true,"internalType":"address","name":"settlementAsset","type":"address"},{"indexed":true,"internalType":"address","name":"lexPool","type":"address"},{"indexed":false,"internalType":"address","name":"poolAccountant","type":"address"}],"name":"SettlementAssetForTradingFloorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tradingFloor","type":"address"}],"name":"TradingFloorSupported","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"chip","type":"address"},{"indexed":true,"internalType":"address","name":"burnHandler","type":"address"}],"name":"ValidChipBurnHandlerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"chip","type":"address"},{"indexed":true,"internalType":"string","name":"role","type":"string"},{"indexed":true,"internalType":"address","name":"spender","type":"address"}],"name":"ValidChipSpenderTargetByRoleSet","type":"event"},{"inputs":[],"name":"VERSION_SCALE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract RegistryProxy","name":"registryProxy","type":"address"}],"name":"_become","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tradingFloor","type":"address"},{"internalType":"address","name":"_asset","type":"address"},{"internalType":"address","name":"_lexPool","type":"address"},{"internalType":"address","name":"_poolAccountant","type":"address"}],"name":"addNewSettlementAssetInTradingFloor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"chipsFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"chipsIntentsVerifier","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"dynamicRoleAddresses","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"feesManagers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"freeLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAllSupportedTradingFloors","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_role","type":"string"}],"name":"getDynamicRoleAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"proxyNameHash","type":"bytes32"}],"name":"getLatestImplementationForProxyByHash","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"proxyName","type":"string"}],"name":"getLatestImplementationForProxyByName","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tradingFloor","type":"address"}],"name":"getSettlementAssetsForTradingFloor","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"chip","type":"address"},{"internalType":"string","name":"role","type":"string"}],"name":"getValidSpenderTargetForChipByRole","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"implementations","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"proxyNameHash","type":"bytes32"},{"internalType":"address","name":"_implementation","type":"address"}],"name":"isImplementationValidForProxy","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"isTradersPortalAndLocker","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"isTradersPortalOrTriggersAndLocker","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isTradingFloorSupported","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"isTriggersAndLocker","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"latestVersions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lexProxiesFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liquidityIntentsVerifier","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"orderBook","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"versionToPublish","type":"uint256"},{"internalType":"bytes32[]","name":"contractNameHashes","type":"bytes32[]"},{"internalType":"address[]","name":"contractImplementations","type":"address[]"}],"name":"publishNewSystemVersionBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"versionToPublish","type":"uint256"},{"internalType":"bytes32","name":"contractNameHash","type":"bytes32"},{"internalType":"address","name":"contractImplementation","type":"address"}],"name":"publishNewSystemVersionSingle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_chipsFactory","type":"address"}],"name":"setChipsFactory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_chipsIntentsVerifier","type":"address"}],"name":"setChipsIntentsVerifier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_role","type":"string"},{"internalType":"address","name":"_address","type":"address"}],"name":"setDynamicRoleAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"feesManager","type":"address"}],"name":"setFeesManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_lexProxiesFactory","type":"address"}],"name":"setLexProxiesFactory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_liquidityIntentsVerifier","type":"address"}],"name":"setLiquidityIntentsVerifier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_orderBook","type":"address"}],"name":"setOrderBook","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tradeIntentsVerifier","type":"address"}],"name":"setTradeIntentsVerifier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tradersPortal","type":"address"}],"name":"setTradersPortal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_triggers","type":"address"}],"name":"setTriggers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"chip","type":"address"},{"internalType":"address","name":"burnHandler","type":"address"}],"name":"setValidChipBurnHandler","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"chip","type":"address"},{"internalType":"string","name":"role","type":"string"},{"internalType":"address","name":"spender","type":"address"}],"name":"setValidChipSpenderTargetByRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"settlementAssetsForTradingFloor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tradingFloor","type":"address"}],"name":"supportTradingFloor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"supportedTradingFloors","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"systemLockOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tradeIntentsVerifier","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tradersPortal","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"triggers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"validBurnHandlerForChip","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"validSpenderTargetForChipByRole","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"validSystemLockOwners","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50600080546001600160a01b0319163317905561220a806100326000396000f3fe608060405234801561001057600080fd5b50600436106103275760003560e01c8063731aa5f9116101b8578063aa3e635911610104578063d466a021116100a2578063f5adc4fd1161007c578063f5adc4fd1461079e578063f83d08ba146107c1578063f851a440146107c9578063fab33704146107dc57600080fd5b8063d466a02114610755578063e1f2345114610768578063f4865dd51461077b57600080fd5b8063b49198b3116100de578063b49198b314610713578063c0e636b21461071c578063c62777c51461072f578063c73704dc1461074257600080fd5b8063aa3e6359146106b9578063ad0a930d146106ed578063adb225901461070057600080fd5b806393a5dd1b11610171578063a2b9cedd1161014b578063a2b9cedd14610657578063a5a2ed371461066a578063a8487bcf1461067d578063a8e36e5b1461069057600080fd5b806393a5dd1b146106085780639a1598c81461061b5780639c9f88651461062e57600080fd5b8063731aa5f914610596578063760ef072146105a9578063776af5ba146105bc5780637896f649146105cf5780637bbb19dc146105e257806382a8e3ed146105f557600080fd5b8063396f7b231161027757806358ca59ce11610230578063631e6d381161020a578063631e6d381461052f57806367e6508114610542578063695660aa146105705780636fad78601461058357600080fd5b806358ca59ce146104f65780635c60da1b146105095780635cecd5ff1461051c57600080fd5b8063396f7b231461048457806340da020f14610497578063419a51931461049f5780634971e256146104b25780634e24b565146104c55780635029a8e6146104cd57600080fd5b806323cb030e116102e457806333829b66116102be57806333829b66146104385780633397432b1461044b57806333e1354d1461045e578063372e24701461047157600080fd5b806323cb030e146103ff578063267822471461041257806330fbdfe11461042557600080fd5b80630764ca6a1461032c578063166b9754146103415780631a2542681461036a5780631d504dc6146103b65780631e586943146103c95780631eb40578146103ec575b600080fd5b61033f61033a366004611d49565b6107ef565b005b61035461034f366004611dd8565b6108d6565b6040516103619190611dfc565b60405180910390f35b61039e610378366004611e49565b60136020908152600092835260408084209091529082529020546001600160a01b031681565b6040516001600160a01b039091168152602001610361565b61033f6103c4366004611dd8565b61094c565b6103dc6103d7366004611e75565b610a9a565b6040519015158152602001610361565b61033f6103fa366004611dd8565b610b04565b61039e61040d366004611e49565b610b87565b60015461039e906001600160a01b031681565b61033f610433366004611dd8565b610bbf565b61033f610446366004611ea5565b610c47565b60165461039e906001600160a01b031681565b61039e61046c366004611ed3565b610c7f565b60105461039e906001600160a01b031681565b60035461039e906001600160a01b031681565b61033f610c90565b6103dc6104ad366004611dd8565b610ce9565b61039e6104c0366004611f2e565b610d30565b610354610d88565b61039e6104db366004611dd8565b6014602052600090815260409020546001600160a01b031681565b61039e610504366004611f83565b610dea565b60025461039e906001600160a01b031681565b60115461039e906001600160a01b031681565b61033f61053d366004611fc5565b610e36565b610562610550366004611ed3565b60066020526000908152604090205481565b604051908152602001610361565b60155461039e906001600160a01b031681565b61033f610591366004611dd8565b610e70565b6103dc6105a4366004611dd8565b610f14565b61033f6105b7366004611ffe565b610f44565b600d5461039e906001600160a01b031681565b61039e6105dd366004611f83565b610fb6565b600f5461039e906001600160a01b031681565b61033f610603366004612066565b610ff5565b61033f610616366004611dd8565b6113bb565b61033f610629366004611dd8565b611425565b61039e61063c366004611ed3565b600c602052600090815260409020546001600160a01b031681565b61033f610665366004611dd8565b6114a9565b6103dc610678366004611dd8565b61151c565b60045461039e906001600160a01b031681565b61039e61069e366004611dd8565b600b602052600090815260409020546001600160a01b031681565b61039e6106c73660046120b7565b60076020908152600092835260408084209091529082529020546001600160a01b031681565b61033f6106fb3660046120d9565b61154c565b61033f61070e366004611dd8565b611621565b6105626103e881565b61039e61072a366004611ed3565b6116d7565b60125461039e906001600160a01b031681565b61033f610750366004611dd8565b611701565b61033f610763366004611dd8565b611768565b61033f610776366004611ea5565b6117d2565b6103dc610789366004611dd8565b60056020526000908152604090205460ff1681565b6103dc6107ac366004611dd8565b60086020526000908152604090205460ff1681565b61033f611853565b60005461039e906001600160a01b031681565b600e5461039e906001600160a01b031681565b6000546001600160a01b031633146108225760405162461bcd60e51b815260040161081990612125565b60405180910390fd5b8281146108665760405162461bcd60e51b8152602060048201526012602482015271417272617973206d75737420626520313a3160701b6044820152606401610819565b60005b838110156108ce57600085858381811061088557610885612149565b90506020020135905060008484848181106108a2576108a2612149565b90506020020160208101906108b79190611dd8565b90506108c48883836118fe565b5050600101610869565b505050505050565b6001600160a01b0381166000908152600a602090815260409182902080548351818402810184019094528084526060939283018282801561094057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610922575b50505050509050919050565b806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381865afa15801561098a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ae919061215f565b6001600160a01b0316336001600160a01b0316146109fd5760405162461bcd60e51b815260206004820152600c60248201526b10b83937bc3c9730b236b4b760a11b6044820152606401610819565b806001600160a01b031663c1e803346040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610a3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a61919061217c565b15610a975760405162461bcd60e51b81526004016108199060208082526004908201526319985a5b60e21b604082015260600190565b50565b60006001600160a01b038216610ae15760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b6044820152606401610819565b6000610aec84611a25565b6001600160a01b039081169084161491505092915050565b6000546001600160a01b03163314610b2e5760405162461bcd60e51b815260040161081990612125565b600f54604080518082019091526008815267747269676765727360c01b6020820152610b65916001600160a01b0316908390611a54565b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b600a6020528160005260406000208181548110610ba357600080fd5b6000918252602090912001546001600160a01b03169150829050565b6000546001600160a01b03163314610be95760405162461bcd60e51b815260040161081990612125565b600e5460408051808201909152600d81526c1d1c9859195c9cd41bdc9d185b609a1b6020820152610c25916001600160a01b0316908390611a54565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610c715760405162461bcd60e51b815260040161081990612125565b610c7b8282611b30565b5050565b6000610c8a82611a25565b92915050565b6004546001600160a01b03163314610cd75760405162461bcd60e51b815260206004820152600a60248201526910a637b1b5a7bbb732b960b11b6044820152606401610819565b600480546001600160a01b0319169055565b6004546000906001600160a01b038381169116148015610c8a5750600e546001600160a01b0383811691161480610c8a575050600f546001600160a01b0390811691161490565b6000808383604051602001610d46929190612195565b60408051808303601f1901815291815281516020928301206001600160a01b039788166000908152601384528281209181529252902054909416949350505050565b60606009805480602002602001604051908101604052809291908181526020018280548015610de057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610dc2575b5050505050905090565b6000808383604051602001610e00929190612195565b60408051808303601f1901815291815281516020928301206000908152600c9092529020546001600160a01b0316949350505050565b6000546001600160a01b03163314610e605760405162461bcd60e51b815260040161081990612125565b610e6b8383836118fe565b505050565b6000546001600160a01b03163314610e9a5760405162461bcd60e51b815260040161081990612125565b601680546001600160a01b0319166001600160a01b0383161790556040516b6368697073466163746f727960a01b8152600c015b6040519081900381206001600160a01b0383168252907f943e9d45a11aaae5d87503e3bc248665d9807856e5cf2bdb4a988bee444227819060200160405180910390a250565b6004546000906001600160a01b038381169116148015610c8a575050600e546001600160a01b0390811691161490565b6000546001600160a01b03163314610f6e5760405162461bcd60e51b815260040161081990612125565b610fb08484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250869250611be3915050565b50505050565b6000808383604051602001610fcc929190612195565b604051602081830303815290604052805190602001209050610fed81611a25565b949350505050565b6000546001600160a01b0316331461101f5760405162461bcd60e51b815260040161081990612125565b6001600160a01b0383161580159061103f57506001600160a01b03821615155b801561105357506001600160a01b03811615155b6110985760405162461bcd60e51b815260206004820152601660248201527543414e4e4f545f42455f5a45524f5f4144445245535360501b6044820152606401610819565b816001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fa919061215f565b6001600160a01b0316836001600160a01b03161461115a5760405162461bcd60e51b815260206004820152601760248201527f4c45585f554e4445524c59494e475f4d49534d415443480000000000000000006044820152606401610819565b816001600160a01b0316816001600160a01b031663fb56c48f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c6919061215f565b6001600160a01b0316146112105760405162461bcd60e51b81526020600482015260116024820152700988ab0bea09e9e98be9a92a69a82a8869607b1b6044820152606401610819565b6001600160a01b0382811660008181526005602090815260408083208054600160ff199091168117909155898616808552600a84528285208054928301815585529290932090920180546001600160a01b03191688861690811790915591516351512f5360e11b81526004810192909252602482019290925291831660448301529063a2a25ea690606401600060405180830381600087803b1580156112b557600080fd5b505af11580156112c9573d6000803e3d6000fd5b505060408051808201909152600c81526b2a3930b234b733a33637b7b960a11b602082015291506112fd9050848287611be3565b60408051808201909152600781526613195e141bdbdb60ca1b6020820152611326858286611be3565b60408051808201909152601481527321b434b839a4b73a32b73a39ab32b934b334b2b960611b602082015260125461136a90879083906001600160a01b0316611be3565b6040516001600160a01b03858116825280871691888216918a16907f581507277f7df160915f5a3857d9fdc98501391a22f7ae91519dadce96ea67199060200160405180910390a450505050505050565b6000546001600160a01b031633146113e55760405162461bcd60e51b815260040161081990612125565b601080546001600160a01b0319166001600160a01b038316179055604051733a3930b232a4b73a32b73a39ab32b934b334b2b960611b8152601401610ece565b6000546001600160a01b0316331461144f5760405162461bcd60e51b815260040161081990612125565b600d546040805180820190915260098152686f72646572426f6f6b60b81b6020820152611487916001600160a01b0316908390611a54565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146114d35760405162461bcd60e51b815260040161081990612125565b601180546001600160a01b0319166001600160a01b0383161790556040517f6c6971756964697479496e74656e7473566572696669657200000000000000008152601801610ece565b6004546000906001600160a01b038381169116148015610c8a575050600f546001600160a01b0390811691161490565b6000546001600160a01b031633146115765760405162461bcd60e51b815260040161081990612125565b6000838360405160200161158b929190612195565b60408051808303601f1901815282825280516020918201206000818152600c90925291902080546001600160a01b0319166001600160a01b03861617905591506115d89085908590612195565b6040519081900381206001600160a01b0384168252907f943e9d45a11aaae5d87503e3bc248665d9807856e5cf2bdb4a988bee444227819060200160405180910390a250505050565b6000546001600160a01b0316331461164b5760405162461bcd60e51b815260040161081990612125565b6001600160a01b038116600081815260086020526040808220805460ff1916600190811790915560098054918201815583527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b03191684179055517fc3b56cad40fff5fd7c2e07c16488355f4e10397fbd438c5125a005c40f4e29f19190a250565b600981815481106116e757600080fd5b6000918252602090912001546001600160a01b0316905081565b6000546001600160a01b0316331461172b5760405162461bcd60e51b815260040161081990612125565b601580546001600160a01b0319166001600160a01b038316179055604051706c657850726f78696573466163746f727960781b8152601101610ece565b6000546001600160a01b031633146117925760405162461bcd60e51b815260040161081990612125565b601280546001600160a01b0319166001600160a01b0383161790556040517331b434b839a4b73a32b73a39ab32b934b334b2b960611b8152601401610ece565b6000546001600160a01b031633146117fc5760405162461bcd60e51b815260040161081990612125565b6001600160a01b038281166000818152600b602052604080822080546001600160a01b0319169486169485179055517f3c294129903f90afbea58693e1e9c725db2f87ba64e5bed851716d1f3dc610139190a35050565b3360009081526005602052604090205460ff166118a15760405162461bcd60e51b815260206004820152600c60248201526b10ab30b634b22637b1b5b2b960a11b6044820152606401610819565b6004546001600160a01b0316156118ea5760405162461bcd60e51b815260206004820152600d60248201526c105b1c9958591e531bd8dad959609a1b6044820152606401610819565b600480546001600160a01b03191633179055565b60008281526006602052604090205480841161195c5760405162461bcd60e51b815260206004820152601a60248201527f4d5553545f5055424c4953485f4e455745525f56455253494f4e0000000000006044820152606401610819565b6001600160a01b0382166119a85760405162461bcd60e51b8152602060048201526013602482015272494d504c454d454e544154494f4e5f5a45524f60681b6044820152606401610819565b60008381526006602090815260408083208790558683526007825280832086845282529182902080546001600160a01b0319166001600160a01b0386169081179091559151918252849186917fe6552da0d01ff56e28f4d0984a3ea0abcaec0a419b7d3057aa687ed889887b13910160405180910390a350505050565b60008181526006602090815260408083205483526007825280832093835292905220546001600160a01b031690565b6001600160a01b038216611aa35760405162461bcd60e51b815260206004820152601660248201527543414e4e4f545f42455f5a45524f5f4144445245535360501b6044820152606401610819565b6001600160a01b03808416600090815260056020526040808220805460ff19908116909155928516825290819020805490921660011790915551611ae89082906121a5565b6040519081900381206001600160a01b0384168252907f943e9d45a11aaae5d87503e3bc248665d9807856e5cf2bdb4a988bee444227819060200160405180910390a2505050565b6001600160a01b0380831660009081526014602052604090205481169082168103611b8b5760405162461bcd60e51b815260206004820152600b60248201526a1053149150511657d4d15560aa1b6044820152606401610819565b6001600160a01b0383811660008181526014602052604080822080546001600160a01b0319169487169485179055517f8772fee7946b5f02fdba3ae14b5fda258b239f97d8c7cf8a53689519fa2f5ef49190a3505050565b600082604051602001611bf691906121a5565b60408051601f1981840301815291815281516020928301206001600160a01b0380881660009081526013855283812083825290945291909220549192509081169083168103611c755760405162461bcd60e51b815260206004820152600b60248201526a1053149150511657d4d15560aa1b6044820152606401610819565b6001600160a01b0385811660009081526013602090815260408083208684529091529081902080546001600160a01b031916928616928317905551611cbb9086906121a5565b604051908190038120906001600160a01b038816907fa1d0356cb207c7aad424409734a64fbf1dc258e464dca16730dea8b3f41ce0e790600090a45050505050565b60008083601f840112611d0f57600080fd5b50813567ffffffffffffffff811115611d2757600080fd5b6020830191508360208260051b8501011115611d4257600080fd5b9250929050565b600080600080600060608688031215611d6157600080fd5b85359450602086013567ffffffffffffffff80821115611d8057600080fd5b611d8c89838a01611cfd565b90965094506040880135915080821115611da557600080fd5b50611db288828901611cfd565b969995985093965092949392505050565b6001600160a01b0381168114610a9757600080fd5b600060208284031215611dea57600080fd5b8135611df581611dc3565b9392505050565b6020808252825182820181905260009190848201906040850190845b81811015611e3d5783516001600160a01b031683529284019291840191600101611e18565b50909695505050505050565b60008060408385031215611e5c57600080fd5b8235611e6781611dc3565b946020939093013593505050565b60008060408385031215611e8857600080fd5b823591506020830135611e9a81611dc3565b809150509250929050565b60008060408385031215611eb857600080fd5b8235611ec381611dc3565b91506020830135611e9a81611dc3565b600060208284031215611ee557600080fd5b5035919050565b60008083601f840112611efe57600080fd5b50813567ffffffffffffffff811115611f1657600080fd5b602083019150836020828501011115611d4257600080fd5b600080600060408486031215611f4357600080fd5b8335611f4e81611dc3565b9250602084013567ffffffffffffffff811115611f6a57600080fd5b611f7686828701611eec565b9497909650939450505050565b60008060208385031215611f9657600080fd5b823567ffffffffffffffff811115611fad57600080fd5b611fb985828601611eec565b90969095509350505050565b600080600060608486031215611fda57600080fd5b83359250602084013591506040840135611ff381611dc3565b809150509250925092565b6000806000806060858703121561201457600080fd5b843561201f81611dc3565b9350602085013567ffffffffffffffff81111561203b57600080fd5b61204787828801611eec565b909450925050604085013561205b81611dc3565b939692955090935050565b6000806000806080858703121561207c57600080fd5b843561208781611dc3565b9350602085013561209781611dc3565b925060408501356120a781611dc3565b9150606085013561205b81611dc3565b600080604083850312156120ca57600080fd5b50508035926020909101359150565b6000806000604084860312156120ee57600080fd5b833567ffffffffffffffff81111561210557600080fd5b61211186828701611eec565b9094509250506020840135611ff381611dc3565b6020808252600a908201526927a7262cafa0a226a4a760b11b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561217157600080fd5b8151611df581611dc3565b60006020828403121561218e57600080fd5b5051919050565b8183823760009101908152919050565b6000825160005b818110156121c657602081860181015185830152016121ac565b50600092019182525091905056fea26469706673582212207f07923ba9b32a2951baf8c5c92b3f353f9f79dcae90ffb60e81654441dae5d664736f6c63430008180033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106103275760003560e01c8063731aa5f9116101b8578063aa3e635911610104578063d466a021116100a2578063f5adc4fd1161007c578063f5adc4fd1461079e578063f83d08ba146107c1578063f851a440146107c9578063fab33704146107dc57600080fd5b8063d466a02114610755578063e1f2345114610768578063f4865dd51461077b57600080fd5b8063b49198b3116100de578063b49198b314610713578063c0e636b21461071c578063c62777c51461072f578063c73704dc1461074257600080fd5b8063aa3e6359146106b9578063ad0a930d146106ed578063adb225901461070057600080fd5b806393a5dd1b11610171578063a2b9cedd1161014b578063a2b9cedd14610657578063a5a2ed371461066a578063a8487bcf1461067d578063a8e36e5b1461069057600080fd5b806393a5dd1b146106085780639a1598c81461061b5780639c9f88651461062e57600080fd5b8063731aa5f914610596578063760ef072146105a9578063776af5ba146105bc5780637896f649146105cf5780637bbb19dc146105e257806382a8e3ed146105f557600080fd5b8063396f7b231161027757806358ca59ce11610230578063631e6d381161020a578063631e6d381461052f57806367e6508114610542578063695660aa146105705780636fad78601461058357600080fd5b806358ca59ce146104f65780635c60da1b146105095780635cecd5ff1461051c57600080fd5b8063396f7b231461048457806340da020f14610497578063419a51931461049f5780634971e256146104b25780634e24b565146104c55780635029a8e6146104cd57600080fd5b806323cb030e116102e457806333829b66116102be57806333829b66146104385780633397432b1461044b57806333e1354d1461045e578063372e24701461047157600080fd5b806323cb030e146103ff578063267822471461041257806330fbdfe11461042557600080fd5b80630764ca6a1461032c578063166b9754146103415780631a2542681461036a5780631d504dc6146103b65780631e586943146103c95780631eb40578146103ec575b600080fd5b61033f61033a366004611d49565b6107ef565b005b61035461034f366004611dd8565b6108d6565b6040516103619190611dfc565b60405180910390f35b61039e610378366004611e49565b60136020908152600092835260408084209091529082529020546001600160a01b031681565b6040516001600160a01b039091168152602001610361565b61033f6103c4366004611dd8565b61094c565b6103dc6103d7366004611e75565b610a9a565b6040519015158152602001610361565b61033f6103fa366004611dd8565b610b04565b61039e61040d366004611e49565b610b87565b60015461039e906001600160a01b031681565b61033f610433366004611dd8565b610bbf565b61033f610446366004611ea5565b610c47565b60165461039e906001600160a01b031681565b61039e61046c366004611ed3565b610c7f565b60105461039e906001600160a01b031681565b60035461039e906001600160a01b031681565b61033f610c90565b6103dc6104ad366004611dd8565b610ce9565b61039e6104c0366004611f2e565b610d30565b610354610d88565b61039e6104db366004611dd8565b6014602052600090815260409020546001600160a01b031681565b61039e610504366004611f83565b610dea565b60025461039e906001600160a01b031681565b60115461039e906001600160a01b031681565b61033f61053d366004611fc5565b610e36565b610562610550366004611ed3565b60066020526000908152604090205481565b604051908152602001610361565b60155461039e906001600160a01b031681565b61033f610591366004611dd8565b610e70565b6103dc6105a4366004611dd8565b610f14565b61033f6105b7366004611ffe565b610f44565b600d5461039e906001600160a01b031681565b61039e6105dd366004611f83565b610fb6565b600f5461039e906001600160a01b031681565b61033f610603366004612066565b610ff5565b61033f610616366004611dd8565b6113bb565b61033f610629366004611dd8565b611425565b61039e61063c366004611ed3565b600c602052600090815260409020546001600160a01b031681565b61033f610665366004611dd8565b6114a9565b6103dc610678366004611dd8565b61151c565b60045461039e906001600160a01b031681565b61039e61069e366004611dd8565b600b602052600090815260409020546001600160a01b031681565b61039e6106c73660046120b7565b60076020908152600092835260408084209091529082529020546001600160a01b031681565b61033f6106fb3660046120d9565b61154c565b61033f61070e366004611dd8565b611621565b6105626103e881565b61039e61072a366004611ed3565b6116d7565b60125461039e906001600160a01b031681565b61033f610750366004611dd8565b611701565b61033f610763366004611dd8565b611768565b61033f610776366004611ea5565b6117d2565b6103dc610789366004611dd8565b60056020526000908152604090205460ff1681565b6103dc6107ac366004611dd8565b60086020526000908152604090205460ff1681565b61033f611853565b60005461039e906001600160a01b031681565b600e5461039e906001600160a01b031681565b6000546001600160a01b031633146108225760405162461bcd60e51b815260040161081990612125565b60405180910390fd5b8281146108665760405162461bcd60e51b8152602060048201526012602482015271417272617973206d75737420626520313a3160701b6044820152606401610819565b60005b838110156108ce57600085858381811061088557610885612149565b90506020020135905060008484848181106108a2576108a2612149565b90506020020160208101906108b79190611dd8565b90506108c48883836118fe565b5050600101610869565b505050505050565b6001600160a01b0381166000908152600a602090815260409182902080548351818402810184019094528084526060939283018282801561094057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610922575b50505050509050919050565b806001600160a01b031663f851a4406040518163ffffffff1660e01b8152600401602060405180830381865afa15801561098a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ae919061215f565b6001600160a01b0316336001600160a01b0316146109fd5760405162461bcd60e51b815260206004820152600c60248201526b10b83937bc3c9730b236b4b760a11b6044820152606401610819565b806001600160a01b031663c1e803346040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610a3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a61919061217c565b15610a975760405162461bcd60e51b81526004016108199060208082526004908201526319985a5b60e21b604082015260600190565b50565b60006001600160a01b038216610ae15760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b6044820152606401610819565b6000610aec84611a25565b6001600160a01b039081169084161491505092915050565b6000546001600160a01b03163314610b2e5760405162461bcd60e51b815260040161081990612125565b600f54604080518082019091526008815267747269676765727360c01b6020820152610b65916001600160a01b0316908390611a54565b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b600a6020528160005260406000208181548110610ba357600080fd5b6000918252602090912001546001600160a01b03169150829050565b6000546001600160a01b03163314610be95760405162461bcd60e51b815260040161081990612125565b600e5460408051808201909152600d81526c1d1c9859195c9cd41bdc9d185b609a1b6020820152610c25916001600160a01b0316908390611a54565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610c715760405162461bcd60e51b815260040161081990612125565b610c7b8282611b30565b5050565b6000610c8a82611a25565b92915050565b6004546001600160a01b03163314610cd75760405162461bcd60e51b815260206004820152600a60248201526910a637b1b5a7bbb732b960b11b6044820152606401610819565b600480546001600160a01b0319169055565b6004546000906001600160a01b038381169116148015610c8a5750600e546001600160a01b0383811691161480610c8a575050600f546001600160a01b0390811691161490565b6000808383604051602001610d46929190612195565b60408051808303601f1901815291815281516020928301206001600160a01b039788166000908152601384528281209181529252902054909416949350505050565b60606009805480602002602001604051908101604052809291908181526020018280548015610de057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610dc2575b5050505050905090565b6000808383604051602001610e00929190612195565b60408051808303601f1901815291815281516020928301206000908152600c9092529020546001600160a01b0316949350505050565b6000546001600160a01b03163314610e605760405162461bcd60e51b815260040161081990612125565b610e6b8383836118fe565b505050565b6000546001600160a01b03163314610e9a5760405162461bcd60e51b815260040161081990612125565b601680546001600160a01b0319166001600160a01b0383161790556040516b6368697073466163746f727960a01b8152600c015b6040519081900381206001600160a01b0383168252907f943e9d45a11aaae5d87503e3bc248665d9807856e5cf2bdb4a988bee444227819060200160405180910390a250565b6004546000906001600160a01b038381169116148015610c8a575050600e546001600160a01b0390811691161490565b6000546001600160a01b03163314610f6e5760405162461bcd60e51b815260040161081990612125565b610fb08484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250869250611be3915050565b50505050565b6000808383604051602001610fcc929190612195565b604051602081830303815290604052805190602001209050610fed81611a25565b949350505050565b6000546001600160a01b0316331461101f5760405162461bcd60e51b815260040161081990612125565b6001600160a01b0383161580159061103f57506001600160a01b03821615155b801561105357506001600160a01b03811615155b6110985760405162461bcd60e51b815260206004820152601660248201527543414e4e4f545f42455f5a45524f5f4144445245535360501b6044820152606401610819565b816001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fa919061215f565b6001600160a01b0316836001600160a01b03161461115a5760405162461bcd60e51b815260206004820152601760248201527f4c45585f554e4445524c59494e475f4d49534d415443480000000000000000006044820152606401610819565b816001600160a01b0316816001600160a01b031663fb56c48f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c6919061215f565b6001600160a01b0316146112105760405162461bcd60e51b81526020600482015260116024820152700988ab0bea09e9e98be9a92a69a82a8869607b1b6044820152606401610819565b6001600160a01b0382811660008181526005602090815260408083208054600160ff199091168117909155898616808552600a84528285208054928301815585529290932090920180546001600160a01b03191688861690811790915591516351512f5360e11b81526004810192909252602482019290925291831660448301529063a2a25ea690606401600060405180830381600087803b1580156112b557600080fd5b505af11580156112c9573d6000803e3d6000fd5b505060408051808201909152600c81526b2a3930b234b733a33637b7b960a11b602082015291506112fd9050848287611be3565b60408051808201909152600781526613195e141bdbdb60ca1b6020820152611326858286611be3565b60408051808201909152601481527321b434b839a4b73a32b73a39ab32b934b334b2b960611b602082015260125461136a90879083906001600160a01b0316611be3565b6040516001600160a01b03858116825280871691888216918a16907f581507277f7df160915f5a3857d9fdc98501391a22f7ae91519dadce96ea67199060200160405180910390a450505050505050565b6000546001600160a01b031633146113e55760405162461bcd60e51b815260040161081990612125565b601080546001600160a01b0319166001600160a01b038316179055604051733a3930b232a4b73a32b73a39ab32b934b334b2b960611b8152601401610ece565b6000546001600160a01b0316331461144f5760405162461bcd60e51b815260040161081990612125565b600d546040805180820190915260098152686f72646572426f6f6b60b81b6020820152611487916001600160a01b0316908390611a54565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146114d35760405162461bcd60e51b815260040161081990612125565b601180546001600160a01b0319166001600160a01b0383161790556040517f6c6971756964697479496e74656e7473566572696669657200000000000000008152601801610ece565b6004546000906001600160a01b038381169116148015610c8a575050600f546001600160a01b0390811691161490565b6000546001600160a01b031633146115765760405162461bcd60e51b815260040161081990612125565b6000838360405160200161158b929190612195565b60408051808303601f1901815282825280516020918201206000818152600c90925291902080546001600160a01b0319166001600160a01b03861617905591506115d89085908590612195565b6040519081900381206001600160a01b0384168252907f943e9d45a11aaae5d87503e3bc248665d9807856e5cf2bdb4a988bee444227819060200160405180910390a250505050565b6000546001600160a01b0316331461164b5760405162461bcd60e51b815260040161081990612125565b6001600160a01b038116600081815260086020526040808220805460ff1916600190811790915560098054918201815583527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b03191684179055517fc3b56cad40fff5fd7c2e07c16488355f4e10397fbd438c5125a005c40f4e29f19190a250565b600981815481106116e757600080fd5b6000918252602090912001546001600160a01b0316905081565b6000546001600160a01b0316331461172b5760405162461bcd60e51b815260040161081990612125565b601580546001600160a01b0319166001600160a01b038316179055604051706c657850726f78696573466163746f727960781b8152601101610ece565b6000546001600160a01b031633146117925760405162461bcd60e51b815260040161081990612125565b601280546001600160a01b0319166001600160a01b0383161790556040517331b434b839a4b73a32b73a39ab32b934b334b2b960611b8152601401610ece565b6000546001600160a01b031633146117fc5760405162461bcd60e51b815260040161081990612125565b6001600160a01b038281166000818152600b602052604080822080546001600160a01b0319169486169485179055517f3c294129903f90afbea58693e1e9c725db2f87ba64e5bed851716d1f3dc610139190a35050565b3360009081526005602052604090205460ff166118a15760405162461bcd60e51b815260206004820152600c60248201526b10ab30b634b22637b1b5b2b960a11b6044820152606401610819565b6004546001600160a01b0316156118ea5760405162461bcd60e51b815260206004820152600d60248201526c105b1c9958591e531bd8dad959609a1b6044820152606401610819565b600480546001600160a01b03191633179055565b60008281526006602052604090205480841161195c5760405162461bcd60e51b815260206004820152601a60248201527f4d5553545f5055424c4953485f4e455745525f56455253494f4e0000000000006044820152606401610819565b6001600160a01b0382166119a85760405162461bcd60e51b8152602060048201526013602482015272494d504c454d454e544154494f4e5f5a45524f60681b6044820152606401610819565b60008381526006602090815260408083208790558683526007825280832086845282529182902080546001600160a01b0319166001600160a01b0386169081179091559151918252849186917fe6552da0d01ff56e28f4d0984a3ea0abcaec0a419b7d3057aa687ed889887b13910160405180910390a350505050565b60008181526006602090815260408083205483526007825280832093835292905220546001600160a01b031690565b6001600160a01b038216611aa35760405162461bcd60e51b815260206004820152601660248201527543414e4e4f545f42455f5a45524f5f4144445245535360501b6044820152606401610819565b6001600160a01b03808416600090815260056020526040808220805460ff19908116909155928516825290819020805490921660011790915551611ae89082906121a5565b6040519081900381206001600160a01b0384168252907f943e9d45a11aaae5d87503e3bc248665d9807856e5cf2bdb4a988bee444227819060200160405180910390a2505050565b6001600160a01b0380831660009081526014602052604090205481169082168103611b8b5760405162461bcd60e51b815260206004820152600b60248201526a1053149150511657d4d15560aa1b6044820152606401610819565b6001600160a01b0383811660008181526014602052604080822080546001600160a01b0319169487169485179055517f8772fee7946b5f02fdba3ae14b5fda258b239f97d8c7cf8a53689519fa2f5ef49190a3505050565b600082604051602001611bf691906121a5565b60408051601f1981840301815291815281516020928301206001600160a01b0380881660009081526013855283812083825290945291909220549192509081169083168103611c755760405162461bcd60e51b815260206004820152600b60248201526a1053149150511657d4d15560aa1b6044820152606401610819565b6001600160a01b0385811660009081526013602090815260408083208684529091529081902080546001600160a01b031916928616928317905551611cbb9086906121a5565b604051908190038120906001600160a01b038816907fa1d0356cb207c7aad424409734a64fbf1dc258e464dca16730dea8b3f41ce0e790600090a45050505050565b60008083601f840112611d0f57600080fd5b50813567ffffffffffffffff811115611d2757600080fd5b6020830191508360208260051b8501011115611d4257600080fd5b9250929050565b600080600080600060608688031215611d6157600080fd5b85359450602086013567ffffffffffffffff80821115611d8057600080fd5b611d8c89838a01611cfd565b90965094506040880135915080821115611da557600080fd5b50611db288828901611cfd565b969995985093965092949392505050565b6001600160a01b0381168114610a9757600080fd5b600060208284031215611dea57600080fd5b8135611df581611dc3565b9392505050565b6020808252825182820181905260009190848201906040850190845b81811015611e3d5783516001600160a01b031683529284019291840191600101611e18565b50909695505050505050565b60008060408385031215611e5c57600080fd5b8235611e6781611dc3565b946020939093013593505050565b60008060408385031215611e8857600080fd5b823591506020830135611e9a81611dc3565b809150509250929050565b60008060408385031215611eb857600080fd5b8235611ec381611dc3565b91506020830135611e9a81611dc3565b600060208284031215611ee557600080fd5b5035919050565b60008083601f840112611efe57600080fd5b50813567ffffffffffffffff811115611f1657600080fd5b602083019150836020828501011115611d4257600080fd5b600080600060408486031215611f4357600080fd5b8335611f4e81611dc3565b9250602084013567ffffffffffffffff811115611f6a57600080fd5b611f7686828701611eec565b9497909650939450505050565b60008060208385031215611f9657600080fd5b823567ffffffffffffffff811115611fad57600080fd5b611fb985828601611eec565b90969095509350505050565b600080600060608486031215611fda57600080fd5b83359250602084013591506040840135611ff381611dc3565b809150509250925092565b6000806000806060858703121561201457600080fd5b843561201f81611dc3565b9350602085013567ffffffffffffffff81111561203b57600080fd5b61204787828801611eec565b909450925050604085013561205b81611dc3565b939692955090935050565b6000806000806080858703121561207c57600080fd5b843561208781611dc3565b9350602085013561209781611dc3565b925060408501356120a781611dc3565b9150606085013561205b81611dc3565b600080604083850312156120ca57600080fd5b50508035926020909101359150565b6000806000604084860312156120ee57600080fd5b833567ffffffffffffffff81111561210557600080fd5b61211186828701611eec565b9094509250506020840135611ff381611dc3565b6020808252600a908201526927a7262cafa0a226a4a760b11b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561217157600080fd5b8151611df581611dc3565b60006020828403121561218e57600080fd5b5051919050565b8183823760009101908152919050565b6000825160005b818110156121c657602081860181015185830152016121ac565b50600092019182525091905056fea26469706673582212207f07923ba9b32a2951baf8c5c92b3f353f9f79dcae90ffb60e81654441dae5d664736f6c63430008180033

Block Transaction Gas Used Reward
view all blocks produced

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

Validator Index Block Amount
View All Withdrawals

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

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