Overview
ETH Balance
ETH Value
$0.00Multichain Info
Latest 25 from a total of 114 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Nft Settings | 12483899 | 17 hrs ago | IN | 0 ETH | 0.00000161 | ||||
Unset Nft Settin... | 12140311 | 4 days ago | IN | 0 ETH | 0.00000142 | ||||
Set Nft Settings | 12140267 | 4 days ago | IN | 0 ETH | 0.00000151 | ||||
Set Nft Settings | 11986431 | 6 days ago | IN | 0 ETH | 0.00000215 | ||||
Set Nft Settings | 11983785 | 6 days ago | IN | 0 ETH | 0.00000135 | ||||
Set Nft Settings | 11983600 | 6 days ago | IN | 0 ETH | 0.00000135 | ||||
Set Nft Settings | 11930580 | 7 days ago | IN | 0 ETH | 0.00000135 | ||||
Set Nft Settings | 11929656 | 7 days ago | IN | 0 ETH | 0.00000147 | ||||
Set Nft Settings | 11904859 | 7 days ago | IN | 0 ETH | 0.00000163 | ||||
Set Nft Settings | 11869055 | 7 days ago | IN | 0 ETH | 0.00000135 | ||||
Set Nft Settings | 11859839 | 7 days ago | IN | 0 ETH | 0.00000164 | ||||
Set Nft Settings | 11846914 | 8 days ago | IN | 0 ETH | 0.00000135 | ||||
Set Nft Settings | 11846903 | 8 days ago | IN | 0 ETH | 0.00000135 | ||||
Set Nft Settings | 11689937 | 9 days ago | IN | 0 ETH | 0.00000163 | ||||
Set Nft Settings | 11644565 | 10 days ago | IN | 0 ETH | 0.00000135 | ||||
Set Nft Settings | 11644542 | 10 days ago | IN | 0 ETH | 0.00000135 | ||||
Set Nft Settings | 11604184 | 10 days ago | IN | 0 ETH | 0.00000135 | ||||
Set Nft Settings | 11604067 | 10 days ago | IN | 0 ETH | 0.00000135 | ||||
Set Nft Settings | 11465842 | 12 days ago | IN | 0 ETH | 0.00000163 | ||||
Set Nft Settings | 11434233 | 12 days ago | IN | 0 ETH | 0.00000172 | ||||
Set Nft Settings | 11434147 | 12 days ago | IN | 0 ETH | 0.00000183 | ||||
Set Nft Settings | 11266694 | 14 days ago | IN | 0 ETH | 0.0000015 | ||||
Set Nft Settings | 11266677 | 14 days ago | IN | 0 ETH | 0.00000145 | ||||
Set Nft Settings | 11266644 | 14 days ago | IN | 0 ETH | 0.00000145 | ||||
Set Nft Settings | 11260397 | 14 days ago | IN | 0 ETH | 0.0000015 |
Latest 25 internal transactions (View All)
Parent Transaction Hash | Block | From | To | ||||
---|---|---|---|---|---|---|---|
12540092 | 1 hr ago | 0 ETH | |||||
12534657 | 2 hrs ago | 0 ETH | |||||
12534657 | 2 hrs ago | 0 ETH | |||||
12534657 | 2 hrs ago | 0 ETH | |||||
12534657 | 2 hrs ago | 0 ETH | |||||
12521058 | 6 hrs ago | 0 ETH | |||||
12521058 | 6 hrs ago | 0 ETH | |||||
12521058 | 6 hrs ago | 0 ETH | |||||
12521058 | 6 hrs ago | 0 ETH | |||||
12521058 | 6 hrs ago | 0 ETH | |||||
12521058 | 6 hrs ago | 0 ETH | |||||
12521058 | 6 hrs ago | 0 ETH | |||||
12521058 | 6 hrs ago | 0 ETH | |||||
12521058 | 6 hrs ago | 0 ETH | |||||
12521058 | 6 hrs ago | 0 ETH | |||||
12521058 | 6 hrs ago | 0 ETH | |||||
12518802 | 7 hrs ago | 0 ETH | |||||
12518802 | 7 hrs ago | 0 ETH | |||||
12518802 | 7 hrs ago | 0 ETH | |||||
12518802 | 7 hrs ago | 0 ETH | |||||
12514527 | 8 hrs ago | 0 ETH | |||||
12514527 | 8 hrs ago | 0 ETH | |||||
12514527 | 8 hrs ago | 0 ETH | |||||
12514527 | 8 hrs ago | 0 ETH | |||||
12514527 | 8 hrs ago | 0 ETH |
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { IUniswapV3Pool } from "contracts/interfaces/external/uniswap/IUniswapV3Pool.sol"; import { INonfungiblePositionManager } from "contracts/interfaces/external/uniswap/INonfungiblePositionManager.sol"; import { Sickle } from "contracts/Sickle.sol"; import { INftLiquidityConnector, NftPositionInfo, NftPoolInfo } from "contracts/interfaces/INftLiquidityConnector.sol"; import { INftSettingsRegistry } from "contracts/interfaces/INftSettingsRegistry.sol"; import { RewardBehavior, RewardConfig } from "contracts/structs/PositionSettingsStructs.sol"; import { NftKey, NftSettings, ExitConfig, RebalanceConfig } from "contracts/structs/NftSettingsStructs.sol"; import { SickleFactory } from "contracts/SickleFactory.sol"; import { ConnectorRegistry } from "contracts/ConnectorRegistry.sol"; import { TimelockAdmin } from "contracts/base/TimelockAdmin.sol"; struct PreviousNftSettings { IUniswapV3Pool pool; bool autoRebalance; RebalanceConfig rebalanceConfig; bool automateRewards; RewardConfig rewardConfig; bool autoExit; ExitConfig exitConfig; } interface IPreviousNftSettingsRegistry { function getNftSettings( NftKey memory key ) external view returns (PreviousNftSettings memory); } contract NftSettingsRegistry is TimelockAdmin, INftSettingsRegistry { uint256 constant MAX_SLIPPAGE_BP = 500; uint256 constant MAX_PRICE_IMPACT_BP = 5000; uint256 constant MAX_DUST_BP = 5000; int24 constant MAX_TICK = 887_272; int24 constant MIN_TICK = -MAX_TICK; SickleFactory public immutable factory; ConnectorRegistry private _connectorRegistry; constructor( SickleFactory _factory, ConnectorRegistry connectorRegistry, address timelockAdmin ) TimelockAdmin(timelockAdmin) { factory = _factory; _connectorRegistry = connectorRegistry; emit ConnectionRegistrySet(address(connectorRegistry)); } mapping(bytes32 => NftSettings) settingsMap; /* Timelock functions */ function setConnectorRegistry( ConnectorRegistry connectorRegistry ) external onlyTimelockAdmin { _connectorRegistry = connectorRegistry; emit ConnectionRegistrySet(address(connectorRegistry)); } /* Public functions */ function getNftSettings( NftKey memory key ) public view returns (NftSettings memory) { return settingsMap[keccak256(abi.encode(key))]; } function validateHarvestFor( NftKey memory key ) public view { NftSettings memory settings = getNftSettings(key); if ( !settings.automateRewards || settings.rewardConfig.rewardBehavior != RewardBehavior.Harvest ) { revert AutoHarvestNotSet(); } } function validateCompoundFor( NftKey memory key ) public view { NftSettings memory settings = getNftSettings(key); if ( !settings.automateRewards || settings.rewardConfig.rewardBehavior != RewardBehavior.Compound ) { revert AutoCompoundNotSet(); } } // @notice Validate that a rebalanceFor meets the user requirements function validateRebalanceFor( NftKey memory key ) public view { NftSettings memory settings = getNftSettings(key); RebalanceConfig memory config = settings.rebalanceConfig; if (!settings.autoRebalance) { revert AutoRebalanceNotSet(); } if (config.cutoffTickLow == 0) { revert RebalanceConfigNotSet(); } INftLiquidityConnector connector = INftLiquidityConnector( _connectorRegistry.connectorOf(address(key.nftManager)) ); NftPositionInfo memory positionInfo = connector.positionInfo(address(key.nftManager), key.tokenId); NftPoolInfo memory poolInfo = connector.poolInfo(address(settings.pool), settings.poolId); if ( poolInfo.tick >= positionInfo.tickLower - int24(config.bufferTicksBelow) && poolInfo.tick < positionInfo.tickUpper + int24(config.bufferTicksAbove) ) { revert TickWithinRange(); } if ( poolInfo.tick <= config.cutoffTickLow || poolInfo.tick >= config.cutoffTickHigh ) { revert TickOutsideStopLossRange(); } } function validateExitFor( NftKey memory key ) public view { NftSettings memory settings = getNftSettings(key); ExitConfig memory config = settings.exitConfig; if (!settings.autoExit) { revert AutoExitNotSet(); } INftLiquidityConnector connector = INftLiquidityConnector( _connectorRegistry.connectorOf(address(key.nftManager)) ); NftPoolInfo memory poolInfo = connector.poolInfo(address(settings.pool), settings.poolId); if ( poolInfo.tick >= config.triggerTickLow && poolInfo.tick < config.triggerTickHigh ) { revert TickWithinRange(); } } /* Sickle Owner functions */ function setNftSettings( INonfungiblePositionManager nftManager, uint256 tokenId, NftSettings calldata settings ) external { Sickle sickle = _getSickleByOwner(msg.sender); NftKey memory key = NftKey({ sickle: sickle, nftManager: nftManager, tokenId: tokenId }); _setNftSettings(key, settings); } function unsetNftSettings( INonfungiblePositionManager nftManager, uint256 tokenId ) external { Sickle sickle = _getSickleByOwner(msg.sender); NftKey memory key = NftKey({ sickle: sickle, nftManager: nftManager, tokenId: tokenId }); _unsetNftSettings(key); } function migrateNftSettings( IPreviousNftSettingsRegistry previousNftSettingsRegistry, INonfungiblePositionManager nftManager, uint256[] memory tokenIds ) external { Sickle sickle = _getSickleByOwner(msg.sender); uint256 tokenLength = tokenIds.length; for (uint256 i; i < tokenLength; i++) { NftKey memory key = NftKey({ sickle: sickle, nftManager: nftManager, tokenId: tokenIds[i] }); PreviousNftSettings memory previousSettings = previousNftSettingsRegistry.getNftSettings(key); NftSettings memory settings = NftSettings({ pool: previousSettings.pool, poolId: bytes32(0), // Uniswap V4 only, not used by previous NFT // settings autoRebalance: previousSettings.autoRebalance, rebalanceConfig: previousSettings.rebalanceConfig, automateRewards: previousSettings.automateRewards, rewardConfig: previousSettings.rewardConfig, autoExit: previousSettings.autoExit, exitConfig: previousSettings.exitConfig, extraData: "" }); _setNftSettings(key, settings); } } /* Sickle functions */ function setNftSettings( NftKey calldata key, NftSettings calldata settings ) external { Sickle sickle = Sickle(payable(msg.sender)); if (key.sickle != sickle) { revert OnlySickle(); } _setNftSettings(key, settings); } // @notice Transfer NFT settings from the old NFT to the new one during a // rebalance. function transferNftSettings( NftKey calldata oldKey, NftSettings calldata settings ) external { Sickle sickle = Sickle(payable(msg.sender)); if (oldKey.sickle != sickle) { revert OnlySickle(); } INftLiquidityConnector connector = INftLiquidityConnector( _connectorRegistry.connectorOf(address(oldKey.nftManager)) ); uint256 newTokenId = connector.getTokenId(address(oldKey.nftManager), msg.sender); NftKey memory newKey = NftKey({ sickle: sickle, nftManager: oldKey.nftManager, tokenId: newTokenId }); if (newTokenId == oldKey.tokenId) { revert TokenIdUnchanged(); } _unsetNftSettings(oldKey); _setNftSettings(newKey, settings); } /* Modifiers */ modifier checkConfigValues(NftKey memory key, NftSettings memory settings) { if (address(key.nftManager) == address(0)) { revert InvalidNftManager(); } if (settings.autoRebalance) { _checkRebalanceConfig(settings.rebalanceConfig); _checkTickWidth(key, settings); } else { if ( settings.rebalanceConfig.cutoffTickLow != 0 || settings.rebalanceConfig.cutoffTickHigh != 0 ) { revert AutoRebalanceNotSet(); } } if ( settings.rewardConfig.rewardBehavior != RewardBehavior.Harvest && settings.rewardConfig.harvestTokenOut != address(0) ) { revert InvalidTokenOut(); } if (settings.autoExit) { _checkExitConfig(settings.exitConfig); } else { if ( settings.exitConfig.triggerTickLow != 0 || settings.exitConfig.triggerTickHigh != 0 || settings.exitConfig.exitTokenOutLow != address(0) || settings.exitConfig.exitTokenOutHigh != address(0) || settings.exitConfig.slippageBP != 0 || settings.exitConfig.priceImpactBP != 0 ) { revert AutoExitNotSet(); } } _; } /* Internal */ function _getSickleByOwner( address owner ) internal view returns (Sickle) { address sickle = factory.sickles(owner); if (sickle == address(0)) { revert SickleNotDeployed(); } return Sickle(payable(sickle)); } function _setNftSettings( NftKey memory key, NftSettings memory settings ) internal checkConfigValues(key, settings) { settingsMap[keccak256(abi.encode(key))] = settings; emit NftSettingsSet(key, settings); } function _unsetNftSettings( NftKey memory key ) internal { delete settingsMap[keccak256(abi.encode(key))]; emit NftSettingsUnset(key); } // @dev Check configuration parameters for errors function _checkRebalanceConfig( RebalanceConfig memory config ) internal pure { if (config.cutoffTickLow < MIN_TICK) { revert InvalidMinTickLow(); } if (config.cutoffTickLow >= config.cutoffTickHigh) { revert InvalidMinMaxTickRange(); } if (config.cutoffTickHigh > MAX_TICK) { revert InvalidMaxTickHigh(); } if ( config.bufferTicksAbove > 2 * MAX_TICK || config.bufferTicksAbove < 2 * MIN_TICK ) { revert InvalidBufferTicksAbove(); } if ( config.bufferTicksBelow > 2 * MAX_TICK || config.bufferTicksBelow < 2 * MIN_TICK ) { revert InvalidBufferTicksBelow(); } if (config.slippageBP > MAX_SLIPPAGE_BP) { revert InvalidSlippageBP(); } if ( config.priceImpactBP > MAX_PRICE_IMPACT_BP || config.priceImpactBP == 0 ) { revert InvalidPriceImpactBP(); } if (config.dustBP > MAX_DUST_BP || config.dustBP == 0) { revert InvalidDustBP(); } if ( config.rewardConfig.rewardBehavior != RewardBehavior.Harvest && config.rewardConfig.harvestTokenOut != address(0) ) { revert InvalidTokenOut(); } } function _checkExitConfig( ExitConfig memory config ) internal pure { if (config.triggerTickLow == 0 && config.triggerTickHigh == 0) { revert ExitTriggersNotSet(); } if ( config.triggerTickLow >= config.triggerTickHigh || config.triggerTickLow < MIN_TICK || config.triggerTickHigh > MAX_TICK ) { revert InvalidExitTriggers(); } if (config.slippageBP > MAX_SLIPPAGE_BP) { revert InvalidSlippageBP(); } if ( config.priceImpactBP > MAX_PRICE_IMPACT_BP || config.priceImpactBP == 0 ) { revert InvalidPriceImpactBP(); } } function _checkTickWidth( NftKey memory key, NftSettings memory settings ) internal view { INftLiquidityConnector connector = INftLiquidityConnector( _connectorRegistry.connectorOf(address(key.nftManager)) ); NftPositionInfo memory positionInfo = connector.positionInfo(address(key.nftManager), key.tokenId); NftPoolInfo memory poolInfo = connector.poolInfo(address(settings.pool), settings.poolId); uint24 actualWidth = uint24( positionInfo.tickUpper - positionInfo.tickLower ) / poolInfo.tickSpacing; uint24 expectedWidth = settings.rebalanceConfig.tickSpacesBelow + settings.rebalanceConfig.tickSpacesAbove + 1; if (actualWidth != expectedWidth) { revert InvalidWidth(actualWidth, expectedWidth); } } }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Pool state that never changes /// @notice These parameters are fixed for a pool forever, i.e., the methods /// will always return the same values interface IUniswapV3PoolImmutables { /// @notice The contract that deployed the pool, which must adhere to the /// IUniswapV3Factory interface /// @return The contract address function factory() external view returns (address); /// @notice The first of the two tokens of the pool, sorted by address /// @return The token contract address function token0() external view returns (address); /// @notice The second of the two tokens of the pool, sorted by address /// @return The token contract address function token1() external view returns (address); /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6 /// @return The fee function fee() external view returns (uint24); /// @notice The pool tick spacing /// @dev Ticks can only be used at multiples of this value, minimum of 1 and /// always positive /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, /// i.e., ..., -6, -3, 0, 3, 6, ... /// This value is an int24 to avoid casting even though it is always /// positive. /// @return The tick spacing function tickSpacing() external view returns (int24); /// @notice The maximum amount of position liquidity that can use any tick /// in the range /// @dev This parameter is enforced per tick to prevent liquidity from /// overflowing a uint128 at any point, and /// also prevents out-of-range liquidity from being used to prevent adding /// in-range liquidity to a pool /// @return The max amount of liquidity per tick function maxLiquidityPerTick() external view returns (uint128); } /// @title Pool state that can change /// @notice These methods compose the pool's state, and can change with any /// frequency including multiple times /// per transaction interface IUniswapV3PoolState { /// @notice The 0th storage slot in the pool stores many values, and is /// exposed as a single method to save gas /// when accessed externally. /// @return sqrtPriceX96 The current price of the pool as a /// sqrt(token1/token0) Q64.96 value /// @return tick The current tick of the pool, i.e. according to the last /// tick transition that was run. /// This value may not always be equal to /// SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick /// boundary. /// @return observationIndex The index of the last oracle observation that /// was written, /// @return observationCardinality The current maximum number of /// observations stored in the pool, /// @return observationCardinalityNext The next maximum number of /// observations, to be updated when the observation. /// @return feeProtocol The protocol fee for both tokens of the pool. /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted /// 4 bits and the protocol fee of token0 /// is the lower 4 bits. Used as the denominator of a fraction of the swap /// fee, e.g. 4 means 1/4th of the swap fee. /// unlocked Whether the pool is currently locked to reentrancy function slot0() external view returns ( uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked ); /// @notice The fee growth as a Q128.128 fees of token0 collected per unit /// of liquidity for the entire life of the pool /// @dev This value can overflow the uint256 function feeGrowthGlobal0X128() external view returns (uint256); /// @notice The fee growth as a Q128.128 fees of token1 collected per unit /// of liquidity for the entire life of the pool /// @dev This value can overflow the uint256 function feeGrowthGlobal1X128() external view returns (uint256); /// @notice The amounts of token0 and token1 that are owed to the protocol /// @dev Protocol fees will never exceed uint128 max in either token function protocolFees() external view returns (uint128 token0, uint128 token1); /// @notice The currently in range liquidity available to the pool /// @dev This value has no relationship to the total liquidity across all /// ticks /// @return The liquidity at the current price of the pool function liquidity() external view returns (uint128); /// @notice Look up information about a specific tick in the pool /// @param tick The tick to look up /// @return liquidityGross the total amount of position liquidity that uses /// the pool either as tick lower or /// tick upper /// @return liquidityNet how much liquidity changes when the pool price /// crosses the tick, /// @return feeGrowthOutside0X128 the fee growth on the other side of the /// tick from the current tick in token0, /// @return feeGrowthOutside1X128 the fee growth on the other side of the /// tick from the current tick in token1, /// @return tickCumulativeOutside the cumulative tick value on the other /// side of the tick from the current tick /// @return secondsPerLiquidityOutsideX128 the seconds spent per liquidity /// on the other side of the tick from the current tick, /// @return secondsOutside the seconds spent on the other side of the tick /// from the current tick, /// @return initialized Set to true if the tick is initialized, i.e. /// liquidityGross is greater than 0, otherwise equal to false. /// Outside values can only be used if the tick is initialized, i.e. if /// liquidityGross is greater than 0. /// In addition, these values are only relative and must be used only in /// comparison to previous snapshots for /// a specific position. function ticks( int24 tick ) external view returns ( uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized ); /// @notice Returns 256 packed tick initialized boolean values. See /// TickBitmap for more information function tickBitmap( int16 wordPosition ) external view returns (uint256); /// @notice Returns the information about a position by the position's key /// @param key The position's key is a hash of a preimage composed by the /// owner, tickLower and tickUpper /// @return liquidity The amount of liquidity in the position, /// @return feeGrowthInside0LastX128 fee growth of token0 inside the tick /// range as of the last mint/burn/poke, /// @return feeGrowthInside1LastX128 fee growth of token1 inside the tick /// range as of the last mint/burn/poke, /// @return tokensOwed0 the computed amount of token0 owed to the position /// as of the last mint/burn/poke, /// @return tokensOwed1 the computed amount of token1 owed to the position /// as of the last mint/burn/poke function positions( bytes32 key ) external view returns ( uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1 ); /// @notice Returns data about a specific observation index /// @param index The element of the observations array to fetch /// @dev You most likely want to use #observe() instead of this method to /// get an observation as of some amount of time /// ago, rather than at a specific index in the array. /// @return blockTimestamp The timestamp of the observation, /// @return tickCumulative the tick multiplied by seconds elapsed for the /// life of the pool as of the observation timestamp, /// @return secondsPerLiquidityCumulativeX128 the seconds per in range /// liquidity for the life of the pool as of the observation timestamp, /// @return initialized whether the observation has been initialized and the /// values are safe to use function observations( uint256 index ) external view returns ( uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized ); } interface IUniswapV3Pool is IUniswapV3PoolImmutables, IUniswapV3PoolState { function flash( address recipient, uint256 amount0, uint256 amount1, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { IERC721Enumerable } from "openzeppelin-contracts/contracts/interfaces/IERC721Enumerable.sol"; interface INonfungiblePositionManager is IERC721Enumerable { struct IncreaseLiquidityParams { uint256 tokenId; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; uint256 deadline; } struct MintParams { address token0; address token1; uint24 fee; int24 tickLower; int24 tickUpper; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; address recipient; uint256 deadline; } struct DecreaseLiquidityParams { uint256 tokenId; uint128 liquidity; uint256 amount0Min; uint256 amount1Min; uint256 deadline; } struct CollectParams { uint256 tokenId; address recipient; uint128 amount0Max; uint128 amount1Max; } function increaseLiquidity( IncreaseLiquidityParams memory params ) external payable returns (uint256 amount0, uint256 amount1, uint256 liquidity); function decreaseLiquidity( DecreaseLiquidityParams calldata params ) external payable returns (uint256 amount0, uint256 amount1); function mint( MintParams memory params ) external payable returns (uint256 tokenId, uint256 amount0, uint256 amount1); function collect( CollectParams calldata params ) external payable returns (uint256 amount0, uint256 amount1); function burn( uint256 tokenId ) external payable; function positions( uint256 tokenId ) external view returns ( uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1 ); function factory() external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { SickleStorage } from "contracts/base/SickleStorage.sol"; import { Multicall } from "contracts/base/Multicall.sol"; import { SickleRegistry } from "contracts/SickleRegistry.sol"; /// @title Sickle contract /// @author vfat.tools /// @notice Sickle facilitates farming and interactions with Masterchef /// contracts /// @dev Base contract inheriting from all the other "manager" contracts contract Sickle is SickleStorage, Multicall { /// @notice Function to receive ETH receive() external payable { } /// @param sickleRegistry_ Address of the SickleRegistry contract constructor( SickleRegistry sickleRegistry_ ) Multicall(sickleRegistry_) { _disableInitializers(); } /// @param sickleOwner_ Address of the Sickle owner function initialize( address sickleOwner_, address approved_ ) external initializer { SickleStorage._initializeSickleStorage(sickleOwner_, approved_); } /// INTERNALS /// function onERC721Received( address, // operator address, // from uint256, // tokenId bytes calldata // data ) external pure returns (bytes4) { return this.onERC721Received.selector; } function onERC1155Received( address, // operator address, // from uint256, // id uint256, // value bytes calldata // data ) external pure returns (bytes4) { return this.onERC1155Received.selector; } function onERC1155BatchReceived( address, // operator address, // from uint256[] calldata, // ids uint256[] calldata, // values bytes calldata // data ) external pure returns (bytes4) { return this.onERC1155BatchReceived.selector; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { NftAddLiquidity, NftRemoveLiquidity, NftPoolKey, NftPoolInfo, NftPositionInfo } from "contracts/structs/NftLiquidityStructs.sol"; interface INftLiquidityConnector { function addLiquidity( NftAddLiquidity memory addLiquidityParams ) external payable; function removeLiquidity( NftRemoveLiquidity memory removeLiquidityParams ) external; function fee( address pool, uint256 tokenId // Used by UniswapV4 ) external view returns (uint24); function totalSupply( address nftManager ) external view returns (uint256); function getTokenId( address nftManager, address owner ) external view returns (uint256); function earnedFees( address nftManager, address pool, uint256 tokenId ) external view returns (uint256 fees0, uint256 fees1); function positionLiquidity( address nftManager, uint256 tokenId ) external view returns (int24 tickLower, int24 tickUpper, uint128 liquidity); function positionPoolKey( address poolFactory, address nftManager, uint256 tokenId ) external view returns (NftPoolKey memory); function poolInfo( address pool, bytes32 poolId ) external view returns (NftPoolInfo memory); // Maintained for backwards compatibility with NftSettingsRegistry function positionInfo( address nftManager, uint256 tokenId ) external view returns (NftPositionInfo memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { NftKey, NftSettings } from "contracts/structs/NftSettingsStructs.sol"; interface INftSettingsRegistry { error InvalidNftManager(); error AutoHarvestNotSet(); error AutoCompoundNotSet(); error AutoRebalanceNotSet(); error AutoExitNotSet(); error ExitTriggersNotSet(); error InvalidExitTriggers(); error InvalidTokenOut(); error InvalidMinMaxTickRange(); error InvalidSlippageBP(); error InvalidPriceImpactBP(); error InvalidDustBP(); error InvalidMinTickLow(); error InvalidMaxTickHigh(); error InvalidBufferTicksAbove(); error InvalidBufferTicksBelow(); error OnlySickle(); error RebalanceConfigNotSet(); error TickWithinRange(); error TickOutsideStopLossRange(); error SickleNotDeployed(); error InvalidWidth(uint24 actual, uint24 expected); error TokenIdUnchanged(); event NftSettingsSet(NftKey key, NftSettings settings); event NftSettingsUnset(NftKey key); event ConnectionRegistrySet(address connectorRegistry); function getNftSettings( NftKey calldata key ) external view returns (NftSettings memory); function setNftSettings( NftKey calldata key, NftSettings calldata settings ) external; function transferNftSettings( NftKey calldata oldKey, NftSettings calldata settings ) external; function validateRebalanceFor( NftKey memory key ) external; function validateExitFor( NftKey memory key ) external; function validateHarvestFor( NftKey memory key ) external; function validateCompoundFor( NftKey memory key ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { Sickle } from "contracts/Sickle.sol"; struct PositionKey { Sickle sickle; address stakingContract; uint256 poolIndex; } enum RewardBehavior { None, Harvest, Compound } struct RewardConfig { RewardBehavior rewardBehavior; address harvestTokenOut; } struct ExitConfig { uint256 baseTokenIndex; uint256 quoteTokenIndex; uint256 triggerPriceLow; address exitTokenOutLow; uint256 triggerPriceHigh; address exitTokenOutHigh; uint256[] triggerReservesLow; address[] triggerReservesTokensOut; uint256 priceImpactBP; uint256 slippageBP; } /** * Settings for automating an ERC20 position * @param pool: Uniswap or Aerodrome vAMM/sAMM pair for the position (requires * ILiquidityConnector connector registered) * @param router: Router for the pair (requires connector registration) * @param automateRewards: Whether to automatically harvest or compound rewards * for this position, regardless of rebalance settings. * @param rewardConfig: Configuration for reward automation * Harvest as-is, harvest and convert to a different token, or compound into the * position. * @param autoExit: Whether to automatically exit the position when it goes out * of * range * @param exitConfig: Configuration for the above */ struct PositionSettings { address pool; address router; bool automateRewards; RewardConfig rewardConfig; bool autoExit; ExitConfig exitConfig; bytes extraData; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { INonfungiblePositionManager } from "contracts/interfaces/external/uniswap/INonfungiblePositionManager.sol"; import { IUniswapV3Pool } from "contracts/interfaces/external/uniswap/IUniswapV3Pool.sol"; import { Sickle } from "contracts/Sickle.sol"; import { RewardConfig } from "contracts/structs/PositionSettingsStructs.sol"; struct NftKey { Sickle sickle; INonfungiblePositionManager nftManager; uint256 tokenId; } struct ExitConfig { int24 triggerTickLow; int24 triggerTickHigh; address exitTokenOutLow; address exitTokenOutHigh; uint256 priceImpactBP; uint256 slippageBP; } /** * @notice Settings for automatic rebalancing * @param tickSpacesBelow: Position width measured in tick spaces below * Default: 0 (Position doesn't include any tick spaces below current) * @param tickSpacesAbove: Position width measured in tick spaces above * Default: 0 (Position doesn't include any tick spaces above current) * @param bufferTicksBelow: Difference from position tickLower to * rebalance below. Can be negative (rebalance before position goes under * range) * Default: 0 (always rebalance if tick < tickLower) * @param bufferTicksAbove: Difference from position tickUpper to * rebalance above. Can be negative (rebalance before position goes above range) * Default: 0 (always rebalance if tick >= tickUpper) * @param dustBP: Dust allowance in basis points * @param priceImpactBP: Price impact allowance in basis points * @param slippageBP: Slippage allowance in basis points * @param cutoffTickLow: Stop rebalancing below this tick * default: MIN_TICK (no stop loss) * @param cutoffTickHigh: Stop rebalancing above this tick * default: MAX_TICK (no stop loss) * @param delayMin: Delay in minutes before rebalancing * @param rewardConfig: Configuration for handling rewards when rebalancing */ struct RebalanceConfig { uint24 tickSpacesBelow; uint24 tickSpacesAbove; int24 bufferTicksBelow; int24 bufferTicksAbove; uint256 dustBP; uint256 priceImpactBP; uint256 slippageBP; int24 cutoffTickLow; int24 cutoffTickHigh; uint8 delayMin; RewardConfig rewardConfig; } /** * Settings for automating an NFT position * @param autoRebalance: Whether to rebalance automatically when position goes * out of range * @param rebalanceConfig: Configuration for the above * @param automateRewards: Whether to automatically harvest or compound rewards * for this position, regardless of rebalance settings. * @param rewardConfig: Configuration for reward automation * Harvest as-is, harvest and convert to a different token, or compound into the * position. */ struct NftSettings { IUniswapV3Pool pool; bytes32 poolId; bool autoRebalance; RebalanceConfig rebalanceConfig; bool automateRewards; RewardConfig rewardConfig; bool autoExit; ExitConfig exitConfig; bytes extraData; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { Clones } from "@openzeppelin/contracts/proxy/Clones.sol"; import { Sickle } from "contracts/Sickle.sol"; import { SickleRegistry } from "contracts/SickleRegistry.sol"; import { Admin } from "contracts/base/Admin.sol"; /// @title SickleFactory contract /// @author vfat.tools /// @notice Factory deploying new Sickle contracts contract SickleFactory is Admin { /// EVENTS /// /// @notice Emitted when a new Sickle contract is deployed /// @param admin Address receiving the admin rights of the Sickle contract /// @param sickle Address of the newly deployed Sickle contract event Deploy(address indexed admin, address sickle); /// @notice Thrown when the caller is not whitelisted /// @param caller Address of the non-whitelisted caller error CallerNotWhitelisted(address caller); // 0x252c8273 /// @notice Thrown when the factory is not active and a deploy is attempted error NotActive(); // 0x80cb55e2 /// @notice Thrown when a Sickle contract is already deployed for a user error SickleAlreadyDeployed(); //0xf6782ef1 /// STORAGE /// mapping(address => address) private _sickles; mapping(address => address) private _admins; mapping(address => bytes32) public _referralCodes; /// @notice Address of the SickleRegistry contract SickleRegistry public immutable registry; /// @notice Address of the Sickle implementation contract address public immutable implementation; /// @notice Address of the previous SickleFactory contract (if applicable) SickleFactory public immutable previousFactory; /// @notice Whether the factory is active (can deploy new Sickle contracts) bool public isActive = true; /// WRITE FUNCTIONS /// /// @param admin_ Address of the admin /// @param sickleRegistry_ Address of the SickleRegistry contract /// @param sickleImplementation_ Address of the Sickle implementation /// contract /// @param previousFactory_ Address of the previous SickleFactory contract /// if applicable constructor( address admin_, address sickleRegistry_, address sickleImplementation_, address previousFactory_ ) Admin(admin_) { registry = SickleRegistry(sickleRegistry_); implementation = sickleImplementation_; previousFactory = SickleFactory(previousFactory_); } function setActive( bool active ) external onlyAdmin { isActive = active; } function _deploy( address admin, address approved, bytes32 referralCode ) internal returns (address sickle) { sickle = Clones.cloneDeterministic( implementation, keccak256(abi.encode(admin)) ); Sickle(payable(sickle)).initialize(admin, approved); _sickles[admin] = sickle; _admins[sickle] = admin; if (referralCode != bytes32(0)) { _referralCodes[sickle] = referralCode; } emit Deploy(admin, sickle); } function _getSickle( address admin ) internal returns (address sickle) { sickle = _sickles[admin]; if (sickle != address(0)) { return sickle; } if (address(previousFactory) != address(0)) { sickle = previousFactory.sickles(admin); if (sickle != address(0)) { _sickles[admin] = sickle; _admins[sickle] = admin; _referralCodes[sickle] = previousFactory.referralCodes(sickle); return sickle; } } } /// @notice Predict the address of a Sickle contract for a specific user /// @param admin Address receiving the admin rights of the Sickle contract /// @return sickle Address of the predicted Sickle contract function predict( address admin ) external view returns (address) { bytes32 salt = keccak256(abi.encode(admin)); return Clones.predictDeterministicAddress(implementation, salt); } /// @notice Returns the Sickle contract for a specific user /// @param admin Address that owns the Sickle contract /// @return sickle Address of the Sickle contract function sickles( address admin ) external view returns (address sickle) { sickle = _sickles[admin]; if (sickle == address(0) && address(previousFactory) != address(0)) { sickle = previousFactory.sickles(admin); } } /// @notice Returns the admin for a specific Sickle contract /// @param sickle Address of the Sickle contract /// @return admin Address that owns the Sickle contract function admins( address sickle ) external view returns (address admin) { admin = _admins[sickle]; if (admin == address(0) && address(previousFactory) != address(0)) { admin = previousFactory.admins(sickle); } } /// @notice Returns the referral code for a specific Sickle contract /// @param sickle Address of the Sickle contract /// @return referralCode Referral code for the user function referralCodes( address sickle ) external view returns (bytes32 referralCode) { referralCode = _referralCodes[sickle]; if ( referralCode == bytes32(0) && address(previousFactory) != address(0) ) { referralCode = previousFactory.referralCodes(sickle); } } /// @notice Deploys a new Sickle contract for a specific user, or returns /// the existing one if it exists /// @param admin Address receiving the admin rights of the Sickle contract /// @param approved Address approved to manage automation /// @param referralCode Referral code for the user /// @return sickle Address of the deployed Sickle contract function getOrDeploy( address admin, address approved, bytes32 referralCode ) external returns (address sickle) { if (!isActive) { revert NotActive(); } if (!registry.isWhitelistedCaller(msg.sender)) { revert CallerNotWhitelisted(msg.sender); } if ((sickle = _getSickle(admin)) != address(0)) { return sickle; } return _deploy(admin, approved, referralCode); } /// @notice Deploys a new Sickle contract for a specific user /// @dev Sickle contracts are deployed with create2, the address of the /// admin is used as a salt, so all the Sickle addresses can be pre-computed /// and only 1 Sickle will exist per address /// @param approved Address approved to manage automation /// @param referralCode Referral code for the user /// @return sickle Address of the deployed Sickle contract function deploy( address approved, bytes32 referralCode ) external returns (address sickle) { if (!isActive) { revert NotActive(); } if (_getSickle(msg.sender) != address(0)) { revert SickleAlreadyDeployed(); } return _deploy(msg.sender, approved, referralCode); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { Admin } from "contracts/base/Admin.sol"; import { TimelockAdmin } from "contracts/base/TimelockAdmin.sol"; error ConnectorNotRegistered(address target); error CustomRegistryAlreadyRegistered(); interface ICustomConnectorRegistry { function connectorOf( address target ) external view returns (address); } contract ConnectorRegistry is Admin, TimelockAdmin { event ConnectorChanged(address target, address connector); event CustomRegistryAdded(address registry); event CustomRegistryRemoved(address registry); error ConnectorAlreadySet(address target); error ConnectorNotSet(address target); error ArrayLengthMismatch(); ICustomConnectorRegistry[] public customRegistries; mapping(address target => address connector) private connectors_; constructor( address admin_, address timelockAdmin_ ) Admin(admin_) TimelockAdmin(timelockAdmin_) { } /// Admin functions /// @notice Update connector addresses for a batch of targets. /// @dev Controls which connector contracts are used for the specified /// targets. /// @custom:access Restricted to protocol admin. function setConnectors( address[] calldata targets, address[] calldata connectors ) external onlyAdmin { if (targets.length != connectors.length) { revert ArrayLengthMismatch(); } for (uint256 i; i != targets.length;) { if (connectors_[targets[i]] != address(0)) { revert ConnectorAlreadySet(targets[i]); } connectors_[targets[i]] = connectors[i]; emit ConnectorChanged(targets[i], connectors[i]); unchecked { ++i; } } } function updateConnectors( address[] calldata targets, address[] calldata connectors ) external onlyTimelockAdmin { if (targets.length != connectors.length) { revert ArrayLengthMismatch(); } for (uint256 i; i != targets.length;) { if (connectors_[targets[i]] == address(0)) { revert ConnectorNotSet(targets[i]); } connectors_[targets[i]] = connectors[i]; emit ConnectorChanged(targets[i], connectors[i]); unchecked { ++i; } } } /// @notice Append an address to the custom registries list. /// @custom:access Restricted to protocol admin. function addCustomRegistry( ICustomConnectorRegistry registry ) external onlyAdmin { if (isCustomRegistry(registry)) { revert CustomRegistryAlreadyRegistered(); } customRegistries.push(registry); emit CustomRegistryAdded(address(registry)); } /// @notice Replace an address in the custom registries list. /// @custom:access Restricted to protocol admin. function updateCustomRegistry( uint256 index, ICustomConnectorRegistry newRegistry ) external onlyTimelockAdmin { ICustomConnectorRegistry oldRegistry = customRegistries[index]; emit CustomRegistryRemoved(address(oldRegistry)); customRegistries[index] = newRegistry; if (address(newRegistry) != address(0)) { emit CustomRegistryAdded(address(newRegistry)); } } /// Public functions function connectorOf( address target ) external view returns (address) { address connector = _getConnector(target); if (connector != address(0)) { return connector; } revert ConnectorNotRegistered(target); } function hasConnector( address target ) external view returns (bool) { return _getConnector(target) != address(0); } function isCustomRegistry( ICustomConnectorRegistry registry ) public view returns (bool) { for (uint256 i; i != customRegistries.length;) { if (address(customRegistries[i]) == address(registry)) { return true; } unchecked { ++i; } } return false; } /// Internal functions function _getConnector( address target ) internal view returns (address) { address connector = connectors_[target]; if (connector != address(0)) { return connector; } uint256 length = customRegistries.length; for (uint256 i; i != length;) { if (address(customRegistries[i]) != address(0)) { (bool success, bytes memory data) = address(customRegistries[i]) .staticcall( abi.encodeWithSelector( ICustomConnectorRegistry.connectorOf.selector, target ) ); if (success && data.length == 32) { address _connector = abi.decode(data, (address)); if (_connector != address(0)) { return _connector; } } } unchecked { ++i; } } return address(0); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; /// @title TimelockAdmin contract /// @author vfat.tools /// @notice Provides an timelockAdministration mechanism allowing restricted /// functions abstract contract TimelockAdmin { /// ERRORS /// /// @notice Thrown when the caller is not the timelockAdmin error NotTimelockAdminError(); /// EVENTS /// /// @notice Emitted when a new timelockAdmin is set /// @param oldTimelockAdmin Address of the old timelockAdmin /// @param newTimelockAdmin Address of the new timelockAdmin event TimelockAdminSet(address oldTimelockAdmin, address newTimelockAdmin); /// STORAGE /// /// @notice Address of the current timelockAdmin address public timelockAdmin; /// MODIFIERS /// /// @dev Restricts a function to the timelockAdmin modifier onlyTimelockAdmin() { if (msg.sender != timelockAdmin) revert NotTimelockAdminError(); _; } /// WRITE FUNCTIONS /// /// @param timelockAdmin_ Address of the timelockAdmin constructor( address timelockAdmin_ ) { emit TimelockAdminSet(timelockAdmin, timelockAdmin_); timelockAdmin = timelockAdmin_; } /// @notice Sets a new timelockAdmin /// @dev Can only be called by the current timelockAdmin /// @param newTimelockAdmin Address of the new timelockAdmin function setTimelockAdmin( address newTimelockAdmin ) external onlyTimelockAdmin { emit TimelockAdminSet(timelockAdmin, newTimelockAdmin); timelockAdmin = newTimelockAdmin; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../token/ERC721/extensions/IERC721Enumerable.sol";
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol"; library SickleStorageEvents { event ApprovedAddressChanged(address newApproved); } /// @title SickleStorage contract /// @author vfat.tools /// @notice Base storage of the Sickle contract /// @dev This contract needs to be inherited by stub contracts meant to be used /// with `delegatecall` abstract contract SickleStorage is Initializable { /// ERRORS /// /// @notice Thrown when the caller is not the owner of the Sickle contract error NotOwnerError(); // 0x74a21527 /// @notice Thrown when the caller is not a strategy contract or the /// Flashloan Stub error NotStrategyError(); // 0x4581ba62 /// STORAGE /// /// @notice Address of the owner address public owner; /// @notice An address that can be set by the owner of the Sickle contract /// in order to trigger specific functions. address public approved; /// MODIFIERS /// /// @dev Restricts a function call to the owner of the Sickle contract modifier onlyOwner() { if (msg.sender != owner) revert NotOwnerError(); _; } /// INITIALIZATION /// /// @param owner_ Address of the owner of this Sickle contract function _initializeSickleStorage( address owner_, address approved_ ) internal onlyInitializing { owner = owner_; approved = approved_; } /// WRITE FUNCTIONS /// /// @notice Sets the approved address of this Sickle /// @param newApproved Address meant to be approved by the owner function setApproved( address newApproved ) external onlyOwner { approved = newApproved; emit SickleStorageEvents.ApprovedAddressChanged(newApproved); } /// @notice Checks if `caller` is either the owner of the Sickle contract /// or was approved by them /// @param caller Address to check /// @return True if `caller` is either the owner of the Sickle contract function isOwnerOrApproved( address caller ) public view returns (bool) { return caller == owner || caller == approved; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { SickleRegistry } from "contracts/SickleRegistry.sol"; /// @title Multicall contract /// @author vfat.tools /// @notice Enables calling multiple methods in a single call to the contract abstract contract Multicall { /// ERRORS /// error MulticallParamsMismatchError(); // 0xc1e637c9 /// @notice Thrown when the target contract is not whitelisted /// @param target Address of the non-whitelisted target error TargetNotWhitelisted(address target); // 0x47ccabe7 /// @notice Thrown when the caller is not whitelisted /// @param caller Address of the non-whitelisted caller error CallerNotWhitelisted(address caller); // 0x252c8273 /// STORAGE /// /// @notice Address of the SickleRegistry contract /// @dev Needs to be immutable so that it's accessible for Sickle proxies SickleRegistry public immutable registry; /// INITIALIZATION /// /// @param registry_ Address of the SickleRegistry contract constructor( SickleRegistry registry_ ) { registry = registry_; } /// WRITE FUNCTIONS /// /// @notice Batch multiple calls together (calls or delegatecalls) /// @param targets Array of targets to call /// @param data Array of data to pass with the calls function multicall( address[] calldata targets, bytes[] calldata data ) external payable { if (targets.length != data.length) { revert MulticallParamsMismatchError(); } if (!registry.isWhitelistedCaller(msg.sender)) { revert CallerNotWhitelisted(msg.sender); } for (uint256 i = 0; i != data.length;) { if (targets[i] == address(0)) { unchecked { ++i; } continue; // No-op } if (targets[i] != address(this)) { if (!registry.isWhitelistedTarget(targets[i])) { revert TargetNotWhitelisted(targets[i]); } } (bool success, bytes memory result) = targets[i].delegatecall(data[i]); if (!success) { if (result.length == 0) revert(); assembly { revert(add(32, result), mload(result)) } } unchecked { ++i; } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { Admin } from "contracts/base/Admin.sol"; library SickleRegistryEvents { event CollectorChanged(address newCollector); event FeesUpdated(bytes32[] feeHashes, uint256[] feesInBP); event ReferralCodeCreated(bytes32 indexed code, address indexed referrer); // Multicall caller and target whitelist status changes event CallerStatusChanged(address caller, bool isWhitelisted); event TargetStatusChanged(address target, bool isWhitelisted); } /// @title SickleRegistry contract /// @author vfat.tools /// @notice Manages the whitelisted contracts and the collector address contract SickleRegistry is Admin { /// CONSTANTS /// uint256 constant MAX_FEE = 500; // 5% /// ERRORS /// error ArrayLengthMismatch(); // 0xa24a13a6 error FeeAboveMaxLimit(); // 0xd6cf7b5e error InvalidReferralCode(); // 0xe55b4629 /// STORAGE /// /// @notice Address of the fee collector address public collector; /// @notice Tracks the contracts that can be called through Sickle multicall /// @return True if the contract is a whitelisted target mapping(address => bool) public isWhitelistedTarget; /// @notice Tracks the contracts that can call Sickle multicall /// @return True if the contract is a whitelisted caller mapping(address => bool) public isWhitelistedCaller; /// @notice Keeps track of the referrers and their associated code mapping(bytes32 => address) public referralCodes; /// @notice Mapping for fee hashes (hash of the strategy contract addresses /// and the function selectors) and their associated fees /// @return The fee in basis points to apply to the transaction amount mapping(bytes32 => uint256) public feeRegistry; /// WRITE FUNCTIONS /// /// @param admin_ Address of the admin /// @param collector_ Address of the collector constructor(address admin_, address collector_) Admin(admin_) { collector = collector_; } /// @notice Updates the whitelist status for multiple multicall targets /// @param targets Addresses of the contracts to update /// @param isApproved New status for the contracts /// @custom:access Restricted to protocol admin. function setWhitelistedTargets( address[] calldata targets, bool isApproved ) external onlyAdmin { for (uint256 i; i < targets.length;) { isWhitelistedTarget[targets[i]] = isApproved; emit SickleRegistryEvents.TargetStatusChanged( targets[i], isApproved ); unchecked { ++i; } } } /// @notice Updates the fee collector address /// @param newCollector Address of the new fee collector /// @custom:access Restricted to protocol admin. function updateCollector( address newCollector ) external onlyAdmin { collector = newCollector; emit SickleRegistryEvents.CollectorChanged(newCollector); } /// @notice Update the whitelist status for multiple multicall callers /// @param callers Addresses of the callers /// @param isApproved New status for the caller /// @custom:access Restricted to protocol admin. function setWhitelistedCallers( address[] calldata callers, bool isApproved ) external onlyAdmin { for (uint256 i; i < callers.length;) { isWhitelistedCaller[callers[i]] = isApproved; emit SickleRegistryEvents.CallerStatusChanged( callers[i], isApproved ); unchecked { ++i; } } } /// @notice Associates a referral code to the address of the caller function setReferralCode( bytes32 referralCode ) external { if (referralCodes[referralCode] != address(0)) { revert InvalidReferralCode(); } referralCodes[referralCode] = msg.sender; emit SickleRegistryEvents.ReferralCodeCreated(referralCode, msg.sender); } /// @notice Update the fees for multiple strategy functions /// @param feeHashes Array of fee hashes /// @param feesArray Array of fees to apply (in basis points) /// @custom:access Restricted to protocol admin. function setFees( bytes32[] calldata feeHashes, uint256[] calldata feesArray ) external onlyAdmin { if (feeHashes.length != feesArray.length) { revert ArrayLengthMismatch(); } for (uint256 i = 0; i < feeHashes.length;) { if (feesArray[i] <= MAX_FEE) { feeRegistry[feeHashes[i]] = feesArray[i]; } else { revert FeeAboveMaxLimit(); } unchecked { ++i; } } emit SickleRegistryEvents.FeesUpdated(feeHashes, feesArray); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { INonfungiblePositionManager } from "contracts/interfaces/external/uniswap/INonfungiblePositionManager.sol"; struct Pool { address token0; address token1; uint24 fee; } struct NftPoolKey { address poolAddress; bytes32 poolId; } struct NftPoolInfo { address token0; address token1; uint24 fee; uint24 tickSpacing; uint160 sqrtPriceX96; int24 tick; uint128 liquidity; uint256 feeGrowthGlobal0X128; uint256 feeGrowthGlobal1X128; } // Maintained for backwards compatibility with NftSettingsRegistry struct NftPositionInfo { uint128 liquidity; int24 tickLower; int24 tickUpper; } struct NftAddLiquidity { INonfungiblePositionManager nft; uint256 tokenId; Pool pool; int24 tickLower; int24 tickUpper; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; bytes extraData; } struct NftRemoveLiquidity { INonfungiblePositionManager nft; uint256 tokenId; uint128 liquidity; uint256 amount0Min; // For decreasing uint256 amount1Min; uint128 amount0Max; // For collecting uint128 amount1Max; bytes extraData; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (proxy/Clones.sol) pragma solidity ^0.8.0; /** * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for * deploying minimal proxy contracts, also known as "clones". * * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies * > a minimal bytecode implementation that delegates all calls to a known, fixed address. * * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2` * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the * deterministic method. * * _Available since v3.4._ */ library Clones { /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create opcode, which should never revert. */ function clone(address implementation) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes // of the `implementation` address with the bytecode before the address. mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) // Packs the remaining 17 bytes of `implementation` with the bytecode after the address. mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)) instance := create(0, 0x09, 0x37) } require(instance != address(0), "ERC1167: create failed"); } /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create2 opcode and a `salt` to deterministically deploy * the clone. Using the same `implementation` and `salt` multiple time will revert, since * the clones cannot be deployed twice at the same address. */ function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes // of the `implementation` address with the bytecode before the address. mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) // Packs the remaining 17 bytes of `implementation` with the bytecode after the address. mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)) instance := create2(0, 0x09, 0x37, salt) } require(instance != address(0), "ERC1167: create2 failed"); } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt, address deployer ) internal pure returns (address predicted) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(add(ptr, 0x38), deployer) mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff) mstore(add(ptr, 0x14), implementation) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73) mstore(add(ptr, 0x58), salt) mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37)) predicted := keccak256(add(ptr, 0x43), 0x55) } } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress(address implementation, bytes32 salt) internal view returns (address predicted) { return predictDeterministicAddress(implementation, salt, address(this)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; /// @title Admin contract /// @author vfat.tools /// @notice Provides an administration mechanism allowing restricted functions abstract contract Admin { /// ERRORS /// /// @notice Thrown when the caller is not the admin error NotAdminError(); //0xb5c42b3b /// EVENTS /// /// @notice Emitted when a new admin is set /// @param oldAdmin Address of the old admin /// @param newAdmin Address of the new admin event AdminSet(address oldAdmin, address newAdmin); /// STORAGE /// /// @notice Address of the current admin address public admin; /// MODIFIERS /// /// @dev Restricts a function to the admin modifier onlyAdmin() { if (msg.sender != admin) revert NotAdminError(); _; } /// WRITE FUNCTIONS /// /// @param admin_ Address of the admin constructor( address admin_ ) { emit AdminSet(address(0), admin_); admin = admin_; } /// @notice Sets a new admin /// @param newAdmin Address of the new admin /// @custom:access Restricted to protocol admin. function setAdmin( address newAdmin ) external onlyAdmin { emit AdminSet(admin, newAdmin); admin = newAdmin; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/Address.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "remappings": [ "solmate/=lib/solmate/src/", "@openzeppelin/=lib/openzeppelin-contracts/", "@morpho-blue/=lib/morpho-blue/src/", "ds-test/=lib/solmate/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "morpho-blue/=lib/morpho-blue/", "openzeppelin-contracts/=lib/openzeppelin-contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": false }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract SickleFactory","name":"_factory","type":"address"},{"internalType":"contract ConnectorRegistry","name":"connectorRegistry","type":"address"},{"internalType":"address","name":"timelockAdmin","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AutoCompoundNotSet","type":"error"},{"inputs":[],"name":"AutoExitNotSet","type":"error"},{"inputs":[],"name":"AutoHarvestNotSet","type":"error"},{"inputs":[],"name":"AutoRebalanceNotSet","type":"error"},{"inputs":[],"name":"ExitTriggersNotSet","type":"error"},{"inputs":[],"name":"InvalidBufferTicksAbove","type":"error"},{"inputs":[],"name":"InvalidBufferTicksBelow","type":"error"},{"inputs":[],"name":"InvalidDustBP","type":"error"},{"inputs":[],"name":"InvalidExitTriggers","type":"error"},{"inputs":[],"name":"InvalidMaxTickHigh","type":"error"},{"inputs":[],"name":"InvalidMinMaxTickRange","type":"error"},{"inputs":[],"name":"InvalidMinTickLow","type":"error"},{"inputs":[],"name":"InvalidNftManager","type":"error"},{"inputs":[],"name":"InvalidPriceImpactBP","type":"error"},{"inputs":[],"name":"InvalidSlippageBP","type":"error"},{"inputs":[],"name":"InvalidTokenOut","type":"error"},{"inputs":[{"internalType":"uint24","name":"actual","type":"uint24"},{"internalType":"uint24","name":"expected","type":"uint24"}],"name":"InvalidWidth","type":"error"},{"inputs":[],"name":"NotTimelockAdminError","type":"error"},{"inputs":[],"name":"OnlySickle","type":"error"},{"inputs":[],"name":"RebalanceConfigNotSet","type":"error"},{"inputs":[],"name":"SickleNotDeployed","type":"error"},{"inputs":[],"name":"TickOutsideStopLossRange","type":"error"},{"inputs":[],"name":"TickWithinRange","type":"error"},{"inputs":[],"name":"TokenIdUnchanged","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"connectorRegistry","type":"address"}],"name":"ConnectionRegistrySet","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"contract Sickle","name":"sickle","type":"address"},{"internalType":"contract INonfungiblePositionManager","name":"nftManager","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"indexed":false,"internalType":"struct NftKey","name":"key","type":"tuple"},{"components":[{"internalType":"contract IUniswapV3Pool","name":"pool","type":"address"},{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"bool","name":"autoRebalance","type":"bool"},{"components":[{"internalType":"uint24","name":"tickSpacesBelow","type":"uint24"},{"internalType":"uint24","name":"tickSpacesAbove","type":"uint24"},{"internalType":"int24","name":"bufferTicksBelow","type":"int24"},{"internalType":"int24","name":"bufferTicksAbove","type":"int24"},{"internalType":"uint256","name":"dustBP","type":"uint256"},{"internalType":"uint256","name":"priceImpactBP","type":"uint256"},{"internalType":"uint256","name":"slippageBP","type":"uint256"},{"internalType":"int24","name":"cutoffTickLow","type":"int24"},{"internalType":"int24","name":"cutoffTickHigh","type":"int24"},{"internalType":"uint8","name":"delayMin","type":"uint8"},{"components":[{"internalType":"enum RewardBehavior","name":"rewardBehavior","type":"uint8"},{"internalType":"address","name":"harvestTokenOut","type":"address"}],"internalType":"struct RewardConfig","name":"rewardConfig","type":"tuple"}],"internalType":"struct RebalanceConfig","name":"rebalanceConfig","type":"tuple"},{"internalType":"bool","name":"automateRewards","type":"bool"},{"components":[{"internalType":"enum RewardBehavior","name":"rewardBehavior","type":"uint8"},{"internalType":"address","name":"harvestTokenOut","type":"address"}],"internalType":"struct RewardConfig","name":"rewardConfig","type":"tuple"},{"internalType":"bool","name":"autoExit","type":"bool"},{"components":[{"internalType":"int24","name":"triggerTickLow","type":"int24"},{"internalType":"int24","name":"triggerTickHigh","type":"int24"},{"internalType":"address","name":"exitTokenOutLow","type":"address"},{"internalType":"address","name":"exitTokenOutHigh","type":"address"},{"internalType":"uint256","name":"priceImpactBP","type":"uint256"},{"internalType":"uint256","name":"slippageBP","type":"uint256"}],"internalType":"struct ExitConfig","name":"exitConfig","type":"tuple"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"indexed":false,"internalType":"struct NftSettings","name":"settings","type":"tuple"}],"name":"NftSettingsSet","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"contract Sickle","name":"sickle","type":"address"},{"internalType":"contract INonfungiblePositionManager","name":"nftManager","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"indexed":false,"internalType":"struct NftKey","name":"key","type":"tuple"}],"name":"NftSettingsUnset","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldTimelockAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newTimelockAdmin","type":"address"}],"name":"TimelockAdminSet","type":"event"},{"inputs":[],"name":"factory","outputs":[{"internalType":"contract SickleFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract Sickle","name":"sickle","type":"address"},{"internalType":"contract INonfungiblePositionManager","name":"nftManager","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftKey","name":"key","type":"tuple"}],"name":"getNftSettings","outputs":[{"components":[{"internalType":"contract IUniswapV3Pool","name":"pool","type":"address"},{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"bool","name":"autoRebalance","type":"bool"},{"components":[{"internalType":"uint24","name":"tickSpacesBelow","type":"uint24"},{"internalType":"uint24","name":"tickSpacesAbove","type":"uint24"},{"internalType":"int24","name":"bufferTicksBelow","type":"int24"},{"internalType":"int24","name":"bufferTicksAbove","type":"int24"},{"internalType":"uint256","name":"dustBP","type":"uint256"},{"internalType":"uint256","name":"priceImpactBP","type":"uint256"},{"internalType":"uint256","name":"slippageBP","type":"uint256"},{"internalType":"int24","name":"cutoffTickLow","type":"int24"},{"internalType":"int24","name":"cutoffTickHigh","type":"int24"},{"internalType":"uint8","name":"delayMin","type":"uint8"},{"components":[{"internalType":"enum RewardBehavior","name":"rewardBehavior","type":"uint8"},{"internalType":"address","name":"harvestTokenOut","type":"address"}],"internalType":"struct RewardConfig","name":"rewardConfig","type":"tuple"}],"internalType":"struct RebalanceConfig","name":"rebalanceConfig","type":"tuple"},{"internalType":"bool","name":"automateRewards","type":"bool"},{"components":[{"internalType":"enum RewardBehavior","name":"rewardBehavior","type":"uint8"},{"internalType":"address","name":"harvestTokenOut","type":"address"}],"internalType":"struct RewardConfig","name":"rewardConfig","type":"tuple"},{"internalType":"bool","name":"autoExit","type":"bool"},{"components":[{"internalType":"int24","name":"triggerTickLow","type":"int24"},{"internalType":"int24","name":"triggerTickHigh","type":"int24"},{"internalType":"address","name":"exitTokenOutLow","type":"address"},{"internalType":"address","name":"exitTokenOutHigh","type":"address"},{"internalType":"uint256","name":"priceImpactBP","type":"uint256"},{"internalType":"uint256","name":"slippageBP","type":"uint256"}],"internalType":"struct ExitConfig","name":"exitConfig","type":"tuple"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftSettings","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IPreviousNftSettingsRegistry","name":"previousNftSettingsRegistry","type":"address"},{"internalType":"contract INonfungiblePositionManager","name":"nftManager","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"migrateNftSettings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ConnectorRegistry","name":"connectorRegistry","type":"address"}],"name":"setConnectorRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract INonfungiblePositionManager","name":"nftManager","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"contract IUniswapV3Pool","name":"pool","type":"address"},{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"bool","name":"autoRebalance","type":"bool"},{"components":[{"internalType":"uint24","name":"tickSpacesBelow","type":"uint24"},{"internalType":"uint24","name":"tickSpacesAbove","type":"uint24"},{"internalType":"int24","name":"bufferTicksBelow","type":"int24"},{"internalType":"int24","name":"bufferTicksAbove","type":"int24"},{"internalType":"uint256","name":"dustBP","type":"uint256"},{"internalType":"uint256","name":"priceImpactBP","type":"uint256"},{"internalType":"uint256","name":"slippageBP","type":"uint256"},{"internalType":"int24","name":"cutoffTickLow","type":"int24"},{"internalType":"int24","name":"cutoffTickHigh","type":"int24"},{"internalType":"uint8","name":"delayMin","type":"uint8"},{"components":[{"internalType":"enum RewardBehavior","name":"rewardBehavior","type":"uint8"},{"internalType":"address","name":"harvestTokenOut","type":"address"}],"internalType":"struct RewardConfig","name":"rewardConfig","type":"tuple"}],"internalType":"struct RebalanceConfig","name":"rebalanceConfig","type":"tuple"},{"internalType":"bool","name":"automateRewards","type":"bool"},{"components":[{"internalType":"enum RewardBehavior","name":"rewardBehavior","type":"uint8"},{"internalType":"address","name":"harvestTokenOut","type":"address"}],"internalType":"struct RewardConfig","name":"rewardConfig","type":"tuple"},{"internalType":"bool","name":"autoExit","type":"bool"},{"components":[{"internalType":"int24","name":"triggerTickLow","type":"int24"},{"internalType":"int24","name":"triggerTickHigh","type":"int24"},{"internalType":"address","name":"exitTokenOutLow","type":"address"},{"internalType":"address","name":"exitTokenOutHigh","type":"address"},{"internalType":"uint256","name":"priceImpactBP","type":"uint256"},{"internalType":"uint256","name":"slippageBP","type":"uint256"}],"internalType":"struct ExitConfig","name":"exitConfig","type":"tuple"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftSettings","name":"settings","type":"tuple"}],"name":"setNftSettings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract Sickle","name":"sickle","type":"address"},{"internalType":"contract INonfungiblePositionManager","name":"nftManager","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftKey","name":"key","type":"tuple"},{"components":[{"internalType":"contract IUniswapV3Pool","name":"pool","type":"address"},{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"bool","name":"autoRebalance","type":"bool"},{"components":[{"internalType":"uint24","name":"tickSpacesBelow","type":"uint24"},{"internalType":"uint24","name":"tickSpacesAbove","type":"uint24"},{"internalType":"int24","name":"bufferTicksBelow","type":"int24"},{"internalType":"int24","name":"bufferTicksAbove","type":"int24"},{"internalType":"uint256","name":"dustBP","type":"uint256"},{"internalType":"uint256","name":"priceImpactBP","type":"uint256"},{"internalType":"uint256","name":"slippageBP","type":"uint256"},{"internalType":"int24","name":"cutoffTickLow","type":"int24"},{"internalType":"int24","name":"cutoffTickHigh","type":"int24"},{"internalType":"uint8","name":"delayMin","type":"uint8"},{"components":[{"internalType":"enum RewardBehavior","name":"rewardBehavior","type":"uint8"},{"internalType":"address","name":"harvestTokenOut","type":"address"}],"internalType":"struct RewardConfig","name":"rewardConfig","type":"tuple"}],"internalType":"struct RebalanceConfig","name":"rebalanceConfig","type":"tuple"},{"internalType":"bool","name":"automateRewards","type":"bool"},{"components":[{"internalType":"enum RewardBehavior","name":"rewardBehavior","type":"uint8"},{"internalType":"address","name":"harvestTokenOut","type":"address"}],"internalType":"struct RewardConfig","name":"rewardConfig","type":"tuple"},{"internalType":"bool","name":"autoExit","type":"bool"},{"components":[{"internalType":"int24","name":"triggerTickLow","type":"int24"},{"internalType":"int24","name":"triggerTickHigh","type":"int24"},{"internalType":"address","name":"exitTokenOutLow","type":"address"},{"internalType":"address","name":"exitTokenOutHigh","type":"address"},{"internalType":"uint256","name":"priceImpactBP","type":"uint256"},{"internalType":"uint256","name":"slippageBP","type":"uint256"}],"internalType":"struct ExitConfig","name":"exitConfig","type":"tuple"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftSettings","name":"settings","type":"tuple"}],"name":"setNftSettings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newTimelockAdmin","type":"address"}],"name":"setTimelockAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelockAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract Sickle","name":"sickle","type":"address"},{"internalType":"contract INonfungiblePositionManager","name":"nftManager","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftKey","name":"oldKey","type":"tuple"},{"components":[{"internalType":"contract IUniswapV3Pool","name":"pool","type":"address"},{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"bool","name":"autoRebalance","type":"bool"},{"components":[{"internalType":"uint24","name":"tickSpacesBelow","type":"uint24"},{"internalType":"uint24","name":"tickSpacesAbove","type":"uint24"},{"internalType":"int24","name":"bufferTicksBelow","type":"int24"},{"internalType":"int24","name":"bufferTicksAbove","type":"int24"},{"internalType":"uint256","name":"dustBP","type":"uint256"},{"internalType":"uint256","name":"priceImpactBP","type":"uint256"},{"internalType":"uint256","name":"slippageBP","type":"uint256"},{"internalType":"int24","name":"cutoffTickLow","type":"int24"},{"internalType":"int24","name":"cutoffTickHigh","type":"int24"},{"internalType":"uint8","name":"delayMin","type":"uint8"},{"components":[{"internalType":"enum RewardBehavior","name":"rewardBehavior","type":"uint8"},{"internalType":"address","name":"harvestTokenOut","type":"address"}],"internalType":"struct RewardConfig","name":"rewardConfig","type":"tuple"}],"internalType":"struct RebalanceConfig","name":"rebalanceConfig","type":"tuple"},{"internalType":"bool","name":"automateRewards","type":"bool"},{"components":[{"internalType":"enum RewardBehavior","name":"rewardBehavior","type":"uint8"},{"internalType":"address","name":"harvestTokenOut","type":"address"}],"internalType":"struct RewardConfig","name":"rewardConfig","type":"tuple"},{"internalType":"bool","name":"autoExit","type":"bool"},{"components":[{"internalType":"int24","name":"triggerTickLow","type":"int24"},{"internalType":"int24","name":"triggerTickHigh","type":"int24"},{"internalType":"address","name":"exitTokenOutLow","type":"address"},{"internalType":"address","name":"exitTokenOutHigh","type":"address"},{"internalType":"uint256","name":"priceImpactBP","type":"uint256"},{"internalType":"uint256","name":"slippageBP","type":"uint256"}],"internalType":"struct ExitConfig","name":"exitConfig","type":"tuple"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftSettings","name":"settings","type":"tuple"}],"name":"transferNftSettings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract INonfungiblePositionManager","name":"nftManager","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"unsetNftSettings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract Sickle","name":"sickle","type":"address"},{"internalType":"contract INonfungiblePositionManager","name":"nftManager","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftKey","name":"key","type":"tuple"}],"name":"validateCompoundFor","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract Sickle","name":"sickle","type":"address"},{"internalType":"contract INonfungiblePositionManager","name":"nftManager","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftKey","name":"key","type":"tuple"}],"name":"validateExitFor","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract Sickle","name":"sickle","type":"address"},{"internalType":"contract INonfungiblePositionManager","name":"nftManager","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftKey","name":"key","type":"tuple"}],"name":"validateHarvestFor","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract Sickle","name":"sickle","type":"address"},{"internalType":"contract INonfungiblePositionManager","name":"nftManager","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftKey","name":"key","type":"tuple"}],"name":"validateRebalanceFor","outputs":[],"stateMutability":"view","type":"function"}]
Contract Creation Code
60a06040523480156200001157600080fd5b5060405162002da238038062002da2833981016040819052620000349162000106565b600054604080516001600160a01b039283168152918316602083015282917f6502ca129870a6ac685369c8428164757ede26f9a492bf9ae7eac4abc0c49fcf910160405180910390a1600080546001600160a01b03199081166001600160a01b03938416179091558482166080526001805490911691841691821790556040519081527f49ff6f7f9fa2954ed0f7b0b88e2b7297bb2168aa74304ab0a6807dae1fd29c4a9060200160405180910390a15050506200015a565b6001600160a01b03811681146200010357600080fd5b50565b6000806000606084860312156200011c57600080fd5b83516200012981620000ed565b60208501519093506200013c81620000ed565b60408501519092506200014f81620000ed565b809150509250925092565b608051612c256200017d600039600081816102080152610f660152612c256000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c80637ac5f2d81161008c578063a49a2ae411610066578063a49a2ae4146101dd578063bca9ca73146101f0578063c45a015514610203578063f1cf41821461022a57600080fd5b80637ac5f2d8146101a4578063849ef53d146101b75780638bb96a90146101ca57600080fd5b80634b105efb116100c85780634b105efb14610140578063528b4d9b1461015357806357181ab01461016657806364ceb97a1461017957600080fd5b8063228ca087146100ef5780633d55a26214610118578063459e26841461012d575b600080fd5b6101026100fd366004611dac565b61023d565b60405161010f919061202a565b60405180910390f35b61012b61012636600461205d565b61051a565b005b61012b61013b366004611dac565b610565565b61012b61014e3660046120b5565b6106ea565b61012b610161366004612181565b61086a565b61012b6101743660046121d6565b6108c0565b60005461018c906001600160a01b031681565b6040516001600160a01b03909116815260200161010f565b61012b6101b2366004612202565b610901565b61012b6101c5366004612202565b610995565b61012b6101d8366004611dac565b610a15565b61012b6101eb366004612181565b610cb9565b61012b6101fe366004611dac565b610e98565b61018c7f000000000000000000000000000000000000000000000000000000000000000081565b61012b610238366004611dac565b610eef565b610245611b57565b600260008360405160200161025a919061221f565b60408051601f1981840301815291815281516020928301208352828201939093529082016000208251610120808201855282546001600160a01b0316825260018301548285015260028084015460ff90811615158488015286516101608101885260038601805462ffffff8082168452630100000080830490911699840199909952600160301b808204860b848c0152600160481b909104850b60608481019190915260048901546080850152600589015460a0850152600689015460c0850152600789015480870b60e0860152998a04860b61010085015298048316948201949094528751808901909852600886018054959896978901969195610140870194929391928492919091169081111561037557610375611df9565b600281111561038657610386611df9565b8152905461010090046001600160a01b0316602091820152915291835250600983015460ff908116151591830191909152604080518082018252600a8501805492909401939092909183911660028111156103e3576103e3611df9565b60028111156103f4576103f4611df9565b815290546001600160a01b036101009091048116602092830152918352600b84015460ff161515838201526040805160c081018252600c860154600281810b835263010000008204900b93820193909352600160301b909204831682820152600d850154909216606080830191909152600e8501546080830152600f85015460a0830152918301526010830180549190920191906104919061224e565b80601f01602080910402602001604051908101604052809291908181526020018280546104bd9061224e565b801561050a5780601f106104df5761010080835404028352916020019161050a565b820191906000526020600020905b8154815290600101906020018083116104ed57829003601f168201915b5050505050815250509050919050565b600061052533610f42565b604080516060810182526001600160a01b0380841682528716602082015290810185905290915061055e81610559856124fe565b611000565b5050505050565b60006105708261023d565b60e081015160c08201519192509061059b576040516301d7fb3960e01b815260040160405180910390fd5b60015460208401516040516363cd755760e11b81526001600160a01b039182166004820152600092919091169063c79aeaae90602401602060405180830381865afa1580156105ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061291906125d9565b8351602085015160405163e85505e160e01b81529293506000926001600160a01b0385169263e85505e19261065d926004016001600160a01b03929092168252602082015260400190565b61012060405180830381865afa15801561067b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069f919061262c565b9050826000015160020b8160a0015160020b121580156106cc5750826020015160020b8160a0015160020b125b1561055e5760405163227b663760e11b815260040160405180910390fd5b60006106f533610f42565b825190915060005b818110156108625760006040518060600160405280856001600160a01b03168152602001876001600160a01b03168152602001868481518110610742576107426126d6565b602002602001015181525090506000876001600160a01b031663228ca087836040518263ffffffff1660e01b815260040161077d919061221f565b61030060405180830381865afa15801561079b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bf9190612874565b9050600060405180610120016040528083600001516001600160a01b031681526020016000801b815260200183602001511515815260200183604001518152602001836060015115158152602001836080015181526020018360a00151151581526020018360c00151815260200160405180602001604052806000815250815250905061084c8382611000565b505050808061085a90612943565b9150506106fd565b505050505050565b33806108796020850185612202565b6001600160a01b0316146108a05760405163b91a09e760e01b815260040160405180910390fd5b6108bb6108b236859003850185611dac565b610559846124fe565b505050565b60006108cb33610f42565b604080516060810182526001600160a01b038084168252861660208201529081018490529091506108fb816114b9565b50505050565b6000546001600160a01b0316331461092c576040516347323cef60e01b815260040160405180910390fd5b600054604080516001600160a01b03928316815291831660208301527f6502ca129870a6ac685369c8428164757ede26f9a492bf9ae7eac4abc0c49fcf910160405180910390a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146109c0576040516347323cef60e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f49ff6f7f9fa2954ed0f7b0b88e2b7297bb2168aa74304ab0a6807dae1fd29c4a906020015b60405180910390a150565b6000610a208261023d565b6060810151604082015191925090610a4b57604051631a0346d160e31b815260040160405180910390fd5b8060e0015160020b600003610a735760405163c20c00ad60e01b815260040160405180910390fd5b60015460208401516040516363cd755760e11b81526001600160a01b039182166004820152600092919091169063c79aeaae90602401602060405180830381865afa158015610ac6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aea91906125d9565b6020850151604080870151905163de91a5e560e01b81529293506000926001600160a01b0385169263de91a5e592610b38926004016001600160a01b03929092168252602082015260400190565b606060405180830381865afa158015610b55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b79919061295c565b8451602086015160405163e85505e160e01b81529293506000926001600160a01b0386169263e85505e192610bc4926004016001600160a01b03929092168252602082015260400190565b61012060405180830381865afa158015610be2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c06919061262c565b905083604001518260200151610c1c91906129ae565b60020b8160a0015160020b12158015610c51575083606001518260400151610c4491906129d3565b60020b8160a0015160020b125b15610c6f5760405163227b663760e11b815260040160405180910390fd5b8360e0015160020b8160a0015160020b131580610c9b575083610100015160020b8160a0015160020b12155b1561086257604051633015515760e01b815260040160405180910390fd5b3380610cc86020850185612202565b6001600160a01b031614610cef5760405163b91a09e760e01b815260040160405180910390fd5b6001546000906001600160a01b031663c79aeaae610d136040870160208801612202565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610d57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7b91906125d9565b905060006001600160a01b03821663b943855e610d9e6040880160208901612202565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152336024820152604401602060405180830381865afa158015610de8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0c91906129f8565b905060006040518060600160405280856001600160a01b03168152602001876020016020810190610e3d9190612202565b6001600160a01b03168152602001839052905060408601358203610e7457604051636acd1fb160e01b815260040160405180910390fd5b610e8b610e8636889003880188611dac565b6114b9565b61086281610559876124fe565b6000610ea38261023d565b905080608001511580610ecd5750600160a0820151516002811115610eca57610eca611df9565b14155b15610eeb57604051630839792d60e41b815260040160405180910390fd5b5050565b6000610efa8261023d565b905080608001511580610f245750600260a0820151516002811115610f2157610f21611df9565b14155b15610eeb576040516311447fdd60e11b815260040160405180910390fd5b6040516312cfc9b560e31b81526001600160a01b03828116600483015260009182917f0000000000000000000000000000000000000000000000000000000000000000169063967e4da890602401602060405180830381865afa158015610fad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd191906125d9565b90506001600160a01b038116610ffa57604051633098a45560e01b815260040160405180910390fd5b92915050565b6020820151829082906001600160a01b031661102f57604051638ff5790b60e01b815260040160405180910390fd5b8060400151156110555761104681606001516115f8565b6110508282611838565b611097565b606081015160e0015160020b15158061107957506060810151610100015160020b15155b1561109757604051631a0346d160e31b815260040160405180910390fd5b600160a08201515160028111156110b0576110b0611df9565b141580156110ce575060a0810151602001516001600160a01b031615155b156110eb5760405162db68fd60e51b815260040160405180910390fd5b8060c0015115611107576111028160e00151611a61565b61119f565b60e08101515160020b151580611127575060e08101516020015160020b15155b80611142575060e0810151604001516001600160a01b031615155b8061115d575060e0810151606001516001600160a01b031615155b8061116f575060e081015160a0015115155b80611181575060e08101516080015115155b1561119f576040516301d7fb3960e01b815260040160405180910390fd5b8260026000866040516020016111b5919061221f565b60408051808303601f190181529181528151602092830120835282820193909352908201600020835181546001600160a01b0319166001600160a01b0390911617815583820151600180830191909155848401516002808401805460ff19908116931515939093179055606080880151805160038701805498830151998301519383015162ffffff92831665ffffffffffff199a8b161763010000009b84168c02176bffffffffffff0000000000001916600160301b95841686026bffffff000000000000000000191617600160481b918416919091021781556080830151600489015560a0830151600589015560c0830151600689015560e083015160078901805461010086015161012087015193861691909c16179a909316909a029890981766ff000000000000191660ff909916909202979097179055610140860151805160088601805496989796929590949193859390921691849081111561131e5761131e611df9565b02179055506020919091015181546001600160a01b0390911661010002610100600160a81b03199091161790555050608082015160098201805491151560ff1992831617905560a08301518051600a8401805492939092839116600183600281111561138c5761138c611df9565b02179055506020918201518154610100600160a81b0319166101006001600160a01b0392831681029190911790925560c0850151600b8501805460ff191691151591909117905560e08501518051600c8601805495830151604084015162ffffff93841665ffffffffffff199098169790971763010000009390911692909202919091176601000000000000600160d01b031916600160301b95841695909502949094179093556060830151600d850180546001600160a01b031916919092161790556080820151600e84015560a090910151600f83015582015160108201906114769082612a57565b509050507fb566e9ef526dad3c79be7d60406d5e70e9218d05c8072728570b032e32377d4984846040516114ab929190612b16565b60405180910390a150505050565b60026000826040516020016114ce919061221f565b60408051601f19818403018152918152815160209283012083529082019290925201600090812080546001600160a01b031990811682556001820183905560028201805460ff199081169091556003830180546bffffffffffffffffffffffff1916905560048301849055600583018490556006830184905560078301805466ffffffffffffff191690556008830180546001600160a81b031990811690915560098401805483169055600a840180549091169055600b830180549091169055600c820180546001600160d01b0319169055600d820180549091169055600e8101829055600f8101829055906115c76010830182611c51565b50507faa3b569bcc3b07fe86d5ae3e76d5d1006e3078ab36159916f288c61b95d0175281604051610a0a919061221f565b611604620d89e8612b5a565b60020b8160e0015160020b121561162e5760405163d3d0c56960e01b815260040160405180910390fd5b80610100015160020b8160e0015160020b1261165d57604051634a05b96760e11b815260040160405180910390fd5b620d89e860020b81610100015160020b131561168c576040516350f3ef1960e11b815260040160405180910390fd5b61169a620d89e86002612b7c565b60020b816060015160020b13806116d057506116b8620d89e8612b5a565b6116c3906002612b7c565b60020b816060015160020b125b156116ee57604051630604be4360e01b815260040160405180910390fd5b6116fc620d89e86002612b7c565b60020b816040015160020b1380611732575061171a620d89e8612b5a565b611725906002612b7c565b60020b816040015160020b125b156117505760405163f2b07f7f60e01b815260040160405180910390fd5b6101f48160c00151111561177757604051636703cded60e01b815260040160405180910390fd5b6113888160a00151118061178d575060a0810151155b156117ab576040516330223ae760e11b815260040160405180910390fd5b611388816080015111806117c157506080810151155b156117df5760405163142b243360e31b815260040160405180910390fd5b60016101408201515160028111156117f9576117f9611df9565b141580156118185750610140810151602001516001600160a01b031615155b156118355760405162db68fd60e51b815260040160405180910390fd5b50565b60015460208301516040516363cd755760e11b81526001600160a01b039182166004820152600092919091169063c79aeaae90602401602060405180830381865afa15801561188b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118af91906125d9565b6020840151604080860151905163de91a5e560e01b81529293506000926001600160a01b0385169263de91a5e5926118fd926004016001600160a01b03929092168252602082015260400190565b606060405180830381865afa15801561191a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061193e919061295c565b8351602085015160405163e85505e160e01b81529293506000926001600160a01b0386169263e85505e192611989926004016001600160a01b03929092168252602082015260400190565b61012060405180830381865afa1580156119a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119cb919061262c565b905060008160600151836020015184604001516119e891906129ae565b6119f29190612ba3565b606086015160208101519051919250600091611a0e9190612bd3565b611a19906001612bd3565b90508062ffffff168262ffffff1614611a58576040516303c906ad60e51b815262ffffff80841660048301528216602482015260440160405180910390fd5b50505050505050565b805160020b158015611a785750602081015160020b155b15611a9657604051631463731360e21b815260040160405180910390fd5b806020015160020b816000015160020b121580611ac75750611aba620d89e8612b5a565b60020b816000015160020b125b80611ade5750620d89e860020b816020015160020b135b15611afc576040516301b08de360e01b815260040160405180910390fd5b6101f48160a001511115611b2357604051636703cded60e01b815260040160405180910390fd5b61138881608001511180611b3957506080810151155b15611835576040516330223ae760e11b815260040160405180910390fd5b60408051610120810182526000808252602082018190529181019190915260608101611be5604080516101608101825260008082526020808301829052828401829052606083018290526080830182905260a0830182905260c0830182905260e083018290526101008301829052610120830182905283518085019094528184528301529061014082015290565b815260006020820152604001611c0b604080518082019091526000808252602082015290565b8152600060208083018290526040805160c08101825283815291820183905281810183905260608083018490526080830184905260a08301939093528301529081015290565b508054611c5d9061224e565b6000825580601f10611c6d575050565b601f01602090049060005260206000209081019061183591905b80821115611c9b5760008155600101611c87565b5090565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715611cd757611cd7611c9f565b60405290565b604080519081016001600160401b0381118282101715611cd757611cd7611c9f565b60405161016081016001600160401b0381118282101715611cd757611cd7611c9f565b60405160c081016001600160401b0381118282101715611cd757611cd7611c9f565b60405161012081016001600160401b0381118282101715611cd757611cd7611c9f565b604051601f8201601f191681016001600160401b0381118282101715611d8f57611d8f611c9f565b604052919050565b6001600160a01b038116811461183557600080fd5b600060608284031215611dbe57600080fd5b611dc6611cb5565b8235611dd181611d97565b81526020830135611de181611d97565b60208201526040928301359281019290925250919050565b634e487b7160e01b600052602160045260246000fd5b805160038110611e2f57634e487b7160e01b600052602160045260246000fd5b82526020908101516001600160a01b0316910152565b805162ffffff1682526020810151611e64602084018262ffffff169052565b506040810151611e79604084018260020b9052565b506060810151611e8e606084018260020b9052565b506080810151608083015260a081015160a083015260c081015160c083015260e0810151611ec160e084018260020b9052565b5061010080820151611ed78285018260020b9052565b50506101208181015160ff1690830152610140808201516108fb82850182611e0f565b6000815180845260005b81811015611f2057602081850181015186830182015201611f04565b506000602082860101526020601f19601f83011685010191505092915050565b80516001600160a01b031682526000610340602083015160208501526040830151611f6f604086018215159052565b506060830151611f826060860182611e45565b50608083015115156101e085015260a0830151611fa3610200860182611e0f565b5060c0830151151561024085015260e08301518051600290810b6102608701526020820151900b61028086015260408101516001600160a01b039081166102a08701526060820151166102c086015260808101516102e086015260a00151610300850152610100830151610320850182905261202182860182611efa565b95945050505050565b60208152600061203d6020830184611f40565b9392505050565b6000610340828403121561205757600080fd5b50919050565b60008060006060848603121561207257600080fd5b833561207d81611d97565b92506020840135915060408401356001600160401b0381111561209f57600080fd5b6120ab86828701612044565b9150509250925092565b6000806000606084860312156120ca57600080fd5b83356120d581611d97565b92506020848101356120e681611d97565b925060408501356001600160401b038082111561210257600080fd5b818701915087601f83011261211657600080fd5b81358181111561212857612128611c9f565b8060051b9150612139848301611d67565b818152918301840191848101908a84111561215357600080fd5b938501935b8385101561217157843582529385019390850190612158565b8096505050505050509250925092565b600080828403608081121561219557600080fd5b60608112156121a357600080fd5b5082915060608301356001600160401b038111156121c057600080fd5b6121cc85828601612044565b9150509250929050565b600080604083850312156121e957600080fd5b82356121f481611d97565b946020939093013593505050565b60006020828403121561221457600080fd5b813561203d81611d97565b81516001600160a01b039081168252602080840151909116908201526040808301519082015260608101610ffa565b600181811c9082168061226257607f821691505b60208210810361205757634e487b7160e01b600052602260045260246000fd5b803561228d81611d97565b919050565b801515811461183557600080fd5b803561228d81612292565b62ffffff8116811461183557600080fd5b803561228d816122ab565b8060020b811461183557600080fd5b803561228d816122c7565b60ff8116811461183557600080fd5b803561228d816122e1565b6003811061183557600080fd5b60006040828403121561231a57600080fd5b612322611cdd565b9050813561232f816122fb565b8152602082013561233f81611d97565b602082015292915050565b6000610180828403121561235d57600080fd5b612365611cff565b9050612370826122bc565b815261237e602083016122bc565b602082015261238f604083016122d6565b60408201526123a0606083016122d6565b60608201526080820135608082015260a082013560a082015260c082013560c08201526123cf60e083016122d6565b60e08201526101006123e28184016122d6565b908201526101206123f48382016122f0565b9082015261014061240784848301612308565b9082015292915050565b600060c0828403121561242357600080fd5b61242b611d22565b90508135612438816122c7565b81526020820135612448816122c7565b6020820152604082013561245b81611d97565b6040820152606082013561246e81611d97565b806060830152506080820135608082015260a082013560a082015292915050565b600082601f8301126124a057600080fd5b81356001600160401b038111156124b9576124b9611c9f565b6124cc601f8201601f1916602001611d67565b8181528460208386010111156124e157600080fd5b816020850160208301376000918101602001919091529392505050565b6000610340823603121561251157600080fd5b612519611d44565b61252283612282565b81526020830135602082015261253a604084016122a0565b604082015261254c366060850161234a565b606082015261255e6101e084016122a0565b6080820152612571366102008501612308565b60a082015261258361024084016122a0565b60c0820152612596366102608501612411565b60e08201526103208301356001600160401b038111156125b557600080fd5b6125c13682860161248f565b6101008301525092915050565b805161228d81611d97565b6000602082840312156125eb57600080fd5b815161203d81611d97565b805161228d816122ab565b805161228d816122c7565b80516fffffffffffffffffffffffffffffffff8116811461228d57600080fd5b6000610120828403121561263f57600080fd5b612647611d44565b612650836125ce565b815261265e602084016125ce565b602082015261266f604084016125f6565b6040820152612680606084016125f6565b6060820152612691608084016125ce565b60808201526126a260a08401612601565b60a08201526126b360c0840161260c565b60c082015260e08381015190820152610100928301519281019290925250919050565b634e487b7160e01b600052603260045260246000fd5b805161228d81612292565b805161228d816122e1565b60006040828403121561271457600080fd5b61271c611cdd565b90508151612729816122fb565b8152602082015161233f81611d97565b6000610180828403121561274c57600080fd5b612754611cff565b905061275f826125f6565b815261276d602083016125f6565b602082015261277e60408301612601565b604082015261278f60608301612601565b60608201526080820151608082015260a082015160a082015260c082015160c08201526127be60e08301612601565b60e08201526101006127d1818401612601565b908201526101206127e38382016126f7565b9082015261014061240784848301612702565b600060c0828403121561280857600080fd5b612810611d22565b9050815161281d816122c7565b8152602082015161282d816122c7565b6020820152604082015161284081611d97565b6040820152606082015161285381611d97565b806060830152506080820151608082015260a082015160a082015292915050565b6000610300828403121561288757600080fd5b60405160e081018181106001600160401b03821117156128a9576128a9611c9f565b60405282516128b781611d97565b81526128c5602084016126ec565b60208201526128d78460408501612739565b60408201526128e96101c084016126ec565b60608201526128fc846101e08501612702565b608082015261290e61022084016126ec565b60a08201526129218461024085016127f6565b60c08201529392505050565b634e487b7160e01b600052601160045260246000fd5b6000600182016129555761295561292d565b5060010190565b60006060828403121561296e57600080fd5b612976611cb5565b61297f8361260c565b8152602083015161298f816122c7565b602082015260408301516129a2816122c7565b60408201529392505050565b600282810b9082900b03627fffff198112627fffff82131715610ffa57610ffa61292d565b600281810b9083900b01627fffff8113627fffff1982121715610ffa57610ffa61292d565b600060208284031215612a0a57600080fd5b5051919050565b601f8211156108bb57600081815260208120601f850160051c81016020861015612a385750805b601f850160051c820191505b8181101561086257828155600101612a44565b81516001600160401b03811115612a7057612a70611c9f565b612a8481612a7e845461224e565b84612a11565b602080601f831160018114612ab95760008415612aa15750858301515b600019600386901b1c1916600185901b178555610862565b600085815260208120601f198616915b82811015612ae857888601518255948401946001909101908401612ac9565b5085821015612b065787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b82516001600160a01b0390811682526020808501519091169082015260408084015190820152608060608201526000612b526080830184611f40565b949350505050565b60008160020b627fffff198103612b7357612b7361292d565b60000392915050565b60008260020b8260020b028060020b9150808214612b9c57612b9c61292d565b5092915050565b600062ffffff80841680612bc757634e487b7160e01b600052601260045260246000fd5b92169190910492915050565b62ffffff818116838216019080821115612b9c57612b9c61292d56fea26469706673582212202a45ea09c60f55b24100be83de937d246686a06f4922cfcbf578002dd8c1448464736f6c63430008130033000000000000000000000000233d9067677dcf1a161954d45b4c965b9d567168000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c990000000000000000000000007f4b6f10c34470ebddf5e7ab049d8dffb01f8a6f
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80637ac5f2d81161008c578063a49a2ae411610066578063a49a2ae4146101dd578063bca9ca73146101f0578063c45a015514610203578063f1cf41821461022a57600080fd5b80637ac5f2d8146101a4578063849ef53d146101b75780638bb96a90146101ca57600080fd5b80634b105efb116100c85780634b105efb14610140578063528b4d9b1461015357806357181ab01461016657806364ceb97a1461017957600080fd5b8063228ca087146100ef5780633d55a26214610118578063459e26841461012d575b600080fd5b6101026100fd366004611dac565b61023d565b60405161010f919061202a565b60405180910390f35b61012b61012636600461205d565b61051a565b005b61012b61013b366004611dac565b610565565b61012b61014e3660046120b5565b6106ea565b61012b610161366004612181565b61086a565b61012b6101743660046121d6565b6108c0565b60005461018c906001600160a01b031681565b6040516001600160a01b03909116815260200161010f565b61012b6101b2366004612202565b610901565b61012b6101c5366004612202565b610995565b61012b6101d8366004611dac565b610a15565b61012b6101eb366004612181565b610cb9565b61012b6101fe366004611dac565b610e98565b61018c7f000000000000000000000000233d9067677dcf1a161954d45b4c965b9d56716881565b61012b610238366004611dac565b610eef565b610245611b57565b600260008360405160200161025a919061221f565b60408051601f1981840301815291815281516020928301208352828201939093529082016000208251610120808201855282546001600160a01b0316825260018301548285015260028084015460ff90811615158488015286516101608101885260038601805462ffffff8082168452630100000080830490911699840199909952600160301b808204860b848c0152600160481b909104850b60608481019190915260048901546080850152600589015460a0850152600689015460c0850152600789015480870b60e0860152998a04860b61010085015298048316948201949094528751808901909852600886018054959896978901969195610140870194929391928492919091169081111561037557610375611df9565b600281111561038657610386611df9565b8152905461010090046001600160a01b0316602091820152915291835250600983015460ff908116151591830191909152604080518082018252600a8501805492909401939092909183911660028111156103e3576103e3611df9565b60028111156103f4576103f4611df9565b815290546001600160a01b036101009091048116602092830152918352600b84015460ff161515838201526040805160c081018252600c860154600281810b835263010000008204900b93820193909352600160301b909204831682820152600d850154909216606080830191909152600e8501546080830152600f85015460a0830152918301526010830180549190920191906104919061224e565b80601f01602080910402602001604051908101604052809291908181526020018280546104bd9061224e565b801561050a5780601f106104df5761010080835404028352916020019161050a565b820191906000526020600020905b8154815290600101906020018083116104ed57829003601f168201915b5050505050815250509050919050565b600061052533610f42565b604080516060810182526001600160a01b0380841682528716602082015290810185905290915061055e81610559856124fe565b611000565b5050505050565b60006105708261023d565b60e081015160c08201519192509061059b576040516301d7fb3960e01b815260040160405180910390fd5b60015460208401516040516363cd755760e11b81526001600160a01b039182166004820152600092919091169063c79aeaae90602401602060405180830381865afa1580156105ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061291906125d9565b8351602085015160405163e85505e160e01b81529293506000926001600160a01b0385169263e85505e19261065d926004016001600160a01b03929092168252602082015260400190565b61012060405180830381865afa15801561067b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069f919061262c565b9050826000015160020b8160a0015160020b121580156106cc5750826020015160020b8160a0015160020b125b1561055e5760405163227b663760e11b815260040160405180910390fd5b60006106f533610f42565b825190915060005b818110156108625760006040518060600160405280856001600160a01b03168152602001876001600160a01b03168152602001868481518110610742576107426126d6565b602002602001015181525090506000876001600160a01b031663228ca087836040518263ffffffff1660e01b815260040161077d919061221f565b61030060405180830381865afa15801561079b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bf9190612874565b9050600060405180610120016040528083600001516001600160a01b031681526020016000801b815260200183602001511515815260200183604001518152602001836060015115158152602001836080015181526020018360a00151151581526020018360c00151815260200160405180602001604052806000815250815250905061084c8382611000565b505050808061085a90612943565b9150506106fd565b505050505050565b33806108796020850185612202565b6001600160a01b0316146108a05760405163b91a09e760e01b815260040160405180910390fd5b6108bb6108b236859003850185611dac565b610559846124fe565b505050565b60006108cb33610f42565b604080516060810182526001600160a01b038084168252861660208201529081018490529091506108fb816114b9565b50505050565b6000546001600160a01b0316331461092c576040516347323cef60e01b815260040160405180910390fd5b600054604080516001600160a01b03928316815291831660208301527f6502ca129870a6ac685369c8428164757ede26f9a492bf9ae7eac4abc0c49fcf910160405180910390a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146109c0576040516347323cef60e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f49ff6f7f9fa2954ed0f7b0b88e2b7297bb2168aa74304ab0a6807dae1fd29c4a906020015b60405180910390a150565b6000610a208261023d565b6060810151604082015191925090610a4b57604051631a0346d160e31b815260040160405180910390fd5b8060e0015160020b600003610a735760405163c20c00ad60e01b815260040160405180910390fd5b60015460208401516040516363cd755760e11b81526001600160a01b039182166004820152600092919091169063c79aeaae90602401602060405180830381865afa158015610ac6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aea91906125d9565b6020850151604080870151905163de91a5e560e01b81529293506000926001600160a01b0385169263de91a5e592610b38926004016001600160a01b03929092168252602082015260400190565b606060405180830381865afa158015610b55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b79919061295c565b8451602086015160405163e85505e160e01b81529293506000926001600160a01b0386169263e85505e192610bc4926004016001600160a01b03929092168252602082015260400190565b61012060405180830381865afa158015610be2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c06919061262c565b905083604001518260200151610c1c91906129ae565b60020b8160a0015160020b12158015610c51575083606001518260400151610c4491906129d3565b60020b8160a0015160020b125b15610c6f5760405163227b663760e11b815260040160405180910390fd5b8360e0015160020b8160a0015160020b131580610c9b575083610100015160020b8160a0015160020b12155b1561086257604051633015515760e01b815260040160405180910390fd5b3380610cc86020850185612202565b6001600160a01b031614610cef5760405163b91a09e760e01b815260040160405180910390fd5b6001546000906001600160a01b031663c79aeaae610d136040870160208801612202565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610d57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7b91906125d9565b905060006001600160a01b03821663b943855e610d9e6040880160208901612202565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152336024820152604401602060405180830381865afa158015610de8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0c91906129f8565b905060006040518060600160405280856001600160a01b03168152602001876020016020810190610e3d9190612202565b6001600160a01b03168152602001839052905060408601358203610e7457604051636acd1fb160e01b815260040160405180910390fd5b610e8b610e8636889003880188611dac565b6114b9565b61086281610559876124fe565b6000610ea38261023d565b905080608001511580610ecd5750600160a0820151516002811115610eca57610eca611df9565b14155b15610eeb57604051630839792d60e41b815260040160405180910390fd5b5050565b6000610efa8261023d565b905080608001511580610f245750600260a0820151516002811115610f2157610f21611df9565b14155b15610eeb576040516311447fdd60e11b815260040160405180910390fd5b6040516312cfc9b560e31b81526001600160a01b03828116600483015260009182917f000000000000000000000000233d9067677dcf1a161954d45b4c965b9d567168169063967e4da890602401602060405180830381865afa158015610fad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd191906125d9565b90506001600160a01b038116610ffa57604051633098a45560e01b815260040160405180910390fd5b92915050565b6020820151829082906001600160a01b031661102f57604051638ff5790b60e01b815260040160405180910390fd5b8060400151156110555761104681606001516115f8565b6110508282611838565b611097565b606081015160e0015160020b15158061107957506060810151610100015160020b15155b1561109757604051631a0346d160e31b815260040160405180910390fd5b600160a08201515160028111156110b0576110b0611df9565b141580156110ce575060a0810151602001516001600160a01b031615155b156110eb5760405162db68fd60e51b815260040160405180910390fd5b8060c0015115611107576111028160e00151611a61565b61119f565b60e08101515160020b151580611127575060e08101516020015160020b15155b80611142575060e0810151604001516001600160a01b031615155b8061115d575060e0810151606001516001600160a01b031615155b8061116f575060e081015160a0015115155b80611181575060e08101516080015115155b1561119f576040516301d7fb3960e01b815260040160405180910390fd5b8260026000866040516020016111b5919061221f565b60408051808303601f190181529181528151602092830120835282820193909352908201600020835181546001600160a01b0319166001600160a01b0390911617815583820151600180830191909155848401516002808401805460ff19908116931515939093179055606080880151805160038701805498830151998301519383015162ffffff92831665ffffffffffff199a8b161763010000009b84168c02176bffffffffffff0000000000001916600160301b95841686026bffffff000000000000000000191617600160481b918416919091021781556080830151600489015560a0830151600589015560c0830151600689015560e083015160078901805461010086015161012087015193861691909c16179a909316909a029890981766ff000000000000191660ff909916909202979097179055610140860151805160088601805496989796929590949193859390921691849081111561131e5761131e611df9565b02179055506020919091015181546001600160a01b0390911661010002610100600160a81b03199091161790555050608082015160098201805491151560ff1992831617905560a08301518051600a8401805492939092839116600183600281111561138c5761138c611df9565b02179055506020918201518154610100600160a81b0319166101006001600160a01b0392831681029190911790925560c0850151600b8501805460ff191691151591909117905560e08501518051600c8601805495830151604084015162ffffff93841665ffffffffffff199098169790971763010000009390911692909202919091176601000000000000600160d01b031916600160301b95841695909502949094179093556060830151600d850180546001600160a01b031916919092161790556080820151600e84015560a090910151600f83015582015160108201906114769082612a57565b509050507fb566e9ef526dad3c79be7d60406d5e70e9218d05c8072728570b032e32377d4984846040516114ab929190612b16565b60405180910390a150505050565b60026000826040516020016114ce919061221f565b60408051601f19818403018152918152815160209283012083529082019290925201600090812080546001600160a01b031990811682556001820183905560028201805460ff199081169091556003830180546bffffffffffffffffffffffff1916905560048301849055600583018490556006830184905560078301805466ffffffffffffff191690556008830180546001600160a81b031990811690915560098401805483169055600a840180549091169055600b830180549091169055600c820180546001600160d01b0319169055600d820180549091169055600e8101829055600f8101829055906115c76010830182611c51565b50507faa3b569bcc3b07fe86d5ae3e76d5d1006e3078ab36159916f288c61b95d0175281604051610a0a919061221f565b611604620d89e8612b5a565b60020b8160e0015160020b121561162e5760405163d3d0c56960e01b815260040160405180910390fd5b80610100015160020b8160e0015160020b1261165d57604051634a05b96760e11b815260040160405180910390fd5b620d89e860020b81610100015160020b131561168c576040516350f3ef1960e11b815260040160405180910390fd5b61169a620d89e86002612b7c565b60020b816060015160020b13806116d057506116b8620d89e8612b5a565b6116c3906002612b7c565b60020b816060015160020b125b156116ee57604051630604be4360e01b815260040160405180910390fd5b6116fc620d89e86002612b7c565b60020b816040015160020b1380611732575061171a620d89e8612b5a565b611725906002612b7c565b60020b816040015160020b125b156117505760405163f2b07f7f60e01b815260040160405180910390fd5b6101f48160c00151111561177757604051636703cded60e01b815260040160405180910390fd5b6113888160a00151118061178d575060a0810151155b156117ab576040516330223ae760e11b815260040160405180910390fd5b611388816080015111806117c157506080810151155b156117df5760405163142b243360e31b815260040160405180910390fd5b60016101408201515160028111156117f9576117f9611df9565b141580156118185750610140810151602001516001600160a01b031615155b156118355760405162db68fd60e51b815260040160405180910390fd5b50565b60015460208301516040516363cd755760e11b81526001600160a01b039182166004820152600092919091169063c79aeaae90602401602060405180830381865afa15801561188b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118af91906125d9565b6020840151604080860151905163de91a5e560e01b81529293506000926001600160a01b0385169263de91a5e5926118fd926004016001600160a01b03929092168252602082015260400190565b606060405180830381865afa15801561191a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061193e919061295c565b8351602085015160405163e85505e160e01b81529293506000926001600160a01b0386169263e85505e192611989926004016001600160a01b03929092168252602082015260400190565b61012060405180830381865afa1580156119a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119cb919061262c565b905060008160600151836020015184604001516119e891906129ae565b6119f29190612ba3565b606086015160208101519051919250600091611a0e9190612bd3565b611a19906001612bd3565b90508062ffffff168262ffffff1614611a58576040516303c906ad60e51b815262ffffff80841660048301528216602482015260440160405180910390fd5b50505050505050565b805160020b158015611a785750602081015160020b155b15611a9657604051631463731360e21b815260040160405180910390fd5b806020015160020b816000015160020b121580611ac75750611aba620d89e8612b5a565b60020b816000015160020b125b80611ade5750620d89e860020b816020015160020b135b15611afc576040516301b08de360e01b815260040160405180910390fd5b6101f48160a001511115611b2357604051636703cded60e01b815260040160405180910390fd5b61138881608001511180611b3957506080810151155b15611835576040516330223ae760e11b815260040160405180910390fd5b60408051610120810182526000808252602082018190529181019190915260608101611be5604080516101608101825260008082526020808301829052828401829052606083018290526080830182905260a0830182905260c0830182905260e083018290526101008301829052610120830182905283518085019094528184528301529061014082015290565b815260006020820152604001611c0b604080518082019091526000808252602082015290565b8152600060208083018290526040805160c08101825283815291820183905281810183905260608083018490526080830184905260a08301939093528301529081015290565b508054611c5d9061224e565b6000825580601f10611c6d575050565b601f01602090049060005260206000209081019061183591905b80821115611c9b5760008155600101611c87565b5090565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715611cd757611cd7611c9f565b60405290565b604080519081016001600160401b0381118282101715611cd757611cd7611c9f565b60405161016081016001600160401b0381118282101715611cd757611cd7611c9f565b60405160c081016001600160401b0381118282101715611cd757611cd7611c9f565b60405161012081016001600160401b0381118282101715611cd757611cd7611c9f565b604051601f8201601f191681016001600160401b0381118282101715611d8f57611d8f611c9f565b604052919050565b6001600160a01b038116811461183557600080fd5b600060608284031215611dbe57600080fd5b611dc6611cb5565b8235611dd181611d97565b81526020830135611de181611d97565b60208201526040928301359281019290925250919050565b634e487b7160e01b600052602160045260246000fd5b805160038110611e2f57634e487b7160e01b600052602160045260246000fd5b82526020908101516001600160a01b0316910152565b805162ffffff1682526020810151611e64602084018262ffffff169052565b506040810151611e79604084018260020b9052565b506060810151611e8e606084018260020b9052565b506080810151608083015260a081015160a083015260c081015160c083015260e0810151611ec160e084018260020b9052565b5061010080820151611ed78285018260020b9052565b50506101208181015160ff1690830152610140808201516108fb82850182611e0f565b6000815180845260005b81811015611f2057602081850181015186830182015201611f04565b506000602082860101526020601f19601f83011685010191505092915050565b80516001600160a01b031682526000610340602083015160208501526040830151611f6f604086018215159052565b506060830151611f826060860182611e45565b50608083015115156101e085015260a0830151611fa3610200860182611e0f565b5060c0830151151561024085015260e08301518051600290810b6102608701526020820151900b61028086015260408101516001600160a01b039081166102a08701526060820151166102c086015260808101516102e086015260a00151610300850152610100830151610320850182905261202182860182611efa565b95945050505050565b60208152600061203d6020830184611f40565b9392505050565b6000610340828403121561205757600080fd5b50919050565b60008060006060848603121561207257600080fd5b833561207d81611d97565b92506020840135915060408401356001600160401b0381111561209f57600080fd5b6120ab86828701612044565b9150509250925092565b6000806000606084860312156120ca57600080fd5b83356120d581611d97565b92506020848101356120e681611d97565b925060408501356001600160401b038082111561210257600080fd5b818701915087601f83011261211657600080fd5b81358181111561212857612128611c9f565b8060051b9150612139848301611d67565b818152918301840191848101908a84111561215357600080fd5b938501935b8385101561217157843582529385019390850190612158565b8096505050505050509250925092565b600080828403608081121561219557600080fd5b60608112156121a357600080fd5b5082915060608301356001600160401b038111156121c057600080fd5b6121cc85828601612044565b9150509250929050565b600080604083850312156121e957600080fd5b82356121f481611d97565b946020939093013593505050565b60006020828403121561221457600080fd5b813561203d81611d97565b81516001600160a01b039081168252602080840151909116908201526040808301519082015260608101610ffa565b600181811c9082168061226257607f821691505b60208210810361205757634e487b7160e01b600052602260045260246000fd5b803561228d81611d97565b919050565b801515811461183557600080fd5b803561228d81612292565b62ffffff8116811461183557600080fd5b803561228d816122ab565b8060020b811461183557600080fd5b803561228d816122c7565b60ff8116811461183557600080fd5b803561228d816122e1565b6003811061183557600080fd5b60006040828403121561231a57600080fd5b612322611cdd565b9050813561232f816122fb565b8152602082013561233f81611d97565b602082015292915050565b6000610180828403121561235d57600080fd5b612365611cff565b9050612370826122bc565b815261237e602083016122bc565b602082015261238f604083016122d6565b60408201526123a0606083016122d6565b60608201526080820135608082015260a082013560a082015260c082013560c08201526123cf60e083016122d6565b60e08201526101006123e28184016122d6565b908201526101206123f48382016122f0565b9082015261014061240784848301612308565b9082015292915050565b600060c0828403121561242357600080fd5b61242b611d22565b90508135612438816122c7565b81526020820135612448816122c7565b6020820152604082013561245b81611d97565b6040820152606082013561246e81611d97565b806060830152506080820135608082015260a082013560a082015292915050565b600082601f8301126124a057600080fd5b81356001600160401b038111156124b9576124b9611c9f565b6124cc601f8201601f1916602001611d67565b8181528460208386010111156124e157600080fd5b816020850160208301376000918101602001919091529392505050565b6000610340823603121561251157600080fd5b612519611d44565b61252283612282565b81526020830135602082015261253a604084016122a0565b604082015261254c366060850161234a565b606082015261255e6101e084016122a0565b6080820152612571366102008501612308565b60a082015261258361024084016122a0565b60c0820152612596366102608501612411565b60e08201526103208301356001600160401b038111156125b557600080fd5b6125c13682860161248f565b6101008301525092915050565b805161228d81611d97565b6000602082840312156125eb57600080fd5b815161203d81611d97565b805161228d816122ab565b805161228d816122c7565b80516fffffffffffffffffffffffffffffffff8116811461228d57600080fd5b6000610120828403121561263f57600080fd5b612647611d44565b612650836125ce565b815261265e602084016125ce565b602082015261266f604084016125f6565b6040820152612680606084016125f6565b6060820152612691608084016125ce565b60808201526126a260a08401612601565b60a08201526126b360c0840161260c565b60c082015260e08381015190820152610100928301519281019290925250919050565b634e487b7160e01b600052603260045260246000fd5b805161228d81612292565b805161228d816122e1565b60006040828403121561271457600080fd5b61271c611cdd565b90508151612729816122fb565b8152602082015161233f81611d97565b6000610180828403121561274c57600080fd5b612754611cff565b905061275f826125f6565b815261276d602083016125f6565b602082015261277e60408301612601565b604082015261278f60608301612601565b60608201526080820151608082015260a082015160a082015260c082015160c08201526127be60e08301612601565b60e08201526101006127d1818401612601565b908201526101206127e38382016126f7565b9082015261014061240784848301612702565b600060c0828403121561280857600080fd5b612810611d22565b9050815161281d816122c7565b8152602082015161282d816122c7565b6020820152604082015161284081611d97565b6040820152606082015161285381611d97565b806060830152506080820151608082015260a082015160a082015292915050565b6000610300828403121561288757600080fd5b60405160e081018181106001600160401b03821117156128a9576128a9611c9f565b60405282516128b781611d97565b81526128c5602084016126ec565b60208201526128d78460408501612739565b60408201526128e96101c084016126ec565b60608201526128fc846101e08501612702565b608082015261290e61022084016126ec565b60a08201526129218461024085016127f6565b60c08201529392505050565b634e487b7160e01b600052601160045260246000fd5b6000600182016129555761295561292d565b5060010190565b60006060828403121561296e57600080fd5b612976611cb5565b61297f8361260c565b8152602083015161298f816122c7565b602082015260408301516129a2816122c7565b60408201529392505050565b600282810b9082900b03627fffff198112627fffff82131715610ffa57610ffa61292d565b600281810b9083900b01627fffff8113627fffff1982121715610ffa57610ffa61292d565b600060208284031215612a0a57600080fd5b5051919050565b601f8211156108bb57600081815260208120601f850160051c81016020861015612a385750805b601f850160051c820191505b8181101561086257828155600101612a44565b81516001600160401b03811115612a7057612a70611c9f565b612a8481612a7e845461224e565b84612a11565b602080601f831160018114612ab95760008415612aa15750858301515b600019600386901b1c1916600185901b178555610862565b600085815260208120601f198616915b82811015612ae857888601518255948401946001909101908401612ac9565b5085821015612b065787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b82516001600160a01b0390811682526020808501519091169082015260408084015190820152608060608201526000612b526080830184611f40565b949350505050565b60008160020b627fffff198103612b7357612b7361292d565b60000392915050565b60008260020b8260020b028060020b9150808214612b9c57612b9c61292d565b5092915050565b600062ffffff80841680612bc757634e487b7160e01b600052601260045260246000fd5b92169190910492915050565b62ffffff818116838216019080821115612b9c57612b9c61292d56fea26469706673582212202a45ea09c60f55b24100be83de937d246686a06f4922cfcbf578002dd8c1448464736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000233d9067677dcf1a161954d45b4c965b9d567168000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c990000000000000000000000007f4b6f10c34470ebddf5e7ab049d8dffb01f8a6f
-----Decoded View---------------
Arg [0] : _factory (address): 0x233D9067677dCf1a161954D45B4C965B9d567168
Arg [1] : connectorRegistry (address): 0xc6013E57a0811C7111A8fB07ACd2E248D9489C99
Arg [2] : timelockAdmin (address): 0x7f4b6f10C34470ebDdF5E7ab049d8DFFb01F8A6f
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000233d9067677dcf1a161954d45b4c965b9d567168
Arg [1] : 000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c99
Arg [2] : 0000000000000000000000007f4b6f10c34470ebddf5e7ab049d8dffb01f8a6f
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.