Overview
ETH Balance
ETH Value
$0.00Latest 16 from a total of 16 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Harvest Multiple | 21466333 | 34 hrs ago | IN | 0 ETH | 0.00000186 | ||||
| Harvest Multiple | 20988965 | 6 days ago | IN | 0 ETH | 0.00000168 | ||||
| Harvest Multiple | 19638935 | 22 days ago | IN | 0 ETH | 0.00000165 | ||||
| Harvest Multiple | 19184313 | 27 days ago | IN | 0 ETH | 0.00000164 | ||||
| Harvest Multiple | 19014944 | 29 days ago | IN | 0 ETH | 0.00000135 | ||||
| Harvest Multiple | 18973949 | 30 days ago | IN | 0 ETH | 0.00000171 | ||||
| Harvest Multiple | 18809794 | 32 days ago | IN | 0 ETH | 0.00000171 | ||||
| Harvest Multiple | 16276927 | 61 days ago | IN | 0 ETH | 0.00000175 | ||||
| Harvest Multiple | 12748374 | 102 days ago | IN | 0 ETH | 0.00000164 | ||||
| Harvest Multiple | 12030318 | 110 days ago | IN | 0 ETH | 0.00000159 | ||||
| Harvest Multiple | 11674848 | 114 days ago | IN | 0 ETH | 0.00000135 | ||||
| Harvest Multiple | 11595817 | 115 days ago | IN | 0 ETH | 0.00000135 | ||||
| Harvest Multiple | 11361709 | 118 days ago | IN | 0 ETH | 0.00000278 | ||||
| Harvest Multiple | 11361686 | 118 days ago | IN | 0 ETH | 0.00000344 | ||||
| Harvest Multiple | 11322491 | 118 days ago | IN | 0 ETH | 0.00000236 | ||||
| Harvest Multiple | 11262529 | 119 days ago | IN | 0 ETH | 0.00000135 |
Latest 25 internal transactions (View All)
| Parent Transaction Hash | Block | From | To | ||||
|---|---|---|---|---|---|---|---|
| 21466333 | 34 hrs ago | 0 ETH | |||||
| 21466333 | 34 hrs ago | 0 ETH | |||||
| 21466333 | 34 hrs ago | 0 ETH | |||||
| 21466333 | 34 hrs ago | 0 ETH | |||||
| 21466333 | 34 hrs ago | 0 ETH | |||||
| 20988965 | 6 days ago | 0 ETH | |||||
| 20988965 | 6 days ago | 0 ETH | |||||
| 20988965 | 6 days ago | 0 ETH | |||||
| 20988965 | 6 days ago | 0 ETH | |||||
| 20988965 | 6 days ago | 0 ETH | |||||
| 20988965 | 6 days ago | 0 ETH | |||||
| 19638935 | 22 days ago | 0 ETH | |||||
| 19638935 | 22 days ago | 0 ETH | |||||
| 19638935 | 22 days ago | 0 ETH | |||||
| 19638935 | 22 days ago | 0 ETH | |||||
| 19638935 | 22 days ago | 0 ETH | |||||
| 19184313 | 27 days ago | 0 ETH | |||||
| 19184313 | 27 days ago | 0 ETH | |||||
| 19184313 | 27 days ago | 0 ETH | |||||
| 19184313 | 27 days ago | 0 ETH | |||||
| 19184313 | 27 days ago | 0 ETH | |||||
| 19014944 | 29 days ago | 0 ETH | |||||
| 19014944 | 29 days ago | 0 ETH | |||||
| 19014944 | 29 days ago | 0 ETH | |||||
| 19014944 | 29 days ago | 0 ETH |
Cross-Chain Transactions
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { IFarmConnector } from "contracts/interfaces/IFarmConnector.sol";
import { INftFarmConnector } from "contracts/interfaces/INftFarmConnector.sol";
import { Farm } from "contracts/structs/FarmStrategyStructs.sol";
import { NftPosition } from "contracts/structs/NftFarmStrategyStructs.sol";
import {
StrategyModule,
SickleFactory,
Sickle
} from "contracts/modules/StrategyModule.sol";
import { ConnectorRegistry } from "contracts/ConnectorRegistry.sol";
import { IZapLib } from "contracts/interfaces/libraries/IZapLib.sol";
import { INftZapLib } from "contracts/interfaces/libraries/INftZapLib.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 { FarmStrategyEvents } from "contracts/events/FarmStrategyEvents.sol";
import { NftFarmStrategyEvents } from
"contracts/events/NftFarmStrategyEvents.sol";
import {
ClaimParams,
NftClaimParams,
MultiCompoundParams,
NftMultiCompoundParams,
MultiHarvestParams
} from "contracts/structs/MultiFarmStrategyStructs.sol";
library MultiFarmStrategyFees {
bytes4 constant Harvest = bytes4(keccak256("FarmHarvestFee"));
bytes4 constant Compound = bytes4(keccak256("FarmCompoundFee"));
}
contract MultiFarmStrategy is
StrategyModule,
FarmStrategyEvents,
NftFarmStrategyEvents
{
struct Libraries {
ITransferLib transferLib;
ISwapLib swapLib;
IFeesLib feesLib;
IZapLib zapLib;
INftZapLib nftZapLib;
}
ITransferLib public immutable transferLib;
ISwapLib public immutable swapLib;
IFeesLib public immutable feesLib;
IZapLib public immutable zapLib;
INftZapLib public immutable nftZapLib;
address public immutable strategyAddress;
constructor(
SickleFactory factory,
ConnectorRegistry connectorRegistry,
Libraries memory libraries
) StrategyModule(factory, connectorRegistry) {
strategyAddress = address(this);
transferLib = libraries.transferLib;
swapLib = libraries.swapLib;
feesLib = libraries.feesLib;
zapLib = libraries.zapLib;
nftZapLib = libraries.nftZapLib;
}
/* External Functions */
/**
* @notice Compound multiple ERC20 and/or NFT farms into a single ERC20 farm
* @param params The parameters for the compound operation
* @param sweepTokens The tokens to sweep after the compound operation
*/
function compoundMultiple(
MultiCompoundParams calldata params,
address[] memory sweepTokens
) external {
Sickle sickle = getSickle(msg.sender);
_harvestErc20Positions(sickle, params.claims);
_harvestNftPositions(sickle, params.nftClaims);
address[] memory targets = new address[](4);
bytes[] memory data = new bytes[](4);
targets[0] = address(feesLib);
data[0] = abi.encodeCall(
IFeesLib.chargeFees,
(
strategyAddress,
MultiFarmStrategyFees.Compound,
params.rewardTokens
)
);
targets[1] = address(zapLib);
data[1] = abi.encodeCall(IZapLib.zapIn, (params.zap));
address depositFarmConnector =
connectorRegistry.connectorOf(params.depositFarm.stakingContract);
targets[2] = depositFarmConnector;
data[2] = abi.encodeCall(
IFarmConnector.deposit,
(
params.depositFarm,
params.zap.addLiquidityParams.lpToken,
params.depositExtraData
)
);
targets[3] = address(transferLib);
data[3] =
abi.encodeCall(ITransferLib.transferTokensToUser, (sweepTokens));
sickle.multicall(targets, data);
_emitCompoundEvents(
sickle, params.depositFarm, params.claims, params.nftClaims
);
}
/**
* @notice Compound multiple ERC20 and/or NFT farms into a single NFT farm
* @param params The parameters for the compound operation
* @param sweepTokens The tokens to sweep after the compound operation
*/
function nftCompoundMultiple(
NftMultiCompoundParams calldata params,
address[] calldata sweepTokens
) external {
Sickle sickle = getSickle(msg.sender);
_harvestErc20Positions(sickle, params.claims);
_harvestNftPositions(sickle, params.nftClaims);
if (!params.compoundInPlace) {
_withdrawNft(
sickle, params.depositPosition, params.depositExtraData
);
}
address[] memory targets = new address[](3);
bytes[] memory data = new bytes[](3);
targets[0] = address(feesLib);
data[0] = abi.encodeCall(
IFeesLib.chargeFees,
(
strategyAddress,
MultiFarmStrategyFees.Compound,
params.rewardTokens
)
);
targets[1] = address(nftZapLib);
data[1] = abi.encodeCall(INftZapLib.zapIn, (params.zap));
targets[2] = address(transferLib);
data[2] =
abi.encodeCall(ITransferLib.transferTokensToUser, (sweepTokens));
sickle.multicall(targets, data);
if (!params.compoundInPlace) {
_depositNft(sickle, params.depositPosition, params.depositExtraData);
}
_emitCompoundEvents(
sickle, params.depositPosition.farm, params.claims, params.nftClaims
);
}
/**
* @notice Harvest multiple ERC20 and/or NFT farms
* @param params The parameters for the harvest operation
* @param sweepTokens The tokens to sweep after the harvest operation
*/
function harvestMultiple(
MultiHarvestParams calldata params,
address[] memory sweepTokens
) public {
Sickle sickle = getSickle(msg.sender);
_harvestErc20Positions(sickle, params.claims);
_harvestNftPositions(sickle, params.nftClaims);
address[] memory targets = new address[](3);
bytes[] memory data = new bytes[](3);
targets[0] = address(swapLib);
data[0] = abi.encodeCall(ISwapLib.swapMultiple, (params.swaps));
targets[1] = address(feesLib);
data[1] = abi.encodeCall(
IFeesLib.chargeFees,
(strategyAddress, MultiFarmStrategyFees.Harvest, params.tokensOut)
);
targets[2] = address(transferLib);
data[2] =
abi.encodeCall(ITransferLib.transferTokensToUser, (sweepTokens));
sickle.multicall(targets, data);
_emitHarvestEvents(sickle, params.claims, params.nftClaims);
}
/* Private Functions */
function _harvestErc20Positions(
Sickle sickle,
ClaimParams[] calldata params
) private {
uint256 arrayLength = params.length;
address[] memory targets = new address[](arrayLength);
bytes[] memory data = new bytes[](arrayLength);
for (uint256 i; i < arrayLength;) {
ClaimParams calldata claim = params[i];
address farmConnector =
connectorRegistry.connectorOf(claim.claimFarm.stakingContract);
targets[i] = farmConnector;
data[i] = abi.encodeCall(
IFarmConnector.claim, (claim.claimFarm, claim.claimExtraData)
);
unchecked {
++i;
}
}
sickle.multicall(targets, data);
}
function _harvestNftPositions(
Sickle sickle,
NftClaimParams[] calldata params
) private {
uint256 arrayLength = params.length;
address[] memory targets = new address[](arrayLength);
bytes[] memory data = new bytes[](arrayLength);
for (uint256 i; i < arrayLength;) {
NftClaimParams calldata claim = params[i];
address farmConnector = connectorRegistry.connectorOf(
claim.position.farm.stakingContract
);
targets[i] = farmConnector;
data[i] = abi.encodeCall(
INftFarmConnector.claim,
(
claim.position,
claim.harvest.rewardTokens,
claim.harvest.amount0Max,
claim.harvest.amount1Max,
claim.harvest.extraData
)
);
unchecked {
++i;
}
}
sickle.multicall(targets, data);
}
function _withdrawNft(
Sickle sickle,
NftPosition calldata 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.withdrawNft, (position, extraData));
sickle.multicall(targets, data);
emit SickleWithdrewNft(
sickle,
position.nft,
position.tokenId,
position.farm.stakingContract,
position.farm.poolIndex
);
}
function _depositNft(
Sickle sickle,
NftPosition calldata 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 _emitHarvestEvents(
Sickle sickle,
ClaimParams[] calldata claims,
NftClaimParams[] calldata nftClaims
) private {
for (uint256 i = 0; i < claims.length;) {
emit SickleHarvested(
sickle,
claims[i].claimFarm.stakingContract,
claims[i].claimFarm.poolIndex
);
unchecked {
++i;
}
}
for (uint256 i = 0; i < nftClaims.length;) {
emit SickleHarvestedNft(
sickle,
nftClaims[i].position.nft,
nftClaims[i].position.tokenId,
nftClaims[i].position.farm.stakingContract,
nftClaims[i].position.farm.poolIndex
);
unchecked {
++i;
}
}
}
function _emitCompoundEvents(
Sickle sickle,
Farm calldata depositFarm,
ClaimParams[] calldata claims,
NftClaimParams[] calldata nftClaims
) private {
for (uint256 i = 0; i < claims.length;) {
emit SickleCompounded(
sickle,
claims[i].claimFarm.stakingContract,
claims[i].claimFarm.poolIndex,
depositFarm.stakingContract,
depositFarm.poolIndex
);
unchecked {
++i;
}
}
for (uint256 i = 0; i < nftClaims.length;) {
emit SickleCompoundedNft(
sickle,
nftClaims[i].position.nft,
nftClaims[i].position.tokenId,
depositFarm.stakingContract,
depositFarm.poolIndex
);
unchecked {
++i;
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { Farm } from "contracts/structs/FarmStrategyStructs.sol";
interface IFarmConnector {
function deposit(
Farm calldata farm,
address token,
bytes memory extraData
) external payable;
function withdraw(
Farm calldata farm,
uint256 amount,
bytes memory extraData
) external;
function claim(Farm calldata farm, bytes memory extraData) external;
function balanceOf(
Farm calldata farm,
address user
) external view returns (uint256);
function earned(
Farm calldata farm,
address user,
address[] calldata rewardTokens
) external view returns (uint256[] memory);
function isStaked(
Farm calldata farm,
address user
) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { NftPosition } from "contracts/structs/NftFarmStrategyStructs.sol";
interface INftFarmConnector {
function depositExistingNft(
NftPosition calldata position,
bytes calldata extraData
) external payable;
function withdrawNft(
NftPosition calldata position,
bytes calldata extraData
) external payable;
// Payable in case an NFT is withdrawn to be increased with ETH
function claim(
NftPosition calldata position,
address[] memory rewardTokens,
uint128 maxAmount0, // For collecting
uint128 maxAmount1,
bytes calldata extraData
) external payable;
function earned(
address user,
NftPosition calldata position,
address[] memory rewardTokens
) external view returns (uint256[] memory);
function isStaked(
address user,
NftPosition calldata position
) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { ZapIn, ZapOut } from "contracts/structs/ZapStructs.sol";
import { SwapParams } from "contracts/structs/SwapStructs.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/SwapStructs.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 { 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);
error CustomRegistryAlreadyRegistered();
interface ICustomConnectorRegistry {
function connectorOf(
address target
) external view returns (address);
}
contract ConnectorRegistry is Admin, TimelockAdmin {
event ConnectorChanged(address target, address connector);
event CustomRegistryAdded(address registry);
event CustomRegistryRemoved(address registry);
error ConnectorAlreadySet(address target);
error ConnectorNotSet(address target);
error ArrayLengthMismatch();
ICustomConnectorRegistry[] public customRegistries;
mapping(address target => address connector) private connectors_;
constructor(
address admin_,
address timelockAdmin_
) Admin(admin_) TimelockAdmin(timelockAdmin_) { }
/// Admin functions
/// @notice Update connector addresses for a batch of targets.
/// @dev Controls which connector contracts are used for the specified
/// targets.
/// @custom:access Restricted to protocol admin.
function setConnectors(
address[] calldata targets,
address[] calldata connectors
) external onlyAdmin {
if (targets.length != connectors.length) {
revert ArrayLengthMismatch();
}
for (uint256 i; i != targets.length;) {
if (connectors_[targets[i]] != address(0)) {
revert ConnectorAlreadySet(targets[i]);
}
connectors_[targets[i]] = connectors[i];
emit ConnectorChanged(targets[i], connectors[i]);
unchecked {
++i;
}
}
}
function updateConnectors(
address[] calldata targets,
address[] calldata connectors
) external onlyTimelockAdmin {
if (targets.length != connectors.length) {
revert ArrayLengthMismatch();
}
for (uint256 i; i != targets.length;) {
if (connectors_[targets[i]] == address(0)) {
revert ConnectorNotSet(targets[i]);
}
connectors_[targets[i]] = connectors[i];
emit ConnectorChanged(targets[i], connectors[i]);
unchecked {
++i;
}
}
}
/// @notice Append an address to the custom registries list.
/// @custom:access Restricted to protocol admin.
function addCustomRegistry(
ICustomConnectorRegistry registry
) external onlyAdmin {
if (isCustomRegistry(registry)) {
revert CustomRegistryAlreadyRegistered();
}
customRegistries.push(registry);
emit CustomRegistryAdded(address(registry));
}
/// @notice Replace an address in the custom registries list.
/// @custom:access Restricted to protocol admin.
function updateCustomRegistry(
uint256 index,
ICustomConnectorRegistry newRegistry
) external onlyTimelockAdmin {
ICustomConnectorRegistry oldRegistry = customRegistries[index];
emit CustomRegistryRemoved(address(oldRegistry));
customRegistries[index] = newRegistry;
if (address(newRegistry) != address(0)) {
emit CustomRegistryAdded(address(newRegistry));
}
}
/// Public functions
function connectorOf(
address target
) external view returns (address) {
address connector = _getConnector(target);
if (connector != address(0)) {
return connector;
}
revert ConnectorNotRegistered(target);
}
function hasConnector(
address target
) external view returns (bool) {
return _getConnector(target) != address(0);
}
function isCustomRegistry(
ICustomConnectorRegistry registry
) public view returns (bool) {
for (uint256 i; i != customRegistries.length;) {
if (address(customRegistries[i]) == address(registry)) {
return true;
}
unchecked {
++i;
}
}
return false;
}
/// Internal functions
function _getConnector(
address target
) internal view returns (address) {
address connector = connectors_[target];
if (connector != address(0)) {
return connector;
}
uint256 length = customRegistries.length;
for (uint256 i; i != length;) {
if (address(customRegistries[i]) != address(0)) {
(bool success, bytes memory data) = address(customRegistries[i])
.staticcall(
abi.encodeWithSelector(
ICustomConnectorRegistry.connectorOf.selector, target
)
);
if (success && data.length == 32) {
address _connector = abi.decode(data, (address));
if (_connector != address(0)) {
return _connector;
}
}
}
unchecked {
++i;
}
}
return address(0);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { 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;
import { NftZapIn, NftZapOut } from "contracts/structs/NftZapStructs.sol";
interface INftZapLib {
function zapIn(
NftZapIn memory zap
) external payable;
function zapOut(
NftZapOut memory zap
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { Sickle } from "contracts/Sickle.sol";
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 DuplicateTokenIn();
error TokenOutRequired();
error IncompatibleEthTokens();
function transferTokenToUser(
address token
) external payable;
function transferTokensToUser(
address[] memory tokens
) external payable;
function transferTokenFromUser(
address tokenIn,
uint256 amountIn,
address strategy,
bytes4 feeSelector
) external payable;
function transferTokensFromUser(
address[] memory tokensIn,
uint256[] memory amountsIn,
address strategy,
bytes4 feeSelector
) external payable;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { SwapParams } from "contracts/structs/SwapStructs.sol";
interface ISwapLib {
function swap(
SwapParams memory swap
) external payable;
function swapMultiple(
SwapParams[] memory swaps
) external payable;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { Sickle } from "contracts/Sickle.sol";
abstract contract FarmStrategyEvents {
event SickleDeposited(
Sickle indexed sickle,
address indexed stakingContract,
uint256 indexed poolIndex
);
event SickleHarvested(
Sickle indexed sickle,
address indexed stakingContract,
uint256 indexed poolIndex
);
event SickleCompounded(
Sickle indexed sickle,
address indexed claimStakingContract,
uint256 claimPoolIndex,
address indexed depositStakingContract,
uint256 depositPoolIndex
);
event SickleWithdrawn(
Sickle indexed sickle,
address indexed stakingContract,
uint256 indexed poolIndex
);
event SickleExited(
Sickle indexed sickle,
address indexed stakingContract,
uint256 indexed poolIndex
);
}// 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 { Farm } from "contracts/structs/FarmStrategyStructs.sol";
import { ZapIn } from "contracts/structs/ZapStructs.sol";
import {
NftPosition,
SimpleNftHarvest
} from "contracts/structs/NftFarmStrategyStructs.sol";
import { SwapParams } from "contracts/structs/SwapStructs.sol";
import { NftZapIn } from "contracts/structs/NftZapStructs.sol";
struct ClaimParams {
Farm claimFarm;
bytes claimExtraData;
}
struct NftClaimParams {
NftPosition position;
SimpleNftHarvest harvest;
}
struct MultiCompoundParams {
ClaimParams[] claims;
NftClaimParams[] nftClaims;
address[] rewardTokens;
ZapIn zap;
Farm depositFarm;
bytes depositExtraData;
}
struct NftMultiCompoundParams {
ClaimParams[] claims;
NftClaimParams[] nftClaims;
address[] rewardTokens;
NftZapIn zap;
NftPosition depositPosition;
bytes depositExtraData;
bool compoundInPlace;
}
struct MultiHarvestParams {
ClaimParams[] claims;
NftClaimParams[] nftClaims;
SwapParams[] swaps;
address[] tokensOut;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { SwapParams } from "contracts/structs/SwapStructs.sol";
import {
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;
struct SwapParams {
address tokenApproval;
address router;
uint256 amountIn;
uint256 desiredAmountOut;
uint256 minAmountOut;
address tokenIn;
address tokenOut;
bytes extraData;
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Pool state that never changes
/// @notice These parameters are fixed for a pool forever, i.e., the methods
/// will always return the same values
interface IUniswapV3PoolImmutables {
/// @notice The contract that deployed the pool, which must adhere to the
/// IUniswapV3Factory interface
/// @return The contract address
function factory() external view returns (address);
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract address
function token1() external view returns (address);
/// @notice The pool's fee in hundredths of a bip, i.e. 1e-6
/// @return The fee
function fee() external view returns (uint24);
/// @notice The pool tick spacing
/// @dev Ticks can only be used at multiples of this value, minimum of 1 and
/// always positive
/// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick,
/// i.e., ..., -6, -3, 0, 3, 6, ...
/// This value is an int24 to avoid casting even though it is always
/// positive.
/// @return The tick spacing
function tickSpacing() external view returns (int24);
/// @notice The maximum amount of position liquidity that can use any tick
/// in the range
/// @dev This parameter is enforced per tick to prevent liquidity from
/// overflowing a uint128 at any point, and
/// also prevents out-of-range liquidity from being used to prevent adding
/// in-range liquidity to a pool
/// @return The max amount of liquidity per tick
function maxLiquidityPerTick() external view returns (uint128);
}
/// @title Pool state that can change
/// @notice These methods compose the pool's state, and can change with any
/// frequency including multiple times
/// per transaction
interface IUniswapV3PoolState {
/// @notice The 0th storage slot in the pool stores many values, and is
/// exposed as a single method to save gas
/// when accessed externally.
/// @return sqrtPriceX96 The current price of the pool as a
/// sqrt(token1/token0) Q64.96 value
/// @return tick The current tick of the pool, i.e. according to the last
/// tick transition that was run.
/// This value may not always be equal to
/// SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick
/// boundary.
/// @return observationIndex The index of the last oracle observation that
/// was written,
/// @return observationCardinality The current maximum number of
/// observations stored in the pool,
/// @return observationCardinalityNext The next maximum number of
/// observations, to be updated when the observation.
/// @return feeProtocol The protocol fee for both tokens of the pool.
/// Encoded as two 4 bit values, where the protocol fee of token1 is shifted
/// 4 bits and the protocol fee of token0
/// is the lower 4 bits. Used as the denominator of a fraction of the swap
/// fee, e.g. 4 means 1/4th of the swap fee.
/// unlocked Whether the pool is currently locked to reentrancy
function slot0()
external
view
returns (
uint160 sqrtPriceX96,
int24 tick,
uint16 observationIndex,
uint16 observationCardinality,
uint16 observationCardinalityNext,
uint8 feeProtocol,
bool unlocked
);
/// @notice The fee growth as a Q128.128 fees of token0 collected per unit
/// of liquidity for the entire life of the pool
/// @dev This value can overflow the uint256
function feeGrowthGlobal0X128() external view returns (uint256);
/// @notice The fee growth as a Q128.128 fees of token1 collected per unit
/// of liquidity for the entire life of the pool
/// @dev This value can overflow the uint256
function feeGrowthGlobal1X128() external view returns (uint256);
/// @notice The amounts of token0 and token1 that are owed to the protocol
/// @dev Protocol fees will never exceed uint128 max in either token
function protocolFees()
external
view
returns (uint128 token0, uint128 token1);
/// @notice The currently in range liquidity available to the pool
/// @dev This value has no relationship to the total liquidity across all
/// ticks
/// @return The liquidity at the current price of the pool
function liquidity() external view returns (uint128);
/// @notice Look up information about a specific tick in the pool
/// @param tick The tick to look up
/// @return liquidityGross the total amount of position liquidity that uses
/// the pool either as tick lower or
/// tick upper
/// @return liquidityNet how much liquidity changes when the pool price
/// crosses the tick,
/// @return feeGrowthOutside0X128 the fee growth on the other side of the
/// tick from the current tick in token0,
/// @return feeGrowthOutside1X128 the fee growth on the other side of the
/// tick from the current tick in token1,
/// @return tickCumulativeOutside the cumulative tick value on the other
/// side of the tick from the current tick
/// @return secondsPerLiquidityOutsideX128 the seconds spent per liquidity
/// on the other side of the tick from the current tick,
/// @return secondsOutside the seconds spent on the other side of the tick
/// from the current tick,
/// @return initialized Set to true if the tick is initialized, i.e.
/// liquidityGross is greater than 0, otherwise equal to false.
/// Outside values can only be used if the tick is initialized, i.e. if
/// liquidityGross is greater than 0.
/// In addition, these values are only relative and must be used only in
/// comparison to previous snapshots for
/// a specific position.
function ticks(
int24 tick
)
external
view
returns (
uint128 liquidityGross,
int128 liquidityNet,
uint256 feeGrowthOutside0X128,
uint256 feeGrowthOutside1X128,
int56 tickCumulativeOutside,
uint160 secondsPerLiquidityOutsideX128,
uint32 secondsOutside,
bool initialized
);
/// @notice Returns 256 packed tick initialized boolean values. See
/// TickBitmap for more information
function tickBitmap(
int16 wordPosition
) external view returns (uint256);
/// @notice Returns the information about a position by the position's key
/// @param key The position's key is a hash of a preimage composed by the
/// owner, tickLower and tickUpper
/// @return liquidity The amount of liquidity in the position,
/// @return feeGrowthInside0LastX128 fee growth of token0 inside the tick
/// range as of the last mint/burn/poke,
/// @return feeGrowthInside1LastX128 fee growth of token1 inside the tick
/// range as of the last mint/burn/poke,
/// @return tokensOwed0 the computed amount of token0 owed to the position
/// as of the last mint/burn/poke,
/// @return tokensOwed1 the computed amount of token1 owed to the position
/// as of the last mint/burn/poke
function positions(
bytes32 key
)
external
view
returns (
uint128 liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);
/// @notice Returns data about a specific observation index
/// @param index The element of the observations array to fetch
/// @dev You most likely want to use #observe() instead of this method to
/// get an observation as of some amount of time
/// ago, rather than at a specific index in the array.
/// @return blockTimestamp The timestamp of the observation,
/// @return tickCumulative the tick multiplied by seconds elapsed for the
/// life of the pool as of the observation timestamp,
/// @return secondsPerLiquidityCumulativeX128 the seconds per in range
/// liquidity for the life of the pool as of the observation timestamp,
/// @return initialized whether the observation has been initialized and the
/// values are safe to use
function observations(
uint256 index
)
external
view
returns (
uint32 blockTimestamp,
int56 tickCumulative,
uint160 secondsPerLiquidityCumulativeX128,
bool initialized
);
}
interface IUniswapV3Pool is IUniswapV3PoolImmutables, IUniswapV3PoolState {
function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IERC721Enumerable } from
"openzeppelin-contracts/contracts/interfaces/IERC721Enumerable.sol";
interface INonfungiblePositionManager is IERC721Enumerable {
struct IncreaseLiquidityParams {
uint256 tokenId;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}
struct MintParams {
address token0;
address token1;
uint24 fee;
int24 tickLower;
int24 tickUpper;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
address recipient;
uint256 deadline;
}
struct DecreaseLiquidityParams {
uint256 tokenId;
uint128 liquidity;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}
struct CollectParams {
uint256 tokenId;
address recipient;
uint128 amount0Max;
uint128 amount1Max;
}
function increaseLiquidity(
IncreaseLiquidityParams memory params
)
external
payable
returns (uint256 amount0, uint256 amount1, uint256 liquidity);
function decreaseLiquidity(
DecreaseLiquidityParams calldata params
) external payable returns (uint256 amount0, uint256 amount1);
function mint(
MintParams memory params
)
external
payable
returns (uint256 tokenId, uint256 amount0, uint256 amount1);
function collect(
CollectParams calldata params
) external payable returns (uint256 amount0, uint256 amount1);
function burn(
uint256 tokenId
) external payable;
function positions(
uint256 tokenId
)
external
view
returns (
uint96 nonce,
address operator,
address token0,
address token1,
uint24 fee,
int24 tickLower,
int24 tickUpper,
uint128 liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);
function factory() external view returns (address);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { SwapParams } from "contracts/structs/SwapStructs.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 { Clones } from "@openzeppelin/contracts/proxy/Clones.sol";
import { Sickle } from "contracts/Sickle.sol";
import { SickleRegistry } from "contracts/SickleRegistry.sol";
import { Admin } from "contracts/base/Admin.sol";
/// @title SickleFactory contract
/// @author vfat.tools
/// @notice Factory deploying new Sickle contracts
contract SickleFactory is Admin {
/// EVENTS ///
/// @notice Emitted when a new Sickle contract is deployed
/// @param admin Address receiving the admin rights of the Sickle contract
/// @param sickle Address of the newly deployed Sickle contract
event Deploy(address indexed admin, address sickle);
/// @notice Thrown when the caller is not whitelisted
/// @param caller Address of the non-whitelisted caller
error CallerNotWhitelisted(address caller); // 0x252c8273
/// @notice Thrown when the factory is not active and a deploy is attempted
error NotActive(); // 0x80cb55e2
/// @notice Thrown when a Sickle contract is already deployed for a user
error SickleAlreadyDeployed(); //0xf6782ef1
/// STORAGE ///
mapping(address => address) private _sickles;
mapping(address => address) private _admins;
mapping(address => bytes32) public _referralCodes;
/// @notice Address of the SickleRegistry contract
SickleRegistry public immutable registry;
/// @notice Address of the Sickle implementation contract
address public immutable implementation;
/// @notice Address of the previous SickleFactory contract (if applicable)
SickleFactory public immutable previousFactory;
/// @notice Whether the factory is active (can deploy new Sickle contracts)
bool public isActive = true;
/// WRITE FUNCTIONS ///
/// @param admin_ Address of the admin
/// @param sickleRegistry_ Address of the SickleRegistry contract
/// @param sickleImplementation_ Address of the Sickle implementation
/// contract
/// @param previousFactory_ Address of the previous SickleFactory contract
/// if applicable
constructor(
address admin_,
address sickleRegistry_,
address sickleImplementation_,
address previousFactory_
) Admin(admin_) {
registry = SickleRegistry(sickleRegistry_);
implementation = sickleImplementation_;
previousFactory = SickleFactory(previousFactory_);
}
function setActive(
bool active
) external onlyAdmin {
isActive = active;
}
function _deploy(
address admin,
address approved,
bytes32 referralCode
) internal returns (address sickle) {
sickle = Clones.cloneDeterministic(
implementation, keccak256(abi.encode(admin))
);
Sickle(payable(sickle)).initialize(admin, approved);
_sickles[admin] = sickle;
_admins[sickle] = admin;
if (referralCode != bytes32(0)) {
_referralCodes[sickle] = referralCode;
}
emit Deploy(admin, sickle);
}
function _getSickle(
address admin
) internal returns (address sickle) {
sickle = _sickles[admin];
if (sickle != address(0)) {
return sickle;
}
if (address(previousFactory) != address(0)) {
sickle = previousFactory.sickles(admin);
if (sickle != address(0)) {
_sickles[admin] = sickle;
_admins[sickle] = admin;
_referralCodes[sickle] = previousFactory.referralCodes(sickle);
return sickle;
}
}
}
/// @notice Predict the address of a Sickle contract for a specific user
/// @param admin Address receiving the admin rights of the Sickle contract
/// @return sickle Address of the predicted Sickle contract
function predict(
address admin
) external view returns (address) {
bytes32 salt = keccak256(abi.encode(admin));
return Clones.predictDeterministicAddress(implementation, salt);
}
/// @notice Returns the Sickle contract for a specific user
/// @param admin Address that owns the Sickle contract
/// @return sickle Address of the Sickle contract
function sickles(
address admin
) external view returns (address sickle) {
sickle = _sickles[admin];
if (sickle == address(0) && address(previousFactory) != address(0)) {
sickle = previousFactory.sickles(admin);
}
}
/// @notice Returns the admin for a specific Sickle contract
/// @param sickle Address of the Sickle contract
/// @return admin Address that owns the Sickle contract
function admins(
address sickle
) external view returns (address admin) {
admin = _admins[sickle];
if (admin == address(0) && address(previousFactory) != address(0)) {
admin = previousFactory.admins(sickle);
}
}
/// @notice Returns the referral code for a specific Sickle contract
/// @param sickle Address of the Sickle contract
/// @return referralCode Referral code for the user
function referralCodes(
address sickle
) external view returns (bytes32 referralCode) {
referralCode = _referralCodes[sickle];
if (
referralCode == bytes32(0) && address(previousFactory) != address(0)
) {
referralCode = previousFactory.referralCodes(sickle);
}
}
/// @notice Deploys a new Sickle contract for a specific user, or returns
/// the existing one if it exists
/// @param admin Address receiving the admin rights of the Sickle contract
/// @param approved Address approved to manage automation
/// @param referralCode Referral code for the user
/// @return sickle Address of the deployed Sickle contract
function getOrDeploy(
address admin,
address approved,
bytes32 referralCode
) external returns (address sickle) {
if (!isActive) {
revert NotActive();
}
if (!registry.isWhitelistedCaller(msg.sender)) {
revert CallerNotWhitelisted(msg.sender);
}
if ((sickle = _getSickle(admin)) != address(0)) {
return sickle;
}
return _deploy(admin, approved, referralCode);
}
/// @notice Deploys a new Sickle contract for a specific user
/// @dev Sickle contracts are deployed with create2, the address of the
/// admin is used as a salt, so all the Sickle addresses can be pre-computed
/// and only 1 Sickle will exist per address
/// @param approved Address approved to manage automation
/// @param referralCode Referral code for the user
/// @return sickle Address of the deployed Sickle contract
function deploy(
address approved,
bytes32 referralCode
) external returns (address sickle) {
if (!isActive) {
revert NotActive();
}
if (_getSickle(msg.sender) != address(0)) {
revert SickleAlreadyDeployed();
}
return _deploy(msg.sender, approved, referralCode);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { Sickle } from "contracts/Sickle.sol";
import { SickleFactory } from "contracts/SickleFactory.sol";
contract AccessControlModule {
SickleFactory public immutable factory;
error NotOwner(address sender); // 30cd7471
error NotApproved();
error SickleNotDeployed();
error NotRegisteredSickle();
constructor(
SickleFactory factory_
) {
factory = factory_;
}
modifier onlyRegisteredSickle() {
if (factory.admins(address(this)) == address(0)) {
revert NotRegisteredSickle();
}
_;
}
// @dev allow access only to the sickle's owner or addresses approved by him
// to use only for functions such as claiming rewards or compounding rewards
modifier onlyApproved(
Sickle sickle
) {
// Here we check if the Sickle was really deployed, this gives use the
// guarantee that the contract that we are going to call is genuine
if (factory.admins(address(sickle)) == address(0)) {
revert SickleNotDeployed();
}
if (sickle.approved() != msg.sender) revert NotApproved();
_;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
/// @title Admin contract
/// @author vfat.tools
/// @notice Provides an administration mechanism allowing restricted functions
abstract contract Admin {
/// ERRORS ///
/// @notice Thrown when the caller is not the admin
error NotAdminError(); //0xb5c42b3b
/// EVENTS ///
/// @notice Emitted when a new admin is set
/// @param oldAdmin Address of the old admin
/// @param newAdmin Address of the new admin
event AdminSet(address oldAdmin, address newAdmin);
/// STORAGE ///
/// @notice Address of the current admin
address public admin;
/// MODIFIERS ///
/// @dev Restricts a function to the admin
modifier onlyAdmin() {
if (msg.sender != admin) revert NotAdminError();
_;
}
/// WRITE FUNCTIONS ///
/// @param admin_ Address of the admin
constructor(
address admin_
) {
emit AdminSet(address(0), admin_);
admin = admin_;
}
/// @notice Sets a new admin
/// @param newAdmin Address of the new admin
/// @custom:access Restricted to protocol admin.
function setAdmin(
address newAdmin
) external onlyAdmin {
emit AdminSet(admin, newAdmin);
admin = newAdmin;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
/// @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
pragma solidity ^0.8.17;
import { SickleStorage } from "contracts/base/SickleStorage.sol";
import { Multicall } from "contracts/base/Multicall.sol";
import { SickleRegistry } from "contracts/SickleRegistry.sol";
/// @title Sickle contract
/// @author vfat.tools
/// @notice Sickle facilitates farming and interactions with Masterchef
/// contracts
/// @dev Base contract inheriting from all the other "manager" contracts
contract Sickle is SickleStorage, Multicall {
/// @notice Function to receive ETH
receive() external payable { }
/// @param sickleRegistry_ Address of the SickleRegistry contract
constructor(
SickleRegistry sickleRegistry_
) Multicall(sickleRegistry_) {
_disableInitializers();
}
/// @param sickleOwner_ Address of the Sickle owner
function initialize(
address sickleOwner_,
address approved_
) external initializer {
SickleStorage._initializeSickleStorage(sickleOwner_, approved_);
}
/// INTERNALS ///
function onERC721Received(
address, // operator
address, // from
uint256, // tokenId
bytes calldata // data
) external pure returns (bytes4) {
return this.onERC721Received.selector;
}
function onERC1155Received(
address, // operator
address, // from
uint256, // id
uint256, // value
bytes calldata // data
) external pure returns (bytes4) {
return this.onERC1155Received.selector;
}
function onERC1155BatchReceived(
address, // operator
address, // from
uint256[] calldata, // ids
uint256[] calldata, // values
bytes calldata // data
) external pure returns (bytes4) {
return this.onERC1155BatchReceived.selector;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
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;
}// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../token/ERC721/extensions/IERC721Enumerable.sol";
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { INonfungiblePositionManager } from
"contracts/interfaces/external/uniswap/INonfungiblePositionManager.sol";
struct Pool {
address token0;
address token1;
uint24 fee;
}
struct NftPoolKey {
address poolAddress;
bytes32 poolId;
}
struct NftPoolInfo {
address token0;
address token1;
uint24 fee;
uint24 tickSpacing;
uint160 sqrtPriceX96;
int24 tick;
uint128 liquidity;
uint256 feeGrowthGlobal0X128;
uint256 feeGrowthGlobal1X128;
}
// Maintained for backwards compatibility with NftSettingsRegistry
struct NftPositionInfo {
uint128 liquidity;
int24 tickLower;
int24 tickUpper;
}
struct NftAddLiquidity {
INonfungiblePositionManager nft;
uint256 tokenId;
Pool pool;
int24 tickLower;
int24 tickUpper;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
bytes extraData;
}
struct NftRemoveLiquidity {
INonfungiblePositionManager nft;
uint256 tokenId;
uint128 liquidity;
uint256 amount0Min; // For decreasing
uint256 amount1Min;
uint128 amount0Max; // For collecting
uint128 amount1Max;
bytes extraData;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (proxy/Clones.sol)
pragma solidity ^0.8.0;
/**
* @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for
* deploying minimal proxy contracts, also known as "clones".
*
* > To simply and cheaply clone contract functionality in an immutable way, this standard specifies
* > a minimal bytecode implementation that delegates all calls to a known, fixed address.
*
* The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`
* (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the
* deterministic method.
*
* _Available since v3.4._
*/
library Clones {
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
*
* This function uses the create opcode, which should never revert.
*/
function clone(address implementation) internal returns (address instance) {
/// @solidity memory-safe-assembly
assembly {
// Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
// of the `implementation` address with the bytecode before the address.
mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
// Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
instance := create(0, 0x09, 0x37)
}
require(instance != address(0), "ERC1167: create failed");
}
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
*
* This function uses the create2 opcode and a `salt` to deterministically deploy
* the clone. Using the same `implementation` and `salt` multiple time will revert, since
* the clones cannot be deployed twice at the same address.
*/
function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {
/// @solidity memory-safe-assembly
assembly {
// Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
// of the `implementation` address with the bytecode before the address.
mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
// Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
instance := create2(0, 0x09, 0x37, salt)
}
require(instance != address(0), "ERC1167: create2 failed");
}
/**
* @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
*/
function predictDeterministicAddress(
address implementation,
bytes32 salt,
address deployer
) internal pure returns (address predicted) {
/// @solidity memory-safe-assembly
assembly {
let ptr := mload(0x40)
mstore(add(ptr, 0x38), deployer)
mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)
mstore(add(ptr, 0x14), implementation)
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)
mstore(add(ptr, 0x58), salt)
mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))
predicted := keccak256(add(ptr, 0x43), 0x55)
}
}
/**
* @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
*/
function predictDeterministicAddress(address implementation, bytes32 salt)
internal
view
returns (address predicted)
{
return predictDeterministicAddress(implementation, salt, address(this));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { Admin } from "contracts/base/Admin.sol";
library SickleRegistryEvents {
event CollectorChanged(address newCollector);
event FeesUpdated(bytes32[] feeHashes, uint256[] feesInBP);
event ReferralCodeCreated(bytes32 indexed code, address indexed referrer);
// Multicall caller and target whitelist status changes
event CallerStatusChanged(address caller, bool isWhitelisted);
event TargetStatusChanged(address target, bool isWhitelisted);
}
/// @title SickleRegistry contract
/// @author vfat.tools
/// @notice Manages the whitelisted contracts and the collector address
contract SickleRegistry is Admin {
/// CONSTANTS ///
uint256 constant MAX_FEE = 500; // 5%
/// ERRORS ///
error ArrayLengthMismatch(); // 0xa24a13a6
error FeeAboveMaxLimit(); // 0xd6cf7b5e
error InvalidReferralCode(); // 0xe55b4629
/// STORAGE ///
/// @notice Address of the fee collector
address public collector;
/// @notice Tracks the contracts that can be called through Sickle multicall
/// @return True if the contract is a whitelisted target
mapping(address => bool) public isWhitelistedTarget;
/// @notice Tracks the contracts that can call Sickle multicall
/// @return True if the contract is a whitelisted caller
mapping(address => bool) public isWhitelistedCaller;
/// @notice Keeps track of the referrers and their associated code
mapping(bytes32 => address) public referralCodes;
/// @notice Mapping for fee hashes (hash of the strategy contract addresses
/// and the function selectors) and their associated fees
/// @return The fee in basis points to apply to the transaction amount
mapping(bytes32 => uint256) public feeRegistry;
/// WRITE FUNCTIONS ///
/// @param admin_ Address of the admin
/// @param collector_ Address of the collector
constructor(address admin_, address collector_) Admin(admin_) {
collector = collector_;
}
/// @notice Updates the whitelist status for multiple multicall targets
/// @param targets Addresses of the contracts to update
/// @param isApproved New status for the contracts
/// @custom:access Restricted to protocol admin.
function setWhitelistedTargets(
address[] calldata targets,
bool isApproved
) external onlyAdmin {
for (uint256 i; i < targets.length;) {
isWhitelistedTarget[targets[i]] = isApproved;
emit SickleRegistryEvents.TargetStatusChanged(
targets[i], isApproved
);
unchecked {
++i;
}
}
}
/// @notice Updates the fee collector address
/// @param newCollector Address of the new fee collector
/// @custom:access Restricted to protocol admin.
function updateCollector(
address newCollector
) external onlyAdmin {
collector = newCollector;
emit SickleRegistryEvents.CollectorChanged(newCollector);
}
/// @notice Update the whitelist status for multiple multicall callers
/// @param callers Addresses of the callers
/// @param isApproved New status for the caller
/// @custom:access Restricted to protocol admin.
function setWhitelistedCallers(
address[] calldata callers,
bool isApproved
) external onlyAdmin {
for (uint256 i; i < callers.length;) {
isWhitelistedCaller[callers[i]] = isApproved;
emit SickleRegistryEvents.CallerStatusChanged(
callers[i], isApproved
);
unchecked {
++i;
}
}
}
/// @notice Associates a referral code to the address of the caller
function setReferralCode(
bytes32 referralCode
) external {
if (referralCodes[referralCode] != address(0)) {
revert InvalidReferralCode();
}
referralCodes[referralCode] = msg.sender;
emit SickleRegistryEvents.ReferralCodeCreated(referralCode, msg.sender);
}
/// @notice Update the fees for multiple strategy functions
/// @param feeHashes Array of fee hashes
/// @param feesArray Array of fees to apply (in basis points)
/// @custom:access Restricted to protocol admin.
function setFees(
bytes32[] calldata feeHashes,
uint256[] calldata feesArray
) external onlyAdmin {
if (feeHashes.length != feesArray.length) {
revert ArrayLengthMismatch();
}
for (uint256 i = 0; i < feeHashes.length;) {
if (feesArray[i] <= MAX_FEE) {
feeRegistry[feeHashes[i]] = feesArray[i];
} else {
revert FeeAboveMaxLimit();
}
unchecked {
++i;
}
}
emit SickleRegistryEvents.FeesUpdated(feeHashes, feesArray);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { Initializable } from
"@openzeppelin/contracts/proxy/utils/Initializable.sol";
library SickleStorageEvents {
event ApprovedAddressChanged(address newApproved);
}
/// @title SickleStorage contract
/// @author vfat.tools
/// @notice Base storage of the Sickle contract
/// @dev This contract needs to be inherited by stub contracts meant to be used
/// with `delegatecall`
abstract contract SickleStorage is Initializable {
/// ERRORS ///
/// @notice Thrown when the caller is not the owner of the Sickle contract
error NotOwnerError(); // 0x74a21527
/// @notice Thrown when the caller is not a strategy contract or the
/// Flashloan Stub
error NotStrategyError(); // 0x4581ba62
/// STORAGE ///
/// @notice Address of the owner
address public owner;
/// @notice An address that can be set by the owner of the Sickle contract
/// in order to trigger specific functions.
address public approved;
/// MODIFIERS ///
/// @dev Restricts a function call to the owner of the Sickle contract
modifier onlyOwner() {
if (msg.sender != owner) revert NotOwnerError();
_;
}
/// INITIALIZATION ///
/// @param owner_ Address of the owner of this Sickle contract
function _initializeSickleStorage(
address owner_,
address approved_
) internal onlyInitializing {
owner = owner_;
approved = approved_;
}
/// WRITE FUNCTIONS ///
/// @notice Sets the approved address of this Sickle
/// @param newApproved Address meant to be approved by the owner
function setApproved(
address newApproved
) external onlyOwner {
approved = newApproved;
emit SickleStorageEvents.ApprovedAddressChanged(newApproved);
}
/// @notice Checks if `caller` is either the owner of the Sickle contract
/// or was approved by them
/// @param caller Address to check
/// @return True if `caller` is either the owner of the Sickle contract
function isOwnerOrApproved(
address caller
) public view returns (bool) {
return caller == owner || caller == approved;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { SickleRegistry } from "contracts/SickleRegistry.sol";
/// @title Multicall contract
/// @author vfat.tools
/// @notice Enables calling multiple methods in a single call to the contract
abstract contract Multicall {
/// ERRORS ///
error MulticallParamsMismatchError(); // 0xc1e637c9
/// @notice Thrown when the target contract is not whitelisted
/// @param target Address of the non-whitelisted target
error TargetNotWhitelisted(address target); // 0x47ccabe7
/// @notice Thrown when the caller is not whitelisted
/// @param caller Address of the non-whitelisted caller
error CallerNotWhitelisted(address caller); // 0x252c8273
/// STORAGE ///
/// @notice Address of the SickleRegistry contract
/// @dev Needs to be immutable so that it's accessible for Sickle proxies
SickleRegistry public immutable registry;
/// INITIALIZATION ///
/// @param registry_ Address of the SickleRegistry contract
constructor(
SickleRegistry registry_
) {
registry = registry_;
}
/// WRITE FUNCTIONS ///
/// @notice Batch multiple calls together (calls or delegatecalls)
/// @param targets Array of targets to call
/// @param data Array of data to pass with the calls
function multicall(
address[] calldata targets,
bytes[] calldata data
) external payable {
if (targets.length != data.length) {
revert MulticallParamsMismatchError();
}
if (!registry.isWhitelistedCaller(msg.sender)) {
revert CallerNotWhitelisted(msg.sender);
}
for (uint256 i = 0; i != data.length;) {
if (targets[i] == address(0)) {
unchecked {
++i;
}
continue; // No-op
}
if (targets[i] != address(this)) {
if (!registry.isWhitelistedTarget(targets[i])) {
revert TargetNotWhitelisted(targets[i]);
}
}
(bool success, bytes memory result) =
targets[i].delegatecall(data[i]);
if (!success) {
if (result.length == 0) revert();
assembly {
revert(add(32, result), mload(result))
}
}
unchecked {
++i;
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/Address.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized < type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"remappings": [
"solmate/=lib/solmate/src/",
"@openzeppelin/=lib/openzeppelin-contracts/",
"@morpho-blue/=lib/morpho-blue/src/",
"ds-test/=lib/solmate/lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"morpho-blue/=lib/morpho-blue/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract SickleFactory","name":"factory","type":"address"},{"internalType":"contract ConnectorRegistry","name":"connectorRegistry","type":"address"},{"components":[{"internalType":"contract ITransferLib","name":"transferLib","type":"address"},{"internalType":"contract ISwapLib","name":"swapLib","type":"address"},{"internalType":"contract IFeesLib","name":"feesLib","type":"address"},{"internalType":"contract IZapLib","name":"zapLib","type":"address"},{"internalType":"contract INftZapLib","name":"nftZapLib","type":"address"}],"internalType":"struct MultiFarmStrategy.Libraries","name":"libraries","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"NotApproved","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"NotOwner","type":"error"},{"inputs":[],"name":"NotRegisteredSickle","type":"error"},{"inputs":[],"name":"SickleNotDeployed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract Sickle","name":"sickle","type":"address"},{"indexed":true,"internalType":"address","name":"claimStakingContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"claimPoolIndex","type":"uint256"},{"indexed":true,"internalType":"address","name":"depositStakingContract","type":"address"},{"indexed":false,"internalType":"uint256","name":"depositPoolIndex","type":"uint256"}],"name":"SickleCompounded","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":"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":"address","name":"stakingContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"poolIndex","type":"uint256"}],"name":"SickleDeposited","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":"address","name":"stakingContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"poolIndex","type":"uint256"}],"name":"SickleExited","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":"address","name":"stakingContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"poolIndex","type":"uint256"}],"name":"SickleHarvested","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":"address","name":"stakingContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"poolIndex","type":"uint256"}],"name":"SickleWithdrawn","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":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"claimFarm","type":"tuple"},{"internalType":"bytes","name":"claimExtraData","type":"bytes"}],"internalType":"struct ClaimParams[]","name":"claims","type":"tuple[]"},{"components":[{"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":"harvest","type":"tuple"}],"internalType":"struct NftClaimParams[]","name":"nftClaims","type":"tuple[]"},{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"components":[{"components":[{"internalType":"address","name":"tokenApproval","type":"address"},{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"desiredAmountOut","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"address","name":"lpToken","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"desiredAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"minAmounts","type":"uint256[]"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct AddLiquidityParams","name":"addLiquidityParams","type":"tuple"}],"internalType":"struct ZapIn","name":"zap","type":"tuple"},{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"depositFarm","type":"tuple"},{"internalType":"bytes","name":"depositExtraData","type":"bytes"}],"internalType":"struct MultiCompoundParams","name":"params","type":"tuple"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"name":"compoundMultiple","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"connectorRegistry","outputs":[{"internalType":"contract ConnectorRegistry","name":"","type":"address"}],"stateMutability":"view","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":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"claimFarm","type":"tuple"},{"internalType":"bytes","name":"claimExtraData","type":"bytes"}],"internalType":"struct ClaimParams[]","name":"claims","type":"tuple[]"},{"components":[{"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":"harvest","type":"tuple"}],"internalType":"struct NftClaimParams[]","name":"nftClaims","type":"tuple[]"},{"components":[{"internalType":"address","name":"tokenApproval","type":"address"},{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"desiredAmountOut","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"internalType":"address[]","name":"tokensOut","type":"address[]"}],"internalType":"struct MultiHarvestParams","name":"params","type":"tuple"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"name":"harvestMultiple","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"claimFarm","type":"tuple"},{"internalType":"bytes","name":"claimExtraData","type":"bytes"}],"internalType":"struct ClaimParams[]","name":"claims","type":"tuple[]"},{"components":[{"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":"harvest","type":"tuple"}],"internalType":"struct NftClaimParams[]","name":"nftClaims","type":"tuple[]"},{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"components":[{"components":[{"internalType":"address","name":"tokenApproval","type":"address"},{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"desiredAmountOut","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","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"},{"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":"depositPosition","type":"tuple"},{"internalType":"bytes","name":"depositExtraData","type":"bytes"},{"internalType":"bool","name":"compoundInPlace","type":"bool"}],"internalType":"struct NftMultiCompoundParams","name":"params","type":"tuple"},{"internalType":"address[]","name":"sweepTokens","type":"address[]"}],"name":"nftCompoundMultiple","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nftZapLib","outputs":[{"internalType":"contract INftZapLib","name":"","type":"address"}],"stateMutability":"view","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":[],"name":"zapLib","outputs":[{"internalType":"contract IZapLib","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
6101806040523480156200001257600080fd5b5060405162002c0e38038062002c0e8339810160408190526200003591620000af565b6001600160a01b03928316608090815291831660a05230610160528051831660c0526020810151831660e052604081015183166101005260608101518316610120520151166101405262000199565b6001600160a01b03811681146200009a57600080fd5b50565b8051620000aa8162000084565b919050565b600080600083850360e0811215620000c657600080fd5b8451620000d38162000084565b6020860151909450620000e68162000084565b925060a0603f1982011215620000fb57600080fd5b5060405160a081016001600160401b03811182821017156200012d57634e487b7160e01b600052604160045260246000fd5b806040525062000140604086016200009d565b815262000150606086016200009d565b602082015262000163608086016200009d565b60408201526200017660a086016200009d565b60608201526200018960c086016200009d565b6080820152809150509250925092565b60805160a05160c05160e0516101005161012051610140516101605161298a62000284600039600081816101f201528181610412015281816106c20152610bc90152600081816102400152610c73015260008181610267015261076c015260008181610101015281816103c6015281816106760152610b7d015260008181610144015261031401526000818161016b015281816104be015281816109900152610d260152600081816101cb01528181610829015281816110b6015281816113300152818161185d0152611ac601526000818161021901528181610e9d0152610f68015261298a6000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063759cb2341161008c578063bc6b74ab11610066578063bc6b74ab146101ed578063c45a015514610214578063d996cef71461023b578063ee360f241461026257600080fd5b8063759cb234146101a0578063b3fb68d5146101b3578063b53c86d2146101c657600080fd5b806316fbdebe146100d457806329a89db1146100e95780632af3fa1b146100fc5780633faa6e301461013f5780633fb53a0d146101665780634cae2e071461018d575b600080fd5b6100e76100e2366004611dd9565b610289565b005b6100e76100f7366004611e45565b6105f5565b6101237f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b6101237f000000000000000000000000000000000000000000000000000000000000000081565b6101237f000000000000000000000000000000000000000000000000000000000000000081565b6100e761019b366004611e84565b610acb565b6101236101ae366004611f27565b610e79565b6101236101c1366004611f4b565b610f37565b6101237f000000000000000000000000000000000000000000000000000000000000000081565b6101237f000000000000000000000000000000000000000000000000000000000000000081565b6101237f000000000000000000000000000000000000000000000000000000000000000081565b6101237f000000000000000000000000000000000000000000000000000000000000000081565b6101237f000000000000000000000000000000000000000000000000000000000000000081565b600061029433610e79565b90506102a9816102a48580611f8c565b610fdf565b6102bf816102ba6020860186611f8c565b611259565b60408051600380825260808201909252600091602082016060803683375050604080516003808252608082019092529293506000929150602082015b60608152602001906001900390816102fb5790505090507f00000000000000000000000000000000000000000000000000000000000000008260008151811061034657610346611fdd565b6001600160a01b039092166020928302919091019091015261036b6040860186611f8c565b60405160240161037c929190612081565b60408051601f198184030181529190526020810180516001600160e01b03166321e9d05b60e01b179052815182906000906103b9576103b9611fdd565b60200260200101819052507f0000000000000000000000000000000000000000000000000000000000000000826001815181106103f8576103f8611fdd565b6001600160a01b03909216602092830291909101909101527f00000000000000000000000000000000000000000000000000000000000000007fe400534da780c9d64ef8b5f03c074ff47537b6a4aa2a3e5d5455cb37b5406aa361045f6060880188611f8c565b60405160240161047294939291906121cb565b60408051601f198184030181529190526020810180516001600160e01b031663dcc3284160e01b1790528151829060019081106104b1576104b1611fdd565b60200260200101819052507f0000000000000000000000000000000000000000000000000000000000000000826002815181106104f0576104f0611fdd565b60200260200101906001600160a01b031690816001600160a01b031681525050836040516024016105219190612243565b60408051601f198184030181529190526020810180516001600160e01b031663d354641160e01b17905281518290600290811061056057610560611fdd565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038416906363fb0b96906105999085908590600401612256565b600060405180830381600087803b1580156105b357600080fd5b505af11580156105c7573d6000803e3d6000fd5b506105ee92508591506105dc90508780611f8c565b6105e960208a018a611f8c565b6114cf565b5050505050565b600061060033610e79565b9050610610816102a48580611f8c565b610621816102ba6020860186611f8c565b60408051600480825260a0820190925260009160208201608080368337505060408051600480825260a082019092529293506000929150602082015b606081526020019060019003908161065d5790505090507f0000000000000000000000000000000000000000000000000000000000000000826000815181106106a8576106a8611fdd565b6001600160a01b03909216602092830291909101909101527f00000000000000000000000000000000000000000000000000000000000000007f1d5b8de553017a3bd388578aeece0183b79c5ca87ec64628b3f76b39487f023161070f6040880188611f8c565b60405160240161072294939291906121cb565b60408051601f198184030181529190526020810180516001600160e01b031663dcc3284160e01b1790528151829060009061075f5761075f611fdd565b60200260200101819052507f00000000000000000000000000000000000000000000000000000000000000008260018151811061079e5761079e611fdd565b6001600160a01b03909216602092830291909101909101526107c360608601866122f8565b6040516024016107d3919061248c565b60408051601f198184030181529190526020810180516001600160e01b0316635bdcfb0d60e01b17905281518290600190811061081257610812611fdd565b602090810291909101015260006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663c79aeaae61085e60a0890160808a01611f27565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156108a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c69190612595565b905080836002815181106108dc576108dc611fdd565b6001600160a01b03909216602092830291909101909101526080860161090560608801886122f8565b6109139060208101906125b2565b610924906040810190602001611f27565b61093160c08901896125c8565b6040516024016109449493929190612630565b60408051601f198184030181529190526020810180516001600160e01b0316636ec4f1e960e11b17905282518390600290811061098357610983611fdd565b60200260200101819052507f0000000000000000000000000000000000000000000000000000000000000000836003815181106109c2576109c2611fdd565b60200260200101906001600160a01b031690816001600160a01b031681525050846040516024016109f39190612243565b60408051601f198184030181529190526020810180516001600160e01b031663d354641160e01b179052825183906003908110610a3257610a32611fdd565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038516906363fb0b9690610a6b9086908690600401612256565b600060405180830381600087803b158015610a8557600080fd5b505af1158015610a99573d6000803e3d6000fd5b50610ac392508691505060808801610ab18980611f8c565b610abe60208c018c611f8c565b6116a4565b505050505050565b6000610ad633610e79565b9050610ae6816102a48680611f8c565b610af7816102ba6020870187611f8c565b610b0961014085016101208601612662565b610b2857610b288160808601610b236101008801886125c8565b611851565b60408051600380825260808201909252600091602082016060803683375050604080516003808252608082019092529293506000929150602082015b6060815260200190600190039081610b645790505090507f000000000000000000000000000000000000000000000000000000000000000082600081518110610baf57610baf611fdd565b6001600160a01b03909216602092830291909101909101527f00000000000000000000000000000000000000000000000000000000000000007f1d5b8de553017a3bd388578aeece0183b79c5ca87ec64628b3f76b39487f0231610c166040890189611f8c565b604051602401610c2994939291906121cb565b60408051601f198184030181529190526020810180516001600160e01b031663dcc3284160e01b17905281518290600090610c6657610c66611fdd565b60200260200101819052507f000000000000000000000000000000000000000000000000000000000000000082600181518110610ca557610ca5611fdd565b6001600160a01b0390921660209283029190910190910152610cca60608701876122f8565b604051602401610cda91906126e6565b60408051601f198184030181529190526020810180516001600160e01b031663ac98b56360e01b179052815182906001908110610d1957610d19611fdd565b60200260200101819052507f000000000000000000000000000000000000000000000000000000000000000082600281518110610d5857610d58611fdd565b60200260200101906001600160a01b031690816001600160a01b0316815250508484604051602401610d8b9291906127fd565b60408051601f198184030181529190526020810180516001600160e01b031663d354641160e01b179052815182906002908110610dca57610dca611fdd565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038416906363fb0b9690610e039085908590600401612256565b600060405180830381600087803b158015610e1d57600080fd5b505af1158015610e31573d6000803e3d6000fd5b50610e489250505061014087016101208801612662565b610e6757610e678360808801610e626101008a018a6125c8565b611aba565b610ac38360808801610ab18980611f8c565b6040516312cfc9b560e31b81526001600160a01b03828116600483015260009182917f0000000000000000000000000000000000000000000000000000000000000000169063967e4da890602401602060405180830381865afa158015610ee4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f089190612595565b90506001600160a01b038116610f3157604051633098a45560e01b815260040160405180910390fd5b92915050565b60405163de0d95ed60e01b81526001600160a01b0384811660048301528381166024830152604482018390526000917f00000000000000000000000000000000000000000000000000000000000000009091169063de0d95ed906064016020604051808303816000875af1158015610fb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd79190612595565b949350505050565b8060008167ffffffffffffffff811115610ffb57610ffb611cf9565b604051908082528060200260200182016040528015611024578160200160208202803683370190505b50905060008267ffffffffffffffff81111561104257611042611cf9565b60405190808252806020026020018201604052801561107557816020015b60608152602001906001900390816110605790505b50905060005b838110156111f0573686868381811061109657611096611fdd565b90506020028101906110a89190612811565b905060006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663c79aeaae6110e86020850185611f27565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa15801561112c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111509190612595565b90508085848151811061116557611165611fdd565b6001600160a01b03909216602092830291909101909101528161118b60408201826125c8565b60405160240161119d93929190612827565b60408051601f198184030181529190526020810180516001600160e01b0316638bddf18760e01b17905284518590859081106111db576111db611fdd565b6020908102919091010152505060010161107b565b506040516331fd85cb60e11b81526001600160a01b038716906363fb0b969061121f9085908590600401612256565b600060405180830381600087803b15801561123957600080fd5b505af115801561124d573d6000803e3d6000fd5b50505050505050505050565b8060008167ffffffffffffffff81111561127557611275611cf9565b60405190808252806020026020018201604052801561129e578160200160208202803683370190505b50905060008267ffffffffffffffff8111156112bc576112bc611cf9565b6040519080825280602002602001820160405280156112ef57816020015b60608152602001906001900390816112da5790505b50905060005b838110156111f0573686868381811061131057611310611fdd565b90506020028101906113229190612851565b905060006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663c79aeaae6113626020850185611f27565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156113a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ca9190612595565b9050808584815181106113df576113df611fdd565b6001600160a01b0390921660209283029190910190910152816114056080820182612867565b61140f9080611f8c565b61141c6080860186612867565b61142d90604081019060200161287d565b61143a6080870187612867565b61144b90606081019060400161287d565b6114586080880188612867565b6114669060608101906125c8565b60405160240161147c97969594939291906128d7565b60408051601f198184030181529190526020810180516001600160e01b0316636f4621e360e01b17905284518590859081106114ba576114ba611fdd565b602090810291909101015250506001016112f5565b60005b8381101561157b578484828181106114ec576114ec611fdd565b90506020028101906114fe9190612811565b6020013585858381811061151457611514611fdd565b90506020028101906115269190612811565b611534906020810190611f27565b6001600160a01b0316876001600160a01b03167f37da49704c95bce31298d9d965163d5953283973279e35728e6666bd9abe1e7a60405160405180910390a46001016114d2565b5060005b81811015610ac35782828281811061159957611599611fdd565b90506020028101906115ab9190612851565b606001358383838181106115c1576115c1611fdd565b90506020028101906115d39190612851565b6115e4906060810190604001611f27565b6001600160a01b0316876001600160a01b03167fbf9d03ac543e8f596c6f4af5ab5e75f366a57d2d6c28d2ff9c024bd3f88e877186868681811061162a5761162a611fdd565b905060200281019061163c9190612851565b61164a906020810190611f27565b87878781811061165c5761165c611fdd565b905060200281019061166e9190612851565b604051611694929160200135906001600160a01b03929092168252602082015260400190565b60405180910390a460010161157f565b60005b83811015611777576116bc6020870187611f27565b6001600160a01b03168585838181106116d7576116d7611fdd565b90506020028101906116e99190612811565b6116f7906020810190611f27565b6001600160a01b0316886001600160a01b03167f052db0f97f7329c6cb05c89ccab89a2ad3acd05ac8d5678a6c1d46c309afbad188888681811061173d5761173d611fdd565b905060200281019061174f9190612811565b6040805160209283013581528c830135928101929092520160405180910390a46001016116a7565b5060005b818110156118485782828281811061179557611795611fdd565b90506020028101906117a79190612851565b606001358383838181106117bd576117bd611fdd565b90506020028101906117cf9190612851565b6117e0906060810190604001611f27565b6001600160a01b039081169089167f504180eddec0aa4ed3bb8edcf99b13013e1d8ae52be37f0f4f38d14ccf0c99a561181c60208b018b611f27565b604080516001600160a01b0390921682526020808d0135908301520160405180910390a460010161177b565b50505050505050565b60006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663c79aeaae61188f6020870187611f27565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156118d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f79190612595565b604080516001808252818301909252919250600091906020808301908036833750506040805160018082528183019092529293506000929150602082015b6060815260200190600190039081611935579050509050828260008151811061196057611960611fdd565b60200260200101906001600160a01b031690816001600160a01b03168152505085858560405160240161199593929190612933565b60408051601f198184030181529190526020810180516001600160e01b0316631423e67960e11b179052815182906000906119d2576119d2611fdd565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038816906363fb0b9690611a0b9085908590600401612256565b600060405180830381600087803b158015611a2557600080fd5b505af1158015611a39573d6000803e3d6000fd5b5050506060870180359150611a519060408901611f27565b6001600160a01b039081169089167f976f9aa1da6d0f0e23405b12b4e2b446c12615150624819f4bebe8060fa39f61611a8d60208b018b611f27565b604080516001600160a01b03909216825260208c810135908301520160405180910390a450505050505050565b60006001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663c79aeaae611af86020870187611f27565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015611b3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b609190612595565b604080516001808252818301909252919250600091906020808301908036833750506040805160018082528183019092529293506000929150602082015b6060815260200190600190039081611b9e5790505090508282600081518110611bc957611bc9611fdd565b60200260200101906001600160a01b031690816001600160a01b031681525050858585604051602401611bfe93929190612933565b60408051601f198184030181529190526020810180516001600160e01b03166001624236cd60e11b031917905281518290600090611c3e57611c3e611fdd565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038816906363fb0b9690611c779085908590600401612256565b600060405180830381600087803b158015611c9157600080fd5b505af1158015611ca5573d6000803e3d6000fd5b5050506060870180359150611cbd9060408901611f27565b6001600160a01b039081169089167f53375fafff3a4a00460af1c1347b8f0dd0d35cce6b2bd5661346bc8ad1d37a00611a8d60208b018b611f27565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114611d2457600080fd5b50565b8035611d3281611d0f565b919050565b600082601f830112611d4857600080fd5b8135602067ffffffffffffffff80831115611d6557611d65611cf9565b8260051b604051601f19603f83011681018181108482111715611d8a57611d8a611cf9565b604052938452858101830193838101925087851115611da857600080fd5b83870191505b84821015611dce57611dbf82611d27565b83529183019190830190611dae565b979650505050505050565b60008060408385031215611dec57600080fd5b823567ffffffffffffffff80821115611e0457600080fd5b9084019060808287031215611e1857600080fd5b90925060208401359080821115611e2e57600080fd5b50611e3b85828601611d37565b9150509250929050565b60008060408385031215611e5857600080fd5b823567ffffffffffffffff80821115611e7057600080fd5b9084019060e08287031215611e1857600080fd5b600080600060408486031215611e9957600080fd5b833567ffffffffffffffff80821115611eb157600080fd5b908501906101408288031215611ec657600080fd5b90935060208501359080821115611edc57600080fd5b818601915086601f830112611ef057600080fd5b813581811115611eff57600080fd5b8760208260051b8501011115611f1457600080fd5b6020830194508093505050509250925092565b600060208284031215611f3957600080fd5b8135611f4481611d0f565b9392505050565b600080600060608486031215611f6057600080fd5b8335611f6b81611d0f565b92506020840135611f7b81611d0f565b929592945050506040919091013590565b6000808335601e19843603018112611fa357600080fd5b83018035915067ffffffffffffffff821115611fbe57600080fd5b6020019150600581901b3603821315611fd657600080fd5b9250929050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261200a57600080fd5b830160208101925035905067ffffffffffffffff81111561202a57600080fd5b803603821315611fd657600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000823560fe1983360301811261207857600080fd5b90910192915050565b60208082528181018390526000906040808401600586901b8501820187855b8881101561217457878303603f190184526120bb828b612062565b61010081356120c981611d0f565b6001600160a01b031685526120df828901611d27565b6001600160a01b0316888601528682013587860152606080830135908601526080808301359086015260a0612115818401611d27565b6001600160a01b03169086015260c061212f838201611d27565b6001600160a01b03169086015260e061214a83820184611ff3565b9350828288015261215e8388018583612039565b978a0197965050509287019250506001016120a0565b509098975050505050505050565b8183526000602080850194508260005b858110156121c05781356121a581611d0f565b6001600160a01b031687529582019590820190600101612192565b509495945050505050565b6001600160a01b03851681526001600160e01b0319841660208201526060604082018190526000906122009083018486612182565b9695505050505050565b600081518084526020808501945080840160005b838110156121c05781516001600160a01b03168752958201959082019060010161221e565b602081526000611f44602083018461220a565b604081526000612269604083018561220a565b6020838203818501528185518084528284019150828160051b8501018388016000805b848110156122e857601f198089860301875283518051808752845b818110156122c2578281018b01518882018c01528a016122a7565b508681018a0185905297890197601f01909116909401870193509186019160010161228c565b50919a9950505050505050505050565b60008235603e1983360301811261230e57600080fd5b9190910192915050565b6000808335601e1984360301811261232f57600080fd5b830160208101925035905067ffffffffffffffff81111561234f57600080fd5b8060051b3603821315611fd657600080fd5b81835260006020808501808196508560051b810191508460005b8781101561244d5782840389526123928288612062565b61010081356123a081611d0f565b6001600160a01b031686526123b6828801611d27565b6001600160a01b03168787015260408281013590870152606080830135908701526080808301359087015260a06123ee818401611d27565b6001600160a01b03169087015260c0612408838201611d27565b6001600160a01b03169087015260e061242383820184611ff3565b935082828901526124378389018583612039565b9c89019c9750505092860192505060010161237b565b5091979650505050505050565b81835260006001600160fb1b0383111561247357600080fd5b8260051b80836020870137939093016020019392505050565b60208152600061249c8384612318565b604060208501526124b1606085018284612361565b915050602084013560be198536030181126124cb57600080fd5b838203601f19016040850152840180356124e481611d0f565b6001600160a01b03908116835260208201359061250082611d0f565b1660208301526125136040820182612318565b60c0604085015261252860c085018284612182565b9150506125386060830183612318565b848303606086015261254b83828461245a565b9250505061255c6080830183612318565b848303608086015261256f83828461245a565b9250505061258060a0830183611ff3565b925083820360a0850152611dce828483612039565b6000602082840312156125a757600080fd5b8151611f4481611d0f565b6000823560be1983360301811261230e57600080fd5b6000808335601e198436030181126125df57600080fd5b83018035915067ffffffffffffffff8211156125fa57600080fd5b602001915036819003821315611fd657600080fd5b803561261a81611d0f565b6001600160a01b03168252602090810135910152565b61263a818661260f565b6001600160a01b03841660408201526080606082018190526000906122009083018486612039565b60006020828403121561267457600080fd5b81358015158114611f4457600080fd5b803561268f81611d0f565b6001600160a01b0390811683526020820135906126ab82611d0f565b166020830152604081013562ffffff81168082146126c857600080fd5b80604085015250505050565b8035600281900b8114611d3257600080fd5b6020815260006126f68384612318565b6040602085015261270b606085018284612361565b915050602084013561017e1985360301811261272657600080fd5b838203601f1901604085015284016101806127518361274484611d27565b6001600160a01b03169052565b6020820135602084015261276b6040840160408401612684565b61277760a083016126d4565b61278660a085018260020b9052565b5061279360c083016126d4565b6127a260c085018260020b9052565b5060e082810135908401526101008083013590840152610120808301359084015261014080830135908401526101606127dd81840184611ff3565b935082828601526127f18386018583612039565b98975050505050505050565b602081526000610fd7602083018486612182565b60008235605e1983360301811261230e57600080fd5b612831818561260f565b606060408201526000612848606083018486612039565b95945050505050565b60008235609e1983360301811261230e57600080fd5b60008235607e1983360301811261230e57600080fd5b60006020828403121561288f57600080fd5b81356001600160801b0381168114611f4457600080fd5b6128b0828261260f565b60408101356128be81611d0f565b6001600160a01b03166040830152606090810135910152565b60006101006128e6838b6128a6565b8060808401526128f9818401898b612182565b6001600160801b0388811660a0860152871660c085015283810360e08501529050612925818587612039565b9a9950505050505050505050565b61293d81856128a6565b60a06080820152600061284860a08301848661203956fea2646970667358221220876c3f362441486d51a1da6fe093846e1c3fa9739e612bf7e0532bbee3fe7edd64736f6c63430008130033000000000000000000000000233d9067677dcf1a161954d45b4c965b9d567168000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c990000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b00000000000000000000000023eb5ce64769b969b58f008154d396957a7ade3b00000000000000000000000046292986df2fee3a048dd6753918e62e93806c2d00000000000000000000000034f895a2b90e60721a046a7cbf330ca74070968c000000000000000000000000ac371d6e651b6450ea8c4ce346ddd44b62d851b5
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063759cb2341161008c578063bc6b74ab11610066578063bc6b74ab146101ed578063c45a015514610214578063d996cef71461023b578063ee360f241461026257600080fd5b8063759cb234146101a0578063b3fb68d5146101b3578063b53c86d2146101c657600080fd5b806316fbdebe146100d457806329a89db1146100e95780632af3fa1b146100fc5780633faa6e301461013f5780633fb53a0d146101665780634cae2e071461018d575b600080fd5b6100e76100e2366004611dd9565b610289565b005b6100e76100f7366004611e45565b6105f5565b6101237f00000000000000000000000046292986df2fee3a048dd6753918e62e93806c2d81565b6040516001600160a01b03909116815260200160405180910390f35b6101237f00000000000000000000000023eb5ce64769b969b58f008154d396957a7ade3b81565b6101237f0000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b81565b6100e761019b366004611e84565b610acb565b6101236101ae366004611f27565b610e79565b6101236101c1366004611f4b565b610f37565b6101237f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c9981565b6101237f00000000000000000000000083631c1dd38a48589622784c30f3119859590c4a81565b6101237f000000000000000000000000233d9067677dcf1a161954d45b4c965b9d56716881565b6101237f000000000000000000000000ac371d6e651b6450ea8c4ce346ddd44b62d851b581565b6101237f00000000000000000000000034f895a2b90e60721a046a7cbf330ca74070968c81565b600061029433610e79565b90506102a9816102a48580611f8c565b610fdf565b6102bf816102ba6020860186611f8c565b611259565b60408051600380825260808201909252600091602082016060803683375050604080516003808252608082019092529293506000929150602082015b60608152602001906001900390816102fb5790505090507f00000000000000000000000023eb5ce64769b969b58f008154d396957a7ade3b8260008151811061034657610346611fdd565b6001600160a01b039092166020928302919091019091015261036b6040860186611f8c565b60405160240161037c929190612081565b60408051601f198184030181529190526020810180516001600160e01b03166321e9d05b60e01b179052815182906000906103b9576103b9611fdd565b60200260200101819052507f00000000000000000000000046292986df2fee3a048dd6753918e62e93806c2d826001815181106103f8576103f8611fdd565b6001600160a01b03909216602092830291909101909101527f00000000000000000000000083631c1dd38a48589622784c30f3119859590c4a7fe400534da780c9d64ef8b5f03c074ff47537b6a4aa2a3e5d5455cb37b5406aa361045f6060880188611f8c565b60405160240161047294939291906121cb565b60408051601f198184030181529190526020810180516001600160e01b031663dcc3284160e01b1790528151829060019081106104b1576104b1611fdd565b60200260200101819052507f0000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b826002815181106104f0576104f0611fdd565b60200260200101906001600160a01b031690816001600160a01b031681525050836040516024016105219190612243565b60408051601f198184030181529190526020810180516001600160e01b031663d354641160e01b17905281518290600290811061056057610560611fdd565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038416906363fb0b96906105999085908590600401612256565b600060405180830381600087803b1580156105b357600080fd5b505af11580156105c7573d6000803e3d6000fd5b506105ee92508591506105dc90508780611f8c565b6105e960208a018a611f8c565b6114cf565b5050505050565b600061060033610e79565b9050610610816102a48580611f8c565b610621816102ba6020860186611f8c565b60408051600480825260a0820190925260009160208201608080368337505060408051600480825260a082019092529293506000929150602082015b606081526020019060019003908161065d5790505090507f00000000000000000000000046292986df2fee3a048dd6753918e62e93806c2d826000815181106106a8576106a8611fdd565b6001600160a01b03909216602092830291909101909101527f00000000000000000000000083631c1dd38a48589622784c30f3119859590c4a7f1d5b8de553017a3bd388578aeece0183b79c5ca87ec64628b3f76b39487f023161070f6040880188611f8c565b60405160240161072294939291906121cb565b60408051601f198184030181529190526020810180516001600160e01b031663dcc3284160e01b1790528151829060009061075f5761075f611fdd565b60200260200101819052507f00000000000000000000000034f895a2b90e60721a046a7cbf330ca74070968c8260018151811061079e5761079e611fdd565b6001600160a01b03909216602092830291909101909101526107c360608601866122f8565b6040516024016107d3919061248c565b60408051601f198184030181529190526020810180516001600160e01b0316635bdcfb0d60e01b17905281518290600190811061081257610812611fdd565b602090810291909101015260006001600160a01b037f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c991663c79aeaae61085e60a0890160808a01611f27565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156108a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c69190612595565b905080836002815181106108dc576108dc611fdd565b6001600160a01b03909216602092830291909101909101526080860161090560608801886122f8565b6109139060208101906125b2565b610924906040810190602001611f27565b61093160c08901896125c8565b6040516024016109449493929190612630565b60408051601f198184030181529190526020810180516001600160e01b0316636ec4f1e960e11b17905282518390600290811061098357610983611fdd565b60200260200101819052507f0000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b836003815181106109c2576109c2611fdd565b60200260200101906001600160a01b031690816001600160a01b031681525050846040516024016109f39190612243565b60408051601f198184030181529190526020810180516001600160e01b031663d354641160e01b179052825183906003908110610a3257610a32611fdd565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038516906363fb0b9690610a6b9086908690600401612256565b600060405180830381600087803b158015610a8557600080fd5b505af1158015610a99573d6000803e3d6000fd5b50610ac392508691505060808801610ab18980611f8c565b610abe60208c018c611f8c565b6116a4565b505050505050565b6000610ad633610e79565b9050610ae6816102a48680611f8c565b610af7816102ba6020870187611f8c565b610b0961014085016101208601612662565b610b2857610b288160808601610b236101008801886125c8565b611851565b60408051600380825260808201909252600091602082016060803683375050604080516003808252608082019092529293506000929150602082015b6060815260200190600190039081610b645790505090507f00000000000000000000000046292986df2fee3a048dd6753918e62e93806c2d82600081518110610baf57610baf611fdd565b6001600160a01b03909216602092830291909101909101527f00000000000000000000000083631c1dd38a48589622784c30f3119859590c4a7f1d5b8de553017a3bd388578aeece0183b79c5ca87ec64628b3f76b39487f0231610c166040890189611f8c565b604051602401610c2994939291906121cb565b60408051601f198184030181529190526020810180516001600160e01b031663dcc3284160e01b17905281518290600090610c6657610c66611fdd565b60200260200101819052507f000000000000000000000000ac371d6e651b6450ea8c4ce346ddd44b62d851b582600181518110610ca557610ca5611fdd565b6001600160a01b0390921660209283029190910190910152610cca60608701876122f8565b604051602401610cda91906126e6565b60408051601f198184030181529190526020810180516001600160e01b031663ac98b56360e01b179052815182906001908110610d1957610d19611fdd565b60200260200101819052507f0000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b82600281518110610d5857610d58611fdd565b60200260200101906001600160a01b031690816001600160a01b0316815250508484604051602401610d8b9291906127fd565b60408051601f198184030181529190526020810180516001600160e01b031663d354641160e01b179052815182906002908110610dca57610dca611fdd565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038416906363fb0b9690610e039085908590600401612256565b600060405180830381600087803b158015610e1d57600080fd5b505af1158015610e31573d6000803e3d6000fd5b50610e489250505061014087016101208801612662565b610e6757610e678360808801610e626101008a018a6125c8565b611aba565b610ac38360808801610ab18980611f8c565b6040516312cfc9b560e31b81526001600160a01b03828116600483015260009182917f000000000000000000000000233d9067677dcf1a161954d45b4c965b9d567168169063967e4da890602401602060405180830381865afa158015610ee4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f089190612595565b90506001600160a01b038116610f3157604051633098a45560e01b815260040160405180910390fd5b92915050565b60405163de0d95ed60e01b81526001600160a01b0384811660048301528381166024830152604482018390526000917f000000000000000000000000233d9067677dcf1a161954d45b4c965b9d5671689091169063de0d95ed906064016020604051808303816000875af1158015610fb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd79190612595565b949350505050565b8060008167ffffffffffffffff811115610ffb57610ffb611cf9565b604051908082528060200260200182016040528015611024578160200160208202803683370190505b50905060008267ffffffffffffffff81111561104257611042611cf9565b60405190808252806020026020018201604052801561107557816020015b60608152602001906001900390816110605790505b50905060005b838110156111f0573686868381811061109657611096611fdd565b90506020028101906110a89190612811565b905060006001600160a01b037f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c991663c79aeaae6110e86020850185611f27565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa15801561112c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111509190612595565b90508085848151811061116557611165611fdd565b6001600160a01b03909216602092830291909101909101528161118b60408201826125c8565b60405160240161119d93929190612827565b60408051601f198184030181529190526020810180516001600160e01b0316638bddf18760e01b17905284518590859081106111db576111db611fdd565b6020908102919091010152505060010161107b565b506040516331fd85cb60e11b81526001600160a01b038716906363fb0b969061121f9085908590600401612256565b600060405180830381600087803b15801561123957600080fd5b505af115801561124d573d6000803e3d6000fd5b50505050505050505050565b8060008167ffffffffffffffff81111561127557611275611cf9565b60405190808252806020026020018201604052801561129e578160200160208202803683370190505b50905060008267ffffffffffffffff8111156112bc576112bc611cf9565b6040519080825280602002602001820160405280156112ef57816020015b60608152602001906001900390816112da5790505b50905060005b838110156111f0573686868381811061131057611310611fdd565b90506020028101906113229190612851565b905060006001600160a01b037f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c991663c79aeaae6113626020850185611f27565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156113a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ca9190612595565b9050808584815181106113df576113df611fdd565b6001600160a01b0390921660209283029190910190910152816114056080820182612867565b61140f9080611f8c565b61141c6080860186612867565b61142d90604081019060200161287d565b61143a6080870187612867565b61144b90606081019060400161287d565b6114586080880188612867565b6114669060608101906125c8565b60405160240161147c97969594939291906128d7565b60408051601f198184030181529190526020810180516001600160e01b0316636f4621e360e01b17905284518590859081106114ba576114ba611fdd565b602090810291909101015250506001016112f5565b60005b8381101561157b578484828181106114ec576114ec611fdd565b90506020028101906114fe9190612811565b6020013585858381811061151457611514611fdd565b90506020028101906115269190612811565b611534906020810190611f27565b6001600160a01b0316876001600160a01b03167f37da49704c95bce31298d9d965163d5953283973279e35728e6666bd9abe1e7a60405160405180910390a46001016114d2565b5060005b81811015610ac35782828281811061159957611599611fdd565b90506020028101906115ab9190612851565b606001358383838181106115c1576115c1611fdd565b90506020028101906115d39190612851565b6115e4906060810190604001611f27565b6001600160a01b0316876001600160a01b03167fbf9d03ac543e8f596c6f4af5ab5e75f366a57d2d6c28d2ff9c024bd3f88e877186868681811061162a5761162a611fdd565b905060200281019061163c9190612851565b61164a906020810190611f27565b87878781811061165c5761165c611fdd565b905060200281019061166e9190612851565b604051611694929160200135906001600160a01b03929092168252602082015260400190565b60405180910390a460010161157f565b60005b83811015611777576116bc6020870187611f27565b6001600160a01b03168585838181106116d7576116d7611fdd565b90506020028101906116e99190612811565b6116f7906020810190611f27565b6001600160a01b0316886001600160a01b03167f052db0f97f7329c6cb05c89ccab89a2ad3acd05ac8d5678a6c1d46c309afbad188888681811061173d5761173d611fdd565b905060200281019061174f9190612811565b6040805160209283013581528c830135928101929092520160405180910390a46001016116a7565b5060005b818110156118485782828281811061179557611795611fdd565b90506020028101906117a79190612851565b606001358383838181106117bd576117bd611fdd565b90506020028101906117cf9190612851565b6117e0906060810190604001611f27565b6001600160a01b039081169089167f504180eddec0aa4ed3bb8edcf99b13013e1d8ae52be37f0f4f38d14ccf0c99a561181c60208b018b611f27565b604080516001600160a01b0390921682526020808d0135908301520160405180910390a460010161177b565b50505050505050565b60006001600160a01b037f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c991663c79aeaae61188f6020870187611f27565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156118d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f79190612595565b604080516001808252818301909252919250600091906020808301908036833750506040805160018082528183019092529293506000929150602082015b6060815260200190600190039081611935579050509050828260008151811061196057611960611fdd565b60200260200101906001600160a01b031690816001600160a01b03168152505085858560405160240161199593929190612933565b60408051601f198184030181529190526020810180516001600160e01b0316631423e67960e11b179052815182906000906119d2576119d2611fdd565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038816906363fb0b9690611a0b9085908590600401612256565b600060405180830381600087803b158015611a2557600080fd5b505af1158015611a39573d6000803e3d6000fd5b5050506060870180359150611a519060408901611f27565b6001600160a01b039081169089167f976f9aa1da6d0f0e23405b12b4e2b446c12615150624819f4bebe8060fa39f61611a8d60208b018b611f27565b604080516001600160a01b03909216825260208c810135908301520160405180910390a450505050505050565b60006001600160a01b037f000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c991663c79aeaae611af86020870187611f27565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015611b3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b609190612595565b604080516001808252818301909252919250600091906020808301908036833750506040805160018082528183019092529293506000929150602082015b6060815260200190600190039081611b9e5790505090508282600081518110611bc957611bc9611fdd565b60200260200101906001600160a01b031690816001600160a01b031681525050858585604051602401611bfe93929190612933565b60408051601f198184030181529190526020810180516001600160e01b03166001624236cd60e11b031917905281518290600090611c3e57611c3e611fdd565b60209081029190910101526040516331fd85cb60e11b81526001600160a01b038816906363fb0b9690611c779085908590600401612256565b600060405180830381600087803b158015611c9157600080fd5b505af1158015611ca5573d6000803e3d6000fd5b5050506060870180359150611cbd9060408901611f27565b6001600160a01b039081169089167f53375fafff3a4a00460af1c1347b8f0dd0d35cce6b2bd5661346bc8ad1d37a00611a8d60208b018b611f27565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114611d2457600080fd5b50565b8035611d3281611d0f565b919050565b600082601f830112611d4857600080fd5b8135602067ffffffffffffffff80831115611d6557611d65611cf9565b8260051b604051601f19603f83011681018181108482111715611d8a57611d8a611cf9565b604052938452858101830193838101925087851115611da857600080fd5b83870191505b84821015611dce57611dbf82611d27565b83529183019190830190611dae565b979650505050505050565b60008060408385031215611dec57600080fd5b823567ffffffffffffffff80821115611e0457600080fd5b9084019060808287031215611e1857600080fd5b90925060208401359080821115611e2e57600080fd5b50611e3b85828601611d37565b9150509250929050565b60008060408385031215611e5857600080fd5b823567ffffffffffffffff80821115611e7057600080fd5b9084019060e08287031215611e1857600080fd5b600080600060408486031215611e9957600080fd5b833567ffffffffffffffff80821115611eb157600080fd5b908501906101408288031215611ec657600080fd5b90935060208501359080821115611edc57600080fd5b818601915086601f830112611ef057600080fd5b813581811115611eff57600080fd5b8760208260051b8501011115611f1457600080fd5b6020830194508093505050509250925092565b600060208284031215611f3957600080fd5b8135611f4481611d0f565b9392505050565b600080600060608486031215611f6057600080fd5b8335611f6b81611d0f565b92506020840135611f7b81611d0f565b929592945050506040919091013590565b6000808335601e19843603018112611fa357600080fd5b83018035915067ffffffffffffffff821115611fbe57600080fd5b6020019150600581901b3603821315611fd657600080fd5b9250929050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261200a57600080fd5b830160208101925035905067ffffffffffffffff81111561202a57600080fd5b803603821315611fd657600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000823560fe1983360301811261207857600080fd5b90910192915050565b60208082528181018390526000906040808401600586901b8501820187855b8881101561217457878303603f190184526120bb828b612062565b61010081356120c981611d0f565b6001600160a01b031685526120df828901611d27565b6001600160a01b0316888601528682013587860152606080830135908601526080808301359086015260a0612115818401611d27565b6001600160a01b03169086015260c061212f838201611d27565b6001600160a01b03169086015260e061214a83820184611ff3565b9350828288015261215e8388018583612039565b978a0197965050509287019250506001016120a0565b509098975050505050505050565b8183526000602080850194508260005b858110156121c05781356121a581611d0f565b6001600160a01b031687529582019590820190600101612192565b509495945050505050565b6001600160a01b03851681526001600160e01b0319841660208201526060604082018190526000906122009083018486612182565b9695505050505050565b600081518084526020808501945080840160005b838110156121c05781516001600160a01b03168752958201959082019060010161221e565b602081526000611f44602083018461220a565b604081526000612269604083018561220a565b6020838203818501528185518084528284019150828160051b8501018388016000805b848110156122e857601f198089860301875283518051808752845b818110156122c2578281018b01518882018c01528a016122a7565b508681018a0185905297890197601f01909116909401870193509186019160010161228c565b50919a9950505050505050505050565b60008235603e1983360301811261230e57600080fd5b9190910192915050565b6000808335601e1984360301811261232f57600080fd5b830160208101925035905067ffffffffffffffff81111561234f57600080fd5b8060051b3603821315611fd657600080fd5b81835260006020808501808196508560051b810191508460005b8781101561244d5782840389526123928288612062565b61010081356123a081611d0f565b6001600160a01b031686526123b6828801611d27565b6001600160a01b03168787015260408281013590870152606080830135908701526080808301359087015260a06123ee818401611d27565b6001600160a01b03169087015260c0612408838201611d27565b6001600160a01b03169087015260e061242383820184611ff3565b935082828901526124378389018583612039565b9c89019c9750505092860192505060010161237b565b5091979650505050505050565b81835260006001600160fb1b0383111561247357600080fd5b8260051b80836020870137939093016020019392505050565b60208152600061249c8384612318565b604060208501526124b1606085018284612361565b915050602084013560be198536030181126124cb57600080fd5b838203601f19016040850152840180356124e481611d0f565b6001600160a01b03908116835260208201359061250082611d0f565b1660208301526125136040820182612318565b60c0604085015261252860c085018284612182565b9150506125386060830183612318565b848303606086015261254b83828461245a565b9250505061255c6080830183612318565b848303608086015261256f83828461245a565b9250505061258060a0830183611ff3565b925083820360a0850152611dce828483612039565b6000602082840312156125a757600080fd5b8151611f4481611d0f565b6000823560be1983360301811261230e57600080fd5b6000808335601e198436030181126125df57600080fd5b83018035915067ffffffffffffffff8211156125fa57600080fd5b602001915036819003821315611fd657600080fd5b803561261a81611d0f565b6001600160a01b03168252602090810135910152565b61263a818661260f565b6001600160a01b03841660408201526080606082018190526000906122009083018486612039565b60006020828403121561267457600080fd5b81358015158114611f4457600080fd5b803561268f81611d0f565b6001600160a01b0390811683526020820135906126ab82611d0f565b166020830152604081013562ffffff81168082146126c857600080fd5b80604085015250505050565b8035600281900b8114611d3257600080fd5b6020815260006126f68384612318565b6040602085015261270b606085018284612361565b915050602084013561017e1985360301811261272657600080fd5b838203601f1901604085015284016101806127518361274484611d27565b6001600160a01b03169052565b6020820135602084015261276b6040840160408401612684565b61277760a083016126d4565b61278660a085018260020b9052565b5061279360c083016126d4565b6127a260c085018260020b9052565b5060e082810135908401526101008083013590840152610120808301359084015261014080830135908401526101606127dd81840184611ff3565b935082828601526127f18386018583612039565b98975050505050505050565b602081526000610fd7602083018486612182565b60008235605e1983360301811261230e57600080fd5b612831818561260f565b606060408201526000612848606083018486612039565b95945050505050565b60008235609e1983360301811261230e57600080fd5b60008235607e1983360301811261230e57600080fd5b60006020828403121561288f57600080fd5b81356001600160801b0381168114611f4457600080fd5b6128b0828261260f565b60408101356128be81611d0f565b6001600160a01b03166040830152606090810135910152565b60006101006128e6838b6128a6565b8060808401526128f9818401898b612182565b6001600160801b0388811660a0860152871660c085015283810360e08501529050612925818587612039565b9a9950505050505050505050565b61293d81856128a6565b60a06080820152600061284860a08301848661203956fea2646970667358221220876c3f362441486d51a1da6fe093846e1c3fa9739e612bf7e0532bbee3fe7edd64736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000233d9067677dcf1a161954d45b4c965b9d567168000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c990000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b00000000000000000000000023eb5ce64769b969b58f008154d396957a7ade3b00000000000000000000000046292986df2fee3a048dd6753918e62e93806c2d00000000000000000000000034f895a2b90e60721a046a7cbf330ca74070968c000000000000000000000000ac371d6e651b6450ea8c4ce346ddd44b62d851b5
-----Decoded View---------------
Arg [0] : factory (address): 0x233D9067677dCf1a161954D45B4C965B9d567168
Arg [1] : connectorRegistry (address): 0xc6013E57a0811C7111A8fB07ACd2E248D9489C99
Arg [2] : libraries (tuple):
Arg [1] : transferLib (address): 0x0626Bd067fF557AE86Ee5c7CE44281aDbf10298B
Arg [2] : swapLib (address): 0x23eb5CE64769b969b58f008154d396957A7aDE3b
Arg [3] : feesLib (address): 0x46292986Df2FEE3a048Dd6753918e62e93806C2d
Arg [4] : zapLib (address): 0x34f895A2b90e60721A046a7cbf330cA74070968C
Arg [5] : nftZapLib (address): 0xAc371D6E651b6450ea8c4cE346Ddd44B62d851B5
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000233d9067677dcf1a161954d45b4c965b9d567168
Arg [1] : 000000000000000000000000c6013e57a0811c7111a8fb07acd2e248d9489c99
Arg [2] : 0000000000000000000000000626bd067ff557ae86ee5c7ce44281adbf10298b
Arg [3] : 00000000000000000000000023eb5ce64769b969b58f008154d396957a7ade3b
Arg [4] : 00000000000000000000000046292986df2fee3a048dd6753918e62e93806c2d
Arg [5] : 00000000000000000000000034f895a2b90e60721a046a7cbf330ca74070968c
Arg [6] : 000000000000000000000000ac371d6e651b6450ea8c4ce346ddd44b62d851b5
Net Worth in USD
Net Worth in ETH
Multichain Portfolio | 35 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.