Source Code
Latest 25 from a total of 63,455 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Compound For | 25555881 | 132 days ago | IN | 0 FRAX | 0.00038993 | ||||
| Compound For | 25555855 | 132 days ago | IN | 0 FRAX | 0.00039595 | ||||
| Compound For | 25555850 | 132 days ago | IN | 0 FRAX | 0.00043793 | ||||
| Rebalance For | 25555842 | 132 days ago | IN | 0 FRAX | 0.00044093 | ||||
| Rebalance For | 25555838 | 132 days ago | IN | 0 FRAX | 0.00042277 | ||||
| Rebalance For | 25555834 | 132 days ago | IN | 0 FRAX | 0.00042124 | ||||
| Rebalance For | 25555828 | 132 days ago | IN | 0 FRAX | 0.00044214 | ||||
| Rebalance For | 25555822 | 132 days ago | IN | 0 FRAX | 0.00042686 | ||||
| Rebalance For | 25555816 | 132 days ago | IN | 0 FRAX | 0.0004248 | ||||
| Rebalance For | 25555811 | 132 days ago | IN | 0 FRAX | 0.00043105 | ||||
| Rebalance For | 25555805 | 132 days ago | IN | 0 FRAX | 0.000579 | ||||
| Rebalance For | 25555799 | 132 days ago | IN | 0 FRAX | 0.00043262 | ||||
| Rebalance For | 25555793 | 132 days ago | IN | 0 FRAX | 0.000507 | ||||
| Rebalance For | 25555660 | 132 days ago | IN | 0 FRAX | 0.00037228 | ||||
| Rebalance For | 25555655 | 132 days ago | IN | 0 FRAX | 0.00036965 | ||||
| Rebalance For | 25555649 | 132 days ago | IN | 0 FRAX | 0.00036641 | ||||
| Rebalance For | 25555641 | 132 days ago | IN | 0 FRAX | 0.00037507 | ||||
| Rebalance For | 25555635 | 132 days ago | IN | 0 FRAX | 0.00030452 | ||||
| Rebalance For | 25555626 | 132 days ago | IN | 0 FRAX | 0.00037689 | ||||
| Rebalance For | 25555620 | 132 days ago | IN | 0 FRAX | 0.0002986 | ||||
| Rebalance For | 25555613 | 132 days ago | IN | 0 FRAX | 0.00040062 | ||||
| Rebalance For | 25555522 | 132 days ago | IN | 0 FRAX | 0.00026224 | ||||
| Rebalance For | 25555469 | 132 days ago | IN | 0 FRAX | 0.00023875 | ||||
| Rebalance For | 25555459 | 132 days ago | IN | 0 FRAX | 0.00022229 | ||||
| Rebalance For | 25555451 | 132 days ago | IN | 0 FRAX | 0.00016807 |
Advanced mode: Intended for advanced users or developers and will display all Internal Transactions including zero value transfers.
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | ||||
|---|---|---|---|---|---|---|---|
| 25555881 | 132 days ago | 0 FRAX | |||||
| 25555881 | 132 days ago | 0 FRAX | |||||
| 25555881 | 132 days ago | 0 FRAX | |||||
| 25555881 | 132 days ago | 0 FRAX | |||||
| 25555855 | 132 days ago | 0 FRAX | |||||
| 25555855 | 132 days ago | 0 FRAX | |||||
| 25555855 | 132 days ago | 0 FRAX | |||||
| 25555855 | 132 days ago | 0 FRAX | |||||
| 25555850 | 132 days ago | 0 FRAX | |||||
| 25555850 | 132 days ago | 0 FRAX | |||||
| 25555850 | 132 days ago | 0 FRAX | |||||
| 25555850 | 132 days ago | 0 FRAX | |||||
| 25555842 | 132 days ago | 0 FRAX | |||||
| 25555842 | 132 days ago | 0 FRAX | |||||
| 25555842 | 132 days ago | 0 FRAX | |||||
| 25555842 | 132 days ago | 0 FRAX | |||||
| 25555838 | 132 days ago | 0 FRAX | |||||
| 25555838 | 132 days ago | 0 FRAX | |||||
| 25555838 | 132 days ago | 0 FRAX | |||||
| 25555838 | 132 days ago | 0 FRAX | |||||
| 25555834 | 132 days ago | 0 FRAX | |||||
| 25555834 | 132 days ago | 0 FRAX | |||||
| 25555834 | 132 days ago | 0 FRAX | |||||
| 25555834 | 132 days ago | 0 FRAX | |||||
| 25555828 | 132 days ago | 0 FRAX |
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();
error InvalidAutomator();
error ApprovedAutomatorNotSet(address approvedAutomator);
error ApprovedAutomatorAlreadySet(address approvedAutomator);
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);
event ApprovedAutomatorRevoked(address approvedAutomator);
address[] public approvedAutomators;
mapping(address => bool) public isApprovedAutomator;
constructor(
SickleRegistry registry_,
address payable approvedAutomator_,
address admin_
) Admin(admin_) NonDelegateMulticall(registry_) {
_setApprovedAutomator(approvedAutomator_);
}
modifier onlyApprovedAutomator() {
if (!isApprovedAutomator[msg.sender]) revert NotApprovedAutomator();
_;
}
/// Public functions
function approvedAutomatorsLength() external view returns (uint256) {
return approvedAutomators.length;
}
// 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 {
_setApprovedAutomator(approvedAutomator_);
}
function revokeApprovedAutomator(
address approvedAutomator_
) external onlyAdmin {
if (!isApprovedAutomator[approvedAutomator_]) {
revert ApprovedAutomatorNotSet(approvedAutomator_);
}
for (uint256 i; i < approvedAutomators.length; i++) {
if (approvedAutomators[i] == approvedAutomator_) {
approvedAutomators[i] =
approvedAutomators[approvedAutomators.length - 1];
approvedAutomators.pop();
break;
}
}
isApprovedAutomator[approvedAutomator_] = false;
emit ApprovedAutomatorRevoked(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;) {
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
);
unchecked {
++i;
}
}
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 != farms.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;) {
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);
unchecked {
++i;
}
}
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;) {
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
);
unchecked {
++i;
}
}
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;) {
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
);
unchecked {
++i;
}
}
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 != inPlace.length
|| strategiesLength != sweepTokens.length
) {
revert InvalidInputLength();
}
address[] memory targets = new address[](strategiesLength);
bytes[] memory data = new bytes[](strategiesLength);
for (uint256 i; i < strategiesLength;) {
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
);
unchecked {
++i;
}
}
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;) {
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);
unchecked {
++i;
}
}
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;) {
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
);
unchecked {
++i;
}
}
this.multicall(targets, data);
}
// Internal
function _setApprovedAutomator(
address payable approvedAutomator_
) internal {
if (approvedAutomator_ == address(0)) revert InvalidAutomator();
if (isApprovedAutomator[approvedAutomator_]) {
revert ApprovedAutomatorAlreadySet(approvedAutomator_);
}
isApprovedAutomator[approvedAutomator_] = true;
approvedAutomators.push(approvedAutomator_);
emit ApprovedAutomatorSet(approvedAutomator_);
}
}// 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(address(0), admin_);
admin = admin_;
}
/// @notice Sets a new admin
/// @param newAdmin Address of the new admin
/// @custom:access Restricted to protocol admin.
function setAdmin(
address newAdmin
) external onlyAdmin {
emit AdminSet(admin, newAdmin);
admin = newAdmin;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
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 {
/// ERRORS ///
error MulticallParamsMismatchError(); // 0xc1e637c9
/// @notice Thrown when the target contract is not whitelisted
/// @param target Address of the non-whitelisted target
error TargetNotWhitelisted(address target); // 0x47ccabe7
/// @notice Thrown when the caller is not whitelisted
/// @param caller Address of the non-whitelisted caller
error CallerNotWhitelisted(address caller); // 0x252c8273
/// STORAGE ///
/// @notice Address of the SickleRegistry contract
/// @dev Needs to be immutable so that it's accessible for Sickle proxies
SickleRegistry public immutable registry;
/// INITIALIZATION ///
/// @param registry_ Address of the SickleRegistry contract
constructor(
SickleRegistry registry_
) {
registry = registry_;
}
/// WRITE FUNCTIONS ///
/// @notice Batch multiple calls together (calls or delegatecalls)
/// @param targets Array of targets to call
/// @param data Array of data to pass with the calls
function multicall(
address[] calldata targets,
bytes[] calldata data
) external payable {
if (targets.length != data.length) {
revert MulticallParamsMismatchError();
}
if (!registry.isWhitelistedCaller(msg.sender)) {
revert CallerNotWhitelisted(msg.sender);
}
for (uint256 i = 0; i != data.length;) {
if (targets[i] == address(0)) {
unchecked {
++i;
}
continue; // No-op
}
if (targets[i] != address(this)) {
if (!registry.isWhitelistedTarget(targets[i])) {
revert TargetNotWhitelisted(targets[i]);
}
}
(bool success, bytes memory result) = targets[i].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_
) Multicall(sickleRegistry_) {
_disableInitializers();
}
/// @param sickleOwner_ Address of the Sickle owner
function initialize(
address sickleOwner_,
address approved_
) external initializer {
SickleStorage._initializeSickleStorage(sickleOwner_, approved_);
}
/// INTERNALS ///
function onERC721Received(
address, // operator
address, // from
uint256, // tokenId
bytes calldata // data
) external pure returns (bytes4) {
return this.onERC721Received.selector;
}
function onERC1155Received(
address, // operator
address, // from
uint256, // id
uint256, // value
bytes calldata // data
) external pure returns (bytes4) {
return this.onERC1155Received.selector;
}
function onERC1155BatchReceived(
address, // operator
address, // from
uint256[] calldata, // ids
uint256[] calldata, // values
bytes calldata // data
) external pure returns (bytes4) {
return this.onERC1155BatchReceived.selector;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { Admin } from "contracts/base/Admin.sol";
library SickleRegistryEvents {
event CollectorChanged(address newCollector);
event FeesUpdated(bytes32[] feeHashes, uint256[] feesInBP);
event ReferralCodeCreated(bytes32 indexed code, address indexed referrer);
// Multicall caller and target whitelist status changes
event CallerStatusChanged(address caller, bool isWhitelisted);
event TargetStatusChanged(address target, bool isWhitelisted);
}
/// @title SickleRegistry contract
/// @author vfat.tools
/// @notice Manages the whitelisted contracts and the collector address
contract SickleRegistry is Admin {
/// CONSTANTS ///
uint256 constant MAX_FEE = 500; // 5%
/// ERRORS ///
error ArrayLengthMismatch(); // 0xa24a13a6
error FeeAboveMaxLimit(); // 0xd6cf7b5e
error InvalidReferralCode(); // 0xe55b4629
/// STORAGE ///
/// @notice Address of the fee collector
address public collector;
/// @notice Tracks the contracts that can be called through Sickle multicall
/// @return True if the contract is a whitelisted target
mapping(address => bool) public isWhitelistedTarget;
/// @notice Tracks the contracts that can call Sickle multicall
/// @return True if the contract is a whitelisted caller
mapping(address => bool) public isWhitelistedCaller;
/// @notice Keeps track of the referrers and their associated code
mapping(bytes32 => address) public referralCodes;
/// @notice Mapping for fee hashes (hash of the strategy contract addresses
/// and the function selectors) and their associated fees
/// @return The fee in basis points to apply to the transaction amount
mapping(bytes32 => uint256) public feeRegistry;
/// WRITE FUNCTIONS ///
/// @param admin_ Address of the admin
/// @param collector_ Address of the collector
constructor(address admin_, address collector_) Admin(admin_) {
collector = collector_;
}
/// @notice Updates the whitelist status for multiple multicall targets
/// @param targets Addresses of the contracts to update
/// @param isApproved New status for the contracts
/// @custom:access Restricted to protocol admin.
function setWhitelistedTargets(
address[] calldata targets,
bool isApproved
) external onlyAdmin {
for (uint256 i; i < targets.length;) {
isWhitelistedTarget[targets[i]] = isApproved;
emit SickleRegistryEvents.TargetStatusChanged(
targets[i], isApproved
);
unchecked {
++i;
}
}
}
/// @notice Updates the fee collector address
/// @param newCollector Address of the new fee collector
/// @custom:access Restricted to protocol admin.
function updateCollector(
address newCollector
) external onlyAdmin {
collector = newCollector;
emit SickleRegistryEvents.CollectorChanged(newCollector);
}
/// @notice Update the whitelist status for multiple multicall callers
/// @param callers Addresses of the callers
/// @param isApproved New status for the caller
/// @custom:access Restricted to protocol admin.
function setWhitelistedCallers(
address[] calldata callers,
bool isApproved
) external onlyAdmin {
for (uint256 i; i < callers.length;) {
isWhitelistedCaller[callers[i]] = isApproved;
emit SickleRegistryEvents.CallerStatusChanged(
callers[i], isApproved
);
unchecked {
++i;
}
}
}
/// @notice Associates a referral code to the address of the caller
function setReferralCode(
bytes32 referralCode
) external {
if (referralCodes[referralCode] != address(0)) {
revert InvalidReferralCode();
}
referralCodes[referralCode] = msg.sender;
emit SickleRegistryEvents.ReferralCodeCreated(referralCode, msg.sender);
}
/// @notice Update the fees for multiple strategy functions
/// @param feeHashes Array of fee hashes
/// @param feesArray Array of fees to apply (in basis points)
/// @custom:access Restricted to protocol admin.
function setFees(
bytes32[] calldata feeHashes,
uint256[] calldata feesArray
) external onlyAdmin {
if (feeHashes.length != feesArray.length) {
revert ArrayLengthMismatch();
}
for (uint256 i = 0; i < feeHashes.length;) {
if (feesArray[i] <= MAX_FEE) {
feeRegistry[feeHashes[i]] = feesArray[i];
} else {
revert FeeAboveMaxLimit();
}
unchecked {
++i;
}
}
emit SickleRegistryEvents.FeesUpdated(feeHashes, feesArray);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { 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;
address[] sweepTokens;
}
struct NftCompound {
SimpleNftHarvest harvest;
NftZapIn zap;
}
struct NftRebalance {
IUniswapV3Pool pool;
NftPosition position;
NftHarvest harvest;
NftWithdraw withdraw;
NftIncrease increase;
}
struct NftMove {
IUniswapV3Pool pool;
NftPosition position;
NftHarvest harvest;
NftWithdraw withdraw;
NftDeposit deposit;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { ZapIn, ZapOut } from "contracts/libraries/ZapLib.sol";
import { SwapParams } from "contracts/structs/LiquidityStructs.sol";
struct Farm {
address stakingContract;
uint256 poolIndex;
}
struct DepositParams {
Farm farm;
address[] tokensIn;
uint256[] amountsIn;
ZapIn zap;
bytes extraData;
}
struct WithdrawParams {
bytes extraData;
ZapOut zap;
address[] tokensOut;
}
struct HarvestParams {
SwapParams[] swaps;
bytes extraData;
address[] tokensOut;
}
struct CompoundParams {
Farm claimFarm;
bytes claimExtraData;
address[] rewardTokens;
ZapIn zap;
Farm depositFarm;
bytes depositExtraData;
}
struct SimpleDepositParams {
Farm farm;
address lpToken;
uint256 amountIn;
bytes extraData;
}
struct SimpleHarvestParams {
address[] rewardTokens;
bytes extraData;
}
struct SimpleWithdrawParams {
address lpToken;
uint256 amountOut;
bytes extraData;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { Initializable } from
"@openzeppelin/contracts/proxy/utils/Initializable.sol";
library SickleStorageEvents {
event ApprovedAddressChanged(address newApproved);
}
/// @title SickleStorage contract
/// @author vfat.tools
/// @notice Base storage of the Sickle contract
/// @dev This contract needs to be inherited by stub contracts meant to be used
/// with `delegatecall`
abstract contract SickleStorage is Initializable {
/// ERRORS ///
/// @notice Thrown when the caller is not the owner of the Sickle contract
error NotOwnerError(); // 0x74a21527
/// @notice Thrown when the caller is not a strategy contract or the
/// Flashloan Stub
error NotStrategyError(); // 0x4581ba62
/// STORAGE ///
/// @notice Address of the owner
address public owner;
/// @notice An address that can be set by the owner of the Sickle contract
/// in order to trigger specific functions.
address public approved;
/// MODIFIERS ///
/// @dev Restricts a function call to the owner of the Sickle contract
modifier onlyOwner() {
if (msg.sender != owner) revert NotOwnerError();
_;
}
/// INITIALIZATION ///
/// @param owner_ Address of the owner of this Sickle contract
function _initializeSickleStorage(
address owner_,
address approved_
) internal onlyInitializing {
owner = owner_;
approved = approved_;
}
/// WRITE FUNCTIONS ///
/// @notice Sets the approved address of this Sickle
/// @param newApproved Address meant to be approved by the owner
function setApproved(
address newApproved
) external onlyOwner {
approved = newApproved;
emit SickleStorageEvents.ApprovedAddressChanged(newApproved);
}
/// @notice Checks if `caller` is either the owner of the Sickle contract
/// or was approved by them
/// @param caller Address to check
/// @return True if `caller` is either the owner of the Sickle contract
function isOwnerOrApproved(
address caller
) public view returns (bool) {
return caller == owner || caller == approved;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { SickleRegistry } from "contracts/SickleRegistry.sol";
/// @title Multicall contract
/// @author vfat.tools
/// @notice Enables calling multiple methods in a single call to the contract
abstract contract Multicall {
/// ERRORS ///
error MulticallParamsMismatchError(); // 0xc1e637c9
/// @notice Thrown when the target contract is not whitelisted
/// @param target Address of the non-whitelisted target
error TargetNotWhitelisted(address target); // 0x47ccabe7
/// @notice Thrown when the caller is not whitelisted
/// @param caller Address of the non-whitelisted caller
error CallerNotWhitelisted(address caller); // 0x252c8273
/// STORAGE ///
/// @notice Address of the SickleRegistry contract
/// @dev Needs to be immutable so that it's accessible for Sickle proxies
SickleRegistry public immutable registry;
/// INITIALIZATION ///
/// @param registry_ Address of the SickleRegistry contract
constructor(
SickleRegistry registry_
) {
registry = registry_;
}
/// WRITE FUNCTIONS ///
/// @notice Batch multiple calls together (calls or delegatecalls)
/// @param targets Array of targets to call
/// @param data Array of data to pass with the calls
function multicall(
address[] calldata targets,
bytes[] calldata data
) external payable {
if (targets.length != data.length) {
revert MulticallParamsMismatchError();
}
if (!registry.isWhitelistedCaller(msg.sender)) {
revert CallerNotWhitelisted(msg.sender);
}
for (uint256 i = 0; i != data.length;) {
if (targets[i] == address(0)) {
unchecked {
++i;
}
continue; // No-op
}
if (targets[i] != address(this)) {
if (!registry.isWhitelistedTarget(targets[i])) {
revert TargetNotWhitelisted(targets[i]);
}
}
(bool success, bytes memory result) =
targets[i].delegatecall(data[i]);
if (!success) {
if (result.length == 0) revert();
assembly {
revert(add(32, result), mload(result))
}
}
unchecked {
++i;
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.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;
}// 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
} from "contracts/structs/LiquidityStructs.sol";
interface ILiquidityConnector {
error InvalidPrice();
function addLiquidity(
AddLiquidityParams memory addLiquidityParams
) external payable;
function removeLiquidity(
RemoveLiquidityParams memory removeLiquidityParams
) external;
function swapExactTokensForTokens(
SwapParams memory swap
) external payable;
function swapExactETHForTokens(
SwapParams memory swap
) external payable;
function getPoolPrice(
address lpToken,
uint256 baseTokenIndex,
uint256 quoteTokenIndex
) external view returns (uint256);
function getReserves(
address lpToken
) external view returns (uint256[] memory reserves);
function getTokens(
address lpToken
) external view returns (address[] memory tokens);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { Admin } from "contracts/base/Admin.sol";
import { TimelockAdmin } from "contracts/base/TimelockAdmin.sol";
error ConnectorNotRegistered(address target);
error CustomRegistryAlreadyRegistered();
interface ICustomConnectorRegistry {
function connectorOf(
address target
) external view returns (address);
}
contract ConnectorRegistry is Admin, TimelockAdmin {
event ConnectorChanged(address target, address connector);
event CustomRegistryAdded(address registry);
event CustomRegistryRemoved(address registry);
error ConnectorAlreadySet(address target);
error ConnectorNotSet(address target);
error ArrayLengthMismatch();
ICustomConnectorRegistry[] public customRegistries;
mapping(address target => address connector) private connectors_;
constructor(
address admin_,
address timelockAdmin_
) Admin(admin_) TimelockAdmin(timelockAdmin_) { }
/// Admin functions
/// @notice Update connector addresses for a batch of targets.
/// @dev Controls which connector contracts are used for the specified
/// targets.
/// @custom:access Restricted to protocol admin.
function setConnectors(
address[] calldata targets,
address[] calldata connectors
) external onlyAdmin {
if (targets.length != connectors.length) {
revert ArrayLengthMismatch();
}
for (uint256 i; i != targets.length;) {
if (connectors_[targets[i]] != address(0)) {
revert ConnectorAlreadySet(targets[i]);
}
connectors_[targets[i]] = connectors[i];
emit ConnectorChanged(targets[i], connectors[i]);
unchecked {
++i;
}
}
}
function updateConnectors(
address[] calldata targets,
address[] calldata connectors
) external onlyTimelockAdmin {
if (targets.length != connectors.length) {
revert ArrayLengthMismatch();
}
for (uint256 i; i != targets.length;) {
if (connectors_[targets[i]] == address(0)) {
revert ConnectorNotSet(targets[i]);
}
connectors_[targets[i]] = connectors[i];
emit ConnectorChanged(targets[i], connectors[i]);
unchecked {
++i;
}
}
}
/// @notice Append an address to the custom registries list.
/// @custom:access Restricted to protocol admin.
function addCustomRegistry(
ICustomConnectorRegistry registry
) external onlyAdmin {
if (isCustomRegistry(registry)) {
revert CustomRegistryAlreadyRegistered();
}
customRegistries.push(registry);
emit CustomRegistryAdded(address(registry));
}
/// @notice Replace an address in the custom registries list.
/// @custom:access Restricted to protocol admin.
function updateCustomRegistry(
uint256 index,
ICustomConnectorRegistry newRegistry
) external onlyTimelockAdmin {
ICustomConnectorRegistry oldRegistry = customRegistries[index];
emit CustomRegistryRemoved(address(oldRegistry));
customRegistries[index] = newRegistry;
if (address(newRegistry) != address(0)) {
emit CustomRegistryAdded(address(newRegistry));
}
}
/// Public functions
function connectorOf(
address target
) external view returns (address) {
address connector = _getConnector(target);
if (connector != address(0)) {
return connector;
}
revert ConnectorNotRegistered(target);
}
function hasConnector(
address target
) external view returns (bool) {
return _getConnector(target) != address(0);
}
function isCustomRegistry(
ICustomConnectorRegistry registry
) public view returns (bool) {
for (uint256 i; i != customRegistries.length;) {
if (address(customRegistries[i]) == address(registry)) {
return true;
}
unchecked {
++i;
}
}
return false;
}
/// Internal functions
function _getConnector(
address target
) internal view returns (address) {
address connector = connectors_[target];
if (connector != address(0)) {
return connector;
}
uint256 length = customRegistries.length;
for (uint256 i; i != length;) {
if (address(customRegistries[i]) != address(0)) {
(bool success, bytes memory data) = address(customRegistries[i])
.staticcall(
abi.encodeWithSelector(
ICustomConnectorRegistry.connectorOf.selector, target
)
);
if (success && data.length == 32) {
address _connector = abi.decode(data, (address));
if (_connector != address(0)) {
return _connector;
}
}
}
unchecked {
++i;
}
}
return address(0);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
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 payable;
}// 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/",
"@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":"approvedAutomator","type":"address"}],"name":"ApprovedAutomatorAlreadySet","type":"error"},{"inputs":[{"internalType":"address","name":"approvedAutomator","type":"address"}],"name":"ApprovedAutomatorNotSet","type":"error"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"CallerNotWhitelisted","type":"error"},{"inputs":[],"name":"InvalidAutomator","type":"error"},{"inputs":[],"name":"InvalidInputLength","type":"error"},{"inputs":[],"name":"MulticallParamsMismatchError","type":"error"},{"inputs":[],"name":"NotAdminError","type":"error"},{"inputs":[],"name":"NotApprovedAutomator","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":"ApprovedAutomatorRevoked","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":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":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"approvedAutomators","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"approvedAutomatorsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"address[]","name":"sweepTokens","type":"address[]"}],"internalType":"struct NftHarvest[]","name":"harvestParams","type":"tuple[]"},{"components":[{"components":[{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftRemoveLiquidity","name":"removeLiquidityParams","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"}],"internalType":"struct NftZapOut","name":"zap","type":"tuple"},{"internalType":"address[]","name":"tokensOut","type":"address[]"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftWithdraw[]","name":"withdrawParams","type":"tuple[]"},{"internalType":"address[][]","name":"sweepTokens","type":"address[][]"}],"name":"exitFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"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":"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":"address[]","name":"sweepTokens","type":"address[]"}],"internalType":"struct NftHarvest[]","name":"params","type":"tuple[]"}],"name":"harvestFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isApprovedAutomator","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":[{"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":"address[]","name":"sweepTokens","type":"address[]"}],"internalType":"struct NftHarvest","name":"harvest","type":"tuple"},{"components":[{"components":[{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"uint128","name":"amount0Max","type":"uint128"},{"internalType":"uint128","name":"amount1Max","type":"uint128"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftRemoveLiquidity","name":"removeLiquidityParams","type":"tuple"},{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"}],"internalType":"struct NftZapOut","name":"zap","type":"tuple"},{"internalType":"address[]","name":"tokensOut","type":"address[]"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftWithdraw","name":"withdraw","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokensIn","type":"address[]"},{"internalType":"uint256[]","name":"amountsIn","type":"uint256[]"},{"components":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams[]","name":"swaps","type":"tuple[]"},{"components":[{"internalType":"contract INonfungiblePositionManager","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"internalType":"struct Pool","name":"pool","type":"tuple"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint256","name":"amount0Desired","type":"uint256"},{"internalType":"uint256","name":"amount1Desired","type":"uint256"},{"internalType":"uint256","name":"amount0Min","type":"uint256"},{"internalType":"uint256","name":"amount1Min","type":"uint256"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftAddLiquidity","name":"addLiquidityParams","type":"tuple"}],"internalType":"struct NftZapIn","name":"zap","type":"tuple"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct NftIncrease","name":"increase","type":"tuple"}],"internalType":"struct NftRebalance[]","name":"params","type":"tuple[]"},{"internalType":"address[][]","name":"sweepTokens","type":"address[][]"}],"name":"rebalanceFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"registry","outputs":[{"internalType":"contract SickleRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"approvedAutomator_","type":"address"}],"name":"revokeApprovedAutomator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"approvedAutomator_","type":"address"}],"name":"setApprovedAutomator","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a06040523480156200001157600080fd5b50604051620045c1380380620045c18339810160408190526200003491620001d2565b60408051600081526001600160a01b0383166020820152849183917fbf265e8326285a2747e33e54d5945f7111f2b5edb826eb8c08d4677779b3ff97910160405180910390a1600080546001600160a01b0319166001600160a01b0392831617905516608052620000a582620000ae565b50505062000226565b6001600160a01b038116620000d657604051631d8d67b960e11b815260040160405180910390fd5b6001600160a01b03811660009081526002602052604090205460ff16156200012057604051631c9ab5b560e01b81526001600160a01b038216600482015260240160405180910390fd5b6001600160a01b0381166000818152600260209081526040808320805460ff191660019081179091558054808201825593527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf690920180546001600160a01b0319168417905590519182527f7b24afe53ea3c0eb8558ae101198e86c392b4055609b2be0e0b23b89b2b8f013910160405180910390a150565b6001600160a01b0381168114620001cf57600080fd5b50565b600080600060608486031215620001e857600080fd5b8351620001f581620001b9565b60208501519093506200020881620001b9565b60408501519092506200021b81620001b9565b809150509250925092565b60805161437162000250600039600081816101e201528181610bce0152610ce101526143716000f3fe6080604052600436106100f35760003560e01c80638a3455701161008a578063d4b1200311610059578063d4b12003146102bc578063e6fb317f146102dc578063f25c4fa9146102fc578063f851a4401461031c57600080fd5b80638a3455701461021c5780639969e9ee1461025c57806399e2a63b1461027c578063bd42d8481461029c57600080fd5b806363fb0b96116100c657806363fb0b961461017d578063704b6c0214610190578063745a7b3b146101b05780637b103999146101d057600080fd5b80631ccb65ff146100f8578063216f5a891461011a57806329df02cf1461013a5780635be6d0621461015a575b600080fd5b34801561010457600080fd5b50610118610113366004611e1f565b61033c565b005b34801561012657600080fd5b506101186101353660046126c9565b610510565b34801561014657600080fd5b50610118610155366004612bb5565b610821565b34801561016657600080fd5b506001546040519081526020015b60405180910390f35b61011861018b366004612d1a565b610b99565b34801561019c57600080fd5b506101186101ab366004611e1f565b610ec5565b3480156101bc57600080fd5b506101186101cb366004611e1f565b610f59565b3480156101dc57600080fd5b506102047f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610174565b34801561022857600080fd5b5061024c610237366004611e1f565b60026020526000908152604090205460ff1681565b6040519015158152602001610174565b34801561026857600080fd5b50610118610277366004612d85565b610f90565b34801561028857600080fd5b50610118610297366004612f81565b611282565b3480156102a857600080fd5b506101186102b7366004613158565b611543565b3480156102c857600080fd5b506102046102d736600461333e565b6117bb565b3480156102e857600080fd5b506101186102f7366004613552565b6117e5565b34801561030857600080fd5b5061011861031736600461375d565b611a4d565b34801561032857600080fd5b50600054610204906001600160a01b031681565b6000546001600160a01b031633146103675760405163b5c42b3b60e01b815260040160405180910390fd5b6001600160a01b03811660009081526002602052604090205460ff166103b0576040516342ad5b3f60e01b81526001600160a01b03821660048201526024015b60405180910390fd5b60005b6001548110156104b757816001600160a01b0316600182815481106103da576103da613821565b6000918252602090912001546001600160a01b0316036104a5576001805461040390829061384d565b8154811061041357610413613821565b600091825260209091200154600180546001600160a01b03909216918390811061043f5761043f613821565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600180548061047e5761047e613866565b600082815260209020810160001990810180546001600160a01b03191690550190556104b7565b806104af8161387c565b9150506103b3565b506001600160a01b038116600081815260026020908152604091829020805460ff1916905590519182527f09c1ab3a33736061b9ab4db19afb80345fb417d89a6b531651d8c51291bf507f91015b60405180910390a150565b3360009081526002602052604090205460ff166105405760405163198f48cb60e31b815260040160405180910390fd5b8551855181141580610553575084518114155b8061055f575083518114155b8061056b575082518114155b80610577575081518114155b1561059557604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b038111156105af576105af611e43565b6040519080825280602002602001820160405280156105d8578160200160208202803683370190505b5090506000826001600160401b038111156105f5576105f5611e43565b60405190808252806020026020018201604052801561062857816020015b60608152602001906001900390816106135790505b50905060005b838110156107be57600089828151811061064a5761064a613821565b60200260200101519050600089838151811061066857610668613821565b602002602001015190508b838151811061068457610684613821565b602002602001015185848151811061069e5761069e613821565b60200260200101906001600160a01b031690816001600160a01b03168152505081818a85815181106106d2576106d2613821565b60200260200101518a86815181106106ec576106ec613821565b60200260200101518a878151811061070657610706613821565b6020026020010151604051602401610722959493929190613b47565b60408051601f198184030181529190526020810180516001600160e01b031663f0806a7f60e01b179052845185908590811061076057610760613821565b6020026020010181905250806040015181602001516001600160a01b0316836001600160a01b03167f62d08c7b40038caee4cbb8d156cdba7f6c9cc8e53163de4b9c5d986f253fd7d860405160405180910390a4505060010161062e565b506040516331fd85cb60e11b815230906363fb0b96906107e49085908590600401613bc9565b600060405180830381600087803b1580156107fe57600080fd5b505af1158015610812573d6000803e3d6000fd5b50505050505050505050505050565b3360009081526002602052604090205460ff166108515760405163198f48cb60e31b815260040160405180910390fd5b8651865181141580610864575085518114155b80610870575084518114155b8061087c575082518114155b80610888575083518114155b80610894575081518114155b156108b257604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b038111156108cc576108cc611e43565b6040519080825280602002602001820160405280156108f5578160200160208202803683370190505b5090506000826001600160401b0381111561091257610912611e43565b60405190808252806020026020018201604052801561094557816020015b60608152602001906001900390816109305790505b50905060005b83811015610b35578a818151811061096557610965613821565b602002602001015183828151811061097f5761097f613821565b60200260200101906001600160a01b031690816001600160a01b0316815250508981815181106109b1576109b1613821565b60200260200101518982815181106109cb576109cb613821565b60200260200101518983815181106109e5576109e5613821565b60200260200101518984815181106109ff576109ff613821565b6020026020010151898581518110610a1957610a19613821565b6020026020010151898681518110610a3357610a33613821565b6020026020010151604051602401610a5096959493929190613cb3565b60408051601f198184030181529190526020810180516001600160e01b031663f1a9e60360e01b1790528251839083908110610a8e57610a8e613821565b6020026020010181905250888181518110610aab57610aab613821565b602002602001015160200151898281518110610ac957610ac9613821565b6020026020010151600001516001600160a01b03168b8381518110610af057610af0613821565b60200260200101516001600160a01b03167f60072b5585d4e6f71a97d87f0e001a6482f2cf1d00c33a30437a3b6f6ebd0a8f60405160405180910390a460010161094b565b506040516331fd85cb60e11b815230906363fb0b9690610b5b9085908590600401613bc9565b600060405180830381600087803b158015610b7557600080fd5b505af1158015610b89573d6000803e3d6000fd5b5050505050505050505050505050565b828114610bb95760405163c1e637c960e01b815260040160405180910390fd5b6040516332afe8a160e21b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063cabfa28490602401602060405180830381865afa158015610c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c419190613e0b565b610c605760405163252c827360e01b81523360048201526024016103a7565b60005b808214610ebe576000858583818110610c7e57610c7e613821565b9050602002016020810190610c939190611e1f565b6001600160a01b031603610ca957600101610c63565b30858583818110610cbc57610cbc613821565b9050602002016020810190610cd19190611e1f565b6001600160a01b031614610ded577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663907caa00868684818110610d2057610d20613821565b9050602002016020810190610d359190611e1f565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610d79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9d9190613e0b565b610ded57848482818110610db357610db3613821565b9050602002016020810190610dc89190611e1f565b6040516347ccabe760e01b81526001600160a01b0390911660048201526024016103a7565b600080868684818110610e0257610e02613821565b9050602002016020810190610e179190611e1f565b6001600160a01b0316858585818110610e3257610e32613821565b9050602002810190610e449190613e28565b604051610e52929190613e6e565b6000604051808303816000865af19150503d8060008114610e8f576040519150601f19603f3d011682016040523d82523d6000602084013e610e94565b606091505b509150915081610eb4578051600003610eac57600080fd5b805181602001fd5b5050600101610c63565b5050505050565b6000546001600160a01b03163314610ef05760405163b5c42b3b60e01b815260040160405180910390fd5b600054604080516001600160a01b03928316815291831660208301527fbf265e8326285a2747e33e54d5945f7111f2b5edb826eb8c08d4677779b3ff97910160405180910390a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610f845760405163b5c42b3b60e01b815260040160405180910390fd5b610f8d81611cfb565b50565b3360009081526002602052604090205460ff16610fc05760405163198f48cb60e31b815260040160405180910390fd5b8451845181141580610fd3575083518114155b80610fdf575082518114155b80610feb575081518114155b1561100957604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b0381111561102357611023611e43565b60405190808252806020026020018201604052801561104c578160200160208202803683370190505b5090506000826001600160401b0381111561106957611069611e43565b60405190808252806020026020018201604052801561109c57816020015b60608152602001906001900390816110875790505b50905060005b838110156112205760008882815181106110be576110be613821565b6020026020010151905060008883815181106110dc576110dc613821565b6020026020010151905060008884815181106110fa576110fa613821565b602002602001015190508b848151811061111657611116613821565b602002602001015186858151811061113057611130613821565b60200260200101906001600160a01b031690816001600160a01b0316815250508282828a878151811061116557611165613821565b60200260200101516040516024016111809493929190613e7e565b60408051601f198184030181529190526020810180516001600160e01b031663aaec71d760e01b17905285518690869081106111be576111be613821565b6020026020010181905250816020015182600001516001600160a01b0316846001600160a01b03167fbeb1a0a003f297419afd0c65340a684e8c5e9b576a1a705a4ac19762f8e89c0460405160405180910390a48360010193505050506110a2565b506040516331fd85cb60e11b815230906363fb0b96906112469085908590600401613bc9565b600060405180830381600087803b15801561126057600080fd5b505af1158015611274573d6000803e3d6000fd5b505050505050505050505050565b3360009081526002602052604090205460ff166112b25760405163198f48cb60e31b815260040160405180910390fd5b83518351811415806112c5575082518114155b806112d1575081518114155b156112ef57604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b0381111561130957611309611e43565b604051908082528060200260200182016040528015611332578160200160208202803683370190505b5090506000826001600160401b0381111561134f5761134f611e43565b60405190808252806020026020018201604052801561138257816020015b606081526020019060019003908161136d5790505b50905060005b838110156114e25760008782815181106113a4576113a4613821565b6020026020010151905060008783815181106113c2576113c2613821565b602002602001015190508983815181106113de576113de613821565b60200260200101518584815181106113f8576113f8613821565b60200260200101906001600160a01b031690816001600160a01b031681525050818188858151811061142c5761142c613821565b602002602001015160405160240161144693929190613f3f565b60408051601f198184030181529190526020810180516001600160e01b0316634a2462b560e11b179052845185908590811061148457611484613821565b6020026020010181905250806040015181602001516001600160a01b0316836001600160a01b03167f845400de7ed0a439c0685ef185e4e48ab874482b2bbba826983593c7b9bb114b60405160405180910390a45050600101611388565b506040516331fd85cb60e11b815230906363fb0b96906115089085908590600401613bc9565b600060405180830381600087803b15801561152257600080fd5b505af1158015611536573d6000803e3d6000fd5b5050505050505050505050565b3360009081526002602052604090205460ff166115735760405163198f48cb60e31b815260040160405180910390fd5b8351835181141580611586575082518114155b80611592575081518114155b156115b057604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b038111156115ca576115ca611e43565b6040519080825280602002602001820160405280156115f3578160200160208202803683370190505b5090506000826001600160401b0381111561161057611610611e43565b60405190808252806020026020018201604052801561164357816020015b606081526020019060019003908161162e5790505b50905060005b838110156114e257600087828151811061166557611665613821565b60200260200101519050600087838151811061168357611683613821565b6020026020010151905089838151811061169f5761169f613821565b60200260200101518584815181106116b9576116b9613821565b60200260200101906001600160a01b031690816001600160a01b03168152505081818885815181106116ed576116ed613821565b602002602001015160405160240161170793929190613f6e565b60408051601f198184030181529190526020810180516001600160e01b031663814a1f1560e01b179052845185908590811061174557611745613821565b6020908102919091018101919091526080820151805183518051908401519284015160408051948552948401526001600160a01b039182169390821692918616917fa7618589b4ad2eca6c42db5d1b67fe22fd78e950354363e80700e97e021614c6910160405180910390a45050600101611649565b600181815481106117cb57600080fd5b6000918252602090912001546001600160a01b0316905081565b3360009081526002602052604090205460ff166118155760405163198f48cb60e31b815260040160405180910390fd5b8351835181141580611828575082518114155b80611834575081518114155b1561185257604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b0381111561186c5761186c611e43565b604051908082528060200260200182016040528015611895578160200160208202803683370190505b5090506000826001600160401b038111156118b2576118b2611e43565b6040519080825280602002602001820160405280156118e557816020015b60608152602001906001900390816118d05790505b50905060005b838110156114e257600086828151811061190757611907613821565b60200260200101519050600088838151811061192557611925613821565b6020026020010151905089838151811061194157611941613821565b602002602001015185848151811061195b5761195b613821565b60200260200101906001600160a01b031690816001600160a01b031681525050808288858151811061198f5761198f613821565b60200260200101516040516024016119a9939291906141e9565b60408051601f198184030181529190526020810180516001600160e01b0316631c03256560e31b17905284518590859081106119e7576119e7613821565b60200260200101819052508160200151604001518260200151602001516001600160a01b0316826001600160a01b03167fb26a0db4cf85bbeaf7c8a6dcf47ab1bab082afd520f0120d76781ec53f67df6e60405160405180910390a450506001016118eb565b3360009081526002602052604090205460ff16611a7d5760405163198f48cb60e31b815260040160405180910390fd5b8551855181141580611a90575084518114155b80611a9c575083518114155b80611aa8575082518114155b80611ab4575081518114155b15611ad257604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b03811115611aec57611aec611e43565b604051908082528060200260200182016040528015611b15578160200160208202803683370190505b5090506000826001600160401b03811115611b3257611b32611e43565b604051908082528060200260200182016040528015611b6557816020015b6060815260200190600190039081611b505790505b50905060005b838110156107be576000898281518110611b8757611b87613821565b602002602001015190506000898381518110611ba557611ba5613821565b602002602001015190508b8381518110611bc157611bc1613821565b6020026020010151858481518110611bdb57611bdb613821565b60200260200101906001600160a01b031690816001600160a01b03168152505081818a8581518110611c0f57611c0f613821565b60200260200101518a8681518110611c2957611c29613821565b60200260200101518a8781518110611c4357611c43613821565b6020026020010151604051602401611c5f9594939291906142e3565b60408051601f198184030181529190526020810180516001600160e01b03166338f6f92760e01b1790528451859085908110611c9d57611c9d613821565b6020026020010181905250806040015181602001516001600160a01b0316836001600160a01b03167f24a5e161bb55a0a758c5ce5e6621fc0494f946bd2e70162ed7d785c7b914079160405160405180910390a45050600101611b6b565b6001600160a01b038116611d2257604051631d8d67b960e11b815260040160405180910390fd5b6001600160a01b03811660009081526002602052604090205460ff1615611d6757604051631c9ab5b560e01b81526001600160a01b03821660048201526024016103a7565b6001600160a01b0381166000818152600260209081526040808320805460ff191660019081179091558054808201825593527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf690920180546001600160a01b0319168417905590519182527f7b24afe53ea3c0eb8558ae101198e86c392b4055609b2be0e0b23b89b2b8f0139101610505565b6001600160a01b0381168114610f8d57600080fd5b8035611e1a81611dfa565b919050565b600060208284031215611e3157600080fd5b8135611e3c81611dfa565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715611e7b57611e7b611e43565b60405290565b604051606081016001600160401b0381118282101715611e7b57611e7b611e43565b604051608081016001600160401b0381118282101715611e7b57611e7b611e43565b60405160a081016001600160401b0381118282101715611e7b57611e7b611e43565b60405161014081016001600160401b0381118282101715611e7b57611e7b611e43565b60405160c081016001600160401b0381118282101715611e7b57611e7b611e43565b60405161010081016001600160401b0381118282101715611e7b57611e7b611e43565b604051601f8201601f191681016001600160401b0381118282101715611f7757611f77611e43565b604052919050565b60006001600160401b03821115611f9857611f98611e43565b5060051b60200190565b600082601f830112611fb357600080fd5b81356020611fc8611fc383611f7f565b611f4f565b82815260059290921b84018101918181019086841115611fe757600080fd5b8286015b8481101561200b578035611ffe81611dfa565b8352918301918301611feb565b509695505050505050565b600082601f83011261202757600080fd5b81356020612037611fc383611f7f565b82815260059290921b8401810191818101908684111561205657600080fd5b8286015b8481101561200b57803561206d81611dfa565b835291830191830161205a565b60006040828403121561208c57600080fd5b612094611e59565b905081356120a181611dfa565b808252506020820135602082015292915050565b6000608082840312156120c757600080fd5b6120cf611e81565b90506120db838361207a565b815260408201356120eb81611dfa565b6020820152606091909101356040820152919050565b600082601f83011261211257600080fd5b81356020612122611fc383611f7f565b82815260079290921b8401810191818101908684111561214157600080fd5b8286015b8481101561200b5761215788826120b5565b835291830191608001612145565b80356001600160801b0381168114611e1a57600080fd5b600082601f83011261218d57600080fd5b81356001600160401b038111156121a6576121a6611e43565b6121b9601f8201601f1916602001611f4f565b8181528460208386010111156121ce57600080fd5b816020850160208301376000918101602001919091529392505050565b6000608082840312156121fd57600080fd5b612205611ea3565b905081356001600160401b038082111561221e57600080fd5b61222a85838601611fa2565b835261223860208501612165565b602084015261224960408501612165565b6040840152606084013591508082111561226257600080fd5b5061226f8482850161217c565b60608301525092915050565b600082601f83011261228c57600080fd5b8135602061229c611fc383611f7f565b82815260059290921b840181019181810190868411156122bb57600080fd5b8286015b8481101561200b5780356001600160401b03808211156122df5760008081fd5b9088019060a0828b03601f19018113156122f95760008081fd5b612301611ec5565b8784013561230e81611dfa565b808252506040808501358983015260608086013582840152608091508186013561233781611dfa565b9083015291840135918383111561234e5760008081fd5b61235c8d8a8588010161217c565b9082015286525050509183019183016122bf565b60006060828403121561238257600080fd5b61238a611e81565b9050813561239781611dfa565b815260208201356123a781611dfa565b6020820152604082013562ffffff811681146123c257600080fd5b604082015292915050565b8035600281900b8114611e1a57600080fd5b6000604082840312156123f157600080fd5b6123f9611e59565b905081356001600160401b038082111561241257600080fd5b61241e8583860161227b565b8352602084013591508082111561243457600080fd5b90830190610180828603121561244957600080fd5b612451611ee7565b61245a83611e0f565b8152602083013560208201526124738660408501612370565b604082015261248460a084016123cd565b606082015261249560c084016123cd565b608082015260e083013560a08201526101008084013560c08301526101208085013560e0840152610140850135828401526101608501359150838211156124db57600080fd5b6124e78883870161217c565b9083015250602084015250909392505050565b600082601f83011261250b57600080fd5b8135602061251b611fc383611f7f565b82815260059290921b8401810191818101908684111561253a57600080fd5b8286015b8481101561200b5780356001600160401b038082111561255e5760008081fd5b908801906040828b03601f19018113156125785760008081fd5b612580611e59565b87840135838111156125925760008081fd5b6125a08d8a838801016121eb565b8252509083013590828211156125b65760008081fd5b6125c48c89848701016123df565b81890152865250505091830191830161253e565b8015158114610f8d57600080fd5b600082601f8301126125f757600080fd5b81356020612607611fc383611f7f565b82815260059290921b8401810191818101908684111561262657600080fd5b8286015b8481101561200b57803561263d816125d8565b835291830191830161262a565b600082601f83011261265b57600080fd5b8135602061266b611fc383611f7f565b82815260059290921b8401810191818101908684111561268a57600080fd5b8286015b8481101561200b5780356001600160401b038111156126ad5760008081fd5b6126bb8986838b0101611fa2565b84525091830191830161268e565b60008060008060008060c087890312156126e257600080fd5b86356001600160401b03808211156126f957600080fd5b6127058a838b01611fa2565b9750602089013591508082111561271b57600080fd5b6127278a838b01612016565b9650604089013591508082111561273d57600080fd5b6127498a838b01612101565b9550606089013591508082111561275f57600080fd5b61276b8a838b016124fa565b9450608089013591508082111561278157600080fd5b61278d8a838b016125e6565b935060a08901359150808211156127a357600080fd5b506127b089828a0161264a565b9150509295509295509295565b600082601f8301126127ce57600080fd5b813560206127de611fc383611f7f565b82815260069290921b840181019181810190868411156127fd57600080fd5b8286015b8481101561200b57612813888261207a565b835291830191604001612801565b600082601f83011261283257600080fd5b81356020612842611fc383611f7f565b82815260059290921b8401810191818101908684111561286157600080fd5b8286015b8481101561200b5780356001600160401b03808211156128855760008081fd5b908801906060828b03601f190181131561289f5760008081fd5b6128a7611e81565b87840135838111156128b95760008081fd5b6128c78d8a8388010161227b565b825250604080850135848111156128de5760008081fd5b6128ec8e8b8389010161217c565b838b0152509184013591838311156129045760008081fd5b6129128d8a85880101611fa2565b908201528652505050918301918301612865565b600082601f83011261293757600080fd5b81356020612947611fc383611f7f565b82815260059290921b8401810191818101908684111561296657600080fd5b8286015b8481101561200b578035835291830191830161296a565b600082601f83011261299257600080fd5b61299f611fc38335611f7f565b82358082526020808301929160051b8501018510156129bd57600080fd5b602084015b6020853560051b860101811015612bac576001600160401b0380823511156129e957600080fd5b81358601601f196060828a0382011215612a0257600080fd5b612a0a611e81565b8360208401351115612a1b57600080fd5b612a2d8a60208086013586010161217c565b81528360408401351115612a4057600080fd5b60408301358301604083828d03011215612a5957600080fd5b612a61611e59565b8560208301351115612a7257600080fd5b6020820135820160c085828f03011215612a8b57600080fd5b612a93611f0a565b9450612aa160208201611e0f565b8552612aaf60408201611e0f565b60208601528660608201351115612ac557600080fd5b612ad88d60206060840135840101611fa2565b6040860152608081013560608601528660a08201351115612af857600080fd5b612b0b8d602060a0840135840101612926565b60808601528660c08201351115612b2157600080fd5b612b348d602060c084013584010161217c565b60a0860152508381528560408301351115612b4e57600080fd5b612b618c6020604085013585010161227b565b602082015280602084015250508360608401351115612b7f57600080fd5b612b928a60206060860135860101611fa2565b6040820152865250506020938401939190910190506129c2565b50949350505050565b600080600080600080600060e0888a031215612bd057600080fd5b87356001600160401b0380821115612be757600080fd5b612bf38b838c01612016565b985060208a0135915080821115612c0957600080fd5b612c158b838c01612016565b975060408a0135915080821115612c2b57600080fd5b612c378b838c016127bd565b965060608a0135915080821115612c4d57600080fd5b612c598b838c01612821565b955060808a0135915080821115612c6f57600080fd5b612c7b8b838c0161264a565b945060a08a0135915080821115612c9157600080fd5b612c9d8b838c01612981565b935060c08a0135915080821115612cb357600080fd5b50612cc08a828b0161264a565b91505092959891949750929550565b60008083601f840112612ce157600080fd5b5081356001600160401b03811115612cf857600080fd5b6020830191508360208260051b8501011115612d1357600080fd5b9250929050565b60008060008060408587031215612d3057600080fd5b84356001600160401b0380821115612d4757600080fd5b612d5388838901612ccf565b90965094506020870135915080821115612d6c57600080fd5b50612d7987828801612ccf565b95989497509550505050565b600080600080600060a08688031215612d9d57600080fd5b85356001600160401b0380821115612db457600080fd5b612dc089838a01612016565b96506020880135915080821115612dd657600080fd5b612de289838a01612016565b95506040880135915080821115612df857600080fd5b612e0489838a016127bd565b94506060880135915080821115612e1a57600080fd5b612e2689838a01612821565b93506080880135915080821115612e3c57600080fd5b50612e498882890161264a565b9150509295509295909350565b600060808284031215612e6857600080fd5b612e70611ea3565b905081356001600160401b0380821115612e8957600080fd5b612e95858386016121eb565b83526020840135915080821115612eab57600080fd5b612eb78583860161227b565b60208401526040840135915080821115612ed057600080fd5b612edc85838601611fa2565b60408401526060840135915080821115612ef557600080fd5b5061226f84828501611fa2565b600082601f830112612f1357600080fd5b81356020612f23611fc383611f7f565b82815260059290921b84018101918181019086841115612f4257600080fd5b8286015b8481101561200b5780356001600160401b03811115612f655760008081fd5b612f738986838b0101612e56565b845250918301918301612f46565b60008060008060808587031215612f9757600080fd5b84356001600160401b0380821115612fae57600080fd5b612fba88838901611fa2565b95506020870135915080821115612fd057600080fd5b612fdc88838901612016565b94506040870135915080821115612ff257600080fd5b612ffe88838901612101565b9350606087013591508082111561301457600080fd5b5061302187828801612f02565b91505092959194509250565b60006040828403121561303f57600080fd5b613047611e59565b905081356001600160401b038082111561306057600080fd5b61306c8583860161227b565b8352602084013591508082111561308257600080fd5b9083019060c0828603121561309657600080fd5b61309e611f0a565b6130a783611e0f565b81526130b560208401611e0f565b60208201526040830135828111156130cc57600080fd5b6130d887828601611fa2565b6040830152506060830135828111156130f057600080fd5b6130fc87828601612926565b60608301525060808301358281111561311457600080fd5b61312087828601612926565b60808301525060a08301358281111561313857600080fd5b6131448782860161217c565b60a083015250602084015250909392505050565b6000806000806080858703121561316e57600080fd5b6001600160401b03808635111561318457600080fd5b6131918787358801612016565b94506020860135818111156131a557600080fd5b6131b188828901612016565b9450506040860135818111156131c657600080fd5b8601601f810188136131d757600080fd5b6131e4611fc38235611f7f565b81358082526020808301929160051b8401018a81111561320357600080fd5b602084015b8181101561330c57858135111561321e57600080fd5b80358501610100818e03601f1901121561323757600080fd5b61323f611f0a565b61324c8e6020840161207a565b815260608201358881111561326057600080fd5b61326f8f60208386010161217c565b60208301525060808201358881111561328757600080fd5b6132968f602083860101611fa2565b60408301525060a0820135888111156132ae57600080fd5b6132bd8f60208386010161302d565b6060830152506132d08e60c0840161207a565b6080820152610100820135888111156132e857600080fd5b6132f78f60208386010161217c565b60a08301525085525060209384019301613208565b5090955050505060608601358181111561332557600080fd5b6133318882890161264a565b9250505092959194509250565b60006020828403121561335057600080fd5b5035919050565b60006060828403121561336957600080fd5b613371611e81565b905081356001600160401b038082111561338a57600080fd5b908301906040828603121561339e57600080fd5b6133a6611e59565b8235828111156133b557600080fd5b830161010081880312156133c857600080fd5b6133d0611f2c565b6133d982611e0f565b8152602080830135818301526133f160408401612165565b6040830152606083013560608301526080830135608083015261341660a08401612165565b60a083015261342760c08401612165565b60c083015260e08301358581111561343e57600080fd5b61344a8a82860161217c565b60e0840152508184528086013592508483111561346657600080fd5b6134728984880161227b565b818501528387528088013595508486111561348c57600080fd5b61349889878a01611fa2565b9087015250505060408401359150808211156134b357600080fd5b506134c08482850161217c565b60408301525092915050565b6000608082840312156134de57600080fd5b6134e6611ea3565b905081356001600160401b03808211156134ff57600080fd5b61350b85838601611fa2565b8352602084013591508082111561352157600080fd5b61352d85838601612926565b6020840152604084013591508082111561354657600080fd5b612249858386016123df565b6000806000806080858703121561356857600080fd5b6001600160401b03808635111561357e57600080fd5b61358b8787358801611fa2565b945060208601358181111561359f57600080fd5b6135ab88828901612016565b9450506040860135818111156135c057600080fd5b8601601f810188136135d157600080fd5b6135de611fc38235611f7f565b81358082526020808301929160051b8401018a8111156135fd57600080fd5b602084015b8181101561330c57858135111561361857600080fd5b80358501610100818e03601f1901121561363157600080fd5b613639611ec5565b61364560208301611e0f565b81526136548e604084016120b5565b602082015260c08201358881111561366b57600080fd5b61367a8f602083860101612e56565b60408301525060e08201358881111561369257600080fd5b6136a18f602083860101613357565b606083015250610100820135888111156136ba57600080fd5b6136c98f6020838601016134cc565b60808301525085525060209384019301613602565b600082601f8301126136ef57600080fd5b813560206136ff611fc383611f7f565b82815260059290921b8401810191818101908684111561371e57600080fd5b8286015b8481101561200b5780356001600160401b038111156137415760008081fd5b61374f8986838b0101613357565b845250918301918301613722565b60008060008060008060c0878903121561377657600080fd5b86356001600160401b038082111561378d57600080fd5b6137998a838b01611fa2565b975060208901359150808211156137af57600080fd5b6137bb8a838b01612016565b965060408901359150808211156137d157600080fd5b6137dd8a838b01612101565b955060608901359150808211156137f357600080fd5b6137ff8a838b01612f02565b9450608089013591508082111561381557600080fd5b61278d8a838b016136de565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8181038181111561386057613860613837565b92915050565b634e487b7160e01b600052603160045260246000fd5b60006001820161388e5761388e613837565b5060010190565b6138b382825180516001600160a01b03168252602090810151910152565b60208101516001600160a01b03166040838101919091520151606090910152565b600081518084526020808501945080840160005b8381101561390d5781516001600160a01b0316875295820195908201906001016138e8565b509495945050505050565b6000815180845260005b8181101561393e57602081850181015186830182015201613922565b506000602082860101526020601f19601f83011685010191505092915050565b600081516080845261397360808501826138d4565b905060208301516001600160801b0380821660208701528060408601511660408701525050606083015184820360608601526139af8282613918565b95945050505050565b600082825180855260208086019550808260051b84010181860160005b84811015613a4557858303601f19018952815180516001600160a01b0390811685528582015186860152604080830151908601526060808301519091169085015260809081015160a091850182905290613a3181860183613918565b9a86019a94505050908301906001016139d5565b5090979650505050505050565b6000815160408452613a6760408501826139b8565b905060208301518482036020860152610180613a8c8383516001600160a01b03169052565b6020828101518482015260408084015180516001600160a01b039081168388015292810151909216606086015281015162ffffff166080850152506060820151613adb60a085018260020b9052565b506080820151613af060c085018260020b9052565b5060a082015160e084015260c0820151610100818186015260e0840151915061012082818701528185015161014087015280850151945050505080610160840152613b3d81840183613918565b9695505050505050565b6001600160a01b03861681526000610100613b656020840188613895565b8060a08401528551604082850152613b8161014085018261395e565b915050602086015160ff1984830301610120850152613ba08282613a52565b91505084151560c084015282810360e0840152613bbd81856138d4565b98975050505050505050565b604081526000613bdc60408301856138d4565b6020838203818501528185518084528284019150828160051b85010183880160005b83811015613c2c57601f19878403018552613c1a838351613918565b94860194925090850190600101613bfe565b50909998505050505050505050565b6000815160608452613c5060608501826139b8565b905060208301518482036020860152613c698282613918565b915050604083015184820360408601526139af82826138d4565b600081518084526020808501945080840160005b8381101561390d57815187529582019590820190600101613c97565b6001600160a01b0387811682526000906020613ce48185018a80516001600160a01b03168252602090810151910152565b60e06060850152613cf860e0850189613c3b565b8481036080860152613d0a81896138d4565b905084810360a0860152865160608252613d276060830182613918565b9050828801518282038484015280516040835285815116604084015285858201511660608401526040810151955060c06080840152613d6a6101008401876138d4565b9550606081015160a08401526080810151603f19808589030160c0860152613d928883613c83565b975060a08301519250808589030160e08601525050613db18682613918565b95505083810151905081850384830152613dcb85826139b8565b9450505060408701519150808303604082015250613de982826138d4565b91505082810360c0840152613dfe81856138d4565b9998505050505050505050565b600060208284031215613e1d57600080fd5b8151611e3c816125d8565b6000808335601e19843603018112613e3f57600080fd5b8301803591506001600160401b03821115613e5957600080fd5b602001915036819003821315612d1357600080fd5b8183823760009101908152919050565b6001600160a01b0385168152613eaa602082018580516001600160a01b03168252602090810151910152565b60a060608201526000613ec060a0830185613c3b565b8281036080840152613ed281856138d4565b979650505050505050565b6000815160808452613ef2608085018261395e565b905060208301518482036020860152613f0b82826139b8565b91505060408301518482036040860152613f2582826138d4565b915050606083015184820360608601526139af82826138d4565b6001600160a01b0384168152613f586020820184613895565b60c060a082015260006139af60c0830184613edd565b600060018060a01b0380861683526020606081850152613fa560608501875180516001600160a01b03168252602090810151910152565b808601516101008060a0870152613fc0610160870183613918565b9150604080890151605f19808986030160c08a0152613fdf85836138d4565b945060608b01519150808986030160e08a01528151838652614003848701826139b8565b9050868301519250858103878701528783511681528787840151168782015283830151975060c08482015261403b60c08201896138d4565b97506060830151965080880360608201526140568888613c83565b97506080830151965080880360808201526140718888613c83565b975060a0830151965080880360a08201525061408d8787613918565b965060808b015195506140b5848a018780516001600160a01b03168252602090810151910152565b60a08b0151955080898803016101408a015250506140d38585613918565b94508685038188015250505050613b3d81856138d4565b600081516060845280516040606086015260018060a01b0381511660a0860152602081015160c0860152604081015161412e60e08701826001600160801b03169052565b5060608101516101008181880152608083015161012088015260a083015191506141646101408801836001600160801b03169052565b60c08301516001600160801b031661016088015260e090920151610180870192909252506141966101a0860182613918565b905060208201519150605f198582030160808601526141b581836139b8565b915050602083015184820360208601526141cf82826138d4565b915050604083015184820360408601526139af8282613918565b6001600160a01b0384811682526060602080840182905285519092169083015283015160009061421c6080840182613895565b50604084015161010083810152614237610160840182613edd565b90506060850151605f19808584030161012086015261425683836140ea565b92506080870151915080858403016101408601525080516080835261427e60808401826138d4565b9050602082015183820360208501526142978282613c83565b915050604082015183820360408501526142b18282613a52565b9150506060820151915082810360608401526142cd8183613918565b925050508281036040840152613b3d81856138d4565b6001600160a01b038616815260006101006143016020840188613895565b8060a084015261431381840187613edd565b905082810360c084015261432781866140ea565b905082810360e0840152613bbd81856138d456fea264697066735822122026995da85201090ccc07aef1874632b226b070308f8e622c72cb354af188288564736f6c6343000813003300000000000000000000000008f0f10ef017cc57d2af1e1c2365807bdff99e9c000000000000000000000000b0bada5d45d939a03c6d211d24a61a4418d7cd13000000000000000000000000bde48624f9e1dd4107df324d1ba3c07004640206
Deployed Bytecode
0x6080604052600436106100f35760003560e01c80638a3455701161008a578063d4b1200311610059578063d4b12003146102bc578063e6fb317f146102dc578063f25c4fa9146102fc578063f851a4401461031c57600080fd5b80638a3455701461021c5780639969e9ee1461025c57806399e2a63b1461027c578063bd42d8481461029c57600080fd5b806363fb0b96116100c657806363fb0b961461017d578063704b6c0214610190578063745a7b3b146101b05780637b103999146101d057600080fd5b80631ccb65ff146100f8578063216f5a891461011a57806329df02cf1461013a5780635be6d0621461015a575b600080fd5b34801561010457600080fd5b50610118610113366004611e1f565b61033c565b005b34801561012657600080fd5b506101186101353660046126c9565b610510565b34801561014657600080fd5b50610118610155366004612bb5565b610821565b34801561016657600080fd5b506001546040519081526020015b60405180910390f35b61011861018b366004612d1a565b610b99565b34801561019c57600080fd5b506101186101ab366004611e1f565b610ec5565b3480156101bc57600080fd5b506101186101cb366004611e1f565b610f59565b3480156101dc57600080fd5b506102047f00000000000000000000000008f0f10ef017cc57d2af1e1c2365807bdff99e9c81565b6040516001600160a01b039091168152602001610174565b34801561022857600080fd5b5061024c610237366004611e1f565b60026020526000908152604090205460ff1681565b6040519015158152602001610174565b34801561026857600080fd5b50610118610277366004612d85565b610f90565b34801561028857600080fd5b50610118610297366004612f81565b611282565b3480156102a857600080fd5b506101186102b7366004613158565b611543565b3480156102c857600080fd5b506102046102d736600461333e565b6117bb565b3480156102e857600080fd5b506101186102f7366004613552565b6117e5565b34801561030857600080fd5b5061011861031736600461375d565b611a4d565b34801561032857600080fd5b50600054610204906001600160a01b031681565b6000546001600160a01b031633146103675760405163b5c42b3b60e01b815260040160405180910390fd5b6001600160a01b03811660009081526002602052604090205460ff166103b0576040516342ad5b3f60e01b81526001600160a01b03821660048201526024015b60405180910390fd5b60005b6001548110156104b757816001600160a01b0316600182815481106103da576103da613821565b6000918252602090912001546001600160a01b0316036104a5576001805461040390829061384d565b8154811061041357610413613821565b600091825260209091200154600180546001600160a01b03909216918390811061043f5761043f613821565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600180548061047e5761047e613866565b600082815260209020810160001990810180546001600160a01b03191690550190556104b7565b806104af8161387c565b9150506103b3565b506001600160a01b038116600081815260026020908152604091829020805460ff1916905590519182527f09c1ab3a33736061b9ab4db19afb80345fb417d89a6b531651d8c51291bf507f91015b60405180910390a150565b3360009081526002602052604090205460ff166105405760405163198f48cb60e31b815260040160405180910390fd5b8551855181141580610553575084518114155b8061055f575083518114155b8061056b575082518114155b80610577575081518114155b1561059557604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b038111156105af576105af611e43565b6040519080825280602002602001820160405280156105d8578160200160208202803683370190505b5090506000826001600160401b038111156105f5576105f5611e43565b60405190808252806020026020018201604052801561062857816020015b60608152602001906001900390816106135790505b50905060005b838110156107be57600089828151811061064a5761064a613821565b60200260200101519050600089838151811061066857610668613821565b602002602001015190508b838151811061068457610684613821565b602002602001015185848151811061069e5761069e613821565b60200260200101906001600160a01b031690816001600160a01b03168152505081818a85815181106106d2576106d2613821565b60200260200101518a86815181106106ec576106ec613821565b60200260200101518a878151811061070657610706613821565b6020026020010151604051602401610722959493929190613b47565b60408051601f198184030181529190526020810180516001600160e01b031663f0806a7f60e01b179052845185908590811061076057610760613821565b6020026020010181905250806040015181602001516001600160a01b0316836001600160a01b03167f62d08c7b40038caee4cbb8d156cdba7f6c9cc8e53163de4b9c5d986f253fd7d860405160405180910390a4505060010161062e565b506040516331fd85cb60e11b815230906363fb0b96906107e49085908590600401613bc9565b600060405180830381600087803b1580156107fe57600080fd5b505af1158015610812573d6000803e3d6000fd5b50505050505050505050505050565b3360009081526002602052604090205460ff166108515760405163198f48cb60e31b815260040160405180910390fd5b8651865181141580610864575085518114155b80610870575084518114155b8061087c575082518114155b80610888575083518114155b80610894575081518114155b156108b257604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b038111156108cc576108cc611e43565b6040519080825280602002602001820160405280156108f5578160200160208202803683370190505b5090506000826001600160401b0381111561091257610912611e43565b60405190808252806020026020018201604052801561094557816020015b60608152602001906001900390816109305790505b50905060005b83811015610b35578a818151811061096557610965613821565b602002602001015183828151811061097f5761097f613821565b60200260200101906001600160a01b031690816001600160a01b0316815250508981815181106109b1576109b1613821565b60200260200101518982815181106109cb576109cb613821565b60200260200101518983815181106109e5576109e5613821565b60200260200101518984815181106109ff576109ff613821565b6020026020010151898581518110610a1957610a19613821565b6020026020010151898681518110610a3357610a33613821565b6020026020010151604051602401610a5096959493929190613cb3565b60408051601f198184030181529190526020810180516001600160e01b031663f1a9e60360e01b1790528251839083908110610a8e57610a8e613821565b6020026020010181905250888181518110610aab57610aab613821565b602002602001015160200151898281518110610ac957610ac9613821565b6020026020010151600001516001600160a01b03168b8381518110610af057610af0613821565b60200260200101516001600160a01b03167f60072b5585d4e6f71a97d87f0e001a6482f2cf1d00c33a30437a3b6f6ebd0a8f60405160405180910390a460010161094b565b506040516331fd85cb60e11b815230906363fb0b9690610b5b9085908590600401613bc9565b600060405180830381600087803b158015610b7557600080fd5b505af1158015610b89573d6000803e3d6000fd5b5050505050505050505050505050565b828114610bb95760405163c1e637c960e01b815260040160405180910390fd5b6040516332afe8a160e21b81523360048201527f00000000000000000000000008f0f10ef017cc57d2af1e1c2365807bdff99e9c6001600160a01b03169063cabfa28490602401602060405180830381865afa158015610c1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c419190613e0b565b610c605760405163252c827360e01b81523360048201526024016103a7565b60005b808214610ebe576000858583818110610c7e57610c7e613821565b9050602002016020810190610c939190611e1f565b6001600160a01b031603610ca957600101610c63565b30858583818110610cbc57610cbc613821565b9050602002016020810190610cd19190611e1f565b6001600160a01b031614610ded577f00000000000000000000000008f0f10ef017cc57d2af1e1c2365807bdff99e9c6001600160a01b031663907caa00868684818110610d2057610d20613821565b9050602002016020810190610d359190611e1f565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610d79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9d9190613e0b565b610ded57848482818110610db357610db3613821565b9050602002016020810190610dc89190611e1f565b6040516347ccabe760e01b81526001600160a01b0390911660048201526024016103a7565b600080868684818110610e0257610e02613821565b9050602002016020810190610e179190611e1f565b6001600160a01b0316858585818110610e3257610e32613821565b9050602002810190610e449190613e28565b604051610e52929190613e6e565b6000604051808303816000865af19150503d8060008114610e8f576040519150601f19603f3d011682016040523d82523d6000602084013e610e94565b606091505b509150915081610eb4578051600003610eac57600080fd5b805181602001fd5b5050600101610c63565b5050505050565b6000546001600160a01b03163314610ef05760405163b5c42b3b60e01b815260040160405180910390fd5b600054604080516001600160a01b03928316815291831660208301527fbf265e8326285a2747e33e54d5945f7111f2b5edb826eb8c08d4677779b3ff97910160405180910390a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610f845760405163b5c42b3b60e01b815260040160405180910390fd5b610f8d81611cfb565b50565b3360009081526002602052604090205460ff16610fc05760405163198f48cb60e31b815260040160405180910390fd5b8451845181141580610fd3575083518114155b80610fdf575082518114155b80610feb575081518114155b1561100957604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b0381111561102357611023611e43565b60405190808252806020026020018201604052801561104c578160200160208202803683370190505b5090506000826001600160401b0381111561106957611069611e43565b60405190808252806020026020018201604052801561109c57816020015b60608152602001906001900390816110875790505b50905060005b838110156112205760008882815181106110be576110be613821565b6020026020010151905060008883815181106110dc576110dc613821565b6020026020010151905060008884815181106110fa576110fa613821565b602002602001015190508b848151811061111657611116613821565b602002602001015186858151811061113057611130613821565b60200260200101906001600160a01b031690816001600160a01b0316815250508282828a878151811061116557611165613821565b60200260200101516040516024016111809493929190613e7e565b60408051601f198184030181529190526020810180516001600160e01b031663aaec71d760e01b17905285518690869081106111be576111be613821565b6020026020010181905250816020015182600001516001600160a01b0316846001600160a01b03167fbeb1a0a003f297419afd0c65340a684e8c5e9b576a1a705a4ac19762f8e89c0460405160405180910390a48360010193505050506110a2565b506040516331fd85cb60e11b815230906363fb0b96906112469085908590600401613bc9565b600060405180830381600087803b15801561126057600080fd5b505af1158015611274573d6000803e3d6000fd5b505050505050505050505050565b3360009081526002602052604090205460ff166112b25760405163198f48cb60e31b815260040160405180910390fd5b83518351811415806112c5575082518114155b806112d1575081518114155b156112ef57604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b0381111561130957611309611e43565b604051908082528060200260200182016040528015611332578160200160208202803683370190505b5090506000826001600160401b0381111561134f5761134f611e43565b60405190808252806020026020018201604052801561138257816020015b606081526020019060019003908161136d5790505b50905060005b838110156114e25760008782815181106113a4576113a4613821565b6020026020010151905060008783815181106113c2576113c2613821565b602002602001015190508983815181106113de576113de613821565b60200260200101518584815181106113f8576113f8613821565b60200260200101906001600160a01b031690816001600160a01b031681525050818188858151811061142c5761142c613821565b602002602001015160405160240161144693929190613f3f565b60408051601f198184030181529190526020810180516001600160e01b0316634a2462b560e11b179052845185908590811061148457611484613821565b6020026020010181905250806040015181602001516001600160a01b0316836001600160a01b03167f845400de7ed0a439c0685ef185e4e48ab874482b2bbba826983593c7b9bb114b60405160405180910390a45050600101611388565b506040516331fd85cb60e11b815230906363fb0b96906115089085908590600401613bc9565b600060405180830381600087803b15801561152257600080fd5b505af1158015611536573d6000803e3d6000fd5b5050505050505050505050565b3360009081526002602052604090205460ff166115735760405163198f48cb60e31b815260040160405180910390fd5b8351835181141580611586575082518114155b80611592575081518114155b156115b057604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b038111156115ca576115ca611e43565b6040519080825280602002602001820160405280156115f3578160200160208202803683370190505b5090506000826001600160401b0381111561161057611610611e43565b60405190808252806020026020018201604052801561164357816020015b606081526020019060019003908161162e5790505b50905060005b838110156114e257600087828151811061166557611665613821565b60200260200101519050600087838151811061168357611683613821565b6020026020010151905089838151811061169f5761169f613821565b60200260200101518584815181106116b9576116b9613821565b60200260200101906001600160a01b031690816001600160a01b03168152505081818885815181106116ed576116ed613821565b602002602001015160405160240161170793929190613f6e565b60408051601f198184030181529190526020810180516001600160e01b031663814a1f1560e01b179052845185908590811061174557611745613821565b6020908102919091018101919091526080820151805183518051908401519284015160408051948552948401526001600160a01b039182169390821692918616917fa7618589b4ad2eca6c42db5d1b67fe22fd78e950354363e80700e97e021614c6910160405180910390a45050600101611649565b600181815481106117cb57600080fd5b6000918252602090912001546001600160a01b0316905081565b3360009081526002602052604090205460ff166118155760405163198f48cb60e31b815260040160405180910390fd5b8351835181141580611828575082518114155b80611834575081518114155b1561185257604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b0381111561186c5761186c611e43565b604051908082528060200260200182016040528015611895578160200160208202803683370190505b5090506000826001600160401b038111156118b2576118b2611e43565b6040519080825280602002602001820160405280156118e557816020015b60608152602001906001900390816118d05790505b50905060005b838110156114e257600086828151811061190757611907613821565b60200260200101519050600088838151811061192557611925613821565b6020026020010151905089838151811061194157611941613821565b602002602001015185848151811061195b5761195b613821565b60200260200101906001600160a01b031690816001600160a01b031681525050808288858151811061198f5761198f613821565b60200260200101516040516024016119a9939291906141e9565b60408051601f198184030181529190526020810180516001600160e01b0316631c03256560e31b17905284518590859081106119e7576119e7613821565b60200260200101819052508160200151604001518260200151602001516001600160a01b0316826001600160a01b03167fb26a0db4cf85bbeaf7c8a6dcf47ab1bab082afd520f0120d76781ec53f67df6e60405160405180910390a450506001016118eb565b3360009081526002602052604090205460ff16611a7d5760405163198f48cb60e31b815260040160405180910390fd5b8551855181141580611a90575084518114155b80611a9c575083518114155b80611aa8575082518114155b80611ab4575081518114155b15611ad257604051637db491eb60e01b815260040160405180910390fd5b6000816001600160401b03811115611aec57611aec611e43565b604051908082528060200260200182016040528015611b15578160200160208202803683370190505b5090506000826001600160401b03811115611b3257611b32611e43565b604051908082528060200260200182016040528015611b6557816020015b6060815260200190600190039081611b505790505b50905060005b838110156107be576000898281518110611b8757611b87613821565b602002602001015190506000898381518110611ba557611ba5613821565b602002602001015190508b8381518110611bc157611bc1613821565b6020026020010151858481518110611bdb57611bdb613821565b60200260200101906001600160a01b031690816001600160a01b03168152505081818a8581518110611c0f57611c0f613821565b60200260200101518a8681518110611c2957611c29613821565b60200260200101518a8781518110611c4357611c43613821565b6020026020010151604051602401611c5f9594939291906142e3565b60408051601f198184030181529190526020810180516001600160e01b03166338f6f92760e01b1790528451859085908110611c9d57611c9d613821565b6020026020010181905250806040015181602001516001600160a01b0316836001600160a01b03167f24a5e161bb55a0a758c5ce5e6621fc0494f946bd2e70162ed7d785c7b914079160405160405180910390a45050600101611b6b565b6001600160a01b038116611d2257604051631d8d67b960e11b815260040160405180910390fd5b6001600160a01b03811660009081526002602052604090205460ff1615611d6757604051631c9ab5b560e01b81526001600160a01b03821660048201526024016103a7565b6001600160a01b0381166000818152600260209081526040808320805460ff191660019081179091558054808201825593527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf690920180546001600160a01b0319168417905590519182527f7b24afe53ea3c0eb8558ae101198e86c392b4055609b2be0e0b23b89b2b8f0139101610505565b6001600160a01b0381168114610f8d57600080fd5b8035611e1a81611dfa565b919050565b600060208284031215611e3157600080fd5b8135611e3c81611dfa565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715611e7b57611e7b611e43565b60405290565b604051606081016001600160401b0381118282101715611e7b57611e7b611e43565b604051608081016001600160401b0381118282101715611e7b57611e7b611e43565b60405160a081016001600160401b0381118282101715611e7b57611e7b611e43565b60405161014081016001600160401b0381118282101715611e7b57611e7b611e43565b60405160c081016001600160401b0381118282101715611e7b57611e7b611e43565b60405161010081016001600160401b0381118282101715611e7b57611e7b611e43565b604051601f8201601f191681016001600160401b0381118282101715611f7757611f77611e43565b604052919050565b60006001600160401b03821115611f9857611f98611e43565b5060051b60200190565b600082601f830112611fb357600080fd5b81356020611fc8611fc383611f7f565b611f4f565b82815260059290921b84018101918181019086841115611fe757600080fd5b8286015b8481101561200b578035611ffe81611dfa565b8352918301918301611feb565b509695505050505050565b600082601f83011261202757600080fd5b81356020612037611fc383611f7f565b82815260059290921b8401810191818101908684111561205657600080fd5b8286015b8481101561200b57803561206d81611dfa565b835291830191830161205a565b60006040828403121561208c57600080fd5b612094611e59565b905081356120a181611dfa565b808252506020820135602082015292915050565b6000608082840312156120c757600080fd5b6120cf611e81565b90506120db838361207a565b815260408201356120eb81611dfa565b6020820152606091909101356040820152919050565b600082601f83011261211257600080fd5b81356020612122611fc383611f7f565b82815260079290921b8401810191818101908684111561214157600080fd5b8286015b8481101561200b5761215788826120b5565b835291830191608001612145565b80356001600160801b0381168114611e1a57600080fd5b600082601f83011261218d57600080fd5b81356001600160401b038111156121a6576121a6611e43565b6121b9601f8201601f1916602001611f4f565b8181528460208386010111156121ce57600080fd5b816020850160208301376000918101602001919091529392505050565b6000608082840312156121fd57600080fd5b612205611ea3565b905081356001600160401b038082111561221e57600080fd5b61222a85838601611fa2565b835261223860208501612165565b602084015261224960408501612165565b6040840152606084013591508082111561226257600080fd5b5061226f8482850161217c565b60608301525092915050565b600082601f83011261228c57600080fd5b8135602061229c611fc383611f7f565b82815260059290921b840181019181810190868411156122bb57600080fd5b8286015b8481101561200b5780356001600160401b03808211156122df5760008081fd5b9088019060a0828b03601f19018113156122f95760008081fd5b612301611ec5565b8784013561230e81611dfa565b808252506040808501358983015260608086013582840152608091508186013561233781611dfa565b9083015291840135918383111561234e5760008081fd5b61235c8d8a8588010161217c565b9082015286525050509183019183016122bf565b60006060828403121561238257600080fd5b61238a611e81565b9050813561239781611dfa565b815260208201356123a781611dfa565b6020820152604082013562ffffff811681146123c257600080fd5b604082015292915050565b8035600281900b8114611e1a57600080fd5b6000604082840312156123f157600080fd5b6123f9611e59565b905081356001600160401b038082111561241257600080fd5b61241e8583860161227b565b8352602084013591508082111561243457600080fd5b90830190610180828603121561244957600080fd5b612451611ee7565b61245a83611e0f565b8152602083013560208201526124738660408501612370565b604082015261248460a084016123cd565b606082015261249560c084016123cd565b608082015260e083013560a08201526101008084013560c08301526101208085013560e0840152610140850135828401526101608501359150838211156124db57600080fd5b6124e78883870161217c565b9083015250602084015250909392505050565b600082601f83011261250b57600080fd5b8135602061251b611fc383611f7f565b82815260059290921b8401810191818101908684111561253a57600080fd5b8286015b8481101561200b5780356001600160401b038082111561255e5760008081fd5b908801906040828b03601f19018113156125785760008081fd5b612580611e59565b87840135838111156125925760008081fd5b6125a08d8a838801016121eb565b8252509083013590828211156125b65760008081fd5b6125c48c89848701016123df565b81890152865250505091830191830161253e565b8015158114610f8d57600080fd5b600082601f8301126125f757600080fd5b81356020612607611fc383611f7f565b82815260059290921b8401810191818101908684111561262657600080fd5b8286015b8481101561200b57803561263d816125d8565b835291830191830161262a565b600082601f83011261265b57600080fd5b8135602061266b611fc383611f7f565b82815260059290921b8401810191818101908684111561268a57600080fd5b8286015b8481101561200b5780356001600160401b038111156126ad5760008081fd5b6126bb8986838b0101611fa2565b84525091830191830161268e565b60008060008060008060c087890312156126e257600080fd5b86356001600160401b03808211156126f957600080fd5b6127058a838b01611fa2565b9750602089013591508082111561271b57600080fd5b6127278a838b01612016565b9650604089013591508082111561273d57600080fd5b6127498a838b01612101565b9550606089013591508082111561275f57600080fd5b61276b8a838b016124fa565b9450608089013591508082111561278157600080fd5b61278d8a838b016125e6565b935060a08901359150808211156127a357600080fd5b506127b089828a0161264a565b9150509295509295509295565b600082601f8301126127ce57600080fd5b813560206127de611fc383611f7f565b82815260069290921b840181019181810190868411156127fd57600080fd5b8286015b8481101561200b57612813888261207a565b835291830191604001612801565b600082601f83011261283257600080fd5b81356020612842611fc383611f7f565b82815260059290921b8401810191818101908684111561286157600080fd5b8286015b8481101561200b5780356001600160401b03808211156128855760008081fd5b908801906060828b03601f190181131561289f5760008081fd5b6128a7611e81565b87840135838111156128b95760008081fd5b6128c78d8a8388010161227b565b825250604080850135848111156128de5760008081fd5b6128ec8e8b8389010161217c565b838b0152509184013591838311156129045760008081fd5b6129128d8a85880101611fa2565b908201528652505050918301918301612865565b600082601f83011261293757600080fd5b81356020612947611fc383611f7f565b82815260059290921b8401810191818101908684111561296657600080fd5b8286015b8481101561200b578035835291830191830161296a565b600082601f83011261299257600080fd5b61299f611fc38335611f7f565b82358082526020808301929160051b8501018510156129bd57600080fd5b602084015b6020853560051b860101811015612bac576001600160401b0380823511156129e957600080fd5b81358601601f196060828a0382011215612a0257600080fd5b612a0a611e81565b8360208401351115612a1b57600080fd5b612a2d8a60208086013586010161217c565b81528360408401351115612a4057600080fd5b60408301358301604083828d03011215612a5957600080fd5b612a61611e59565b8560208301351115612a7257600080fd5b6020820135820160c085828f03011215612a8b57600080fd5b612a93611f0a565b9450612aa160208201611e0f565b8552612aaf60408201611e0f565b60208601528660608201351115612ac557600080fd5b612ad88d60206060840135840101611fa2565b6040860152608081013560608601528660a08201351115612af857600080fd5b612b0b8d602060a0840135840101612926565b60808601528660c08201351115612b2157600080fd5b612b348d602060c084013584010161217c565b60a0860152508381528560408301351115612b4e57600080fd5b612b618c6020604085013585010161227b565b602082015280602084015250508360608401351115612b7f57600080fd5b612b928a60206060860135860101611fa2565b6040820152865250506020938401939190910190506129c2565b50949350505050565b600080600080600080600060e0888a031215612bd057600080fd5b87356001600160401b0380821115612be757600080fd5b612bf38b838c01612016565b985060208a0135915080821115612c0957600080fd5b612c158b838c01612016565b975060408a0135915080821115612c2b57600080fd5b612c378b838c016127bd565b965060608a0135915080821115612c4d57600080fd5b612c598b838c01612821565b955060808a0135915080821115612c6f57600080fd5b612c7b8b838c0161264a565b945060a08a0135915080821115612c9157600080fd5b612c9d8b838c01612981565b935060c08a0135915080821115612cb357600080fd5b50612cc08a828b0161264a565b91505092959891949750929550565b60008083601f840112612ce157600080fd5b5081356001600160401b03811115612cf857600080fd5b6020830191508360208260051b8501011115612d1357600080fd5b9250929050565b60008060008060408587031215612d3057600080fd5b84356001600160401b0380821115612d4757600080fd5b612d5388838901612ccf565b90965094506020870135915080821115612d6c57600080fd5b50612d7987828801612ccf565b95989497509550505050565b600080600080600060a08688031215612d9d57600080fd5b85356001600160401b0380821115612db457600080fd5b612dc089838a01612016565b96506020880135915080821115612dd657600080fd5b612de289838a01612016565b95506040880135915080821115612df857600080fd5b612e0489838a016127bd565b94506060880135915080821115612e1a57600080fd5b612e2689838a01612821565b93506080880135915080821115612e3c57600080fd5b50612e498882890161264a565b9150509295509295909350565b600060808284031215612e6857600080fd5b612e70611ea3565b905081356001600160401b0380821115612e8957600080fd5b612e95858386016121eb565b83526020840135915080821115612eab57600080fd5b612eb78583860161227b565b60208401526040840135915080821115612ed057600080fd5b612edc85838601611fa2565b60408401526060840135915080821115612ef557600080fd5b5061226f84828501611fa2565b600082601f830112612f1357600080fd5b81356020612f23611fc383611f7f565b82815260059290921b84018101918181019086841115612f4257600080fd5b8286015b8481101561200b5780356001600160401b03811115612f655760008081fd5b612f738986838b0101612e56565b845250918301918301612f46565b60008060008060808587031215612f9757600080fd5b84356001600160401b0380821115612fae57600080fd5b612fba88838901611fa2565b95506020870135915080821115612fd057600080fd5b612fdc88838901612016565b94506040870135915080821115612ff257600080fd5b612ffe88838901612101565b9350606087013591508082111561301457600080fd5b5061302187828801612f02565b91505092959194509250565b60006040828403121561303f57600080fd5b613047611e59565b905081356001600160401b038082111561306057600080fd5b61306c8583860161227b565b8352602084013591508082111561308257600080fd5b9083019060c0828603121561309657600080fd5b61309e611f0a565b6130a783611e0f565b81526130b560208401611e0f565b60208201526040830135828111156130cc57600080fd5b6130d887828601611fa2565b6040830152506060830135828111156130f057600080fd5b6130fc87828601612926565b60608301525060808301358281111561311457600080fd5b61312087828601612926565b60808301525060a08301358281111561313857600080fd5b6131448782860161217c565b60a083015250602084015250909392505050565b6000806000806080858703121561316e57600080fd5b6001600160401b03808635111561318457600080fd5b6131918787358801612016565b94506020860135818111156131a557600080fd5b6131b188828901612016565b9450506040860135818111156131c657600080fd5b8601601f810188136131d757600080fd5b6131e4611fc38235611f7f565b81358082526020808301929160051b8401018a81111561320357600080fd5b602084015b8181101561330c57858135111561321e57600080fd5b80358501610100818e03601f1901121561323757600080fd5b61323f611f0a565b61324c8e6020840161207a565b815260608201358881111561326057600080fd5b61326f8f60208386010161217c565b60208301525060808201358881111561328757600080fd5b6132968f602083860101611fa2565b60408301525060a0820135888111156132ae57600080fd5b6132bd8f60208386010161302d565b6060830152506132d08e60c0840161207a565b6080820152610100820135888111156132e857600080fd5b6132f78f60208386010161217c565b60a08301525085525060209384019301613208565b5090955050505060608601358181111561332557600080fd5b6133318882890161264a565b9250505092959194509250565b60006020828403121561335057600080fd5b5035919050565b60006060828403121561336957600080fd5b613371611e81565b905081356001600160401b038082111561338a57600080fd5b908301906040828603121561339e57600080fd5b6133a6611e59565b8235828111156133b557600080fd5b830161010081880312156133c857600080fd5b6133d0611f2c565b6133d982611e0f565b8152602080830135818301526133f160408401612165565b6040830152606083013560608301526080830135608083015261341660a08401612165565b60a083015261342760c08401612165565b60c083015260e08301358581111561343e57600080fd5b61344a8a82860161217c565b60e0840152508184528086013592508483111561346657600080fd5b6134728984880161227b565b818501528387528088013595508486111561348c57600080fd5b61349889878a01611fa2565b9087015250505060408401359150808211156134b357600080fd5b506134c08482850161217c565b60408301525092915050565b6000608082840312156134de57600080fd5b6134e6611ea3565b905081356001600160401b03808211156134ff57600080fd5b61350b85838601611fa2565b8352602084013591508082111561352157600080fd5b61352d85838601612926565b6020840152604084013591508082111561354657600080fd5b612249858386016123df565b6000806000806080858703121561356857600080fd5b6001600160401b03808635111561357e57600080fd5b61358b8787358801611fa2565b945060208601358181111561359f57600080fd5b6135ab88828901612016565b9450506040860135818111156135c057600080fd5b8601601f810188136135d157600080fd5b6135de611fc38235611f7f565b81358082526020808301929160051b8401018a8111156135fd57600080fd5b602084015b8181101561330c57858135111561361857600080fd5b80358501610100818e03601f1901121561363157600080fd5b613639611ec5565b61364560208301611e0f565b81526136548e604084016120b5565b602082015260c08201358881111561366b57600080fd5b61367a8f602083860101612e56565b60408301525060e08201358881111561369257600080fd5b6136a18f602083860101613357565b606083015250610100820135888111156136ba57600080fd5b6136c98f6020838601016134cc565b60808301525085525060209384019301613602565b600082601f8301126136ef57600080fd5b813560206136ff611fc383611f7f565b82815260059290921b8401810191818101908684111561371e57600080fd5b8286015b8481101561200b5780356001600160401b038111156137415760008081fd5b61374f8986838b0101613357565b845250918301918301613722565b60008060008060008060c0878903121561377657600080fd5b86356001600160401b038082111561378d57600080fd5b6137998a838b01611fa2565b975060208901359150808211156137af57600080fd5b6137bb8a838b01612016565b965060408901359150808211156137d157600080fd5b6137dd8a838b01612101565b955060608901359150808211156137f357600080fd5b6137ff8a838b01612f02565b9450608089013591508082111561381557600080fd5b61278d8a838b016136de565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8181038181111561386057613860613837565b92915050565b634e487b7160e01b600052603160045260246000fd5b60006001820161388e5761388e613837565b5060010190565b6138b382825180516001600160a01b03168252602090810151910152565b60208101516001600160a01b03166040838101919091520151606090910152565b600081518084526020808501945080840160005b8381101561390d5781516001600160a01b0316875295820195908201906001016138e8565b509495945050505050565b6000815180845260005b8181101561393e57602081850181015186830182015201613922565b506000602082860101526020601f19601f83011685010191505092915050565b600081516080845261397360808501826138d4565b905060208301516001600160801b0380821660208701528060408601511660408701525050606083015184820360608601526139af8282613918565b95945050505050565b600082825180855260208086019550808260051b84010181860160005b84811015613a4557858303601f19018952815180516001600160a01b0390811685528582015186860152604080830151908601526060808301519091169085015260809081015160a091850182905290613a3181860183613918565b9a86019a94505050908301906001016139d5565b5090979650505050505050565b6000815160408452613a6760408501826139b8565b905060208301518482036020860152610180613a8c8383516001600160a01b03169052565b6020828101518482015260408084015180516001600160a01b039081168388015292810151909216606086015281015162ffffff166080850152506060820151613adb60a085018260020b9052565b506080820151613af060c085018260020b9052565b5060a082015160e084015260c0820151610100818186015260e0840151915061012082818701528185015161014087015280850151945050505080610160840152613b3d81840183613918565b9695505050505050565b6001600160a01b03861681526000610100613b656020840188613895565b8060a08401528551604082850152613b8161014085018261395e565b915050602086015160ff1984830301610120850152613ba08282613a52565b91505084151560c084015282810360e0840152613bbd81856138d4565b98975050505050505050565b604081526000613bdc60408301856138d4565b6020838203818501528185518084528284019150828160051b85010183880160005b83811015613c2c57601f19878403018552613c1a838351613918565b94860194925090850190600101613bfe565b50909998505050505050505050565b6000815160608452613c5060608501826139b8565b905060208301518482036020860152613c698282613918565b915050604083015184820360408601526139af82826138d4565b600081518084526020808501945080840160005b8381101561390d57815187529582019590820190600101613c97565b6001600160a01b0387811682526000906020613ce48185018a80516001600160a01b03168252602090810151910152565b60e06060850152613cf860e0850189613c3b565b8481036080860152613d0a81896138d4565b905084810360a0860152865160608252613d276060830182613918565b9050828801518282038484015280516040835285815116604084015285858201511660608401526040810151955060c06080840152613d6a6101008401876138d4565b9550606081015160a08401526080810151603f19808589030160c0860152613d928883613c83565b975060a08301519250808589030160e08601525050613db18682613918565b95505083810151905081850384830152613dcb85826139b8565b9450505060408701519150808303604082015250613de982826138d4565b91505082810360c0840152613dfe81856138d4565b9998505050505050505050565b600060208284031215613e1d57600080fd5b8151611e3c816125d8565b6000808335601e19843603018112613e3f57600080fd5b8301803591506001600160401b03821115613e5957600080fd5b602001915036819003821315612d1357600080fd5b8183823760009101908152919050565b6001600160a01b0385168152613eaa602082018580516001600160a01b03168252602090810151910152565b60a060608201526000613ec060a0830185613c3b565b8281036080840152613ed281856138d4565b979650505050505050565b6000815160808452613ef2608085018261395e565b905060208301518482036020860152613f0b82826139b8565b91505060408301518482036040860152613f2582826138d4565b915050606083015184820360608601526139af82826138d4565b6001600160a01b0384168152613f586020820184613895565b60c060a082015260006139af60c0830184613edd565b600060018060a01b0380861683526020606081850152613fa560608501875180516001600160a01b03168252602090810151910152565b808601516101008060a0870152613fc0610160870183613918565b9150604080890151605f19808986030160c08a0152613fdf85836138d4565b945060608b01519150808986030160e08a01528151838652614003848701826139b8565b9050868301519250858103878701528783511681528787840151168782015283830151975060c08482015261403b60c08201896138d4565b97506060830151965080880360608201526140568888613c83565b97506080830151965080880360808201526140718888613c83565b975060a0830151965080880360a08201525061408d8787613918565b965060808b015195506140b5848a018780516001600160a01b03168252602090810151910152565b60a08b0151955080898803016101408a015250506140d38585613918565b94508685038188015250505050613b3d81856138d4565b600081516060845280516040606086015260018060a01b0381511660a0860152602081015160c0860152604081015161412e60e08701826001600160801b03169052565b5060608101516101008181880152608083015161012088015260a083015191506141646101408801836001600160801b03169052565b60c08301516001600160801b031661016088015260e090920151610180870192909252506141966101a0860182613918565b905060208201519150605f198582030160808601526141b581836139b8565b915050602083015184820360208601526141cf82826138d4565b915050604083015184820360408601526139af8282613918565b6001600160a01b0384811682526060602080840182905285519092169083015283015160009061421c6080840182613895565b50604084015161010083810152614237610160840182613edd565b90506060850151605f19808584030161012086015261425683836140ea565b92506080870151915080858403016101408601525080516080835261427e60808401826138d4565b9050602082015183820360208501526142978282613c83565b915050604082015183820360408501526142b18282613a52565b9150506060820151915082810360608401526142cd8183613918565b925050508281036040840152613b3d81856138d4565b6001600160a01b038616815260006101006143016020840188613895565b8060a084015261431381840187613edd565b905082810360c084015261432781866140ea565b905082810360e0840152613bbd81856138d456fea264697066735822122026995da85201090ccc07aef1874632b226b070308f8e622c72cb354af188288564736f6c63430008130033
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.