// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {EnumerableMap} from "@openzeppelin/contracts/utils/structs/EnumerableMap.sol";
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {Ownable2Step, Ownable} from "@openzeppelin/contracts/access/Ownable2Step.sol";
import {PairParameterHelper} from "./libraries/PairParameterHelper.sol";
import {Encoded} from "./libraries/math/Encoded.sol";
import {ImmutableClone} from "./libraries/ImmutableClone.sol";
import {PriceHelper} from "./libraries/PriceHelper.sol";
import {SafeCast} from "./libraries/math/SafeCast.sol";
import {Hooks} from "./libraries/Hooks.sol";
import {ILBFactory} from "./interfaces/ILBFactory.sol";
import {ILBPair} from "./interfaces/ILBPair.sol";
import {ILBHooks} from "./interfaces/ILBHooks.sol";
/**
* @title Liquidity Book Factory
* @author Trader Joe
* @notice Contract used to deploy and register new LBPairs.
* Enables setting fee parameters, flashloan fees and LBPair implementation.
* Unless the `isOpen` is `true`, only the owner of the factory can create pairs.
*/
contract LBFactory is Ownable2Step, AccessControl, ILBFactory {
using SafeCast for uint256;
using Encoded for bytes32;
using PairParameterHelper for bytes32;
using EnumerableSet for EnumerableSet.AddressSet;
using EnumerableSet for EnumerableSet.UintSet;
using EnumerableMap for EnumerableMap.UintToUintMap;
bytes32 public constant LB_HOOKS_MANAGER_ROLE = keccak256("LB_HOOKS_MANAGER_ROLE");
uint256 private constant _OFFSET_IS_PRESET_OPEN = 255;
uint256 private constant _MIN_BIN_STEP = 1; // 0.001%
uint256 private constant _MAX_FLASHLOAN_FEE = 0.1e18; // 10%
address private _feeRecipient;
uint256 private _flashLoanFee;
address private _lbPairImplementation;
ILBPair[] private _allLBPairs;
/**
* @dev Mapping from a (tokenA, tokenB, binStep) to a LBPair. The tokens are ordered to save gas, but they can be
* in the reverse order in the actual pair.
* Always query one of the 2 tokens of the pair to assert the order of the 2 tokens
*/
mapping(IERC20 => mapping(IERC20 => mapping(uint256 => LBPairInformation))) private _lbPairsInfo;
EnumerableMap.UintToUintMap private _presets;
EnumerableSet.AddressSet private _quoteAssetWhitelist;
/**
* @dev Mapping from a (tokenA, tokenB) to a set of available bin steps, this is used to keep track of the
* bin steps that are already used for a pair.
* The tokens are ordered to save gas, but they can be in the reverse order in the actual pair.
* Always query one of the 2 tokens of the pair to assert the order of the 2 tokens
*/
mapping(IERC20 => mapping(IERC20 => EnumerableSet.UintSet)) private _availableLBPairBinSteps;
/**
* @notice Constructor
* @param feeRecipient The address of the fee recipient
* @param flashLoanFee The value of the fee for flash loan
*/
constructor(address feeRecipient, address initialOwner, uint256 flashLoanFee) Ownable(initialOwner) {
if (flashLoanFee > _MAX_FLASHLOAN_FEE) revert LBFactory__FlashLoanFeeAboveMax(flashLoanFee, _MAX_FLASHLOAN_FEE);
_setFeeRecipient(feeRecipient);
_flashLoanFee = flashLoanFee;
emit FlashLoanFeeSet(0, flashLoanFee);
}
/**
* @notice Get the minimum bin step a pair can have
* @return minBinStep
*/
function getMinBinStep() external pure override returns (uint256 minBinStep) {
return _MIN_BIN_STEP;
}
/**
* @notice Get the protocol fee recipient
* @return feeRecipient
*/
function getFeeRecipient() external view override returns (address feeRecipient) {
return _feeRecipient;
}
/**
* @notice Get the maximum fee percentage for flashLoans
* @return maxFee
*/
function getMaxFlashLoanFee() external pure override returns (uint256 maxFee) {
return _MAX_FLASHLOAN_FEE;
}
/**
* @notice Get the fee for flash loans, in 1e18
* @return flashLoanFee The fee for flash loans, in 1e18
*/
function getFlashLoanFee() external view override returns (uint256 flashLoanFee) {
return _flashLoanFee;
}
/**
* @notice Get the address of the LBPair implementation
* @return lbPairImplementation The address of the LBPair implementation
*/
function getLBPairImplementation() external view override returns (address lbPairImplementation) {
return _lbPairImplementation;
}
/**
* @notice View function to return the number of LBPairs created
* @return lbPairNumber
*/
function getNumberOfLBPairs() external view override returns (uint256 lbPairNumber) {
return _allLBPairs.length;
}
/**
* @notice View function to return the LBPair created at index `index`
* @param index The index
* @return lbPair The address of the LBPair at index `index`
*/
function getLBPairAtIndex(uint256 index) external view override returns (ILBPair lbPair) {
return _allLBPairs[index];
}
/**
* @notice View function to return the number of quote assets whitelisted
* @return numberOfQuoteAssets The number of quote assets
*/
function getNumberOfQuoteAssets() external view override returns (uint256 numberOfQuoteAssets) {
return _quoteAssetWhitelist.length();
}
/**
* @notice View function to return the quote asset whitelisted at index `index`
* @param index The index
* @return asset The address of the quoteAsset at index `index`
*/
function getQuoteAssetAtIndex(uint256 index) external view override returns (IERC20 asset) {
return IERC20(_quoteAssetWhitelist.at(index));
}
/**
* @notice View function to return whether a token is a quotedAsset (true) or not (false)
* @param token The address of the asset
* @return isQuote Whether the token is a quote asset or not
*/
function isQuoteAsset(IERC20 token) external view override returns (bool isQuote) {
return _quoteAssetWhitelist.contains(address(token));
}
/**
* @notice Returns the LBPairInformation if it exists,
* if not, then the address 0 is returned. The order doesn't matter
* @param tokenA The address of the first token of the pair
* @param tokenB The address of the second token of the pair
* @param binStep The bin step of the LBPair
* @return lbPairInformation The LBPairInformation
*/
function getLBPairInformation(IERC20 tokenA, IERC20 tokenB, uint256 binStep)
external
view
override
returns (LBPairInformation memory lbPairInformation)
{
return _getLBPairInformation(tokenA, tokenB, binStep);
}
/**
* @notice View function to return the different parameters of the preset
* Will revert if the preset doesn't exist
* @param binStep The bin step of the preset
* @return baseFactor The base factor
* @return filterPeriod The filter period of the preset
* @return decayPeriod The decay period of the preset
* @return reductionFactor The reduction factor of the preset
* @return variableFeeControl The variable fee control of the preset
* @return protocolShare The protocol share of the preset
* @return maxVolatilityAccumulator The max volatility accumulator of the preset
* @return isOpen Whether the preset is open or not
*/
function getPreset(uint256 binStep)
external
view
override
returns (
uint256 baseFactor,
uint256 filterPeriod,
uint256 decayPeriod,
uint256 reductionFactor,
uint256 variableFeeControl,
uint256 protocolShare,
uint256 maxVolatilityAccumulator,
bool isOpen
)
{
if (!_presets.contains(binStep)) revert LBFactory__BinStepHasNoPreset(binStep);
bytes32 preset = bytes32(_presets.get(binStep));
baseFactor = preset.getBaseFactor();
filterPeriod = preset.getFilterPeriod();
decayPeriod = preset.getDecayPeriod();
reductionFactor = preset.getReductionFactor();
variableFeeControl = preset.getVariableFeeControl();
protocolShare = preset.getProtocolShare();
maxVolatilityAccumulator = preset.getMaxVolatilityAccumulator();
isOpen = preset.decodeBool(_OFFSET_IS_PRESET_OPEN);
}
/**
* @notice View function to return the list of available binStep with a preset
* @return binStepWithPreset The list of binStep
*/
function getAllBinSteps() external view override returns (uint256[] memory binStepWithPreset) {
return _presets.keys();
}
/**
* @notice View function to return the list of open binSteps
* @return openBinStep The list of open binSteps
*/
function getOpenBinSteps() external view override returns (uint256[] memory openBinStep) {
uint256 length = _presets.length();
if (length > 0) {
openBinStep = new uint256[](length);
uint256 index;
for (uint256 i; i < length; ++i) {
(uint256 binStep, uint256 preset) = _presets.at(i);
if (_isPresetOpen(bytes32(preset))) {
openBinStep[index] = binStep;
index++;
}
}
if (index < length) {
assembly {
mstore(openBinStep, index)
}
}
}
}
/**
* @notice View function to return all the LBPair of a pair of tokens
* @param tokenX The first token of the pair
* @param tokenY The second token of the pair
* @return lbPairsAvailable The list of available LBPairs
*/
function getAllLBPairs(IERC20 tokenX, IERC20 tokenY)
external
view
override
returns (LBPairInformation[] memory lbPairsAvailable)
{
unchecked {
(IERC20 tokenA, IERC20 tokenB) = _sortTokens(tokenX, tokenY);
EnumerableSet.UintSet storage addressSet = _availableLBPairBinSteps[tokenA][tokenB];
uint256 length = addressSet.length();
if (length > 0) {
lbPairsAvailable = new LBPairInformation[](length);
mapping(uint256 => LBPairInformation) storage lbPairsInfo = _lbPairsInfo[tokenA][tokenB];
for (uint256 i = 0; i < length; ++i) {
uint16 binStep = addressSet.at(i).safe16();
lbPairsAvailable[i] = LBPairInformation({
binStep: binStep,
LBPair: lbPairsInfo[binStep].LBPair,
createdByOwner: lbPairsInfo[binStep].createdByOwner,
ignoredForRouting: lbPairsInfo[binStep].ignoredForRouting
});
}
}
}
}
/**
* @notice Set the LBPair implementation address
* @dev Needs to be called by the owner
* @param newLBPairImplementation The address of the implementation
*/
function setLBPairImplementation(address newLBPairImplementation) external override onlyOwner {
if (ILBPair(newLBPairImplementation).getFactory() != this) {
revert LBFactory__LBPairSafetyCheckFailed(newLBPairImplementation);
}
address oldLBPairImplementation = _lbPairImplementation;
if (oldLBPairImplementation == newLBPairImplementation) {
revert LBFactory__SameImplementation(newLBPairImplementation);
}
_lbPairImplementation = newLBPairImplementation;
emit LBPairImplementationSet(oldLBPairImplementation, newLBPairImplementation);
}
/**
* @notice Create a liquidity bin LBPair for tokenX and tokenY
* @param tokenX The address of the first token
* @param tokenY The address of the second token
* @param activeId The active id of the pair
* @param binStep The bin step in basis point, used to calculate log(1 + binStep / 10_000)
* @return pair The address of the newly created LBPair
*/
function createLBPair(IERC20 tokenX, IERC20 tokenY, uint24 activeId, uint16 binStep)
external
override
returns (ILBPair pair)
{
if (!_presets.contains(binStep)) revert LBFactory__BinStepHasNoPreset(binStep);
bytes32 preset = bytes32(_presets.get(binStep));
bool isOwner = msg.sender == owner();
if (!_isPresetOpen(preset) && !isOwner) {
revert LBFactory__PresetIsLockedForUsers(msg.sender, binStep);
}
if (!_quoteAssetWhitelist.contains(address(tokenY))) revert LBFactory__QuoteAssetNotWhitelisted(tokenY);
if (tokenX == tokenY) revert LBFactory__IdenticalAddresses(tokenX);
// safety check, making sure that the price can be calculated
PriceHelper.getPriceFromId(activeId, binStep);
// We sort token for storage efficiency, only one input needs to be stored because they are sorted
(IERC20 tokenA, IERC20 tokenB) = _sortTokens(tokenX, tokenY);
// single check is sufficient
if (address(tokenA) == address(0)) revert LBFactory__AddressZero();
if (address(_lbPairsInfo[tokenA][tokenB][binStep].LBPair) != address(0)) {
revert LBFactory__LBPairAlreadyExists(tokenX, tokenY, binStep);
}
{
address implementation = _lbPairImplementation;
if (implementation == address(0)) revert LBFactory__ImplementationNotSet();
pair = ILBPair(
ImmutableClone.cloneDeterministic(
implementation,
abi.encodePacked(tokenX, tokenY, binStep),
keccak256(abi.encode(tokenA, tokenB, binStep))
)
);
}
_lbPairsInfo[tokenA][tokenB][binStep] =
LBPairInformation({binStep: binStep, LBPair: pair, createdByOwner: isOwner, ignoredForRouting: false});
_allLBPairs.push(pair);
_availableLBPairBinSteps[tokenA][tokenB].add(binStep);
emit LBPairCreated(tokenX, tokenY, binStep, pair, _allLBPairs.length - 1);
pair.initialize(
preset.getBaseFactor(),
preset.getFilterPeriod(),
preset.getDecayPeriod(),
preset.getReductionFactor(),
preset.getVariableFeeControl(),
preset.getProtocolShare(),
preset.getMaxVolatilityAccumulator(),
activeId
);
}
/**
* @notice Function to set whether the pair is ignored or not for routing, it will make the pair unusable by the router
* @dev Needs to be called by the owner
* Reverts if:
* - The pair doesn't exist
* - The ignored state is already in the same state
* @param tokenX The address of the first token of the pair
* @param tokenY The address of the second token of the pair
* @param binStep The bin step in basis point of the pair
* @param ignored Whether to ignore (true) or not (false) the pair for routing
*/
function setLBPairIgnored(IERC20 tokenX, IERC20 tokenY, uint16 binStep, bool ignored) external override onlyOwner {
(IERC20 tokenA, IERC20 tokenB) = _sortTokens(tokenX, tokenY);
LBPairInformation memory pairInformation = _lbPairsInfo[tokenA][tokenB][binStep];
if (address(pairInformation.LBPair) == address(0)) {
revert LBFactory__LBPairDoesNotExist(tokenX, tokenY, binStep);
}
if (pairInformation.ignoredForRouting == ignored) revert LBFactory__LBPairIgnoredIsAlreadyInTheSameState();
_lbPairsInfo[tokenA][tokenB][binStep].ignoredForRouting = ignored;
emit LBPairIgnoredStateChanged(pairInformation.LBPair, ignored);
}
/**
* @notice Sets the preset parameters of a bin step
* @dev Needs to be called by the owner
* Reverts if:
* - The binStep is lower than the minimum bin step
* @param binStep The bin step in basis point, used to calculate the price
* @param baseFactor The base factor, used to calculate the base fee, baseFee = baseFactor * binStep
* @param filterPeriod The period where the accumulator value is untouched, prevent spam
* @param decayPeriod The period where the accumulator value is decayed, by the reduction factor
* @param reductionFactor The reduction factor, used to calculate the reduction of the accumulator
* @param variableFeeControl The variable fee control, used to control the variable fee, can be 0 to disable it
* @param protocolShare The share of the fees received by the protocol
* @param maxVolatilityAccumulator The max value of the volatility accumulator
*/
function setPreset(
uint16 binStep,
uint16 baseFactor,
uint16 filterPeriod,
uint16 decayPeriod,
uint16 reductionFactor,
uint24 variableFeeControl,
uint16 protocolShare,
uint24 maxVolatilityAccumulator,
bool isOpen
) external override onlyOwner {
if (binStep < _MIN_BIN_STEP) revert LBFactory__BinStepTooLow(binStep);
bytes32 preset = bytes32(0).setStaticFeeParameters(
baseFactor,
filterPeriod,
decayPeriod,
reductionFactor,
variableFeeControl,
protocolShare,
maxVolatilityAccumulator
);
if (isOpen) {
preset = preset.setBool(true, _OFFSET_IS_PRESET_OPEN);
}
_presets.set(binStep, uint256(preset));
emit PresetSet(
binStep,
baseFactor,
filterPeriod,
decayPeriod,
reductionFactor,
variableFeeControl,
protocolShare,
maxVolatilityAccumulator
);
emit PresetOpenStateChanged(binStep, isOpen);
}
/**
* @notice Sets if the preset is open or not to be used by users
* @dev Needs to be called by the owner
* Reverts if:
* - The binStep doesn't have a preset
* - The preset is already in the same state
* @param binStep The bin step in basis point, used to calculate the price
* @param isOpen Whether the preset is open or not
*/
function setPresetOpenState(uint16 binStep, bool isOpen) external override onlyOwner {
if (!_presets.contains(binStep)) revert LBFactory__BinStepHasNoPreset(binStep);
bytes32 preset = bytes32(_presets.get(binStep));
if (preset.decodeBool(_OFFSET_IS_PRESET_OPEN) == isOpen) {
revert LBFactory__PresetOpenStateIsAlreadyInTheSameState();
}
_presets.set(binStep, uint256(preset.setBool(isOpen, _OFFSET_IS_PRESET_OPEN)));
emit PresetOpenStateChanged(binStep, isOpen);
}
/**
* @notice Remove the preset linked to a binStep
* @dev Needs to be called by the owner
* Reverts if:
* - The binStep doesn't have a preset
* @param binStep The bin step to remove
*/
function removePreset(uint16 binStep) external override onlyOwner {
if (!_presets.remove(binStep)) revert LBFactory__BinStepHasNoPreset(binStep);
emit PresetRemoved(binStep);
}
/**
* @notice Function to set the fee parameter of a LBPair
* @dev Needs to be called by the owner
* Reverts if:
* - The pair doesn't exist
* @param tokenX The address of the first token
* @param tokenY The address of the second token
* @param binStep The bin step in basis point, used to calculate the price
* @param baseFactor The base factor, used to calculate the base fee, baseFee = baseFactor * binStep
* @param filterPeriod The period where the accumulator value is untouched, prevent spam
* @param decayPeriod The period where the accumulator value is decayed, by the reduction factor
* @param reductionFactor The reduction factor, used to calculate the reduction of the accumulator
* @param variableFeeControl The variable fee control, used to control the variable fee, can be 0 to disable it
* @param protocolShare The share of the fees received by the protocol
* @param maxVolatilityAccumulator The max value of volatility accumulator
*/
function setFeesParametersOnPair(
IERC20 tokenX,
IERC20 tokenY,
uint16 binStep,
uint16 baseFactor,
uint16 filterPeriod,
uint16 decayPeriod,
uint16 reductionFactor,
uint24 variableFeeControl,
uint16 protocolShare,
uint24 maxVolatilityAccumulator
) external override onlyOwner {
ILBPair lbPair = _getLBPairInformation(tokenX, tokenY, binStep).LBPair;
if (address(lbPair) == address(0)) revert LBFactory__LBPairNotCreated(tokenX, tokenY, binStep);
lbPair.setStaticFeeParameters(
baseFactor,
filterPeriod,
decayPeriod,
reductionFactor,
variableFeeControl,
protocolShare,
maxVolatilityAccumulator
);
}
/**
* @notice Function to set the hooks parameters of a pair
* @dev Needs to be called by an address with the LB_HOOKS_MANAGER_ROLE
* Reverts if:
* - The pair doesn't exist
* - The hooks is `address(0)` or the hooks flags are all false
* @param tokenX The address of the first token
* @param tokenY The address of the second token
* @param binStep The bin step in basis point, used to calculate the price
* @param hooksParameters The hooks parameters
* @param onHooksSetData The data to pass to the onHooksSet function
*/
function setLBHooksParametersOnPair(
IERC20 tokenX,
IERC20 tokenY,
uint16 binStep,
bytes32 hooksParameters,
bytes calldata onHooksSetData
) external override onlyRole(LB_HOOKS_MANAGER_ROLE) {
if (Hooks.getHooks(hooksParameters) == address(0) || Hooks.getFlags(hooksParameters) == 0) {
revert LBFactory__InvalidHooksParameters();
}
_setLBHooksParametersOnPair(tokenX, tokenY, binStep, hooksParameters, onHooksSetData);
}
/**
* @notice Function to remove the hooks contract from the pair
* @dev Needs to be called by an address with the LB_HOOKS_MANAGER_ROLE
* Reverts if:
* - The pair doesn't exist
* @param tokenX The address of the first token
* @param tokenY The address of the second token
* @param binStep The bin step in basis point, used to calculate the price
*/
function removeLBHooksOnPair(IERC20 tokenX, IERC20 tokenY, uint16 binStep)
external
override
onlyRole(LB_HOOKS_MANAGER_ROLE)
{
_setLBHooksParametersOnPair(tokenX, tokenY, binStep, 0, new bytes(0));
}
/**
* @notice Function to set the recipient of the fees. This address needs to be able to receive ERC20s
* @dev Needs to be called by the owner
* Reverts if:
* - The feeRecipient is `address(0)`
* - The feeRecipient is the same as the current one
* @param feeRecipient The address of the recipient
*/
function setFeeRecipient(address feeRecipient) external override onlyOwner {
_setFeeRecipient(feeRecipient);
}
/**
* @notice Function to set the flash loan fee
* @dev Needs to be called by the owner
* Reverts if:
* - The flashLoanFee is the same as the current one
* - The flashLoanFee is above the maximum flash loan fee
* @param flashLoanFee The value of the fee for flash loan
*/
function setFlashLoanFee(uint256 flashLoanFee) external override onlyOwner {
uint256 oldFlashLoanFee = _flashLoanFee;
if (oldFlashLoanFee == flashLoanFee) revert LBFactory__SameFlashLoanFee(flashLoanFee);
if (flashLoanFee > _MAX_FLASHLOAN_FEE) revert LBFactory__FlashLoanFeeAboveMax(flashLoanFee, _MAX_FLASHLOAN_FEE);
_flashLoanFee = flashLoanFee;
emit FlashLoanFeeSet(oldFlashLoanFee, flashLoanFee);
}
/**
* @notice Function to add an asset to the whitelist of quote assets
* @dev Needs to be called by the owner
* Reverts if:
* - The quoteAsset is already whitelisted
* @param quoteAsset The quote asset (e.g: NATIVE, USDC...)
*/
function addQuoteAsset(IERC20 quoteAsset) external override onlyOwner {
if (!_quoteAssetWhitelist.add(address(quoteAsset))) {
revert LBFactory__QuoteAssetAlreadyWhitelisted(quoteAsset);
}
emit QuoteAssetAdded(quoteAsset);
}
/**
* @notice Function to remove an asset from the whitelist of quote assets
* @dev Needs to be called by the owner
* Reverts if:
* - The quoteAsset was not whitelisted
* @param quoteAsset The quote asset (e.g: NATIVE, USDC...)
*/
function removeQuoteAsset(IERC20 quoteAsset) external override onlyOwner {
if (!_quoteAssetWhitelist.remove(address(quoteAsset))) revert LBFactory__QuoteAssetNotWhitelisted(quoteAsset);
emit QuoteAssetRemoved(quoteAsset);
}
function _isPresetOpen(bytes32 preset) internal pure returns (bool) {
return preset.decodeBool(_OFFSET_IS_PRESET_OPEN);
}
/**
* @notice Internal function to set the recipient of the fee
* @param feeRecipient The address of the recipient
*/
function _setFeeRecipient(address feeRecipient) internal {
if (feeRecipient == address(0)) revert LBFactory__AddressZero();
address oldFeeRecipient = _feeRecipient;
if (oldFeeRecipient == feeRecipient) revert LBFactory__SameFeeRecipient(_feeRecipient);
_feeRecipient = feeRecipient;
emit FeeRecipientSet(oldFeeRecipient, feeRecipient);
}
/**
* @notice Function to force the decay of the volatility accumulator of a pair
* @dev Needs to be called by the owner
* @param pair The pair to force the decay
*/
function forceDecay(ILBPair pair) external override onlyOwner {
pair.forceDecay();
}
/**
* @notice Returns the LBPairInformation if it exists,
* if not, then the address 0 is returned. The order doesn't matter
* @param tokenA The address of the first token of the pair
* @param tokenB The address of the second token of the pair
* @param binStep The bin step of the LBPair
* @return The LBPairInformation
*/
function _getLBPairInformation(IERC20 tokenA, IERC20 tokenB, uint256 binStep)
private
view
returns (LBPairInformation memory)
{
(tokenA, tokenB) = _sortTokens(tokenA, tokenB);
return _lbPairsInfo[tokenA][tokenB][binStep];
}
/**
* @notice Private view function to sort 2 tokens in ascending order
* @param tokenA The first token
* @param tokenB The second token
* @return The sorted first token
* @return The sorted second token
*/
function _sortTokens(IERC20 tokenA, IERC20 tokenB) private pure returns (IERC20, IERC20) {
if (tokenA > tokenB) (tokenA, tokenB) = (tokenB, tokenA);
return (tokenA, tokenB);
}
/**
* @notice Internal function to set a hooks contract to the pair
* @param tokenX The address of the first token
* @param tokenY The address of the second token
* @param binStep The bin step in basis point, used to calculate the price
* @param hooksParameters The hooks parameters
* @param onHooksSetData The data to pass to the onHooksSet function
*/
function _setLBHooksParametersOnPair(
IERC20 tokenX,
IERC20 tokenY,
uint16 binStep,
bytes32 hooksParameters,
bytes memory onHooksSetData
) internal {
ILBPair lbPair = _getLBPairInformation(tokenX, tokenY, binStep).LBPair;
if (address(lbPair) == address(0)) revert LBFactory__LBPairNotCreated(tokenX, tokenY, binStep);
if (lbPair.getLBHooksParameters() == hooksParameters) revert LBFactory__SameHooksParameters(hooksParameters);
lbPair.setHooksParameters(hooksParameters, onHooksSetData);
}
/**
* @notice Returns whether the caller has the role or not, only the owner has the DEFAULT_ADMIN_ROLE
* @param role The role to check
* @param account The address to check
* @return Whether the account has the role or not
*/
function hasRole(bytes32 role, address account) public view override returns (bool) {
if (role == DEFAULT_ADMIN_ROLE) return account == owner();
return super.hasRole(role, account);
}
/**
* @notice Grants a role to an address, the DEFAULT_ADMIN_ROLE can not be granted
* @param role The role to grant
* @param account The address to grant the role to
* @return Whether the role has been granted or not
*/
function _grantRole(bytes32 role, address account) internal override returns (bool) {
if (role == DEFAULT_ADMIN_ROLE) revert LBFactory__CannotGrantDefaultAdminRole();
return super._grantRole(role, account);
}
}[
{
"type": "constructor",
"inputs": [
{
"name": "feeRecipient",
"type": "address",
"internalType": "address"
},
{
"name": "initialOwner",
"type": "address",
"internalType": "address"
},
{
"name": "flashLoanFee",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "nonpayable"
},
{
"name": "AccessControlBadConfirmation",
"type": "error",
"inputs": []
},
{
"name": "AccessControlUnauthorizedAccount",
"type": "error",
"inputs": [
{
"name": "account",
"type": "address",
"internalType": "address"
},
{
"name": "neededRole",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"name": "EnumerableMapNonexistentKey",
"type": "error",
"inputs": [
{
"name": "key",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"name": "LBFactory__AddressZero",
"type": "error",
"inputs": []
},
{
"name": "LBFactory__BinStepHasNoPreset",
"type": "error",
"inputs": [
{
"name": "binStep",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"name": "LBFactory__BinStepTooLow",
"type": "error",
"inputs": [
{
"name": "binStep",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"name": "LBFactory__CannotGrantDefaultAdminRole",
"type": "error",
"inputs": []
},
{
"name": "LBFactory__FlashLoanFeeAboveMax",
"type": "error",
"inputs": [
{
"name": "fees",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "maxFees",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"name": "LBFactory__IdenticalAddresses",
"type": "error",
"inputs": [
{
"name": "token",
"type": "address",
"internalType": "contract IERC20"
}
]
},
{
"name": "LBFactory__ImplementationNotSet",
"type": "error",
"inputs": []
},
{
"name": "LBFactory__InvalidHooksParameters",
"type": "error",
"inputs": []
},
{
"name": "LBFactory__LBPairAlreadyExists",
"type": "error",
"inputs": [
{
"name": "tokenX",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "tokenY",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "_binStep",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"name": "LBFactory__LBPairDoesNotExist",
"type": "error",
"inputs": [
{
"name": "tokenX",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "tokenY",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "binStep",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"name": "LBFactory__LBPairIgnoredIsAlreadyInTheSameState",
"type": "error",
"inputs": []
},
{
"name": "LBFactory__LBPairNotCreated",
"type": "error",
"inputs": [
{
"name": "tokenX",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "tokenY",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "binStep",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"name": "LBFactory__LBPairSafetyCheckFailed",
"type": "error",
"inputs": [
{
"name": "LBPairImplementation",
"type": "address",
"internalType": "address"
}
]
},
{
"name": "LBFactory__PresetIsLockedForUsers",
"type": "error",
"inputs": [
{
"name": "user",
"type": "address",
"internalType": "address"
},
{
"name": "binStep",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"name": "LBFactory__PresetOpenStateIsAlreadyInTheSameState",
"type": "error",
"inputs": []
},
{
"name": "LBFactory__QuoteAssetAlreadyWhitelisted",
"type": "error",
"inputs": [
{
"name": "quoteAsset",
"type": "address",
"internalType": "contract IERC20"
}
]
},
{
"name": "LBFactory__QuoteAssetNotWhitelisted",
"type": "error",
"inputs": [
{
"name": "quoteAsset",
"type": "address",
"internalType": "contract IERC20"
}
]
},
{
"name": "LBFactory__SameFeeRecipient",
"type": "error",
"inputs": [
{
"name": "feeRecipient",
"type": "address",
"internalType": "address"
}
]
},
{
"name": "LBFactory__SameFlashLoanFee",
"type": "error",
"inputs": [
{
"name": "flashLoanFee",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"name": "LBFactory__SameHooksImplementation",
"type": "error",
"inputs": [
{
"name": "hooksImplementation",
"type": "address",
"internalType": "address"
}
]
},
{
"name": "LBFactory__SameHooksParameters",
"type": "error",
"inputs": [
{
"name": "hooksParameters",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"name": "LBFactory__SameImplementation",
"type": "error",
"inputs": [
{
"name": "LBPairImplementation",
"type": "address",
"internalType": "address"
}
]
},
{
"name": "OwnableInvalidOwner",
"type": "error",
"inputs": [
{
"name": "owner",
"type": "address",
"internalType": "address"
}
]
},
{
"name": "OwnableUnauthorizedAccount",
"type": "error",
"inputs": [
{
"name": "account",
"type": "address",
"internalType": "address"
}
]
},
{
"name": "PairParametersHelper__InvalidParameter",
"type": "error",
"inputs": []
},
{
"name": "SafeCast__Exceeds16Bits",
"type": "error",
"inputs": []
},
{
"name": "Uint128x128Math__PowUnderflow",
"type": "error",
"inputs": [
{
"name": "x",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "y",
"type": "int256",
"internalType": "int256"
}
]
},
{
"name": "FeeRecipientSet",
"type": "event",
"inputs": [
{
"name": "oldRecipient",
"type": "address",
"indexed": false,
"internalType": "address"
},
{
"name": "newRecipient",
"type": "address",
"indexed": false,
"internalType": "address"
}
],
"anonymous": false
},
{
"name": "FlashLoanFeeSet",
"type": "event",
"inputs": [
{
"name": "oldFlashLoanFee",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "newFlashLoanFee",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"name": "LBPairCreated",
"type": "event",
"inputs": [
{
"name": "tokenX",
"type": "address",
"indexed": true,
"internalType": "contract IERC20"
},
{
"name": "tokenY",
"type": "address",
"indexed": true,
"internalType": "contract IERC20"
},
{
"name": "binStep",
"type": "uint256",
"indexed": true,
"internalType": "uint256"
},
{
"name": "LBPair",
"type": "address",
"indexed": false,
"internalType": "contract ILBPair"
},
{
"name": "pid",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"name": "LBPairIgnoredStateChanged",
"type": "event",
"inputs": [
{
"name": "LBPair",
"type": "address",
"indexed": true,
"internalType": "contract ILBPair"
},
{
"name": "ignored",
"type": "bool",
"indexed": false,
"internalType": "bool"
}
],
"anonymous": false
},
{
"name": "LBPairImplementationSet",
"type": "event",
"inputs": [
{
"name": "oldLBPairImplementation",
"type": "address",
"indexed": false,
"internalType": "address"
},
{
"name": "LBPairImplementation",
"type": "address",
"indexed": false,
"internalType": "address"
}
],
"anonymous": false
},
{
"name": "OwnershipTransferStarted",
"type": "event",
"inputs": [
{
"name": "previousOwner",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "newOwner",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"name": "OwnershipTransferred",
"type": "event",
"inputs": [
{
"name": "previousOwner",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "newOwner",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"name": "PresetOpenStateChanged",
"type": "event",
"inputs": [
{
"name": "binStep",
"type": "uint256",
"indexed": true,
"internalType": "uint256"
},
{
"name": "isOpen",
"type": "bool",
"indexed": true,
"internalType": "bool"
}
],
"anonymous": false
},
{
"name": "PresetRemoved",
"type": "event",
"inputs": [
{
"name": "binStep",
"type": "uint256",
"indexed": true,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"name": "PresetSet",
"type": "event",
"inputs": [
{
"name": "binStep",
"type": "uint256",
"indexed": true,
"internalType": "uint256"
},
{
"name": "baseFactor",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "filterPeriod",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "decayPeriod",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "reductionFactor",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "variableFeeControl",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "protocolShare",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "maxVolatilityAccumulator",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"name": "QuoteAssetAdded",
"type": "event",
"inputs": [
{
"name": "quoteAsset",
"type": "address",
"indexed": true,
"internalType": "contract IERC20"
}
],
"anonymous": false
},
{
"name": "QuoteAssetRemoved",
"type": "event",
"inputs": [
{
"name": "quoteAsset",
"type": "address",
"indexed": true,
"internalType": "contract IERC20"
}
],
"anonymous": false
},
{
"name": "RoleAdminChanged",
"type": "event",
"inputs": [
{
"name": "role",
"type": "bytes32",
"indexed": true,
"internalType": "bytes32"
},
{
"name": "previousAdminRole",
"type": "bytes32",
"indexed": true,
"internalType": "bytes32"
},
{
"name": "newAdminRole",
"type": "bytes32",
"indexed": true,
"internalType": "bytes32"
}
],
"anonymous": false
},
{
"name": "RoleGranted",
"type": "event",
"inputs": [
{
"name": "role",
"type": "bytes32",
"indexed": true,
"internalType": "bytes32"
},
{
"name": "account",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "sender",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"name": "RoleRevoked",
"type": "event",
"inputs": [
{
"name": "role",
"type": "bytes32",
"indexed": true,
"internalType": "bytes32"
},
{
"name": "account",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "sender",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"name": "DEFAULT_ADMIN_ROLE",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"name": "LB_HOOKS_MANAGER_ROLE",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"name": "acceptOwnership",
"type": "function",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "addQuoteAsset",
"type": "function",
"inputs": [
{
"name": "quoteAsset",
"type": "address",
"internalType": "contract IERC20"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "createLBPair",
"type": "function",
"inputs": [
{
"name": "tokenX",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "tokenY",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "activeId",
"type": "uint24",
"internalType": "uint24"
},
{
"name": "binStep",
"type": "uint16",
"internalType": "uint16"
}
],
"outputs": [
{
"name": "pair",
"type": "address",
"internalType": "contract ILBPair"
}
],
"stateMutability": "nonpayable"
},
{
"name": "forceDecay",
"type": "function",
"inputs": [
{
"name": "pair",
"type": "address",
"internalType": "contract ILBPair"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "getAllBinSteps",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "binStepWithPreset",
"type": "uint256[]",
"internalType": "uint256[]"
}
],
"stateMutability": "view"
},
{
"name": "getAllLBPairs",
"type": "function",
"inputs": [
{
"name": "tokenX",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "tokenY",
"type": "address",
"internalType": "contract IERC20"
}
],
"outputs": [
{
"name": "lbPairsAvailable",
"type": "tuple[]",
"components": [
{
"name": "binStep",
"type": "uint16",
"internalType": "uint16"
},
{
"name": "LBPair",
"type": "address",
"internalType": "contract ILBPair"
},
{
"name": "createdByOwner",
"type": "bool",
"internalType": "bool"
},
{
"name": "ignoredForRouting",
"type": "bool",
"internalType": "bool"
}
],
"internalType": "struct ILBFactory.LBPairInformation[]"
}
],
"stateMutability": "view"
},
{
"name": "getFeeRecipient",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "feeRecipient",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "view"
},
{
"name": "getFlashLoanFee",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "flashLoanFee",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "getLBPairAtIndex",
"type": "function",
"inputs": [
{
"name": "index",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "lbPair",
"type": "address",
"internalType": "contract ILBPair"
}
],
"stateMutability": "view"
},
{
"name": "getLBPairImplementation",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "lbPairImplementation",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "view"
},
{
"name": "getLBPairInformation",
"type": "function",
"inputs": [
{
"name": "tokenA",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "tokenB",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "binStep",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "lbPairInformation",
"type": "tuple",
"components": [
{
"name": "binStep",
"type": "uint16",
"internalType": "uint16"
},
{
"name": "LBPair",
"type": "address",
"internalType": "contract ILBPair"
},
{
"name": "createdByOwner",
"type": "bool",
"internalType": "bool"
},
{
"name": "ignoredForRouting",
"type": "bool",
"internalType": "bool"
}
],
"internalType": "struct ILBFactory.LBPairInformation"
}
],
"stateMutability": "view"
},
{
"name": "getMaxFlashLoanFee",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "maxFee",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "pure"
},
{
"name": "getMinBinStep",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "minBinStep",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "pure"
},
{
"name": "getNumberOfLBPairs",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "lbPairNumber",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "getNumberOfQuoteAssets",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "numberOfQuoteAssets",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "getOpenBinSteps",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "openBinStep",
"type": "uint256[]",
"internalType": "uint256[]"
}
],
"stateMutability": "view"
},
{
"name": "getPreset",
"type": "function",
"inputs": [
{
"name": "binStep",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "baseFactor",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "filterPeriod",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "decayPeriod",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "reductionFactor",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "variableFeeControl",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "protocolShare",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "maxVolatilityAccumulator",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "isOpen",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"name": "getQuoteAssetAtIndex",
"type": "function",
"inputs": [
{
"name": "index",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "asset",
"type": "address",
"internalType": "contract IERC20"
}
],
"stateMutability": "view"
},
{
"name": "getRoleAdmin",
"type": "function",
"inputs": [
{
"name": "role",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"name": "grantRole",
"type": "function",
"inputs": [
{
"name": "role",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "account",
"type": "address",
"internalType": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "hasRole",
"type": "function",
"inputs": [
{
"name": "role",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "account",
"type": "address",
"internalType": "address"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"name": "isQuoteAsset",
"type": "function",
"inputs": [
{
"name": "token",
"type": "address",
"internalType": "contract IERC20"
}
],
"outputs": [
{
"name": "isQuote",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"name": "owner",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "view"
},
{
"name": "pendingOwner",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "view"
},
{
"name": "removeLBHooksOnPair",
"type": "function",
"inputs": [
{
"name": "tokenX",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "tokenY",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "binStep",
"type": "uint16",
"internalType": "uint16"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "removePreset",
"type": "function",
"inputs": [
{
"name": "binStep",
"type": "uint16",
"internalType": "uint16"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "removeQuoteAsset",
"type": "function",
"inputs": [
{
"name": "quoteAsset",
"type": "address",
"internalType": "contract IERC20"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "renounceOwnership",
"type": "function",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "renounceRole",
"type": "function",
"inputs": [
{
"name": "role",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "callerConfirmation",
"type": "address",
"internalType": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "revokeRole",
"type": "function",
"inputs": [
{
"name": "role",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "account",
"type": "address",
"internalType": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "setFeeRecipient",
"type": "function",
"inputs": [
{
"name": "feeRecipient",
"type": "address",
"internalType": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "setFeesParametersOnPair",
"type": "function",
"inputs": [
{
"name": "tokenX",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "tokenY",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "binStep",
"type": "uint16",
"internalType": "uint16"
},
{
"name": "baseFactor",
"type": "uint16",
"internalType": "uint16"
},
{
"name": "filterPeriod",
"type": "uint16",
"internalType": "uint16"
},
{
"name": "decayPeriod",
"type": "uint16",
"internalType": "uint16"
},
{
"name": "reductionFactor",
"type": "uint16",
"internalType": "uint16"
},
{
"name": "variableFeeControl",
"type": "uint24",
"internalType": "uint24"
},
{
"name": "protocolShare",
"type": "uint16",
"internalType": "uint16"
},
{
"name": "maxVolatilityAccumulator",
"type": "uint24",
"internalType": "uint24"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "setFlashLoanFee",
"type": "function",
"inputs": [
{
"name": "flashLoanFee",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "setLBHooksParametersOnPair",
"type": "function",
"inputs": [
{
"name": "tokenX",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "tokenY",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "binStep",
"type": "uint16",
"internalType": "uint16"
},
{
"name": "hooksParameters",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "onHooksSetData",
"type": "bytes",
"internalType": "bytes"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "setLBPairIgnored",
"type": "function",
"inputs": [
{
"name": "tokenX",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "tokenY",
"type": "address",
"internalType": "contract IERC20"
},
{
"name": "binStep",
"type": "uint16",
"internalType": "uint16"
},
{
"name": "ignored",
"type": "bool",
"internalType": "bool"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "setLBPairImplementation",
"type": "function",
"inputs": [
{
"name": "newLBPairImplementation",
"type": "address",
"internalType": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "setPreset",
"type": "function",
"inputs": [
{
"name": "binStep",
"type": "uint16",
"internalType": "uint16"
},
{
"name": "baseFactor",
"type": "uint16",
"internalType": "uint16"
},
{
"name": "filterPeriod",
"type": "uint16",
"internalType": "uint16"
},
{
"name": "decayPeriod",
"type": "uint16",
"internalType": "uint16"
},
{
"name": "reductionFactor",
"type": "uint16",
"internalType": "uint16"
},
{
"name": "variableFeeControl",
"type": "uint24",
"internalType": "uint24"
},
{
"name": "protocolShare",
"type": "uint16",
"internalType": "uint16"
},
{
"name": "maxVolatilityAccumulator",
"type": "uint24",
"internalType": "uint24"
},
{
"name": "isOpen",
"type": "bool",
"internalType": "bool"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "setPresetOpenState",
"type": "function",
"inputs": [
{
"name": "binStep",
"type": "uint16",
"internalType": "uint16"
},
{
"name": "isOpen",
"type": "bool",
"internalType": "bool"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "supportsInterface",
"type": "function",
"inputs": [
{
"name": "interfaceId",
"type": "bytes4",
"internalType": "bytes4"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"name": "transferOwnership",
"type": "function",
"inputs": [
{
"name": "newOwner",
"type": "address",
"internalType": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
}
]0x60806040523480156200001157600080fd5b506040516200319938038062003199833981016040819052620000349162000253565b816001600160a01b0381166200006557604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b620000708162000100565b5067016345785d8a0000811115620000ad57604051635e8988c160e01b81526004810182905267016345785d8a000060248201526044016200005c565b620000b8836200011e565b60048190556040805160008152602081018390527f5c34e91c94c78b662a45d0bd4a25a4e32c584c54a45a76e4a4d43be27ba40e50910160405180910390a150505062000294565b600180546001600160a01b03191690556200011b81620001e6565b50565b6001600160a01b0381166200014657604051632573cfb960e21b815260040160405180910390fd5b6003546001600160a01b0390811690821681036200018757600354604051634fcea97160e01b81526001600160a01b0390911660048201526024016200005c565b600380546001600160a01b0319166001600160a01b0384811691821790925560408051928416835260208301919091527f15d80a013f22151bc7246e3bc132e12828cde19de98870475e3fa70840152721910160405180910390a15050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200024e57600080fd5b919050565b6000806000606084860312156200026957600080fd5b620002748462000236565b9250620002846020850162000236565b9150604084015190509250925092565b612ef580620002a46000396000f3fe608060405234801561001057600080fd5b50600436106102de5760003560e01c8063701ab8c111610186578063aabc4b3c116100e3578063e203a31f11610097578063e92d0d5d11610071578063e92d0d5d14610627578063f2fde38b1461063a578063fd90c2be1461064d57600080fd5b8063e203a31f146105f0578063e30c397814610603578063e74b981b1461061457600080fd5b8063b0384781116100c8578063b0384781146105b7578063d547741f146105ca578063ddbfd941146105dd57600080fd5b8063aabc4b3c14610556578063af371065146105a657600080fd5b806380c5061e1161013a5780638da5cb5b1161011f5780638da5cb5b1461052a57806391d148541461053b578063a217fddf1461054e57600080fd5b806380c5061e146105145780638ce9aa1c1461051c57600080fd5b8063715018a61161016b578063715018a6146104f157806379ba5097146104f95780637daf5d661461050157600080fd5b8063701ab8c1146104ca578063704037bd146104d157600080fd5b8063379ee8031161023f5780634e937c3a116101f3578063659ac74b116101cd578063659ac74b146104845780636622e0d71461049757806369d56ea3146104b757600080fd5b80634e937c3a146104615780635a440923146104695780635b35875c1461047c57600080fd5b80633c78a941116102245780633c78a9411461042a5780634ccb20c01461043d5780634cd161d31461044e57600080fd5b8063379ee803146104045780633a2f1a911461041757600080fd5b8063248a9ca3116102965780632cc06b8c1161027b5780632cc06b8c146103cb5780632f2ff15d146103de57806336568abe146103f157600080fd5b8063248a9ca31461039557806327721842146103b857600080fd5b80630752092b116102c75780630752092b14610320578063093ff7691461034b5780631af5bacc1461036057600080fd5b806301ffc9a7146102e35780630282c9c11461030b575b600080fd5b6102f66102f13660046127ff565b610655565b60405190151581526020015b60405180910390f35b61031361068c565b6040516103029190612829565b61033361032e36600461286d565b610766565b6040516001600160a01b039091168152602001610302565b61035e6103593660046128c0565b610773565b005b6103877fdcf4465aa60d92459eb361fac2489220ae3c524301cc0433c30a5d83e8fb0fa981565b604051908152602001610302565b6103876103a336600461286d565b60009081526002602052604090206001015490565b6102f66103c636600461297e565b610879565b61035e6103d936600461299b565b610886565b61035e6103ec3660046129e2565b6108d5565b61035e6103ff3660046129e2565b6108fa565b61035e610412366004612a22565b610932565b61035e610425366004612aca565b610a4e565b61035e61043836600461297e565b610b00565b6003546001600160a01b0316610333565b61035e61045c366004612b7b565b610b5e565b600654610387565b61035e61047736600461297e565b610c29565b610313610c9b565b610333610492366004612bae565b610cac565b6104aa6104a5366004612c06565b6111f7565b6040516103029190612c34565b61035e6104c5366004612ca8565b61138f565b6001610387565b6104e46104df366004612cf5565b611519565b6040516103029190612d36565b61035e611550565b61035e611564565b61033361050f36600461286d565b6115a8565b6103876115d8565b67016345785d8a0000610387565b6000546001600160a01b0316610333565b6102f66105493660046129e2565b6115e4565b610387600081565b61056961056436600461286d565b611630565b604080519889526020890197909752958701949094526060860192909252608085015260a084015260c0830152151560e082015261010001610302565b6005546001600160a01b0316610333565b61035e6105c536600461297e565b6116f1565b61035e6105d83660046129e2565b611832565b61035e6105eb36600461297e565b611857565b61035e6105fe366004612d72565b6118c9565b6001546001600160a01b0316610333565b61035e61062236600461297e565b611935565b61035e61063536600461286d565b611946565b61035e61064836600461297e565b6119e9565b600454610387565b60006001600160e01b03198216637965db0b60e01b148061068657506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600061069a6008611a5a565b90508015610762578067ffffffffffffffff8111156106bb576106bb612d8d565b6040519080825280602002602001820160405280156106e4578160200160208202803683370190505b5091506000805b8281101561075357600080610701600884611a65565b909250905061070f81611a81565b15610740578186858151811061072757610727612da3565b60209081029190910101528361073c81612dcf565b9450505b50508061074c90612dcf565b90506106eb565b5081811015610760578083525b505b5090565b6000610686600b83611a8d565b61077b611a99565b600061078c8b8b8b61ffff16611ac6565b6020015190506001600160a01b0381166107db5760405163b65ee95360e01b81526001600160a01b03808d1660048301528b16602482015261ffff8a1660448201526064015b60405180910390fd5b604051633329c28d60e11b815261ffff808a16600483015280891660248301528088166044830152808716606483015262ffffff808716608484015290851660a4830152831660c48201526001600160a01b03821690636653851a9060e401600060405180830381600087803b15801561085457600080fd5b505af1158015610868573d6000803e3d6000fd5b505050505050505050505050505050565b6000610686600b83611b70565b7fdcf4465aa60d92459eb361fac2489220ae3c524301cc0433c30a5d83e8fb0fa96108b081611b92565b604080516000808252602082019092526108cf91869186918691611b9c565b50505050565b6000828152600260205260409020600101546108f081611b92565b6108cf8383611ce3565b6001600160a01b03811633146109235760405163334bd91960e11b815260040160405180910390fd5b61092d8282611d0d565b505050565b61093a611a99565b60018961ffff16101561096657604051634f958e7160e01b815261ffff8a1660048201526024016107d2565b6000610978818a8a8a8a8a8a8a611d82565b905081156109905761098d81600160ff611e82565b90505b6109a0600861ffff8c1683611ea9565b506040805161ffff8b811682528a8116602083015289811682840152888116606083015262ffffff888116608084015287821660a0840152861660c08301529151918c16917f839844a256a87f87c9c835117d9a1c40be013954064c937072acb32d36db6a289181900360e00190a26040518215159061ffff8c16907f58a8b6a02b964cca2712e5a71d7b0d564a56b4a0f573b4c47f389341ade14cfd90600090a350505050505050505050565b7fdcf4465aa60d92459eb361fac2489220ae3c524301cc0433c30a5d83e8fb0fa9610a7881611b92565b6001600160a01b0384161580610a965750836001600160a01b031916155b15610ab45760405163d43a15d160e01b815260040160405180910390fd5b610af78787878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611b9c92505050565b50505050505050565b610b08611a99565b806001600160a01b031663d3b9fbe46040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b4357600080fd5b505af1158015610b57573d6000803e3d6000fd5b5050505050565b610b66611a99565b610b75600861ffff8416611eb6565b610b9857604051637d9160bf60e11b815261ffff831660048201526024016107d2565b6000610ba9600861ffff8516611ec2565b905081151560ff82901c151503610bd3576040516311be38db60e11b815260040160405180910390fd5b610bf061ffff8416610be7838560ff611e82565b60089190611ea9565b506040518215159061ffff8516907f58a8b6a02b964cca2712e5a71d7b0d564a56b4a0f573b4c47f389341ade14cfd90600090a3505050565b610c31611a99565b610c3c600b82611ece565b610c64576040516303ce0ad960e01b81526001600160a01b03821660048201526024016107d2565b6040516001600160a01b038216907f84cc2115995684dcb0cd3d3a9565e3d32f075de81db70c8dc3a719b2a47af67e90600090a250565b6060610ca76008611ee3565b905090565b6000610cbd600861ffff8416611eb6565b610ce057604051637d9160bf60e11b815261ffff831660048201526024016107d2565b6000610cf1600861ffff8516611ec2565b90506000610d076000546001600160a01b031690565b6001600160a01b0316336001600160a01b0316149050610d2682611a81565b158015610d31575080155b15610d5b576040516304fc2fe760e11b815233600482015261ffff851660248201526044016107d2565b610d66600b87611b70565b610d8e57604051638e888ef360e01b81526001600160a01b03871660048201526024016107d2565b856001600160a01b0316876001600160a01b031603610dcb57604051632f9b185360e01b81526001600160a01b03881660048201526024016107d2565b610dd58585611ef0565b50600080610de38989611f34565b90925090506001600160a01b038216610e0f57604051632573cfb960e21b815260040160405180910390fd5b6001600160a01b0382811660009081526007602090815260408083208585168452825280832061ffff8b1684529091529020546201000090041615610e845760405163cb27a43560e01b81526001600160a01b03808b1660048301528916602482015261ffff871660448201526064016107d2565b6005546001600160a01b031680610eae576040516328b4fcf960e21b815260040160405180910390fd5b6040516bffffffffffffffffffffffff1960608c811b821660208401528b901b1660348201527fffff00000000000000000000000000000000000000000000000000000000000060f089901b166048820152610f5b908290604a0160408051601f198184030181528282526001600160a01b03808916602085015287169183019190915261ffff8b1660608301529060800160405160208183030381529060405280519060200120611f5d565b6040805160808101825261ffff808b168083526001600160a01b0380861660208086018281528c15158789019081526000606089018181528e8716808352600786528b83208f89168085529087528c84208a855287528c84209b518c549651955193511515600160b81b0260ff60b81b19941515600160b01b02949094167fffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffff96909a1662010000027fffffffffffffffffffff000000000000000000000000000000000000000000009097169b169a909a179490941792909216959095171790965560068054600181019091557ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b031916909217909155938152600d8452848120928152919092529190912091975061109e9250612018565b508561ffff16886001600160a01b03168a6001600160a01b03167f2c8d104b27c6b7f4492017a6f5cf3803043688934ebcaa6a03540beeaf976aff8860016006805490506110ec9190612de8565b604080516001600160a01b03909316835260208301919091520160405180910390a4846001600160a01b03166347973bff61112686612024565b61112f87612030565b61113888612040565b61114189612050565b61114a8a612060565b6111538b612071565b61115c8c612081565b6040516001600160e01b031960e08a901b16815261ffff978816600482015295871660248701529386166044860152918516606485015262ffffff9081166084850152931660a4830152821660c4820152908a1660e482015261010401600060405180830381600087803b1580156111d357600080fd5b505af11580156111e7573d6000803e3d6000fd5b5050505050505050949350505050565b60606000806112068585611f34565b6001600160a01b038083166000908152600d60209081526040808320938516835292905290812092945090925061123c82612092565b90508015611385578067ffffffffffffffff81111561125d5761125d612d8d565b6040519080825280602002602001820160405280156112af57816020015b60408051608081018252600080825260208083018290529282018190526060820152825260001990920191018161127b5790505b506001600160a01b03808616600090815260076020908152604080832093881683529290529081209196505b828110156113825760006112f76112f28684611a8d565b61209c565b6040805160808101825261ffff831680825260008181526020888152848220546001600160a01b03620100008204168286015260ff600160b01b8204811615159686019690965292909152879052600160b81b90049091161515606082015289519192509089908490811061136e5761136e612da3565b6020908102919091010152506001016112db565b50505b5050505092915050565b611397611a99565b6000806113a48686611f34565b6001600160a01b0380831660009081526007602090815260408083208486168452825280832061ffff808c1685529083529281902081516080810183529054938416815262010000840490941691840182905260ff600160b01b84048116151591850191909152600160b81b909204909116151560608301529294509092509061145e5760405163102a919160e21b81526001600160a01b0380891660048301528716602482015261ffff861660448201526064016107d2565b831515816060015115150361148557604051626ee66560e11b815260040160405180910390fd5b6001600160a01b0380841660009081526007602090815260408083208685168452825280832061ffff8a1684528252918290208054881515600160b81b0260ff60b81b1990911617905583015190519116907f44cf35361c9ff3c8c1397ec6410d5495cc481feaef35c9af11da1a637107de4f9061150890871515815260200190565b60405180910390a250505050505050565b604080516080810182526000808252602082018190529181018290526060810191909152611548848484611ac6565b949350505050565b611558611a99565b61156260006120c6565b565b60015433906001600160a01b0316811461159c5760405163118cdaa760e01b81526001600160a01b03821660048201526024016107d2565b6115a5816120c6565b50565b6000600682815481106115bd576115bd612da3565b6000918252602090912001546001600160a01b031692915050565b6000610ca7600b612092565b60008261160257506000546001600160a01b03828116911614610686565b60008381526002602090815260408083206001600160a01b038616845290915290205460ff165b9392505050565b60008080808080808061164460088a611eb6565b61166457604051637d9160bf60e11b8152600481018a90526024016107d2565b600061167160088b611ec2565b905061167c81612024565b61ffff16985061168b81612030565b61ffff16975061169a81612040565b61ffff1696506116a981612050565b61ffff1695506116b881612060565b62ffffff1694506116c881612071565b61ffff1693506116d781612081565b62ffffff16925060ff81901c915050919395975091939597565b6116f9611a99565b306001600160a01b0316816001600160a01b03166388cc58e46040518163ffffffff1660e01b8152600401602060405180830381865afa158015611741573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117659190612dfb565b6001600160a01b03161461179757604051630a3e70af60e11b81526001600160a01b03821660048201526024016107d2565b6005546001600160a01b0390811690821681036117d257604051630ded3b9560e31b81526001600160a01b03831660048201526024016107d2565b600580546001600160a01b0319166001600160a01b0384811691821790925560408051928416835260208301919091527f900d0e3d359f50e4f923ecdc06b401e07dbb9f485e17b07bcfc91a13000b277e91015b60405180910390a15050565b60008281526002602052604090206001015461184d81611b92565b6108cf8383611d0d565b61185f611a99565b61186a600b826120df565b61189257604051638e888ef360e01b81526001600160a01b03821660048201526024016107d2565b6040516001600160a01b038216907f0b767739217755d8af5a2ba75b181a19fa1750f8bb701f09311cb19a90140cb390600090a250565b6118d1611a99565b6118e0600861ffff83166120f4565b61190357604051637d9160bf60e11b815261ffff821660048201526024016107d2565b60405161ffff8216907fdd86b848bb56ff540caa68683fa467d0e7eb5f8b2d44e4ee435742eeeae9be1390600090a250565b61193d611a99565b6115a581612100565b61194e611a99565b60045481810361197457604051631baa31e960e21b8152600481018390526024016107d2565b67016345785d8a00008211156119ae57604051635e8988c160e01b81526004810183905267016345785d8a000060248201526044016107d2565b600482905560408051828152602081018490527f5c34e91c94c78b662a45d0bd4a25a4e32c584c54a45a76e4a4d43be27ba40e509101611826565b6119f1611a99565b600180546001600160a01b0383166001600160a01b03199091168117909155611a226000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6000610686826121be565b6000808080611a7486866121c9565b9097909650945050505050565b600060ff82901c610686565b600061162983836121f4565b6000546001600160a01b031633146115625760405163118cdaa760e01b81523360048201526024016107d2565b604080516080810182526000808252602082018190529181018290526060810191909152611af48484611f34565b6001600160a01b03918216600090815260076020908152604080832093851683529281528282209582529485528190208151608081018352905461ffff811682526201000081049093169481019490945260ff600160b01b83048116151591850191909152600160b81b90910416151560608301525092915050565b6001600160a01b03811660009081526001830160205260408120541515611629565b6115a5813361221e565b6000611bad86868661ffff16611ac6565b6020015190506001600160a01b038116611bf75760405163b65ee95360e01b81526001600160a01b0380881660048301528616602482015261ffff851660448201526064016107d2565b82816001600160a01b031663781a89156040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5a9190612e18565b03611c7b5760405163b70cd0db60e01b8152600481018490526024016107d2565b604051631b057f6d60e01b81526001600160a01b03821690631b057f6d90611ca99086908690600401612e31565b600060405180830381600087803b158015611cc357600080fd5b505af1158015611cd7573d6000803e3d6000fd5b50505050505050505050565b600082611d0357604051633e3253cf60e11b815260040160405180910390fd5b611629838361225b565b6000611d1983836115e4565b15611d7a5760008381526002602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610686565b506000610686565b60008561ffff168761ffff161180611d9f5750610fff8661ffff16115b80611daf57506127108561ffff16115b80611dbf57506109c48361ffff16115b80611dd15750620fffff8262ffffff16115b15611def57604051631c07203f60e01b815260040160405180910390fd5b5060109590951b630fff00001661ffff9690961695909517601c9390931b64fff0000000169290921760289190911b663fff0000000000161760369190911b693fffffc00000000000001617604e9290921b6b0fffc00000000000000000001691909117605c9190911b6dfffff0000000000000000000000016176dffffffffffffffffffffffffffff19919091161790565b60006115488484611e94576000611e97565b60015b600180861b19929092169116841b1790565b60006115488484846122e7565b60006116298383612304565b60006116298383612310565b6000611629836001600160a01b038416612357565b606060006116298361239e565b600061271071ffff00000000000000000000000000000000608084901b1604600160801b0162ffffff8416627fffff1901611f2b82826123a9565b95945050505050565b600080826001600160a01b0316846001600160a01b03161115611f55579192915b509192909150565b600060408303516020840351845180602087010180516002830161ffca811115611f8f5763c8c781396000526004601cfd5b6c5af43d3d93803e603357fd5bf3895289600d8a03527d6100003d81600a3d39f3363d3d373d3d3d3d610000806035363936013d738160481b176035820160d81b1760218a03528060f01b835287603f8201601f8b036000f596505085611ffe5763301164256000526004601cfd5b90528552601f19850152603f199093019290925250919050565b60006116298383612357565b600061ffff8216610686565b60006106868260101c610fff1690565b600061068682601c1c610fff1690565b60006106868260281c613fff1690565b60006106868260361c62ffffff1690565b600061068682604e1c613fff1690565b600061068682605c1c620fffff1690565b6000610686825490565b8061ffff811681146120c1576040516364ae406d60e01b815260040160405180910390fd5b919050565b600180546001600160a01b03191690556115a581612612565b6000611629836001600160a01b038416612662565b60006116298383612755565b6001600160a01b03811661212757604051632573cfb960e21b815260040160405180910390fd5b6003546001600160a01b03908116908216810361216657600354604051634fcea97160e01b81526001600160a01b0390911660048201526024016107d2565b600380546001600160a01b0319166001600160a01b0384811691821790925560408051928416835260208301919091527f15d80a013f22151bc7246e3bc132e12828cde19de98870475e3fa708401527219101611826565b600061068682612092565b600080806121d78585611a8d565b600081815260029690960160205260409095205494959350505050565b600082600001828154811061220b5761220b612da3565b9060005260206000200154905092915050565b61222882826115e4565b6122575760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016107d2565b5050565b600061226783836115e4565b611d7a5760008381526002602090815260408083206001600160a01b03861684529091529020805460ff1916600117905561229f3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610686565b600082815260028401602052604081208290556115488484612018565b60006116298383612772565b60008181526002830160205260408120548015801561233657506123348484612304565b155b156116295760405163015ab34360e11b8152600481018490526024016107d2565b6000818152600183016020526040812054611d7a57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610686565b60606106868261278a565b6000806000836000036123c55750600160801b91506106869050565b508260008112156123d7579015906000035b621000008110156125d057600160801b9250846fffffffffffffffffffffffffffffffff81111561240a57911591600019045b600182161561241b5792830260801c925b800260801c60028216156124315792830260801c925b800260801c60048216156124475792830260801c925b800260801c600882161561245d5792830260801c925b800260801c60108216156124735792830260801c925b800260801c60208216156124895792830260801c925b800260801c604082161561249f5792830260801c925b8002608090811c908216156124b65792830260801c925b800260801c6101008216156124cd5792830260801c925b800260801c6102008216156124e45792830260801c925b800260801c6104008216156124fb5792830260801c925b800260801c6108008216156125125792830260801c925b800260801c6110008216156125295792830260801c925b800260801c6120008216156125405792830260801c925b800260801c6140008216156125575792830260801c925b800260801c61800082161561256e5792830260801c925b800260801c620100008216156125865792830260801c925b800260801c6202000082161561259e5792830260801c925b800260801c620400008216156125b65792830260801c925b800260801c620800008216156125ce5792830260801c925b505b826000036125fb57604051631dba598d60e11b815260048101869052602481018590526044016107d2565b816126065782611f2b565b611f2b83600019612e87565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000818152600183016020526040812054801561274b576000612686600183612de8565b855490915060009061269a90600190612de8565b90508082146126ff5760008660000182815481106126ba576126ba612da3565b90600052602060002001549050808760000184815481106126dd576126dd612da3565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061271057612710612ea9565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610686565b6000915050610686565b600081815260028301602052604081208190556116298383612797565b60008181526001830160205260408120541515611629565b60606000611629836127a3565b60006116298383612662565b6060816000018054806020026020016040519081016040528092919081815260200182805480156127f357602002820191906000526020600020905b8154815260200190600101908083116127df575b50505050509050919050565b60006020828403121561281157600080fd5b81356001600160e01b03198116811461162957600080fd5b6020808252825182820181905260009190848201906040850190845b8181101561286157835183529284019291840191600101612845565b50909695505050505050565b60006020828403121561287f57600080fd5b5035919050565b6001600160a01b03811681146115a557600080fd5b803561ffff811681146120c157600080fd5b803562ffffff811681146120c157600080fd5b6000806000806000806000806000806101408b8d0312156128e057600080fd5b8a356128eb81612886565b995060208b01356128fb81612886565b985061290960408c0161289b565b975061291760608c0161289b565b965061292560808c0161289b565b955061293360a08c0161289b565b945061294160c08c0161289b565b935061294f60e08c016128ad565b925061295e6101008c0161289b565b915061296d6101208c016128ad565b90509295989b9194979a5092959850565b60006020828403121561299057600080fd5b813561162981612886565b6000806000606084860312156129b057600080fd5b83356129bb81612886565b925060208401356129cb81612886565b91506129d96040850161289b565b90509250925092565b600080604083850312156129f557600080fd5b823591506020830135612a0781612886565b809150509250929050565b803580151581146120c157600080fd5b60008060008060008060008060006101208a8c031215612a4157600080fd5b612a4a8a61289b565b9850612a5860208b0161289b565b9750612a6660408b0161289b565b9650612a7460608b0161289b565b9550612a8260808b0161289b565b9450612a9060a08b016128ad565b9350612a9e60c08b0161289b565b9250612aac60e08b016128ad565b9150612abb6101008b01612a12565b90509295985092959850929598565b60008060008060008060a08789031215612ae357600080fd5b8635612aee81612886565b95506020870135612afe81612886565b9450612b0c6040880161289b565b935060608701359250608087013567ffffffffffffffff80821115612b3057600080fd5b818901915089601f830112612b4457600080fd5b813581811115612b5357600080fd5b8a6020828501011115612b6557600080fd5b6020830194508093505050509295509295509295565b60008060408385031215612b8e57600080fd5b612b978361289b565b9150612ba560208401612a12565b90509250929050565b60008060008060808587031215612bc457600080fd5b8435612bcf81612886565b93506020850135612bdf81612886565b9250612bed604086016128ad565b9150612bfb6060860161289b565b905092959194509250565b60008060408385031215612c1957600080fd5b8235612c2481612886565b91506020830135612a0781612886565b6020808252825182820181905260009190848201906040850190845b8181101561286157612c9583855161ffff81511682526001600160a01b0360208201511660208301526040810151151560408301526060810151151560608301525050565b9284019260809290920191600101612c50565b60008060008060808587031215612cbe57600080fd5b8435612cc981612886565b93506020850135612cd981612886565b9250612ce76040860161289b565b9150612bfb60608601612a12565b600080600060608486031215612d0a57600080fd5b8335612d1581612886565b92506020840135612d2581612886565b929592945050506040919091013590565b815161ffff1681526020808301516001600160a01b03169082015260408083015115159082015260608083015115159082015260808101610686565b600060208284031215612d8457600080fd5b6116298261289b565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612de157612de1612db9565b5060010190565b8181038181111561068657610686612db9565b600060208284031215612e0d57600080fd5b815161162981612886565b600060208284031215612e2a57600080fd5b5051919050565b82815260006020604081840152835180604085015260005b81811015612e6557858101830151858201606001528201612e49565b506000606082860101526060601f19601f830116850101925050509392505050565b600082612ea457634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fdfea26469706673582212204d4599d4f319681bcc0ab1ad8a7491658f81ea33d082fe0961f0948dd9a32e0b64736f6c6343000814003300000000000000000000000038a936f870508fa3f8e577fa96c821b119f84262000000000000000000000000da8d14497660de57623faabf54952162cec0de5b0000000000000000000000000000000000000000000000000000048c27395000
0x608060405234801561001057600080fd5b50600436106102de5760003560e01c8063701ab8c111610186578063aabc4b3c116100e3578063e203a31f11610097578063e92d0d5d11610071578063e92d0d5d14610627578063f2fde38b1461063a578063fd90c2be1461064d57600080fd5b8063e203a31f146105f0578063e30c397814610603578063e74b981b1461061457600080fd5b8063b0384781116100c8578063b0384781146105b7578063d547741f146105ca578063ddbfd941146105dd57600080fd5b8063aabc4b3c14610556578063af371065146105a657600080fd5b806380c5061e1161013a5780638da5cb5b1161011f5780638da5cb5b1461052a57806391d148541461053b578063a217fddf1461054e57600080fd5b806380c5061e146105145780638ce9aa1c1461051c57600080fd5b8063715018a61161016b578063715018a6146104f157806379ba5097146104f95780637daf5d661461050157600080fd5b8063701ab8c1146104ca578063704037bd146104d157600080fd5b8063379ee8031161023f5780634e937c3a116101f3578063659ac74b116101cd578063659ac74b146104845780636622e0d71461049757806369d56ea3146104b757600080fd5b80634e937c3a146104615780635a440923146104695780635b35875c1461047c57600080fd5b80633c78a941116102245780633c78a9411461042a5780634ccb20c01461043d5780634cd161d31461044e57600080fd5b8063379ee803146104045780633a2f1a911461041757600080fd5b8063248a9ca3116102965780632cc06b8c1161027b5780632cc06b8c146103cb5780632f2ff15d146103de57806336568abe146103f157600080fd5b8063248a9ca31461039557806327721842146103b857600080fd5b80630752092b116102c75780630752092b14610320578063093ff7691461034b5780631af5bacc1461036057600080fd5b806301ffc9a7146102e35780630282c9c11461030b575b600080fd5b6102f66102f13660046127ff565b610655565b60405190151581526020015b60405180910390f35b61031361068c565b6040516103029190612829565b61033361032e36600461286d565b610766565b6040516001600160a01b039091168152602001610302565b61035e6103593660046128c0565b610773565b005b6103877fdcf4465aa60d92459eb361fac2489220ae3c524301cc0433c30a5d83e8fb0fa981565b604051908152602001610302565b6103876103a336600461286d565b60009081526002602052604090206001015490565b6102f66103c636600461297e565b610879565b61035e6103d936600461299b565b610886565b61035e6103ec3660046129e2565b6108d5565b61035e6103ff3660046129e2565b6108fa565b61035e610412366004612a22565b610932565b61035e610425366004612aca565b610a4e565b61035e61043836600461297e565b610b00565b6003546001600160a01b0316610333565b61035e61045c366004612b7b565b610b5e565b600654610387565b61035e61047736600461297e565b610c29565b610313610c9b565b610333610492366004612bae565b610cac565b6104aa6104a5366004612c06565b6111f7565b6040516103029190612c34565b61035e6104c5366004612ca8565b61138f565b6001610387565b6104e46104df366004612cf5565b611519565b6040516103029190612d36565b61035e611550565b61035e611564565b61033361050f36600461286d565b6115a8565b6103876115d8565b67016345785d8a0000610387565b6000546001600160a01b0316610333565b6102f66105493660046129e2565b6115e4565b610387600081565b61056961056436600461286d565b611630565b604080519889526020890197909752958701949094526060860192909252608085015260a084015260c0830152151560e082015261010001610302565b6005546001600160a01b0316610333565b61035e6105c536600461297e565b6116f1565b61035e6105d83660046129e2565b611832565b61035e6105eb36600461297e565b611857565b61035e6105fe366004612d72565b6118c9565b6001546001600160a01b0316610333565b61035e61062236600461297e565b611935565b61035e61063536600461286d565b611946565b61035e61064836600461297e565b6119e9565b600454610387565b60006001600160e01b03198216637965db0b60e01b148061068657506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600061069a6008611a5a565b90508015610762578067ffffffffffffffff8111156106bb576106bb612d8d565b6040519080825280602002602001820160405280156106e4578160200160208202803683370190505b5091506000805b8281101561075357600080610701600884611a65565b909250905061070f81611a81565b15610740578186858151811061072757610727612da3565b60209081029190910101528361073c81612dcf565b9450505b50508061074c90612dcf565b90506106eb565b5081811015610760578083525b505b5090565b6000610686600b83611a8d565b61077b611a99565b600061078c8b8b8b61ffff16611ac6565b6020015190506001600160a01b0381166107db5760405163b65ee95360e01b81526001600160a01b03808d1660048301528b16602482015261ffff8a1660448201526064015b60405180910390fd5b604051633329c28d60e11b815261ffff808a16600483015280891660248301528088166044830152808716606483015262ffffff808716608484015290851660a4830152831660c48201526001600160a01b03821690636653851a9060e401600060405180830381600087803b15801561085457600080fd5b505af1158015610868573d6000803e3d6000fd5b505050505050505050505050505050565b6000610686600b83611b70565b7fdcf4465aa60d92459eb361fac2489220ae3c524301cc0433c30a5d83e8fb0fa96108b081611b92565b604080516000808252602082019092526108cf91869186918691611b9c565b50505050565b6000828152600260205260409020600101546108f081611b92565b6108cf8383611ce3565b6001600160a01b03811633146109235760405163334bd91960e11b815260040160405180910390fd5b61092d8282611d0d565b505050565b61093a611a99565b60018961ffff16101561096657604051634f958e7160e01b815261ffff8a1660048201526024016107d2565b6000610978818a8a8a8a8a8a8a611d82565b905081156109905761098d81600160ff611e82565b90505b6109a0600861ffff8c1683611ea9565b506040805161ffff8b811682528a8116602083015289811682840152888116606083015262ffffff888116608084015287821660a0840152861660c08301529151918c16917f839844a256a87f87c9c835117d9a1c40be013954064c937072acb32d36db6a289181900360e00190a26040518215159061ffff8c16907f58a8b6a02b964cca2712e5a71d7b0d564a56b4a0f573b4c47f389341ade14cfd90600090a350505050505050505050565b7fdcf4465aa60d92459eb361fac2489220ae3c524301cc0433c30a5d83e8fb0fa9610a7881611b92565b6001600160a01b0384161580610a965750836001600160a01b031916155b15610ab45760405163d43a15d160e01b815260040160405180910390fd5b610af78787878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611b9c92505050565b50505050505050565b610b08611a99565b806001600160a01b031663d3b9fbe46040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b4357600080fd5b505af1158015610b57573d6000803e3d6000fd5b5050505050565b610b66611a99565b610b75600861ffff8416611eb6565b610b9857604051637d9160bf60e11b815261ffff831660048201526024016107d2565b6000610ba9600861ffff8516611ec2565b905081151560ff82901c151503610bd3576040516311be38db60e11b815260040160405180910390fd5b610bf061ffff8416610be7838560ff611e82565b60089190611ea9565b506040518215159061ffff8516907f58a8b6a02b964cca2712e5a71d7b0d564a56b4a0f573b4c47f389341ade14cfd90600090a3505050565b610c31611a99565b610c3c600b82611ece565b610c64576040516303ce0ad960e01b81526001600160a01b03821660048201526024016107d2565b6040516001600160a01b038216907f84cc2115995684dcb0cd3d3a9565e3d32f075de81db70c8dc3a719b2a47af67e90600090a250565b6060610ca76008611ee3565b905090565b6000610cbd600861ffff8416611eb6565b610ce057604051637d9160bf60e11b815261ffff831660048201526024016107d2565b6000610cf1600861ffff8516611ec2565b90506000610d076000546001600160a01b031690565b6001600160a01b0316336001600160a01b0316149050610d2682611a81565b158015610d31575080155b15610d5b576040516304fc2fe760e11b815233600482015261ffff851660248201526044016107d2565b610d66600b87611b70565b610d8e57604051638e888ef360e01b81526001600160a01b03871660048201526024016107d2565b856001600160a01b0316876001600160a01b031603610dcb57604051632f9b185360e01b81526001600160a01b03881660048201526024016107d2565b610dd58585611ef0565b50600080610de38989611f34565b90925090506001600160a01b038216610e0f57604051632573cfb960e21b815260040160405180910390fd5b6001600160a01b0382811660009081526007602090815260408083208585168452825280832061ffff8b1684529091529020546201000090041615610e845760405163cb27a43560e01b81526001600160a01b03808b1660048301528916602482015261ffff871660448201526064016107d2565b6005546001600160a01b031680610eae576040516328b4fcf960e21b815260040160405180910390fd5b6040516bffffffffffffffffffffffff1960608c811b821660208401528b901b1660348201527fffff00000000000000000000000000000000000000000000000000000000000060f089901b166048820152610f5b908290604a0160408051601f198184030181528282526001600160a01b03808916602085015287169183019190915261ffff8b1660608301529060800160405160208183030381529060405280519060200120611f5d565b6040805160808101825261ffff808b168083526001600160a01b0380861660208086018281528c15158789019081526000606089018181528e8716808352600786528b83208f89168085529087528c84208a855287528c84209b518c549651955193511515600160b81b0260ff60b81b19941515600160b01b02949094167fffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffff96909a1662010000027fffffffffffffffffffff000000000000000000000000000000000000000000009097169b169a909a179490941792909216959095171790965560068054600181019091557ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b031916909217909155938152600d8452848120928152919092529190912091975061109e9250612018565b508561ffff16886001600160a01b03168a6001600160a01b03167f2c8d104b27c6b7f4492017a6f5cf3803043688934ebcaa6a03540beeaf976aff8860016006805490506110ec9190612de8565b604080516001600160a01b03909316835260208301919091520160405180910390a4846001600160a01b03166347973bff61112686612024565b61112f87612030565b61113888612040565b61114189612050565b61114a8a612060565b6111538b612071565b61115c8c612081565b6040516001600160e01b031960e08a901b16815261ffff978816600482015295871660248701529386166044860152918516606485015262ffffff9081166084850152931660a4830152821660c4820152908a1660e482015261010401600060405180830381600087803b1580156111d357600080fd5b505af11580156111e7573d6000803e3d6000fd5b5050505050505050949350505050565b60606000806112068585611f34565b6001600160a01b038083166000908152600d60209081526040808320938516835292905290812092945090925061123c82612092565b90508015611385578067ffffffffffffffff81111561125d5761125d612d8d565b6040519080825280602002602001820160405280156112af57816020015b60408051608081018252600080825260208083018290529282018190526060820152825260001990920191018161127b5790505b506001600160a01b03808616600090815260076020908152604080832093881683529290529081209196505b828110156113825760006112f76112f28684611a8d565b61209c565b6040805160808101825261ffff831680825260008181526020888152848220546001600160a01b03620100008204168286015260ff600160b01b8204811615159686019690965292909152879052600160b81b90049091161515606082015289519192509089908490811061136e5761136e612da3565b6020908102919091010152506001016112db565b50505b5050505092915050565b611397611a99565b6000806113a48686611f34565b6001600160a01b0380831660009081526007602090815260408083208486168452825280832061ffff808c1685529083529281902081516080810183529054938416815262010000840490941691840182905260ff600160b01b84048116151591850191909152600160b81b909204909116151560608301529294509092509061145e5760405163102a919160e21b81526001600160a01b0380891660048301528716602482015261ffff861660448201526064016107d2565b831515816060015115150361148557604051626ee66560e11b815260040160405180910390fd5b6001600160a01b0380841660009081526007602090815260408083208685168452825280832061ffff8a1684528252918290208054881515600160b81b0260ff60b81b1990911617905583015190519116907f44cf35361c9ff3c8c1397ec6410d5495cc481feaef35c9af11da1a637107de4f9061150890871515815260200190565b60405180910390a250505050505050565b604080516080810182526000808252602082018190529181018290526060810191909152611548848484611ac6565b949350505050565b611558611a99565b61156260006120c6565b565b60015433906001600160a01b0316811461159c5760405163118cdaa760e01b81526001600160a01b03821660048201526024016107d2565b6115a5816120c6565b50565b6000600682815481106115bd576115bd612da3565b6000918252602090912001546001600160a01b031692915050565b6000610ca7600b612092565b60008261160257506000546001600160a01b03828116911614610686565b60008381526002602090815260408083206001600160a01b038616845290915290205460ff165b9392505050565b60008080808080808061164460088a611eb6565b61166457604051637d9160bf60e11b8152600481018a90526024016107d2565b600061167160088b611ec2565b905061167c81612024565b61ffff16985061168b81612030565b61ffff16975061169a81612040565b61ffff1696506116a981612050565b61ffff1695506116b881612060565b62ffffff1694506116c881612071565b61ffff1693506116d781612081565b62ffffff16925060ff81901c915050919395975091939597565b6116f9611a99565b306001600160a01b0316816001600160a01b03166388cc58e46040518163ffffffff1660e01b8152600401602060405180830381865afa158015611741573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117659190612dfb565b6001600160a01b03161461179757604051630a3e70af60e11b81526001600160a01b03821660048201526024016107d2565b6005546001600160a01b0390811690821681036117d257604051630ded3b9560e31b81526001600160a01b03831660048201526024016107d2565b600580546001600160a01b0319166001600160a01b0384811691821790925560408051928416835260208301919091527f900d0e3d359f50e4f923ecdc06b401e07dbb9f485e17b07bcfc91a13000b277e91015b60405180910390a15050565b60008281526002602052604090206001015461184d81611b92565b6108cf8383611d0d565b61185f611a99565b61186a600b826120df565b61189257604051638e888ef360e01b81526001600160a01b03821660048201526024016107d2565b6040516001600160a01b038216907f0b767739217755d8af5a2ba75b181a19fa1750f8bb701f09311cb19a90140cb390600090a250565b6118d1611a99565b6118e0600861ffff83166120f4565b61190357604051637d9160bf60e11b815261ffff821660048201526024016107d2565b60405161ffff8216907fdd86b848bb56ff540caa68683fa467d0e7eb5f8b2d44e4ee435742eeeae9be1390600090a250565b61193d611a99565b6115a581612100565b61194e611a99565b60045481810361197457604051631baa31e960e21b8152600481018390526024016107d2565b67016345785d8a00008211156119ae57604051635e8988c160e01b81526004810183905267016345785d8a000060248201526044016107d2565b600482905560408051828152602081018490527f5c34e91c94c78b662a45d0bd4a25a4e32c584c54a45a76e4a4d43be27ba40e509101611826565b6119f1611a99565b600180546001600160a01b0383166001600160a01b03199091168117909155611a226000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6000610686826121be565b6000808080611a7486866121c9565b9097909650945050505050565b600060ff82901c610686565b600061162983836121f4565b6000546001600160a01b031633146115625760405163118cdaa760e01b81523360048201526024016107d2565b604080516080810182526000808252602082018190529181018290526060810191909152611af48484611f34565b6001600160a01b03918216600090815260076020908152604080832093851683529281528282209582529485528190208151608081018352905461ffff811682526201000081049093169481019490945260ff600160b01b83048116151591850191909152600160b81b90910416151560608301525092915050565b6001600160a01b03811660009081526001830160205260408120541515611629565b6115a5813361221e565b6000611bad86868661ffff16611ac6565b6020015190506001600160a01b038116611bf75760405163b65ee95360e01b81526001600160a01b0380881660048301528616602482015261ffff851660448201526064016107d2565b82816001600160a01b031663781a89156040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5a9190612e18565b03611c7b5760405163b70cd0db60e01b8152600481018490526024016107d2565b604051631b057f6d60e01b81526001600160a01b03821690631b057f6d90611ca99086908690600401612e31565b600060405180830381600087803b158015611cc357600080fd5b505af1158015611cd7573d6000803e3d6000fd5b50505050505050505050565b600082611d0357604051633e3253cf60e11b815260040160405180910390fd5b611629838361225b565b6000611d1983836115e4565b15611d7a5760008381526002602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610686565b506000610686565b60008561ffff168761ffff161180611d9f5750610fff8661ffff16115b80611daf57506127108561ffff16115b80611dbf57506109c48361ffff16115b80611dd15750620fffff8262ffffff16115b15611def57604051631c07203f60e01b815260040160405180910390fd5b5060109590951b630fff00001661ffff9690961695909517601c9390931b64fff0000000169290921760289190911b663fff0000000000161760369190911b693fffffc00000000000001617604e9290921b6b0fffc00000000000000000001691909117605c9190911b6dfffff0000000000000000000000016176dffffffffffffffffffffffffffff19919091161790565b60006115488484611e94576000611e97565b60015b600180861b19929092169116841b1790565b60006115488484846122e7565b60006116298383612304565b60006116298383612310565b6000611629836001600160a01b038416612357565b606060006116298361239e565b600061271071ffff00000000000000000000000000000000608084901b1604600160801b0162ffffff8416627fffff1901611f2b82826123a9565b95945050505050565b600080826001600160a01b0316846001600160a01b03161115611f55579192915b509192909150565b600060408303516020840351845180602087010180516002830161ffca811115611f8f5763c8c781396000526004601cfd5b6c5af43d3d93803e603357fd5bf3895289600d8a03527d6100003d81600a3d39f3363d3d373d3d3d3d610000806035363936013d738160481b176035820160d81b1760218a03528060f01b835287603f8201601f8b036000f596505085611ffe5763301164256000526004601cfd5b90528552601f19850152603f199093019290925250919050565b60006116298383612357565b600061ffff8216610686565b60006106868260101c610fff1690565b600061068682601c1c610fff1690565b60006106868260281c613fff1690565b60006106868260361c62ffffff1690565b600061068682604e1c613fff1690565b600061068682605c1c620fffff1690565b6000610686825490565b8061ffff811681146120c1576040516364ae406d60e01b815260040160405180910390fd5b919050565b600180546001600160a01b03191690556115a581612612565b6000611629836001600160a01b038416612662565b60006116298383612755565b6001600160a01b03811661212757604051632573cfb960e21b815260040160405180910390fd5b6003546001600160a01b03908116908216810361216657600354604051634fcea97160e01b81526001600160a01b0390911660048201526024016107d2565b600380546001600160a01b0319166001600160a01b0384811691821790925560408051928416835260208301919091527f15d80a013f22151bc7246e3bc132e12828cde19de98870475e3fa708401527219101611826565b600061068682612092565b600080806121d78585611a8d565b600081815260029690960160205260409095205494959350505050565b600082600001828154811061220b5761220b612da3565b9060005260206000200154905092915050565b61222882826115e4565b6122575760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016107d2565b5050565b600061226783836115e4565b611d7a5760008381526002602090815260408083206001600160a01b03861684529091529020805460ff1916600117905561229f3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610686565b600082815260028401602052604081208290556115488484612018565b60006116298383612772565b60008181526002830160205260408120548015801561233657506123348484612304565b155b156116295760405163015ab34360e11b8152600481018490526024016107d2565b6000818152600183016020526040812054611d7a57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610686565b60606106868261278a565b6000806000836000036123c55750600160801b91506106869050565b508260008112156123d7579015906000035b621000008110156125d057600160801b9250846fffffffffffffffffffffffffffffffff81111561240a57911591600019045b600182161561241b5792830260801c925b800260801c60028216156124315792830260801c925b800260801c60048216156124475792830260801c925b800260801c600882161561245d5792830260801c925b800260801c60108216156124735792830260801c925b800260801c60208216156124895792830260801c925b800260801c604082161561249f5792830260801c925b8002608090811c908216156124b65792830260801c925b800260801c6101008216156124cd5792830260801c925b800260801c6102008216156124e45792830260801c925b800260801c6104008216156124fb5792830260801c925b800260801c6108008216156125125792830260801c925b800260801c6110008216156125295792830260801c925b800260801c6120008216156125405792830260801c925b800260801c6140008216156125575792830260801c925b800260801c61800082161561256e5792830260801c925b800260801c620100008216156125865792830260801c925b800260801c6202000082161561259e5792830260801c925b800260801c620400008216156125b65792830260801c925b800260801c620800008216156125ce5792830260801c925b505b826000036125fb57604051631dba598d60e11b815260048101869052602481018590526044016107d2565b816126065782611f2b565b611f2b83600019612e87565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000818152600183016020526040812054801561274b576000612686600183612de8565b855490915060009061269a90600190612de8565b90508082146126ff5760008660000182815481106126ba576126ba612da3565b90600052602060002001549050808760000184815481106126dd576126dd612da3565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061271057612710612ea9565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610686565b6000915050610686565b600081815260028301602052604081208190556116298383612797565b60008181526001830160205260408120541515611629565b60606000611629836127a3565b60006116298383612662565b6060816000018054806020026020016040519081016040528092919081815260200182805480156127f357602002820191906000526020600020905b8154815260200190600101908083116127df575b50505050509050919050565b60006020828403121561281157600080fd5b81356001600160e01b03198116811461162957600080fd5b6020808252825182820181905260009190848201906040850190845b8181101561286157835183529284019291840191600101612845565b50909695505050505050565b60006020828403121561287f57600080fd5b5035919050565b6001600160a01b03811681146115a557600080fd5b803561ffff811681146120c157600080fd5b803562ffffff811681146120c157600080fd5b6000806000806000806000806000806101408b8d0312156128e057600080fd5b8a356128eb81612886565b995060208b01356128fb81612886565b985061290960408c0161289b565b975061291760608c0161289b565b965061292560808c0161289b565b955061293360a08c0161289b565b945061294160c08c0161289b565b935061294f60e08c016128ad565b925061295e6101008c0161289b565b915061296d6101208c016128ad565b90509295989b9194979a5092959850565b60006020828403121561299057600080fd5b813561162981612886565b6000806000606084860312156129b057600080fd5b83356129bb81612886565b925060208401356129cb81612886565b91506129d96040850161289b565b90509250925092565b600080604083850312156129f557600080fd5b823591506020830135612a0781612886565b809150509250929050565b803580151581146120c157600080fd5b60008060008060008060008060006101208a8c031215612a4157600080fd5b612a4a8a61289b565b9850612a5860208b0161289b565b9750612a6660408b0161289b565b9650612a7460608b0161289b565b9550612a8260808b0161289b565b9450612a9060a08b016128ad565b9350612a9e60c08b0161289b565b9250612aac60e08b016128ad565b9150612abb6101008b01612a12565b90509295985092959850929598565b60008060008060008060a08789031215612ae357600080fd5b8635612aee81612886565b95506020870135612afe81612886565b9450612b0c6040880161289b565b935060608701359250608087013567ffffffffffffffff80821115612b3057600080fd5b818901915089601f830112612b4457600080fd5b813581811115612b5357600080fd5b8a6020828501011115612b6557600080fd5b6020830194508093505050509295509295509295565b60008060408385031215612b8e57600080fd5b612b978361289b565b9150612ba560208401612a12565b90509250929050565b60008060008060808587031215612bc457600080fd5b8435612bcf81612886565b93506020850135612bdf81612886565b9250612bed604086016128ad565b9150612bfb6060860161289b565b905092959194509250565b60008060408385031215612c1957600080fd5b8235612c2481612886565b91506020830135612a0781612886565b6020808252825182820181905260009190848201906040850190845b8181101561286157612c9583855161ffff81511682526001600160a01b0360208201511660208301526040810151151560408301526060810151151560608301525050565b9284019260809290920191600101612c50565b60008060008060808587031215612cbe57600080fd5b8435612cc981612886565b93506020850135612cd981612886565b9250612ce76040860161289b565b9150612bfb60608601612a12565b600080600060608486031215612d0a57600080fd5b8335612d1581612886565b92506020840135612d2581612886565b929592945050506040919091013590565b815161ffff1681526020808301516001600160a01b03169082015260408083015115159082015260608083015115159082015260808101610686565b600060208284031215612d8457600080fd5b6116298261289b565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612de157612de1612db9565b5060010190565b8181038181111561068657610686612db9565b600060208284031215612e0d57600080fd5b815161162981612886565b600060208284031215612e2a57600080fd5b5051919050565b82815260006020604081840152835180604085015260005b81811015612e6557858101830151858201606001528201612e49565b506000606082860101526060601f19601f830116850101925050509392505050565b600082612ea457634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fdfea26469706673582212204d4599d4f319681bcc0ab1ad8a7491658f81ea33d082fe0961f0948dd9a32e0b64736f6c63430008140033
| Token | Symbol | Balance | Price | Value |
|---|---|---|---|---|
| DIH | 1 | $0.0000102 | $0 |
| Type | Age | Block | Details |
|---|---|---|---|
| no cross-chain L1↔L2 transactions for this address | |||
| Transaction Hash | Method | Block | Age | From | To | Amount | Token | ||
|---|---|---|---|---|---|---|---|---|---|
| 0xc453c844…73200c | Transfer | 19,053,583 | 22 days agoSat, 25 Jul 2026 13:41:46 UTC | 0xcaf7…5d11 | IN | 0x2260…fe1b | $0.001 DIH |
| Transaction Hash | Method | Block | Age | From | To | Type | Item | ||
|---|---|---|---|---|---|---|---|---|---|
| no NFT transfers for this address yet | |||||||||
| Txn Hash | Age | Event | Topics / Data |
|---|---|---|---|
| 0xa97cc6…e47c43 | 3 days agoThu, 13 Aug 2026 09:56:44 UTC | 0x2c8d10…6aff | [0] 0x000000000000…87710565 [1] 0x000000000000…1eacad73 [2] 0x000000000000…000001f4 data: 0x000000000000000000…0000000b |
| 0x195273…a88034 | 27 days agoMon, 20 Jul 2026 16:53:30 UTC | 0x2c8d10…6aff | [0] 0x000000000000…cd17b4a1 [1] 0x000000000000…1eacad73 [2] 0x000000000000…000001f4 data: 0x000000000000000000…0000000a |
| 0xcf00fe…e20857 | 27 days agoMon, 20 Jul 2026 16:47:03 UTC | 0x2c8d10…6aff | [0] 0x000000000000…cd17b4a1 [1] 0x000000000000…1eacad73 [2] 0x000000000000…0000000a data: 0x000000000000000000…00000009 |
| 0xb8ecd6…c45be9 | 32 days agoWed, 15 Jul 2026 12:07:03 UTC | 0x2c8d10…6aff | [0] 0x000000000000…907d12f6 [1] 0x000000000000…1eacad73 [2] 0x000000000000…000000c8 data: 0x000000000000000000…00000008 |
| 0xe353e5…48e2ad | 32 days agoWed, 15 Jul 2026 11:31:37 UTC | 0x2c8d10…6aff | [0] 0x000000000000…178bc987 [1] 0x000000000000…1eacad73 [2] 0x000000000000…000000c8 data: 0x000000000000000000…00000007 |
| 0x472617…773048 | 34 days agoMon, 13 Jul 2026 18:40:30 UTC | 0x2c8d10…6aff | [0] 0x000000000000…cd3d9c31 [1] 0x000000000000…1eacad73 [2] 0x000000000000…00000019 data: 0x000000000000000000…00000006 |
| 0x536891…a784a9 | 34 days agoMon, 13 Jul 2026 12:03:32 UTC | 0x2c8d10…6aff | [0] 0x000000000000…291018b4 [1] 0x000000000000…1eacad73 [2] 0x000000000000…00000019 data: 0x000000000000000000…00000005 |
| 0xa5adf8…78d5d6 | 34 days agoMon, 13 Jul 2026 08:39:19 UTC | 0x2c8d10…6aff | [0] 0x000000000000…3fc23f1c [1] 0x000000000000…1eacad73 [2] 0x000000000000…000000c8 data: 0x000000000000000000…00000004 |
| 0x029c48…672826 | 34 days agoMon, 13 Jul 2026 08:38:58 UTC | 0x2c8d10…6aff | [0] 0x000000000000…b5f08d5e [1] 0x000000000000…1eacad73 [2] 0x000000000000…000000c8 data: 0x000000000000000000…00000003 |
| 0x52a8f2…5461fe | 35 days agoSun, 12 Jul 2026 17:39:48 UTC | 0x58a8b6…4cfd | [0] 0x000000000000…000001f4 [1] 0x000000000000…00000001 |
| 0x52a8f2…5461fe | 35 days agoSun, 12 Jul 2026 17:39:48 UTC | 0x839844…6a28 | [0] 0x000000000000…000001f4 data: 0x000000000000000000…000249f0 |
| 0xeb17a5…acb1b4 | 35 days agoSun, 12 Jul 2026 17:39:42 UTC | 0x58a8b6…4cfd | [0] 0x000000000000…000000c8 [1] 0x000000000000…00000001 |
| 0xeb17a5…acb1b4 | 35 days agoSun, 12 Jul 2026 17:39:42 UTC | 0x839844…6a28 | [0] 0x000000000000…000000c8 data: 0x000000000000000000…0003d090 |
| 0x3dd8f6…6e4468 | 35 days agoSun, 12 Jul 2026 12:36:45 UTC | 0x2c8d10…6aff | [0] 0x000000000000…291018b4 [1] 0x000000000000…1eacad73 [2] 0x000000000000…00000064 data: 0x000000000000000000…00000002 |
| 0x67ba28…74311d | 35 days agoSun, 12 Jul 2026 12:34:54 UTC | 0x2c8d10…6aff | [0] 0x000000000000…a424319e [1] 0x000000000000…1eacad73 [2] 0x000000000000…00000064 data: 0x000000000000000000…00000001 |
| 0xc5693e…64d218 | 35 days agoSun, 12 Jul 2026 08:06:29 UTC | 0x2c8d10…6aff | [0] 0x000000000000…9f043b88 [1] 0x000000000000…1eacad73 [2] 0x000000000000…00000064 data: 0x000000000000000000…00000000 |
| 0xa1946d…2f376d | 35 days agoSun, 12 Jul 2026 07:44:54 UTC | 0x58a8b6…4cfd | [0] 0x000000000000…00000064 [1] 0x000000000000…00000001 |
| 0xa1946d…2f376d | 35 days agoSun, 12 Jul 2026 07:44:54 UTC | 0x839844…6a28 | [0] 0x000000000000…00000064 data: 0x000000000000000000…000493e0 |
| 0x6f6e11…979dfd | 35 days agoSun, 12 Jul 2026 07:44:51 UTC | 0x58a8b6…4cfd | [0] 0x000000000000…00000032 [1] 0x000000000000…00000001 |
| 0x6f6e11…979dfd | 35 days agoSun, 12 Jul 2026 07:44:51 UTC | 0x839844…6a28 | [0] 0x000000000000…00000032 data: 0x000000000000000000…00055730 |
| 0xeb1a45…c4d595 | 35 days agoSun, 12 Jul 2026 07:44:48 UTC | 0x58a8b6…4cfd | [0] 0x000000000000…00000019 [1] 0x000000000000…00000001 |
| 0xeb1a45…c4d595 | 35 days agoSun, 12 Jul 2026 07:44:48 UTC | 0x839844…6a28 | [0] 0x000000000000…00000019 data: 0x000000000000000000…00055730 |
| 0xa12b0b…c2661a | 35 days agoSun, 12 Jul 2026 07:44:45 UTC | 0x58a8b6…4cfd | [0] 0x000000000000…00000014 [1] 0x000000000000…00000000 |
| 0xa12b0b…c2661a | 35 days agoSun, 12 Jul 2026 07:44:45 UTC | 0x839844…6a28 | [0] 0x000000000000…00000014 data: 0x000000000000000000…00055730 |
| 0xf335b0…d342d4 | 35 days agoSun, 12 Jul 2026 07:44:42 UTC | 0x58a8b6…4cfd | [0] 0x000000000000…0000000a [1] 0x000000000000…00000001 |
| Transaction Hash | Method ? | Block | Age | From | To | Amount | Txn Fee ? | ||
|---|---|---|---|---|---|---|---|---|---|
| 0xa97cc6…e47c43 | createLBPair | 35,299,753 | 3 days agoThu, 13 Aug 2026 09:56:44 UTC | 0x4e84…b1bc | IN | LBFactory | $0.000 ETH | 0.00001341 | |
| 0x195273…a88034 | createLBPair | 14,859,820 | 27 days agoMon, 20 Jul 2026 16:53:30 UTC | 0x7ca2…39a8 | IN | LBFactory | $0.000 ETH | 0.00001414 | |
| 0xcf00fe…e20857 | createLBPair | 14,855,954 | 27 days agoMon, 20 Jul 2026 16:47:03 UTC | 0x61fb…69f0 | IN | LBFactory | $0.000 ETH | 0.00001504 | |
| 0xb8ecd6…c45be9 | createLBPair | 10,380,084 | 32 days agoWed, 15 Jul 2026 12:07:03 UTC | 0x7ca2…39a8 | IN | LBFactory | $0.000 ETH | 0.00001643 | |
| 0xe353e5…48e2ad | createLBPair | 10,358,849 | 32 days agoWed, 15 Jul 2026 11:31:37 UTC | 0x7ca2…39a8 | IN | LBFactory | $0.000 ETH | 0.00001641 | |
| 0x472617…773048 | createLBPair | 8,890,229 | 34 days agoMon, 13 Jul 2026 18:40:30 UTC | 0x7ca2…39a8 | IN | LBFactory | $0.000 ETH | 0.00001461 | |
| 0x536891…a784a9 | createLBPair | 8,652,420 | 34 days agoMon, 13 Jul 2026 12:03:32 UTC | 0x7ca2…39a8 | IN | LBFactory | $0.000 ETH | 0.00001303 | |
| 0xa5adf8…78d5d6 | createLBPair | 8,530,093 | 34 days agoMon, 13 Jul 2026 08:39:19 UTC | 0x7ca2…39a8 | IN | LBFactory | $0.000 ETH | 0.00001415 | |
| 0x029c48…672826 | createLBPair | 8,529,886 | 34 days agoMon, 13 Jul 2026 08:38:58 UTC | 0x7ca2…39a8 | IN | LBFactory | $0.000 ETH | 0.00001416 | |
| 0x52a8f2…5461fe | setPreset | 7,991,537 | 35 days agoSun, 12 Jul 2026 17:39:48 UTC | 0xda8d…de5b | IN | LBFactory | $0.000 ETH | 0.00000563 | |
| 0xeb17a5…acb1b4 | setPreset | 7,991,480 | 35 days agoSun, 12 Jul 2026 17:39:42 UTC | 0xda8d…de5b | IN | LBFactory | $0.000 ETH | 0.00000559 | |
| 0x3dd8f6…6e4468 | createLBPair | 7,809,988 | 35 days agoSun, 12 Jul 2026 12:36:45 UTC | 0x7ca2…39a8 | IN | LBFactory | $0.000 ETH | 0.00001487 | |
| 0x67ba28…74311d | createLBPair | 7,808,888 | 35 days agoSun, 12 Jul 2026 12:34:54 UTC | 0x7ca2…39a8 | IN | LBFactory | $0.000 ETH | 0.00001499 | |
| 0xc5693e…64d218 | createLBPair | 7,648,278 | 35 days agoSun, 12 Jul 2026 08:06:29 UTC | 0x7ca2…39a8 | IN | LBFactory | $0.000 ETH | 0.00001640 | |
| 0xa1946d…2f376d | setPreset | 7,635,383 | 35 days agoSun, 12 Jul 2026 07:44:54 UTC | 0xda8d…de5b | IN | LBFactory | $0.000 ETH | 0.00000210 | |
| 0x6f6e11…979dfd | setPreset | 7,635,353 | 35 days agoSun, 12 Jul 2026 07:44:51 UTC | 0xda8d…de5b | IN | LBFactory | $0.000 ETH | 0.00000210 | |
| 0xeb1a45…c4d595 | setPreset | 7,635,322 | 35 days agoSun, 12 Jul 2026 07:44:48 UTC | 0xda8d…de5b | IN | LBFactory | $0.000 ETH | 0.00000212 | |
| 0xa12b0b…c2661a | setPreset | 7,635,292 | 35 days agoSun, 12 Jul 2026 07:44:45 UTC | 0xda8d…de5b | IN | LBFactory | $0.000 ETH | 0.00000209 | |
| 0xf335b0…d342d4 | setPreset | 7,635,262 | 35 days agoSun, 12 Jul 2026 07:44:42 UTC | 0xda8d…de5b | IN | LBFactory | $0.000 ETH | 0.00000210 | |
| 0x40a3c4…a82f6f | setPreset | 7,635,231 | 35 days agoSun, 12 Jul 2026 07:44:39 UTC | 0xda8d…de5b | IN | LBFactory | $0.000 ETH | 0.00000209 | |
| 0x0f6a26…0b23f1 | setFeeRecipient | 7,634,824 | 35 days agoSun, 12 Jul 2026 07:43:59 UTC | 0xda8d…de5b | IN | LBFactory | $0.000 ETH | 0.00000167 | |
| 0x595716…d95217 | setPreset | 7,297,331 | 36 days agoSat, 11 Jul 2026 22:20:01 UTC | 0xda8d…de5b | IN | LBFactory | $0.000 ETH | 0.00000619 | |
| 0x994396…75f73c | addQuoteAsset | 7,297,331 | 36 days agoSat, 11 Jul 2026 22:20:01 UTC | 0xda8d…de5b | IN | LBFactory | $0.000 ETH | 0.00000554 | |
| 0xd807cb…729779 | setPreset | 7,297,331 | 36 days agoSat, 11 Jul 2026 22:20:01 UTC | 0xda8d…de5b | IN | LBFactory | $0.000 ETH | 0.00000722 | |
| 0xe76cdd…52fc9c | setPreset | 7,297,331 | 36 days agoSat, 11 Jul 2026 22:20:01 UTC | 0xda8d…de5b | IN | LBFactory | $0.000 ETH | 0.00000620 |
| Block | Age | Parent Transaction Hash | Type | Method | From | To | Value | |
|---|---|---|---|---|---|---|---|---|
| 35,299,753 | 3 days agoThu, 13 Aug 2026 09:56:44 UTC | 0xa97cc6…e47c43 | CREATE2 | createLBPair | 0x2260…fe1b | OUT | 0x27db…cacb | 0 ETH |
| 14,859,820 | 27 days agoMon, 20 Jul 2026 16:53:30 UTC | 0x195273…a88034 | CREATE2 | createLBPair | 0x2260…fe1b | OUT | 0xb1d1…eb21 | 0 ETH |
| 14,855,954 | 27 days agoMon, 20 Jul 2026 16:47:03 UTC | 0xcf00fe…e20857 | CREATE2 | createLBPair | 0x2260…fe1b | OUT | 0x05cd…9fec | 0 ETH |
| 10,380,084 | 32 days agoWed, 15 Jul 2026 12:07:03 UTC | 0xb8ecd6…c45be9 | CREATE2 | createLBPair | 0x2260…fe1b | OUT | 0x6aef…06f9 | 0 ETH |
| 10,358,849 | 32 days agoWed, 15 Jul 2026 11:31:37 UTC | 0xe353e5…48e2ad | CREATE2 | createLBPair | 0x2260…fe1b | OUT | 0x1dc5…765c | 0 ETH |