Overview
S Balance
0 S
S Value
$0.00More Info
Private Name Tags
ContractCreator
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 { 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 { 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(); } uint256 initialSupply = params.nft.totalSupply(); Sickle sickle = getOrDeploySickle(msg.sender, approved, referralCode); _transfer_in_tokens(sickle, params.increase); _zap_in(sickle, params.increase.zap); uint256 tokenId = _get_token_id(sickle, params.nft); _deposit_nft( sickle, NftPosition(params.farm, params.nft, tokenId), params.increase.extraData ); _set_nft_settings(sickle, params.nft, tokenId, settings); _sweep(sickle, sweepTokens); if (params.nft.totalSupply() <= initialSupply) { 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 nftSupplyUnchanged(params.position.nft) { Sickle sickle = getSickle(msg.sender); _harvest( sickle, params.position, params.harvest, NftFarmStrategyFees.Harvest ); _withdraw( sickle, params.position, params.withdraw, _get_rebalance_fee(params.pool) ); _zap_in(sickle, params.deposit.increase.zap); uint256 tokenId = _get_token_id(sickle, params.deposit.nft); _deposit_nft( sickle, NftPosition(params.deposit.farm, params.deposit.nft, tokenId), params.deposit.increase.extraData ); _set_nft_settings(sickle, params.deposit.nft, tokenId, settings); _sweep(sickle, sweepTokens); _emit_move_event( sickle, params.position, params.deposit.nft, params.deposit.farm, tokenId ); } // Required due to stack too deep error function _emit_move_event( 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 ); _withdraw_nft(sickle, position, increaseParams.extraData); } _transfer_in_tokens(sickle, increaseParams); _zap_in(sickle, increaseParams.zap); if (!inPlace) { _deposit_nft(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 ); _withdraw_nft(sickle, position, withdrawParams.extraData); } bytes4 fee = withdrawParams.zap.swaps.length > 0 ? NftFarmStrategyFees.Withdraw : bytes4(0); _zap_out(sickle, withdrawParams, fee); if (!inPlace) { _deposit_nft(sickle, position, withdrawParams.extraData); } _sweep(sickle, sweepTokens); 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); _transfer_in_nft(sickle, position.nft, position.tokenId); _deposit_nft(sickle, position, extraData); _set_nft_settings(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); _simple_harvest(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); _withdraw_nft(sickle, position, extraData); _transfer_out_nft(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); _simple_harvest(sickle, position, harvestParams); _withdraw_nft(sickle, position, withdrawExtraData); _transfer_out_nft(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, position.nft, 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, position.nft, 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, position.nft, 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, params.position.nft, params.position.tokenId) ); _rebalance(sickle, params, sweepTokens, NftFarmStrategyFees.HarvestFor); } /* Modifiers */ modifier nftSupplyUnchanged( INonfungiblePositionManager nft ) { uint256 initialSupply = nft.totalSupply(); _; if (initialSupply != nft.totalSupply()) { revert NftSupplyChanged(); } } /* Private */ function _withdraw( Sickle sickle, NftPosition calldata position, NftWithdraw calldata params, bytes4 withdrawalFee ) internal { _withdraw_nft(sickle, position, params.extraData); _zap_out(sickle, params, withdrawalFee); } function _harvest( Sickle sickle, NftPosition calldata position, NftHarvest calldata params, bytes4 fee ) private { if (params.swaps.length > 0) { _claim_and_swap(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 _simple_harvest( 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) { _withdraw_nft(sickle, position, params.harvest.extraData); } _zap_in(sickle, params.zap); if (!inPlace) { _deposit_nft(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 nftSupplyUnchanged(params.position.nft) { _harvest(sickle, params.position, params.harvest, harvestFee); _withdraw( sickle, params.position, params.withdraw, _get_rebalance_fee(params.pool) ); _zap_in(sickle, params.increase.zap); _reset_nft_settings( sickle, params.position.nft, params.position.tokenId ); uint256 tokenId = _get_token_id(sickle, params.position.nft); _deposit_nft( sickle, NftPosition(params.position.farm, params.position.nft, 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 _transfer_in_tokens( 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 _transfer_in_nft( 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 _transfer_out_nft( 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 _deposit_nft( 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 _withdraw_nft( 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 _claim_and_swap( 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 _zap_in(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 _zap_out( 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 _get_token_id( Sickle sickle, INonfungiblePositionManager nft ) private view returns (uint256) { return IERC721Enumerable(nft).tokenOfOwnerByIndex( address(sickle), IERC721Enumerable(nft).balanceOf(address(sickle)) - 1 ); } function _set_nft_settings( 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 _reset_nft_settings( 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.resetNftSettings, (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 _get_rebalance_fee( IUniswapV3Pool pool ) internal view returns (bytes4) { uint24 fee = IUniswapV3PoolImmutables(pool).fee(); if (fee <= 500) { return NftFarmStrategyFees.RebalanceLow; } else if (fee <= 3000) { return NftFarmStrategyFees.RebalanceMid; } else { return NftFarmStrategyFees.RebalanceHigh; } } }
// 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 { 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: 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 pragma solidity ^0.8.17; import { Admin } from "contracts/base/Admin.sol"; import { TimelockAdmin } from "contracts/base/TimelockAdmin.sol"; error ConnectorNotRegistered(address target); 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); ICustomConnectorRegistry[] public customRegistries; mapping(ICustomConnectorRegistry => bool) public isCustomRegistry; mapping(address target => address connector) private connectors_; constructor( address admin_, address timelockAdmin_ ) Admin(admin_) TimelockAdmin(timelockAdmin_) { } /// @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 { 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 { 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 { customRegistries.push(registry); isCustomRegistry[registry] = true; 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 { address oldRegistry = address(customRegistries[index]); isCustomRegistry[customRegistries[index]] = false; emit CustomRegistryRemoved(oldRegistry); customRegistries[index] = newRegistry; isCustomRegistry[newRegistry] = true; if (address(newRegistry) != address(0)) { emit CustomRegistryAdded(address(newRegistry)); } } function connectorOf(address target) external 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)) { try customRegistries[i].connectorOf(target) returns ( address _connector ) { if (_connector != address(0)) { return _connector; } } catch { // Ignore } } unchecked { ++i; } } revert ConnectorNotRegistered(target); } function hasConnector(address target) external view returns (bool) { if (connectors_[target] != address(0)) { return true; } uint256 length = customRegistries.length; for (uint256 i; i != length;) { if (address(customRegistries[i]) != address(0)) { try customRegistries[i].connectorOf(target) returns ( address _connector ) { if (_connector != address(0)) { return true; } } catch { // Ignore } unchecked { ++i; } } } return false; } }
// 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; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { NftKey, NftSettings } from "contracts/structs/NftSettingsStructs.sol"; interface INftSettingsRegistry { function getNftSettings( NftKey calldata key ) external view returns (NftSettings memory); function setNftSettings( NftKey calldata key, NftSettings calldata settings ) external; function resetNftSettings( NftKey calldata oldKey, NftKey calldata newKey, NftSettings calldata settings ) external; function validateRebalanceFor( NftKey memory key ) external; function validateExitFor( NftKey memory key ) external; function validateHarvestFor( NftKey memory key ) external; function validateCompoundFor( NftKey memory key ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { 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 { 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: MIT pragma solidity ^0.8.17; interface ITransferLib { error ArrayLengthMismatch(); error TokenInRequired(); error AmountInRequired(); error TwoTokenMaximum(); error SameTokenIn(); error TokenOutRequired(); 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 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; }
// 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 { INonfungiblePositionManager } from "contracts/interfaces/external/uniswap/INonfungiblePositionManager.sol"; import { INftSettingsRegistry, NftSettings, NftKey } from "contracts/interfaces/INftSettingsRegistry.sol"; interface INftSettingsLib { error TokenIdUnchanged(); function resetNftSettings( INftSettingsRegistry nftSettingsRegistry, INonfungiblePositionManager nftManager, uint256 tokenId ) external; function setNftSettings( INftSettingsRegistry nftSettingsRegistry, INonfungiblePositionManager nftManager, uint256 tokenId, NftSettings calldata settings ) external; }
// 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.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.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 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 { 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 { 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; bool autoRebalance; RebalanceConfig rebalanceConfig; bool automateRewards; RewardConfig rewardConfig; bool autoExit; ExitConfig exitConfig; }
// 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.17; import { Clones } from "@openzeppelin/contracts/proxy/Clones.sol"; import { SickleRegistry } from "contracts/SickleRegistry.sol"; import { Sickle } from "contracts/Sickle.sol"; import { Admin } from "contracts/base/Admin.sol"; /// @title SickleFactory contract /// @author vfat.tools /// @notice Factory deploying new Sickle contracts contract SickleFactory is Admin { /// EVENTS /// /// @notice Emitted when a new Sickle contract is deployed /// @param admin Address receiving the admin rights of the Sickle contract /// @param sickle Address of the newly deployed Sickle contract event Deploy(address indexed admin, address sickle); /// @notice Thrown when the caller is not whitelisted /// @param caller Address of the non-whitelisted caller error CallerNotWhitelisted(address caller); // 0x252c8273 /// @notice Thrown when the factory is not active and a deploy is attempted error NotActive(); // 0x80cb55e2 /// @notice Thrown when a Sickle contract is already deployed for a user error SickleAlreadyDeployed(); //0xf6782ef1 /// STORAGE /// mapping(address => address) private _sickles; mapping(address => address) private _admins; mapping(address => bytes32) public _referralCodes; /// @notice Address of the SickleRegistry contract SickleRegistry public immutable registry; /// @notice Address of the Sickle implementation contract address public immutable implementation; /// @notice Address of the previous SickleFactory contract (if applicable) SickleFactory public immutable previousFactory; /// @notice Whether the factory is active (can deploy new Sickle contracts) bool public isActive = true; /// WRITE FUNCTIONS /// /// @param admin_ Address of the admin /// @param sickleRegistry_ Address of the SickleRegistry contract /// @param sickleImplementation_ Address of the Sickle implementation /// contract /// @param previousFactory_ Address of the previous SickleFactory contract /// if applicable constructor( address admin_, address sickleRegistry_, address sickleImplementation_, address previousFactory_ ) Admin(admin_) { registry = SickleRegistry(sickleRegistry_); implementation = sickleImplementation_; previousFactory = SickleFactory(previousFactory_); } /// @notice Update the isActive flag. /// @dev Effectively pauses and unpauses new Sickle deployments. /// @custom:access Restricted to protocol admin. 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"; 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(admin, 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; /// @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.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.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 { 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_ ) initializer Multicall(sickleRegistry_) { _Sickle_initialize(address(0), address(0)); } /// @param sickleOwner_ Address of the Sickle owner function initialize( address sickleOwner_, address approved_ ) external initializer { _Sickle_initialize(sickleOwner_, approved_); } /// INTERNALS /// function _Sickle_initialize( address sickleOwner_, address approved_ ) internal { SickleStorage._SickleStorage_initialize(sickleOwner_, approved_); } function onERC721Received( address, // operator address, // from uint256, // tokenId bytes calldata // data ) external pure returns (bytes4) { return this.onERC721Received.selector; } function onERC1155Received( address, // operator address, // from uint256, // id uint256, // value bytes calldata // data ) external pure returns (bytes4) { return this.onERC1155Received.selector; } function onERC1155BatchReceived( address, // operator address, // from uint256[] calldata, // ids uint256[] calldata, // values bytes calldata // data ) external pure returns (bytes4) { return this.onERC1155BatchReceived.selector; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; 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; } struct GetAmountOutParams { address router; address lpToken; address tokenIn; address tokenOut; uint256 amountIn; }
// 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 { 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++; } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { IPool } from "contracts/interfaces/external/aerodrome/IPool.sol"; 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 triggerPriceHigh; uint256 triggerPriceLow; uint256 triggerReserves0; uint256 triggerReserves1; address exitTokenOutLow; address exitTokenOutHigh; uint256 priceImpactBP; uint256 slippageBP; } /** * Settings for automating an ERC20 position * @param pool: Uniswap or Aerodrome vAMM/sAMM pair for the position (requires * token0/token1/getReserves functions) * @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 { IPool pair; address router; bool automateRewards; RewardConfig rewardConfig; bool autoExit; ExitConfig exitConfig; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (proxy/Clones.sol) pragma solidity ^0.8.0; /** * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for * deploying minimal proxy contracts, also known as "clones". * * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies * > a minimal bytecode implementation that delegates all calls to a known, fixed address. * * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2` * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the * deterministic method. * * _Available since v3.4._ */ library Clones { /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create opcode, which should never revert. */ function clone(address implementation) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes // of the `implementation` address with the bytecode before the address. mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) // Packs the remaining 17 bytes of `implementation` with the bytecode after the address. mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)) instance := create(0, 0x09, 0x37) } require(instance != address(0), "ERC1167: create failed"); } /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create2 opcode and a `salt` to deterministically deploy * the clone. Using the same `implementation` and `salt` multiple time will revert, since * the clones cannot be deployed twice at the same address. */ function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) { /// @solidity memory-safe-assembly assembly { // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes // of the `implementation` address with the bytecode before the address. mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) // Packs the remaining 17 bytes of `implementation` with the bytecode after the address. mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)) instance := create2(0, 0x09, 0x37, salt) } require(instance != address(0), "ERC1167: create2 failed"); } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress( address implementation, bytes32 salt, address deployer ) internal pure returns (address predicted) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(add(ptr, 0x38), deployer) mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff) mstore(add(ptr, 0x14), implementation) mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73) mstore(add(ptr, 0x58), salt) mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37)) predicted := keccak256(add(ptr, 0x43), 0x55) } } /** * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}. */ function predictDeterministicAddress(address implementation, bytes32 salt) internal view returns (address predicted) { return predictDeterministicAddress(implementation, salt, address(this)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; 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 { /// 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] <= 500) { // maximum fee of 5% feeRegistry[feeHashes[i]] = feesArray[i]; } else { revert FeeAboveMaxLimit(); } unchecked { ++i; } } emit SickleRegistryEvents.FeesUpdated(feeHashes, feesArray); } }
// 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 { 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, however if the admin was /// not set yet, /// the modifier will not restrict the call, this allows the SickleFactory /// to perform /// some calls on the user's behalf before passing the admin rights to them modifier onlyOwner() { if (msg.sender != owner) revert NotOwnerError(); _; } /// INITIALIZATION /// /// @param owner_ Address of the owner of this Sickle contract function _SickleStorage_initialize( address owner_, address approved_ ) internal onlyInitializing { owner = owner_; approved = approved_; } /// WRITE FUNCTIONS /// /// @notice Sets the approved address of this Sickle /// @param newApproved Address meant to be approved by the owner function setApproved(address newApproved) external onlyOwner { approved = newApproved; emit SickleStorageEvents.ApprovedAddressChanged(newApproved); } /// @notice Checks if `caller` is either the owner of the Sickle contract /// or was approved by them /// @param caller Address to check /// @return True if `caller` is either the owner of the Sickle contract function isOwnerOrApproved(address caller) public view returns (bool) { return caller == owner || caller == approved; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import { SickleStorage } from "contracts/base/SickleStorage.sol"; 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 is SickleStorage { /// 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_) initializer { registry = registry_; } /// WRITE FUNCTIONS /// /// @notice Batch multiple calls together (calls or delegatecalls) /// @param targets Array of targets to call /// @param data Array of data to pass with the calls function multicall( address[] calldata targets, bytes[] calldata data ) external payable { if (targets.length != data.length) { revert MulticallParamsMismatchError(); } if (!registry.isWhitelistedCaller(msg.sender)) { revert CallerNotWhitelisted(msg.sender); } for (uint256 i = 0; i != data.length;) { if (targets[i] == address(0)) { unchecked { ++i; } continue; // No-op } if (targets[i] != address(this)) { if (!registry.isWhitelistedTarget(targets[i])) { revert TargetNotWhitelisted(targets[i]); } } (bool success, bytes memory result) = targets[i].delegatecall(data[i]); if (!success) { if (result.length == 0) revert(); assembly { revert(add(32, result), mload(result)) } } unchecked { ++i; } } } }
// SPDX-License-Identifier: MIT // 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: 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.0; import { AddLiquidityParams, RemoveLiquidityParams, SwapParams, GetAmountOutParams } from "contracts/structs/LiquidityStructs.sol"; interface ILiquidityConnector { function addLiquidity( AddLiquidityParams memory addLiquidityParams ) external payable; function removeLiquidity( RemoveLiquidityParams memory removeLiquidityParams ) external; function swapExactTokensForTokens( SwapParams memory swap ) external payable; function getAmountOut( GetAmountOutParams memory getAmountOutParams ) external view returns (uint256); }
// 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.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 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.0; interface IPool { error DepositsNotEqual(); error BelowMinimumK(); error FactoryAlreadySet(); error InsufficientLiquidity(); error InsufficientLiquidityMinted(); error InsufficientLiquidityBurned(); error InsufficientOutputAmount(); error InsufficientInputAmount(); error IsPaused(); error InvalidTo(); error K(); error NotEmergencyCouncil(); event Fees(address indexed sender, uint256 amount0, uint256 amount1); event Mint(address indexed sender, uint256 amount0, uint256 amount1); event Burn(address indexed sender, address indexed to, uint256 amount0, uint256 amount1); event Swap( address indexed sender, address indexed to, uint256 amount0In, uint256 amount1In, uint256 amount0Out, uint256 amount1Out ); event Sync(uint256 reserve0, uint256 reserve1); event Claim(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1); // Struct to capture time period obervations every 30 minutes, used for local oracles struct Observation { uint256 timestamp; uint256 reserve0Cumulative; uint256 reserve1Cumulative; } /// @notice Returns the decimal (dec), reserves (r), stable (st), and tokens (t) of token0 and token1 function metadata() external view returns (uint256 dec0, uint256 dec1, uint256 r0, uint256 r1, bool st, address t0, address t1); /// @notice Claim accumulated but unclaimed fees (claimable0 and claimable1) function claimFees() external returns (uint256, uint256); /// @notice Returns [token0, token1] function tokens() external view returns (address, address); /// @notice Address of token in the pool with the lower address value function token0() external view returns (address); /// @notice Address of token in the poool with the higher address value function token1() external view returns (address); /// @notice Address of linked PoolFees.sol function poolFees() external view returns (address); /// @notice Address of PoolFactory that created this contract function factory() external view returns (address); /// @notice Capture oracle reading every 30 minutes (1800 seconds) function periodSize() external view returns (uint256); /// @notice Amount of token0 in pool function reserve0() external view returns (uint256); /// @notice Amount of token1 in pool function reserve1() external view returns (uint256); /// @notice Timestamp of last update to pool function blockTimestampLast() external view returns (uint256); /// @notice Cumulative of reserve0 factoring in time elapsed function reserve0CumulativeLast() external view returns (uint256); /// @notice Cumulative of reserve1 factoring in time elapsed function reserve1CumulativeLast() external view returns (uint256); /// @notice Accumulated fees of token0 (global) function index0() external view returns (uint256); /// @notice Accumulated fees of token1 (global) function index1() external view returns (uint256); /// @notice Get an LP's relative index0 to index0 function supplyIndex0(address) external view returns (uint256); /// @notice Get an LP's relative index1 to index1 function supplyIndex1(address) external view returns (uint256); /// @notice Amount of unclaimed, but claimable tokens from fees of token0 for an LP function claimable0(address) external view returns (uint256); /// @notice Amount of unclaimed, but claimable tokens from fees of token1 for an LP function claimable1(address) external view returns (uint256); /// @notice Returns the value of K in the Pool, based on its reserves. function getK() external returns (uint256); /// @notice Set pool name /// Only callable by Voter.emergencyCouncil() /// @param __name String of new name function setName(string calldata __name) external; /// @notice Set pool symbol /// Only callable by Voter.emergencyCouncil() /// @param __symbol String of new symbol function setSymbol(string calldata __symbol) external; /// @notice Get the number of observations recorded function observationLength() external view returns (uint256); /// @notice Get the value of the most recent observation function lastObservation() external view returns (Observation memory); /// @notice True if pool is stable, false if volatile function stable() external view returns (bool); /// @notice Produces the cumulative price using counterfactuals to save gas and avoid a call to sync. function currentCumulativePrices() external view returns (uint256 reserve0Cumulative, uint256 reserve1Cumulative, uint256 blockTimestamp); /// @notice Provides twap price with user configured granularity, up to the full window size /// @param tokenIn . /// @param amountIn . /// @param granularity . /// @return amountOut . function quote(address tokenIn, uint256 amountIn, uint256 granularity) external view returns (uint256 amountOut); /// @notice Returns a memory set of TWAP prices /// Same as calling sample(tokenIn, amountIn, points, 1) /// @param tokenIn . /// @param amountIn . /// @param points Number of points to return /// @return Array of TWAP prices function prices(address tokenIn, uint256 amountIn, uint256 points) external view returns (uint256[] memory); /// @notice Same as prices with with an additional window argument. /// Window = 2 means 2 * 30min (or 1 hr) between observations /// @param tokenIn . /// @param amountIn . /// @param points . /// @param window . /// @return Array of TWAP prices function sample( address tokenIn, uint256 amountIn, uint256 points, uint256 window ) external view returns (uint256[] memory); /// @notice This low-level function should be called from a contract which performs important safety checks /// @param amount0Out Amount of token0 to send to `to` /// @param amount1Out Amount of token1 to send to `to` /// @param to Address to recieve the swapped output /// @param data Additional calldata for flashloans function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data) external; /// @notice This low-level function should be called from a contract which performs important safety checks /// standard uniswap v2 implementation /// @param to Address to receive token0 and token1 from burning the pool token /// @return amount0 Amount of token0 returned /// @return amount1 Amount of token1 returned function burn(address to) external returns (uint256 amount0, uint256 amount1); /// @notice This low-level function should be called by addLiquidity functions in Router.sol, which performs important safety checks /// standard uniswap v2 implementation /// @param to Address to receive the minted LP token /// @return liquidity Amount of LP token minted function mint(address to) external returns (uint256 liquidity); /// @notice Update reserves and, on the first call per block, price accumulators /// @return _reserve0 . /// @return _reserve1 . /// @return _blockTimestampLast . function getReserves() external view returns (uint256 _reserve0, uint256 _reserve1, uint256 _blockTimestampLast); /// @notice Get the amount of tokenOut given the amount of tokenIn /// @param amountIn Amount of token in /// @param tokenIn Address of token /// @return Amount out function getAmountOut(uint256 amountIn, address tokenIn) external view returns (uint256); /// @notice Force balances to match reserves /// @param to Address to receive any skimmed rewards function skim(address to) external; /// @notice Force reserves to match balances function sync() external; /// @notice Called on pool creation by PoolFactory /// @param _token0 Address of token0 /// @param _token1 Address of token1 /// @param _stable True if stable, false if volatile function initialize(address _token0, address _token1, bool _stable) external; }
// 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: 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); } } }
{ "remappings": [ "solmate/=lib/solmate/src/", "@openzeppelin/=lib/openzeppelin-contracts/", "@uniswap/v3-periphery/=lib/v3-periphery/", "@uniswap/v3-core/=lib/v3-core/", "@morpho-blue/=lib/morpho-blue/src/", "ds-test/=lib/solmate/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "morpho-blue/=lib/morpho-blue/", "openzeppelin-contracts/=lib/openzeppelin-contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": false, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"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":"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":"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":"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":"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":"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":"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
6101c06040523480156200001257600080fd5b5060405162005333380380620053338339810160408190526200003591620000c3565b6001600160a01b03938416608090815292841660a09081528151851660c05292810151841660e052604081015184166101005260208101518416610120526060810151841661014052909101518216610160521661018052306101a052620001d4565b6001600160a01b0381168114620000ae57600080fd5b50565b8051620000be8162000098565b919050565b600080600080848603610120811215620000dc57600080fd5b8551620000e98162000098565b6020870151909550620000fc8162000098565b60408701519094506200010f8162000098565b925060c0605f19820112156200012457600080fd5b5060405160c081016001600160401b03811182821017156200015657634e487b7160e01b600052604160045260246000fd5b6040526200016760608701620000b1565b81526200017760808701620000b1565b60208201526200018a60a08701620000b1565b60408201526200019d60c08701620000b1565b6060820152620001b060e08701620000b1565b6080820152620001c46101008701620000b1565b60a0820152939692955090935050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a05161500362000330600039600081816104ef0152818161231c0152818161325c0152818161360b01526138a40152600081816102ab01528181610e61015281816112e70152818161162a01528181611a1b01528181612a510152613a3401526000818161023b015281816129fd01526139e701526000818161031f015281816122d1015281816135bf01526138580152600081816103a701528181611d9d01526131f9015260008181610373015261350d0152600081816105ab0152818161222301526127b901526000818161057701528181612db401526130b60152600081816104bb01528181611fcf015281816123c10152818161332d01526136a401526000818161052301528181610d3a01528181611102015281816111c0015281816114020152818161150301526118f401526150036000f3fe6080604052600436106101c25760003560e01c8063659b91b1116100f7578063c45a015511610095578063e0192b2811610064578063e0192b28146105cd578063e5bacdd0146105ed578063f0806a7f14610600578063f53043771461062057600080fd5b8063c45a015514610511578063cb54e34d14610545578063cce5b8c614610565578063d996cef71461059957600080fd5b80639448c56a116100d15780639448c56a14610469578063b3fb68d514610489578063b53c86d2146104a9578063bc6b74ab146104dd57600080fd5b8063659b91b1146104095780636e2f91d514610429578063759cb2341461044957600080fd5b806328734381116101645780633faa6e301161013e5780633faa6e30146103615780633fb53a0d14610395578063541bb89e146103c95780635ec5999e146103e957600080fd5b806328734381146102ed5780632af3fa1b1461030d57806338f6f9271461034157600080fd5b80631de7354b116101a05780631de7354b14610229578063224512621461027957806324f450db146102995780632812d614146102cd57600080fd5b8063107acebd146101c75780631c396db6146101e95780631d06722b14610209575b600080fd5b3480156101d357600080fd5b506101e76101e2366004613b1e565b610633565b005b3480156101f557600080fd5b506101e7610204366004613baa565b6106ac565b34801561021557600080fd5b506101e7610224366004613c5b565b6108ed565b34801561023557600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b34801561028557600080fd5b506101e7610294366004613ccf565b61090a565b3480156102a557600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102d957600080fd5b506101e76102e8366004613d41565b610bbe565b3480156102f957600080fd5b506101e7610308366004613dcd565b610cfb565b34801561031957600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034d57600080fd5b506101e761035c366004613e51565b610d16565b34801561036d57600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b3480156103a157600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b3480156103d557600080fd5b506101e76103e4366004613f10565b610f2d565b3480156103f557600080fd5b506101e7610404366004613c5b565b610fd5565b34801561041557600080fd5b506101e7610424366004613f63565b610ffc565b34801561043557600080fd5b506101e7610444366004613fbe565b61102a565b34801561045557600080fd5b5061025d610464366004614029565b6110de565b34801561047557600080fd5b506101e7610484366004614046565b61119c565b34801561049557600080fd5b5061025d6104a43660046140a6565b6113d1565b3480156104b557600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b3480156104e957600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561051d57600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561055157600080fd5b506101e76105603660046140e7565b611479565b34801561057157600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b3480156105a557600080fd5b5061025d7f000000000000000000000000000000000000000000000000000000000000000081565b3480156105d957600080fd5b506101e76105e836600461416d565b6114df565b6101e76105fb3660046141cc565b611724565b34801561060c57600080fd5b506101e761061b36600461423a565b6118d0565b6101e761062e366004614296565b611b08565b600061063e336110de565b905060008061064d8680614331565b61065b906020810190614351565b90501161066957600061068b565b7fdfa64d371f38074894860654f13f7558a46a9b052e65fd158280c8dd2f07af645b905061069982878784611d2d565b6106a4828585611d4a565b505050505050565b6106bc6060870160408801614029565b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072091906143a5565b9050600061072d336110de565b9050856107655761074e818a8a600080516020614fae833981519152611ea6565b610765818a61076060408b018b6143be565b611f72565b6000806107728980614331565b610780906020810190614351565b90501161078e5760006107b0565b7fdfa64d371f38074894860654f13f7558a46a9b052e65fd158280c8dd2f07af645b90506107bd8289836121d0565b866107e7576107e7826107d5368d90038d018d61446a565b6107e260408c018c6143be565b61239c565b6107f2828787611d4a565b60608a018035906108069060408d01614029565b6001600160a01b039081169084167f3d988581b5d3b2ed8c77b357af36f383c9a6d036a423cb9f82be3b03211cfd1461084260208f018f614029565b8e600001602001356040516108589291906144e0565b60405180910390a45050816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c491906143a5565b81146108e35760405163648873f960e01b815260040160405180910390fd5b5050505050505050565b60006108f8336110de565b90506109058184846125d3565b505050565b61091a6080850160608601614029565b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561095a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097e91906143a5565b9050600061098b336110de565b90506109b681602089016109a260a08b018b6144f9565b600080516020614fae833981519152611ea6565b6109e581602089016109cb60c08b018b61450f565b6109e06109db60208d018d614029565b61266b565b611d2d565b610a17816109f660e08a018a6144f9565b610a049060608101906144f9565b610a12906040810190614331565b612766565b6000610a4082610a2a60e08b018b6144f9565b610a3b906060810190604001614029565b6128c0565b9050610ace8260405180606001604052808b8060e00190610a6191906144f9565b610a719036819003810190614525565b8152602001610a8360e08d018d6144f9565b610a94906060810190604001614029565b6001600160a01b03168152602001849052610ab260e08c018c6144f9565b610ac09060608101906144f9565b6107e29060608101906143be565b610af782610adf60e08b018b6144f9565b610af0906060810190604001614029565b838a6129aa565b610b02828787611d4a565b610b3b8260208a01610b1760e08c018c6144f9565b610b28906060810190604001614029565b610b3560e08d018d6144f9565b85612b36565b5050816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9f91906143a5565b81146106a45760405163648873f960e01b815260040160405180910390fd5b610bce6060860160408701614029565b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3291906143a5565b90506000610c3f336110de565b9050610c708189898989897f1d5b8de553017a3bd388578aeece0183b79c5ca87ec64628b3f76b39487f0231612bde565b50816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610caf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd391906143a5565b8114610cf25760405163648873f960e01b815260040160405180910390fd5b50505050505050565b6000610d06336110de565b90506106a4818787878787612c9d565b60405163429b62e560e01b81526001600160a01b03808816600483015287916000917f0000000000000000000000000000000000000000000000000000000000000000169063429b62e590602401602060405180830381865afa158015610d81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da59190614541565b6001600160a01b031603610dcc57604051633098a45560e01b815260040160405180910390fd5b336001600160a01b0316816001600160a01b03166319d40b086040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e389190614541565b6001600160a01b031614610e5f5760405163c19f17a960e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663459e268460405180606001604052808a6001600160a01b03168152602001896040016020810190610ebb9190614029565b6001600160a01b0316815260200189606001358152506040518263ffffffff1660e01b8152600401610eed919061455e565b600060405180830381600087803b158015610f0757600080fd5b505af1158015610f1b573d6000803e3d6000fd5b50505050610cf2878787878787612c9d565b6000610f38336110de565b9050610f4681858585611f72565b610f6481610f5a6060870160408801614029565b8660600135612d61565b60608401803590610f789060408701614029565b6001600160a01b039081169083167f976f9aa1da6d0f0e23405b12b4e2b446c12615150624819f4bebe8060fa39f61610fb46020890189614029565b604051610fc7919060208b0135906144e0565b60405180910390a450505050565b6000610fe0336110de565b9050610905818484600080516020614fae833981519152611ea6565b6000611007336110de565b905061102481858585600080516020614fae833981519152612e56565b50505050565b6000611035336110de565b90506110428186866125d3565b61104e81868585611f72565b61106c816110626060880160408901614029565b8760600135612d61565b606085018035906110809060408801614029565b6001600160a01b039081169083167fc9a3d0888f5ab83eb0fcd2e948c80035fd02319ad2f57c4bc68b1513a0f78ea06110bc60208a018a614029565b6040516110cf919060208c0135906144e0565b60405180910390a45050505050565b6040516312cfc9b560e31b81526001600160a01b03828116600483015260009182917f0000000000000000000000000000000000000000000000000000000000000000169063967e4da890602401602060405180830381865afa158015611149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116d9190614541565b90506001600160a01b03811661119657604051633098a45560e01b815260040160405180910390fd5b92915050565b60405163429b62e560e01b81526001600160a01b03808516600483015284916000917f0000000000000000000000000000000000000000000000000000000000000000169063429b62e590602401602060405180830381865afa158015611207573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122b9190614541565b6001600160a01b03160361125257604051633098a45560e01b815260040160405180910390fd5b336001600160a01b0316816001600160a01b03166319d40b086040518163ffffffff1660e01b8152600401602060405180830381865afa15801561129a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112be9190614541565b6001600160a01b0316146112e55760405163c19f17a960e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663bca9ca736040518060600160405280876001600160a01b031681526020018660400160208101906113419190614029565b6001600160a01b0316815260200186606001358152506040518263ffffffff1660e01b8152600401611373919061455e565b600060405180830381600087803b15801561138d57600080fd5b505af11580156113a1573d6000803e3d6000fd5b505050506110248484847f139f6e665188bd3327a590d2d1c9d8d09b55289c07e19fef103ceab100ea0979611ea6565b60405163de0d95ed60e01b81526001600160a01b0384811660048301528381166024830152604482018390526000917f00000000000000000000000000000000000000000000000000000000000000009091169063de0d95ed906064016020604051808303816000875af115801561144d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114719190614541565b949350505050565b60006114863384846113d1565b90506114a68161149c60608a0160408b01614029565b8960600135613063565b6114c0816114b9368a90038a018a61446a565b888861239c565b610cf2816114d460608a0160408b01614029565b8960600135876129aa565b60405163429b62e560e01b81526001600160a01b03808616600483015285916000917f0000000000000000000000000000000000000000000000000000000000000000169063429b62e590602401602060405180830381865afa15801561154a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156e9190614541565b6001600160a01b03160361159557604051633098a45560e01b815260040160405180910390fd5b336001600160a01b0316816001600160a01b03166319d40b086040518163ffffffff1660e01b8152600401602060405180830381865afa1580156115dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116019190614541565b6001600160a01b0316146116285760405163c19f17a960e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638bb96a906040518060600160405280886001600160a01b031681526020018760200160400160208101906116879190614029565b6001600160a01b0316815260808801356020909101526040516001600160e01b031960e084901b1681526116be919060040161455e565b600060405180830381600087803b1580156116d857600080fd5b505af11580156116ec573d6000803e3d6000fd5b5050505061171d858585857f139f6e665188bd3327a590d2d1c9d8d09b55289c07e19fef103ceab100ea0979612e56565b5050505050565b6117346060870160408801614029565b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611774573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061179891906143a5565b905060006117a5336110de565b9050856117d8576117c6818a8a600080516020614fae833981519152611ea6565b6117d8818a61076060608b018b6143be565b6117e28188613158565b6117f381610a1260408a018a614331565b85611818576118188161180b368c90038c018c61446a565b6107e260608b018b6143be565b611823818686611d4a565b606089018035906118379060408c01614029565b6001600160a01b039081169083167fb00138e527e12645ad7a5a8d608b107cf2fcd3525d2b5d09973ed652f87b4f3961187360208e018e614029565b8d600001602001356040516118899291906144e0565b60405180910390a450816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108a0573d6000803e3d6000fd5b60405163429b62e560e01b81526001600160a01b03808816600483015287916000917f0000000000000000000000000000000000000000000000000000000000000000169063429b62e590602401602060405180830381865afa15801561193b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195f9190614541565b6001600160a01b03160361198657604051633098a45560e01b815260040160405180910390fd5b336001600160a01b0316816001600160a01b03166319d40b086040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f29190614541565b6001600160a01b031614611a195760405163c19f17a960e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663f1cf418260405180606001604052808a6001600160a01b03168152602001896040016020810190611a759190614029565b6001600160a01b0316815260200189606001358152506040518263ffffffff1660e01b8152600401611aa7919061455e565b600060405180830381600087803b158015611ac157600080fd5b505af1158015611ad5573d6000803e3d6000fd5b50505050610cf28787878787877f6b277b6f647b7a0d8000e4fc1460639f589d3e1262b3f1a2f378cce0a5da40bb612bde565b611b1560608701876144f9565b611b23906040810190614331565b611b3190602081019061458d565b6020013515611b53576040516379bb579b60e11b815260040160405180910390fd5b6000611b656060880160408901614029565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ba2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bc691906143a5565b90506000611bd53385856113d1565b9050611bed81611be860608b018b6144f9565b613158565b611bfe81610a0460608b018b6144f9565b6000611c1482610a3b60608c0160408d01614029565b9050611c6c8260405180606001604052808c600001803603810190611c399190614525565b8152602001611c4e60608e0160408f01614029565b6001600160a01b03168152602001849052610ac060608d018d6144f9565b611c8782611c8060608c0160408d01614029565b838b6129aa565b611c92828888611d4a565b82611ca360608b0160408c01614029565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ce0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d0491906143a5565b11611d2257604051638480c32560e01b815260040160405180910390fd5b505050505050505050565b611d3f848461076060408601866143be565b6110248483836121d0565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b6060815260200190600190039081611d845790505090507f000000000000000000000000000000000000000000000000000000000000000082600081518110611dcf57611dcf6145a4565b60200260200101906001600160a01b031690816001600160a01b0316815250508383604051602401611e02929190614603565b60408051601f198184030181529190526020810180516001600160e01b031663d354641160e01b17905281518290600090611e3f57611e3f6145a4565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038616906363fb0b9690611e789085908590600401614617565b600060405180830381600087803b158015611e9257600080fd5b505af1158015611d22573d6000803e3d6000fd5b6000611eb56020840184614351565b90501115611ecd57611ec8848484613321565b611ee2565b611ee28484611edc85806144f9565b84613698565b6000611ef16060840184614351565b90501115611f0f57611f0f84611f0a6060850185614351565b611d4a565b60608301803590611f239060408601614029565b6001600160a01b039081169086167fbf9d03ac543e8f596c6f4af5ab5e75f366a57d2d6c28d2ff9c024bd3f88e8771611f5f6020880188614029565b604051610fc7919060208a0135906144e0565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b6060815260200190600190039081611fac57905050905060006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663c79aeaae6120016020890189614029565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015612045573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120699190614541565b9050808360008151811061207f5761207f6145a4565b60200260200101906001600160a01b031690816001600160a01b0316815250508585856040516024016120b493929190614752565b60408051601f198184030181529190526020810180516001600160e01b0316631423e67960e11b179052825183906000906120f1576120f16145a4565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038816906363fb0b969061212a9086908690600401614617565b600060405180830381600087803b15801561214457600080fd5b505af1158015612158573d6000803e3d6000fd5b50505060608701803591506121709060408901614029565b6001600160a01b039081169089167f976f9aa1da6d0f0e23405b12b4e2b446c12615150624819f4bebe8060fa39f616121ac60208b018b614029565b6040516121bf919060208d0135906144e0565b60405180910390a450505050505050565b6040805160028082526060820183526000926020830190803683375050604080516002808252606082019092529293506000929150602082015b606081526020019060019003908161220a5790505090507f000000000000000000000000000000000000000000000000000000000000000082600081518110612255576122556145a4565b6001600160a01b03909216602092830291909101909101526122778480614331565b60405160240161228791906148f6565b60408051601f198184030181529190526020810180516001600160e01b0316630505281960e11b179052815182906000906122c4576122c46145a4565b60200260200101819052507f000000000000000000000000000000000000000000000000000000000000000082600181518110612303576123036145a4565b6001600160a01b039092166020928302919091018201527f000000000000000000000000000000000000000000000000000000000000000090849061234a90870187614351565b60405160240161235d9493929190614a06565b60408051601f198184030181529190526020810180516001600160e01b031663dcc3284160e01b179052815182906001908110611e3f57611e3f6145a4565b8251516040516363cd755760e11b81526001600160a01b0391821660048201526000917f0000000000000000000000000000000000000000000000000000000000000000169063c79aeaae90602401602060405180830381865afa158015612408573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061242c9190614541565b604080516001808252818301909252919250600091906020808301908036833750506040805160018082528183019092529293506000929150602082015b606081526020019060019003908161246a5790505090508282600081518110612495576124956145a4565b60200260200101906001600160a01b031690816001600160a01b0316815250508585856040516024016124ca93929190614a3b565b60408051601f198184030181529190526020810180516001600160e01b03166001624236cd60e11b03191790528151829060009061250a5761250a6145a4565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038816906363fb0b96906125439085908590600401614617565b600060405180830381600087803b15801561255d57600080fd5b505af1158015612571573d6000803e3d6000fd5b50505050856040015186602001516001600160a01b0316886001600160a01b03167f53375fafff3a4a00460af1c1347b8f0dd0d35cce6b2bd5661346bc8ad1d37a008960000151600001518a60000151602001516040516121bf9291906144e0565b6125ed838383600080516020614fae833981519152613698565b6125fb83611f0a8380614351565b6060820180359061260f9060408501614029565b6001600160a01b039081169085167fbf9d03ac543e8f596c6f4af5ab5e75f366a57d2d6c28d2ff9c024bd3f88e877161264b6020870187614029565b60405161265e91906020890135906144e0565b60405180910390a4505050565b600080826001600160a01b031663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa1580156126ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126d09190614a94565b90506101f48162ffffff161161270857507fcb922c4d36cde61b3660729b33f36eff74a31440cf3e852d4467b4bd6045011c92915050565b610bb88162ffffff161161273e57507fc552bcd88e8785f8a0d9f9c5b9dc4e198659e68e9f6645642142b2900cde564d92915050565b507fa7e26cbd23588e6e87ee40cb01079e973bf8a0910c2edb6bc11ba3240a81480b92915050565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b60608152602001906001900390816127a05790505090507f0000000000000000000000000000000000000000000000000000000000000000826000815181106127eb576127eb6145a4565b60200260200101906001600160a01b031690816001600160a01b0316815250508260405160240161281c9190614b19565b60408051601f198184030181529190526020810180516001600160e01b0316633d74119b60e21b17905281518290600090612859576128596145a4565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038516906363fb0b96906128929085908590600401614617565b600060405180830381600087803b1580156128ac57600080fd5b505af11580156108e3573d6000803e3d6000fd5b6040516370a0823160e01b81526001600160a01b03838116600483015260009190831690632f745c5990859060019084906370a0823190602401602060405180830381865afa158015612917573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293b91906143a5565b6129459190614c30565b6040518363ffffffff1660e01b81526004016129629291906144e0565b602060405180830381865afa15801561297f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129a391906143a5565b9392505050565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b60608152602001906001900390816129e45790505090507f000000000000000000000000000000000000000000000000000000000000000082600081518110612a2f57612a2f6145a4565b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000000000000000000000000000000000000000000000858585604051602401612a869493929190614d01565b60408051601f198184030181529190526020810180516001600160e01b031663349677a160e21b17905281518290600090612ac357612ac36145a4565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038716906363fb0b9690612afc9085908590600401614617565b600060405180830381600087803b158015612b1657600080fd5b505af1158015612b2a573d6000803e3d6000fd5b50505050505050505050565b60608401803590612b4a9060408701614029565b6001600160a01b039081169087167f8181f528787b6f5d64998fce6130134048cf712961e4d1554465276932df54cc612b866020890189614029565b6020808a01359089908890612b9d908b018b614029565b604080516001600160a01b039687168152602080820196909652938616908401526060830191909152909216608083015287013560a082015260c0016110cf565b612bed8787611edc88806144f9565b83612c0f57612c0f8787612c0188806144f9565b6107609060608101906143be565b612c2087610a126020880188614331565b83612c4257612c4287612c383689900389018961446a565b610ac088806144f9565b612c4d878484611d4a565b60608601803590612c619060408901614029565b6001600160a01b039081169089167f504180eddec0aa4ed3bb8edcf99b13013e1d8ae52be37f0f4f38d14ccf0c99a56121ac60208b018b614029565b612cb7868686600080516020614fae833981519152611ea6565b612ce38686857fdfa64d371f38074894860654f13f7558a46a9b052e65fd158280c8dd2f07af64611d2d565b612cee868383611d4a565b60608501803590612d029060408801614029565b6001600160a01b039081169088167fc9a3d0888f5ab83eb0fcd2e948c80035fd02319ad2f57c4bc68b1513a0f78ea0612d3e60208a018a614029565b604051612d51919060208c0135906144e0565b60405180910390a4505050505050565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b6060815260200190600190039081612d9b5790505090507f000000000000000000000000000000000000000000000000000000000000000082600081518110612de657612de66145a4565b60200260200101906001600160a01b031690816001600160a01b0316815250508383604051602401612e199291906144e0565b60408051601f198184030181529190526020810180516001600160e01b0316631df6a96160e31b17905281518290600090611e3f57611e3f6145a4565b612e666080850160608601614029565b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ea6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eca91906143a5565b9050612ee78760208801612ee160a08a018a6144f9565b86611ea6565b612f0c8760208801612efc60c08a018a61450f565b6109e06109db60208c018c614029565b612f1d87610a0460e08901896144f9565b612f3b87612f316080890160608a01614029565b6080890135613994565b6000612f5188610a3b60808a0160608b01614029565b9050612fac8860405180606001604052808a602001600001803603810190612f799190614525565b8152602001612f8e60808c0160608d01614029565b6001600160a01b03168152602001849052610ac060e08b018b6144f9565b612fb7888787611d4a565b60808701803590612fcb9060608a01614029565b6001600160a01b03908116908a167f550ef6ca72911d6a82dfa1fade2d87ed10c69661f1bf04376add792b5d1e543761300a60408c0160208d01614029565b6040805161301c92918e0135906144e0565b60405180910390a450816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610caf573d6000803e3d6000fd5b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b606081526020019060019003908161309d5790505090507f0000000000000000000000000000000000000000000000000000000000000000826000815181106130e8576130e86145a4565b60200260200101906001600160a01b031690816001600160a01b031681525050838360405160240161311b9291906144e0565b60408051601f198184030181529190526020810180516001600160e01b03166306c530b960e41b17905281518290600090611e3f57611e3f6145a4565b6000806131686040840184614331565b6131729080614351565b9050116131805760006131a2565b7fab273376f9efdd920b41b30b3f02b3dee877874951e3c14bf87bc60060efebcc5b604080516001808252818301909252919250600091906020808301908036833750506040805160018082528183019092529293506000929150602082015b60608152602001906001900390816131e05790505090507f00000000000000000000000000000000000000000000000000000000000000008260008151811061322b5761322b6145a4565b6001600160a01b039092166020928302919091019091015261324d8480614351565b61325a6020870187614351565b7f00000000000000000000000000000000000000000000000000000000000000008760405160240161329196959493929190614eb0565b60408051601f198184030181529190526020810180516001600160e01b03166312f5760360e01b179052815182906000906132ce576132ce6145a4565b6020026020010181905250846001600160a01b03166363fb0b963484846040518463ffffffff1660e01b8152600401613308929190614617565b6000604051808303818588803b158015612b1657600080fd5b60006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663c79aeaae61335f6020860186614029565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156133a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133c79190614541565b6040805160038082526080820190925291925060009190602082016060803683375050604080516003808252608082019092529293506000929150602082015b60608152602001906001900390816134075790505090508282600081518110613432576134326145a4565b6001600160a01b03909216602092830291909101909101528461345585806144f9565b61345f9080614351565b61346987806144f9565b61347a906040810190602001614f22565b61348488806144f9565b613495906060810190604001614f22565b61349f89806144f9565b6134ad9060608101906143be565b6040516024016134c39796959493929190614f3d565b60408051601f198184030181529190526020810180516001600160e01b0316636f4621e360e01b17905281518290600090613500576135006145a4565b60200260200101819052507f00000000000000000000000000000000000000000000000000000000000000008260018151811061353f5761353f6145a4565b6001600160a01b0390921660209283029190910182015261356290850185614351565b604051602401613573929190614f99565b60408051601f198184030181529190526020810180516001600160e01b03166357e72eb360e01b1790528151829060019081106135b2576135b26145a4565b60200260200101819052507f0000000000000000000000000000000000000000000000000000000000000000826002815181106135f1576135f16145a4565b6001600160a01b03909216602092830291909101909101527f0000000000000000000000000000000000000000000000000000000000000000600080516020614fae8339815191526136466040870187614351565b6040516024016136599493929190614a06565b60408051601f198184030181529190526020810180516001600160e01b031663dcc3284160e01b179052815182906002908110612ac357612ac36145a4565b60006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663c79aeaae6136d66020870187614029565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa15801561371a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061373e9190614541565b60408051600280825260608201835292935060009290916020830190803683375050604080516002808252606082019092529293506000929150602082015b606081526020019060019003908161377d57905050905082826000815181106137a8576137a86145a4565b6001600160a01b0390921660209283029190910190910152856137cb8680614351565b6137db6040890160208a01614f22565b6137eb60608a0160408b01614f22565b6137f860608b018b6143be565b60405160240161380e9796959493929190614f3d565b60408051601f198184030181529190526020810180516001600160e01b0316636f4621e360e01b1790528151829060009061384b5761384b6145a4565b60200260200101819052507f00000000000000000000000000000000000000000000000000000000000000008260018151811061388a5761388a6145a4565b6001600160a01b03909216602092830291909101909101527f0000000000000000000000000000000000000000000000000000000000000000846138ce8780614351565b6040516024016138e19493929190614a06565b60408051601f198184030181529190526020810180516001600160e01b031663dcc3284160e01b179052815182906001908110613920576139206145a4565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038816906363fb0b96906139599085908590600401614617565b600060405180830381600087803b15801561397357600080fd5b505af1158015613987573d6000803e3d6000fd5b5050505050505050505050565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b60608152602001906001900390816139ce5790505090507f000000000000000000000000000000000000000000000000000000000000000082600081518110613a1957613a196145a4565b6001600160a01b0392831660209182029290920101526040517f00000000000000000000000000000000000000000000000000000000000000008216602482015290851660448201526064810184905260840160408051601f198184030181529190526020810180516001600160e01b0316637f9ebb0960e01b17905281518290600090611e3f57611e3f6145a4565b600060808284031215613abb57600080fd5b50919050565b600060608284031215613abb57600080fd5b60008083601f840112613ae557600080fd5b5081356001600160401b03811115613afc57600080fd5b6020830191508360208260051b8501011115613b1757600080fd5b9250929050565b60008060008060c08587031215613b3457600080fd5b613b3e8686613aa9565b935060808501356001600160401b0380821115613b5a57600080fd5b613b6688838901613ac1565b945060a0870135915080821115613b7c57600080fd5b50613b8987828801613ad3565b95989497509550505050565b80358015158114613ba557600080fd5b919050565b6000806000806000806101008789031215613bc457600080fd5b613bce8888613aa9565b955060808701356001600160401b0380821115613bea57600080fd5b613bf68a838b01613aa9565b965060a0890135915080821115613c0c57600080fd5b613c188a838b01613ac1565b9550613c2660c08a01613b95565b945060e0890135915080821115613c3c57600080fd5b50613c4989828a01613ad3565b979a9699509497509295939492505050565b60008060a08385031215613c6e57600080fd5b613c788484613aa9565b915060808301356001600160401b03811115613c9357600080fd5b613c9f85828601613aa9565b9150509250929050565b60006101008284031215613abb57600080fd5b60006103008284031215613abb57600080fd5b6000806000806103408587031215613ce657600080fd5b84356001600160401b0380821115613cfd57600080fd5b613d0988838901613ca9565b9550613d188860208901613cbc565b9450610320870135915080821115613b7c57600080fd5b600060408284031215613abb57600080fd5b600080600080600060e08688031215613d5957600080fd5b613d638787613aa9565b945060808601356001600160401b0380821115613d7f57600080fd5b613d8b89838a01613d2f565b9550613d9960a08901613b95565b945060c0880135915080821115613daf57600080fd5b50613dbc88828901613ad3565b969995985093965092949392505050565b600080600080600060e08688031215613de557600080fd5b613def8787613aa9565b945060808601356001600160401b0380821115613e0b57600080fd5b613e1789838a01613aa9565b955060a0880135915080821115613e2d57600080fd5b613d9989838a01613ac1565b6001600160a01b0381168114613e4e57600080fd5b50565b6000806000806000806101008789031215613e6b57600080fd5b8635613e7681613e39565b9550613e858860208901613aa9565b945060a08701356001600160401b0380821115613ea157600080fd5b613ead8a838b01613aa9565b955060c0890135915080821115613ec357600080fd5b613c268a838b01613ac1565b60008083601f840112613ee157600080fd5b5081356001600160401b03811115613ef857600080fd5b602083019150836020828501011115613b1757600080fd5b600080600060a08486031215613f2557600080fd5b613f2f8585613aa9565b925060808401356001600160401b03811115613f4a57600080fd5b613f5686828701613ecf565b9497909650939450505050565b600080600060408486031215613f7857600080fd5b83356001600160401b0380821115613f8f57600080fd5b613f9b87838801613ca9565b94506020860135915080821115613fb157600080fd5b50613f5686828701613ad3565b60008060008060c08587031215613fd457600080fd5b613fde8686613aa9565b935060808501356001600160401b0380821115613ffa57600080fd5b61400688838901613aa9565b945060a087013591508082111561401c57600080fd5b50613b8987828801613ecf565b60006020828403121561403b57600080fd5b81356129a381613e39565b600080600060c0848603121561405b57600080fd5b833561406681613e39565b92506140758560208601613aa9565b915060a08401356001600160401b0381111561409057600080fd5b61409c86828701613aa9565b9150509250925092565b6000806000606084860312156140bb57600080fd5b83356140c681613e39565b925060208401356140d681613e39565b929592945050506040919091013590565b6000806000806000806103e0878903121561410157600080fd5b61410b8888613aa9565b955060808701356001600160401b0381111561412657600080fd5b61413289828a01613ecf565b909650945061414690508860a08901613cbc565b92506103a087013561415781613e39565b809250506103c087013590509295509295509295565b6000806000806060858703121561418357600080fd5b843561418e81613e39565b935060208501356001600160401b03808211156141aa57600080fd5b6141b688838901613ca9565b94506040870135915080821115613b7c57600080fd5b60008060008060008061010087890312156141e657600080fd5b6141f08888613aa9565b955060808701356001600160401b038082111561420c57600080fd5b6142188a838b01613aa9565b965060a089013591508082111561422e57600080fd5b613c188a838b01613aa9565b600080600080600080610100878903121561425457600080fd5b863561425f81613e39565b955061426e8860208901613aa9565b945060a08701356001600160401b038082111561428a57600080fd5b613c188a838b01613d2f565b60008060008060008061038087890312156142b057600080fd5b86356001600160401b03808211156142c757600080fd5b6142d38a838b01613aa9565b97506142e28a60208b01613cbc565b96506103208901359150808211156142f957600080fd5b5061430689828a01613ad3565b90955093505061034087013561431b81613e39565b8092505061036087013590509295509295509295565b60008235603e1983360301811261434757600080fd5b9190910192915050565b6000808335601e1984360301811261436857600080fd5b8301803591506001600160401b0382111561438257600080fd5b6020019150600581901b3603821315613b1757600080fd5b8035613ba581613e39565b6000602082840312156143b757600080fd5b5051919050565b6000808335601e198436030181126143d557600080fd5b8301803591506001600160401b038211156143ef57600080fd5b602001915036819003821315613b1757600080fd5b60006040828403121561441657600080fd5b604051604081018181106001600160401b038211171561444657634e487b7160e01b600052604160045260246000fd5b604052905080823561445781613e39565b8152602092830135920191909152919050565b60006080828403121561447c57600080fd5b604051606081018181106001600160401b03821117156144ac57634e487b7160e01b600052604160045260246000fd5b6040526144b98484614404565b815260408301356144c981613e39565b602082015260609290920135604083015250919050565b6001600160a01b03929092168252602082015260400190565b60008235607e1983360301811261434757600080fd5b60008235605e1983360301811261434757600080fd5b60006040828403121561453757600080fd5b6129a38383614404565b60006020828403121561455357600080fd5b81516129a381613e39565b81516001600160a01b039081168252602080840151909116908201526040918201519181019190915260600190565b6000823561017e1983360301811261434757600080fd5b634e487b7160e01b600052603260045260246000fd5b8183526000602080850194508260005b858110156145f85781356145dd81613e39565b6001600160a01b0316875295820195908201906001016145ca565b509495945050505050565b6020815260006114716020830184866145ba565b604080825283519082018190526000906020906060840190828701845b828110156146595781516001600160a01b031684529284019290840190600101614634565b50505083810382850152845180825282820190600581901b8301840187850160005b838110156146d857601f19808785030186528251805180865260005b818110156146b2578281018b01518782018c01528a01614697565b5060008682018b015296890196601f01909116909301870192509086019060010161467b565b50909998505050505050505050565b80356146f281613e39565b6001600160a01b0390811683526020828101359084015260408201359061471882613e39565b166040830152606090810135910152565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61475c81856146e7565b60a06080820152600061477360a083018486614729565b95945050505050565b80356001600160801b0381168114613ba557600080fd5b6000808335601e198436030181126147aa57600080fd5b83016020810192503590506001600160401b038111156147c957600080fd5b803603821315613b1757600080fd5b6000808335601e198436030181126147ef57600080fd5b83016020810192503590506001600160401b0381111561480e57600080fd5b8060051b3603821315613b1757600080fd5b60008235609e1983360301811261483657600080fd5b90910192915050565b81835260006020808501808196508560051b810191508460005b878110156148e95782840389526148708288614820565b60a0813561487d81613e39565b6001600160a01b039081168752828801358888015260408084013590880152606090818401356148ac81613e39565b169087015260806148bf83820184614793565b935082828901526148d38389018583614729565b9c89019c97505050928601925050600101614859565b5091979650505050505050565b602081526000823560fe1984360301811261491057600080fd5b604060208401528301803561492481613e39565b6001600160a01b03166060840152602081013560808401526149486040820161477c565b6001600160801b03811660a085015250606081013560c0840152608081013560e084015261497860a0820161477c565b61010061498f818601836001600160801b03169052565b61499b60c0840161477c565b6001600160801b03811661012087015291506149ba60e0840184614793565b9350915080610140860152506149d561016085018383614729565b9150506149e560208501856147d8565b848303601f190160408601526149fc83828461483f565b9695505050505050565b6001600160a01b03851681526001600160e01b0319841660208201526060604082018190526000906149fc90830184866145ba565b6000845160018060a01b038082511684526020820151602085015280602088015116604085015250506040850151606083015260a0608083015261477360a083018486614729565b62ffffff81168114613e4e57600080fd5b600060208284031215614aa657600080fd5b81516129a381614a83565b8035613ba581614a83565b8035614ac781613e39565b6001600160a01b039081168352602082013590614ae382613e39565b1660208301526040810135614af781614a83565b62ffffff81166040840152505050565b8035600281900b8114613ba557600080fd5b602081526000614b2983846147d8565b60406020850152614b3e60608501828461483f565b915050602084013561017e19853603018112614b5957600080fd5b838203601f190160408501528401610180614b8483614b778461439a565b6001600160a01b03169052565b60208201356020840152614b9e6040840160408401614abc565b614baa60a08301614b07565b614bb960a085018260020b9052565b50614bc660c08301614b07565b614bd560c085018260020b9052565b5060e08281013590840152610100808301359084015261012080830135908401526101408083013590840152610160614c1081840184614793565b93508282860152614c248386018583614729565b98975050505050505050565b8181038181111561119657634e487b7160e01b600052601160045260246000fd5b803560ff81168114613ba557600080fd5b803560038110614c7157600080fd5b82526020810135614c8181613e39565b6001600160a01b03166020929092019190915250565b614ca081614b07565b60020b8252614cb160208201614b07565b60020b60208301526040810135614cc781613e39565b6001600160a01b039081166040840152606082013590614ce682613e39565b1660608301526080818101359083015260a090810135910152565b6001600160a01b0385811682528481166020830152604082018490526103608201908335614d2e81613e39565b166060830152614d4060208401613b95565b15156080830152614d6360a08301614d5a60408601614ab1565b62ffffff169052565b614d6f60608401614ab1565b62ffffff1660c0830152614d8560808401614b07565b614d9460e084018260020b9052565b50614da160a08401614b07565b610100614db28185018360020b9052565b610120915060c08501358285015261014060e0860135818601526101608287013581870152614de2848801614b07565b93506101809250614df78387018560020b9052565b614e02828801614b07565b9350614e146101a087018560020b9052565b614e1f818801614c51565b935050506101c0614e348186018460ff169052565b6101e09250614e47838601838801614c62565b614e52818701613b95565b915050610220614e658186018315159052565b6102409150614e78828601848801614c62565b614e83818701613b95565b925050614e9561028085018315159052565b614ea56102a08501828701614c97565b505095945050505050565b608081526000614ec460808301888a6145ba565b82810360208401528581526001600160fb1b03861115614ee357600080fd5b8560051b808860208401376001600160a01b039590951660408401526001600160e01b0319939093166060909201919091525001602001949350505050565b600060208284031215614f3457600080fd5b6129a38261477c565b6000610100614f4c838b6146e7565b806080840152614f5f818401898b6145ba565b6001600160801b0388811660a0860152871660c085015283810360e08501529050614f8b818587614729565b9a9950505050505050505050565b60208152600061147160208301848661483f56fee400534da780c9d64ef8b5f03c074ff47537b6a4aa2a3e5d5455cb37b5406aa3a2646970667358221220ea96b3bd368c040e933d05ce657aa3e8d3cc0dbf5b0fc5485d371e3bf4debf4964736f6c6343000813003300000000000000000000000053d9780dbd3831e3a797fd215be4131636cd5fdf0000000000000000000000003575aa02ae85d8cd2aae6dcaa5d8750cfc9622e6000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c990000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b000000000000000000000000a77d2dde3847a92d57b847b59a270cdfe67f2823000000000000000000000000b01e431542bafbac3fc95057961c92ed8e06e08d00000000000000000000000060d3345c2d2fd62dbed55cf2178bdcff69d176980000000000000000000000009fad68008c8361436545a206c90af1cc480f710a000000000000000000000000bbddb992caf83388b216af8aeb8a0ac8a4bdd932
Deployed Bytecode
0x6080604052600436106101c25760003560e01c8063659b91b1116100f7578063c45a015511610095578063e0192b2811610064578063e0192b28146105cd578063e5bacdd0146105ed578063f0806a7f14610600578063f53043771461062057600080fd5b8063c45a015514610511578063cb54e34d14610545578063cce5b8c614610565578063d996cef71461059957600080fd5b80639448c56a116100d15780639448c56a14610469578063b3fb68d514610489578063b53c86d2146104a9578063bc6b74ab146104dd57600080fd5b8063659b91b1146104095780636e2f91d514610429578063759cb2341461044957600080fd5b806328734381116101645780633faa6e301161013e5780633faa6e30146103615780633fb53a0d14610395578063541bb89e146103c95780635ec5999e146103e957600080fd5b806328734381146102ed5780632af3fa1b1461030d57806338f6f9271461034157600080fd5b80631de7354b116101a05780631de7354b14610229578063224512621461027957806324f450db146102995780632812d614146102cd57600080fd5b8063107acebd146101c75780631c396db6146101e95780631d06722b14610209575b600080fd5b3480156101d357600080fd5b506101e76101e2366004613b1e565b610633565b005b3480156101f557600080fd5b506101e7610204366004613baa565b6106ac565b34801561021557600080fd5b506101e7610224366004613c5b565b6108ed565b34801561023557600080fd5b5061025d7f000000000000000000000000bbddb992caf83388b216af8aeb8a0ac8a4bdd93281565b6040516001600160a01b03909116815260200160405180910390f35b34801561028557600080fd5b506101e7610294366004613ccf565b61090a565b3480156102a557600080fd5b5061025d7f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c9981565b3480156102d957600080fd5b506101e76102e8366004613d41565b610bbe565b3480156102f957600080fd5b506101e7610308366004613dcd565b610cfb565b34801561031957600080fd5b5061025d7f00000000000000000000000060d3345c2d2fd62dbed55cf2178bdcff69d1769881565b34801561034d57600080fd5b506101e761035c366004613e51565b610d16565b34801561036d57600080fd5b5061025d7f000000000000000000000000b01e431542bafbac3fc95057961c92ed8e06e08d81565b3480156103a157600080fd5b5061025d7f000000000000000000000000a77d2dde3847a92d57b847b59a270cdfe67f282381565b3480156103d557600080fd5b506101e76103e4366004613f10565b610f2d565b3480156103f557600080fd5b506101e7610404366004613c5b565b610fd5565b34801561041557600080fd5b506101e7610424366004613f63565b610ffc565b34801561043557600080fd5b506101e7610444366004613fbe565b61102a565b34801561045557600080fd5b5061025d610464366004614029565b6110de565b34801561047557600080fd5b506101e7610484366004614046565b61119c565b34801561049557600080fd5b5061025d6104a43660046140a6565b6113d1565b3480156104b557600080fd5b5061025d7f0000000000000000000000003575aa02ae85d8cd2aae6dcaa5d8750cfc9622e681565b3480156104e957600080fd5b5061025d7f00000000000000000000000004448ed523730142b1eaf647123d9029e8da74fa81565b34801561051d57600080fd5b5061025d7f00000000000000000000000053d9780dbd3831e3a797fd215be4131636cd5fdf81565b34801561055157600080fd5b506101e76105603660046140e7565b611479565b34801561057157600080fd5b5061025d7f0000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b81565b3480156105a557600080fd5b5061025d7f0000000000000000000000009fad68008c8361436545a206c90af1cc480f710a81565b3480156105d957600080fd5b506101e76105e836600461416d565b6114df565b6101e76105fb3660046141cc565b611724565b34801561060c57600080fd5b506101e761061b36600461423a565b6118d0565b6101e761062e366004614296565b611b08565b600061063e336110de565b905060008061064d8680614331565b61065b906020810190614351565b90501161066957600061068b565b7fdfa64d371f38074894860654f13f7558a46a9b052e65fd158280c8dd2f07af645b905061069982878784611d2d565b6106a4828585611d4a565b505050505050565b6106bc6060870160408801614029565b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106fc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072091906143a5565b9050600061072d336110de565b9050856107655761074e818a8a600080516020614fae833981519152611ea6565b610765818a61076060408b018b6143be565b611f72565b6000806107728980614331565b610780906020810190614351565b90501161078e5760006107b0565b7fdfa64d371f38074894860654f13f7558a46a9b052e65fd158280c8dd2f07af645b90506107bd8289836121d0565b866107e7576107e7826107d5368d90038d018d61446a565b6107e260408c018c6143be565b61239c565b6107f2828787611d4a565b60608a018035906108069060408d01614029565b6001600160a01b039081169084167f3d988581b5d3b2ed8c77b357af36f383c9a6d036a423cb9f82be3b03211cfd1461084260208f018f614029565b8e600001602001356040516108589291906144e0565b60405180910390a45050816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c491906143a5565b81146108e35760405163648873f960e01b815260040160405180910390fd5b5050505050505050565b60006108f8336110de565b90506109058184846125d3565b505050565b61091a6080850160608601614029565b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561095a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097e91906143a5565b9050600061098b336110de565b90506109b681602089016109a260a08b018b6144f9565b600080516020614fae833981519152611ea6565b6109e581602089016109cb60c08b018b61450f565b6109e06109db60208d018d614029565b61266b565b611d2d565b610a17816109f660e08a018a6144f9565b610a049060608101906144f9565b610a12906040810190614331565b612766565b6000610a4082610a2a60e08b018b6144f9565b610a3b906060810190604001614029565b6128c0565b9050610ace8260405180606001604052808b8060e00190610a6191906144f9565b610a719036819003810190614525565b8152602001610a8360e08d018d6144f9565b610a94906060810190604001614029565b6001600160a01b03168152602001849052610ab260e08c018c6144f9565b610ac09060608101906144f9565b6107e29060608101906143be565b610af782610adf60e08b018b6144f9565b610af0906060810190604001614029565b838a6129aa565b610b02828787611d4a565b610b3b8260208a01610b1760e08c018c6144f9565b610b28906060810190604001614029565b610b3560e08d018d6144f9565b85612b36565b5050816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9f91906143a5565b81146106a45760405163648873f960e01b815260040160405180910390fd5b610bce6060860160408701614029565b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3291906143a5565b90506000610c3f336110de565b9050610c708189898989897f1d5b8de553017a3bd388578aeece0183b79c5ca87ec64628b3f76b39487f0231612bde565b50816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610caf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd391906143a5565b8114610cf25760405163648873f960e01b815260040160405180910390fd5b50505050505050565b6000610d06336110de565b90506106a4818787878787612c9d565b60405163429b62e560e01b81526001600160a01b03808816600483015287916000917f00000000000000000000000053d9780dbd3831e3a797fd215be4131636cd5fdf169063429b62e590602401602060405180830381865afa158015610d81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da59190614541565b6001600160a01b031603610dcc57604051633098a45560e01b815260040160405180910390fd5b336001600160a01b0316816001600160a01b03166319d40b086040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e389190614541565b6001600160a01b031614610e5f5760405163c19f17a960e01b815260040160405180910390fd5b7f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c996001600160a01b031663459e268460405180606001604052808a6001600160a01b03168152602001896040016020810190610ebb9190614029565b6001600160a01b0316815260200189606001358152506040518263ffffffff1660e01b8152600401610eed919061455e565b600060405180830381600087803b158015610f0757600080fd5b505af1158015610f1b573d6000803e3d6000fd5b50505050610cf2878787878787612c9d565b6000610f38336110de565b9050610f4681858585611f72565b610f6481610f5a6060870160408801614029565b8660600135612d61565b60608401803590610f789060408701614029565b6001600160a01b039081169083167f976f9aa1da6d0f0e23405b12b4e2b446c12615150624819f4bebe8060fa39f61610fb46020890189614029565b604051610fc7919060208b0135906144e0565b60405180910390a450505050565b6000610fe0336110de565b9050610905818484600080516020614fae833981519152611ea6565b6000611007336110de565b905061102481858585600080516020614fae833981519152612e56565b50505050565b6000611035336110de565b90506110428186866125d3565b61104e81868585611f72565b61106c816110626060880160408901614029565b8760600135612d61565b606085018035906110809060408801614029565b6001600160a01b039081169083167fc9a3d0888f5ab83eb0fcd2e948c80035fd02319ad2f57c4bc68b1513a0f78ea06110bc60208a018a614029565b6040516110cf919060208c0135906144e0565b60405180910390a45050505050565b6040516312cfc9b560e31b81526001600160a01b03828116600483015260009182917f00000000000000000000000053d9780dbd3831e3a797fd215be4131636cd5fdf169063967e4da890602401602060405180830381865afa158015611149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116d9190614541565b90506001600160a01b03811661119657604051633098a45560e01b815260040160405180910390fd5b92915050565b60405163429b62e560e01b81526001600160a01b03808516600483015284916000917f00000000000000000000000053d9780dbd3831e3a797fd215be4131636cd5fdf169063429b62e590602401602060405180830381865afa158015611207573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122b9190614541565b6001600160a01b03160361125257604051633098a45560e01b815260040160405180910390fd5b336001600160a01b0316816001600160a01b03166319d40b086040518163ffffffff1660e01b8152600401602060405180830381865afa15801561129a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112be9190614541565b6001600160a01b0316146112e55760405163c19f17a960e01b815260040160405180910390fd5b7f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c996001600160a01b031663bca9ca736040518060600160405280876001600160a01b031681526020018660400160208101906113419190614029565b6001600160a01b0316815260200186606001358152506040518263ffffffff1660e01b8152600401611373919061455e565b600060405180830381600087803b15801561138d57600080fd5b505af11580156113a1573d6000803e3d6000fd5b505050506110248484847f139f6e665188bd3327a590d2d1c9d8d09b55289c07e19fef103ceab100ea0979611ea6565b60405163de0d95ed60e01b81526001600160a01b0384811660048301528381166024830152604482018390526000917f00000000000000000000000053d9780dbd3831e3a797fd215be4131636cd5fdf9091169063de0d95ed906064016020604051808303816000875af115801561144d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114719190614541565b949350505050565b60006114863384846113d1565b90506114a68161149c60608a0160408b01614029565b8960600135613063565b6114c0816114b9368a90038a018a61446a565b888861239c565b610cf2816114d460608a0160408b01614029565b8960600135876129aa565b60405163429b62e560e01b81526001600160a01b03808616600483015285916000917f00000000000000000000000053d9780dbd3831e3a797fd215be4131636cd5fdf169063429b62e590602401602060405180830381865afa15801561154a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156e9190614541565b6001600160a01b03160361159557604051633098a45560e01b815260040160405180910390fd5b336001600160a01b0316816001600160a01b03166319d40b086040518163ffffffff1660e01b8152600401602060405180830381865afa1580156115dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116019190614541565b6001600160a01b0316146116285760405163c19f17a960e01b815260040160405180910390fd5b7f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c996001600160a01b0316638bb96a906040518060600160405280886001600160a01b031681526020018760200160400160208101906116879190614029565b6001600160a01b0316815260808801356020909101526040516001600160e01b031960e084901b1681526116be919060040161455e565b600060405180830381600087803b1580156116d857600080fd5b505af11580156116ec573d6000803e3d6000fd5b5050505061171d858585857f139f6e665188bd3327a590d2d1c9d8d09b55289c07e19fef103ceab100ea0979612e56565b5050505050565b6117346060870160408801614029565b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611774573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061179891906143a5565b905060006117a5336110de565b9050856117d8576117c6818a8a600080516020614fae833981519152611ea6565b6117d8818a61076060608b018b6143be565b6117e28188613158565b6117f381610a1260408a018a614331565b85611818576118188161180b368c90038c018c61446a565b6107e260608b018b6143be565b611823818686611d4a565b606089018035906118379060408c01614029565b6001600160a01b039081169083167fb00138e527e12645ad7a5a8d608b107cf2fcd3525d2b5d09973ed652f87b4f3961187360208e018e614029565b8d600001602001356040516118899291906144e0565b60405180910390a450816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108a0573d6000803e3d6000fd5b60405163429b62e560e01b81526001600160a01b03808816600483015287916000917f00000000000000000000000053d9780dbd3831e3a797fd215be4131636cd5fdf169063429b62e590602401602060405180830381865afa15801561193b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195f9190614541565b6001600160a01b03160361198657604051633098a45560e01b815260040160405180910390fd5b336001600160a01b0316816001600160a01b03166319d40b086040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f29190614541565b6001600160a01b031614611a195760405163c19f17a960e01b815260040160405180910390fd5b7f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c996001600160a01b031663f1cf418260405180606001604052808a6001600160a01b03168152602001896040016020810190611a759190614029565b6001600160a01b0316815260200189606001358152506040518263ffffffff1660e01b8152600401611aa7919061455e565b600060405180830381600087803b158015611ac157600080fd5b505af1158015611ad5573d6000803e3d6000fd5b50505050610cf28787878787877f6b277b6f647b7a0d8000e4fc1460639f589d3e1262b3f1a2f378cce0a5da40bb612bde565b611b1560608701876144f9565b611b23906040810190614331565b611b3190602081019061458d565b6020013515611b53576040516379bb579b60e11b815260040160405180910390fd5b6000611b656060880160408901614029565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ba2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bc691906143a5565b90506000611bd53385856113d1565b9050611bed81611be860608b018b6144f9565b613158565b611bfe81610a0460608b018b6144f9565b6000611c1482610a3b60608c0160408d01614029565b9050611c6c8260405180606001604052808c600001803603810190611c399190614525565b8152602001611c4e60608e0160408f01614029565b6001600160a01b03168152602001849052610ac060608d018d6144f9565b611c8782611c8060608c0160408d01614029565b838b6129aa565b611c92828888611d4a565b82611ca360608b0160408c01614029565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ce0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d0491906143a5565b11611d2257604051638480c32560e01b815260040160405180910390fd5b505050505050505050565b611d3f848461076060408601866143be565b6110248483836121d0565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b6060815260200190600190039081611d845790505090507f000000000000000000000000a77d2dde3847a92d57b847b59a270cdfe67f282382600081518110611dcf57611dcf6145a4565b60200260200101906001600160a01b031690816001600160a01b0316815250508383604051602401611e02929190614603565b60408051601f198184030181529190526020810180516001600160e01b031663d354641160e01b17905281518290600090611e3f57611e3f6145a4565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038616906363fb0b9690611e789085908590600401614617565b600060405180830381600087803b158015611e9257600080fd5b505af1158015611d22573d6000803e3d6000fd5b6000611eb56020840184614351565b90501115611ecd57611ec8848484613321565b611ee2565b611ee28484611edc85806144f9565b84613698565b6000611ef16060840184614351565b90501115611f0f57611f0f84611f0a6060850185614351565b611d4a565b60608301803590611f239060408601614029565b6001600160a01b039081169086167fbf9d03ac543e8f596c6f4af5ab5e75f366a57d2d6c28d2ff9c024bd3f88e8771611f5f6020880188614029565b604051610fc7919060208a0135906144e0565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b6060815260200190600190039081611fac57905050905060006001600160a01b037f0000000000000000000000003575aa02ae85d8cd2aae6dcaa5d8750cfc9622e61663c79aeaae6120016020890189614029565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015612045573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120699190614541565b9050808360008151811061207f5761207f6145a4565b60200260200101906001600160a01b031690816001600160a01b0316815250508585856040516024016120b493929190614752565b60408051601f198184030181529190526020810180516001600160e01b0316631423e67960e11b179052825183906000906120f1576120f16145a4565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038816906363fb0b969061212a9086908690600401614617565b600060405180830381600087803b15801561214457600080fd5b505af1158015612158573d6000803e3d6000fd5b50505060608701803591506121709060408901614029565b6001600160a01b039081169089167f976f9aa1da6d0f0e23405b12b4e2b446c12615150624819f4bebe8060fa39f616121ac60208b018b614029565b6040516121bf919060208d0135906144e0565b60405180910390a450505050505050565b6040805160028082526060820183526000926020830190803683375050604080516002808252606082019092529293506000929150602082015b606081526020019060019003908161220a5790505090507f0000000000000000000000009fad68008c8361436545a206c90af1cc480f710a82600081518110612255576122556145a4565b6001600160a01b03909216602092830291909101909101526122778480614331565b60405160240161228791906148f6565b60408051601f198184030181529190526020810180516001600160e01b0316630505281960e11b179052815182906000906122c4576122c46145a4565b60200260200101819052507f00000000000000000000000060d3345c2d2fd62dbed55cf2178bdcff69d1769882600181518110612303576123036145a4565b6001600160a01b039092166020928302919091018201527f00000000000000000000000004448ed523730142b1eaf647123d9029e8da74fa90849061234a90870187614351565b60405160240161235d9493929190614a06565b60408051601f198184030181529190526020810180516001600160e01b031663dcc3284160e01b179052815182906001908110611e3f57611e3f6145a4565b8251516040516363cd755760e11b81526001600160a01b0391821660048201526000917f0000000000000000000000003575aa02ae85d8cd2aae6dcaa5d8750cfc9622e6169063c79aeaae90602401602060405180830381865afa158015612408573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061242c9190614541565b604080516001808252818301909252919250600091906020808301908036833750506040805160018082528183019092529293506000929150602082015b606081526020019060019003908161246a5790505090508282600081518110612495576124956145a4565b60200260200101906001600160a01b031690816001600160a01b0316815250508585856040516024016124ca93929190614a3b565b60408051601f198184030181529190526020810180516001600160e01b03166001624236cd60e11b03191790528151829060009061250a5761250a6145a4565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038816906363fb0b96906125439085908590600401614617565b600060405180830381600087803b15801561255d57600080fd5b505af1158015612571573d6000803e3d6000fd5b50505050856040015186602001516001600160a01b0316886001600160a01b03167f53375fafff3a4a00460af1c1347b8f0dd0d35cce6b2bd5661346bc8ad1d37a008960000151600001518a60000151602001516040516121bf9291906144e0565b6125ed838383600080516020614fae833981519152613698565b6125fb83611f0a8380614351565b6060820180359061260f9060408501614029565b6001600160a01b039081169085167fbf9d03ac543e8f596c6f4af5ab5e75f366a57d2d6c28d2ff9c024bd3f88e877161264b6020870187614029565b60405161265e91906020890135906144e0565b60405180910390a4505050565b600080826001600160a01b031663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa1580156126ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126d09190614a94565b90506101f48162ffffff161161270857507fcb922c4d36cde61b3660729b33f36eff74a31440cf3e852d4467b4bd6045011c92915050565b610bb88162ffffff161161273e57507fc552bcd88e8785f8a0d9f9c5b9dc4e198659e68e9f6645642142b2900cde564d92915050565b507fa7e26cbd23588e6e87ee40cb01079e973bf8a0910c2edb6bc11ba3240a81480b92915050565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b60608152602001906001900390816127a05790505090507f0000000000000000000000009fad68008c8361436545a206c90af1cc480f710a826000815181106127eb576127eb6145a4565b60200260200101906001600160a01b031690816001600160a01b0316815250508260405160240161281c9190614b19565b60408051601f198184030181529190526020810180516001600160e01b0316633d74119b60e21b17905281518290600090612859576128596145a4565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038516906363fb0b96906128929085908590600401614617565b600060405180830381600087803b1580156128ac57600080fd5b505af11580156108e3573d6000803e3d6000fd5b6040516370a0823160e01b81526001600160a01b03838116600483015260009190831690632f745c5990859060019084906370a0823190602401602060405180830381865afa158015612917573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293b91906143a5565b6129459190614c30565b6040518363ffffffff1660e01b81526004016129629291906144e0565b602060405180830381865afa15801561297f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129a391906143a5565b9392505050565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b60608152602001906001900390816129e45790505090507f000000000000000000000000bbddb992caf83388b216af8aeb8a0ac8a4bdd93282600081518110612a2f57612a2f6145a4565b60200260200101906001600160a01b031690816001600160a01b0316815250507f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c99858585604051602401612a869493929190614d01565b60408051601f198184030181529190526020810180516001600160e01b031663349677a160e21b17905281518290600090612ac357612ac36145a4565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038716906363fb0b9690612afc9085908590600401614617565b600060405180830381600087803b158015612b1657600080fd5b505af1158015612b2a573d6000803e3d6000fd5b50505050505050505050565b60608401803590612b4a9060408701614029565b6001600160a01b039081169087167f8181f528787b6f5d64998fce6130134048cf712961e4d1554465276932df54cc612b866020890189614029565b6020808a01359089908890612b9d908b018b614029565b604080516001600160a01b039687168152602080820196909652938616908401526060830191909152909216608083015287013560a082015260c0016110cf565b612bed8787611edc88806144f9565b83612c0f57612c0f8787612c0188806144f9565b6107609060608101906143be565b612c2087610a126020880188614331565b83612c4257612c4287612c383689900389018961446a565b610ac088806144f9565b612c4d878484611d4a565b60608601803590612c619060408901614029565b6001600160a01b039081169089167f504180eddec0aa4ed3bb8edcf99b13013e1d8ae52be37f0f4f38d14ccf0c99a56121ac60208b018b614029565b612cb7868686600080516020614fae833981519152611ea6565b612ce38686857fdfa64d371f38074894860654f13f7558a46a9b052e65fd158280c8dd2f07af64611d2d565b612cee868383611d4a565b60608501803590612d029060408801614029565b6001600160a01b039081169088167fc9a3d0888f5ab83eb0fcd2e948c80035fd02319ad2f57c4bc68b1513a0f78ea0612d3e60208a018a614029565b604051612d51919060208c0135906144e0565b60405180910390a4505050505050565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b6060815260200190600190039081612d9b5790505090507f0000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b82600081518110612de657612de66145a4565b60200260200101906001600160a01b031690816001600160a01b0316815250508383604051602401612e199291906144e0565b60408051601f198184030181529190526020810180516001600160e01b0316631df6a96160e31b17905281518290600090611e3f57611e3f6145a4565b612e666080850160608601614029565b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ea6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eca91906143a5565b9050612ee78760208801612ee160a08a018a6144f9565b86611ea6565b612f0c8760208801612efc60c08a018a61450f565b6109e06109db60208c018c614029565b612f1d87610a0460e08901896144f9565b612f3b87612f316080890160608a01614029565b6080890135613994565b6000612f5188610a3b60808a0160608b01614029565b9050612fac8860405180606001604052808a602001600001803603810190612f799190614525565b8152602001612f8e60808c0160608d01614029565b6001600160a01b03168152602001849052610ac060e08b018b6144f9565b612fb7888787611d4a565b60808701803590612fcb9060608a01614029565b6001600160a01b03908116908a167f550ef6ca72911d6a82dfa1fade2d87ed10c69661f1bf04376add792b5d1e543761300a60408c0160208d01614029565b6040805161301c92918e0135906144e0565b60405180910390a450816001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610caf573d6000803e3d6000fd5b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b606081526020019060019003908161309d5790505090507f0000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b826000815181106130e8576130e86145a4565b60200260200101906001600160a01b031690816001600160a01b031681525050838360405160240161311b9291906144e0565b60408051601f198184030181529190526020810180516001600160e01b03166306c530b960e41b17905281518290600090611e3f57611e3f6145a4565b6000806131686040840184614331565b6131729080614351565b9050116131805760006131a2565b7fab273376f9efdd920b41b30b3f02b3dee877874951e3c14bf87bc60060efebcc5b604080516001808252818301909252919250600091906020808301908036833750506040805160018082528183019092529293506000929150602082015b60608152602001906001900390816131e05790505090507f000000000000000000000000a77d2dde3847a92d57b847b59a270cdfe67f28238260008151811061322b5761322b6145a4565b6001600160a01b039092166020928302919091019091015261324d8480614351565b61325a6020870187614351565b7f00000000000000000000000004448ed523730142b1eaf647123d9029e8da74fa8760405160240161329196959493929190614eb0565b60408051601f198184030181529190526020810180516001600160e01b03166312f5760360e01b179052815182906000906132ce576132ce6145a4565b6020026020010181905250846001600160a01b03166363fb0b963484846040518463ffffffff1660e01b8152600401613308929190614617565b6000604051808303818588803b158015612b1657600080fd5b60006001600160a01b037f0000000000000000000000003575aa02ae85d8cd2aae6dcaa5d8750cfc9622e61663c79aeaae61335f6020860186614029565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156133a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133c79190614541565b6040805160038082526080820190925291925060009190602082016060803683375050604080516003808252608082019092529293506000929150602082015b60608152602001906001900390816134075790505090508282600081518110613432576134326145a4565b6001600160a01b03909216602092830291909101909101528461345585806144f9565b61345f9080614351565b61346987806144f9565b61347a906040810190602001614f22565b61348488806144f9565b613495906060810190604001614f22565b61349f89806144f9565b6134ad9060608101906143be565b6040516024016134c39796959493929190614f3d565b60408051601f198184030181529190526020810180516001600160e01b0316636f4621e360e01b17905281518290600090613500576135006145a4565b60200260200101819052507f000000000000000000000000b01e431542bafbac3fc95057961c92ed8e06e08d8260018151811061353f5761353f6145a4565b6001600160a01b0390921660209283029190910182015261356290850185614351565b604051602401613573929190614f99565b60408051601f198184030181529190526020810180516001600160e01b03166357e72eb360e01b1790528151829060019081106135b2576135b26145a4565b60200260200101819052507f00000000000000000000000060d3345c2d2fd62dbed55cf2178bdcff69d17698826002815181106135f1576135f16145a4565b6001600160a01b03909216602092830291909101909101527f00000000000000000000000004448ed523730142b1eaf647123d9029e8da74fa600080516020614fae8339815191526136466040870187614351565b6040516024016136599493929190614a06565b60408051601f198184030181529190526020810180516001600160e01b031663dcc3284160e01b179052815182906002908110612ac357612ac36145a4565b60006001600160a01b037f0000000000000000000000003575aa02ae85d8cd2aae6dcaa5d8750cfc9622e61663c79aeaae6136d66020870187614029565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa15801561371a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061373e9190614541565b60408051600280825260608201835292935060009290916020830190803683375050604080516002808252606082019092529293506000929150602082015b606081526020019060019003908161377d57905050905082826000815181106137a8576137a86145a4565b6001600160a01b0390921660209283029190910190910152856137cb8680614351565b6137db6040890160208a01614f22565b6137eb60608a0160408b01614f22565b6137f860608b018b6143be565b60405160240161380e9796959493929190614f3d565b60408051601f198184030181529190526020810180516001600160e01b0316636f4621e360e01b1790528151829060009061384b5761384b6145a4565b60200260200101819052507f00000000000000000000000060d3345c2d2fd62dbed55cf2178bdcff69d176988260018151811061388a5761388a6145a4565b6001600160a01b03909216602092830291909101909101527f00000000000000000000000004448ed523730142b1eaf647123d9029e8da74fa846138ce8780614351565b6040516024016138e19493929190614a06565b60408051601f198184030181529190526020810180516001600160e01b031663dcc3284160e01b179052815182906001908110613920576139206145a4565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038816906363fb0b96906139599085908590600401614617565b600060405180830381600087803b15801561397357600080fd5b505af1158015613987573d6000803e3d6000fd5b5050505050505050505050565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602082015b60608152602001906001900390816139ce5790505090507f000000000000000000000000bbddb992caf83388b216af8aeb8a0ac8a4bdd93282600081518110613a1957613a196145a4565b6001600160a01b0392831660209182029290920101526040517f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c998216602482015290851660448201526064810184905260840160408051601f198184030181529190526020810180516001600160e01b0316637f9ebb0960e01b17905281518290600090611e3f57611e3f6145a4565b600060808284031215613abb57600080fd5b50919050565b600060608284031215613abb57600080fd5b60008083601f840112613ae557600080fd5b5081356001600160401b03811115613afc57600080fd5b6020830191508360208260051b8501011115613b1757600080fd5b9250929050565b60008060008060c08587031215613b3457600080fd5b613b3e8686613aa9565b935060808501356001600160401b0380821115613b5a57600080fd5b613b6688838901613ac1565b945060a0870135915080821115613b7c57600080fd5b50613b8987828801613ad3565b95989497509550505050565b80358015158114613ba557600080fd5b919050565b6000806000806000806101008789031215613bc457600080fd5b613bce8888613aa9565b955060808701356001600160401b0380821115613bea57600080fd5b613bf68a838b01613aa9565b965060a0890135915080821115613c0c57600080fd5b613c188a838b01613ac1565b9550613c2660c08a01613b95565b945060e0890135915080821115613c3c57600080fd5b50613c4989828a01613ad3565b979a9699509497509295939492505050565b60008060a08385031215613c6e57600080fd5b613c788484613aa9565b915060808301356001600160401b03811115613c9357600080fd5b613c9f85828601613aa9565b9150509250929050565b60006101008284031215613abb57600080fd5b60006103008284031215613abb57600080fd5b6000806000806103408587031215613ce657600080fd5b84356001600160401b0380821115613cfd57600080fd5b613d0988838901613ca9565b9550613d188860208901613cbc565b9450610320870135915080821115613b7c57600080fd5b600060408284031215613abb57600080fd5b600080600080600060e08688031215613d5957600080fd5b613d638787613aa9565b945060808601356001600160401b0380821115613d7f57600080fd5b613d8b89838a01613d2f565b9550613d9960a08901613b95565b945060c0880135915080821115613daf57600080fd5b50613dbc88828901613ad3565b969995985093965092949392505050565b600080600080600060e08688031215613de557600080fd5b613def8787613aa9565b945060808601356001600160401b0380821115613e0b57600080fd5b613e1789838a01613aa9565b955060a0880135915080821115613e2d57600080fd5b613d9989838a01613ac1565b6001600160a01b0381168114613e4e57600080fd5b50565b6000806000806000806101008789031215613e6b57600080fd5b8635613e7681613e39565b9550613e858860208901613aa9565b945060a08701356001600160401b0380821115613ea157600080fd5b613ead8a838b01613aa9565b955060c0890135915080821115613ec357600080fd5b613c268a838b01613ac1565b60008083601f840112613ee157600080fd5b5081356001600160401b03811115613ef857600080fd5b602083019150836020828501011115613b1757600080fd5b600080600060a08486031215613f2557600080fd5b613f2f8585613aa9565b925060808401356001600160401b03811115613f4a57600080fd5b613f5686828701613ecf565b9497909650939450505050565b600080600060408486031215613f7857600080fd5b83356001600160401b0380821115613f8f57600080fd5b613f9b87838801613ca9565b94506020860135915080821115613fb157600080fd5b50613f5686828701613ad3565b60008060008060c08587031215613fd457600080fd5b613fde8686613aa9565b935060808501356001600160401b0380821115613ffa57600080fd5b61400688838901613aa9565b945060a087013591508082111561401c57600080fd5b50613b8987828801613ecf565b60006020828403121561403b57600080fd5b81356129a381613e39565b600080600060c0848603121561405b57600080fd5b833561406681613e39565b92506140758560208601613aa9565b915060a08401356001600160401b0381111561409057600080fd5b61409c86828701613aa9565b9150509250925092565b6000806000606084860312156140bb57600080fd5b83356140c681613e39565b925060208401356140d681613e39565b929592945050506040919091013590565b6000806000806000806103e0878903121561410157600080fd5b61410b8888613aa9565b955060808701356001600160401b0381111561412657600080fd5b61413289828a01613ecf565b909650945061414690508860a08901613cbc565b92506103a087013561415781613e39565b809250506103c087013590509295509295509295565b6000806000806060858703121561418357600080fd5b843561418e81613e39565b935060208501356001600160401b03808211156141aa57600080fd5b6141b688838901613ca9565b94506040870135915080821115613b7c57600080fd5b60008060008060008061010087890312156141e657600080fd5b6141f08888613aa9565b955060808701356001600160401b038082111561420c57600080fd5b6142188a838b01613aa9565b965060a089013591508082111561422e57600080fd5b613c188a838b01613aa9565b600080600080600080610100878903121561425457600080fd5b863561425f81613e39565b955061426e8860208901613aa9565b945060a08701356001600160401b038082111561428a57600080fd5b613c188a838b01613d2f565b60008060008060008061038087890312156142b057600080fd5b86356001600160401b03808211156142c757600080fd5b6142d38a838b01613aa9565b97506142e28a60208b01613cbc565b96506103208901359150808211156142f957600080fd5b5061430689828a01613ad3565b90955093505061034087013561431b81613e39565b8092505061036087013590509295509295509295565b60008235603e1983360301811261434757600080fd5b9190910192915050565b6000808335601e1984360301811261436857600080fd5b8301803591506001600160401b0382111561438257600080fd5b6020019150600581901b3603821315613b1757600080fd5b8035613ba581613e39565b6000602082840312156143b757600080fd5b5051919050565b6000808335601e198436030181126143d557600080fd5b8301803591506001600160401b038211156143ef57600080fd5b602001915036819003821315613b1757600080fd5b60006040828403121561441657600080fd5b604051604081018181106001600160401b038211171561444657634e487b7160e01b600052604160045260246000fd5b604052905080823561445781613e39565b8152602092830135920191909152919050565b60006080828403121561447c57600080fd5b604051606081018181106001600160401b03821117156144ac57634e487b7160e01b600052604160045260246000fd5b6040526144b98484614404565b815260408301356144c981613e39565b602082015260609290920135604083015250919050565b6001600160a01b03929092168252602082015260400190565b60008235607e1983360301811261434757600080fd5b60008235605e1983360301811261434757600080fd5b60006040828403121561453757600080fd5b6129a38383614404565b60006020828403121561455357600080fd5b81516129a381613e39565b81516001600160a01b039081168252602080840151909116908201526040918201519181019190915260600190565b6000823561017e1983360301811261434757600080fd5b634e487b7160e01b600052603260045260246000fd5b8183526000602080850194508260005b858110156145f85781356145dd81613e39565b6001600160a01b0316875295820195908201906001016145ca565b509495945050505050565b6020815260006114716020830184866145ba565b604080825283519082018190526000906020906060840190828701845b828110156146595781516001600160a01b031684529284019290840190600101614634565b50505083810382850152845180825282820190600581901b8301840187850160005b838110156146d857601f19808785030186528251805180865260005b818110156146b2578281018b01518782018c01528a01614697565b5060008682018b015296890196601f01909116909301870192509086019060010161467b565b50909998505050505050505050565b80356146f281613e39565b6001600160a01b0390811683526020828101359084015260408201359061471882613e39565b166040830152606090810135910152565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61475c81856146e7565b60a06080820152600061477360a083018486614729565b95945050505050565b80356001600160801b0381168114613ba557600080fd5b6000808335601e198436030181126147aa57600080fd5b83016020810192503590506001600160401b038111156147c957600080fd5b803603821315613b1757600080fd5b6000808335601e198436030181126147ef57600080fd5b83016020810192503590506001600160401b0381111561480e57600080fd5b8060051b3603821315613b1757600080fd5b60008235609e1983360301811261483657600080fd5b90910192915050565b81835260006020808501808196508560051b810191508460005b878110156148e95782840389526148708288614820565b60a0813561487d81613e39565b6001600160a01b039081168752828801358888015260408084013590880152606090818401356148ac81613e39565b169087015260806148bf83820184614793565b935082828901526148d38389018583614729565b9c89019c97505050928601925050600101614859565b5091979650505050505050565b602081526000823560fe1984360301811261491057600080fd5b604060208401528301803561492481613e39565b6001600160a01b03166060840152602081013560808401526149486040820161477c565b6001600160801b03811660a085015250606081013560c0840152608081013560e084015261497860a0820161477c565b61010061498f818601836001600160801b03169052565b61499b60c0840161477c565b6001600160801b03811661012087015291506149ba60e0840184614793565b9350915080610140860152506149d561016085018383614729565b9150506149e560208501856147d8565b848303601f190160408601526149fc83828461483f565b9695505050505050565b6001600160a01b03851681526001600160e01b0319841660208201526060604082018190526000906149fc90830184866145ba565b6000845160018060a01b038082511684526020820151602085015280602088015116604085015250506040850151606083015260a0608083015261477360a083018486614729565b62ffffff81168114613e4e57600080fd5b600060208284031215614aa657600080fd5b81516129a381614a83565b8035613ba581614a83565b8035614ac781613e39565b6001600160a01b039081168352602082013590614ae382613e39565b1660208301526040810135614af781614a83565b62ffffff81166040840152505050565b8035600281900b8114613ba557600080fd5b602081526000614b2983846147d8565b60406020850152614b3e60608501828461483f565b915050602084013561017e19853603018112614b5957600080fd5b838203601f190160408501528401610180614b8483614b778461439a565b6001600160a01b03169052565b60208201356020840152614b9e6040840160408401614abc565b614baa60a08301614b07565b614bb960a085018260020b9052565b50614bc660c08301614b07565b614bd560c085018260020b9052565b5060e08281013590840152610100808301359084015261012080830135908401526101408083013590840152610160614c1081840184614793565b93508282860152614c248386018583614729565b98975050505050505050565b8181038181111561119657634e487b7160e01b600052601160045260246000fd5b803560ff81168114613ba557600080fd5b803560038110614c7157600080fd5b82526020810135614c8181613e39565b6001600160a01b03166020929092019190915250565b614ca081614b07565b60020b8252614cb160208201614b07565b60020b60208301526040810135614cc781613e39565b6001600160a01b039081166040840152606082013590614ce682613e39565b1660608301526080818101359083015260a090810135910152565b6001600160a01b0385811682528481166020830152604082018490526103608201908335614d2e81613e39565b166060830152614d4060208401613b95565b15156080830152614d6360a08301614d5a60408601614ab1565b62ffffff169052565b614d6f60608401614ab1565b62ffffff1660c0830152614d8560808401614b07565b614d9460e084018260020b9052565b50614da160a08401614b07565b610100614db28185018360020b9052565b610120915060c08501358285015261014060e0860135818601526101608287013581870152614de2848801614b07565b93506101809250614df78387018560020b9052565b614e02828801614b07565b9350614e146101a087018560020b9052565b614e1f818801614c51565b935050506101c0614e348186018460ff169052565b6101e09250614e47838601838801614c62565b614e52818701613b95565b915050610220614e658186018315159052565b6102409150614e78828601848801614c62565b614e83818701613b95565b925050614e9561028085018315159052565b614ea56102a08501828701614c97565b505095945050505050565b608081526000614ec460808301888a6145ba565b82810360208401528581526001600160fb1b03861115614ee357600080fd5b8560051b808860208401376001600160a01b039590951660408401526001600160e01b0319939093166060909201919091525001602001949350505050565b600060208284031215614f3457600080fd5b6129a38261477c565b6000610100614f4c838b6146e7565b806080840152614f5f818401898b6145ba565b6001600160801b0388811660a0860152871660c085015283810360e08501529050614f8b818587614729565b9a9950505050505050505050565b60208152600061147160208301848661483f56fee400534da780c9d64ef8b5f03c074ff47537b6a4aa2a3e5d5455cb37b5406aa3a2646970667358221220ea96b3bd368c040e933d05ce657aa3e8d3cc0dbf5b0fc5485d371e3bf4debf4964736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000053d9780dbd3831e3a797fd215be4131636cd5fdf0000000000000000000000003575aa02ae85d8cd2aae6dcaa5d8750cfc9622e6000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c990000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b000000000000000000000000a77d2dde3847a92d57b847b59a270cdfe67f2823000000000000000000000000b01e431542bafbac3fc95057961c92ed8e06e08d00000000000000000000000060d3345c2d2fd62dbed55cf2178bdcff69d176980000000000000000000000009fad68008c8361436545a206c90af1cc480f710a000000000000000000000000bbddb992caf83388b216af8aeb8a0ac8a4bdd932
-----Decoded View---------------
Arg [0] : factory (address): 0x53d9780DbD3831E3A797Fd215be4131636cD5FDf
Arg [1] : connectorRegistry (address): 0x3575Aa02Ae85D8Cd2AaE6DCaA5D8750cFc9622e6
Arg [2] : nftSettingsRegistry_ (address): 0xc6013E57a0811C7111A8fB07ACd2E248D9489C99
Arg [3] : libraries (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 00000000000000000000000053d9780dbd3831e3a797fd215be4131636cd5fdf
Arg [1] : 0000000000000000000000003575aa02ae85d8cd2aae6dcaa5d8750cfc9622e6
Arg [2] : 000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c99
Arg [3] : 0000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b
Arg [4] : 000000000000000000000000a77d2dde3847a92d57b847b59a270cdfe67f2823
Arg [5] : 000000000000000000000000b01e431542bafbac3fc95057961c92ed8e06e08d
Arg [6] : 00000000000000000000000060d3345c2d2fd62dbed55cf2178bdcff69d17698
Arg [7] : 0000000000000000000000009fad68008c8361436545a206c90af1cc480f710a
Arg [8] : 000000000000000000000000bbddb992caf83388b216af8aeb8a0ac8a4bdd932
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.