Source Code
Latest 25 from a total of 89 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Compound For | 13854955 | 403 days ago | IN | 0 FRAX | 0.00001079 | ||||
| Rebalance For | 13852452 | 403 days ago | IN | 0 FRAX | 0.00000745 | ||||
| Rebalance For | 13851753 | 403 days ago | IN | 0 FRAX | 0.00000646 | ||||
| Rebalance For | 13851662 | 403 days ago | IN | 0 FRAX | 0.0000071 | ||||
| Compound For | 13851238 | 403 days ago | IN | 0 FRAX | 0.0000052 | ||||
| Compound For | 13851176 | 403 days ago | IN | 0 FRAX | 0.00000481 | ||||
| Harvest For | 13848898 | 403 days ago | IN | 0 FRAX | 0.0000019 | ||||
| Rebalance For | 13844645 | 404 days ago | IN | 0 FRAX | 0.00000659 | ||||
| Rebalance For | 13844555 | 404 days ago | IN | 0 FRAX | 0.00000656 | ||||
| Compound For | 13844010 | 404 days ago | IN | 0 FRAX | 0.00000487 | ||||
| Compound For | 13843249 | 404 days ago | IN | 0 FRAX | 0.00000685 | ||||
| Compound For | 13842157 | 404 days ago | IN | 0 FRAX | 0.00000655 | ||||
| Rebalance For | 13835960 | 404 days ago | IN | 0 FRAX | 0.00000686 | ||||
| Compound For | 13835786 | 404 days ago | IN | 0 FRAX | 0.00000555 | ||||
| Compound For | 13835754 | 404 days ago | IN | 0 FRAX | 0.00000576 | ||||
| Rebalance For | 13834961 | 404 days ago | IN | 0 FRAX | 0.00000842 | ||||
| Rebalance For | 13834928 | 404 days ago | IN | 0 FRAX | 0.00001421 | ||||
| Compound For | 13832802 | 404 days ago | IN | 0 FRAX | 0.00000731 | ||||
| Compound For | 13829833 | 404 days ago | IN | 0 FRAX | 0.00000704 | ||||
| Compound For | 13826971 | 404 days ago | IN | 0 FRAX | 0.00000782 | ||||
| Compound For | 13825421 | 404 days ago | IN | 0 FRAX | 0.00001076 | ||||
| Rebalance For | 13825389 | 404 days ago | IN | 0 FRAX | 0.00002301 | ||||
| Compound For | 13824448 | 404 days ago | IN | 0 FRAX | 0.00001026 | ||||
| Compound For | 13823476 | 404 days ago | IN | 0 FRAX | 0.00001314 | ||||
| Compound For | 13822731 | 404 days ago | IN | 0 FRAX | 0.00001437 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
Automation
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IUniswapV3Pool } from
"contracts/interfaces/external/uniswap/IUniswapV3Pool.sol";
import { Admin } from "contracts/base/Admin.sol";
import { NonDelegateMulticall } from "contracts/base/NonDelegateMulticall.sol";
import { Sickle } from "contracts/Sickle.sol";
import { SickleRegistry } from "contracts/SickleRegistry.sol";
import { IAutomation } from "contracts/interfaces/IAutomation.sol";
import { INftAutomation } from "contracts/interfaces/INftAutomation.sol";
import {
NftRebalance,
NftPosition,
NftHarvest,
NftWithdraw,
NftCompound
} from "contracts/structs/NftFarmStrategyStructs.sol";
import {
Farm,
HarvestParams,
WithdrawParams,
CompoundParams
} from "contracts/structs/FarmStrategyStructs.sol";
// @title Automation contract for automating farming strategies
// @notice This contract allows users to automate their farming strategies
// by enabling auto-compound or auto-harvest for non-NFT positions.
// Only one of Auto-Compound or Auto-Harvest can be enabled:
// all user positions will be either auto-compounded or auto-harvested.
// For NFT positions, all automation settings are handled by NftSettingsRegistry
// instead.
// The contract also allows an approved automator to compound, harvest, exit or
// rebalance farming positions on behalf of users.
// @dev This contract is expected to be used by an external automation bot
// that will call the compoundFor, harvestFor, and rebalanceFor functions.
// The automation bot is expected to be the EOA of the approved automator.
// The approved automator is set by the protocol admin.
contract Automation is Admin, NonDelegateMulticall {
error InvalidInputLength();
error NotApprovedAutomator();
event HarvestedFor(
Sickle indexed sickle,
address indexed stakingContract,
uint256 indexed poolIndex
);
event CompoundedFor(
Sickle indexed sickle,
address indexed claimStakingContract,
uint256 claimPoolIndex,
address indexed depositStakingContract,
uint256 depositPoolIndex
);
event ExitedFor(
Sickle indexed sickle,
address indexed stakingContract,
uint256 indexed poolIndex
);
event NftHarvestedFor(
Sickle indexed sickle,
address indexed nftAddress,
uint256 indexed tokenId
);
event NftCompoundedFor(
Sickle indexed sickle,
address indexed nftAddress,
uint256 indexed tokenId
);
event NftExitedFor(
Sickle indexed sickle,
address indexed nftAddress,
uint256 indexed tokenId
);
event NftRebalancedFor(
Sickle indexed sickle,
address indexed nftAddress,
uint256 indexed tokenId
);
event ApprovedAutomatorSet(address approvedAutomator);
address payable public approvedAutomator;
constructor(
SickleRegistry registry_,
address payable approvedAutomator_,
address admin_
) Admin(admin_) NonDelegateMulticall(registry_) {
approvedAutomator = approvedAutomator_;
}
modifier onlyApprovedAutomator() {
if (msg.sender != approvedAutomator) revert NotApprovedAutomator();
_;
}
// Admin functions
/// @notice Update approved automator address.
/// @dev Controls which external address is allowed to
/// compound farming positions for Sickles. This is expected to be the EOA
/// of an automation bot.
/// @custom:access Restricted to protocol admin.
function setApprovedAutomator(
address payable approvedAutomator_
) external onlyAdmin {
approvedAutomator = approvedAutomator_;
emit ApprovedAutomatorSet(approvedAutomator_);
}
// Automator functions
function compoundFor(
IAutomation[] memory strategies,
Sickle[] memory sickles,
CompoundParams[] memory params,
address[][] memory sweepTokens
) external onlyApprovedAutomator {
uint256 strategiesLength = strategies.length;
if (
strategiesLength != sickles.length
|| strategiesLength != params.length
|| strategiesLength != sweepTokens.length
) {
revert InvalidInputLength();
}
address[] memory targets = new address[](strategiesLength);
bytes[] memory data = new bytes[](strategiesLength);
for (uint256 i; i < strategiesLength; i++) {
Sickle sickle = sickles[i];
CompoundParams memory param = params[i];
targets[i] = address(strategies[i]);
data[i] = abi.encodeCall(
IAutomation.compoundFor, (sickle, param, sweepTokens[i])
);
emit CompoundedFor(
sickle,
param.claimFarm.stakingContract,
param.claimFarm.poolIndex,
param.depositFarm.stakingContract,
param.depositFarm.poolIndex
);
}
this.multicall(targets, data);
}
function harvestFor(
IAutomation[] memory strategies,
Sickle[] memory sickles,
Farm[] memory farms,
HarvestParams[] memory params,
address[][] memory sweepTokens
) external onlyApprovedAutomator {
uint256 strategiesLength = strategies.length;
if (
strategiesLength != sickles.length
|| strategiesLength != params.length
|| strategiesLength != sweepTokens.length
) {
revert InvalidInputLength();
}
address[] memory targets = new address[](strategiesLength);
bytes[] memory data = new bytes[](strategiesLength);
for (uint256 i; i < strategiesLength; i++) {
Sickle sickle = sickles[i];
Farm memory farm = farms[i];
HarvestParams memory param = params[i];
targets[i] = address(strategies[i]);
data[i] = abi.encodeCall(
IAutomation.harvestFor, (sickle, farm, param, sweepTokens[i])
);
emit HarvestedFor(sickle, farm.stakingContract, farm.poolIndex);
}
this.multicall(targets, data);
}
function exitFor(
IAutomation[] memory strategies,
Sickle[] memory sickles,
Farm[] memory farms,
HarvestParams[] memory harvestParams,
address[][] memory harvestSweepTokens,
WithdrawParams[] memory withdrawParams,
address[][] memory withdrawSweepTokens
) external onlyApprovedAutomator {
uint256 strategiesLength = strategies.length;
if (
strategiesLength != sickles.length
|| strategiesLength != farms.length
|| strategiesLength != harvestParams.length
|| strategiesLength != withdrawParams.length
|| strategiesLength != harvestSweepTokens.length
|| strategiesLength != withdrawSweepTokens.length
) {
revert InvalidInputLength();
}
address[] memory targets = new address[](strategiesLength);
bytes[] memory data = new bytes[](strategiesLength);
for (uint256 i; i < strategiesLength; i++) {
targets[i] = address(strategies[i]);
data[i] = abi.encodeCall(
IAutomation.exitFor,
(
sickles[i],
farms[i],
harvestParams[i],
harvestSweepTokens[i],
withdrawParams[i],
withdrawSweepTokens[i]
)
);
emit ExitedFor(
sickles[i], farms[i].stakingContract, farms[i].poolIndex
);
}
this.multicall(targets, data);
}
// NFT Automator functions
// Validation is done in the NftAutomation contract
function harvestFor(
INftAutomation[] memory strategies,
Sickle[] memory sickles,
NftPosition[] memory positions,
NftHarvest[] memory params
) external onlyApprovedAutomator {
uint256 strategiesLength = strategies.length;
if (
strategiesLength != sickles.length
|| strategiesLength != positions.length
|| strategiesLength != params.length
) {
revert InvalidInputLength();
}
address[] memory targets = new address[](strategiesLength);
bytes[] memory data = new bytes[](strategiesLength);
for (uint256 i; i < strategiesLength; i++) {
Sickle sickle = sickles[i];
NftPosition memory position = positions[i];
targets[i] = address(strategies[i]);
data[i] = abi.encodeCall(
INftAutomation.harvestFor, (sickle, position, params[i])
);
emit NftHarvestedFor(
sickle, address(position.nft), position.tokenId
);
}
this.multicall(targets, data);
}
function compoundFor(
INftAutomation[] memory strategies,
Sickle[] memory sickles,
NftPosition[] memory positions,
NftCompound[] memory params,
bool[] memory inPlace,
address[][] memory sweepTokens
) external onlyApprovedAutomator {
uint256 strategiesLength = strategies.length;
if (
strategiesLength != sickles.length
|| strategiesLength != positions.length
|| strategiesLength != params.length
|| strategiesLength != sweepTokens.length
) {
revert InvalidInputLength();
}
address[] memory targets = new address[](strategiesLength);
bytes[] memory data = new bytes[](strategiesLength);
for (uint256 i; i < strategiesLength; i++) {
Sickle sickle = sickles[i];
NftPosition memory position = positions[i];
targets[i] = address(strategies[i]);
data[i] = abi.encodeCall(
INftAutomation.compoundFor,
(sickle, position, params[i], inPlace[i], sweepTokens[i])
);
emit NftCompoundedFor(
sickle, address(position.nft), position.tokenId
);
}
this.multicall(targets, data);
}
function exitFor(
INftAutomation[] memory strategies,
Sickle[] memory sickles,
NftPosition[] memory positions,
NftHarvest[] memory harvestParams,
NftWithdraw[] memory withdrawParams,
address[][] memory sweepTokens
) external onlyApprovedAutomator {
uint256 strategiesLength = strategies.length;
if (
strategiesLength != sickles.length
|| strategiesLength != positions.length
|| strategiesLength != harvestParams.length
|| strategiesLength != withdrawParams.length
|| strategiesLength != sweepTokens.length
) {
revert InvalidInputLength();
}
address[] memory targets = new address[](strategiesLength);
bytes[] memory data = new bytes[](strategiesLength);
for (uint256 i; i < strategiesLength; i++) {
Sickle sickle = sickles[i];
NftPosition memory position = positions[i];
targets[i] = address(strategies[i]);
data[i] = abi.encodeCall(
INftAutomation.exitFor,
(
sickle,
position,
harvestParams[i],
withdrawParams[i],
sweepTokens[i]
)
);
emit NftExitedFor(sickle, address(position.nft), position.tokenId);
}
this.multicall(targets, data);
}
function rebalanceFor(
INftAutomation[] memory strategies,
Sickle[] memory sickles,
NftRebalance[] memory params,
address[][] memory sweepTokens
) external onlyApprovedAutomator {
uint256 strategiesLength = strategies.length;
if (
strategiesLength != sickles.length
|| strategiesLength != params.length
|| strategiesLength != sweepTokens.length
) {
revert InvalidInputLength();
}
address[] memory targets = new address[](strategiesLength);
bytes[] memory data = new bytes[](strategiesLength);
for (uint256 i; i < strategiesLength; i++) {
NftRebalance memory param = params[i];
Sickle sickle = sickles[i];
targets[i] = address(strategies[i]);
data[i] = abi.encodeCall(
INftAutomation.rebalanceFor, (sickle, param, sweepTokens[i])
);
emit NftRebalancedFor(
sickle, address(param.position.nft), param.position.tokenId
);
}
this.multicall(targets, data);
}
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Pool state that never changes
/// @notice These parameters are fixed for a pool forever, i.e., the methods
/// will always return the same values
interface IUniswapV3PoolImmutables {
/// @notice The contract that deployed the pool, which must adhere to the
/// IUniswapV3Factory interface
/// @return The contract address
function factory() external view returns (address);
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract address
function token1() external view returns (address);
/// @notice The pool's fee in hundredths of a bip, i.e. 1e-6
/// @return The fee
function fee() external view returns (uint24);
/// @notice The pool tick spacing
/// @dev Ticks can only be used at multiples of this value, minimum of 1 and
/// always positive
/// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick,
/// i.e., ..., -6, -3, 0, 3, 6, ...
/// This value is an int24 to avoid casting even though it is always
/// positive.
/// @return The tick spacing
function tickSpacing() external view returns (int24);
/// @notice The maximum amount of position liquidity that can use any tick
/// in the range
/// @dev This parameter is enforced per tick to prevent liquidity from
/// overflowing a uint128 at any point, and
/// also prevents out-of-range liquidity from being used to prevent adding
/// in-range liquidity to a pool
/// @return The max amount of liquidity per tick
function maxLiquidityPerTick() external view returns (uint128);
}
/// @title Pool state that can change
/// @notice These methods compose the pool's state, and can change with any
/// frequency including multiple times
/// per transaction
interface IUniswapV3PoolState {
/// @notice The 0th storage slot in the pool stores many values, and is
/// exposed as a single method to save gas
/// when accessed externally.
/// @return sqrtPriceX96 The current price of the pool as a
/// sqrt(token1/token0) Q64.96 value
/// @return tick The current tick of the pool, i.e. according to the last
/// tick transition that was run.
/// This value may not always be equal to
/// SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick
/// boundary.
/// @return observationIndex The index of the last oracle observation that
/// was written,
/// @return observationCardinality The current maximum number of
/// observations stored in the pool,
/// @return observationCardinalityNext The next maximum number of
/// observations, to be updated when the observation.
/// @return feeProtocol The protocol fee for both tokens of the pool.
/// Encoded as two 4 bit values, where the protocol fee of token1 is shifted
/// 4 bits and the protocol fee of token0
/// is the lower 4 bits. Used as the denominator of a fraction of the swap
/// fee, e.g. 4 means 1/4th of the swap fee.
/// unlocked Whether the pool is currently locked to reentrancy
function slot0()
external
view
returns (
uint160 sqrtPriceX96,
int24 tick,
uint16 observationIndex,
uint16 observationCardinality,
uint16 observationCardinalityNext,
uint8 feeProtocol,
bool unlocked
);
/// @notice The fee growth as a Q128.128 fees of token0 collected per unit
/// of liquidity for the entire life of the pool
/// @dev This value can overflow the uint256
function feeGrowthGlobal0X128() external view returns (uint256);
/// @notice The fee growth as a Q128.128 fees of token1 collected per unit
/// of liquidity for the entire life of the pool
/// @dev This value can overflow the uint256
function feeGrowthGlobal1X128() external view returns (uint256);
/// @notice The amounts of token0 and token1 that are owed to the protocol
/// @dev Protocol fees will never exceed uint128 max in either token
function protocolFees()
external
view
returns (uint128 token0, uint128 token1);
/// @notice The currently in range liquidity available to the pool
/// @dev This value has no relationship to the total liquidity across all
/// ticks
/// @return The liquidity at the current price of the pool
function liquidity() external view returns (uint128);
/// @notice Look up information about a specific tick in the pool
/// @param tick The tick to look up
/// @return liquidityGross the total amount of position liquidity that uses
/// the pool either as tick lower or
/// tick upper
/// @return liquidityNet how much liquidity changes when the pool price
/// crosses the tick,
/// @return feeGrowthOutside0X128 the fee growth on the other side of the
/// tick from the current tick in token0,
/// @return feeGrowthOutside1X128 the fee growth on the other side of the
/// tick from the current tick in token1,
/// @return tickCumulativeOutside the cumulative tick value on the other
/// side of the tick from the current tick
/// @return secondsPerLiquidityOutsideX128 the seconds spent per liquidity
/// on the other side of the tick from the current tick,
/// @return secondsOutside the seconds spent on the other side of the tick
/// from the current tick,
/// @return initialized Set to true if the tick is initialized, i.e.
/// liquidityGross is greater than 0, otherwise equal to false.
/// Outside values can only be used if the tick is initialized, i.e. if
/// liquidityGross is greater than 0.
/// In addition, these values are only relative and must be used only in
/// comparison to previous snapshots for
/// a specific position.
function ticks(int24 tick)
external
view
returns (
uint128 liquidityGross,
int128 liquidityNet,
uint256 feeGrowthOutside0X128,
uint256 feeGrowthOutside1X128,
int56 tickCumulativeOutside,
uint160 secondsPerLiquidityOutsideX128,
uint32 secondsOutside,
bool initialized
);
/// @notice Returns 256 packed tick initialized boolean values. See
/// TickBitmap for more information
function tickBitmap(int16 wordPosition) external view returns (uint256);
/// @notice Returns the information about a position by the position's key
/// @param key The position's key is a hash of a preimage composed by the
/// owner, tickLower and tickUpper
/// @return liquidity The amount of liquidity in the position,
/// @return feeGrowthInside0LastX128 fee growth of token0 inside the tick
/// range as of the last mint/burn/poke,
/// @return feeGrowthInside1LastX128 fee growth of token1 inside the tick
/// range as of the last mint/burn/poke,
/// @return tokensOwed0 the computed amount of token0 owed to the position
/// as of the last mint/burn/poke,
/// @return tokensOwed1 the computed amount of token1 owed to the position
/// as of the last mint/burn/poke
function positions(bytes32 key)
external
view
returns (
uint128 liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);
/// @notice Returns data about a specific observation index
/// @param index The element of the observations array to fetch
/// @dev You most likely want to use #observe() instead of this method to
/// get an observation as of some amount of time
/// ago, rather than at a specific index in the array.
/// @return blockTimestamp The timestamp of the observation,
/// @return tickCumulative the tick multiplied by seconds elapsed for the
/// life of the pool as of the observation timestamp,
/// @return secondsPerLiquidityCumulativeX128 the seconds per in range
/// liquidity for the life of the pool as of the observation timestamp,
/// @return initialized whether the observation has been initialized and the
/// values are safe to use
function observations(uint256 index)
external
view
returns (
uint32 blockTimestamp,
int56 tickCumulative,
uint160 secondsPerLiquidityCumulativeX128,
bool initialized
);
}
interface IUniswapV3Pool is IUniswapV3PoolImmutables, IUniswapV3PoolState {
function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
/// @title Admin contract
/// @author vfat.tools
/// @notice Provides an administration mechanism allowing restricted functions
abstract contract Admin {
/// ERRORS ///
/// @notice Thrown when the caller is not the admin
error NotAdminError(); //0xb5c42b3b
/// EVENTS ///
/// @notice Emitted when a new admin is set
/// @param oldAdmin Address of the old admin
/// @param newAdmin Address of the new admin
event AdminSet(address oldAdmin, address newAdmin);
/// STORAGE ///
/// @notice Address of the current admin
address public admin;
/// MODIFIERS ///
/// @dev Restricts a function to the admin
modifier onlyAdmin() {
if (msg.sender != admin) revert NotAdminError();
_;
}
/// WRITE FUNCTIONS ///
/// @param admin_ Address of the admin
constructor(address admin_) {
emit AdminSet(admin, admin_);
admin = admin_;
}
/// @notice Sets a new admin
/// @param newAdmin Address of the new admin
/// @custom:access Restricted to protocol admin.
function setAdmin(address newAdmin) external onlyAdmin {
emit AdminSet(admin, newAdmin);
admin = newAdmin;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { SickleStorage } from "contracts/base/SickleStorage.sol";
import { SickleRegistry } from "contracts/SickleRegistry.sol";
/// @title Multicall contract
/// @author vfat.tools
/// @notice Enables calling multiple methods in a single call to the contract
abstract contract NonDelegateMulticall is SickleStorage {
/// ERRORS ///
error MulticallParamsMismatchError(); // 0xc1e637c9
/// @notice Thrown when the target contract is not whitelisted
/// @param target Address of the non-whitelisted target
error TargetNotWhitelisted(address target); // 0x47ccabe7
/// @notice Thrown when the caller is not whitelisted
/// @param caller Address of the non-whitelisted caller
error CallerNotWhitelisted(address caller); // 0x252c8273
/// STORAGE ///
/// @notice Address of the SickleRegistry contract
/// @dev Needs to be immutable so that it's accessible for Sickle proxies
SickleRegistry public immutable registry;
/// INITIALIZATION ///
/// @param registry_ Address of the SickleRegistry contract
constructor(SickleRegistry registry_) initializer {
registry = registry_;
}
/// WRITE FUNCTIONS ///
/// @notice Batch multiple calls together (calls or delegatecalls)
/// @param targets Array of targets to call
/// @param data Array of data to pass with the calls
function multicall(
address[] calldata targets,
bytes[] calldata data
) external payable {
if (targets.length != data.length) {
revert MulticallParamsMismatchError();
}
if (!registry.isWhitelistedCaller(msg.sender)) {
revert CallerNotWhitelisted(msg.sender);
}
for (uint256 i = 0; i != data.length;) {
if (targets[i] == address(0)) {
unchecked {
++i;
}
continue; // No-op
}
if (targets[i] != address(this)) {
if (!registry.isWhitelistedTarget(targets[i])) {
revert TargetNotWhitelisted(targets[i]);
}
}
(bool success, bytes memory result) = targets[i].call(data[i]);
if (!success) {
if (result.length == 0) revert();
assembly {
revert(add(32, result), mload(result))
}
}
unchecked {
++i;
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { SickleStorage } from "contracts/base/SickleStorage.sol";
import { Multicall } from "contracts/base/Multicall.sol";
import { SickleRegistry } from "contracts/SickleRegistry.sol";
/// @title Sickle contract
/// @author vfat.tools
/// @notice Sickle facilitates farming and interactions with Masterchef
/// contracts
/// @dev Base contract inheriting from all the other "manager" contracts
contract Sickle is SickleStorage, Multicall {
/// @notice Function to receive ETH
receive() external payable { }
/// @param sickleRegistry_ Address of the SickleRegistry contract
constructor(
SickleRegistry sickleRegistry_
) initializer Multicall(sickleRegistry_) {
_Sickle_initialize(address(0), address(0));
}
/// @param sickleOwner_ Address of the Sickle owner
function initialize(
address sickleOwner_,
address approved_
) external initializer {
_Sickle_initialize(sickleOwner_, approved_);
}
/// INTERNALS ///
function _Sickle_initialize(
address sickleOwner_,
address approved_
) internal {
SickleStorage._SickleStorage_initialize(sickleOwner_, approved_);
}
function onERC721Received(
address, // operator
address, // from
uint256, // tokenId
bytes calldata // data
) external pure returns (bytes4) {
return this.onERC721Received.selector;
}
function onERC1155Received(
address, // operator
address, // from
uint256, // id
uint256, // value
bytes calldata // data
) external pure returns (bytes4) {
return this.onERC1155Received.selector;
}
function onERC1155BatchReceived(
address, // operator
address, // from
uint256[] calldata, // ids
uint256[] calldata, // values
bytes calldata // data
) external pure returns (bytes4) {
return this.onERC1155BatchReceived.selector;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { Admin } from "contracts/base/Admin.sol";
library SickleRegistryEvents {
event CollectorChanged(address newCollector);
event FeesUpdated(bytes32[] feeHashes, uint256[] feesInBP);
event ReferralCodeCreated(bytes32 indexed code, address indexed referrer);
// Multicall caller and target whitelist status changes
event CallerStatusChanged(address caller, bool isWhitelisted);
event TargetStatusChanged(address target, bool isWhitelisted);
}
/// @title SickleRegistry contract
/// @author vfat.tools
/// @notice Manages the whitelisted contracts and the collector address
contract SickleRegistry is Admin {
/// ERRORS ///
error ArrayLengthMismatch(); // 0xa24a13a6
error FeeAboveMaxLimit(); // 0xd6cf7b5e
error InvalidReferralCode(); // 0xe55b4629
/// STORAGE ///
/// @notice Address of the fee collector
address public collector;
/// @notice Tracks the contracts that can be called through Sickle multicall
/// @return True if the contract is a whitelisted target
mapping(address => bool) public isWhitelistedTarget;
/// @notice Tracks the contracts that can call Sickle multicall
/// @return True if the contract is a whitelisted caller
mapping(address => bool) public isWhitelistedCaller;
/// @notice Keeps track of the referrers and their associated code
mapping(bytes32 => address) public referralCodes;
/// @notice Mapping for fee hashes (hash of the strategy contract addresses
/// and the function selectors) and their associated fees
/// @return The fee in basis points to apply to the transaction amount
mapping(bytes32 => uint256) public feeRegistry;
/// WRITE FUNCTIONS ///
/// @param admin_ Address of the admin
/// @param collector_ Address of the collector
constructor(address admin_, address collector_) Admin(admin_) {
collector = collector_;
}
/// @notice Updates the whitelist status for multiple multicall targets
/// @param targets Addresses of the contracts to update
/// @param isApproved New status for the contracts
/// @custom:access Restricted to protocol admin.
function setWhitelistedTargets(
address[] calldata targets,
bool isApproved
) external onlyAdmin {
for (uint256 i; i < targets.length;) {
isWhitelistedTarget[targets[i]] = isApproved;
emit SickleRegistryEvents.TargetStatusChanged(
targets[i], isApproved
);
unchecked {
++i;
}
}
}
/// @notice Updates the fee collector address
/// @param newCollector Address of the new fee collector
/// @custom:access Restricted to protocol admin.
function updateCollector(address newCollector) external onlyAdmin {
collector = newCollector;
emit SickleRegistryEvents.CollectorChanged(newCollector);
}
/// @notice Update the whitelist status for multiple multicall callers
/// @param callers Addresses of the callers
/// @param isApproved New status for the caller
/// @custom:access Restricted to protocol admin.
function setWhitelistedCallers(
address[] calldata callers,
bool isApproved
) external onlyAdmin {
for (uint256 i; i < callers.length;) {
isWhitelistedCaller[callers[i]] = isApproved;
emit SickleRegistryEvents.CallerStatusChanged(
callers[i], isApproved
);
unchecked {
++i;
}
}
}
/// @notice Associates a referral code to the address of the caller
function setReferralCode(bytes32 referralCode) external {
if (referralCodes[referralCode] != address(0)) {
revert InvalidReferralCode();
}
referralCodes[referralCode] = msg.sender;
emit SickleRegistryEvents.ReferralCodeCreated(referralCode, msg.sender);
}
/// @notice Update the fees for multiple strategy functions
/// @param feeHashes Array of fee hashes
/// @param feesArray Array of fees to apply (in basis points)
/// @custom:access Restricted to protocol admin.
function setFees(
bytes32[] calldata feeHashes,
uint256[] calldata feesArray
) external onlyAdmin {
if (feeHashes.length != feesArray.length) {
revert ArrayLengthMismatch();
}
for (uint256 i = 0; i < feeHashes.length;) {
if (feesArray[i] <= 500) {
// maximum fee of 5%
feeRegistry[feeHashes[i]] = feesArray[i];
} else {
revert FeeAboveMaxLimit();
}
unchecked {
++i;
}
}
emit SickleRegistryEvents.FeesUpdated(feeHashes, feesArray);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { Sickle } from "contracts/Sickle.sol";
import {
Farm,
HarvestParams,
CompoundParams,
WithdrawParams
} from "contracts/structs/FarmStrategyStructs.sol";
interface IAutomation {
function harvestFor(
Sickle sickle,
Farm calldata farm,
HarvestParams calldata params,
address[] calldata sweepTokens
) external;
function compoundFor(
Sickle sickle,
CompoundParams calldata params,
address[] calldata sweepTokens
) external;
function exitFor(
Sickle sickle,
Farm calldata farm,
HarvestParams calldata harvestParams,
address[] calldata harvestSweepTokens,
WithdrawParams calldata withdrawParams,
address[] calldata withdrawSweepTokens
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { IUniswapV3Pool } from
"contracts/interfaces/external/uniswap/IUniswapV3Pool.sol";
import { Sickle } from "contracts/Sickle.sol";
import {
NftPosition,
NftRebalance,
NftHarvest,
NftWithdraw,
NftCompound
} from "contracts/structs/NftFarmStrategyStructs.sol";
interface INftAutomation {
function rebalanceFor(
Sickle sickle,
NftRebalance calldata rebalance,
address[] calldata sweepTokens
) external;
function harvestFor(
Sickle sickle,
NftPosition calldata position,
NftHarvest calldata params
) external;
function compoundFor(
Sickle sickle,
NftPosition calldata position,
NftCompound calldata params,
bool inPlace,
address[] memory sweepTokens
) external;
function exitFor(
Sickle sickle,
NftPosition calldata position,
NftHarvest calldata harvestParams,
NftWithdraw calldata withdrawParams,
address[] memory sweepTokens
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { IUniswapV3Pool } from
"contracts/interfaces/external/uniswap/IUniswapV3Pool.sol";
import { INonfungiblePositionManager } from
"contracts/interfaces/external/uniswap/INonfungiblePositionManager.sol";
import { NftZapIn, NftZapOut } from "contracts/structs/NftZapStructs.sol";
import { SwapParams } from "contracts/structs/LiquidityStructs.sol";
import { Farm } from "contracts/structs/FarmStrategyStructs.sol";
struct NftPosition {
Farm farm;
INonfungiblePositionManager nft;
uint256 tokenId;
}
struct NftIncrease {
address[] tokensIn;
uint256[] amountsIn;
NftZapIn zap;
bytes extraData;
}
struct NftDeposit {
Farm farm;
INonfungiblePositionManager nft;
NftIncrease increase;
}
struct NftWithdraw {
NftZapOut zap;
address[] tokensOut;
bytes extraData;
}
struct SimpleNftHarvest {
address[] rewardTokens;
uint128 amount0Max;
uint128 amount1Max;
bytes extraData;
}
struct NftHarvest {
SimpleNftHarvest harvest;
SwapParams[] swaps;
address[] outputTokens;
}
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 { ZapIn, ZapOut } from "contracts/libraries/ZapLib.sol";
import { SwapParams } from "contracts/structs/LiquidityStructs.sol";
struct Farm {
address stakingContract;
uint256 poolIndex;
}
struct DepositParams {
Farm farm;
address[] tokensIn;
uint256[] amountsIn;
ZapIn zap;
bytes extraData;
}
struct WithdrawParams {
bytes extraData;
ZapOut zap;
address[] tokensOut;
}
struct HarvestParams {
SwapParams[] swaps;
bytes extraData;
address[] tokensOut;
}
struct CompoundParams {
Farm claimFarm;
bytes claimExtraData;
address[] rewardTokens;
ZapIn zap;
Farm depositFarm;
bytes depositExtraData;
}
struct SimpleDepositParams {
Farm farm;
address lpToken;
uint256 amountIn;
bytes extraData;
}
struct SimpleHarvestParams {
address[] rewardTokens;
bytes extraData;
}
struct SimpleWithdrawParams {
address lpToken;
uint256 amountOut;
bytes extraData;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { Initializable } from
"@openzeppelin/contracts/proxy/utils/Initializable.sol";
library SickleStorageEvents {
event ApprovedAddressChanged(address newApproved);
}
/// @title SickleStorage contract
/// @author vfat.tools
/// @notice Base storage of the Sickle contract
/// @dev This contract needs to be inherited by stub contracts meant to be used
/// with `delegatecall`
abstract contract SickleStorage is Initializable {
/// ERRORS ///
/// @notice Thrown when the caller is not the owner of the Sickle contract
error NotOwnerError(); // 0x74a21527
/// @notice Thrown when the caller is not a strategy contract or the
/// Flashloan Stub
error NotStrategyError(); // 0x4581ba62
/// STORAGE ///
/// @notice Address of the owner
address public owner;
/// @notice An address that can be set by the owner of the Sickle contract
/// in order to trigger specific functions.
address public approved;
/// MODIFIERS ///
/// @dev Restricts a function call to the owner, however if the admin was
/// not set yet,
/// the modifier will not restrict the call, this allows the SickleFactory
/// to perform
/// some calls on the user's behalf before passing the admin rights to them
modifier onlyOwner() {
if (msg.sender != owner) revert NotOwnerError();
_;
}
/// INITIALIZATION ///
/// @param owner_ Address of the owner of this Sickle contract
function _SickleStorage_initialize(
address owner_,
address approved_
) internal onlyInitializing {
owner = owner_;
approved = approved_;
}
/// WRITE FUNCTIONS ///
/// @notice Sets the approved address of this Sickle
/// @param newApproved Address meant to be approved by the owner
function setApproved(address newApproved) external onlyOwner {
approved = newApproved;
emit SickleStorageEvents.ApprovedAddressChanged(newApproved);
}
/// @notice Checks if `caller` is either the owner of the Sickle contract
/// or was approved by them
/// @param caller Address to check
/// @return True if `caller` is either the owner of the Sickle contract
function isOwnerOrApproved(address caller) public view returns (bool) {
return caller == owner || caller == approved;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { SickleStorage } from "contracts/base/SickleStorage.sol";
import { SickleRegistry } from "contracts/SickleRegistry.sol";
/// @title Multicall contract
/// @author vfat.tools
/// @notice Enables calling multiple methods in a single call to the contract
abstract contract Multicall is SickleStorage {
/// ERRORS ///
error MulticallParamsMismatchError(); // 0xc1e637c9
/// @notice Thrown when the target contract is not whitelisted
/// @param target Address of the non-whitelisted target
error TargetNotWhitelisted(address target); // 0x47ccabe7
/// @notice Thrown when the caller is not whitelisted
/// @param caller Address of the non-whitelisted caller
error CallerNotWhitelisted(address caller); // 0x252c8273
/// STORAGE ///
/// @notice Address of the SickleRegistry contract
/// @dev Needs to be immutable so that it's accessible for Sickle proxies
SickleRegistry public immutable registry;
/// INITIALIZATION ///
/// @param registry_ Address of the SickleRegistry contract
constructor(SickleRegistry registry_) initializer {
registry = registry_;
}
/// WRITE FUNCTIONS ///
/// @notice Batch multiple calls together (calls or delegatecalls)
/// @param targets Array of targets to call
/// @param data Array of data to pass with the calls
function multicall(
address[] calldata targets,
bytes[] calldata data
) external payable {
if (targets.length != data.length) {
revert MulticallParamsMismatchError();
}
if (!registry.isWhitelistedCaller(msg.sender)) {
revert CallerNotWhitelisted(msg.sender);
}
for (uint256 i = 0; i != data.length;) {
if (targets[i] == address(0)) {
unchecked {
++i;
}
continue; // No-op
}
if (targets[i] != address(this)) {
if (!registry.isWhitelistedTarget(targets[i])) {
revert TargetNotWhitelisted(targets[i]);
}
}
(bool success, bytes memory result) =
targets[i].delegatecall(data[i]);
if (!success) {
if (result.length == 0) revert();
assembly {
revert(add(32, result), mload(result))
}
}
unchecked {
++i;
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IERC721Enumerable } from
"openzeppelin-contracts/contracts/interfaces/IERC721Enumerable.sol";
interface INonfungiblePositionManager is IERC721Enumerable {
struct IncreaseLiquidityParams {
uint256 tokenId;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}
struct MintParams {
address token0;
address token1;
uint24 fee;
int24 tickLower;
int24 tickUpper;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
address recipient;
uint256 deadline;
}
struct DecreaseLiquidityParams {
uint256 tokenId;
uint128 liquidity;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}
struct CollectParams {
uint256 tokenId;
address recipient;
uint128 amount0Max;
uint128 amount1Max;
}
function increaseLiquidity(IncreaseLiquidityParams memory params)
external
payable
returns (uint256 amount0, uint256 amount1, uint256 liquidity);
function decreaseLiquidity(DecreaseLiquidityParams calldata params)
external
payable
returns (uint256 amount0, uint256 amount1);
function mint(MintParams memory params)
external
payable
returns (uint256 tokenId, uint256 amount0, uint256 amount1);
function collect(CollectParams calldata params)
external
payable
returns (uint256 amount0, uint256 amount1);
function burn(uint256 tokenId) external payable;
function positions(uint256 tokenId)
external
view
returns (
uint96 nonce,
address operator,
address token0,
address token1,
uint24 fee,
int24 tickLower,
int24 tickUpper,
uint128 liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { SwapParams } from "contracts/structs/LiquidityStructs.sol";
import {
NftAddLiquidity,
NftRemoveLiquidity
} from "contracts/structs/NftLiquidityStructs.sol";
struct NftZapIn {
SwapParams[] swaps;
NftAddLiquidity addLiquidityParams;
}
struct NftZapOut {
NftRemoveLiquidity removeLiquidityParams;
SwapParams[] swaps;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
struct AddLiquidityParams {
address router;
address lpToken;
address[] tokens;
uint256[] desiredAmounts;
uint256[] minAmounts;
bytes extraData;
}
struct RemoveLiquidityParams {
address router;
address lpToken;
address[] tokens;
uint256 lpAmountIn;
uint256[] minAmountsOut;
bytes extraData;
}
struct SwapParams {
address router;
uint256 amountIn;
uint256 minAmountOut;
address tokenIn;
bytes extraData;
}
struct GetAmountOutParams {
address router;
address lpToken;
address tokenIn;
address tokenOut;
uint256 amountIn;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeTransferLib } from "solmate/utils/SafeTransferLib.sol";
import {
SwapParams,
AddLiquidityParams
} from "contracts/structs/LiquidityStructs.sol";
import { ILiquidityConnector } from
"contracts/interfaces/ILiquidityConnector.sol";
import { ConnectorRegistry } from "contracts/ConnectorRegistry.sol";
import { DelegateModule } from "contracts/modules/DelegateModule.sol";
import { ZapIn, ZapOut } from "contracts/structs/ZapStructs.sol";
import { IZapLib } from "contracts/interfaces/libraries/IZapLib.sol";
import { ISwapLib } from "contracts/interfaces/libraries/ISwapLib.sol";
contract ZapLib is DelegateModule, IZapLib {
error LiquidityAmountError(); // 0x4d0ab6b4
ISwapLib public immutable swapLib;
ConnectorRegistry public immutable connectorRegistry;
constructor(ConnectorRegistry connectorRegistry_, ISwapLib swapLib_) {
connectorRegistry = connectorRegistry_;
swapLib = swapLib_;
}
function zapIn(
ZapIn memory zap
) external payable {
uint256 swapDataLength = zap.swaps.length;
for (uint256 i; i < swapDataLength;) {
_delegateTo(
address(swapLib), abi.encodeCall(ISwapLib.swap, (zap.swaps[i]))
);
unchecked {
i++;
}
}
if (zap.addLiquidityParams.lpToken == address(0)) {
return;
}
bool atLeastOneNonZero = false;
AddLiquidityParams memory addLiquidityParams = zap.addLiquidityParams;
uint256 addLiquidityParamsTokensLength =
addLiquidityParams.tokens.length;
for (uint256 i; i < addLiquidityParamsTokensLength; i++) {
if (addLiquidityParams.tokens[i] == address(0)) {
continue;
}
if (addLiquidityParams.desiredAmounts[i] == 0) {
addLiquidityParams.desiredAmounts[i] = IERC20(
addLiquidityParams.tokens[i]
).balanceOf(address(this));
}
if (addLiquidityParams.desiredAmounts[i] > 0) {
atLeastOneNonZero = true;
// In case there is USDT or similar dust approval, revoke it
SafeTransferLib.safeApprove(
addLiquidityParams.tokens[i], addLiquidityParams.router, 0
);
SafeTransferLib.safeApprove(
addLiquidityParams.tokens[i],
addLiquidityParams.router,
addLiquidityParams.desiredAmounts[i]
);
}
}
if (!atLeastOneNonZero) {
revert LiquidityAmountError();
}
address routerConnector =
connectorRegistry.connectorOf(addLiquidityParams.router);
_delegateTo(
routerConnector,
abi.encodeCall(
ILiquidityConnector.addLiquidity, (addLiquidityParams)
)
);
for (uint256 i; i < addLiquidityParamsTokensLength;) {
if (addLiquidityParams.tokens[i] != address(0)) {
// Revoke any dust approval in case the amount was estimated
SafeTransferLib.safeApprove(
addLiquidityParams.tokens[i], addLiquidityParams.router, 0
);
}
unchecked {
i++;
}
}
}
function zapOut(
ZapOut memory zap
) external {
if (zap.removeLiquidityParams.lpToken != address(0)) {
if (zap.removeLiquidityParams.lpAmountIn > 0) {
SafeTransferLib.safeApprove(
zap.removeLiquidityParams.lpToken,
zap.removeLiquidityParams.router,
zap.removeLiquidityParams.lpAmountIn
);
}
address routerConnector =
connectorRegistry.connectorOf(zap.removeLiquidityParams.router);
_delegateTo(
address(routerConnector),
abi.encodeCall(
ILiquidityConnector.removeLiquidity,
zap.removeLiquidityParams
)
);
}
uint256 swapDataLength = zap.swaps.length;
for (uint256 i; i < swapDataLength;) {
_delegateTo(
address(swapLib), abi.encodeCall(ISwapLib.swap, (zap.swaps[i]))
);
unchecked {
i++;
}
}
}
}// SPDX-License-Identifier: MIT
// 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 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 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.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
import {ERC20} from "../tokens/ERC20.sol";
/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.
/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.
library SafeTransferLib {
/*//////////////////////////////////////////////////////////////
ERRORS
//////////////////////////////////////////////////////////////*/
error ETHTransferFailed();
error TransferFromFailed();
error TransferFailed();
error ApproveFailed();
/*//////////////////////////////////////////////////////////////
ETH OPERATIONS
//////////////////////////////////////////////////////////////*/
function safeTransferETH(address to, uint256 amount) internal {
bool success;
/// @solidity memory-safe-assembly
assembly {
// Transfer the ETH and store if it succeeded or not.
success := call(gas(), to, amount, 0, 0, 0, 0)
}
if (!success) revert ETHTransferFailed();
}
/*//////////////////////////////////////////////////////////////
ERC20 OPERATIONS
//////////////////////////////////////////////////////////////*/
function safeTransferFrom(
address token,
address from,
address to,
uint256 amount
) internal {
bool success;
/// @solidity memory-safe-assembly
assembly {
// Get a pointer to some free memory.
let freeMemoryPointer := mload(0x40)
// Write the abi-encoded calldata into memory, beginning with the function selector.
mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)
mstore(add(freeMemoryPointer, 4), from) // Append the "from" argument.
mstore(add(freeMemoryPointer, 36), to) // Append the "to" argument.
mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument.
success := and(
// Set success to whether the call reverted, if not we check it either
// returned exactly 1 (can't just be non-zero data), or had no return data.
or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
// We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.
// We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
// Counterintuitively, this call must be positioned second to the or() call in the
// surrounding and() call or else returndatasize() will be zero during the computation.
call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)
)
}
if (!success) revert TransferFromFailed();
}
function safeTransfer(
address token,
address to,
uint256 amount
) internal {
bool success;
/// @solidity memory-safe-assembly
assembly {
// Get a pointer to some free memory.
let freeMemoryPointer := mload(0x40)
// Write the abi-encoded calldata into memory, beginning with the function selector.
mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)
mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument.
mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument.
success := and(
// Set success to whether the call reverted, if not we check it either
// returned exactly 1 (can't just be non-zero data), or had no return data.
or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
// We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
// We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
// Counterintuitively, this call must be positioned second to the or() call in the
// surrounding and() call or else returndatasize() will be zero during the computation.
call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
)
}
if (!success) revert TransferFailed();
}
function safeApprove(
address token,
address to,
uint256 amount
) internal {
bool success;
/// @solidity memory-safe-assembly
assembly {
// Get a pointer to some free memory.
let freeMemoryPointer := mload(0x40)
// Write the abi-encoded calldata into memory, beginning with the function selector.
mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)
mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument.
mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument.
success := and(
// Set success to whether the call reverted, if not we check it either
// returned exactly 1 (can't just be non-zero data), or had no return data.
or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
// We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
// We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
// Counterintuitively, this call must be positioned second to the or() call in the
// surrounding and() call or else returndatasize() will be zero during the computation.
call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
)
}
if (!success) revert ApproveFailed();
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {
AddLiquidityParams,
RemoveLiquidityParams,
SwapParams,
GetAmountOutParams
} from "contracts/structs/LiquidityStructs.sol";
interface ILiquidityConnector {
function addLiquidity(
AddLiquidityParams memory addLiquidityParams
) external payable;
function removeLiquidity(
RemoveLiquidityParams memory removeLiquidityParams
) external;
function swapExactTokensForTokens(
SwapParams memory swap
) external payable;
function getAmountOut(
GetAmountOutParams memory getAmountOutParams
) external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { Admin } from "contracts/base/Admin.sol";
import { TimelockAdmin } from "contracts/base/TimelockAdmin.sol";
error ConnectorNotRegistered(address target);
interface ICustomConnectorRegistry {
function connectorOf(address target) external view returns (address);
}
contract ConnectorRegistry is Admin, TimelockAdmin {
event ConnectorChanged(address target, address connector);
event CustomRegistryAdded(address registry);
event CustomRegistryRemoved(address registry);
error ConnectorAlreadySet(address target);
error ConnectorNotSet(address target);
ICustomConnectorRegistry[] public customRegistries;
mapping(ICustomConnectorRegistry => bool) public isCustomRegistry;
mapping(address target => address connector) private connectors_;
constructor(
address admin_,
address timelockAdmin_
) Admin(admin_) TimelockAdmin(timelockAdmin_) { }
/// @notice Update connector addresses for a batch of targets.
/// @dev Controls which connector contracts are used for the specified
/// targets.
/// @custom:access Restricted to protocol admin.
function setConnectors(
address[] calldata targets,
address[] calldata connectors
) external onlyAdmin {
for (uint256 i; i != targets.length;) {
if (connectors_[targets[i]] != address(0)) {
revert ConnectorAlreadySet(targets[i]);
}
connectors_[targets[i]] = connectors[i];
emit ConnectorChanged(targets[i], connectors[i]);
unchecked {
++i;
}
}
}
function updateConnectors(
address[] calldata targets,
address[] calldata connectors
) external onlyTimelockAdmin {
for (uint256 i; i != targets.length;) {
if (connectors_[targets[i]] == address(0)) {
revert ConnectorNotSet(targets[i]);
}
connectors_[targets[i]] = connectors[i];
emit ConnectorChanged(targets[i], connectors[i]);
unchecked {
++i;
}
}
}
/// @notice Append an address to the custom registries list.
/// @custom:access Restricted to protocol admin.
function addCustomRegistry(ICustomConnectorRegistry registry)
external
onlyAdmin
{
customRegistries.push(registry);
isCustomRegistry[registry] = true;
emit CustomRegistryAdded(address(registry));
}
/// @notice Replace an address in the custom registries list.
/// @custom:access Restricted to protocol admin.
function updateCustomRegistry(
uint256 index,
ICustomConnectorRegistry newRegistry
) external onlyTimelockAdmin {
address oldRegistry = address(customRegistries[index]);
isCustomRegistry[customRegistries[index]] = false;
emit CustomRegistryRemoved(oldRegistry);
customRegistries[index] = newRegistry;
isCustomRegistry[newRegistry] = true;
if (address(newRegistry) != address(0)) {
emit CustomRegistryAdded(address(newRegistry));
}
}
function connectorOf(address target) external view returns (address) {
address connector = connectors_[target];
if (connector != address(0)) {
return connector;
}
uint256 length = customRegistries.length;
for (uint256 i; i != length;) {
if (address(customRegistries[i]) != address(0)) {
try customRegistries[i].connectorOf(target) returns (
address _connector
) {
if (_connector != address(0)) {
return _connector;
}
} catch {
// Ignore
}
}
unchecked {
++i;
}
}
revert ConnectorNotRegistered(target);
}
function hasConnector(address target) external view returns (bool) {
if (connectors_[target] != address(0)) {
return true;
}
uint256 length = customRegistries.length;
for (uint256 i; i != length;) {
if (address(customRegistries[i]) != address(0)) {
try customRegistries[i].connectorOf(target) returns (
address _connector
) {
if (_connector != address(0)) {
return true;
}
} catch {
// Ignore
}
unchecked {
++i;
}
}
}
return false;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
contract DelegateModule {
function _delegateTo(
address to,
bytes memory data
) internal returns (bytes memory) {
(bool success, bytes memory result) = to.delegatecall(data);
if (!success) {
if (result.length == 0) revert();
assembly {
revert(add(32, result), mload(result))
}
}
return result;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {
SwapParams,
AddLiquidityParams,
RemoveLiquidityParams
} from "contracts/structs/LiquidityStructs.sol";
struct ZapIn {
SwapParams[] swaps;
AddLiquidityParams addLiquidityParams;
}
struct ZapOut {
RemoveLiquidityParams removeLiquidityParams;
SwapParams[] swaps;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { ZapIn, ZapOut } from "contracts/structs/ZapStructs.sol";
interface IZapLib {
function zapIn(
ZapIn memory zap
) external payable;
function zapOut(
ZapOut memory zap
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { SwapParams } from "contracts/structs/LiquidityStructs.sol";
interface ISwapLib {
function swap(
SwapParams memory swap
) external payable;
function swapMultiple(
SwapParams[] memory swaps
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.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: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
/*//////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(address indexed owner, address indexed spender, uint256 amount);
/*//////////////////////////////////////////////////////////////
METADATA STORAGE
//////////////////////////////////////////////////////////////*/
string public name;
string public symbol;
uint8 public immutable decimals;
/*//////////////////////////////////////////////////////////////
ERC20 STORAGE
//////////////////////////////////////////////////////////////*/
uint256 public totalSupply;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
/*//////////////////////////////////////////////////////////////
EIP-2612 STORAGE
//////////////////////////////////////////////////////////////*/
uint256 internal immutable INITIAL_CHAIN_ID;
bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;
mapping(address => uint256) public nonces;
/*//////////////////////////////////////////////////////////////
CONSTRUCTOR
//////////////////////////////////////////////////////////////*/
constructor(
string memory _name,
string memory _symbol,
uint8 _decimals
) {
name = _name;
symbol = _symbol;
decimals = _decimals;
INITIAL_CHAIN_ID = block.chainid;
INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
}
/*//////////////////////////////////////////////////////////////
ERC20 LOGIC
//////////////////////////////////////////////////////////////*/
function approve(address spender, uint256 amount) public virtual returns (bool) {
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transfer(address to, uint256 amount) public virtual returns (bool) {
balanceOf[msg.sender] -= amount;
// Cannot overflow because the sum of all user
// balances can't exceed the max uint256 value.
unchecked {
balanceOf[to] += amount;
}
emit Transfer(msg.sender, to, amount);
return true;
}
function transferFrom(
address from,
address to,
uint256 amount
) public virtual returns (bool) {
uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.
if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;
balanceOf[from] -= amount;
// Cannot overflow because the sum of all user
// balances can't exceed the max uint256 value.
unchecked {
balanceOf[to] += amount;
}
emit Transfer(from, to, amount);
return true;
}
/*//////////////////////////////////////////////////////////////
EIP-2612 LOGIC
//////////////////////////////////////////////////////////////*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) public virtual {
require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");
// Unchecked because the only math done is incrementing
// the owner's nonce which cannot realistically overflow.
unchecked {
address recoveredAddress = ecrecover(
keccak256(
abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR(),
keccak256(
abi.encode(
keccak256(
"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
),
owner,
spender,
value,
nonces[owner]++,
deadline
)
)
)
),
v,
r,
s
);
require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");
allowance[recoveredAddress][spender] = value;
}
emit Approval(owner, spender, value);
}
function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
}
function computeDomainSeparator() internal view virtual returns (bytes32) {
return
keccak256(
abi.encode(
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
keccak256(bytes(name)),
keccak256("1"),
block.chainid,
address(this)
)
);
}
/*//////////////////////////////////////////////////////////////
INTERNAL MINT/BURN LOGIC
//////////////////////////////////////////////////////////////*/
function _mint(address to, uint256 amount) internal virtual {
totalSupply += amount;
// Cannot overflow because the sum of all user
// balances can't exceed the max uint256 value.
unchecked {
balanceOf[to] += amount;
}
emit Transfer(address(0), to, amount);
}
function _burn(address from, uint256 amount) internal virtual {
balanceOf[from] -= amount;
// Cannot underflow because a user's balance
// will never be larger than the total supply.
unchecked {
totalSupply -= amount;
}
emit Transfer(from, address(0), amount);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
/// @title TimelockAdmin contract
/// @author vfat.tools
/// @notice Provides an timelockAdministration mechanism allowing restricted
/// functions
abstract contract TimelockAdmin {
/// ERRORS ///
/// @notice Thrown when the caller is not the timelockAdmin
error NotTimelockAdminError();
/// EVENTS ///
/// @notice Emitted when a new timelockAdmin is set
/// @param oldTimelockAdmin Address of the old timelockAdmin
/// @param newTimelockAdmin Address of the new timelockAdmin
event TimelockAdminSet(address oldTimelockAdmin, address newTimelockAdmin);
/// STORAGE ///
/// @notice Address of the current timelockAdmin
address public timelockAdmin;
/// MODIFIERS ///
/// @dev Restricts a function to the timelockAdmin
modifier onlyTimelockAdmin() {
if (msg.sender != timelockAdmin) revert NotTimelockAdminError();
_;
}
/// WRITE FUNCTIONS ///
/// @param timelockAdmin_ Address of the timelockAdmin
constructor(address timelockAdmin_) {
emit TimelockAdminSet(timelockAdmin, timelockAdmin_);
timelockAdmin = timelockAdmin_;
}
/// @notice Sets a new timelockAdmin
/// @dev Can only be called by the current timelockAdmin
/// @param newTimelockAdmin Address of the new timelockAdmin
function setTimelockAdmin(address newTimelockAdmin)
external
onlyTimelockAdmin
{
emit TimelockAdminSet(timelockAdmin, newTimelockAdmin);
timelockAdmin = newTimelockAdmin;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts 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/",
"@uniswap/v3-periphery/=lib/v3-periphery/",
"@uniswap/v3-core/=lib/v3-core/",
"@morpho-blue/=lib/morpho-blue/src/",
"ds-test/=lib/solmate/lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"morpho-blue/=lib/morpho-blue/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract SickleRegistry","name":"registry_","type":"address"},{"internalType":"address payable","name":"approvedAutomator_","type":"address"},{"internalType":"address","name":"admin_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"CallerNotWhitelisted","type":"error"},{"inputs":[],"name":"InvalidInputLength","type":"error"},{"inputs":[],"name":"MulticallParamsMismatchError","type":"error"},{"inputs":[],"name":"NotAdminError","type":"error"},{"inputs":[],"name":"NotApprovedAutomator","type":"error"},{"inputs":[],"name":"NotOwnerError","type":"error"},{"inputs":[],"name":"NotStrategyError","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"TargetNotWhitelisted","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"approvedAutomator","type":"address"}],"name":"ApprovedAutomatorSet","type":"event"},{"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":"CompoundedFor","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":"ExitedFor","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":"HarvestedFor","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract Sickle","name":"sickle","type":"address"},{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"NftCompoundedFor","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract Sickle","name":"sickle","type":"address"},{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"NftExitedFor","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract Sickle","name":"sickle","type":"address"},{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"NftHarvestedFor","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract Sickle","name":"sickle","type":"address"},{"indexed":true,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"NftRebalancedFor","type":"event"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"approved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"approvedAutomator","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract INftAutomation[]","name":"strategies","type":"address[]"},{"internalType":"contract Sickle[]","name":"sickles","type":"address[]"},{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition[]","name":"positions","type":"tuple[]"},{"components":[{"components":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SimpleNftHarvest","name":"harvest","type":"tuple"},{"components":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"internalType":"struct Pool","name":"pool","type":"tuple"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint256","name":"amount0Desired","type":"uint256"},{"internalType":"uint256","name":"amount1Desired","type":"uint256"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftAddLiquidity","name":"addLiquidityParams","type":"tuple"}],"internalType":"struct NftZapIn","name":"zap","type":"tuple"}],"internalType":"struct NftCompound[]","name":"params","type":"tuple[]"},{"internalType":"bool[]","name":"inPlace","type":"bool[]"},{"internalType":"address[][]","name":"sweepTokens","type":"address[][]"}],"name":"compoundFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IAutomation[]","name":"strategies","type":"address[]"},{"internalType":"contract Sickle[]","name":"sickles","type":"address[]"},{"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":"address[]","name":"rewardTokens","type":"address[]"},{"components":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"components":[{"internalType":"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 CompoundParams[]","name":"params","type":"tuple[]"},{"internalType":"address[][]","name":"sweepTokens","type":"address[][]"}],"name":"compoundFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IAutomation[]","name":"strategies","type":"address[]"},{"internalType":"contract Sickle[]","name":"sickles","type":"address[]"},{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm[]","name":"farms","type":"tuple[]"},{"components":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"internalType":"bytes","name":"extraData","type":"bytes"},{"internalType":"address[]","name":"tokensOut","type":"address[]"}],"internalType":"struct HarvestParams[]","name":"harvestParams","type":"tuple[]"},{"internalType":"address[][]","name":"harvestSweepTokens","type":"address[][]"},{"components":[{"internalType":"bytes","name":"extraData","type":"bytes"},{"components":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"address","name":"lpToken","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256","name":"lpAmountIn","type":"uint256"},{"internalType":"uint256[]","name":"minAmountsOut","type":"uint256[]"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct RemoveLiquidityParams","name":"removeLiquidityParams","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"}],"internalType":"struct ZapOut","name":"zap","type":"tuple"},{"internalType":"address[]","name":"tokensOut","type":"address[]"}],"internalType":"struct WithdrawParams[]","name":"withdrawParams","type":"tuple[]"},{"internalType":"address[][]","name":"withdrawSweepTokens","type":"address[][]"}],"name":"exitFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract INftAutomation[]","name":"strategies","type":"address[]"},{"internalType":"contract Sickle[]","name":"sickles","type":"address[]"},{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition[]","name":"positions","type":"tuple[]"},{"components":[{"components":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SimpleNftHarvest","name":"harvest","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"internalType":"address[]","name":"outputTokens","type":"address[]"}],"internalType":"struct NftHarvest[]","name":"harvestParams","type":"tuple[]"},{"components":[{"components":[{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftRemoveLiquidity","name":"removeLiquidityParams","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"}],"internalType":"struct NftZapOut","name":"zap","type":"tuple"},{"internalType":"address[]","name":"tokensOut","type":"address[]"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftWithdraw[]","name":"withdrawParams","type":"tuple[]"},{"internalType":"address[][]","name":"sweepTokens","type":"address[][]"}],"name":"exitFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract INftAutomation[]","name":"strategies","type":"address[]"},{"internalType":"contract Sickle[]","name":"sickles","type":"address[]"},{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition[]","name":"positions","type":"tuple[]"},{"components":[{"components":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SimpleNftHarvest","name":"harvest","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"internalType":"address[]","name":"outputTokens","type":"address[]"}],"internalType":"struct NftHarvest[]","name":"params","type":"tuple[]"}],"name":"harvestFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IAutomation[]","name":"strategies","type":"address[]"},{"internalType":"contract Sickle[]","name":"sickles","type":"address[]"},{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm[]","name":"farms","type":"tuple[]"},{"components":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"internalType":"bytes","name":"extraData","type":"bytes"},{"internalType":"address[]","name":"tokensOut","type":"address[]"}],"internalType":"struct HarvestParams[]","name":"params","type":"tuple[]"},{"internalType":"address[][]","name":"sweepTokens","type":"address[][]"}],"name":"harvestFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"isOwnerOrApproved","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"targets","type":"address[]"},{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract INftAutomation[]","name":"strategies","type":"address[]"},{"internalType":"contract Sickle[]","name":"sickles","type":"address[]"},{"components":[{"internalType":"contract IUniswapV3Pool","name":"pool","type":"address"},{"components":[{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct NftPosition","name":"position","type":"tuple"},{"components":[{"components":[{"internalType":"address[]","name":"rewardTokens","type":"address[]"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SimpleNftHarvest","name":"harvest","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"internalType":"address[]","name":"outputTokens","type":"address[]"}],"internalType":"struct NftHarvest","name":"harvest","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftRemoveLiquidity","name":"removeLiquidityParams","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"}],"internalType":"struct NftZapOut","name":"zap","type":"tuple"},{"internalType":"address[]","name":"tokensOut","type":"address[]"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftWithdraw","name":"withdraw","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokensIn","type":"address[]"},{"internalType":"uint256[]","name":"amountsIn","type":"uint256[]"},{"components":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"internalType":"struct Pool","name":"pool","type":"tuple"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint256","name":"amount0Desired","type":"uint256"},{"internalType":"uint256","name":"amount1Desired","type":"uint256"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftAddLiquidity","name":"addLiquidityParams","type":"tuple"}],"internalType":"struct NftZapIn","name":"zap","type":"tuple"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftIncrease","name":"increase","type":"tuple"}],"internalType":"struct NftRebalance[]","name":"params","type":"tuple[]"},{"internalType":"address[][]","name":"sweepTokens","type":"address[][]"}],"name":"rebalanceFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"registry","outputs":[{"internalType":"contract SickleRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newApproved","type":"address"}],"name":"setApproved","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"approvedAutomator_","type":"address"}],"name":"setApprovedAutomator","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a06040523480156200001157600080fd5b50604051620043883803806200438883398101604081905262000034916200021b565b600054604080516001600160a01b0392831681529183166020830152849183917fbf265e8326285a2747e33e54d5945f7111f2b5edb826eb8c08d4677779b3ff97910160405180910390a1600080546001600160a01b0319166001600160a01b03929092169190911790819055600160a81b900460ff1615808015620000c757506000546001600160a01b90910460ff16105b80620000ea5750303b158015620000ea5750600054600160a01b900460ff166001145b620001525760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805460ff60a01b1916600160a01b179055801562000180576000805460ff60a81b1916600160a81b1790555b6001600160a01b0382166080528015620001d6576000805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050600380546001600160a01b0319166001600160a01b039390931692909217909155506200026f9050565b6001600160a01b03811681146200021857600080fd5b50565b6000806000606084860312156200023157600080fd5b83516200023e8162000202565b6020850151909350620002518162000202565b6040850151909250620002648162000202565b809150509250925092565b6080516140ef620002996000396000818161022701528181610cdd0152610df501526140ef6000f3fe6080604052600436106100fe5760003560e01c80637b10399911610095578063bd42d84811610064578063bd42d848146102a9578063eb87524c146102c9578063f5b3f424146102e9578063f851a44014610319578063fb0289ca1461033957600080fd5b80637b103999146102155780638da5cb5b14610249578063936b0aa6146102695780639969e9ee1461028957600080fd5b80634179eebc116100d15780634179eebc146101a257806363fb0b96146101c2578063704b6c02146101d5578063745a7b3b146101f557600080fd5b806319d40b08146101035780631c0efeab14610140578063216f5a891461016257806329df02cf14610182575b600080fd5b34801561010f57600080fd5b50600254610123906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014c57600080fd5b5061016061015b366004612288565b610359565b005b34801561016e57600080fd5b5061016061017d36600461268d565b610620565b34801561018e57600080fd5b5061016061019d366004612b79565b61092b565b3480156101ae57600080fd5b50600354610123906001600160a01b031681565b6101606101d0366004612cde565b610ca8565b3480156101e157600080fd5b506101606101f0366004612d49565b610fd9565b34801561020157600080fd5b50610160610210366004612d49565b61106d565b34801561022157600080fd5b506101237f000000000000000000000000000000000000000000000000000000000000000081565b34801561025557600080fd5b50600154610123906001600160a01b031681565b34801561027557600080fd5b50610160610284366004612f55565b6110ed565b34801561029557600080fd5b506101606102a4366004613019565b6113a1565b3480156102b557600080fd5b506101606102c4366004613215565b61168a565b3480156102d557600080fd5b506101606102e4366004613481565b611908565b3480156102f557600080fd5b50610309610304366004612d49565b611b76565b6040519015158152602001610137565b34801561032557600080fd5b50600054610123906001600160a01b031681565b34801561034557600080fd5b50610160610354366004612d49565b611ba8565b6003546001600160a01b031633146103845760405163198f48cb60e31b815260040160405180910390fd5b8351835181141580610397575082518114155b806103a3575081518114155b156103c157604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b038111156103db576103db611c21565b604051908082528060200260200182016040528015610404578160200160208202803683370190505b5090506000826001600160401b0381111561042157610421611c21565b60405190808252806020026020018201604052801561045457816020015b606081526020019060019003908161043f5790505b50905060005b838110156105bf5760008782815181106104765761047661360d565b6020026020010151905060008783815181106104945761049461360d565b602002602001015190508983815181106104b0576104b061360d565b60200260200101518584815181106104ca576104ca61360d565b60200260200101906001600160a01b031690816001600160a01b03168152505081818885815181106104fe576104fe61360d565b602002602001015160405160240161051893929190613825565b60408051601f198184030181529190526020810180516001600160e01b0316632822ec0360e11b17905284518590859081106105565761055661360d565b6020026020010181905250806040015181602001516001600160a01b0316836001600160a01b03167f845400de7ed0a439c0685ef185e4e48ab874482b2bbba826983593c7b9bb114b60405160405180910390a4505080806105b790613854565b91505061045a565b506040516331fd85cb60e11b815230906363fb0b96906105e5908590859060040161387b565b600060405180830381600087803b1580156105ff57600080fd5b505af1158015610613573d6000803e3d6000fd5b5050505050505050505050565b6003546001600160a01b0316331461064b5760405163198f48cb60e31b815260040160405180910390fd5b855185518114158061065e575084518114155b8061066a575083518114155b80610676575081518114155b1561069457604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b038111156106ae576106ae611c21565b6040519080825280602002602001820160405280156106d7578160200160208202803683370190505b5090506000826001600160401b038111156106f4576106f4611c21565b60405190808252806020026020018201604052801561072757816020015b60608152602001906001900390816107125790505b50905060005b838110156108c85760008982815181106107495761074961360d565b6020026020010151905060008983815181106107675761076761360d565b602002602001015190508b83815181106107835761078361360d565b602002602001015185848151811061079d5761079d61360d565b60200260200101906001600160a01b031690816001600160a01b03168152505081818a85815181106107d1576107d161360d565b60200260200101518a86815181106107eb576107eb61360d565b60200260200101518a87815181106108055761080561360d565b60200260200101516040516024016108219594939291906139e2565b60408051601f198184030181529190526020810180516001600160e01b031663f0806a7f60e01b179052845185908590811061085f5761085f61360d565b6020026020010181905250806040015181602001516001600160a01b0316836001600160a01b03167f62d08c7b40038caee4cbb8d156cdba7f6c9cc8e53163de4b9c5d986f253fd7d860405160405180910390a4505080806108c090613854565b91505061072d565b506040516331fd85cb60e11b815230906363fb0b96906108ee908590859060040161387b565b600060405180830381600087803b15801561090857600080fd5b505af115801561091c573d6000803e3d6000fd5b50505050505050505050505050565b6003546001600160a01b031633146109565760405163198f48cb60e31b815260040160405180910390fd5b8651865181141580610969575085518114155b80610975575084518114155b80610981575082518114155b8061098d575083518114155b80610999575081518114155b156109b757604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b038111156109d1576109d1611c21565b6040519080825280602002602001820160405280156109fa578160200160208202803683370190505b5090506000826001600160401b03811115610a1757610a17611c21565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50905060005b83811015610c44578a8181518110610a6a57610a6a61360d565b6020026020010151838281518110610a8457610a8461360d565b60200260200101906001600160a01b031690816001600160a01b031681525050898181518110610ab657610ab661360d565b6020026020010151898281518110610ad057610ad061360d565b6020026020010151898381518110610aea57610aea61360d565b6020026020010151898481518110610b0457610b0461360d565b6020026020010151898581518110610b1e57610b1e61360d565b6020026020010151898681518110610b3857610b3861360d565b6020026020010151604051602401610b5596959493929190613ac2565b60408051601f198184030181529190526020810180516001600160e01b031663f1a9e60360e01b1790528251839083908110610b9357610b9361360d565b6020026020010181905250888181518110610bb057610bb061360d565b602002602001015160200151898281518110610bce57610bce61360d565b6020026020010151600001516001600160a01b03168b8381518110610bf557610bf561360d565b60200260200101516001600160a01b03167f60072b5585d4e6f71a97d87f0e001a6482f2cf1d00c33a30437a3b6f6ebd0a8f60405160405180910390a480610c3c81613854565b915050610a50565b506040516331fd85cb60e11b815230906363fb0b9690610c6a908590859060040161387b565b600060405180830381600087803b158015610c8457600080fd5b505af1158015610c98573d6000803e3d6000fd5b5050505050505050505050505050565b828114610cc85760405163c1e637c960e01b815260040160405180910390fd5b6040516332afe8a160e21b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063cabfa28490602401602060405180830381865afa158015610d2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d509190613c1a565b610d745760405163252c827360e01b81523360048201526024015b60405180910390fd5b60005b808214610fd2576000858583818110610d9257610d9261360d565b9050602002016020810190610da79190612d49565b6001600160a01b031603610dbd57600101610d77565b30858583818110610dd057610dd061360d565b9050602002016020810190610de59190612d49565b6001600160a01b031614610f01577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663907caa00868684818110610e3457610e3461360d565b9050602002016020810190610e499190612d49565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610e8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb19190613c1a565b610f0157848482818110610ec757610ec761360d565b9050602002016020810190610edc9190612d49565b6040516347ccabe760e01b81526001600160a01b039091166004820152602401610d6b565b600080868684818110610f1657610f1661360d565b9050602002016020810190610f2b9190612d49565b6001600160a01b0316858585818110610f4657610f4661360d565b9050602002810190610f589190613c37565b604051610f66929190613c7d565b6000604051808303816000865af19150503d8060008114610fa3576040519150601f19603f3d011682016040523d82523d6000602084013e610fa8565b606091505b509150915081610fc8578051600003610fc057600080fd5b805181602001fd5b5050600101610d77565b5050505050565b6000546001600160a01b031633146110045760405163b5c42b3b60e01b815260040160405180910390fd5b600054604080516001600160a01b03928316815291831660208301527fbf265e8326285a2747e33e54d5945f7111f2b5edb826eb8c08d4677779b3ff97910160405180910390a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146110985760405163b5c42b3b60e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527f7b24afe53ea3c0eb8558ae101198e86c392b4055609b2be0e0b23b89b2b8f013906020015b60405180910390a150565b6003546001600160a01b031633146111185760405163198f48cb60e31b815260040160405180910390fd5b855185518114158061112b575084518114155b80611137575083518114155b80611143575082518114155b8061114f575081518114155b1561116d57604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b0381111561118757611187611c21565b6040519080825280602002602001820160405280156111b0578160200160208202803683370190505b5090506000826001600160401b038111156111cd576111cd611c21565b60405190808252806020026020018201604052801561120057816020015b60608152602001906001900390816111eb5790505b50905060005b838110156108c85760008982815181106112225761122261360d565b6020026020010151905060008983815181106112405761124061360d565b602002602001015190508b838151811061125c5761125c61360d565b60200260200101518584815181106112765761127661360d565b60200260200101906001600160a01b031690816001600160a01b03168152505081818a85815181106112aa576112aa61360d565b60200260200101518a86815181106112c4576112c461360d565b60200260200101518a87815181106112de576112de61360d565b60200260200101516040516024016112fa959493929190613d8c565b60408051601f198184030181529190526020810180516001600160e01b031663c31a8e2f60e01b17905284518590859081106113385761133861360d565b6020026020010181905250806040015181602001516001600160a01b0316836001600160a01b03167f24a5e161bb55a0a758c5ce5e6621fc0494f946bd2e70162ed7d785c7b914079160405160405180910390a45050808061139990613854565b915050611206565b6003546001600160a01b031633146113cc5760405163198f48cb60e31b815260040160405180910390fd5b84518451811415806113df575082518114155b806113eb575081518114155b1561140957604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b0381111561142357611423611c21565b60405190808252806020026020018201604052801561144c578160200160208202803683370190505b5090506000826001600160401b0381111561146957611469611c21565b60405190808252806020026020018201604052801561149c57816020015b60608152602001906001900390816114875790505b50905060005b838110156116285760008882815181106114be576114be61360d565b6020026020010151905060008883815181106114dc576114dc61360d565b6020026020010151905060008884815181106114fa576114fa61360d565b602002602001015190508b84815181106115165761151661360d565b60200260200101518685815181106115305761153061360d565b60200260200101906001600160a01b031690816001600160a01b0316815250508282828a87815181106115655761156561360d565b60200260200101516040516024016115809493929190613de4565b60408051601f198184030181529190526020810180516001600160e01b031663aaec71d760e01b17905285518690869081106115be576115be61360d565b6020026020010181905250816020015182600001516001600160a01b0316846001600160a01b03167fbeb1a0a003f297419afd0c65340a684e8c5e9b576a1a705a4ac19762f8e89c0460405160405180910390a4505050808061162090613854565b9150506114a2565b506040516331fd85cb60e11b815230906363fb0b969061164e908590859060040161387b565b600060405180830381600087803b15801561166857600080fd5b505af115801561167c573d6000803e3d6000fd5b505050505050505050505050565b6003546001600160a01b031633146116b55760405163198f48cb60e31b815260040160405180910390fd5b83518351811415806116c8575082518114155b806116d4575081518114155b156116f257604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b0381111561170c5761170c611c21565b604051908082528060200260200182016040528015611735578160200160208202803683370190505b5090506000826001600160401b0381111561175257611752611c21565b60405190808252806020026020018201604052801561178557816020015b60608152602001906001900390816117705790505b50905060005b838110156105bf5760008782815181106117a7576117a761360d565b6020026020010151905060008783815181106117c5576117c561360d565b602002602001015190508983815181106117e1576117e161360d565b60200260200101518584815181106117fb576117fb61360d565b60200260200101906001600160a01b031690816001600160a01b031681525050818188858151811061182f5761182f61360d565b602002602001015160405160240161184993929190613e43565b60408051601f198184030181529190526020810180516001600160e01b031663814a1f1560e01b17905284518590859081106118875761188761360d565b6020908102919091018101919091526080820151805183518051908401519284015160408051948552948401526001600160a01b039182169390821692918616917fa7618589b4ad2eca6c42db5d1b67fe22fd78e950354363e80700e97e021614c6910160405180910390a45050808061190090613854565b91505061178b565b6003546001600160a01b031633146119335760405163198f48cb60e31b815260040160405180910390fd5b8351835181141580611946575082518114155b80611952575081518114155b1561197057604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b0381111561198a5761198a611c21565b6040519080825280602002602001820160405280156119b3578160200160208202803683370190505b5090506000826001600160401b038111156119d0576119d0611c21565b604051908082528060200260200182016040528015611a0357816020015b60608152602001906001900390816119ee5790505b50905060005b838110156105bf576000868281518110611a2557611a2561360d565b602002602001015190506000888381518110611a4357611a4361360d565b60200260200101519050898381518110611a5f57611a5f61360d565b6020026020010151858481518110611a7957611a7961360d565b60200260200101906001600160a01b031690816001600160a01b0316815250508082888581518110611aad57611aad61360d565b6020026020010151604051602401611ac793929190613fbf565b60408051601f198184030181529190526020810180516001600160e01b0316636e67036760e11b1790528451859085908110611b0557611b0561360d565b60200260200101819052508160200151604001518260200151602001516001600160a01b0316826001600160a01b03167fb26a0db4cf85bbeaf7c8a6dcf47ab1bab082afd520f0120d76781ec53f67df6e60405160405180910390a450508080611b6e90613854565b915050611a09565b6001546000906001600160a01b0383811691161480611ba257506002546001600160a01b038381169116145b92915050565b6001546001600160a01b03163314611bd3576040516374a2152760e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527f5e5dee98c8f51165e719725b40ebe485de8ce07b39ad552e40a31d58b5be7646906020016110e2565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715611c5957611c59611c21565b60405290565b604051606081016001600160401b0381118282101715611c5957611c59611c21565b604051608081016001600160401b0381118282101715611c5957611c59611c21565b60405160a081016001600160401b0381118282101715611c5957611c59611c21565b60405161014081016001600160401b0381118282101715611c5957611c59611c21565b60405160c081016001600160401b0381118282101715611c5957611c59611c21565b60405161010081016001600160401b0381118282101715611c5957611c59611c21565b604051601f8201601f191681016001600160401b0381118282101715611d5557611d55611c21565b604052919050565b60006001600160401b03821115611d7657611d76611c21565b5060051b60200190565b6001600160a01b0381168114611d9557600080fd5b50565b600082601f830112611da957600080fd5b81356020611dbe611db983611d5d565b611d2d565b82815260059290921b84018101918181019086841115611ddd57600080fd5b8286015b84811015611e01578035611df481611d80565b8352918301918301611de1565b509695505050505050565b600082601f830112611e1d57600080fd5b81356020611e2d611db983611d5d565b82815260059290921b84018101918181019086841115611e4c57600080fd5b8286015b84811015611e01578035611e6381611d80565b8352918301918301611e50565b8035611e7b81611d80565b919050565b600060408284031215611e9257600080fd5b611e9a611c37565b90508135611ea781611d80565b808252506020820135602082015292915050565b600060808284031215611ecd57600080fd5b611ed5611c5f565b9050611ee18383611e80565b81526040820135611ef181611d80565b6020820152606091909101356040820152919050565b600082601f830112611f1857600080fd5b81356020611f28611db983611d5d565b82815260079290921b84018101918181019086841115611f4757600080fd5b8286015b84811015611e0157611f5d8882611ebb565b835291830191608001611f4b565b80356001600160801b0381168114611e7b57600080fd5b600082601f830112611f9357600080fd5b81356001600160401b03811115611fac57611fac611c21565b611fbf601f8201601f1916602001611d2d565b818152846020838601011115611fd457600080fd5b816020850160208301376000918101602001919091529392505050565b60006080828403121561200357600080fd5b61200b611c81565b905081356001600160401b038082111561202457600080fd5b61203085838601611d98565b835261203e60208501611f6b565b602084015261204f60408501611f6b565b6040840152606084013591508082111561206857600080fd5b5061207584828501611f82565b60608301525092915050565b600082601f83011261209257600080fd5b813560206120a2611db983611d5d565b82815260059290921b840181019181810190868411156120c157600080fd5b8286015b84811015611e015780356001600160401b03808211156120e55760008081fd5b9088019060a0828b03601f19018113156120ff5760008081fd5b612107611ca3565b8784013561211481611d80565b808252506040808501358983015260608086013582840152608091508186013561213d81611d80565b908301529184013591838311156121545760008081fd5b6121628d8a85880101611f82565b9082015286525050509183019183016120c5565b60006060828403121561218857600080fd5b612190611c5f565b905081356001600160401b03808211156121a957600080fd5b6121b585838601611ff1565b835260208401359150808211156121cb57600080fd5b6121d785838601612081565b602084015260408401359150808211156121f057600080fd5b506121fd84828501611d98565b60408301525092915050565b600082601f83011261221a57600080fd5b8135602061222a611db983611d5d565b82815260059290921b8401810191818101908684111561224957600080fd5b8286015b84811015611e015780356001600160401b0381111561226c5760008081fd5b61227a8986838b0101612176565b84525091830191830161224d565b6000806000806080858703121561229e57600080fd5b84356001600160401b03808211156122b557600080fd5b6122c188838901611d98565b955060208701359150808211156122d757600080fd5b6122e388838901611e0c565b945060408701359150808211156122f957600080fd5b61230588838901611f07565b9350606087013591508082111561231b57600080fd5b5061232887828801612209565b91505092959194509250565b60006060828403121561234657600080fd5b61234e611c5f565b9050813561235b81611d80565b8152602082013561236b81611d80565b6020820152604082013562ffffff8116811461238657600080fd5b604082015292915050565b8035600281900b8114611e7b57600080fd5b6000604082840312156123b557600080fd5b6123bd611c37565b905081356001600160401b03808211156123d657600080fd5b6123e285838601612081565b835260208401359150808211156123f857600080fd5b90830190610180828603121561240d57600080fd5b612415611cc5565b61241e83611e70565b8152602083013560208201526124378660408501612334565b604082015261244860a08401612391565b606082015261245960c08401612391565b608082015260e083013560a08201526101008084013560c08301526101208085013560e08401526101408501358284015261016085013591508382111561249f57600080fd5b6124ab88838701611f82565b9083015250602084015250909392505050565b600082601f8301126124cf57600080fd5b813560206124df611db983611d5d565b82815260059290921b840181019181810190868411156124fe57600080fd5b8286015b84811015611e015780356001600160401b03808211156125225760008081fd5b908801906040828b03601f190181131561253c5760008081fd5b612544611c37565b87840135838111156125565760008081fd5b6125648d8a83880101611ff1565b82525090830135908282111561257a5760008081fd5b6125888c89848701016123a3565b818901528652505050918301918301612502565b8015158114611d9557600080fd5b600082601f8301126125bb57600080fd5b813560206125cb611db983611d5d565b82815260059290921b840181019181810190868411156125ea57600080fd5b8286015b84811015611e015780356126018161259c565b83529183019183016125ee565b600082601f83011261261f57600080fd5b8135602061262f611db983611d5d565b82815260059290921b8401810191818101908684111561264e57600080fd5b8286015b84811015611e015780356001600160401b038111156126715760008081fd5b61267f8986838b0101611d98565b845250918301918301612652565b60008060008060008060c087890312156126a657600080fd5b86356001600160401b03808211156126bd57600080fd5b6126c98a838b01611d98565b975060208901359150808211156126df57600080fd5b6126eb8a838b01611e0c565b9650604089013591508082111561270157600080fd5b61270d8a838b01611f07565b9550606089013591508082111561272357600080fd5b61272f8a838b016124be565b9450608089013591508082111561274557600080fd5b6127518a838b016125aa565b935060a089013591508082111561276757600080fd5b5061277489828a0161260e565b9150509295509295509295565b600082601f83011261279257600080fd5b813560206127a2611db983611d5d565b82815260069290921b840181019181810190868411156127c157600080fd5b8286015b84811015611e01576127d78882611e80565b8352918301916040016127c5565b600082601f8301126127f657600080fd5b81356020612806611db983611d5d565b82815260059290921b8401810191818101908684111561282557600080fd5b8286015b84811015611e015780356001600160401b03808211156128495760008081fd5b908801906060828b03601f19018113156128635760008081fd5b61286b611c5f565b878401358381111561287d5760008081fd5b61288b8d8a83880101612081565b825250604080850135848111156128a25760008081fd5b6128b08e8b83890101611f82565b838b0152509184013591838311156128c85760008081fd5b6128d68d8a85880101611d98565b908201528652505050918301918301612829565b600082601f8301126128fb57600080fd5b8135602061290b611db983611d5d565b82815260059290921b8401810191818101908684111561292a57600080fd5b8286015b84811015611e01578035835291830191830161292e565b600082601f83011261295657600080fd5b612963611db98335611d5d565b82358082526020808301929160051b85010185101561298157600080fd5b602084015b6020853560051b860101811015612b70576001600160401b0380823511156129ad57600080fd5b81358601601f196060828a03820112156129c657600080fd5b6129ce611c5f565b83602084013511156129df57600080fd5b6129f18a602080860135860101611f82565b81528360408401351115612a0457600080fd5b60408301358301604083828d03011215612a1d57600080fd5b612a25611c37565b8560208301351115612a3657600080fd5b6020820135820160c085828f03011215612a4f57600080fd5b612a57611ce8565b9450612a6560208201611e70565b8552612a7360408201611e70565b60208601528660608201351115612a8957600080fd5b612a9c8d60206060840135840101611d98565b6040860152608081013560608601528660a08201351115612abc57600080fd5b612acf8d602060a08401358401016128ea565b60808601528660c08201351115612ae557600080fd5b612af88d602060c0840135840101611f82565b60a0860152508381528560408301351115612b1257600080fd5b612b258c60206040850135850101612081565b602082015280602084015250508360608401351115612b4357600080fd5b612b568a60206060860135860101611d98565b604082015286525050602093840193919091019050612986565b50949350505050565b600080600080600080600060e0888a031215612b9457600080fd5b87356001600160401b0380821115612bab57600080fd5b612bb78b838c01611d98565b985060208a0135915080821115612bcd57600080fd5b612bd98b838c01611e0c565b975060408a0135915080821115612bef57600080fd5b612bfb8b838c01612781565b965060608a0135915080821115612c1157600080fd5b612c1d8b838c016127e5565b955060808a0135915080821115612c3357600080fd5b612c3f8b838c0161260e565b945060a08a0135915080821115612c5557600080fd5b612c618b838c01612945565b935060c08a0135915080821115612c7757600080fd5b50612c848a828b0161260e565b91505092959891949750929550565b60008083601f840112612ca557600080fd5b5081356001600160401b03811115612cbc57600080fd5b6020830191508360208260051b8501011115612cd757600080fd5b9250929050565b60008060008060408587031215612cf457600080fd5b84356001600160401b0380821115612d0b57600080fd5b612d1788838901612c93565b90965094506020870135915080821115612d3057600080fd5b50612d3d87828801612c93565b95989497509550505050565b600060208284031215612d5b57600080fd5b8135612d6681611d80565b9392505050565b600060608284031215612d7f57600080fd5b612d87611c5f565b905081356001600160401b0380821115612da057600080fd5b9083019060408286031215612db457600080fd5b612dbc611c37565b823582811115612dcb57600080fd5b83016101008188031215612dde57600080fd5b612de6611d0a565b612def82611e70565b815260208083013581830152612e0760408401611f6b565b60408301526060830135606083015260808301356080830152612e2c60a08401611f6b565b60a0830152612e3d60c08401611f6b565b60c083015260e083013585811115612e5457600080fd5b612e608a828601611f82565b60e08401525081845280860135925084831115612e7c57600080fd5b612e8889848801612081565b8185015283875280880135955084861115612ea257600080fd5b612eae89878a01611d98565b908701525050506040840135915080821115612ec957600080fd5b506121fd84828501611f82565b600082601f830112612ee757600080fd5b81356020612ef7611db983611d5d565b82815260059290921b84018101918181019086841115612f1657600080fd5b8286015b84811015611e015780356001600160401b03811115612f395760008081fd5b612f478986838b0101612d6d565b845250918301918301612f1a565b60008060008060008060c08789031215612f6e57600080fd5b86356001600160401b0380821115612f8557600080fd5b612f918a838b01611d98565b97506020890135915080821115612fa757600080fd5b612fb38a838b01611e0c565b96506040890135915080821115612fc957600080fd5b612fd58a838b01611f07565b95506060890135915080821115612feb57600080fd5b612ff78a838b01612209565b9450608089013591508082111561300d57600080fd5b6127518a838b01612ed6565b600080600080600060a0868803121561303157600080fd5b85356001600160401b038082111561304857600080fd5b61305489838a01611d98565b9650602088013591508082111561306a57600080fd5b61307689838a01611e0c565b9550604088013591508082111561308c57600080fd5b61309889838a01612781565b945060608801359150808211156130ae57600080fd5b6130ba89838a016127e5565b935060808801359150808211156130d057600080fd5b506130dd8882890161260e565b9150509295509295909350565b6000604082840312156130fc57600080fd5b613104611c37565b905081356001600160401b038082111561311d57600080fd5b61312985838601612081565b8352602084013591508082111561313f57600080fd5b9083019060c0828603121561315357600080fd5b61315b611ce8565b61316483611e70565b815261317260208401611e70565b602082015260408301358281111561318957600080fd5b61319587828601611d98565b6040830152506060830135828111156131ad57600080fd5b6131b9878286016128ea565b6060830152506080830135828111156131d157600080fd5b6131dd878286016128ea565b60808301525060a0830135828111156131f557600080fd5b61320187828601611f82565b60a083015250602084015250909392505050565b6000806000806080858703121561322b57600080fd5b6001600160401b03808635111561324157600080fd5b61324e8787358801611d98565b945060208601358181111561326257600080fd5b61326e88828901611e0c565b94505060408601358181111561328357600080fd5b8601601f8101881361329457600080fd5b6132a1611db98235611d5d565b81358082526020808301929160051b8401018a8111156132c057600080fd5b602084015b818110156133c95785813511156132db57600080fd5b80358501610100818e03601f190112156132f457600080fd5b6132fc611ce8565b6133098e60208401611e80565b815260608201358881111561331d57600080fd5b61332c8f602083860101611f82565b60208301525060808201358881111561334457600080fd5b6133538f602083860101611d98565b60408301525060a08201358881111561336b57600080fd5b61337a8f6020838601016130ea565b60608301525061338d8e60c08401611e80565b6080820152610100820135888111156133a557600080fd5b6133b48f602083860101611f82565b60a083015250855250602093840193016132c5565b509095505050506060860135818111156133e257600080fd5b6133ee8882890161260e565b9250505092959194509250565b60006080828403121561340d57600080fd5b613415611c81565b905081356001600160401b038082111561342e57600080fd5b61343a85838601611d98565b8352602084013591508082111561345057600080fd5b61345c858386016128ea565b6020840152604084013591508082111561347557600080fd5b61204f858386016123a3565b6000806000806080858703121561349757600080fd5b6001600160401b0380863511156134ad57600080fd5b6134ba8787358801611d98565b94506020860135818111156134ce57600080fd5b6134da88828901611e0c565b9450506040860135818111156134ef57600080fd5b8601601f8101881361350057600080fd5b61350d611db98235611d5d565b81358082526020808301929160051b8401018a81111561352c57600080fd5b602084015b818110156133c957858135111561354757600080fd5b80358501610100818e03601f1901121561356057600080fd5b613568611ca3565b61357460208301611e70565b81526135838e60408401611ebb565b602082015260c08201358881111561359a57600080fd5b6135a98f602083860101612176565b60408301525060e0820135888111156135c157600080fd5b6135d08f602083860101612d6d565b606083015250610100820135888111156135e957600080fd5b6135f88f6020838601016133fb565b60808301525085525060209384019301613531565b634e487b7160e01b600052603260045260246000fd5b61364182825180516001600160a01b03168252602090810151910152565b60208101516001600160a01b03166040838101919091520151606090910152565b600081518084526020808501945080840160005b8381101561369b5781516001600160a01b031687529582019590820190600101613676565b509495945050505050565b6000815180845260005b818110156136cc576020818501810151868301820152016136b0565b506000602082860101526020601f19601f83011685010191505092915050565b60008151608084526137016080850182613662565b905060208301516001600160801b03808216602087015280604086015116604087015250506060830151848203606086015261373d82826136a6565b95945050505050565b600081518084526020808501808196508360051b8101915082860160005b858110156137d0578284038952815180516001600160a01b0390811686528682015187870152604080830151908701526060808301519091169086015260809081015160a0918601829052906137bc818701836136a6565b9a87019a9550505090840190600101613764565b5091979650505050505050565b60008151606084526137f260608501826136ec565b90506020830151848203602086015261380b8282613746565b9150506040830151848203604086015261373d8282613662565b6001600160a01b038416815261383e6020820184613623565b60c060a0820152600061373d60c08301846137dd565b60006001820161387457634e487b7160e01b600052601160045260246000fd5b5060010190565b60408152600061388e6040830185613662565b6020838203818501528185518084528284019150828160051b85010183880160005b838110156138de57601f198784030185526138cc8383516136a6565b948601949250908501906001016138b0565b50909998505050505050505050565b60008151604084526139026040850182613746565b9050602083015184820360208601526101806139278383516001600160a01b03169052565b6020828101518482015260408084015180516001600160a01b039081168388015292810151909216606086015281015162ffffff16608085015250606082015161397660a085018260020b9052565b50608082015161398b60c085018260020b9052565b5060a082015160e084015260c0820151610100818186015260e08401519150610120828187015281850151610140870152808501519450505050806101608401526139d8818401836136a6565b9695505050505050565b6001600160a01b03861681526000610100613a006020840188613623565b8060a08401528551604082850152613a1c6101408501826136ec565b915050602086015160ff1984830301610120850152613a3b82826138ed565b91505084151560c084015282810360e0840152613a588185613662565b98975050505050505050565b6000815160608452613a796060850182613746565b90506020830151848203602086015261380b82826136a6565b600081518084526020808501945080840160005b8381101561369b57815187529582019590820190600101613aa6565b6001600160a01b0387811682526000906020613af38185018a80516001600160a01b03168252602090810151910152565b60e06060850152613b0760e0850189613a64565b8481036080860152613b198189613662565b905084810360a0860152865160608252613b3660608301826136a6565b9050828801518282038484015280516040835285815116604084015285858201511660608401526040810151955060c06080840152613b79610100840187613662565b9550606081015160a08401526080810151603f19808589030160c0860152613ba18883613a92565b975060a08301519250808589030160e08601525050613bc086826136a6565b95505083810151905081850384830152613bda8582613746565b9450505060408701519150808303604082015250613bf88282613662565b91505082810360c0840152613c0d8185613662565b9998505050505050505050565b600060208284031215613c2c57600080fd5b8151612d668161259c565b6000808335601e19843603018112613c4e57600080fd5b8301803591506001600160401b03821115613c6857600080fd5b602001915036819003821315612cd757600080fd5b8183823760009101908152919050565b600081516060845280516040606086015260018060a01b0381511660a0860152602081015160c08601526040810151613cd160e08701826001600160801b03169052565b5060608101516101008181880152608083015161012088015260a08301519150613d076101408801836001600160801b03169052565b60c08301516001600160801b031661016088015260e09092015161018087019290925250613d396101a08601826136a6565b905060208201519150605f19858203016080860152613d588183613746565b91505060208301518482036020860152613d728282613662565b9150506040830151848203604086015261373d82826136a6565b6001600160a01b03861681526000610100613daa6020840188613623565b8060a0840152613dbc818401876137dd565b905082810360c0840152613dd08186613c8d565b905082810360e0840152613a588185613662565b6001600160a01b0385168152613e10602082018580516001600160a01b03168252602090810151910152565b60a060608201526000613e2660a0830185613a64565b8281036080840152613e388185613662565b979650505050505050565b600060018060a01b0380861683526020606081850152613e7a60608501875180516001600160a01b03168252602090810151910152565b808601516101008060a0870152613e956101608701836136a6565b9150604080890151605f19808986030160c08a0152613eb48583613662565b945060608b01519150808986030160e08a01528151838652613ed884870182613746565b9050868301519250858103878701528783511681528787840151168782015283830151975060c084820152613f1060c0820189613662565b9750606083015196508088036060820152613f2b8888613a92565b9750608083015196508088036080820152613f468888613a92565b975060a0830151965080880360a082015250613f6287876136a6565b965060808b01519550613f8a848a018780516001600160a01b03168252602090810151910152565b60a08b0151955080898803016101408a01525050613fa885856136a6565b945086850381880152505050506139d88185613662565b6001600160a01b03848116825260606020808401829052855190921690830152830151600090613ff26080840182613623565b5060408401516101008381015261400d6101608401826137dd565b90506060850151605f19808584030161012086015261402c8383613c8d565b9250608087015191508085840301610140860152508051608083526140546080840182613662565b90506020820151838203602085015261406d8282613a92565b9150506040820151838203604085015261408782826138ed565b9150506060820151915082810360608401526140a381836136a6565b9250505082810360408401526139d8818561366256fea26469706673582212203a251684446b4abb3699a78df3584a0feb2d0b88bb48fcc4cb0aabbab06e659064736f6c6343000813003300000000000000000000000008f0f10ef017cc57d2af1e1c2365807bdff99e9c000000000000000000000000b0bada5d45d939a03c6d211d24a61a4418d7cd13000000000000000000000000bde48624f9e1dd4107df324d1ba3c07004640206
Deployed Bytecode
0x6080604052600436106100fe5760003560e01c80637b10399911610095578063bd42d84811610064578063bd42d848146102a9578063eb87524c146102c9578063f5b3f424146102e9578063f851a44014610319578063fb0289ca1461033957600080fd5b80637b103999146102155780638da5cb5b14610249578063936b0aa6146102695780639969e9ee1461028957600080fd5b80634179eebc116100d15780634179eebc146101a257806363fb0b96146101c2578063704b6c02146101d5578063745a7b3b146101f557600080fd5b806319d40b08146101035780631c0efeab14610140578063216f5a891461016257806329df02cf14610182575b600080fd5b34801561010f57600080fd5b50600254610123906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014c57600080fd5b5061016061015b366004612288565b610359565b005b34801561016e57600080fd5b5061016061017d36600461268d565b610620565b34801561018e57600080fd5b5061016061019d366004612b79565b61092b565b3480156101ae57600080fd5b50600354610123906001600160a01b031681565b6101606101d0366004612cde565b610ca8565b3480156101e157600080fd5b506101606101f0366004612d49565b610fd9565b34801561020157600080fd5b50610160610210366004612d49565b61106d565b34801561022157600080fd5b506101237f00000000000000000000000008f0f10ef017cc57d2af1e1c2365807bdff99e9c81565b34801561025557600080fd5b50600154610123906001600160a01b031681565b34801561027557600080fd5b50610160610284366004612f55565b6110ed565b34801561029557600080fd5b506101606102a4366004613019565b6113a1565b3480156102b557600080fd5b506101606102c4366004613215565b61168a565b3480156102d557600080fd5b506101606102e4366004613481565b611908565b3480156102f557600080fd5b50610309610304366004612d49565b611b76565b6040519015158152602001610137565b34801561032557600080fd5b50600054610123906001600160a01b031681565b34801561034557600080fd5b50610160610354366004612d49565b611ba8565b6003546001600160a01b031633146103845760405163198f48cb60e31b815260040160405180910390fd5b8351835181141580610397575082518114155b806103a3575081518114155b156103c157604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b038111156103db576103db611c21565b604051908082528060200260200182016040528015610404578160200160208202803683370190505b5090506000826001600160401b0381111561042157610421611c21565b60405190808252806020026020018201604052801561045457816020015b606081526020019060019003908161043f5790505b50905060005b838110156105bf5760008782815181106104765761047661360d565b6020026020010151905060008783815181106104945761049461360d565b602002602001015190508983815181106104b0576104b061360d565b60200260200101518584815181106104ca576104ca61360d565b60200260200101906001600160a01b031690816001600160a01b03168152505081818885815181106104fe576104fe61360d565b602002602001015160405160240161051893929190613825565b60408051601f198184030181529190526020810180516001600160e01b0316632822ec0360e11b17905284518590859081106105565761055661360d565b6020026020010181905250806040015181602001516001600160a01b0316836001600160a01b03167f845400de7ed0a439c0685ef185e4e48ab874482b2bbba826983593c7b9bb114b60405160405180910390a4505080806105b790613854565b91505061045a565b506040516331fd85cb60e11b815230906363fb0b96906105e5908590859060040161387b565b600060405180830381600087803b1580156105ff57600080fd5b505af1158015610613573d6000803e3d6000fd5b5050505050505050505050565b6003546001600160a01b0316331461064b5760405163198f48cb60e31b815260040160405180910390fd5b855185518114158061065e575084518114155b8061066a575083518114155b80610676575081518114155b1561069457604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b038111156106ae576106ae611c21565b6040519080825280602002602001820160405280156106d7578160200160208202803683370190505b5090506000826001600160401b038111156106f4576106f4611c21565b60405190808252806020026020018201604052801561072757816020015b60608152602001906001900390816107125790505b50905060005b838110156108c85760008982815181106107495761074961360d565b6020026020010151905060008983815181106107675761076761360d565b602002602001015190508b83815181106107835761078361360d565b602002602001015185848151811061079d5761079d61360d565b60200260200101906001600160a01b031690816001600160a01b03168152505081818a85815181106107d1576107d161360d565b60200260200101518a86815181106107eb576107eb61360d565b60200260200101518a87815181106108055761080561360d565b60200260200101516040516024016108219594939291906139e2565b60408051601f198184030181529190526020810180516001600160e01b031663f0806a7f60e01b179052845185908590811061085f5761085f61360d565b6020026020010181905250806040015181602001516001600160a01b0316836001600160a01b03167f62d08c7b40038caee4cbb8d156cdba7f6c9cc8e53163de4b9c5d986f253fd7d860405160405180910390a4505080806108c090613854565b91505061072d565b506040516331fd85cb60e11b815230906363fb0b96906108ee908590859060040161387b565b600060405180830381600087803b15801561090857600080fd5b505af115801561091c573d6000803e3d6000fd5b50505050505050505050505050565b6003546001600160a01b031633146109565760405163198f48cb60e31b815260040160405180910390fd5b8651865181141580610969575085518114155b80610975575084518114155b80610981575082518114155b8061098d575083518114155b80610999575081518114155b156109b757604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b038111156109d1576109d1611c21565b6040519080825280602002602001820160405280156109fa578160200160208202803683370190505b5090506000826001600160401b03811115610a1757610a17611c21565b604051908082528060200260200182016040528015610a4a57816020015b6060815260200190600190039081610a355790505b50905060005b83811015610c44578a8181518110610a6a57610a6a61360d565b6020026020010151838281518110610a8457610a8461360d565b60200260200101906001600160a01b031690816001600160a01b031681525050898181518110610ab657610ab661360d565b6020026020010151898281518110610ad057610ad061360d565b6020026020010151898381518110610aea57610aea61360d565b6020026020010151898481518110610b0457610b0461360d565b6020026020010151898581518110610b1e57610b1e61360d565b6020026020010151898681518110610b3857610b3861360d565b6020026020010151604051602401610b5596959493929190613ac2565b60408051601f198184030181529190526020810180516001600160e01b031663f1a9e60360e01b1790528251839083908110610b9357610b9361360d565b6020026020010181905250888181518110610bb057610bb061360d565b602002602001015160200151898281518110610bce57610bce61360d565b6020026020010151600001516001600160a01b03168b8381518110610bf557610bf561360d565b60200260200101516001600160a01b03167f60072b5585d4e6f71a97d87f0e001a6482f2cf1d00c33a30437a3b6f6ebd0a8f60405160405180910390a480610c3c81613854565b915050610a50565b506040516331fd85cb60e11b815230906363fb0b9690610c6a908590859060040161387b565b600060405180830381600087803b158015610c8457600080fd5b505af1158015610c98573d6000803e3d6000fd5b5050505050505050505050505050565b828114610cc85760405163c1e637c960e01b815260040160405180910390fd5b6040516332afe8a160e21b81523360048201527f00000000000000000000000008f0f10ef017cc57d2af1e1c2365807bdff99e9c6001600160a01b03169063cabfa28490602401602060405180830381865afa158015610d2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d509190613c1a565b610d745760405163252c827360e01b81523360048201526024015b60405180910390fd5b60005b808214610fd2576000858583818110610d9257610d9261360d565b9050602002016020810190610da79190612d49565b6001600160a01b031603610dbd57600101610d77565b30858583818110610dd057610dd061360d565b9050602002016020810190610de59190612d49565b6001600160a01b031614610f01577f00000000000000000000000008f0f10ef017cc57d2af1e1c2365807bdff99e9c6001600160a01b031663907caa00868684818110610e3457610e3461360d565b9050602002016020810190610e499190612d49565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610e8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb19190613c1a565b610f0157848482818110610ec757610ec761360d565b9050602002016020810190610edc9190612d49565b6040516347ccabe760e01b81526001600160a01b039091166004820152602401610d6b565b600080868684818110610f1657610f1661360d565b9050602002016020810190610f2b9190612d49565b6001600160a01b0316858585818110610f4657610f4661360d565b9050602002810190610f589190613c37565b604051610f66929190613c7d565b6000604051808303816000865af19150503d8060008114610fa3576040519150601f19603f3d011682016040523d82523d6000602084013e610fa8565b606091505b509150915081610fc8578051600003610fc057600080fd5b805181602001fd5b5050600101610d77565b5050505050565b6000546001600160a01b031633146110045760405163b5c42b3b60e01b815260040160405180910390fd5b600054604080516001600160a01b03928316815291831660208301527fbf265e8326285a2747e33e54d5945f7111f2b5edb826eb8c08d4677779b3ff97910160405180910390a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146110985760405163b5c42b3b60e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527f7b24afe53ea3c0eb8558ae101198e86c392b4055609b2be0e0b23b89b2b8f013906020015b60405180910390a150565b6003546001600160a01b031633146111185760405163198f48cb60e31b815260040160405180910390fd5b855185518114158061112b575084518114155b80611137575083518114155b80611143575082518114155b8061114f575081518114155b1561116d57604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b0381111561118757611187611c21565b6040519080825280602002602001820160405280156111b0578160200160208202803683370190505b5090506000826001600160401b038111156111cd576111cd611c21565b60405190808252806020026020018201604052801561120057816020015b60608152602001906001900390816111eb5790505b50905060005b838110156108c85760008982815181106112225761122261360d565b6020026020010151905060008983815181106112405761124061360d565b602002602001015190508b838151811061125c5761125c61360d565b60200260200101518584815181106112765761127661360d565b60200260200101906001600160a01b031690816001600160a01b03168152505081818a85815181106112aa576112aa61360d565b60200260200101518a86815181106112c4576112c461360d565b60200260200101518a87815181106112de576112de61360d565b60200260200101516040516024016112fa959493929190613d8c565b60408051601f198184030181529190526020810180516001600160e01b031663c31a8e2f60e01b17905284518590859081106113385761133861360d565b6020026020010181905250806040015181602001516001600160a01b0316836001600160a01b03167f24a5e161bb55a0a758c5ce5e6621fc0494f946bd2e70162ed7d785c7b914079160405160405180910390a45050808061139990613854565b915050611206565b6003546001600160a01b031633146113cc5760405163198f48cb60e31b815260040160405180910390fd5b84518451811415806113df575082518114155b806113eb575081518114155b1561140957604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b0381111561142357611423611c21565b60405190808252806020026020018201604052801561144c578160200160208202803683370190505b5090506000826001600160401b0381111561146957611469611c21565b60405190808252806020026020018201604052801561149c57816020015b60608152602001906001900390816114875790505b50905060005b838110156116285760008882815181106114be576114be61360d565b6020026020010151905060008883815181106114dc576114dc61360d565b6020026020010151905060008884815181106114fa576114fa61360d565b602002602001015190508b84815181106115165761151661360d565b60200260200101518685815181106115305761153061360d565b60200260200101906001600160a01b031690816001600160a01b0316815250508282828a87815181106115655761156561360d565b60200260200101516040516024016115809493929190613de4565b60408051601f198184030181529190526020810180516001600160e01b031663aaec71d760e01b17905285518690869081106115be576115be61360d565b6020026020010181905250816020015182600001516001600160a01b0316846001600160a01b03167fbeb1a0a003f297419afd0c65340a684e8c5e9b576a1a705a4ac19762f8e89c0460405160405180910390a4505050808061162090613854565b9150506114a2565b506040516331fd85cb60e11b815230906363fb0b969061164e908590859060040161387b565b600060405180830381600087803b15801561166857600080fd5b505af115801561167c573d6000803e3d6000fd5b505050505050505050505050565b6003546001600160a01b031633146116b55760405163198f48cb60e31b815260040160405180910390fd5b83518351811415806116c8575082518114155b806116d4575081518114155b156116f257604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b0381111561170c5761170c611c21565b604051908082528060200260200182016040528015611735578160200160208202803683370190505b5090506000826001600160401b0381111561175257611752611c21565b60405190808252806020026020018201604052801561178557816020015b60608152602001906001900390816117705790505b50905060005b838110156105bf5760008782815181106117a7576117a761360d565b6020026020010151905060008783815181106117c5576117c561360d565b602002602001015190508983815181106117e1576117e161360d565b60200260200101518584815181106117fb576117fb61360d565b60200260200101906001600160a01b031690816001600160a01b031681525050818188858151811061182f5761182f61360d565b602002602001015160405160240161184993929190613e43565b60408051601f198184030181529190526020810180516001600160e01b031663814a1f1560e01b17905284518590859081106118875761188761360d565b6020908102919091018101919091526080820151805183518051908401519284015160408051948552948401526001600160a01b039182169390821692918616917fa7618589b4ad2eca6c42db5d1b67fe22fd78e950354363e80700e97e021614c6910160405180910390a45050808061190090613854565b91505061178b565b6003546001600160a01b031633146119335760405163198f48cb60e31b815260040160405180910390fd5b8351835181141580611946575082518114155b80611952575081518114155b1561197057604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b0381111561198a5761198a611c21565b6040519080825280602002602001820160405280156119b3578160200160208202803683370190505b5090506000826001600160401b038111156119d0576119d0611c21565b604051908082528060200260200182016040528015611a0357816020015b60608152602001906001900390816119ee5790505b50905060005b838110156105bf576000868281518110611a2557611a2561360d565b602002602001015190506000888381518110611a4357611a4361360d565b60200260200101519050898381518110611a5f57611a5f61360d565b6020026020010151858481518110611a7957611a7961360d565b60200260200101906001600160a01b031690816001600160a01b0316815250508082888581518110611aad57611aad61360d565b6020026020010151604051602401611ac793929190613fbf565b60408051601f198184030181529190526020810180516001600160e01b0316636e67036760e11b1790528451859085908110611b0557611b0561360d565b60200260200101819052508160200151604001518260200151602001516001600160a01b0316826001600160a01b03167fb26a0db4cf85bbeaf7c8a6dcf47ab1bab082afd520f0120d76781ec53f67df6e60405160405180910390a450508080611b6e90613854565b915050611a09565b6001546000906001600160a01b0383811691161480611ba257506002546001600160a01b038381169116145b92915050565b6001546001600160a01b03163314611bd3576040516374a2152760e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527f5e5dee98c8f51165e719725b40ebe485de8ce07b39ad552e40a31d58b5be7646906020016110e2565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715611c5957611c59611c21565b60405290565b604051606081016001600160401b0381118282101715611c5957611c59611c21565b604051608081016001600160401b0381118282101715611c5957611c59611c21565b60405160a081016001600160401b0381118282101715611c5957611c59611c21565b60405161014081016001600160401b0381118282101715611c5957611c59611c21565b60405160c081016001600160401b0381118282101715611c5957611c59611c21565b60405161010081016001600160401b0381118282101715611c5957611c59611c21565b604051601f8201601f191681016001600160401b0381118282101715611d5557611d55611c21565b604052919050565b60006001600160401b03821115611d7657611d76611c21565b5060051b60200190565b6001600160a01b0381168114611d9557600080fd5b50565b600082601f830112611da957600080fd5b81356020611dbe611db983611d5d565b611d2d565b82815260059290921b84018101918181019086841115611ddd57600080fd5b8286015b84811015611e01578035611df481611d80565b8352918301918301611de1565b509695505050505050565b600082601f830112611e1d57600080fd5b81356020611e2d611db983611d5d565b82815260059290921b84018101918181019086841115611e4c57600080fd5b8286015b84811015611e01578035611e6381611d80565b8352918301918301611e50565b8035611e7b81611d80565b919050565b600060408284031215611e9257600080fd5b611e9a611c37565b90508135611ea781611d80565b808252506020820135602082015292915050565b600060808284031215611ecd57600080fd5b611ed5611c5f565b9050611ee18383611e80565b81526040820135611ef181611d80565b6020820152606091909101356040820152919050565b600082601f830112611f1857600080fd5b81356020611f28611db983611d5d565b82815260079290921b84018101918181019086841115611f4757600080fd5b8286015b84811015611e0157611f5d8882611ebb565b835291830191608001611f4b565b80356001600160801b0381168114611e7b57600080fd5b600082601f830112611f9357600080fd5b81356001600160401b03811115611fac57611fac611c21565b611fbf601f8201601f1916602001611d2d565b818152846020838601011115611fd457600080fd5b816020850160208301376000918101602001919091529392505050565b60006080828403121561200357600080fd5b61200b611c81565b905081356001600160401b038082111561202457600080fd5b61203085838601611d98565b835261203e60208501611f6b565b602084015261204f60408501611f6b565b6040840152606084013591508082111561206857600080fd5b5061207584828501611f82565b60608301525092915050565b600082601f83011261209257600080fd5b813560206120a2611db983611d5d565b82815260059290921b840181019181810190868411156120c157600080fd5b8286015b84811015611e015780356001600160401b03808211156120e55760008081fd5b9088019060a0828b03601f19018113156120ff5760008081fd5b612107611ca3565b8784013561211481611d80565b808252506040808501358983015260608086013582840152608091508186013561213d81611d80565b908301529184013591838311156121545760008081fd5b6121628d8a85880101611f82565b9082015286525050509183019183016120c5565b60006060828403121561218857600080fd5b612190611c5f565b905081356001600160401b03808211156121a957600080fd5b6121b585838601611ff1565b835260208401359150808211156121cb57600080fd5b6121d785838601612081565b602084015260408401359150808211156121f057600080fd5b506121fd84828501611d98565b60408301525092915050565b600082601f83011261221a57600080fd5b8135602061222a611db983611d5d565b82815260059290921b8401810191818101908684111561224957600080fd5b8286015b84811015611e015780356001600160401b0381111561226c5760008081fd5b61227a8986838b0101612176565b84525091830191830161224d565b6000806000806080858703121561229e57600080fd5b84356001600160401b03808211156122b557600080fd5b6122c188838901611d98565b955060208701359150808211156122d757600080fd5b6122e388838901611e0c565b945060408701359150808211156122f957600080fd5b61230588838901611f07565b9350606087013591508082111561231b57600080fd5b5061232887828801612209565b91505092959194509250565b60006060828403121561234657600080fd5b61234e611c5f565b9050813561235b81611d80565b8152602082013561236b81611d80565b6020820152604082013562ffffff8116811461238657600080fd5b604082015292915050565b8035600281900b8114611e7b57600080fd5b6000604082840312156123b557600080fd5b6123bd611c37565b905081356001600160401b03808211156123d657600080fd5b6123e285838601612081565b835260208401359150808211156123f857600080fd5b90830190610180828603121561240d57600080fd5b612415611cc5565b61241e83611e70565b8152602083013560208201526124378660408501612334565b604082015261244860a08401612391565b606082015261245960c08401612391565b608082015260e083013560a08201526101008084013560c08301526101208085013560e08401526101408501358284015261016085013591508382111561249f57600080fd5b6124ab88838701611f82565b9083015250602084015250909392505050565b600082601f8301126124cf57600080fd5b813560206124df611db983611d5d565b82815260059290921b840181019181810190868411156124fe57600080fd5b8286015b84811015611e015780356001600160401b03808211156125225760008081fd5b908801906040828b03601f190181131561253c5760008081fd5b612544611c37565b87840135838111156125565760008081fd5b6125648d8a83880101611ff1565b82525090830135908282111561257a5760008081fd5b6125888c89848701016123a3565b818901528652505050918301918301612502565b8015158114611d9557600080fd5b600082601f8301126125bb57600080fd5b813560206125cb611db983611d5d565b82815260059290921b840181019181810190868411156125ea57600080fd5b8286015b84811015611e015780356126018161259c565b83529183019183016125ee565b600082601f83011261261f57600080fd5b8135602061262f611db983611d5d565b82815260059290921b8401810191818101908684111561264e57600080fd5b8286015b84811015611e015780356001600160401b038111156126715760008081fd5b61267f8986838b0101611d98565b845250918301918301612652565b60008060008060008060c087890312156126a657600080fd5b86356001600160401b03808211156126bd57600080fd5b6126c98a838b01611d98565b975060208901359150808211156126df57600080fd5b6126eb8a838b01611e0c565b9650604089013591508082111561270157600080fd5b61270d8a838b01611f07565b9550606089013591508082111561272357600080fd5b61272f8a838b016124be565b9450608089013591508082111561274557600080fd5b6127518a838b016125aa565b935060a089013591508082111561276757600080fd5b5061277489828a0161260e565b9150509295509295509295565b600082601f83011261279257600080fd5b813560206127a2611db983611d5d565b82815260069290921b840181019181810190868411156127c157600080fd5b8286015b84811015611e01576127d78882611e80565b8352918301916040016127c5565b600082601f8301126127f657600080fd5b81356020612806611db983611d5d565b82815260059290921b8401810191818101908684111561282557600080fd5b8286015b84811015611e015780356001600160401b03808211156128495760008081fd5b908801906060828b03601f19018113156128635760008081fd5b61286b611c5f565b878401358381111561287d5760008081fd5b61288b8d8a83880101612081565b825250604080850135848111156128a25760008081fd5b6128b08e8b83890101611f82565b838b0152509184013591838311156128c85760008081fd5b6128d68d8a85880101611d98565b908201528652505050918301918301612829565b600082601f8301126128fb57600080fd5b8135602061290b611db983611d5d565b82815260059290921b8401810191818101908684111561292a57600080fd5b8286015b84811015611e01578035835291830191830161292e565b600082601f83011261295657600080fd5b612963611db98335611d5d565b82358082526020808301929160051b85010185101561298157600080fd5b602084015b6020853560051b860101811015612b70576001600160401b0380823511156129ad57600080fd5b81358601601f196060828a03820112156129c657600080fd5b6129ce611c5f565b83602084013511156129df57600080fd5b6129f18a602080860135860101611f82565b81528360408401351115612a0457600080fd5b60408301358301604083828d03011215612a1d57600080fd5b612a25611c37565b8560208301351115612a3657600080fd5b6020820135820160c085828f03011215612a4f57600080fd5b612a57611ce8565b9450612a6560208201611e70565b8552612a7360408201611e70565b60208601528660608201351115612a8957600080fd5b612a9c8d60206060840135840101611d98565b6040860152608081013560608601528660a08201351115612abc57600080fd5b612acf8d602060a08401358401016128ea565b60808601528660c08201351115612ae557600080fd5b612af88d602060c0840135840101611f82565b60a0860152508381528560408301351115612b1257600080fd5b612b258c60206040850135850101612081565b602082015280602084015250508360608401351115612b4357600080fd5b612b568a60206060860135860101611d98565b604082015286525050602093840193919091019050612986565b50949350505050565b600080600080600080600060e0888a031215612b9457600080fd5b87356001600160401b0380821115612bab57600080fd5b612bb78b838c01611d98565b985060208a0135915080821115612bcd57600080fd5b612bd98b838c01611e0c565b975060408a0135915080821115612bef57600080fd5b612bfb8b838c01612781565b965060608a0135915080821115612c1157600080fd5b612c1d8b838c016127e5565b955060808a0135915080821115612c3357600080fd5b612c3f8b838c0161260e565b945060a08a0135915080821115612c5557600080fd5b612c618b838c01612945565b935060c08a0135915080821115612c7757600080fd5b50612c848a828b0161260e565b91505092959891949750929550565b60008083601f840112612ca557600080fd5b5081356001600160401b03811115612cbc57600080fd5b6020830191508360208260051b8501011115612cd757600080fd5b9250929050565b60008060008060408587031215612cf457600080fd5b84356001600160401b0380821115612d0b57600080fd5b612d1788838901612c93565b90965094506020870135915080821115612d3057600080fd5b50612d3d87828801612c93565b95989497509550505050565b600060208284031215612d5b57600080fd5b8135612d6681611d80565b9392505050565b600060608284031215612d7f57600080fd5b612d87611c5f565b905081356001600160401b0380821115612da057600080fd5b9083019060408286031215612db457600080fd5b612dbc611c37565b823582811115612dcb57600080fd5b83016101008188031215612dde57600080fd5b612de6611d0a565b612def82611e70565b815260208083013581830152612e0760408401611f6b565b60408301526060830135606083015260808301356080830152612e2c60a08401611f6b565b60a0830152612e3d60c08401611f6b565b60c083015260e083013585811115612e5457600080fd5b612e608a828601611f82565b60e08401525081845280860135925084831115612e7c57600080fd5b612e8889848801612081565b8185015283875280880135955084861115612ea257600080fd5b612eae89878a01611d98565b908701525050506040840135915080821115612ec957600080fd5b506121fd84828501611f82565b600082601f830112612ee757600080fd5b81356020612ef7611db983611d5d565b82815260059290921b84018101918181019086841115612f1657600080fd5b8286015b84811015611e015780356001600160401b03811115612f395760008081fd5b612f478986838b0101612d6d565b845250918301918301612f1a565b60008060008060008060c08789031215612f6e57600080fd5b86356001600160401b0380821115612f8557600080fd5b612f918a838b01611d98565b97506020890135915080821115612fa757600080fd5b612fb38a838b01611e0c565b96506040890135915080821115612fc957600080fd5b612fd58a838b01611f07565b95506060890135915080821115612feb57600080fd5b612ff78a838b01612209565b9450608089013591508082111561300d57600080fd5b6127518a838b01612ed6565b600080600080600060a0868803121561303157600080fd5b85356001600160401b038082111561304857600080fd5b61305489838a01611d98565b9650602088013591508082111561306a57600080fd5b61307689838a01611e0c565b9550604088013591508082111561308c57600080fd5b61309889838a01612781565b945060608801359150808211156130ae57600080fd5b6130ba89838a016127e5565b935060808801359150808211156130d057600080fd5b506130dd8882890161260e565b9150509295509295909350565b6000604082840312156130fc57600080fd5b613104611c37565b905081356001600160401b038082111561311d57600080fd5b61312985838601612081565b8352602084013591508082111561313f57600080fd5b9083019060c0828603121561315357600080fd5b61315b611ce8565b61316483611e70565b815261317260208401611e70565b602082015260408301358281111561318957600080fd5b61319587828601611d98565b6040830152506060830135828111156131ad57600080fd5b6131b9878286016128ea565b6060830152506080830135828111156131d157600080fd5b6131dd878286016128ea565b60808301525060a0830135828111156131f557600080fd5b61320187828601611f82565b60a083015250602084015250909392505050565b6000806000806080858703121561322b57600080fd5b6001600160401b03808635111561324157600080fd5b61324e8787358801611d98565b945060208601358181111561326257600080fd5b61326e88828901611e0c565b94505060408601358181111561328357600080fd5b8601601f8101881361329457600080fd5b6132a1611db98235611d5d565b81358082526020808301929160051b8401018a8111156132c057600080fd5b602084015b818110156133c95785813511156132db57600080fd5b80358501610100818e03601f190112156132f457600080fd5b6132fc611ce8565b6133098e60208401611e80565b815260608201358881111561331d57600080fd5b61332c8f602083860101611f82565b60208301525060808201358881111561334457600080fd5b6133538f602083860101611d98565b60408301525060a08201358881111561336b57600080fd5b61337a8f6020838601016130ea565b60608301525061338d8e60c08401611e80565b6080820152610100820135888111156133a557600080fd5b6133b48f602083860101611f82565b60a083015250855250602093840193016132c5565b509095505050506060860135818111156133e257600080fd5b6133ee8882890161260e565b9250505092959194509250565b60006080828403121561340d57600080fd5b613415611c81565b905081356001600160401b038082111561342e57600080fd5b61343a85838601611d98565b8352602084013591508082111561345057600080fd5b61345c858386016128ea565b6020840152604084013591508082111561347557600080fd5b61204f858386016123a3565b6000806000806080858703121561349757600080fd5b6001600160401b0380863511156134ad57600080fd5b6134ba8787358801611d98565b94506020860135818111156134ce57600080fd5b6134da88828901611e0c565b9450506040860135818111156134ef57600080fd5b8601601f8101881361350057600080fd5b61350d611db98235611d5d565b81358082526020808301929160051b8401018a81111561352c57600080fd5b602084015b818110156133c957858135111561354757600080fd5b80358501610100818e03601f1901121561356057600080fd5b613568611ca3565b61357460208301611e70565b81526135838e60408401611ebb565b602082015260c08201358881111561359a57600080fd5b6135a98f602083860101612176565b60408301525060e0820135888111156135c157600080fd5b6135d08f602083860101612d6d565b606083015250610100820135888111156135e957600080fd5b6135f88f6020838601016133fb565b60808301525085525060209384019301613531565b634e487b7160e01b600052603260045260246000fd5b61364182825180516001600160a01b03168252602090810151910152565b60208101516001600160a01b03166040838101919091520151606090910152565b600081518084526020808501945080840160005b8381101561369b5781516001600160a01b031687529582019590820190600101613676565b509495945050505050565b6000815180845260005b818110156136cc576020818501810151868301820152016136b0565b506000602082860101526020601f19601f83011685010191505092915050565b60008151608084526137016080850182613662565b905060208301516001600160801b03808216602087015280604086015116604087015250506060830151848203606086015261373d82826136a6565b95945050505050565b600081518084526020808501808196508360051b8101915082860160005b858110156137d0578284038952815180516001600160a01b0390811686528682015187870152604080830151908701526060808301519091169086015260809081015160a0918601829052906137bc818701836136a6565b9a87019a9550505090840190600101613764565b5091979650505050505050565b60008151606084526137f260608501826136ec565b90506020830151848203602086015261380b8282613746565b9150506040830151848203604086015261373d8282613662565b6001600160a01b038416815261383e6020820184613623565b60c060a0820152600061373d60c08301846137dd565b60006001820161387457634e487b7160e01b600052601160045260246000fd5b5060010190565b60408152600061388e6040830185613662565b6020838203818501528185518084528284019150828160051b85010183880160005b838110156138de57601f198784030185526138cc8383516136a6565b948601949250908501906001016138b0565b50909998505050505050505050565b60008151604084526139026040850182613746565b9050602083015184820360208601526101806139278383516001600160a01b03169052565b6020828101518482015260408084015180516001600160a01b039081168388015292810151909216606086015281015162ffffff16608085015250606082015161397660a085018260020b9052565b50608082015161398b60c085018260020b9052565b5060a082015160e084015260c0820151610100818186015260e08401519150610120828187015281850151610140870152808501519450505050806101608401526139d8818401836136a6565b9695505050505050565b6001600160a01b03861681526000610100613a006020840188613623565b8060a08401528551604082850152613a1c6101408501826136ec565b915050602086015160ff1984830301610120850152613a3b82826138ed565b91505084151560c084015282810360e0840152613a588185613662565b98975050505050505050565b6000815160608452613a796060850182613746565b90506020830151848203602086015261380b82826136a6565b600081518084526020808501945080840160005b8381101561369b57815187529582019590820190600101613aa6565b6001600160a01b0387811682526000906020613af38185018a80516001600160a01b03168252602090810151910152565b60e06060850152613b0760e0850189613a64565b8481036080860152613b198189613662565b905084810360a0860152865160608252613b3660608301826136a6565b9050828801518282038484015280516040835285815116604084015285858201511660608401526040810151955060c06080840152613b79610100840187613662565b9550606081015160a08401526080810151603f19808589030160c0860152613ba18883613a92565b975060a08301519250808589030160e08601525050613bc086826136a6565b95505083810151905081850384830152613bda8582613746565b9450505060408701519150808303604082015250613bf88282613662565b91505082810360c0840152613c0d8185613662565b9998505050505050505050565b600060208284031215613c2c57600080fd5b8151612d668161259c565b6000808335601e19843603018112613c4e57600080fd5b8301803591506001600160401b03821115613c6857600080fd5b602001915036819003821315612cd757600080fd5b8183823760009101908152919050565b600081516060845280516040606086015260018060a01b0381511660a0860152602081015160c08601526040810151613cd160e08701826001600160801b03169052565b5060608101516101008181880152608083015161012088015260a08301519150613d076101408801836001600160801b03169052565b60c08301516001600160801b031661016088015260e09092015161018087019290925250613d396101a08601826136a6565b905060208201519150605f19858203016080860152613d588183613746565b91505060208301518482036020860152613d728282613662565b9150506040830151848203604086015261373d82826136a6565b6001600160a01b03861681526000610100613daa6020840188613623565b8060a0840152613dbc818401876137dd565b905082810360c0840152613dd08186613c8d565b905082810360e0840152613a588185613662565b6001600160a01b0385168152613e10602082018580516001600160a01b03168252602090810151910152565b60a060608201526000613e2660a0830185613a64565b8281036080840152613e388185613662565b979650505050505050565b600060018060a01b0380861683526020606081850152613e7a60608501875180516001600160a01b03168252602090810151910152565b808601516101008060a0870152613e956101608701836136a6565b9150604080890151605f19808986030160c08a0152613eb48583613662565b945060608b01519150808986030160e08a01528151838652613ed884870182613746565b9050868301519250858103878701528783511681528787840151168782015283830151975060c084820152613f1060c0820189613662565b9750606083015196508088036060820152613f2b8888613a92565b9750608083015196508088036080820152613f468888613a92565b975060a0830151965080880360a082015250613f6287876136a6565b965060808b01519550613f8a848a018780516001600160a01b03168252602090810151910152565b60a08b0151955080898803016101408a01525050613fa885856136a6565b945086850381880152505050506139d88185613662565b6001600160a01b03848116825260606020808401829052855190921690830152830151600090613ff26080840182613623565b5060408401516101008381015261400d6101608401826137dd565b90506060850151605f19808584030161012086015261402c8383613c8d565b9250608087015191508085840301610140860152508051608083526140546080840182613662565b90506020820151838203602085015261406d8282613a92565b9150506040820151838203604085015261408782826138ed565b9150506060820151915082810360608401526140a381836136a6565b9250505082810360408401526139d8818561366256fea26469706673582212203a251684446b4abb3699a78df3584a0feb2d0b88bb48fcc4cb0aabbab06e659064736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000008f0f10ef017cc57d2af1e1c2365807bdff99e9c000000000000000000000000b0bada5d45d939a03c6d211d24a61a4418d7cd13000000000000000000000000bde48624f9e1dd4107df324d1ba3c07004640206
-----Decoded View---------------
Arg [0] : registry_ (address): 0x08F0F10ef017Cc57D2af1E1C2365807BdFF99E9C
Arg [1] : approvedAutomator_ (address): 0xB0baDa5d45d939A03C6d211D24a61A4418D7cd13
Arg [2] : admin_ (address): 0xBDE48624F9E1dd4107df324D1BA3C07004640206
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000008f0f10ef017cc57d2af1e1c2365807bdff99e9c
Arg [1] : 000000000000000000000000b0bada5d45d939a03c6d211d24a61a4418d7cd13
Arg [2] : 000000000000000000000000bde48624f9e1dd4107df324d1ba3c07004640206
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in FRAX
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.