Source Code
Overview
HYPE Balance
HYPE Value
$0.00Latest 25 from a total of 2,616 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Deposit | 7819175 | 1 hr ago | IN | 0 HYPE | 0.00087301 | ||||
Deposit | 7814071 | 2 hrs ago | IN | 44.94784107 HYPE | 0.00009085 | ||||
Simple Exit | 7785218 | 10 hrs ago | IN | 0 HYPE | 0.00007147 | ||||
Exit | 7780887 | 11 hrs ago | IN | 0 HYPE | 0.00005997 | ||||
Increase | 7776007 | 13 hrs ago | IN | 0 HYPE | 0.00003945 | ||||
Exit | 7775702 | 13 hrs ago | IN | 0 HYPE | 0.00005482 | ||||
Simple Deposit | 7774663 | 13 hrs ago | IN | 0 HYPE | 0.00019086 | ||||
Decrease | 7771554 | 14 hrs ago | IN | 0 HYPE | 0.00004949 | ||||
Simple Harvest | 7770517 | 14 hrs ago | IN | 0 HYPE | 0.00002535 | ||||
Increase | 7770395 | 14 hrs ago | IN | 0 HYPE | 0.00003962 | ||||
Move | 7770029 | 14 hrs ago | IN | 0 HYPE | 0.0001023 | ||||
Move | 7769846 | 14 hrs ago | IN | 0 HYPE | 0.00011504 | ||||
Simple Deposit | 7769663 | 14 hrs ago | IN | 0 HYPE | 0.00002701 | ||||
Simple Harvest | 7768748 | 15 hrs ago | IN | 0 HYPE | 0.00002458 | ||||
Move | 7768504 | 15 hrs ago | IN | 0 HYPE | 0.00010533 | ||||
Increase | 7768321 | 15 hrs ago | IN | 0 HYPE | 0.00004955 | ||||
Decrease | 7767589 | 15 hrs ago | IN | 0 HYPE | 0.00003241 | ||||
Simple Deposit | 7767345 | 15 hrs ago | IN | 0 HYPE | 0.00002701 | ||||
Simple Deposit | 7767223 | 15 hrs ago | IN | 0 HYPE | 0.0000316 | ||||
Exit | 7762797 | 16 hrs ago | IN | 0 HYPE | 0.00006796 | ||||
Simple Exit | 7761916 | 17 hrs ago | IN | 0 HYPE | 0.00009602 | ||||
Simple Deposit | 7756548 | 18 hrs ago | IN | 0 HYPE | 0.00003384 | ||||
Deposit | 7755694 | 18 hrs ago | IN | 0 HYPE | 0.00189538 | ||||
Simple Deposit | 7744621 | 21 hrs ago | IN | 0 HYPE | 0.0000416 | ||||
Simple Exit | 7690041 | 36 hrs ago | IN | 0 HYPE | 0.0001044 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
7814071 | 2 hrs ago | 44.94784107 HYPE | ||||
7667488 | 42 hrs ago | 5 HYPE | ||||
7666573 | 43 hrs ago | 0.90614645 HYPE | ||||
7663889 | 43 hrs ago | 2 HYPE | ||||
7608562 | 2 days ago | 0.67487533 HYPE | ||||
7576695 | 2 days ago | 147.24757103 HYPE | ||||
7450680 | 4 days ago | 28 HYPE | ||||
7423735 | 4 days ago | 5 HYPE | ||||
7408866 | 4 days ago | 2 HYPE | ||||
7385499 | 4 days ago | 182 HYPE | ||||
7384112 | 5 days ago | 72 HYPE | ||||
7379014 | 5 days ago | 8.17858093 HYPE | ||||
7377381 | 5 days ago | 37.53151007 HYPE | ||||
7334168 | 5 days ago | 4 HYPE | ||||
7290030 | 6 days ago | 0.00042006 HYPE | ||||
7290008 | 6 days ago | 0.00089767 HYPE | ||||
7251540 | 6 days ago | 54 HYPE | ||||
7251470 | 6 days ago | 0.28450788 HYPE | ||||
7249920 | 6 days ago | 2 HYPE | ||||
7141579 | 7 days ago | 0.00050464 HYPE | ||||
7006325 | 9 days ago | 0.15244865 HYPE | ||||
6924044 | 10 days ago | 0.035 HYPE | ||||
6923983 | 10 days ago | 0.035 HYPE | ||||
6809843 | 11 days ago | 19 HYPE | ||||
6772506 | 11 days ago | 0.66 HYPE |
Loading...
Loading
Contract Name:
NftFarmStrategy
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { IERC721Enumerable } from "lib/openzeppelin-contracts/contracts/interfaces/IERC721Enumerable.sol"; import { INonfungiblePositionManager } from "contracts/interfaces/external/uniswap/INonfungiblePositionManager.sol"; import { IUniswapV3Pool, IUniswapV3PoolImmutables } from "contracts/interfaces/external/uniswap/IUniswapV3Pool.sol"; import { StrategyModule, SickleFactory, Sickle } from "contracts/modules/StrategyModule.sol"; import { ConnectorRegistry } from "contracts/ConnectorRegistry.sol"; import { INftFarmConnector } from "contracts/interfaces/INftFarmConnector.sol"; import { INftLiquidityConnector } from "contracts/interfaces/INftLiquidityConnector.sol"; import { INftSettingsRegistry, NftKey } from "contracts/interfaces/INftSettingsRegistry.sol"; import { INftTransferLib } from "contracts/interfaces/libraries/INftTransferLib.sol"; import { IFeesLib } from "contracts/interfaces/libraries/IFeesLib.sol"; import { ITransferLib } from "contracts/interfaces/libraries/ITransferLib.sol"; import { ISwapLib } from "contracts/interfaces/libraries/ISwapLib.sol"; import { INftZapLib } from "contracts/interfaces/libraries/INftZapLib.sol"; import { INftSettingsLib } from "contracts/interfaces/libraries/INftSettingsLib.sol"; import { NftFarmStrategyEvents } from "contracts/events/NftFarmStrategyEvents.sol"; import { INftAutomation } from "contracts/interfaces/INftAutomation.sol"; import { NftZapIn } from "contracts/structs/NftZapStructs.sol"; import { Farm } from "contracts/structs/FarmStrategyStructs.sol"; import { NftPosition, NftDeposit, NftIncrease, NftWithdraw, NftHarvest, NftCompound, NftRebalance, NftMove, SimpleNftHarvest } from "contracts/structs/NftFarmStrategyStructs.sol"; import { NftSettings } from "contracts/structs/NftSettingsStructs.sol"; library NftFarmStrategyFees { bytes4 constant Deposit = bytes4(keccak256("FarmDepositFee")); bytes4 constant Harvest = bytes4(keccak256("FarmHarvestFee")); bytes4 constant Compound = bytes4(keccak256("FarmCompoundFee")); bytes4 constant Withdraw = bytes4(keccak256("FarmWithdrawFee")); bytes4 constant HarvestFor = bytes4(keccak256("FarmHarvestForFee")); bytes4 constant CompoundFor = bytes4(keccak256("FarmCompoundForFee")); bytes4 constant RebalanceLow = bytes4(keccak256("RebalanceLowFee")); bytes4 constant RebalanceMid = bytes4(keccak256("RebalanceMidFee")); bytes4 constant RebalanceHigh = bytes4(keccak256("RebalanceHighFee")); } contract NftFarmStrategy is StrategyModule, NftFarmStrategyEvents, INftAutomation { uint256 constant REBALANCE_LOW_FEE_BPS = 500; // 0.05% uint256 constant REBALANCE_MID_FEE_BPS = 3000; // 0.3% error PleaseUseIncrease(); error NftSupplyChanged(); error NftSupplyDidntIncrease(); struct Libraries { INftTransferLib nftTransferLib; ITransferLib transferLib; ISwapLib swapLib; IFeesLib feesLib; INftZapLib nftZapLib; INftSettingsLib nftSettingsLib; } INftTransferLib public immutable nftTransferLib; INftZapLib public immutable nftZapLib; ISwapLib public immutable swapLib; ITransferLib public immutable transferLib; IFeesLib public immutable feesLib; INftSettingsLib public immutable nftSettingsLib; INftSettingsRegistry public immutable nftSettingsRegistry; address public immutable strategyAddress; constructor( SickleFactory factory, ConnectorRegistry connectorRegistry, INftSettingsRegistry nftSettingsRegistry_, Libraries memory libraries ) StrategyModule(factory, connectorRegistry) { nftTransferLib = libraries.nftTransferLib; nftZapLib = libraries.nftZapLib; swapLib = libraries.swapLib; transferLib = libraries.transferLib; feesLib = libraries.feesLib; nftSettingsLib = libraries.nftSettingsLib; nftSettingsRegistry = nftSettingsRegistry_; strategyAddress = address(this); } /** * @notice Deposits tokens into the farm, creating a new NFT position. * @param params The parameters for the deposit. * @param settings The automation settings to be applied to the NFT. * @param sweepTokens The tokens to be swept at the end of the deposit. * @param approved The address approved to manage automation (used when * deploying a new Sickle only). * @param referralCode The referral code for tracking purposes (used when * deploying a new Sickle only). */ function deposit( NftDeposit calldata params, NftSettings calldata settings, address[] calldata sweepTokens, address approved, bytes32 referralCode ) external payable { if (params.increase.zap.addLiquidityParams.tokenId != 0) { revert PleaseUseIncrease(); } INftLiquidityConnector liquidityConnector = INftLiquidityConnector( connectorRegistry.connectorOf(address(params.nft)) ); uint256 initialSupply = liquidityConnector.totalSupply(address(params.nft)); Sickle sickle = getOrDeploySickle(msg.sender, approved, referralCode); _transferInTokens(sickle, params.increase); _zapIn(sickle, params.increase.zap); uint256 tokenId = liquidityConnector.getTokenId(address(params.nft), address(sickle)); _depositNft( sickle, NftPosition({ farm: params.farm, nft: params.nft, tokenId: tokenId }), params.increase.extraData ); _setNftSettings(sickle, params.nft, tokenId, settings); _sweep(sickle, sweepTokens); if ( initialSupply >= liquidityConnector.totalSupply(address(params.nft)) ) { revert NftSupplyDidntIncrease(); } } /** * @notice Withdraws from the NFT farm and breaks the NFT position. * @param position The position details of the NFT to be withdrawn. * @param params The parameters for the withdrawal. * @param sweepTokens The tokens to be swept at the end of the withdrawal. */ function withdraw( NftPosition calldata position, NftWithdraw calldata params, address[] calldata sweepTokens ) external { Sickle sickle = getSickle(msg.sender); bytes4 fee = params.zap.swaps.length > 0 ? NftFarmStrategyFees.Withdraw : bytes4(0); _withdraw(sickle, position, params, fee); _sweep(sickle, sweepTokens); } /** * @notice Harvests rewards from the NFT farm. * @param position The position details of the NFT to be harvested. * @param params The parameters for the harvest. */ function harvest( NftPosition calldata position, NftHarvest calldata params ) external { Sickle sickle = getSickle(msg.sender); _harvest(sickle, position, params, NftFarmStrategyFees.Harvest); } /** * @notice Compounds the NFT farm. * @param position The position details of the NFT to be compounded. * @param params The parameters for the compound. * @param inPlace Whether to compound in place (without withdrawing). * @param sweepTokens The tokens to be swept at the end of the compound. */ function compound( NftPosition calldata position, NftCompound calldata params, bool inPlace, // Compound without withdrawing address[] calldata sweepTokens ) external nftSupplyUnchanged(position.nft) { Sickle sickle = getSickle(msg.sender); _compound( sickle, position, params, inPlace, sweepTokens, NftFarmStrategyFees.Compound ); } /** * @notice Exits an NFT from the NFT farm (harvests and withdraws). * @param position The position details of the NFT to be exited. * @param harvestParams The parameters for the harvest. * @param withdrawParams The parameters for the withdrawal. * @param sweepTokens The tokens to be swept at the end of the exit. */ function exit( NftPosition calldata position, NftHarvest calldata harvestParams, NftWithdraw calldata withdrawParams, address[] calldata sweepTokens ) external { Sickle sickle = getSickle(msg.sender); _exit(sickle, position, harvestParams, withdrawParams, sweepTokens); } /** * @notice Rebalances the NFT position. * @param params The parameters for the rebalance. * @param sweepTokens The tokens to be swept at the end of the rebalance. */ function rebalance( NftRebalance calldata params, address[] calldata sweepTokens ) external { Sickle sickle = getSickle(msg.sender); _rebalance(sickle, params, sweepTokens, NftFarmStrategyFees.Harvest); } /** * @notice Withdraws from the current farm and deposits into a new farm. * @param params The parameters for the move. * @param settings The automation settings to be applied to the new NFT. * @param sweepTokens The tokens to be swept at the end of the move. */ function move( NftMove calldata params, NftSettings calldata settings, address[] calldata sweepTokens ) external { Sickle sickle = getSickle(msg.sender); _harvest( sickle, params.position, params.harvest, NftFarmStrategyFees.Harvest ); _withdraw( sickle, params.position, params.withdraw, _getRebalanceFee( params.position.nft, params.pool, params.position.tokenId ) ); _zapIn(sickle, params.deposit.increase.zap); uint256 tokenId = INftLiquidityConnector( connectorRegistry.connectorOf(address(params.position.nft)) ).getTokenId(address(params.position.nft), address(sickle)); _depositNft( sickle, NftPosition({ farm: params.deposit.farm, nft: params.deposit.nft, tokenId: tokenId }), params.deposit.increase.extraData ); _setNftSettings(sickle, params.deposit.nft, tokenId, settings); _sweep(sickle, sweepTokens); _emitMoveEvent( sickle, params.position, params.deposit.nft, params.deposit.farm, tokenId ); } // Required due to stack too deep error function _emitMoveEvent( Sickle sickle, NftPosition calldata positionFrom, INonfungiblePositionManager nftTo, Farm calldata farmTo, uint256 tokenId ) internal { emit SickleMovedNft( sickle, positionFrom.nft, positionFrom.tokenId, positionFrom.farm.stakingContract, positionFrom.farm.poolIndex, nftTo, tokenId, farmTo.stakingContract, farmTo.poolIndex ); } /** * @notice Increases the NFT position. * @param position The position details of the NFT to be increased. * @param harvestParams The parameters for the harvest. * @param increaseParams The parameters for the increase. * @param inPlace Whether to increase in place (without withdrawing). * @param sweepTokens The tokens to be swept at the end of the increase. */ function increase( NftPosition calldata position, NftHarvest calldata harvestParams, NftIncrease calldata increaseParams, bool inPlace, // Increase without withdrawing address[] calldata sweepTokens ) external payable nftSupplyUnchanged(position.nft) { Sickle sickle = getSickle(msg.sender); if (!inPlace) { _harvest( sickle, position, harvestParams, NftFarmStrategyFees.Harvest ); _withdrawNft(sickle, position, increaseParams.extraData); } _transferInTokens(sickle, increaseParams); _zapIn(sickle, increaseParams.zap); if (!inPlace) { _depositNft(sickle, position, increaseParams.extraData); } _sweep(sickle, sweepTokens); emit SickleIncreasedNft( sickle, position.nft, position.tokenId, position.farm.stakingContract, position.farm.poolIndex ); } /** * @notice Decreases the NFT position. * @param position The position details of the NFT to be decreased. * @param harvestParams The parameters for the harvest. * @param withdrawParams The parameters for the withdrawal. * @param inPlace Whether to decrease in place (without withdrawing). * @param sweepTokens The tokens to be swept at the end of the decrease. */ function decrease( NftPosition calldata position, NftHarvest calldata harvestParams, NftWithdraw calldata withdrawParams, bool inPlace, address[] calldata sweepTokens ) external nftSupplyUnchanged(position.nft) { Sickle sickle = getSickle(msg.sender); if (!inPlace) { _harvest( sickle, position, harvestParams, NftFarmStrategyFees.Harvest ); _withdrawNft(sickle, position, withdrawParams.extraData); } bytes4 fee = withdrawParams.zap.swaps.length > 0 ? NftFarmStrategyFees.Withdraw : bytes4(0); _zapOut(sickle, withdrawParams, fee); if (!inPlace) { _depositNft(sickle, position, withdrawParams.extraData); } _sweep(sickle, sweepTokens); _emitDecreaseEvent(sickle, position); } function _emitDecreaseEvent( Sickle sickle, NftPosition calldata position ) internal { emit SickleDecreasedNft( sickle, position.nft, position.tokenId, position.farm.stakingContract, position.farm.poolIndex ); } /* Simple actions (non-swap) */ /** * @notice Deposits an NFT into the farm strategy. * @param position The position details of the NFT to be deposited. * @param extraData Additional data required for the deposit (optional). * @param settings The automation settings to be applied to the NFT. * @param approved The address approved to manage automation (used when * deploying a new Sickle only). * @param referralCode The referral code for tracking purposes (used when * deploying a new Sickle only). */ function simpleDeposit( NftPosition calldata position, bytes calldata extraData, NftSettings calldata settings, address approved, bytes32 referralCode ) public { Sickle sickle = getOrDeploySickle(msg.sender, approved, referralCode); _transferInNft(sickle, position.nft, position.tokenId); _depositNft(sickle, position, extraData); _setNftSettings(sickle, position.nft, position.tokenId, settings); } /** * @notice Harvests rewards from the NFT farm without swapping. * @param position The position details of the NFT to be harvested. * @param params The parameters for the harvest. */ function simpleHarvest( NftPosition calldata position, SimpleNftHarvest calldata params ) external { Sickle sickle = getSickle(msg.sender); _simpleHarvest(sickle, position, params); } /** * @notice Withdraws an NFT from the NFT farm. * @param position The position details of the NFT to be withdrawn. * @param extraData Additional data required for the withdrawal (optional). */ function simpleWithdraw( NftPosition calldata position, bytes calldata extraData ) public { Sickle sickle = getSickle(msg.sender); _withdrawNft(sickle, position, extraData); _transferOutNft(sickle, position.nft, position.tokenId); emit SickleWithdrewNft( sickle, position.nft, position.tokenId, position.farm.stakingContract, position.farm.poolIndex ); } /** * @notice Exits an NFT from the NFT farm without swapping. * @param position The position details of the NFT to be exited. * @param harvestParams The parameters for the harvest. * @param withdrawExtraData Additional data required for the withdrawal * (optional). */ function simpleExit( NftPosition calldata position, SimpleNftHarvest calldata harvestParams, bytes calldata withdrawExtraData ) public { Sickle sickle = getSickle(msg.sender); _simpleHarvest(sickle, position, harvestParams); _withdrawNft(sickle, position, withdrawExtraData); _transferOutNft(sickle, position.nft, position.tokenId); emit SickleExitedNft( sickle, position.nft, position.tokenId, position.farm.stakingContract, position.farm.poolIndex ); } /* Automation */ /** * @notice Harvests rewards from the NFT farm. * Can only be called by the approved address on the Sickle. * @param position The position details of the NFT to be harvested. * @param params The parameters for the harvest. */ function harvestFor( Sickle sickle, NftPosition calldata position, NftHarvest calldata params ) external override onlyApproved(sickle) { nftSettingsRegistry.validateHarvestFor( NftKey({ sickle: sickle, nftManager: position.nft, tokenId: position.tokenId }) ); _harvest(sickle, position, params, NftFarmStrategyFees.HarvestFor); } /** * @notice Compounds the NFT farm. * Can only be called by the approved address on the Sickle. * @param position The position details of the NFT to be compounded. * @param params The parameters for the compound. * @param inPlace Whether to compound in place. * @param sweepTokens The tokens to be swept. */ function compoundFor( Sickle sickle, NftPosition calldata position, NftCompound calldata params, bool inPlace, address[] calldata sweepTokens ) external override onlyApproved(sickle) { nftSettingsRegistry.validateCompoundFor( NftKey({ sickle: sickle, nftManager: position.nft, tokenId: position.tokenId }) ); _compound( sickle, position, params, inPlace, sweepTokens, NftFarmStrategyFees.CompoundFor ); } /** * @notice Exits an NFT from the NFT farm. * Can only be called by the approved address on the Sickle. * @param position The position details of the NFT to be exited. * @param harvestParams The parameters for the harvest. * @param withdrawParams The parameters for the withdrawal. * @param sweepTokens The tokens to be swept. */ function exitFor( Sickle sickle, NftPosition calldata position, NftHarvest calldata harvestParams, NftWithdraw calldata withdrawParams, address[] calldata sweepTokens ) external override onlyApproved(sickle) { nftSettingsRegistry.validateExitFor( NftKey({ sickle: sickle, nftManager: position.nft, tokenId: position.tokenId }) ); _exit(sickle, position, harvestParams, withdrawParams, sweepTokens); } /** * @notice Rebalances the NFT farm. * Can only be called by the approved address on the Sickle. * @param params The parameters for the rebalance. * @param sweepTokens The tokens to be swept. */ function rebalanceFor( Sickle sickle, NftRebalance calldata params, address[] calldata sweepTokens ) external override onlyApproved(sickle) { nftSettingsRegistry.validateRebalanceFor( NftKey({ sickle: sickle, nftManager: params.position.nft, tokenId: params.position.tokenId }) ); _rebalance(sickle, params, sweepTokens, NftFarmStrategyFees.HarvestFor); } /* Modifiers */ modifier nftSupplyUnchanged( INonfungiblePositionManager nft ) { INftLiquidityConnector liquidityConnector = INftLiquidityConnector(connectorRegistry.connectorOf(address(nft))); uint256 initialSupply = liquidityConnector.totalSupply(address(nft)); _; if (initialSupply != liquidityConnector.totalSupply(address(nft))) { revert NftSupplyChanged(); } } /* Private */ function _withdraw( Sickle sickle, NftPosition calldata position, NftWithdraw calldata params, bytes4 withdrawalFee ) internal { _withdrawNft(sickle, position, params.extraData); _zapOut(sickle, params, withdrawalFee); } function _harvest( Sickle sickle, NftPosition calldata position, NftHarvest calldata params, bytes4 fee ) private { if (params.swaps.length > 0) { _claimAndSwap(sickle, position, params); } else { _claim(sickle, position, params.harvest, fee); } if (params.sweepTokens.length > 0) { _sweep(sickle, params.sweepTokens); } emit SickleHarvestedNft( sickle, position.nft, position.tokenId, position.farm.stakingContract, position.farm.poolIndex ); } function _simpleHarvest( Sickle sickle, NftPosition calldata position, SimpleNftHarvest calldata params ) private { _claim(sickle, position, params, NftFarmStrategyFees.Harvest); _sweep(sickle, params.rewardTokens); emit SickleHarvestedNft( sickle, position.nft, position.tokenId, position.farm.stakingContract, position.farm.poolIndex ); } function _compound( Sickle sickle, NftPosition calldata position, NftCompound calldata params, bool inPlace, address[] calldata sweepTokens, bytes4 fee ) private { _claim(sickle, position, params.harvest, fee); if (!inPlace) { _withdrawNft(sickle, position, params.harvest.extraData); } _zapIn(sickle, params.zap); if (!inPlace) { _depositNft(sickle, position, params.harvest.extraData); } _sweep(sickle, sweepTokens); emit SickleCompoundedNft( sickle, position.nft, position.tokenId, position.farm.stakingContract, position.farm.poolIndex ); } function _exit( Sickle sickle, NftPosition calldata position, NftHarvest calldata harvestParams, NftWithdraw calldata withdrawParams, address[] calldata sweepTokens ) private { _harvest(sickle, position, harvestParams, NftFarmStrategyFees.Harvest); _withdraw( sickle, position, withdrawParams, NftFarmStrategyFees.Withdraw ); _sweep(sickle, sweepTokens); emit SickleExitedNft( sickle, position.nft, position.tokenId, position.farm.stakingContract, position.farm.poolIndex ); } function _rebalance( Sickle sickle, NftRebalance calldata params, address[] calldata sweepTokens, bytes4 harvestFee ) private { _harvest(sickle, params.position, params.harvest, harvestFee); _withdraw( sickle, params.position, params.withdraw, _getRebalanceFee( params.position.nft, params.pool, params.position.tokenId ) ); _zapIn(sickle, params.increase.zap); _resetNftSettings(sickle, params.position.nft, params.position.tokenId); uint256 tokenId = INftLiquidityConnector( connectorRegistry.connectorOf(address(params.position.nft)) ).getTokenId(address(params.position.nft), address(sickle)); _depositNft( sickle, NftPosition({ farm: params.position.farm, nft: params.position.nft, tokenId: tokenId }), params.increase.extraData ); _sweep(sickle, sweepTokens); emit SickleRebalancedNft( sickle, params.position.nft, params.position.tokenId, params.position.farm.stakingContract, params.position.farm.poolIndex ); } /* Building blocks */ function _transferInTokens( Sickle sickle, NftIncrease calldata params ) private { bytes4 fee = params.zap.swaps.length > 0 ? NftFarmStrategyFees.Deposit : bytes4(0); address[] memory targets = new address[](1); bytes[] memory data = new bytes[](1); targets[0] = address(transferLib); data[0] = abi.encodeCall( ITransferLib.transferTokensFromUser, (params.tokensIn, params.amountsIn, strategyAddress, fee) ); sickle.multicall{ value: msg.value }(targets, data); } function _transferInNft( Sickle sickle, INonfungiblePositionManager nft, uint256 tokenId ) private { address[] memory targets = new address[](1); bytes[] memory data = new bytes[](1); targets[0] = address(nftTransferLib); data[0] = abi.encodeCall( INftTransferLib.transferErc721FromUser, (nft, tokenId) ); sickle.multicall(targets, data); } function _transferOutNft( Sickle sickle, INonfungiblePositionManager nft, uint256 tokenId ) private { address[] memory targets = new address[](1); bytes[] memory data = new bytes[](1); targets[0] = address(nftTransferLib); data[0] = abi.encodeCall(INftTransferLib.transferErc721ToUser, (nft, tokenId)); sickle.multicall(targets, data); } function _depositNft( Sickle sickle, NftPosition memory position, bytes calldata extraData ) private { address farmConnector = connectorRegistry.connectorOf(position.farm.stakingContract); address[] memory targets = new address[](1); bytes[] memory data = new bytes[](1); targets[0] = farmConnector; data[0] = abi.encodeCall( INftFarmConnector.depositExistingNft, (position, extraData) ); sickle.multicall(targets, data); emit SickleDepositedNft( sickle, position.nft, position.tokenId, position.farm.stakingContract, position.farm.poolIndex ); } function _withdrawNft( Sickle sickle, NftPosition calldata position, bytes calldata extraData ) private { address[] memory targets = new address[](1); bytes[] memory data = new bytes[](1); address farmConnector = connectorRegistry.connectorOf(position.farm.stakingContract); targets[0] = farmConnector; data[0] = abi.encodeCall(INftFarmConnector.withdrawNft, (position, extraData)); sickle.multicall(targets, data); emit SickleWithdrewNft( sickle, position.nft, position.tokenId, position.farm.stakingContract, position.farm.poolIndex ); } // Claim, swap then charge fees on the output function _claimAndSwap( Sickle sickle, NftPosition calldata position, NftHarvest calldata params ) private { address farmConnector = connectorRegistry.connectorOf(position.farm.stakingContract); address[] memory targets = new address[](3); bytes[] memory data = new bytes[](3); targets[0] = farmConnector; data[0] = abi.encodeCall( INftFarmConnector.claim, ( position, params.harvest.rewardTokens, params.harvest.amount0Max, params.harvest.amount1Max, params.harvest.extraData ) ); targets[1] = address(swapLib); data[1] = abi.encodeCall(ISwapLib.swapMultiple, (params.swaps)); targets[2] = address(feesLib); data[2] = abi.encodeCall( IFeesLib.chargeFees, (strategyAddress, NftFarmStrategyFees.Harvest, params.outputTokens) ); sickle.multicall(targets, data); } // Claim then charge fees on the reward tokens function _claim( Sickle sickle, NftPosition calldata position, SimpleNftHarvest calldata params, bytes4 fee ) private { address farmConnector = connectorRegistry.connectorOf(position.farm.stakingContract); address[] memory targets = new address[](2); bytes[] memory data = new bytes[](2); targets[0] = farmConnector; data[0] = abi.encodeCall( INftFarmConnector.claim, ( position, params.rewardTokens, params.amount0Max, params.amount1Max, params.extraData ) ); targets[1] = address(feesLib); data[1] = abi.encodeCall( IFeesLib.chargeFees, (strategyAddress, fee, params.rewardTokens) ); sickle.multicall(targets, data); } function _zapIn(Sickle sickle, NftZapIn calldata zap) private { address[] memory targets = new address[](1); bytes[] memory data = new bytes[](1); targets[0] = address(nftZapLib); data[0] = abi.encodeCall(INftZapLib.zapIn, (zap)); sickle.multicall(targets, data); } function _zapOut( Sickle sickle, NftWithdraw calldata params, bytes4 withdrawalFee ) private { address[] memory targets = new address[](2); bytes[] memory data = new bytes[](2); targets[0] = address(nftZapLib); data[0] = abi.encodeCall(INftZapLib.zapOut, (params.zap)); targets[1] = address(feesLib); data[1] = abi.encodeCall( IFeesLib.chargeFees, (strategyAddress, withdrawalFee, params.tokensOut) ); sickle.multicall(targets, data); } function _setNftSettings( Sickle sickle, INonfungiblePositionManager nft, uint256 tokenId, NftSettings calldata settings ) private { address[] memory targets = new address[](1); bytes[] memory data = new bytes[](1); targets[0] = address(nftSettingsLib); data[0] = abi.encodeCall( INftSettingsLib.setNftSettings, (nftSettingsRegistry, nft, tokenId, settings) ); sickle.multicall(targets, data); } function _resetNftSettings( Sickle sickle, INonfungiblePositionManager nft, uint256 tokenId ) private { address[] memory targets = new address[](1); bytes[] memory data = new bytes[](1); targets[0] = address(nftSettingsLib); data[0] = abi.encodeCall( INftSettingsLib.transferNftSettings, (nftSettingsRegistry, nft, tokenId) ); sickle.multicall(targets, data); } function _sweep(Sickle sickle, address[] calldata sweepTokens) private { address[] memory targets = new address[](1); bytes[] memory data = new bytes[](1); targets[0] = address(transferLib); data[0] = abi.encodeCall(ITransferLib.transferTokensToUser, (sweepTokens)); sickle.multicall(targets, data); } function _getRebalanceFee( INonfungiblePositionManager nft, IUniswapV3Pool pool, uint256 tokenId ) internal view returns (bytes4) { INftLiquidityConnector liquidityConnector = INftLiquidityConnector(connectorRegistry.connectorOf(address(nft))); uint24 fee = liquidityConnector.fee(address(pool), tokenId); if (fee <= REBALANCE_LOW_FEE_BPS) { return NftFarmStrategyFees.RebalanceLow; } else if (fee <= REBALANCE_MID_FEE_BPS) { return NftFarmStrategyFees.RebalanceMid; } else { return NftFarmStrategyFees.RebalanceHigh; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; struct AddLiquidityParams { address router; address lpToken; address[] tokens; uint256[] desiredAmounts; uint256[] minAmounts; bytes extraData; } struct RemoveLiquidityParams { address router; address lpToken; address[] tokens; uint256 lpAmountIn; uint256[] minAmountsOut; bytes extraData; } struct SwapParams { address router; uint256 amountIn; uint256 minAmountOut; address tokenIn; bytes extraData; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { SwapParams } from "contracts/structs/LiquidityStructs.sol"; import { NftAddLiquidity, NftRemoveLiquidity } from "contracts/structs/NftLiquidityStructs.sol"; 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; } struct NftPositionInfo { uint128 liquidity; int24 tickLower; int24 tickUpper; } interface INftLiquidityConnector { function addLiquidity( NftAddLiquidity memory addLiquidityParams ) external payable; function removeLiquidity( NftRemoveLiquidity memory removeLiquidityParams ) external; function swapExactTokensForTokens( SwapParams memory swap ) external payable; function swapExactETHForTokens( SwapParams memory swap ) external payable; function feeGrowthOutside( address pool, bytes32 poolId, int24 tick ) external view returns (uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128); function fee( address pool, uint256 tokenId // Used by UniswapV4 ) external view returns (uint24); function poolInfo( address pool, bytes32 poolId ) external view returns (NftPoolInfo memory); function positionInfo( address nftManager, uint256 tokenId ) external view returns (NftPositionInfo memory); function positionPoolKey( address poolFactory, address nftManager, uint256 tokenId ) external view returns (NftPoolKey memory); function totalSupply( address nftManager ) external view returns (uint256); function getTokenId( address nftManager, address owner ) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts/proxy/Clones.sol"; import "./Sickle.sol"; import "./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 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 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 { Sickle } from "contracts/Sickle.sol"; interface IFeesLib { event FeeCharged( address strategy, bytes4 feeDescriptor, uint256 amount, address token ); event TransactionCostCharged(address recipient, uint256 amount); function chargeFee( address strategy, bytes4 feeDescriptor, address feeToken, uint256 feeBasis ) external payable returns (uint256 remainder); function chargeFees( address strategy, bytes4 feeDescriptor, address[] memory feeTokens ) external payable; function getBalance( Sickle sickle, address token ) external view returns (uint256); }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Modern and gas efficient ERC20 + EIP-2612 implementation. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol) /// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol) /// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it. abstract contract ERC20 { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); /*////////////////////////////////////////////////////////////// METADATA STORAGE //////////////////////////////////////////////////////////////*/ string public name; string public symbol; uint8 public immutable decimals; /*////////////////////////////////////////////////////////////// ERC20 STORAGE //////////////////////////////////////////////////////////////*/ uint256 public totalSupply; mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowance; /*////////////////////////////////////////////////////////////// EIP-2612 STORAGE //////////////////////////////////////////////////////////////*/ uint256 internal immutable INITIAL_CHAIN_ID; bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR; mapping(address => uint256) public nonces; /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor( string memory _name, string memory _symbol, uint8 _decimals ) { name = _name; symbol = _symbol; decimals = _decimals; INITIAL_CHAIN_ID = block.chainid; INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator(); } /*////////////////////////////////////////////////////////////// ERC20 LOGIC //////////////////////////////////////////////////////////////*/ function approve(address spender, uint256 amount) public virtual returns (bool) { allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function transfer(address to, uint256 amount) public virtual returns (bool) { balanceOf[msg.sender] -= amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(msg.sender, to, amount); return true; } function transferFrom( address from, address to, uint256 amount ) public virtual returns (bool) { uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals. if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount; balanceOf[from] -= amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(from, to, amount); return true; } /*////////////////////////////////////////////////////////////// EIP-2612 LOGIC //////////////////////////////////////////////////////////////*/ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual { require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED"); // Unchecked because the only math done is incrementing // the owner's nonce which cannot realistically overflow. unchecked { address recoveredAddress = ecrecover( keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR(), keccak256( abi.encode( keccak256( "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)" ), owner, spender, value, nonces[owner]++, deadline ) ) ) ), v, r, s ); require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER"); allowance[recoveredAddress][spender] = value; } emit Approval(owner, spender, value); } function DOMAIN_SEPARATOR() public view virtual returns (bytes32) { return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator(); } function computeDomainSeparator() internal view virtual returns (bytes32) { return keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(name)), keccak256("1"), block.chainid, address(this) ) ); } /*////////////////////////////////////////////////////////////// INTERNAL MINT/BURN LOGIC //////////////////////////////////////////////////////////////*/ function _mint(address to, uint256 amount) internal virtual { totalSupply += amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(address(0), to, amount); } function _burn(address from, uint256 amount) internal virtual { balanceOf[from] -= amount; // Cannot underflow because a user's balance // will never be larger than the total supply. unchecked { totalSupply -= amount; } emit Transfer(from, address(0), amount); } }
// 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 (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) 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 { 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.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, RewardBehavior } 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 { IUniswapV3Pool } from "contracts/interfaces/external/uniswap/IUniswapV3Pool.sol"; import { Sickle } from "contracts/Sickle.sol"; import { NftPosition, NftRebalance, NftHarvest, NftWithdraw, NftCompound } from "contracts/structs/NftFarmStrategyStructs.sol"; interface INftAutomation { function rebalanceFor( Sickle sickle, NftRebalance calldata rebalance, address[] calldata sweepTokens ) external; function harvestFor( Sickle sickle, NftPosition calldata position, NftHarvest calldata params ) external; function compoundFor( Sickle sickle, NftPosition calldata position, NftCompound calldata params, bool inPlace, address[] memory sweepTokens ) external; function exitFor( Sickle sickle, NftPosition calldata position, NftHarvest calldata harvestParams, NftWithdraw calldata withdrawParams, address[] memory sweepTokens ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { ZapIn, ZapOut } from "contracts/structs/ZapStructs.sol"; interface IZapLib { function zapIn( ZapIn memory zap ) external payable; function zapOut( ZapOut memory zap ) external; }
// 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.0; import { INonfungiblePositionManager } from "contracts/interfaces/external/uniswap/INonfungiblePositionManager.sol"; struct Pool { address token0; address token1; uint24 fee; } 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 pragma solidity ^0.8.17; import { ZapIn, ZapOut } from "contracts/libraries/ZapLib.sol"; import { SwapParams } from "contracts/structs/LiquidityStructs.sol"; struct Farm { address stakingContract; uint256 poolIndex; } struct DepositParams { Farm farm; address[] tokensIn; uint256[] amountsIn; ZapIn zap; bytes extraData; } struct WithdrawParams { bytes extraData; ZapOut zap; address[] tokensOut; } struct HarvestParams { SwapParams[] swaps; bytes extraData; address[] tokensOut; } struct CompoundParams { Farm claimFarm; bytes claimExtraData; address[] rewardTokens; ZapIn zap; Farm depositFarm; bytes depositExtraData; } struct SimpleDepositParams { Farm farm; address lpToken; uint256 amountIn; bytes extraData; } struct SimpleHarvestParams { address[] rewardTokens; bytes extraData; } struct SimpleWithdrawParams { address lpToken; uint256 amountOut; bytes extraData; }
// 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.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 ); }
// 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 (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 pragma solidity ^0.8.0; import { SwapParams, AddLiquidityParams, RemoveLiquidityParams } from "contracts/structs/LiquidityStructs.sol"; struct ZapIn { SwapParams[] swaps; AddLiquidityParams addLiquidityParams; } struct ZapOut { RemoveLiquidityParams removeLiquidityParams; SwapParams[] swaps; }
// 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); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { INonfungiblePositionManager } from "contracts/interfaces/external/uniswap/INonfungiblePositionManager.sol"; import { INftSettingsRegistry, NftSettings, NftKey } from "contracts/interfaces/INftSettingsRegistry.sol"; interface INftSettingsLib { error InvalidTokenId(); function transferNftSettings( INftSettingsRegistry nftSettingsRegistry, INonfungiblePositionManager nftManager, uint256 tokenId ) external; function setNftSettings( INftSettingsRegistry nftSettingsRegistry, INonfungiblePositionManager nftManager, uint256 tokenId, NftSettings calldata settings ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// 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.0; import { NftZapIn, NftZapOut } from "contracts/structs/NftZapStructs.sol"; interface INftZapLib { function zapIn( NftZapIn memory zap ) external payable; function zapOut( NftZapOut memory zap ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { Sickle } from "contracts/Sickle.sol"; import { SickleFactory } from "contracts/SickleFactory.sol"; contract AccessControlModule { SickleFactory public immutable factory; error NotOwner(address sender); // 30cd7471 error NotApproved(); error SickleNotDeployed(); error NotRegisteredSickle(); constructor( SickleFactory factory_ ) { factory = factory_; } modifier onlyRegisteredSickle() { if (factory.admins(address(this)) == address(0)) { revert NotRegisteredSickle(); } _; } // @dev allow access only to the sickle's owner or addresses approved by him // to use only for functions such as claiming rewards or compounding rewards modifier onlyApproved( Sickle sickle ) { // Here we check if the Sickle was really deployed, this gives use the // guarantee that the contract that we are going to call is genuine if (factory.admins(address(sickle)) == address(0)) { revert SickleNotDeployed(); } if (sickle.approved() != msg.sender) revert NotApproved(); _; } }
// 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 pragma solidity ^0.8.17; interface ITransferLib { error ArrayLengthMismatch(); error TokenInRequired(); error AmountInRequired(); error DuplicateTokenIn(); error TokenOutRequired(); error IncompatibleEthTokens(); function transferTokenToUser( address token ) external payable; function transferTokensToUser( address[] memory tokens ) external payable; function transferTokenFromUser( address tokenIn, uint256 amountIn, address strategy, bytes4 feeSelector ) external payable; function transferTokensFromUser( address[] memory tokensIn, uint256[] memory amountsIn, address strategy, bytes4 feeSelector ) external payable; }
// 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 pragma solidity ^0.8.0; import { SwapParams } from "contracts/structs/LiquidityStructs.sol"; interface ISwapLib { function swap( SwapParams memory swap ) external payable; function swapMultiple( SwapParams[] memory swaps ) external payable; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { SwapParams } from "contracts/structs/LiquidityStructs.sol"; import { NftAddLiquidity, NftRemoveLiquidity } from "contracts/structs/NftLiquidityStructs.sol"; struct NftZapIn { SwapParams[] swaps; NftAddLiquidity addLiquidityParams; } struct NftZapOut { NftRemoveLiquidity removeLiquidityParams; SwapParams[] swaps; }
// 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.0; import { INonfungiblePositionManager } from "contracts/interfaces/external/uniswap/INonfungiblePositionManager.sol"; import { Farm } from "contracts/structs/FarmStrategyStructs.sol"; import { NftPosition } from "contracts/structs/NftFarmStrategyStructs.sol"; interface INftFarmConnector { function depositExistingNft( NftPosition calldata position, bytes calldata extraData ) external payable; function withdrawNft( NftPosition calldata position, bytes calldata extraData ) external payable; // Payable in case an NFT is withdrawn to be increased with ETH function claim( NftPosition calldata position, address[] memory rewardTokens, uint128 maxAmount0, // For collecting uint128 maxAmount1, bytes calldata extraData ) external payable; function earned( NftPosition calldata position, address[] memory rewardTokens ) external view returns (uint256[] memory); function isStaked( address user, NftPosition calldata position ) external view returns (bool); }
// 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 { NftZapIn, NftZapOut } from "contracts/structs/NftZapStructs.sol"; import { SwapParams } from "contracts/structs/LiquidityStructs.sol"; import { Farm } from "contracts/structs/FarmStrategyStructs.sol"; struct NftPosition { Farm farm; INonfungiblePositionManager nft; uint256 tokenId; } struct NftIncrease { address[] tokensIn; uint256[] amountsIn; NftZapIn zap; bytes extraData; } struct NftDeposit { Farm farm; INonfungiblePositionManager nft; NftIncrease increase; } struct NftWithdraw { NftZapOut zap; address[] tokensOut; bytes extraData; } struct SimpleNftHarvest { address[] rewardTokens; uint128 amount0Max; uint128 amount1Max; bytes extraData; } struct NftHarvest { SimpleNftHarvest harvest; SwapParams[] swaps; address[] outputTokens; address[] sweepTokens; } struct NftCompound { SimpleNftHarvest harvest; NftZapIn zap; } struct NftRebalance { IUniswapV3Pool pool; NftPosition position; NftHarvest harvest; NftWithdraw withdraw; NftIncrease increase; } struct NftMove { IUniswapV3Pool pool; NftPosition position; NftHarvest harvest; NftWithdraw withdraw; NftDeposit deposit; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { INonfungiblePositionManager } from "contracts/interfaces/external/uniswap/INonfungiblePositionManager.sol"; import { Sickle } from "contracts/Sickle.sol"; abstract contract NftFarmStrategyEvents { event SickleDepositedNft( Sickle indexed sickle, INonfungiblePositionManager indexed nft, uint256 indexed tokenId, address stakingContract, uint256 poolIndex ); event SickleIncreasedNft( Sickle indexed sickle, INonfungiblePositionManager indexed nft, uint256 indexed tokenId, address stakingContract, uint256 poolIndex ); event SickleHarvestedNft( Sickle indexed sickle, INonfungiblePositionManager indexed nft, uint256 indexed tokenId, address stakingContract, uint256 poolIndex ); event SickleCompoundedNft( Sickle indexed sickle, INonfungiblePositionManager indexed nft, uint256 indexed tokenId, address stakingContract, uint256 poolIndex ); event SickleWithdrewNft( Sickle indexed sickle, INonfungiblePositionManager indexed nft, uint256 indexed tokenId, address stakingContract, uint256 poolIndex ); event SickleDecreasedNft( Sickle indexed sickle, INonfungiblePositionManager indexed nft, uint256 indexed tokenId, address stakingContract, uint256 poolIndex ); event SickleExitedNft( Sickle indexed sickle, INonfungiblePositionManager indexed nft, uint256 indexed tokenId, address stakingContract, uint256 poolIndex ); event SickleRebalancedNft( Sickle indexed sickle, INonfungiblePositionManager indexed nft, uint256 indexed tokenId, address stakingContract, uint256 poolIndex ); event SickleMovedNft( Sickle indexed sickle, INonfungiblePositionManager indexed fromNft, uint256 indexed fromTokenId, address fromStakingContract, uint256 fromPoolIndex, INonfungiblePositionManager toNft, uint256 toTokenId, address toStakingContract, uint256 toPoolIndex ); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { AddLiquidityParams, RemoveLiquidityParams, SwapParams } from "contracts/structs/LiquidityStructs.sol"; interface ILiquidityConnector { error InvalidPrice(); function addLiquidity( AddLiquidityParams memory addLiquidityParams ) external payable; function removeLiquidity( RemoveLiquidityParams memory removeLiquidityParams ) external; function swapExactTokensForTokens( SwapParams memory swap ) external payable; function swapExactETHForTokens( SwapParams memory swap ) external payable; function getPoolPrice( address lpToken, uint256 baseTokenIndex, uint256 quoteTokenIndex ) external view returns (uint256); function getReserves( address lpToken ) external view returns (uint256[] memory reserves); function getTokens( address lpToken ) external view returns (address[] memory tokens); }
// 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.17; contract DelegateModule { function _delegateTo( address to, bytes memory data ) internal returns (bytes memory) { (bool success, bytes memory result) = to.delegatecall(data); if (!success) { if (result.length == 0) revert(); assembly { revert(add(32, result), mload(result)) } } return result; } }
// 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: AGPL-3.0-only pragma solidity >=0.8.0; import {ERC20} from "../tokens/ERC20.sol"; /// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol) /// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer. /// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller. library SafeTransferLib { /*////////////////////////////////////////////////////////////// ERRORS //////////////////////////////////////////////////////////////*/ error ETHTransferFailed(); error TransferFromFailed(); error TransferFailed(); error ApproveFailed(); /*////////////////////////////////////////////////////////////// ETH OPERATIONS //////////////////////////////////////////////////////////////*/ function safeTransferETH(address to, uint256 amount) internal { bool success; /// @solidity memory-safe-assembly assembly { // Transfer the ETH and store if it succeeded or not. success := call(gas(), to, amount, 0, 0, 0, 0) } if (!success) revert ETHTransferFailed(); } /*////////////////////////////////////////////////////////////// ERC20 OPERATIONS //////////////////////////////////////////////////////////////*/ function safeTransferFrom( address token, address from, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), from) // Append the "from" argument. mstore(add(freeMemoryPointer, 36), to) // Append the "to" argument. mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 100, 0, 32) ) } if (!success) revert TransferFromFailed(); } function safeTransfer( address token, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument. mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) ) } if (!success) revert TransferFailed(); } function safeApprove( address token, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument. mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) ) } if (!success) revert ApproveFailed(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { IERC721 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import { IERC1155 } from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import { Sickle } from "contracts/Sickle.sol"; interface INftTransferLib { /// @dev Transfers the ERC721 NFT with {tokenId} from the user to the Sickle function transferErc721FromUser(IERC721 nft, uint256 tokenId) external; /// @dev Transfers the ERC721 NFT with {tokenId} from the Sickle to the user function transferErc721ToUser(IERC721 nft, uint256 tokenId) external; /// @dev Transfers the ERC1155 NFT with {tokenId} from the user to Sickle function transferErc1155FromUser( IERC1155 nft, uint256 tokenId, uint256 amount ) external; /// @dev Transfers the ERC1155 NFT with {tokenId} from Sickle to the user function transferErc1155ToUser( IERC1155 nft, uint256 tokenId, uint256 amount ) external; }
// 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: 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.17; import { SickleFactory, Sickle } from "contracts/SickleFactory.sol"; import { ConnectorRegistry } from "contracts/ConnectorRegistry.sol"; import { AccessControlModule } from "contracts/modules/AccessControlModule.sol"; contract StrategyModule is AccessControlModule { ConnectorRegistry public immutable connectorRegistry; constructor( SickleFactory factory, ConnectorRegistry connectorRegistry_ ) AccessControlModule(factory) { connectorRegistry = connectorRegistry_; } function getSickle(address owner) public view returns (Sickle) { Sickle sickle = Sickle(payable(factory.sickles(owner))); if (address(sickle) == address(0)) { revert SickleNotDeployed(); } return sickle; } function getOrDeploySickle( address owner, address approved, bytes32 referralCode ) public returns (Sickle) { return Sickle(payable(factory.getOrDeploy(owner, approved, referralCode))); } }
// 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 pragma solidity ^0.8.17; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { SafeTransferLib } from "solmate/utils/SafeTransferLib.sol"; import { SwapParams, AddLiquidityParams } from "contracts/structs/LiquidityStructs.sol"; import { ILiquidityConnector } from "contracts/interfaces/ILiquidityConnector.sol"; import { ConnectorRegistry } from "contracts/ConnectorRegistry.sol"; import { DelegateModule } from "contracts/modules/DelegateModule.sol"; import { ZapIn, ZapOut } from "contracts/structs/ZapStructs.sol"; import { IZapLib } from "contracts/interfaces/libraries/IZapLib.sol"; import { ISwapLib } from "contracts/interfaces/libraries/ISwapLib.sol"; contract ZapLib is DelegateModule, IZapLib { error LiquidityAmountError(); // 0x4d0ab6b4 ISwapLib public immutable swapLib; ConnectorRegistry public immutable connectorRegistry; constructor(ConnectorRegistry connectorRegistry_, ISwapLib swapLib_) { connectorRegistry = connectorRegistry_; swapLib = swapLib_; } function zapIn( ZapIn memory zap ) external payable { uint256 swapDataLength = zap.swaps.length; for (uint256 i; i < swapDataLength;) { _delegateTo( address(swapLib), abi.encodeCall(ISwapLib.swap, (zap.swaps[i])) ); unchecked { i++; } } if (zap.addLiquidityParams.lpToken == address(0)) { return; } bool atLeastOneNonZero = false; AddLiquidityParams memory addLiquidityParams = zap.addLiquidityParams; uint256 addLiquidityParamsTokensLength = addLiquidityParams.tokens.length; for (uint256 i; i < addLiquidityParamsTokensLength; i++) { if (addLiquidityParams.tokens[i] == address(0)) { continue; } if (addLiquidityParams.desiredAmounts[i] == 0) { addLiquidityParams.desiredAmounts[i] = IERC20( addLiquidityParams.tokens[i] ).balanceOf(address(this)); } if (addLiquidityParams.desiredAmounts[i] > 0) { atLeastOneNonZero = true; // In case there is USDT or similar dust approval, revoke it SafeTransferLib.safeApprove( addLiquidityParams.tokens[i], addLiquidityParams.router, 0 ); SafeTransferLib.safeApprove( addLiquidityParams.tokens[i], addLiquidityParams.router, addLiquidityParams.desiredAmounts[i] ); } } if (!atLeastOneNonZero) { revert LiquidityAmountError(); } address routerConnector = connectorRegistry.connectorOf(addLiquidityParams.router); _delegateTo( routerConnector, abi.encodeCall( ILiquidityConnector.addLiquidity, (addLiquidityParams) ) ); for (uint256 i; i < addLiquidityParamsTokensLength;) { if (addLiquidityParams.tokens[i] != address(0)) { // Revoke any dust approval in case the amount was estimated SafeTransferLib.safeApprove( addLiquidityParams.tokens[i], addLiquidityParams.router, 0 ); } unchecked { i++; } } } function zapOut( ZapOut memory zap ) external { if (zap.removeLiquidityParams.lpToken != address(0)) { if (zap.removeLiquidityParams.lpAmountIn > 0) { SafeTransferLib.safeApprove( zap.removeLiquidityParams.lpToken, zap.removeLiquidityParams.router, zap.removeLiquidityParams.lpAmountIn ); } address routerConnector = connectorRegistry.connectorOf(zap.removeLiquidityParams.router); _delegateTo( address(routerConnector), abi.encodeCall( ILiquidityConnector.removeLiquidity, zap.removeLiquidityParams ) ); } uint256 swapDataLength = zap.swaps.length; for (uint256 i; i < swapDataLength;) { _delegateTo( address(swapLib), abi.encodeCall(ISwapLib.swap, (zap.swaps[i])) ); unchecked { i++; } } } }
{ "evmVersion": "paris", "libraries": {}, "metadata": { "appendCBOR": true, "bytecodeHash": "ipfs", "useLiteralContent": false }, "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "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/" ], "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":"contract INftSettingsRegistry","name":"nftSettingsRegistry_","type":"address"},{"components":[{"internalType":"contract INftTransferLib","name":"nftTransferLib","type":"address"},{"internalType":"contract ITransferLib","name":"transferLib","type":"address"},{"internalType":"contract ISwapLib","name":"swapLib","type":"address"},{"internalType":"contract IFeesLib","name":"feesLib","type":"address"},{"internalType":"contract INftZapLib","name":"nftZapLib","type":"address"},{"internalType":"contract INftSettingsLib","name":"nftSettingsLib","type":"address"}],"internalType":"struct NftFarmStrategy.Libraries","name":"libraries","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"NftSupplyChanged","type":"error"},{"inputs":[],"name":"NftSupplyDidntIncrease","type":"error"},{"inputs":[],"name":"NotApproved","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"NotOwner","type":"error"},{"inputs":[],"name":"NotRegisteredSickle","type":"error"},{"inputs":[],"name":"PleaseUseIncrease","type":"error"},{"inputs":[],"name":"SickleNotDeployed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract Sickle","name":"sickle","type":"address"},{"indexed":true,"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"stakingContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"poolIndex","type":"uint256"}],"name":"SickleCompoundedNft","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract Sickle","name":"sickle","type":"address"},{"indexed":true,"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"stakingContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"poolIndex","type":"uint256"}],"name":"SickleDecreasedNft","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract Sickle","name":"sickle","type":"address"},{"indexed":true,"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"stakingContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"poolIndex","type":"uint256"}],"name":"SickleDepositedNft","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract Sickle","name":"sickle","type":"address"},{"indexed":true,"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"stakingContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"poolIndex","type":"uint256"}],"name":"SickleExitedNft","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract Sickle","name":"sickle","type":"address"},{"indexed":true,"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"stakingContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"poolIndex","type":"uint256"}],"name":"SickleHarvestedNft","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract Sickle","name":"sickle","type":"address"},{"indexed":true,"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"stakingContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"poolIndex","type":"uint256"}],"name":"SickleIncreasedNft","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract Sickle","name":"sickle","type":"address"},{"indexed":true,"internalType":"contract INonfungiblePositionManager","name":"fromNft","type":"address"},{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"fromStakingContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"fromPoolIndex","type":"uint256"},{"indexed":false,"internalType":"contract INonfungiblePositionManager","name":"toNft","type":"address"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"toStakingContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"toPoolIndex","type":"uint256"}],"name":"SickleMovedNft","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract Sickle","name":"sickle","type":"address"},{"indexed":true,"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"stakingContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"poolIndex","type":"uint256"}],"name":"SickleRebalancedNft","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract Sickle","name":"sickle","type":"address"},{"indexed":true,"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"stakingContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"poolIndex","type":"uint256"}],"name":"SickleWithdrewNft","type":"event"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition","name":"position","type":"tuple"},{"components":[{"components":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SimpleNftHarvest","name":"harvest","type":"tuple"},{"components":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"internalType":"struct Pool","name":"pool","type":"tuple"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint256","name":"amount0Desired","type":"uint256"},{"internalType":"uint256","name":"amount1Desired","type":"uint256"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftAddLiquidity","name":"addLiquidityParams","type":"tuple"}],"internalType":"struct NftZapIn","name":"zap","type":"tuple"}],"internalType":"struct NftCompound","name":"params","type":"tuple"},{"internalType":"bool","name":"inPlace","type":"bool"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"name":"compound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract Sickle","name":"sickle","type":"address"},{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition","name":"position","type":"tuple"},{"components":[{"components":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SimpleNftHarvest","name":"harvest","type":"tuple"},{"components":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"internalType":"struct Pool","name":"pool","type":"tuple"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint256","name":"amount0Desired","type":"uint256"},{"internalType":"uint256","name":"amount1Desired","type":"uint256"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftAddLiquidity","name":"addLiquidityParams","type":"tuple"}],"internalType":"struct NftZapIn","name":"zap","type":"tuple"}],"internalType":"struct NftCompound","name":"params","type":"tuple"},{"internalType":"bool","name":"inPlace","type":"bool"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"name":"compoundFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"connectorRegistry","outputs":[{"internalType":"contract ConnectorRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition","name":"position","type":"tuple"},{"components":[{"components":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SimpleNftHarvest","name":"harvest","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"internalType":"address[]","name":"outputTokens","type":"address[]"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"internalType":"struct NftHarvest","name":"harvestParams","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftRemoveLiquidity","name":"removeLiquidityParams","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"}],"internalType":"struct NftZapOut","name":"zap","type":"tuple"},{"internalType":"address[]","name":"tokensOut","type":"address[]"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftWithdraw","name":"withdrawParams","type":"tuple"},{"internalType":"bool","name":"inPlace","type":"bool"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"name":"decrease","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"components":[{"internalType":"address[]","name":"tokensIn","type":"address[]"},{"internalType":"uint256[]","name":"amountsIn","type":"uint256[]"},{"components":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"internalType":"struct Pool","name":"pool","type":"tuple"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint256","name":"amount0Desired","type":"uint256"},{"internalType":"uint256","name":"amount1Desired","type":"uint256"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftAddLiquidity","name":"addLiquidityParams","type":"tuple"}],"internalType":"struct NftZapIn","name":"zap","type":"tuple"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftIncrease","name":"increase","type":"tuple"}],"internalType":"struct NftDeposit","name":"params","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"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"},{"internalType":"address","name":"approved","type":"address"},{"internalType":"bytes32","name":"referralCode","type":"bytes32"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition","name":"position","type":"tuple"},{"components":[{"components":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SimpleNftHarvest","name":"harvest","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"internalType":"address[]","name":"outputTokens","type":"address[]"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"internalType":"struct NftHarvest","name":"harvestParams","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftRemoveLiquidity","name":"removeLiquidityParams","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"}],"internalType":"struct NftZapOut","name":"zap","type":"tuple"},{"internalType":"address[]","name":"tokensOut","type":"address[]"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftWithdraw","name":"withdrawParams","type":"tuple"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"name":"exit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract Sickle","name":"sickle","type":"address"},{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition","name":"position","type":"tuple"},{"components":[{"components":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SimpleNftHarvest","name":"harvest","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"internalType":"address[]","name":"outputTokens","type":"address[]"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"internalType":"struct NftHarvest","name":"harvestParams","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftRemoveLiquidity","name":"removeLiquidityParams","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"}],"internalType":"struct NftZapOut","name":"zap","type":"tuple"},{"internalType":"address[]","name":"tokensOut","type":"address[]"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftWithdraw","name":"withdrawParams","type":"tuple"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"name":"exitFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"contract SickleFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feesLib","outputs":[{"internalType":"contract IFeesLib","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"approved","type":"address"},{"internalType":"bytes32","name":"referralCode","type":"bytes32"}],"name":"getOrDeploySickle","outputs":[{"internalType":"contract Sickle","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"getSickle","outputs":[{"internalType":"contract Sickle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition","name":"position","type":"tuple"},{"components":[{"components":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SimpleNftHarvest","name":"harvest","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"internalType":"address[]","name":"outputTokens","type":"address[]"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"internalType":"struct NftHarvest","name":"params","type":"tuple"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract Sickle","name":"sickle","type":"address"},{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition","name":"position","type":"tuple"},{"components":[{"components":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SimpleNftHarvest","name":"harvest","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"internalType":"address[]","name":"outputTokens","type":"address[]"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"internalType":"struct NftHarvest","name":"params","type":"tuple"}],"name":"harvestFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition","name":"position","type":"tuple"},{"components":[{"components":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SimpleNftHarvest","name":"harvest","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"internalType":"address[]","name":"outputTokens","type":"address[]"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"internalType":"struct NftHarvest","name":"harvestParams","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokensIn","type":"address[]"},{"internalType":"uint256[]","name":"amountsIn","type":"uint256[]"},{"components":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"internalType":"struct Pool","name":"pool","type":"tuple"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint256","name":"amount0Desired","type":"uint256"},{"internalType":"uint256","name":"amount1Desired","type":"uint256"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftAddLiquidity","name":"addLiquidityParams","type":"tuple"}],"internalType":"struct NftZapIn","name":"zap","type":"tuple"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftIncrease","name":"increaseParams","type":"tuple"},{"internalType":"bool","name":"inPlace","type":"bool"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"name":"increase","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IUniswapV3Pool","name":"pool","type":"address"},{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition","name":"position","type":"tuple"},{"components":[{"components":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SimpleNftHarvest","name":"harvest","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"internalType":"address[]","name":"outputTokens","type":"address[]"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"internalType":"struct NftHarvest","name":"harvest","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftRemoveLiquidity","name":"removeLiquidityParams","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"}],"internalType":"struct NftZapOut","name":"zap","type":"tuple"},{"internalType":"address[]","name":"tokensOut","type":"address[]"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftWithdraw","name":"withdraw","type":"tuple"},{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"components":[{"internalType":"address[]","name":"tokensIn","type":"address[]"},{"internalType":"uint256[]","name":"amountsIn","type":"uint256[]"},{"components":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"internalType":"struct Pool","name":"pool","type":"tuple"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint256","name":"amount0Desired","type":"uint256"},{"internalType":"uint256","name":"amount1Desired","type":"uint256"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftAddLiquidity","name":"addLiquidityParams","type":"tuple"}],"internalType":"struct NftZapIn","name":"zap","type":"tuple"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftIncrease","name":"increase","type":"tuple"}],"internalType":"struct NftDeposit","name":"deposit","type":"tuple"}],"internalType":"struct NftMove","name":"params","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"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"name":"move","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nftSettingsLib","outputs":[{"internalType":"contract INftSettingsLib","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftSettingsRegistry","outputs":[{"internalType":"contract INftSettingsRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftTransferLib","outputs":[{"internalType":"contract INftTransferLib","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftZapLib","outputs":[{"internalType":"contract INftZapLib","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"contract IUniswapV3Pool","name":"pool","type":"address"},{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition","name":"position","type":"tuple"},{"components":[{"components":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SimpleNftHarvest","name":"harvest","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"internalType":"address[]","name":"outputTokens","type":"address[]"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"internalType":"struct NftHarvest","name":"harvest","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftRemoveLiquidity","name":"removeLiquidityParams","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"}],"internalType":"struct NftZapOut","name":"zap","type":"tuple"},{"internalType":"address[]","name":"tokensOut","type":"address[]"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftWithdraw","name":"withdraw","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokensIn","type":"address[]"},{"internalType":"uint256[]","name":"amountsIn","type":"uint256[]"},{"components":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"internalType":"struct Pool","name":"pool","type":"tuple"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint256","name":"amount0Desired","type":"uint256"},{"internalType":"uint256","name":"amount1Desired","type":"uint256"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftAddLiquidity","name":"addLiquidityParams","type":"tuple"}],"internalType":"struct NftZapIn","name":"zap","type":"tuple"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftIncrease","name":"increase","type":"tuple"}],"internalType":"struct NftRebalance","name":"params","type":"tuple"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"name":"rebalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract Sickle","name":"sickle","type":"address"},{"components":[{"internalType":"contract IUniswapV3Pool","name":"pool","type":"address"},{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition","name":"position","type":"tuple"},{"components":[{"components":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SimpleNftHarvest","name":"harvest","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"internalType":"address[]","name":"outputTokens","type":"address[]"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"internalType":"struct NftHarvest","name":"harvest","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftRemoveLiquidity","name":"removeLiquidityParams","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"}],"internalType":"struct NftZapOut","name":"zap","type":"tuple"},{"internalType":"address[]","name":"tokensOut","type":"address[]"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftWithdraw","name":"withdraw","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokensIn","type":"address[]"},{"internalType":"uint256[]","name":"amountsIn","type":"uint256[]"},{"components":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"internalType":"struct Pool","name":"pool","type":"tuple"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint256","name":"amount0Desired","type":"uint256"},{"internalType":"uint256","name":"amount1Desired","type":"uint256"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftAddLiquidity","name":"addLiquidityParams","type":"tuple"}],"internalType":"struct NftZapIn","name":"zap","type":"tuple"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftIncrease","name":"increase","type":"tuple"}],"internalType":"struct NftRebalance","name":"params","type":"tuple"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"name":"rebalanceFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition","name":"position","type":"tuple"},{"internalType":"bytes","name":"extraData","type":"bytes"},{"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"},{"internalType":"address","name":"approved","type":"address"},{"internalType":"bytes32","name":"referralCode","type":"bytes32"}],"name":"simpleDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition","name":"position","type":"tuple"},{"components":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SimpleNftHarvest","name":"harvestParams","type":"tuple"},{"internalType":"bytes","name":"withdrawExtraData","type":"bytes"}],"name":"simpleExit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition","name":"position","type":"tuple"},{"components":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SimpleNftHarvest","name":"params","type":"tuple"}],"name":"simpleHarvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition","name":"position","type":"tuple"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"name":"simpleWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"strategyAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapLib","outputs":[{"internalType":"contract ISwapLib","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"transferLib","outputs":[{"internalType":"contract ITransferLib","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition","name":"position","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftRemoveLiquidity","name":"removeLiquidityParams","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"}],"internalType":"struct NftZapOut","name":"zap","type":"tuple"},{"internalType":"address[]","name":"tokensOut","type":"address[]"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftWithdraw","name":"params","type":"tuple"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6101c06040523480156200001257600080fd5b5060405162005710380380620057108339810160408190526200003591620000c3565b6001600160a01b03938416608090815292841660a09081528151851660c05292810151841660e052604081015184166101005260208101518416610120526060810151841661014052909101518216610160521661018052306101a052620001d4565b6001600160a01b0381168114620000ae57600080fd5b50565b8051620000be8162000098565b919050565b600080600080848603610120811215620000dc57600080fd5b8551620000e98162000098565b6020870151909550620000fc8162000098565b60408701519094506200010f8162000098565b925060c0605f19820112156200012457600080fd5b5060405160c081016001600160401b03811182821017156200015657634e487b7160e01b600052604160045260246000fd5b6040526200016760608701620000b1565b81526200017760808701620000b1565b60208201526200018a60a08701620000b1565b60408201526200019d60c08701620000b1565b6060820152620001b060e08701620000b1565b6080820152620001c46101008701620000b1565b60a0820152939692955090935050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516153af62000361600039600081816104ef01528181612617015281816134fc015281816139a00152613c390152600081816102ab01528181610f70015281816113ff01528181611a5901528181611ed501528181612d740152613dc901526000818161023b01528181612d200152613d7c01526000818161031f015281816125cc015281816139540152613bed0152600081816103a701528181612098015261349901526000818161037301526138a201526000818161058b0152818161251e0152612bc6015260008181610557015281816130cb01526136140152600081816104bb015281816106de01528181610a0301528181610c5b015281816115ea01528181611b85015281816122ca015281816126bc015281816129f901528181613202015281816136c20152613a3901526000818161052301528181610e490152818161121a015281816112d80152818161151a015281816119320152611dae01526153af6000f3fe6080604052600436106101c25760003560e01c8063659b91b1116100f7578063c45a015511610095578063e0192b2811610064578063e0192b28146105c0578063e5bacdd0146105e0578063f0806a7f146105f3578063f0d847501461061357600080fd5b8063c45a015514610511578063cce5b8c614610545578063d996cef714610579578063ddff9470146105ad57600080fd5b80639448c56a116100d15780639448c56a14610469578063b3fb68d514610489578063b53c86d2146104a9578063bc6b74ab146104dd57600080fd5b8063659b91b1146104095780636e2f91d514610429578063759cb2341461044957600080fd5b806328734381116101645780633faa6e301161013e5780633faa6e30146103615780633fb53a0d14610395578063541bb89e146103c95780635ec5999e146103e957600080fd5b806328734381146102ed5780632af3fa1b1461030d57806338f6f9271461034157600080fd5b80631de7354b116101a05780631de7354b14610229578063237179671461027957806324f450db146102995780632812d614146102cd57600080fd5b8063107acebd146101c75780631c396db6146101e95780631d06722b14610209575b600080fd5b3480156101d357600080fd5b506101e76101e2366004613eb3565b610633565b005b3480156101f557600080fd5b506101e7610204366004613f3f565b6106ac565b34801561021557600080fd5b506101e7610224366004613ff0565b61092e565b34801561023557600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b34801561028557600080fd5b506101e7610294366004614064565b61094b565b3480156102a557600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102d957600080fd5b506101e76102e83660046140e7565b610c29565b3480156102f957600080fd5b506101e7610308366004614173565b610e0a565b34801561031957600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034d57600080fd5b506101e761035c3660046141f7565b610e25565b34801561036d57600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b3480156103a157600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b3480156103d557600080fd5b506101e76103e43660046142b6565b611045565b3480156103f557600080fd5b506101e7610404366004613ff0565b6110ed565b34801561041557600080fd5b506101e7610424366004614309565b611114565b34801561043557600080fd5b506101e7610444366004614364565b611142565b34801561045557600080fd5b5061025d6104643660046143cf565b6111f6565b34801561047557600080fd5b506101e76104843660046143ec565b6112b4565b34801561049557600080fd5b5061025d6104a436600461444c565b6114e9565b3480156104b557600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b3480156104e957600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561051d57600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561055157600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561058557600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b6101e76105bb36600461448d565b611593565b3480156105cc57600080fd5b506101e76105db366004614537565b61190e565b6101e76105ee366004614580565b611b53565b3480156105ff57600080fd5b506101e761060e3660046145ee565b611d8a565b34801561061f57600080fd5b506101e761062e36600461464a565b611fc2565b600061063e336111f6565b905060008061064d86806146e2565b61065b906020810190614702565b90501161066957600061068b565b7fdfa64d371f38074894860654f13f7558a46a9b052e65fd158280c8dd2f07af645b905061069982878784612028565b6106a4828585612045565b505050505050565b6106bc60608701604088016143cf565b6040516363cd755760e11b81526001600160a01b0382811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063c79aeaae90602401602060405180830381865afa158015610727573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074b9190614756565b6040516339370aa960e21b81526001600160a01b03848116600483015291925060009183169063e4dc2aa490602401602060405180830381865afa158015610797573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bb9190614773565b905060006107c8336111f6565b905086610800576107e9818b8b60008051602061535a8339815191526121a1565b610800818b6107fb60408c018c61478c565b61226d565b60008061080d8a806146e2565b61081b906020810190614702565b90501161082957600061084b565b7fdfa64d371f38074894860654f13f7558a46a9b052e65fd158280c8dd2f07af645b9050610858828a836124cb565b876108825761088282610870368e90038e018e614838565b61087d60408d018d61478c565b612697565b61088d828888612045565b610897828c6128ce565b50506040516339370aa960e21b81526001600160a01b03848116600483015283169063e4dc2aa4906024015b602060405180830381865afa1580156108e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109049190614773565b81146109235760405163648873f960e01b815260040160405180910390fd5b505050505050505050565b6000610939336111f6565b905061094681848461293d565b505050565b6000610956336111f6565b9050610981816020870161096d60a08901896148ae565b60008051602061535a8339815191526121a1565b6109c5816020870161099660c08901896148c4565b6109c06109a960808b0160608c016143cf565b6109b660208c018c6143cf565b60808c01356129d5565b612028565b6109f7816109d660e08801886148ae565b6109e49060608101906148ae565b6109f29060408101906146e2565b612b73565b60006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663c79aeaae610a386080890160608a016143cf565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610a7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa09190614756565b6001600160a01b031663b943855e610abe6080890160608a016143cf565b6040516001600160e01b031960e084901b1681526001600160a01b0391821660048201529085166024820152604401602060405180830381865afa158015610b0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2e9190614773565b9050610bbc826040518060600160405280898060e00190610b4f91906148ae565b610b5f90368190038101906148da565b8152602001610b7160e08b018b6148ae565b610b829060608101906040016143cf565b6001600160a01b03168152602001849052610ba060e08a018a6148ae565b610bae9060608101906148ae565b61087d90606081019061478c565b610be582610bcd60e08901896148ae565b610bde9060608101906040016143cf565b8388612ccd565b610bf0828585612045565b6106a48260208801610c0560e08a018a6148ae565b610c169060608101906040016143cf565b610c2360e08b018b6148ae565b85612e4d565b610c3960608601604087016143cf565b6040516363cd755760e11b81526001600160a01b0382811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063c79aeaae90602401602060405180830381865afa158015610ca4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc89190614756565b6040516339370aa960e21b81526001600160a01b03848116600483015291925060009183169063e4dc2aa490602401602060405180830381865afa158015610d14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d389190614773565b90506000610d45336111f6565b9050610d76818a8a8a8a8a7f1d5b8de553017a3bd388578aeece0183b79c5ca87ec64628b3f76b39487f0231612ef5565b506040516339370aa960e21b81526001600160a01b03848116600483015283169063e4dc2aa490602401602060405180830381865afa158015610dbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de19190614773565b8114610e005760405163648873f960e01b815260040160405180910390fd5b5050505050505050565b6000610e15336111f6565b90506106a4818787878787612fb4565b60405163429b62e560e01b81526001600160a01b03808816600483015287916000917f0000000000000000000000000000000000000000000000000000000000000000169063429b62e590602401602060405180830381865afa158015610e90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb49190614756565b6001600160a01b031603610edb57604051633098a45560e01b815260040160405180910390fd5b336001600160a01b0316816001600160a01b03166319d40b086040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f479190614756565b6001600160a01b031614610f6e5760405163c19f17a960e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663459e268460405180606001604052808a6001600160a01b03168152602001896040016020810190610fca91906143cf565b6001600160a01b0316815260200189606001358152506040518263ffffffff1660e01b8152600401610ffc91906148f6565b600060405180830381600087803b15801561101657600080fd5b505af115801561102a573d6000803e3d6000fd5b5050505061103c878787878787612fb4565b50505050505050565b6000611050336111f6565b905061105e8185858561226d565b61107c8161107260608701604088016143cf565b8660600135613078565b6060840180359061109090604087016143cf565b6001600160a01b039081169083167f976f9aa1da6d0f0e23405b12b4e2b446c12615150624819f4bebe8060fa39f616110cc60208901896143cf565b6040516110df919060208b013590614925565b60405180910390a450505050565b60006110f8336111f6565b905061094681848460008051602061535a8339815191526121a1565b600061111f336111f6565b905061113c8185858560008051602061535a83398151915261316d565b50505050565b600061114d336111f6565b905061115a81868661293d565b6111668186858561226d565b6111848161117a60608801604089016143cf565b8760600135613078565b6060850180359061119890604088016143cf565b6001600160a01b039081169083167fc9a3d0888f5ab83eb0fcd2e948c80035fd02319ad2f57c4bc68b1513a0f78ea06111d460208a018a6143cf565b6040516111e7919060208c013590614925565b60405180910390a45050505050565b6040516312cfc9b560e31b81526001600160a01b03828116600483015260009182917f0000000000000000000000000000000000000000000000000000000000000000169063967e4da890602401602060405180830381865afa158015611261573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112859190614756565b90506001600160a01b0381166112ae57604051633098a45560e01b815260040160405180910390fd5b92915050565b60405163429b62e560e01b81526001600160a01b03808516600483015284916000917f0000000000000000000000000000000000000000000000000000000000000000169063429b62e590602401602060405180830381865afa15801561131f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113439190614756565b6001600160a01b03160361136a57604051633098a45560e01b815260040160405180910390fd5b336001600160a01b0316816001600160a01b03166319d40b086040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d69190614756565b6001600160a01b0316146113fd5760405163c19f17a960e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663bca9ca736040518060600160405280876001600160a01b0316815260200186604001602081019061145991906143cf565b6001600160a01b0316815260200186606001358152506040518263ffffffff1660e01b815260040161148b91906148f6565b600060405180830381600087803b1580156114a557600080fd5b505af11580156114b9573d6000803e3d6000fd5b5050505061113c8484847f139f6e665188bd3327a590d2d1c9d8d09b55289c07e19fef103ceab100ea09796121a1565b60405163de0d95ed60e01b81526001600160a01b0384811660048301528381166024830152604482018390526000917f00000000000000000000000000000000000000000000000000000000000000009091169063de0d95ed906064016020604051808303816000875af1158015611565573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115899190614756565b90505b9392505050565b6115a060608701876148ae565b6115ae9060408101906146e2565b6115bc90602081019061493e565b60200135156115de576040516379bb579b60e11b815260040160405180910390fd5b60006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663c79aeaae61161f60608a0160408b016143cf565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015611663573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116879190614756565b905060006001600160a01b03821663e4dc2aa46116aa60608b0160408c016143cf565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156116ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117129190614773565b905060006117213386866114e9565b90506117398161173460608c018c6148ae565b6133f8565b61174a816109e460608c018c6148ae565b60006001600160a01b03841663b943855e61176b60608d0160408e016143cf565b6040516001600160e01b031960e084901b1681526001600160a01b0391821660048201529085166024820152604401602060405180830381865afa1580156117b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117db9190614773565b90506118368260405180606001604052808d60000180360381019061180091906148da565b81526020018d604001602081019061181891906143cf565b6001600160a01b03168152602001849052610bae60608e018e6148ae565b6118518261184a60608d0160408e016143cf565b838c612ccd565b61185c828989612045565b6001600160a01b03841663e4dc2aa461187b60608d0160408e016143cf565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156118bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e39190614773565b831061190257604051638480c32560e01b815260040160405180910390fd5b50505050505050505050565b60405163429b62e560e01b81526001600160a01b03808616600483015285916000917f0000000000000000000000000000000000000000000000000000000000000000169063429b62e590602401602060405180830381865afa158015611979573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061199d9190614756565b6001600160a01b0316036119c457604051633098a45560e01b815260040160405180910390fd5b336001600160a01b0316816001600160a01b03166319d40b086040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a309190614756565b6001600160a01b031614611a575760405163c19f17a960e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638bb96a906040518060600160405280886001600160a01b03168152602001876020016040016020810190611ab691906143cf565b6001600160a01b0316815260808801356020909101526040516001600160e01b031960e084901b168152611aed91906004016148f6565b600060405180830381600087803b158015611b0757600080fd5b505af1158015611b1b573d6000803e3d6000fd5b50505050611b4c858585857f139f6e665188bd3327a590d2d1c9d8d09b55289c07e19fef103ceab100ea097961316d565b5050505050565b611b6360608701604088016143cf565b6040516363cd755760e11b81526001600160a01b0382811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063c79aeaae90602401602060405180830381865afa158015611bce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bf29190614756565b6040516339370aa960e21b81526001600160a01b03848116600483015291925060009183169063e4dc2aa490602401602060405180830381865afa158015611c3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c629190614773565b90506000611c6f336111f6565b905086611ca257611c90818b8b60008051602061535a8339815191526121a1565b611ca2818b6107fb60608c018c61478c565b611cac81896133f8565b611cbd816109f260408b018b6146e2565b86611ce257611ce281611cd5368d90038d018d614838565b61087d60608c018c61478c565b611ced818787612045565b60608a01803590611d019060408d016143cf565b6001600160a01b039081169083167fb00138e527e12645ad7a5a8d608b107cf2fcd3525d2b5d09973ed652f87b4f39611d3d60208f018f6143cf565b8e60000160200135604051611d53929190614925565b60405180910390a4506040516339370aa960e21b81526001600160a01b03848116600483015283169063e4dc2aa4906024016108c3565b60405163429b62e560e01b81526001600160a01b03808816600483015287916000917f0000000000000000000000000000000000000000000000000000000000000000169063429b62e590602401602060405180830381865afa158015611df5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e199190614756565b6001600160a01b031603611e4057604051633098a45560e01b815260040160405180910390fd5b336001600160a01b0316816001600160a01b03166319d40b086040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eac9190614756565b6001600160a01b031614611ed35760405163c19f17a960e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663f1cf418260405180606001604052808a6001600160a01b03168152602001896040016020810190611f2f91906143cf565b6001600160a01b0316815260200189606001358152506040518263ffffffff1660e01b8152600401611f6191906148f6565b600060405180830381600087803b158015611f7b57600080fd5b505af1158015611f8f573d6000803e3d6000fd5b5050505061103c8787878787877f6b277b6f647b7a0d8000e4fc1460639f589d3e1262b3f1a2f378cce0a5da40bb612ef5565b6000611fcf3384846114e9565b9050611fef81611fe560608a0160408b016143cf565b89606001356135c1565b61200981612002368a90038a018a614838565b8888612697565b61103c8161201d60608a0160408b016143cf565b896060013587612ccd565b61203a84846107fb604086018661478c565b61113c8483836124cb565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b606081526020019060019003908161207f5790505090507f0000000000000000000000000000000000000000000000000000000000000000826000815181106120ca576120ca614955565b60200260200101906001600160a01b031690816001600160a01b03168152505083836040516024016120fd9291906149b4565b60408051601f198184030181529190526020810180516001600160e01b031663d354641160e01b1790528151829060009061213a5761213a614955565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038616906363fb0b969061217390859085906004016149c8565b600060405180830381600087803b15801561218d57600080fd5b505af1158015610923573d6000803e3d6000fd5b60006121b06020840184614702565b905011156121c8576121c38484846136b6565b6121dd565b6121dd84846121d785806148ae565b84613a2d565b60006121ec6060840184614702565b9050111561220a5761220a846122056060850185614702565b612045565b6060830180359061221e90604086016143cf565b6001600160a01b039081169086167fbf9d03ac543e8f596c6f4af5ab5e75f366a57d2d6c28d2ff9c024bd3f88e877161225a60208801886143cf565b6040516110df919060208a013590614925565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b60608152602001906001900390816122a757905050905060006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663c79aeaae6122fc60208901896143cf565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015612340573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123649190614756565b9050808360008151811061237a5761237a614955565b60200260200101906001600160a01b031690816001600160a01b0316815250508585856040516024016123af93929190614b03565b60408051601f198184030181529190526020810180516001600160e01b0316631423e67960e11b179052825183906000906123ec576123ec614955565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038816906363fb0b969061242590869086906004016149c8565b600060405180830381600087803b15801561243f57600080fd5b505af1158015612453573d6000803e3d6000fd5b505050606087018035915061246b90604089016143cf565b6001600160a01b039081169089167f976f9aa1da6d0f0e23405b12b4e2b446c12615150624819f4bebe8060fa39f616124a760208b018b6143cf565b6040516124ba919060208d013590614925565b60405180910390a450505050505050565b6040805160028082526060820183526000926020830190803683375050604080516002808252606082019092529293506000929150602082015b60608152602001906001900390816125055790505090507f00000000000000000000000000000000000000000000000000000000000000008260008151811061255057612550614955565b6001600160a01b039092166020928302919091019091015261257284806146e2565b6040516024016125829190614ca7565b60408051601f198184030181529190526020810180516001600160e01b0316630505281960e11b179052815182906000906125bf576125bf614955565b60200260200101819052507f0000000000000000000000000000000000000000000000000000000000000000826001815181106125fe576125fe614955565b6001600160a01b039092166020928302919091018201527f000000000000000000000000000000000000000000000000000000000000000090849061264590870187614702565b6040516024016126589493929190614db7565b60408051601f198184030181529190526020810180516001600160e01b031663dcc3284160e01b17905281518290600190811061213a5761213a614955565b8251516040516363cd755760e11b81526001600160a01b0391821660048201526000917f0000000000000000000000000000000000000000000000000000000000000000169063c79aeaae90602401602060405180830381865afa158015612703573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127279190614756565b604080516001808252818301909252919250600091906020808301908036833750506040805160018082528183019092529293506000929150602082015b6060815260200190600190039081612765579050509050828260008151811061279057612790614955565b60200260200101906001600160a01b031690816001600160a01b0316815250508585856040516024016127c593929190614dec565b60408051601f198184030181529190526020810180516001600160e01b03166001624236cd60e11b03191790528151829060009061280557612805614955565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038816906363fb0b969061283e90859085906004016149c8565b600060405180830381600087803b15801561285857600080fd5b505af115801561286c573d6000803e3d6000fd5b50505050856040015186602001516001600160a01b0316886001600160a01b03167f53375fafff3a4a00460af1c1347b8f0dd0d35cce6b2bd5661346bc8ad1d37a008960000151600001518a60000151602001516040516124ba929190614925565b606081018035906128e290604084016143cf565b6001600160a01b039081169084167f3d988581b5d3b2ed8c77b357af36f383c9a6d036a423cb9f82be3b03211cfd1461291e60208601866143cf565b6040516129319190602088013590614925565b60405180910390a45050565b61295783838360008051602061535a833981519152613a2d565b612965836122058380614702565b6060820180359061297990604085016143cf565b6001600160a01b039081169085167fbf9d03ac543e8f596c6f4af5ab5e75f366a57d2d6c28d2ff9c024bd3f88e87716129b560208701876143cf565b6040516129c89190602089013590614925565b60405180910390a4505050565b6040516363cd755760e11b81526001600160a01b03848116600483015260009182917f0000000000000000000000000000000000000000000000000000000000000000169063c79aeaae90602401602060405180830381865afa158015612a40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a649190614756565b90506000816001600160a01b0316639e6eda1886866040518363ffffffff1660e01b8152600401612a96929190614925565b602060405180830381865afa158015612ab3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ad79190614e45565b90506101f48162ffffff1611612b11577fcb922c4d36cde61b3660729b33f36eff74a31440cf3e852d4467b4bd6045011c9250505061158c565b610bb88162ffffff1611612b49577fc552bcd88e8785f8a0d9f9c5b9dc4e198659e68e9f6645642142b2900cde564d9250505061158c565b7fa7e26cbd23588e6e87ee40cb01079e973bf8a0910c2edb6bc11ba3240a81480b9250505061158c565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b6060815260200190600190039081612bad5790505090507f000000000000000000000000000000000000000000000000000000000000000082600081518110612bf857612bf8614955565b60200260200101906001600160a01b031690816001600160a01b03168152505082604051602401612c299190614eca565b60408051601f198184030181529190526020810180516001600160e01b0316633d74119b60e21b17905281518290600090612c6657612c66614955565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038516906363fb0b9690612c9f90859085906004016149c8565b600060405180830381600087803b158015612cb957600080fd5b505af1158015610e00573d6000803e3d6000fd5b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b6060815260200190600190039081612d075790505090507f000000000000000000000000000000000000000000000000000000000000000082600081518110612d5257612d52614955565b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000000000000000000000000000000000000000000000858585604051602401612da99493929190615173565b60408051601f198184030181529190526020810180516001600160e01b0316636505c9ff60e11b17905281518290600090612de657612de6614955565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038716906363fb0b9690612e1f90859085906004016149c8565b600060405180830381600087803b158015612e3957600080fd5b505af1158015611902573d6000803e3d6000fd5b60608401803590612e6190604087016143cf565b6001600160a01b039081169087167f8181f528787b6f5d64998fce6130134048cf712961e4d1554465276932df54cc612e9d60208901896143cf565b6020808a01359089908890612eb4908b018b6143cf565b604080516001600160a01b039687168152602080820196909652938616908401526060830191909152909216608083015287013560a082015260c0016111e7565b612f0487876121d788806148ae565b83612f2657612f268787612f1888806148ae565b6107fb90606081019061478c565b612f37876109f260208801886146e2565b83612f5957612f5987612f4f36899003890189614838565b610bae88806148ae565b612f64878484612045565b60608601803590612f7890604089016143cf565b6001600160a01b039081169089167f504180eddec0aa4ed3bb8edcf99b13013e1d8ae52be37f0f4f38d14ccf0c99a56124a760208b018b6143cf565b612fce86868660008051602061535a8339815191526121a1565b612ffa8686857fdfa64d371f38074894860654f13f7558a46a9b052e65fd158280c8dd2f07af64612028565b613005868383612045565b6060850180359061301990604088016143cf565b6001600160a01b039081169088167fc9a3d0888f5ab83eb0fcd2e948c80035fd02319ad2f57c4bc68b1513a0f78ea061305560208a018a6143cf565b604051613068919060208c013590614925565b60405180910390a4505050505050565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b60608152602001906001900390816130b25790505090507f0000000000000000000000000000000000000000000000000000000000000000826000815181106130fd576130fd614955565b60200260200101906001600160a01b031690816001600160a01b0316815250508383604051602401613130929190614925565b60408051601f198184030181529190526020810180516001600160e01b0316631df6a96160e31b1790528151829060009061213a5761213a614955565b613188856020860161318260a08801886148ae565b846121a1565b6131c7856020860161319d60c08801886148c4565b6109c06131b060808a0160608b016143cf565b6131bd60208b018b6143cf565b60808b01356129d5565b6131d8856109e460e08701876148ae565b6131f6856131ec60808701606088016143cf565b6080870135613d29565b60006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663c79aeaae61323760808801606089016143cf565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa15801561327b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061329f9190614756565b6001600160a01b031663b943855e6132bd60808801606089016143cf565b6040516001600160e01b031960e084901b1681526001600160a01b0391821660048201529089166024820152604401602060405180830381865afa158015613309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061332d9190614773565b90506133888660405180606001604052808860200160000180360381019061335591906148da565b815260200161336a60808a0160608b016143cf565b6001600160a01b03168152602001849052610bae60e08901896148ae565b613393868585612045565b608085018035906133a790606088016143cf565b6001600160a01b039081169088167f550ef6ca72911d6a82dfa1fade2d87ed10c69661f1bf04376add792b5d1e54376133e660408a0160208b016143cf565b6040805161306892918c013590614925565b60008061340860408401846146e2565b6134129080614702565b905011613420576000613442565b7fab273376f9efdd920b41b30b3f02b3dee877874951e3c14bf87bc60060efebcc5b604080516001808252818301909252919250600091906020808301908036833750506040805160018082528183019092529293506000929150602082015b60608152602001906001900390816134805790505090507f0000000000000000000000000000000000000000000000000000000000000000826000815181106134cb576134cb614955565b6001600160a01b03909216602092830291909101909101526134ed8480614702565b6134fa6020870187614702565b7f0000000000000000000000000000000000000000000000000000000000000000876040516024016135319695949392919061525c565b60408051601f198184030181529190526020810180516001600160e01b03166312f5760360e01b1790528151829060009061356e5761356e614955565b6020026020010181905250846001600160a01b03166363fb0b963484846040518463ffffffff1660e01b81526004016135a89291906149c8565b6000604051808303818588803b158015612e3957600080fd5b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b60608152602001906001900390816135fb5790505090507f00000000000000000000000000000000000000000000000000000000000000008260008151811061364657613646614955565b60200260200101906001600160a01b031690816001600160a01b0316815250508383604051602401613679929190614925565b60408051601f198184030181529190526020810180516001600160e01b03166306c530b960e41b1790528151829060009061213a5761213a614955565b60006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663c79aeaae6136f460208601866143cf565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015613738573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061375c9190614756565b6040805160038082526080820190925291925060009190602082016060803683375050604080516003808252608082019092529293506000929150602082015b606081526020019060019003908161379c57905050905082826000815181106137c7576137c7614955565b6001600160a01b0390921660209283029190910190910152846137ea85806148ae565b6137f49080614702565b6137fe87806148ae565b61380f9060408101906020016152ce565b61381988806148ae565b61382a9060608101906040016152ce565b61383489806148ae565b61384290606081019061478c565b60405160240161385897969594939291906152e9565b60408051601f198184030181529190526020810180516001600160e01b0316636f4621e360e01b1790528151829060009061389557613895614955565b60200260200101819052507f0000000000000000000000000000000000000000000000000000000000000000826001815181106138d4576138d4614955565b6001600160a01b039092166020928302919091018201526138f790850185614702565b604051602401613908929190615345565b60408051601f198184030181529190526020810180516001600160e01b03166357e72eb360e01b17905281518290600190811061394757613947614955565b60200260200101819052507f00000000000000000000000000000000000000000000000000000000000000008260028151811061398657613986614955565b6001600160a01b03909216602092830291909101909101527f000000000000000000000000000000000000000000000000000000000000000060008051602061535a8339815191526139db6040870187614702565b6040516024016139ee9493929190614db7565b60408051601f198184030181529190526020810180516001600160e01b031663dcc3284160e01b179052815182906002908110612de657612de6614955565b60006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663c79aeaae613a6b60208701876143cf565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015613aaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ad39190614756565b60408051600280825260608201835292935060009290916020830190803683375050604080516002808252606082019092529293506000929150602082015b6060815260200190600190039081613b125790505090508282600081518110613b3d57613b3d614955565b6001600160a01b039092166020928302919091019091015285613b608680614702565b613b706040890160208a016152ce565b613b8060608a0160408b016152ce565b613b8d60608b018b61478c565b604051602401613ba397969594939291906152e9565b60408051601f198184030181529190526020810180516001600160e01b0316636f4621e360e01b17905281518290600090613be057613be0614955565b60200260200101819052507f000000000000000000000000000000000000000000000000000000000000000082600181518110613c1f57613c1f614955565b6001600160a01b03909216602092830291909101909101527f000000000000000000000000000000000000000000000000000000000000000084613c638780614702565b604051602401613c769493929190614db7565b60408051601f198184030181529190526020810180516001600160e01b031663dcc3284160e01b179052815182906001908110613cb557613cb5614955565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038816906363fb0b9690613cee90859085906004016149c8565b600060405180830381600087803b158015613d0857600080fd5b505af1158015613d1c573d6000803e3d6000fd5b5050505050505050505050565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b6060815260200190600190039081613d635790505090507f000000000000000000000000000000000000000000000000000000000000000082600081518110613dae57613dae614955565b6001600160a01b0392831660209182029290920101526040517f00000000000000000000000000000000000000000000000000000000000000008216602482015290851660448201526064810184905260840160408051601f198184030181529190526020810180516001600160e01b0316631f5cecd560e01b1790528151829060009061213a5761213a614955565b600060808284031215613e5057600080fd5b50919050565b600060608284031215613e5057600080fd5b60008083601f840112613e7a57600080fd5b5081356001600160401b03811115613e9157600080fd5b6020830191508360208260051b8501011115613eac57600080fd5b9250929050565b60008060008060c08587031215613ec957600080fd5b613ed38686613e3e565b935060808501356001600160401b0380821115613eef57600080fd5b613efb88838901613e56565b945060a0870135915080821115613f1157600080fd5b50613f1e87828801613e68565b95989497509550505050565b80358015158114613f3a57600080fd5b919050565b6000806000806000806101008789031215613f5957600080fd5b613f638888613e3e565b955060808701356001600160401b0380821115613f7f57600080fd5b613f8b8a838b01613e3e565b965060a0890135915080821115613fa157600080fd5b613fad8a838b01613e56565b9550613fbb60c08a01613f2a565b945060e0890135915080821115613fd157600080fd5b50613fde89828a01613e68565b979a9699509497509295939492505050565b60008060a0838503121561400357600080fd5b61400d8484613e3e565b915060808301356001600160401b0381111561402857600080fd5b61403485828601613e3e565b9150509250929050565b60006101008284031215613e5057600080fd5b60006103408284031215613e5057600080fd5b6000806000806060858703121561407a57600080fd5b84356001600160401b038082111561409157600080fd5b61409d8883890161403e565b955060208701359150808211156140b357600080fd5b6140bf88838901614051565b94506040870135915080821115613f1157600080fd5b600060408284031215613e5057600080fd5b600080600080600060e086880312156140ff57600080fd5b6141098787613e3e565b945060808601356001600160401b038082111561412557600080fd5b61413189838a016140d5565b955061413f60a08901613f2a565b945060c088013591508082111561415557600080fd5b5061416288828901613e68565b969995985093965092949392505050565b600080600080600060e0868803121561418b57600080fd5b6141958787613e3e565b945060808601356001600160401b03808211156141b157600080fd5b6141bd89838a01613e3e565b955060a08801359150808211156141d357600080fd5b61413f89838a01613e56565b6001600160a01b03811681146141f457600080fd5b50565b600080600080600080610100878903121561421157600080fd5b863561421c816141df565b955061422b8860208901613e3e565b945060a08701356001600160401b038082111561424757600080fd5b6142538a838b01613e3e565b955060c089013591508082111561426957600080fd5b613fbb8a838b01613e56565b60008083601f84011261428757600080fd5b5081356001600160401b0381111561429e57600080fd5b602083019150836020828501011115613eac57600080fd5b600080600060a084860312156142cb57600080fd5b6142d58585613e3e565b925060808401356001600160401b038111156142f057600080fd5b6142fc86828701614275565b9497909650939450505050565b60008060006040848603121561431e57600080fd5b83356001600160401b038082111561433557600080fd5b6143418783880161403e565b9450602086013591508082111561435757600080fd5b506142fc86828701613e68565b60008060008060c0858703121561437a57600080fd5b6143848686613e3e565b935060808501356001600160401b03808211156143a057600080fd5b6143ac88838901613e3e565b945060a08701359150808211156143c257600080fd5b50613f1e87828801614275565b6000602082840312156143e157600080fd5b813561158c816141df565b600080600060c0848603121561440157600080fd5b833561440c816141df565b925061441b8560208601613e3e565b915060a08401356001600160401b0381111561443657600080fd5b61444286828701613e3e565b9150509250925092565b60008060006060848603121561446157600080fd5b833561446c816141df565b9250602084013561447c816141df565b929592945050506040919091013590565b60008060008060008060a087890312156144a657600080fd5b86356001600160401b03808211156144bd57600080fd5b6144c98a838b01613e3e565b975060208901359150808211156144df57600080fd5b6144eb8a838b01614051565b9650604089013591508082111561450157600080fd5b5061450e89828a01613e68565b9095509350506060870135614522816141df565b80925050608087013590509295509295509295565b6000806000806060858703121561454d57600080fd5b8435614558816141df565b935060208501356001600160401b038082111561457457600080fd5b6140bf8883890161403e565b600080600080600080610100878903121561459a57600080fd5b6145a48888613e3e565b955060808701356001600160401b03808211156145c057600080fd5b6145cc8a838b01613e3e565b965060a08901359150808211156145e257600080fd5b613fad8a838b01613e3e565b600080600080600080610100878903121561460857600080fd5b8635614613816141df565b95506146228860208901613e3e565b945060a08701356001600160401b038082111561463e57600080fd5b613fad8a838b016140d5565b600080600080600080610100878903121561466457600080fd5b61466e8888613e3e565b955060808701356001600160401b038082111561468a57600080fd5b6146968a838b01614275565b909750955060a08901359150808211156146af57600080fd5b506146bc89828a01614051565b93505060c08701356146cd816141df565b8092505060e087013590509295509295509295565b60008235603e198336030181126146f857600080fd5b9190910192915050565b6000808335601e1984360301811261471957600080fd5b8301803591506001600160401b0382111561473357600080fd5b6020019150600581901b3603821315613eac57600080fd5b8035613f3a816141df565b60006020828403121561476857600080fd5b815161158c816141df565b60006020828403121561478557600080fd5b5051919050565b6000808335601e198436030181126147a357600080fd5b8301803591506001600160401b038211156147bd57600080fd5b602001915036819003821315613eac57600080fd5b6000604082840312156147e457600080fd5b604051604081018181106001600160401b038211171561481457634e487b7160e01b600052604160045260246000fd5b6040529050808235614825816141df565b8152602092830135920191909152919050565b60006080828403121561484a57600080fd5b604051606081018181106001600160401b038211171561487a57634e487b7160e01b600052604160045260246000fd5b60405261488784846147d2565b81526040830135614897816141df565b602082015260609290920135604083015250919050565b60008235607e198336030181126146f857600080fd5b60008235605e198336030181126146f857600080fd5b6000604082840312156148ec57600080fd5b61158c83836147d2565b81516001600160a01b039081168252602080840151909116908201526040918201519181019190915260600190565b6001600160a01b03929092168252602082015260400190565b6000823561017e198336030181126146f857600080fd5b634e487b7160e01b600052603260045260246000fd5b8183526000602080850194508260005b858110156149a957813561498e816141df565b6001600160a01b03168752958201959082019060010161497b565b509495945050505050565b60208152600061158960208301848661496b565b604080825283519082018190526000906020906060840190828701845b82811015614a0a5781516001600160a01b0316845292840192908401906001016149e5565b50505083810382850152845180825282820190600581901b8301840187850160005b83811015614a8957601f19808785030186528251805180865260005b81811015614a63578281018b01518782018c01528a01614a48565b5060008682018b015296890196601f019091169093018701925090860190600101614a2c565b50909998505050505050505050565b8035614aa3816141df565b6001600160a01b03908116835260208281013590840152604082013590614ac9826141df565b166040830152606090810135910152565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b614b0d8185614a98565b60a060808201526000614b2460a083018486614ada565b95945050505050565b80356001600160801b0381168114613f3a57600080fd5b6000808335601e19843603018112614b5b57600080fd5b83016020810192503590506001600160401b03811115614b7a57600080fd5b803603821315613eac57600080fd5b6000808335601e19843603018112614ba057600080fd5b83016020810192503590506001600160401b03811115614bbf57600080fd5b8060051b3603821315613eac57600080fd5b60008235609e19833603018112614be757600080fd5b90910192915050565b81835260006020808501808196508560051b810191508460005b87811015614c9a578284038952614c218288614bd1565b60a08135614c2e816141df565b6001600160a01b03908116875282880135888801526040808401359088015260609081840135614c5d816141df565b16908701526080614c7083820184614b44565b93508282890152614c848389018583614ada565b9c89019c97505050928601925050600101614c0a565b5091979650505050505050565b602081526000823560fe19843603018112614cc157600080fd5b6040602084015283018035614cd5816141df565b6001600160a01b0316606084015260208101356080840152614cf960408201614b2d565b6001600160801b03811660a085015250606081013560c0840152608081013560e0840152614d2960a08201614b2d565b610100614d40818601836001600160801b03169052565b614d4c60c08401614b2d565b6001600160801b0381166101208701529150614d6b60e0840184614b44565b935091508061014086015250614d8661016085018383614ada565b915050614d966020850185614b89565b848303601f19016040860152614dad838284614bf0565b9695505050505050565b6001600160a01b03851681526001600160e01b031984166020820152606060408201819052600090614dad908301848661496b565b6000845160018060a01b038082511684526020820151602085015280602088015116604085015250506040850151606083015260a06080830152614b2460a083018486614ada565b62ffffff811681146141f457600080fd5b600060208284031215614e5757600080fd5b815161158c81614e34565b8035613f3a81614e34565b8035614e78816141df565b6001600160a01b039081168352602082013590614e94826141df565b1660208301526040810135614ea881614e34565b62ffffff81166040840152505050565b8035600281900b8114613f3a57600080fd5b602081526000614eda8384614b89565b60406020850152614eef606085018284614bf0565b915050602084013561017e19853603018112614f0a57600080fd5b838203601f190160408501528401610180614f3583614f288461474b565b6001600160a01b03169052565b60208201356020840152614f4f6040840160408401614e6d565b614f5b60a08301614eb8565b614f6a60a085018260020b9052565b50614f7760c08301614eb8565b614f8660c085018260020b9052565b5060e08281013590840152610100808301359084015261012080830135908401526101408083013590840152610160614fc181840184614b44565b93508282860152614fd58386018583614ada565b98975050505050505050565b803560ff81168114613f3a57600080fd5b80356003811061500157600080fd5b82526020810135615011816141df565b6001600160a01b03166020929092019190915250565b61503d8261503483614e62565b62ffffff169052565b61504960208201614e62565b62ffffff16602083015261505f60408201614eb8565b61506e604084018260020b9052565b5061507b60608201614eb8565b61508a606084018260020b9052565b506080810135608083015260a081013560a083015260c081013560c08301526150b560e08201614eb8565b6150c460e084018260020b9052565b506101006150d3818301614eb8565b6150e18285018260020b9052565b50506101206150f1818301614fe1565b60ff1690830152610140610946818401838301614ff2565b61511281614eb8565b60020b825261512360208201614eb8565b60020b60208301526040810135615139816141df565b6001600160a01b039081166040840152606082013590615158826141df565b1660608301526080818101359083015260a090810135910152565b6001600160a01b038581168252841660208201526040810183905260806060820152600082356151a2816141df565b6001600160a01b03166080830152602083013560a08301526151c660408401613f2a565b151560c08301526151dd60e0830160608501615027565b6151ea6101e08401613f2a565b6102606151fa8185018315159052565b61520c61028085016102008701614ff2565b6152196102408601613f2a565b8015156102c086015291506152346102e08501828701615109565b5050615244610320840184614b44565b6103406103a0850152614fd56103c085018284614ada565b60808152600061527060808301888a61496b565b82810360208401528581526001600160fb1b0386111561528f57600080fd5b8560051b808860208401376001600160a01b039590951660408401526001600160e01b0319939093166060909201919091525001602001949350505050565b6000602082840312156152e057600080fd5b61158c82614b2d565b60006101006152f8838b614a98565b80608084015261530b818401898b61496b565b6001600160801b0388811660a0860152871660c085015283810360e08501529050615337818587614ada565b9a9950505050505050505050565b602081526000611589602083018486614bf056fee400534da780c9d64ef8b5f03c074ff47537b6a4aa2a3e5d5455cb37b5406aa3a2646970667358221220bd1aeb8030723770f7edc36bc1a42c9738d3f58005e4d88df2903c528efd00c864736f6c63430008130033000000000000000000000000233d9067677dcf1a161954d45b4c965b9d567168000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c99000000000000000000000000372e7761997858be1ee3c492dfa01091282c5083000000000000000000000000188f3b2b1c40e3bc77bc0993c6c951ce4030c9430000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b0000000000000000000000009fad68008c8361436545a206c90af1cc480f710a00000000000000000000000046292986df2fee3a048dd6753918e62e93806c2d000000000000000000000000a697ca262c8338fce02f5e6a0484fcb3ae0bc8d80000000000000000000000000f592f2ee1779fa7d81a8482f4cc6d216a0fe04f
Deployed Bytecode
0x6080604052600436106101c25760003560e01c8063659b91b1116100f7578063c45a015511610095578063e0192b2811610064578063e0192b28146105c0578063e5bacdd0146105e0578063f0806a7f146105f3578063f0d847501461061357600080fd5b8063c45a015514610511578063cce5b8c614610545578063d996cef714610579578063ddff9470146105ad57600080fd5b80639448c56a116100d15780639448c56a14610469578063b3fb68d514610489578063b53c86d2146104a9578063bc6b74ab146104dd57600080fd5b8063659b91b1146104095780636e2f91d514610429578063759cb2341461044957600080fd5b806328734381116101645780633faa6e301161013e5780633faa6e30146103615780633fb53a0d14610395578063541bb89e146103c95780635ec5999e146103e957600080fd5b806328734381146102ed5780632af3fa1b1461030d57806338f6f9271461034157600080fd5b80631de7354b116101a05780631de7354b14610229578063237179671461027957806324f450db146102995780632812d614146102cd57600080fd5b8063107acebd146101c75780631c396db6146101e95780631d06722b14610209575b600080fd5b3480156101d357600080fd5b506101e76101e2366004613eb3565b610633565b005b3480156101f557600080fd5b506101e7610204366004613f3f565b6106ac565b34801561021557600080fd5b506101e7610224366004613ff0565b61092e565b34801561023557600080fd5b5061025d7f0000000000000000000000000f592f2ee1779fa7d81a8482f4cc6d216a0fe04f81565b6040516001600160a01b03909116815260200160405180910390f35b34801561028557600080fd5b506101e7610294366004614064565b61094b565b3480156102a557600080fd5b5061025d7f000000000000000000000000372e7761997858be1ee3c492dfa01091282c508381565b3480156102d957600080fd5b506101e76102e83660046140e7565b610c29565b3480156102f957600080fd5b506101e7610308366004614173565b610e0a565b34801561031957600080fd5b5061025d7f00000000000000000000000046292986df2fee3a048dd6753918e62e93806c2d81565b34801561034d57600080fd5b506101e761035c3660046141f7565b610e25565b34801561036d57600080fd5b5061025d7f0000000000000000000000009fad68008c8361436545a206c90af1cc480f710a81565b3480156103a157600080fd5b5061025d7f0000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b81565b3480156103d557600080fd5b506101e76103e43660046142b6565b611045565b3480156103f557600080fd5b506101e7610404366004613ff0565b6110ed565b34801561041557600080fd5b506101e7610424366004614309565b611114565b34801561043557600080fd5b506101e7610444366004614364565b611142565b34801561045557600080fd5b5061025d6104643660046143cf565b6111f6565b34801561047557600080fd5b506101e76104843660046143ec565b6112b4565b34801561049557600080fd5b5061025d6104a436600461444c565b6114e9565b3480156104b557600080fd5b5061025d7f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c9981565b3480156104e957600080fd5b5061025d7f000000000000000000000000588be0d1422b81e0c7c1349d124b047909098b1981565b34801561051d57600080fd5b5061025d7f000000000000000000000000233d9067677dcf1a161954d45b4c965b9d56716881565b34801561055157600080fd5b5061025d7f000000000000000000000000188f3b2b1c40e3bc77bc0993c6c951ce4030c94381565b34801561058557600080fd5b5061025d7f000000000000000000000000a697ca262c8338fce02f5e6a0484fcb3ae0bc8d881565b6101e76105bb36600461448d565b611593565b3480156105cc57600080fd5b506101e76105db366004614537565b61190e565b6101e76105ee366004614580565b611b53565b3480156105ff57600080fd5b506101e761060e3660046145ee565b611d8a565b34801561061f57600080fd5b506101e761062e36600461464a565b611fc2565b600061063e336111f6565b905060008061064d86806146e2565b61065b906020810190614702565b90501161066957600061068b565b7fdfa64d371f38074894860654f13f7558a46a9b052e65fd158280c8dd2f07af645b905061069982878784612028565b6106a4828585612045565b505050505050565b6106bc60608701604088016143cf565b6040516363cd755760e11b81526001600160a01b0382811660048301526000917f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c999091169063c79aeaae90602401602060405180830381865afa158015610727573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074b9190614756565b6040516339370aa960e21b81526001600160a01b03848116600483015291925060009183169063e4dc2aa490602401602060405180830381865afa158015610797573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bb9190614773565b905060006107c8336111f6565b905086610800576107e9818b8b60008051602061535a8339815191526121a1565b610800818b6107fb60408c018c61478c565b61226d565b60008061080d8a806146e2565b61081b906020810190614702565b90501161082957600061084b565b7fdfa64d371f38074894860654f13f7558a46a9b052e65fd158280c8dd2f07af645b9050610858828a836124cb565b876108825761088282610870368e90038e018e614838565b61087d60408d018d61478c565b612697565b61088d828888612045565b610897828c6128ce565b50506040516339370aa960e21b81526001600160a01b03848116600483015283169063e4dc2aa4906024015b602060405180830381865afa1580156108e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109049190614773565b81146109235760405163648873f960e01b815260040160405180910390fd5b505050505050505050565b6000610939336111f6565b905061094681848461293d565b505050565b6000610956336111f6565b9050610981816020870161096d60a08901896148ae565b60008051602061535a8339815191526121a1565b6109c5816020870161099660c08901896148c4565b6109c06109a960808b0160608c016143cf565b6109b660208c018c6143cf565b60808c01356129d5565b612028565b6109f7816109d660e08801886148ae565b6109e49060608101906148ae565b6109f29060408101906146e2565b612b73565b60006001600160a01b037f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c991663c79aeaae610a386080890160608a016143cf565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610a7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa09190614756565b6001600160a01b031663b943855e610abe6080890160608a016143cf565b6040516001600160e01b031960e084901b1681526001600160a01b0391821660048201529085166024820152604401602060405180830381865afa158015610b0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2e9190614773565b9050610bbc826040518060600160405280898060e00190610b4f91906148ae565b610b5f90368190038101906148da565b8152602001610b7160e08b018b6148ae565b610b829060608101906040016143cf565b6001600160a01b03168152602001849052610ba060e08a018a6148ae565b610bae9060608101906148ae565b61087d90606081019061478c565b610be582610bcd60e08901896148ae565b610bde9060608101906040016143cf565b8388612ccd565b610bf0828585612045565b6106a48260208801610c0560e08a018a6148ae565b610c169060608101906040016143cf565b610c2360e08b018b6148ae565b85612e4d565b610c3960608601604087016143cf565b6040516363cd755760e11b81526001600160a01b0382811660048301526000917f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c999091169063c79aeaae90602401602060405180830381865afa158015610ca4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc89190614756565b6040516339370aa960e21b81526001600160a01b03848116600483015291925060009183169063e4dc2aa490602401602060405180830381865afa158015610d14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d389190614773565b90506000610d45336111f6565b9050610d76818a8a8a8a8a7f1d5b8de553017a3bd388578aeece0183b79c5ca87ec64628b3f76b39487f0231612ef5565b506040516339370aa960e21b81526001600160a01b03848116600483015283169063e4dc2aa490602401602060405180830381865afa158015610dbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de19190614773565b8114610e005760405163648873f960e01b815260040160405180910390fd5b5050505050505050565b6000610e15336111f6565b90506106a4818787878787612fb4565b60405163429b62e560e01b81526001600160a01b03808816600483015287916000917f000000000000000000000000233d9067677dcf1a161954d45b4c965b9d567168169063429b62e590602401602060405180830381865afa158015610e90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb49190614756565b6001600160a01b031603610edb57604051633098a45560e01b815260040160405180910390fd5b336001600160a01b0316816001600160a01b03166319d40b086040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f479190614756565b6001600160a01b031614610f6e5760405163c19f17a960e01b815260040160405180910390fd5b7f000000000000000000000000372e7761997858be1ee3c492dfa01091282c50836001600160a01b031663459e268460405180606001604052808a6001600160a01b03168152602001896040016020810190610fca91906143cf565b6001600160a01b0316815260200189606001358152506040518263ffffffff1660e01b8152600401610ffc91906148f6565b600060405180830381600087803b15801561101657600080fd5b505af115801561102a573d6000803e3d6000fd5b5050505061103c878787878787612fb4565b50505050505050565b6000611050336111f6565b905061105e8185858561226d565b61107c8161107260608701604088016143cf565b8660600135613078565b6060840180359061109090604087016143cf565b6001600160a01b039081169083167f976f9aa1da6d0f0e23405b12b4e2b446c12615150624819f4bebe8060fa39f616110cc60208901896143cf565b6040516110df919060208b013590614925565b60405180910390a450505050565b60006110f8336111f6565b905061094681848460008051602061535a8339815191526121a1565b600061111f336111f6565b905061113c8185858560008051602061535a83398151915261316d565b50505050565b600061114d336111f6565b905061115a81868661293d565b6111668186858561226d565b6111848161117a60608801604089016143cf565b8760600135613078565b6060850180359061119890604088016143cf565b6001600160a01b039081169083167fc9a3d0888f5ab83eb0fcd2e948c80035fd02319ad2f57c4bc68b1513a0f78ea06111d460208a018a6143cf565b6040516111e7919060208c013590614925565b60405180910390a45050505050565b6040516312cfc9b560e31b81526001600160a01b03828116600483015260009182917f000000000000000000000000233d9067677dcf1a161954d45b4c965b9d567168169063967e4da890602401602060405180830381865afa158015611261573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112859190614756565b90506001600160a01b0381166112ae57604051633098a45560e01b815260040160405180910390fd5b92915050565b60405163429b62e560e01b81526001600160a01b03808516600483015284916000917f000000000000000000000000233d9067677dcf1a161954d45b4c965b9d567168169063429b62e590602401602060405180830381865afa15801561131f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113439190614756565b6001600160a01b03160361136a57604051633098a45560e01b815260040160405180910390fd5b336001600160a01b0316816001600160a01b03166319d40b086040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d69190614756565b6001600160a01b0316146113fd5760405163c19f17a960e01b815260040160405180910390fd5b7f000000000000000000000000372e7761997858be1ee3c492dfa01091282c50836001600160a01b031663bca9ca736040518060600160405280876001600160a01b0316815260200186604001602081019061145991906143cf565b6001600160a01b0316815260200186606001358152506040518263ffffffff1660e01b815260040161148b91906148f6565b600060405180830381600087803b1580156114a557600080fd5b505af11580156114b9573d6000803e3d6000fd5b5050505061113c8484847f139f6e665188bd3327a590d2d1c9d8d09b55289c07e19fef103ceab100ea09796121a1565b60405163de0d95ed60e01b81526001600160a01b0384811660048301528381166024830152604482018390526000917f000000000000000000000000233d9067677dcf1a161954d45b4c965b9d5671689091169063de0d95ed906064016020604051808303816000875af1158015611565573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115899190614756565b90505b9392505050565b6115a060608701876148ae565b6115ae9060408101906146e2565b6115bc90602081019061493e565b60200135156115de576040516379bb579b60e11b815260040160405180910390fd5b60006001600160a01b037f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c991663c79aeaae61161f60608a0160408b016143cf565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015611663573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116879190614756565b905060006001600160a01b03821663e4dc2aa46116aa60608b0160408c016143cf565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156116ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117129190614773565b905060006117213386866114e9565b90506117398161173460608c018c6148ae565b6133f8565b61174a816109e460608c018c6148ae565b60006001600160a01b03841663b943855e61176b60608d0160408e016143cf565b6040516001600160e01b031960e084901b1681526001600160a01b0391821660048201529085166024820152604401602060405180830381865afa1580156117b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117db9190614773565b90506118368260405180606001604052808d60000180360381019061180091906148da565b81526020018d604001602081019061181891906143cf565b6001600160a01b03168152602001849052610bae60608e018e6148ae565b6118518261184a60608d0160408e016143cf565b838c612ccd565b61185c828989612045565b6001600160a01b03841663e4dc2aa461187b60608d0160408e016143cf565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156118bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e39190614773565b831061190257604051638480c32560e01b815260040160405180910390fd5b50505050505050505050565b60405163429b62e560e01b81526001600160a01b03808616600483015285916000917f000000000000000000000000233d9067677dcf1a161954d45b4c965b9d567168169063429b62e590602401602060405180830381865afa158015611979573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061199d9190614756565b6001600160a01b0316036119c457604051633098a45560e01b815260040160405180910390fd5b336001600160a01b0316816001600160a01b03166319d40b086040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a309190614756565b6001600160a01b031614611a575760405163c19f17a960e01b815260040160405180910390fd5b7f000000000000000000000000372e7761997858be1ee3c492dfa01091282c50836001600160a01b0316638bb96a906040518060600160405280886001600160a01b03168152602001876020016040016020810190611ab691906143cf565b6001600160a01b0316815260808801356020909101526040516001600160e01b031960e084901b168152611aed91906004016148f6565b600060405180830381600087803b158015611b0757600080fd5b505af1158015611b1b573d6000803e3d6000fd5b50505050611b4c858585857f139f6e665188bd3327a590d2d1c9d8d09b55289c07e19fef103ceab100ea097961316d565b5050505050565b611b6360608701604088016143cf565b6040516363cd755760e11b81526001600160a01b0382811660048301526000917f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c999091169063c79aeaae90602401602060405180830381865afa158015611bce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bf29190614756565b6040516339370aa960e21b81526001600160a01b03848116600483015291925060009183169063e4dc2aa490602401602060405180830381865afa158015611c3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c629190614773565b90506000611c6f336111f6565b905086611ca257611c90818b8b60008051602061535a8339815191526121a1565b611ca2818b6107fb60608c018c61478c565b611cac81896133f8565b611cbd816109f260408b018b6146e2565b86611ce257611ce281611cd5368d90038d018d614838565b61087d60608c018c61478c565b611ced818787612045565b60608a01803590611d019060408d016143cf565b6001600160a01b039081169083167fb00138e527e12645ad7a5a8d608b107cf2fcd3525d2b5d09973ed652f87b4f39611d3d60208f018f6143cf565b8e60000160200135604051611d53929190614925565b60405180910390a4506040516339370aa960e21b81526001600160a01b03848116600483015283169063e4dc2aa4906024016108c3565b60405163429b62e560e01b81526001600160a01b03808816600483015287916000917f000000000000000000000000233d9067677dcf1a161954d45b4c965b9d567168169063429b62e590602401602060405180830381865afa158015611df5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e199190614756565b6001600160a01b031603611e4057604051633098a45560e01b815260040160405180910390fd5b336001600160a01b0316816001600160a01b03166319d40b086040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eac9190614756565b6001600160a01b031614611ed35760405163c19f17a960e01b815260040160405180910390fd5b7f000000000000000000000000372e7761997858be1ee3c492dfa01091282c50836001600160a01b031663f1cf418260405180606001604052808a6001600160a01b03168152602001896040016020810190611f2f91906143cf565b6001600160a01b0316815260200189606001358152506040518263ffffffff1660e01b8152600401611f6191906148f6565b600060405180830381600087803b158015611f7b57600080fd5b505af1158015611f8f573d6000803e3d6000fd5b5050505061103c8787878787877f6b277b6f647b7a0d8000e4fc1460639f589d3e1262b3f1a2f378cce0a5da40bb612ef5565b6000611fcf3384846114e9565b9050611fef81611fe560608a0160408b016143cf565b89606001356135c1565b61200981612002368a90038a018a614838565b8888612697565b61103c8161201d60608a0160408b016143cf565b896060013587612ccd565b61203a84846107fb604086018661478c565b61113c8483836124cb565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b606081526020019060019003908161207f5790505090507f0000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b826000815181106120ca576120ca614955565b60200260200101906001600160a01b031690816001600160a01b03168152505083836040516024016120fd9291906149b4565b60408051601f198184030181529190526020810180516001600160e01b031663d354641160e01b1790528151829060009061213a5761213a614955565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038616906363fb0b969061217390859085906004016149c8565b600060405180830381600087803b15801561218d57600080fd5b505af1158015610923573d6000803e3d6000fd5b60006121b06020840184614702565b905011156121c8576121c38484846136b6565b6121dd565b6121dd84846121d785806148ae565b84613a2d565b60006121ec6060840184614702565b9050111561220a5761220a846122056060850185614702565b612045565b6060830180359061221e90604086016143cf565b6001600160a01b039081169086167fbf9d03ac543e8f596c6f4af5ab5e75f366a57d2d6c28d2ff9c024bd3f88e877161225a60208801886143cf565b6040516110df919060208a013590614925565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b60608152602001906001900390816122a757905050905060006001600160a01b037f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c991663c79aeaae6122fc60208901896143cf565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015612340573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123649190614756565b9050808360008151811061237a5761237a614955565b60200260200101906001600160a01b031690816001600160a01b0316815250508585856040516024016123af93929190614b03565b60408051601f198184030181529190526020810180516001600160e01b0316631423e67960e11b179052825183906000906123ec576123ec614955565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038816906363fb0b969061242590869086906004016149c8565b600060405180830381600087803b15801561243f57600080fd5b505af1158015612453573d6000803e3d6000fd5b505050606087018035915061246b90604089016143cf565b6001600160a01b039081169089167f976f9aa1da6d0f0e23405b12b4e2b446c12615150624819f4bebe8060fa39f616124a760208b018b6143cf565b6040516124ba919060208d013590614925565b60405180910390a450505050505050565b6040805160028082526060820183526000926020830190803683375050604080516002808252606082019092529293506000929150602082015b60608152602001906001900390816125055790505090507f000000000000000000000000a697ca262c8338fce02f5e6a0484fcb3ae0bc8d88260008151811061255057612550614955565b6001600160a01b039092166020928302919091019091015261257284806146e2565b6040516024016125829190614ca7565b60408051601f198184030181529190526020810180516001600160e01b0316630505281960e11b179052815182906000906125bf576125bf614955565b60200260200101819052507f00000000000000000000000046292986df2fee3a048dd6753918e62e93806c2d826001815181106125fe576125fe614955565b6001600160a01b039092166020928302919091018201527f000000000000000000000000588be0d1422b81e0c7c1349d124b047909098b1990849061264590870187614702565b6040516024016126589493929190614db7565b60408051601f198184030181529190526020810180516001600160e01b031663dcc3284160e01b17905281518290600190811061213a5761213a614955565b8251516040516363cd755760e11b81526001600160a01b0391821660048201526000917f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c99169063c79aeaae90602401602060405180830381865afa158015612703573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127279190614756565b604080516001808252818301909252919250600091906020808301908036833750506040805160018082528183019092529293506000929150602082015b6060815260200190600190039081612765579050509050828260008151811061279057612790614955565b60200260200101906001600160a01b031690816001600160a01b0316815250508585856040516024016127c593929190614dec565b60408051601f198184030181529190526020810180516001600160e01b03166001624236cd60e11b03191790528151829060009061280557612805614955565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038816906363fb0b969061283e90859085906004016149c8565b600060405180830381600087803b15801561285857600080fd5b505af115801561286c573d6000803e3d6000fd5b50505050856040015186602001516001600160a01b0316886001600160a01b03167f53375fafff3a4a00460af1c1347b8f0dd0d35cce6b2bd5661346bc8ad1d37a008960000151600001518a60000151602001516040516124ba929190614925565b606081018035906128e290604084016143cf565b6001600160a01b039081169084167f3d988581b5d3b2ed8c77b357af36f383c9a6d036a423cb9f82be3b03211cfd1461291e60208601866143cf565b6040516129319190602088013590614925565b60405180910390a45050565b61295783838360008051602061535a833981519152613a2d565b612965836122058380614702565b6060820180359061297990604085016143cf565b6001600160a01b039081169085167fbf9d03ac543e8f596c6f4af5ab5e75f366a57d2d6c28d2ff9c024bd3f88e87716129b560208701876143cf565b6040516129c89190602089013590614925565b60405180910390a4505050565b6040516363cd755760e11b81526001600160a01b03848116600483015260009182917f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c99169063c79aeaae90602401602060405180830381865afa158015612a40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a649190614756565b90506000816001600160a01b0316639e6eda1886866040518363ffffffff1660e01b8152600401612a96929190614925565b602060405180830381865afa158015612ab3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ad79190614e45565b90506101f48162ffffff1611612b11577fcb922c4d36cde61b3660729b33f36eff74a31440cf3e852d4467b4bd6045011c9250505061158c565b610bb88162ffffff1611612b49577fc552bcd88e8785f8a0d9f9c5b9dc4e198659e68e9f6645642142b2900cde564d9250505061158c565b7fa7e26cbd23588e6e87ee40cb01079e973bf8a0910c2edb6bc11ba3240a81480b9250505061158c565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b6060815260200190600190039081612bad5790505090507f000000000000000000000000a697ca262c8338fce02f5e6a0484fcb3ae0bc8d882600081518110612bf857612bf8614955565b60200260200101906001600160a01b031690816001600160a01b03168152505082604051602401612c299190614eca565b60408051601f198184030181529190526020810180516001600160e01b0316633d74119b60e21b17905281518290600090612c6657612c66614955565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038516906363fb0b9690612c9f90859085906004016149c8565b600060405180830381600087803b158015612cb957600080fd5b505af1158015610e00573d6000803e3d6000fd5b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b6060815260200190600190039081612d075790505090507f0000000000000000000000000f592f2ee1779fa7d81a8482f4cc6d216a0fe04f82600081518110612d5257612d52614955565b60200260200101906001600160a01b031690816001600160a01b0316815250507f000000000000000000000000372e7761997858be1ee3c492dfa01091282c5083858585604051602401612da99493929190615173565b60408051601f198184030181529190526020810180516001600160e01b0316636505c9ff60e11b17905281518290600090612de657612de6614955565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038716906363fb0b9690612e1f90859085906004016149c8565b600060405180830381600087803b158015612e3957600080fd5b505af1158015611902573d6000803e3d6000fd5b60608401803590612e6190604087016143cf565b6001600160a01b039081169087167f8181f528787b6f5d64998fce6130134048cf712961e4d1554465276932df54cc612e9d60208901896143cf565b6020808a01359089908890612eb4908b018b6143cf565b604080516001600160a01b039687168152602080820196909652938616908401526060830191909152909216608083015287013560a082015260c0016111e7565b612f0487876121d788806148ae565b83612f2657612f268787612f1888806148ae565b6107fb90606081019061478c565b612f37876109f260208801886146e2565b83612f5957612f5987612f4f36899003890189614838565b610bae88806148ae565b612f64878484612045565b60608601803590612f7890604089016143cf565b6001600160a01b039081169089167f504180eddec0aa4ed3bb8edcf99b13013e1d8ae52be37f0f4f38d14ccf0c99a56124a760208b018b6143cf565b612fce86868660008051602061535a8339815191526121a1565b612ffa8686857fdfa64d371f38074894860654f13f7558a46a9b052e65fd158280c8dd2f07af64612028565b613005868383612045565b6060850180359061301990604088016143cf565b6001600160a01b039081169088167fc9a3d0888f5ab83eb0fcd2e948c80035fd02319ad2f57c4bc68b1513a0f78ea061305560208a018a6143cf565b604051613068919060208c013590614925565b60405180910390a4505050505050565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b60608152602001906001900390816130b25790505090507f000000000000000000000000188f3b2b1c40e3bc77bc0993c6c951ce4030c943826000815181106130fd576130fd614955565b60200260200101906001600160a01b031690816001600160a01b0316815250508383604051602401613130929190614925565b60408051601f198184030181529190526020810180516001600160e01b0316631df6a96160e31b1790528151829060009061213a5761213a614955565b613188856020860161318260a08801886148ae565b846121a1565b6131c7856020860161319d60c08801886148c4565b6109c06131b060808a0160608b016143cf565b6131bd60208b018b6143cf565b60808b01356129d5565b6131d8856109e460e08701876148ae565b6131f6856131ec60808701606088016143cf565b6080870135613d29565b60006001600160a01b037f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c991663c79aeaae61323760808801606089016143cf565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa15801561327b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061329f9190614756565b6001600160a01b031663b943855e6132bd60808801606089016143cf565b6040516001600160e01b031960e084901b1681526001600160a01b0391821660048201529089166024820152604401602060405180830381865afa158015613309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061332d9190614773565b90506133888660405180606001604052808860200160000180360381019061335591906148da565b815260200161336a60808a0160608b016143cf565b6001600160a01b03168152602001849052610bae60e08901896148ae565b613393868585612045565b608085018035906133a790606088016143cf565b6001600160a01b039081169088167f550ef6ca72911d6a82dfa1fade2d87ed10c69661f1bf04376add792b5d1e54376133e660408a0160208b016143cf565b6040805161306892918c013590614925565b60008061340860408401846146e2565b6134129080614702565b905011613420576000613442565b7fab273376f9efdd920b41b30b3f02b3dee877874951e3c14bf87bc60060efebcc5b604080516001808252818301909252919250600091906020808301908036833750506040805160018082528183019092529293506000929150602082015b60608152602001906001900390816134805790505090507f0000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b826000815181106134cb576134cb614955565b6001600160a01b03909216602092830291909101909101526134ed8480614702565b6134fa6020870187614702565b7f000000000000000000000000588be0d1422b81e0c7c1349d124b047909098b19876040516024016135319695949392919061525c565b60408051601f198184030181529190526020810180516001600160e01b03166312f5760360e01b1790528151829060009061356e5761356e614955565b6020026020010181905250846001600160a01b03166363fb0b963484846040518463ffffffff1660e01b81526004016135a89291906149c8565b6000604051808303818588803b158015612e3957600080fd5b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b60608152602001906001900390816135fb5790505090507f000000000000000000000000188f3b2b1c40e3bc77bc0993c6c951ce4030c9438260008151811061364657613646614955565b60200260200101906001600160a01b031690816001600160a01b0316815250508383604051602401613679929190614925565b60408051601f198184030181529190526020810180516001600160e01b03166306c530b960e41b1790528151829060009061213a5761213a614955565b60006001600160a01b037f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c991663c79aeaae6136f460208601866143cf565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015613738573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061375c9190614756565b6040805160038082526080820190925291925060009190602082016060803683375050604080516003808252608082019092529293506000929150602082015b606081526020019060019003908161379c57905050905082826000815181106137c7576137c7614955565b6001600160a01b0390921660209283029190910190910152846137ea85806148ae565b6137f49080614702565b6137fe87806148ae565b61380f9060408101906020016152ce565b61381988806148ae565b61382a9060608101906040016152ce565b61383489806148ae565b61384290606081019061478c565b60405160240161385897969594939291906152e9565b60408051601f198184030181529190526020810180516001600160e01b0316636f4621e360e01b1790528151829060009061389557613895614955565b60200260200101819052507f0000000000000000000000009fad68008c8361436545a206c90af1cc480f710a826001815181106138d4576138d4614955565b6001600160a01b039092166020928302919091018201526138f790850185614702565b604051602401613908929190615345565b60408051601f198184030181529190526020810180516001600160e01b03166357e72eb360e01b17905281518290600190811061394757613947614955565b60200260200101819052507f00000000000000000000000046292986df2fee3a048dd6753918e62e93806c2d8260028151811061398657613986614955565b6001600160a01b03909216602092830291909101909101527f000000000000000000000000588be0d1422b81e0c7c1349d124b047909098b1960008051602061535a8339815191526139db6040870187614702565b6040516024016139ee9493929190614db7565b60408051601f198184030181529190526020810180516001600160e01b031663dcc3284160e01b179052815182906002908110612de657612de6614955565b60006001600160a01b037f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c991663c79aeaae613a6b60208701876143cf565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015613aaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ad39190614756565b60408051600280825260608201835292935060009290916020830190803683375050604080516002808252606082019092529293506000929150602082015b6060815260200190600190039081613b125790505090508282600081518110613b3d57613b3d614955565b6001600160a01b039092166020928302919091019091015285613b608680614702565b613b706040890160208a016152ce565b613b8060608a0160408b016152ce565b613b8d60608b018b61478c565b604051602401613ba397969594939291906152e9565b60408051601f198184030181529190526020810180516001600160e01b0316636f4621e360e01b17905281518290600090613be057613be0614955565b60200260200101819052507f00000000000000000000000046292986df2fee3a048dd6753918e62e93806c2d82600181518110613c1f57613c1f614955565b6001600160a01b03909216602092830291909101909101527f000000000000000000000000588be0d1422b81e0c7c1349d124b047909098b1984613c638780614702565b604051602401613c769493929190614db7565b60408051601f198184030181529190526020810180516001600160e01b031663dcc3284160e01b179052815182906001908110613cb557613cb5614955565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038816906363fb0b9690613cee90859085906004016149c8565b600060405180830381600087803b158015613d0857600080fd5b505af1158015613d1c573d6000803e3d6000fd5b5050505050505050505050565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b6060815260200190600190039081613d635790505090507f0000000000000000000000000f592f2ee1779fa7d81a8482f4cc6d216a0fe04f82600081518110613dae57613dae614955565b6001600160a01b0392831660209182029290920101526040517f000000000000000000000000372e7761997858be1ee3c492dfa01091282c50838216602482015290851660448201526064810184905260840160408051601f198184030181529190526020810180516001600160e01b0316631f5cecd560e01b1790528151829060009061213a5761213a614955565b600060808284031215613e5057600080fd5b50919050565b600060608284031215613e5057600080fd5b60008083601f840112613e7a57600080fd5b5081356001600160401b03811115613e9157600080fd5b6020830191508360208260051b8501011115613eac57600080fd5b9250929050565b60008060008060c08587031215613ec957600080fd5b613ed38686613e3e565b935060808501356001600160401b0380821115613eef57600080fd5b613efb88838901613e56565b945060a0870135915080821115613f1157600080fd5b50613f1e87828801613e68565b95989497509550505050565b80358015158114613f3a57600080fd5b919050565b6000806000806000806101008789031215613f5957600080fd5b613f638888613e3e565b955060808701356001600160401b0380821115613f7f57600080fd5b613f8b8a838b01613e3e565b965060a0890135915080821115613fa157600080fd5b613fad8a838b01613e56565b9550613fbb60c08a01613f2a565b945060e0890135915080821115613fd157600080fd5b50613fde89828a01613e68565b979a9699509497509295939492505050565b60008060a0838503121561400357600080fd5b61400d8484613e3e565b915060808301356001600160401b0381111561402857600080fd5b61403485828601613e3e565b9150509250929050565b60006101008284031215613e5057600080fd5b60006103408284031215613e5057600080fd5b6000806000806060858703121561407a57600080fd5b84356001600160401b038082111561409157600080fd5b61409d8883890161403e565b955060208701359150808211156140b357600080fd5b6140bf88838901614051565b94506040870135915080821115613f1157600080fd5b600060408284031215613e5057600080fd5b600080600080600060e086880312156140ff57600080fd5b6141098787613e3e565b945060808601356001600160401b038082111561412557600080fd5b61413189838a016140d5565b955061413f60a08901613f2a565b945060c088013591508082111561415557600080fd5b5061416288828901613e68565b969995985093965092949392505050565b600080600080600060e0868803121561418b57600080fd5b6141958787613e3e565b945060808601356001600160401b03808211156141b157600080fd5b6141bd89838a01613e3e565b955060a08801359150808211156141d357600080fd5b61413f89838a01613e56565b6001600160a01b03811681146141f457600080fd5b50565b600080600080600080610100878903121561421157600080fd5b863561421c816141df565b955061422b8860208901613e3e565b945060a08701356001600160401b038082111561424757600080fd5b6142538a838b01613e3e565b955060c089013591508082111561426957600080fd5b613fbb8a838b01613e56565b60008083601f84011261428757600080fd5b5081356001600160401b0381111561429e57600080fd5b602083019150836020828501011115613eac57600080fd5b600080600060a084860312156142cb57600080fd5b6142d58585613e3e565b925060808401356001600160401b038111156142f057600080fd5b6142fc86828701614275565b9497909650939450505050565b60008060006040848603121561431e57600080fd5b83356001600160401b038082111561433557600080fd5b6143418783880161403e565b9450602086013591508082111561435757600080fd5b506142fc86828701613e68565b60008060008060c0858703121561437a57600080fd5b6143848686613e3e565b935060808501356001600160401b03808211156143a057600080fd5b6143ac88838901613e3e565b945060a08701359150808211156143c257600080fd5b50613f1e87828801614275565b6000602082840312156143e157600080fd5b813561158c816141df565b600080600060c0848603121561440157600080fd5b833561440c816141df565b925061441b8560208601613e3e565b915060a08401356001600160401b0381111561443657600080fd5b61444286828701613e3e565b9150509250925092565b60008060006060848603121561446157600080fd5b833561446c816141df565b9250602084013561447c816141df565b929592945050506040919091013590565b60008060008060008060a087890312156144a657600080fd5b86356001600160401b03808211156144bd57600080fd5b6144c98a838b01613e3e565b975060208901359150808211156144df57600080fd5b6144eb8a838b01614051565b9650604089013591508082111561450157600080fd5b5061450e89828a01613e68565b9095509350506060870135614522816141df565b80925050608087013590509295509295509295565b6000806000806060858703121561454d57600080fd5b8435614558816141df565b935060208501356001600160401b038082111561457457600080fd5b6140bf8883890161403e565b600080600080600080610100878903121561459a57600080fd5b6145a48888613e3e565b955060808701356001600160401b03808211156145c057600080fd5b6145cc8a838b01613e3e565b965060a08901359150808211156145e257600080fd5b613fad8a838b01613e3e565b600080600080600080610100878903121561460857600080fd5b8635614613816141df565b95506146228860208901613e3e565b945060a08701356001600160401b038082111561463e57600080fd5b613fad8a838b016140d5565b600080600080600080610100878903121561466457600080fd5b61466e8888613e3e565b955060808701356001600160401b038082111561468a57600080fd5b6146968a838b01614275565b909750955060a08901359150808211156146af57600080fd5b506146bc89828a01614051565b93505060c08701356146cd816141df565b8092505060e087013590509295509295509295565b60008235603e198336030181126146f857600080fd5b9190910192915050565b6000808335601e1984360301811261471957600080fd5b8301803591506001600160401b0382111561473357600080fd5b6020019150600581901b3603821315613eac57600080fd5b8035613f3a816141df565b60006020828403121561476857600080fd5b815161158c816141df565b60006020828403121561478557600080fd5b5051919050565b6000808335601e198436030181126147a357600080fd5b8301803591506001600160401b038211156147bd57600080fd5b602001915036819003821315613eac57600080fd5b6000604082840312156147e457600080fd5b604051604081018181106001600160401b038211171561481457634e487b7160e01b600052604160045260246000fd5b6040529050808235614825816141df565b8152602092830135920191909152919050565b60006080828403121561484a57600080fd5b604051606081018181106001600160401b038211171561487a57634e487b7160e01b600052604160045260246000fd5b60405261488784846147d2565b81526040830135614897816141df565b602082015260609290920135604083015250919050565b60008235607e198336030181126146f857600080fd5b60008235605e198336030181126146f857600080fd5b6000604082840312156148ec57600080fd5b61158c83836147d2565b81516001600160a01b039081168252602080840151909116908201526040918201519181019190915260600190565b6001600160a01b03929092168252602082015260400190565b6000823561017e198336030181126146f857600080fd5b634e487b7160e01b600052603260045260246000fd5b8183526000602080850194508260005b858110156149a957813561498e816141df565b6001600160a01b03168752958201959082019060010161497b565b509495945050505050565b60208152600061158960208301848661496b565b604080825283519082018190526000906020906060840190828701845b82811015614a0a5781516001600160a01b0316845292840192908401906001016149e5565b50505083810382850152845180825282820190600581901b8301840187850160005b83811015614a8957601f19808785030186528251805180865260005b81811015614a63578281018b01518782018c01528a01614a48565b5060008682018b015296890196601f019091169093018701925090860190600101614a2c565b50909998505050505050505050565b8035614aa3816141df565b6001600160a01b03908116835260208281013590840152604082013590614ac9826141df565b166040830152606090810135910152565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b614b0d8185614a98565b60a060808201526000614b2460a083018486614ada565b95945050505050565b80356001600160801b0381168114613f3a57600080fd5b6000808335601e19843603018112614b5b57600080fd5b83016020810192503590506001600160401b03811115614b7a57600080fd5b803603821315613eac57600080fd5b6000808335601e19843603018112614ba057600080fd5b83016020810192503590506001600160401b03811115614bbf57600080fd5b8060051b3603821315613eac57600080fd5b60008235609e19833603018112614be757600080fd5b90910192915050565b81835260006020808501808196508560051b810191508460005b87811015614c9a578284038952614c218288614bd1565b60a08135614c2e816141df565b6001600160a01b03908116875282880135888801526040808401359088015260609081840135614c5d816141df565b16908701526080614c7083820184614b44565b93508282890152614c848389018583614ada565b9c89019c97505050928601925050600101614c0a565b5091979650505050505050565b602081526000823560fe19843603018112614cc157600080fd5b6040602084015283018035614cd5816141df565b6001600160a01b0316606084015260208101356080840152614cf960408201614b2d565b6001600160801b03811660a085015250606081013560c0840152608081013560e0840152614d2960a08201614b2d565b610100614d40818601836001600160801b03169052565b614d4c60c08401614b2d565b6001600160801b0381166101208701529150614d6b60e0840184614b44565b935091508061014086015250614d8661016085018383614ada565b915050614d966020850185614b89565b848303601f19016040860152614dad838284614bf0565b9695505050505050565b6001600160a01b03851681526001600160e01b031984166020820152606060408201819052600090614dad908301848661496b565b6000845160018060a01b038082511684526020820151602085015280602088015116604085015250506040850151606083015260a06080830152614b2460a083018486614ada565b62ffffff811681146141f457600080fd5b600060208284031215614e5757600080fd5b815161158c81614e34565b8035613f3a81614e34565b8035614e78816141df565b6001600160a01b039081168352602082013590614e94826141df565b1660208301526040810135614ea881614e34565b62ffffff81166040840152505050565b8035600281900b8114613f3a57600080fd5b602081526000614eda8384614b89565b60406020850152614eef606085018284614bf0565b915050602084013561017e19853603018112614f0a57600080fd5b838203601f190160408501528401610180614f3583614f288461474b565b6001600160a01b03169052565b60208201356020840152614f4f6040840160408401614e6d565b614f5b60a08301614eb8565b614f6a60a085018260020b9052565b50614f7760c08301614eb8565b614f8660c085018260020b9052565b5060e08281013590840152610100808301359084015261012080830135908401526101408083013590840152610160614fc181840184614b44565b93508282860152614fd58386018583614ada565b98975050505050505050565b803560ff81168114613f3a57600080fd5b80356003811061500157600080fd5b82526020810135615011816141df565b6001600160a01b03166020929092019190915250565b61503d8261503483614e62565b62ffffff169052565b61504960208201614e62565b62ffffff16602083015261505f60408201614eb8565b61506e604084018260020b9052565b5061507b60608201614eb8565b61508a606084018260020b9052565b506080810135608083015260a081013560a083015260c081013560c08301526150b560e08201614eb8565b6150c460e084018260020b9052565b506101006150d3818301614eb8565b6150e18285018260020b9052565b50506101206150f1818301614fe1565b60ff1690830152610140610946818401838301614ff2565b61511281614eb8565b60020b825261512360208201614eb8565b60020b60208301526040810135615139816141df565b6001600160a01b039081166040840152606082013590615158826141df565b1660608301526080818101359083015260a090810135910152565b6001600160a01b038581168252841660208201526040810183905260806060820152600082356151a2816141df565b6001600160a01b03166080830152602083013560a08301526151c660408401613f2a565b151560c08301526151dd60e0830160608501615027565b6151ea6101e08401613f2a565b6102606151fa8185018315159052565b61520c61028085016102008701614ff2565b6152196102408601613f2a565b8015156102c086015291506152346102e08501828701615109565b5050615244610320840184614b44565b6103406103a0850152614fd56103c085018284614ada565b60808152600061527060808301888a61496b565b82810360208401528581526001600160fb1b0386111561528f57600080fd5b8560051b808860208401376001600160a01b039590951660408401526001600160e01b0319939093166060909201919091525001602001949350505050565b6000602082840312156152e057600080fd5b61158c82614b2d565b60006101006152f8838b614a98565b80608084015261530b818401898b61496b565b6001600160801b0388811660a0860152871660c085015283810360e08501529050615337818587614ada565b9a9950505050505050505050565b602081526000611589602083018486614bf056fee400534da780c9d64ef8b5f03c074ff47537b6a4aa2a3e5d5455cb37b5406aa3a2646970667358221220bd1aeb8030723770f7edc36bc1a42c9738d3f58005e4d88df2903c528efd00c864736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000233d9067677dcf1a161954d45b4c965b9d567168000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c99000000000000000000000000372e7761997858be1ee3c492dfa01091282c5083000000000000000000000000188f3b2b1c40e3bc77bc0993c6c951ce4030c9430000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b0000000000000000000000009fad68008c8361436545a206c90af1cc480f710a00000000000000000000000046292986df2fee3a048dd6753918e62e93806c2d000000000000000000000000a697ca262c8338fce02f5e6a0484fcb3ae0bc8d80000000000000000000000000f592f2ee1779fa7d81a8482f4cc6d216a0fe04f
-----Decoded View---------------
Arg [0] : factory (address): 0x233D9067677dCf1a161954D45B4C965B9d567168
Arg [1] : connectorRegistry (address): 0xc6013E57a0811C7111A8fB07ACd2E248D9489C99
Arg [2] : nftSettingsRegistry_ (address): 0x372e7761997858BE1ee3c492DFa01091282c5083
Arg [3] : libraries (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 000000000000000000000000233d9067677dcf1a161954d45b4c965b9d567168
Arg [1] : 000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c99
Arg [2] : 000000000000000000000000372e7761997858be1ee3c492dfa01091282c5083
Arg [3] : 000000000000000000000000188f3b2b1c40e3bc77bc0993c6c951ce4030c943
Arg [4] : 0000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b
Arg [5] : 0000000000000000000000009fad68008c8361436545a206c90af1cc480f710a
Arg [6] : 00000000000000000000000046292986df2fee3a048dd6753918e62e93806c2d
Arg [7] : 000000000000000000000000a697ca262c8338fce02f5e6a0484fcb3ae0bc8d8
Arg [8] : 0000000000000000000000000f592f2ee1779fa7d81a8482f4cc6d216a0fe04f
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.