Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ConnectorLens
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { ConnectorRegistry } from "contracts/ConnectorRegistry.sol";
import { INftLiquidityConnector } from
"contracts/interfaces/INftLiquidityConnector.sol";
import { INftFarmConnector } from "contracts/interfaces/INftFarmConnector.sol";
import { IFarmConnector, Farm } from "contracts/interfaces/IFarmConnector.sol";
import {
NftPoolKey, NftPoolInfo
} from "contracts/structs/NftLiquidityStructs.sol";
import { NftPosition } from "contracts/structs/NftFarmStrategyStructs.sol";
struct NftPositionInfo {
uint128 liquidity;
int24 tickLower;
int24 tickUpper;
bool isStaked;
uint256 fees0;
uint256 fees1;
uint256[] tokenRewards;
}
struct ERC20PositionInfo {
uint256 balance;
bool isStaked;
uint256[] tokenRewards;
}
contract ConnectorLens {
struct LiquidityData {
int24 tickLower;
int24 tickUpper;
uint128 liquidity;
}
struct FeesData {
uint256 fees0;
uint256 fees1;
}
function getPositionInfo(
ConnectorRegistry registry,
address poolFactory,
address user,
NftPosition calldata position,
address[] calldata rewardTokens
) external view returns (NftPositionInfo memory, NftPoolKey memory) {
NftPoolKey memory poolKey = _get_pool_key(
registry, poolFactory, address(position.nft), position.tokenId
);
NftPositionInfo memory positionInfo = _get_position_info(
registry, poolFactory, user, position, rewardTokens
);
return (positionInfo, poolKey);
}
function _get_pool_key(
ConnectorRegistry registry,
address poolFactory,
address nftManager,
uint256 tokenId
) internal view returns (NftPoolKey memory) {
address connectorAddress = registry.connectorOf(nftManager);
return INftLiquidityConnector(connectorAddress).positionPoolKey(
poolFactory, nftManager, tokenId
);
}
function _get_position_info(
ConnectorRegistry registry,
address poolFactory,
address user,
NftPosition calldata position,
address[] calldata rewardTokens
) internal view returns (NftPositionInfo memory) {
address connectorAddress = registry.connectorOf(address(position.nft));
LiquidityData memory liquidityData =
_get_liquidity_data(connectorAddress, position);
NftPoolKey memory poolKey = INftLiquidityConnector(connectorAddress)
.positionPoolKey(poolFactory, address(position.nft), position.tokenId);
FeesData memory feesData = _get_fees_data(
connectorAddress,
address(position.nft),
poolKey.poolAddress,
position.tokenId
);
address farmConnectorAddress =
registry.connectorOf(address(position.farm.stakingContract));
bool isStaked =
INftFarmConnector(farmConnectorAddress).isStaked(user, position);
uint256[] memory tokenRewards = INftFarmConnector(farmConnectorAddress)
.earned(user, position, rewardTokens);
return NftPositionInfo({
liquidity: liquidityData.liquidity,
tickLower: liquidityData.tickLower,
tickUpper: liquidityData.tickUpper,
isStaked: isStaked,
fees0: feesData.fees0,
fees1: feesData.fees1,
tokenRewards: tokenRewards
});
}
function _get_liquidity_data(
address connectorAddress,
NftPosition calldata position
) internal view returns (LiquidityData memory) {
(int24 tickLower, int24 tickUpper, uint128 liquidity) =
INftLiquidityConnector(connectorAddress).positionLiquidity(
address(position.nft), position.tokenId
);
return LiquidityData({
tickLower: tickLower,
tickUpper: tickUpper,
liquidity: liquidity
});
}
function _get_fees_data(
address connectorAddress,
address nft,
address poolAddress,
uint256 tokenId
) internal view returns (FeesData memory) {
(uint256 fees0, uint256 fees1) = INftLiquidityConnector(
connectorAddress
).earnedFees(nft, poolAddress, tokenId);
return FeesData({ fees0: fees0, fees1: fees1 });
}
function getPoolInfo(
ConnectorRegistry registry,
address nftManager,
address pool,
bytes32 poolId
) external view returns (NftPoolInfo memory poolInfo) {
address connectorAddress = registry.connectorOf(nftManager);
INftLiquidityConnector connector =
INftLiquidityConnector(connectorAddress);
poolInfo = connector.poolInfo(pool, poolId);
}
function getERC20PositionInfo(
ConnectorRegistry registry,
Farm calldata farm,
address user,
address[] calldata rewardTokens
) external view returns (ERC20PositionInfo memory) {
address connectorAddress = registry.connectorOf(farm.stakingContract);
uint256 balance = IFarmConnector(connectorAddress).balanceOf(farm, user);
bool isStaked = IFarmConnector(connectorAddress).isStaked(farm, user);
uint256[] memory tokenRewards =
IFarmConnector(connectorAddress).earned(farm, user, rewardTokens);
return ERC20PositionInfo({
balance: balance,
isStaked: isStaked,
tokenRewards: tokenRewards
});
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { Admin } from "contracts/base/Admin.sol";
import { TimelockAdmin } from "contracts/base/TimelockAdmin.sol";
error ConnectorNotRegistered(address target);
error CustomRegistryAlreadyRegistered();
interface ICustomConnectorRegistry {
function connectorOf(
address target
) external view returns (address);
}
contract ConnectorRegistry is Admin, TimelockAdmin {
event ConnectorChanged(address target, address connector);
event CustomRegistryAdded(address registry);
event CustomRegistryRemoved(address registry);
error ConnectorAlreadySet(address target);
error ConnectorNotSet(address target);
error ArrayLengthMismatch();
ICustomConnectorRegistry[] public customRegistries;
mapping(address target => address connector) private connectors_;
constructor(
address admin_,
address timelockAdmin_
) Admin(admin_) TimelockAdmin(timelockAdmin_) { }
/// Admin functions
/// @notice Update connector addresses for a batch of targets.
/// @dev Controls which connector contracts are used for the specified
/// targets.
/// @custom:access Restricted to protocol admin.
function setConnectors(
address[] calldata targets,
address[] calldata connectors
) external onlyAdmin {
if (targets.length != connectors.length) {
revert ArrayLengthMismatch();
}
for (uint256 i; i != targets.length;) {
if (connectors_[targets[i]] != address(0)) {
revert ConnectorAlreadySet(targets[i]);
}
connectors_[targets[i]] = connectors[i];
emit ConnectorChanged(targets[i], connectors[i]);
unchecked {
++i;
}
}
}
function updateConnectors(
address[] calldata targets,
address[] calldata connectors
) external onlyTimelockAdmin {
if (targets.length != connectors.length) {
revert ArrayLengthMismatch();
}
for (uint256 i; i != targets.length;) {
if (connectors_[targets[i]] == address(0)) {
revert ConnectorNotSet(targets[i]);
}
connectors_[targets[i]] = connectors[i];
emit ConnectorChanged(targets[i], connectors[i]);
unchecked {
++i;
}
}
}
/// @notice Append an address to the custom registries list.
/// @custom:access Restricted to protocol admin.
function addCustomRegistry(
ICustomConnectorRegistry registry
) external onlyAdmin {
if (isCustomRegistry(registry)) {
revert CustomRegistryAlreadyRegistered();
}
customRegistries.push(registry);
emit CustomRegistryAdded(address(registry));
}
/// @notice Replace an address in the custom registries list.
/// @custom:access Restricted to protocol admin.
function updateCustomRegistry(
uint256 index,
ICustomConnectorRegistry newRegistry
) external onlyTimelockAdmin {
ICustomConnectorRegistry oldRegistry = customRegistries[index];
emit CustomRegistryRemoved(address(oldRegistry));
customRegistries[index] = newRegistry;
if (address(newRegistry) != address(0)) {
emit CustomRegistryAdded(address(newRegistry));
}
}
/// Public functions
function connectorOf(
address target
) external view returns (address) {
address connector = _getConnector(target);
if (connector != address(0)) {
return connector;
}
revert ConnectorNotRegistered(target);
}
function hasConnector(
address target
) external view returns (bool) {
return _getConnector(target) != address(0);
}
function isCustomRegistry(
ICustomConnectorRegistry registry
) public view returns (bool) {
for (uint256 i; i != customRegistries.length;) {
if (address(customRegistries[i]) == address(registry)) {
return true;
}
unchecked {
++i;
}
}
return false;
}
/// Internal functions
function _getConnector(
address target
) internal view returns (address) {
address connector = connectors_[target];
if (connector != address(0)) {
return connector;
}
uint256 length = customRegistries.length;
for (uint256 i; i != length;) {
if (address(customRegistries[i]) != address(0)) {
(bool success, bytes memory data) = address(customRegistries[i])
.staticcall(
abi.encodeWithSelector(
ICustomConnectorRegistry.connectorOf.selector, target
)
);
if (success && data.length == 32) {
address _connector = abi.decode(data, (address));
if (_connector != address(0)) {
return _connector;
}
}
}
unchecked {
++i;
}
}
return address(0);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {
NftAddLiquidity,
NftRemoveLiquidity,
NftPoolKey,
NftPoolInfo,
NftPositionInfo
} from "contracts/structs/NftLiquidityStructs.sol";
interface INftLiquidityConnector {
function addLiquidity(
NftAddLiquidity memory addLiquidityParams
) external payable;
function removeLiquidity(
NftRemoveLiquidity memory removeLiquidityParams
) external;
function fee(
address pool,
uint256 tokenId // Used by UniswapV4
) external view returns (uint24);
function totalSupply(
address nftManager
) external view returns (uint256);
function getTokenId(
address nftManager,
address owner
) external view returns (uint256);
function earnedFees(
address nftManager,
address pool,
uint256 tokenId
) external view returns (uint256 fees0, uint256 fees1);
function positionLiquidity(
address nftManager,
uint256 tokenId
)
external
view
returns (int24 tickLower, int24 tickUpper, uint128 liquidity);
function positionPoolKey(
address poolFactory,
address nftManager,
uint256 tokenId
) external view returns (NftPoolKey memory);
function poolInfo(
address pool,
bytes32 poolId
) external view returns (NftPoolInfo memory);
// Maintained for backwards compatibility with NftSettingsRegistry
function positionInfo(
address nftManager,
uint256 tokenId
) external view returns (NftPositionInfo memory);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { NftPosition } from "contracts/structs/NftFarmStrategyStructs.sol";
interface INftFarmConnector {
function depositExistingNft(
NftPosition calldata position,
bytes calldata extraData
) external payable;
function withdrawNft(
NftPosition calldata position,
bytes calldata extraData
) external payable;
// Payable in case an NFT is withdrawn to be increased with ETH
function claim(
NftPosition calldata position,
address[] memory rewardTokens,
uint128 maxAmount0, // For collecting
uint128 maxAmount1,
bytes calldata extraData
) external payable;
function earned(
address user,
NftPosition calldata position,
address[] memory rewardTokens
) external view returns (uint256[] memory);
function isStaked(
address user,
NftPosition calldata position
) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { Farm } from "contracts/structs/FarmStrategyStructs.sol";
interface IFarmConnector {
function deposit(
Farm calldata farm,
address token,
bytes memory extraData
) external payable;
function withdraw(
Farm calldata farm,
uint256 amount,
bytes memory extraData
) external;
function claim(Farm calldata farm, bytes memory extraData) external;
function balanceOf(
Farm calldata farm,
address user
) external view returns (uint256);
function earned(
Farm calldata farm,
address user,
address[] calldata rewardTokens
) external view returns (uint256[] memory);
function isStaked(
Farm calldata farm,
address user
) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { INonfungiblePositionManager } from
"contracts/interfaces/external/uniswap/INonfungiblePositionManager.sol";
struct Pool {
address token0;
address token1;
uint24 fee;
}
struct NftPoolKey {
address poolAddress;
bytes32 poolId;
}
struct NftPoolInfo {
address token0;
address token1;
uint24 fee;
uint24 tickSpacing;
uint160 sqrtPriceX96;
int24 tick;
uint128 liquidity;
uint256 feeGrowthGlobal0X128;
uint256 feeGrowthGlobal1X128;
}
// Maintained for backwards compatibility with NftSettingsRegistry
struct NftPositionInfo {
uint128 liquidity;
int24 tickLower;
int24 tickUpper;
}
struct NftAddLiquidity {
INonfungiblePositionManager nft;
uint256 tokenId;
Pool pool;
int24 tickLower;
int24 tickUpper;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
bytes extraData;
}
struct NftRemoveLiquidity {
INonfungiblePositionManager nft;
uint256 tokenId;
uint128 liquidity;
uint256 amount0Min; // For decreasing
uint256 amount1Min;
uint128 amount0Max; // For collecting
uint128 amount1Max;
bytes extraData;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { IUniswapV3Pool } from
"contracts/interfaces/external/uniswap/IUniswapV3Pool.sol";
import { INonfungiblePositionManager } from
"contracts/interfaces/external/uniswap/INonfungiblePositionManager.sol";
import { NftZapIn, NftZapOut } from "contracts/structs/NftZapStructs.sol";
import { SwapParams } from "contracts/structs/SwapStructs.sol";
import { Farm } from "contracts/structs/FarmStrategyStructs.sol";
struct NftPosition {
Farm farm;
INonfungiblePositionManager nft;
uint256 tokenId;
}
struct NftIncrease {
address[] tokensIn;
uint256[] amountsIn;
NftZapIn zap;
bytes extraData;
}
struct NftDeposit {
Farm farm;
INonfungiblePositionManager nft;
NftIncrease increase;
}
struct NftWithdraw {
NftZapOut zap;
address[] tokensOut;
bytes extraData;
}
struct SimpleNftHarvest {
address[] rewardTokens;
uint128 amount0Max;
uint128 amount1Max;
bytes extraData;
}
struct NftHarvest {
SimpleNftHarvest harvest;
SwapParams[] swaps;
address[] outputTokens;
address[] sweepTokens;
}
struct NftCompound {
SimpleNftHarvest harvest;
NftZapIn zap;
}
struct NftRebalance {
IUniswapV3Pool pool;
NftPosition position;
NftHarvest harvest;
NftWithdraw withdraw;
NftIncrease increase;
}
struct NftMove {
IUniswapV3Pool pool;
NftPosition position;
NftHarvest harvest;
NftWithdraw withdraw;
NftDeposit deposit;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
/// @title Admin contract
/// @author vfat.tools
/// @notice Provides an administration mechanism allowing restricted functions
abstract contract Admin {
/// ERRORS ///
/// @notice Thrown when the caller is not the admin
error NotAdminError(); //0xb5c42b3b
/// EVENTS ///
/// @notice Emitted when a new admin is set
/// @param oldAdmin Address of the old admin
/// @param newAdmin Address of the new admin
event AdminSet(address oldAdmin, address newAdmin);
/// STORAGE ///
/// @notice Address of the current admin
address public admin;
/// MODIFIERS ///
/// @dev Restricts a function to the admin
modifier onlyAdmin() {
if (msg.sender != admin) revert NotAdminError();
_;
}
/// WRITE FUNCTIONS ///
/// @param admin_ Address of the admin
constructor(
address admin_
) {
emit AdminSet(address(0), admin_);
admin = admin_;
}
/// @notice Sets a new admin
/// @param newAdmin Address of the new admin
/// @custom:access Restricted to protocol admin.
function setAdmin(
address newAdmin
) external onlyAdmin {
emit AdminSet(admin, newAdmin);
admin = newAdmin;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
/// @title TimelockAdmin contract
/// @author vfat.tools
/// @notice Provides an timelockAdministration mechanism allowing restricted
/// functions
abstract contract TimelockAdmin {
/// ERRORS ///
/// @notice Thrown when the caller is not the timelockAdmin
error NotTimelockAdminError();
/// EVENTS ///
/// @notice Emitted when a new timelockAdmin is set
/// @param oldTimelockAdmin Address of the old timelockAdmin
/// @param newTimelockAdmin Address of the new timelockAdmin
event TimelockAdminSet(address oldTimelockAdmin, address newTimelockAdmin);
/// STORAGE ///
/// @notice Address of the current timelockAdmin
address public timelockAdmin;
/// MODIFIERS ///
/// @dev Restricts a function to the timelockAdmin
modifier onlyTimelockAdmin() {
if (msg.sender != timelockAdmin) revert NotTimelockAdminError();
_;
}
/// WRITE FUNCTIONS ///
/// @param timelockAdmin_ Address of the timelockAdmin
constructor(
address timelockAdmin_
) {
emit TimelockAdminSet(timelockAdmin, timelockAdmin_);
timelockAdmin = timelockAdmin_;
}
/// @notice Sets a new timelockAdmin
/// @dev Can only be called by the current timelockAdmin
/// @param newTimelockAdmin Address of the new timelockAdmin
function setTimelockAdmin(
address newTimelockAdmin
) external onlyTimelockAdmin {
emit TimelockAdminSet(timelockAdmin, newTimelockAdmin);
timelockAdmin = newTimelockAdmin;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { ZapIn, ZapOut } from "contracts/structs/ZapStructs.sol";
import { SwapParams } from "contracts/structs/SwapStructs.sol";
struct Farm {
address stakingContract;
uint256 poolIndex;
}
struct DepositParams {
Farm farm;
address[] tokensIn;
uint256[] amountsIn;
ZapIn zap;
bytes extraData;
}
struct WithdrawParams {
bytes extraData;
ZapOut zap;
address[] tokensOut;
}
struct HarvestParams {
SwapParams[] swaps;
bytes extraData;
address[] tokensOut;
}
struct CompoundParams {
Farm claimFarm;
bytes claimExtraData;
address[] rewardTokens;
ZapIn zap;
Farm depositFarm;
bytes depositExtraData;
}
struct SimpleDepositParams {
Farm farm;
address lpToken;
uint256 amountIn;
bytes extraData;
}
struct SimpleHarvestParams {
address[] rewardTokens;
bytes extraData;
}
struct SimpleWithdrawParams {
address lpToken;
uint256 amountOut;
bytes extraData;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IERC721Enumerable } from
"openzeppelin-contracts/contracts/interfaces/IERC721Enumerable.sol";
interface INonfungiblePositionManager is IERC721Enumerable {
struct IncreaseLiquidityParams {
uint256 tokenId;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}
struct MintParams {
address token0;
address token1;
uint24 fee;
int24 tickLower;
int24 tickUpper;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
address recipient;
uint256 deadline;
}
struct DecreaseLiquidityParams {
uint256 tokenId;
uint128 liquidity;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}
struct CollectParams {
uint256 tokenId;
address recipient;
uint128 amount0Max;
uint128 amount1Max;
}
function increaseLiquidity(
IncreaseLiquidityParams memory params
)
external
payable
returns (uint256 amount0, uint256 amount1, uint256 liquidity);
function decreaseLiquidity(
DecreaseLiquidityParams calldata params
) external payable returns (uint256 amount0, uint256 amount1);
function mint(
MintParams memory params
)
external
payable
returns (uint256 tokenId, uint256 amount0, uint256 amount1);
function collect(
CollectParams calldata params
) external payable returns (uint256 amount0, uint256 amount1);
function burn(
uint256 tokenId
) external payable;
function positions(
uint256 tokenId
)
external
view
returns (
uint96 nonce,
address operator,
address token0,
address token1,
uint24 fee,
int24 tickLower,
int24 tickUpper,
uint128 liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);
function factory() external view returns (address);
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Pool state that never changes
/// @notice These parameters are fixed for a pool forever, i.e., the methods
/// will always return the same values
interface IUniswapV3PoolImmutables {
/// @notice The contract that deployed the pool, which must adhere to the
/// IUniswapV3Factory interface
/// @return The contract address
function factory() external view returns (address);
/// @notice The first of the two tokens of the pool, sorted by address
/// @return The token contract address
function token0() external view returns (address);
/// @notice The second of the two tokens of the pool, sorted by address
/// @return The token contract address
function token1() external view returns (address);
/// @notice The pool's fee in hundredths of a bip, i.e. 1e-6
/// @return The fee
function fee() external view returns (uint24);
/// @notice The pool tick spacing
/// @dev Ticks can only be used at multiples of this value, minimum of 1 and
/// always positive
/// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick,
/// i.e., ..., -6, -3, 0, 3, 6, ...
/// This value is an int24 to avoid casting even though it is always
/// positive.
/// @return The tick spacing
function tickSpacing() external view returns (int24);
/// @notice The maximum amount of position liquidity that can use any tick
/// in the range
/// @dev This parameter is enforced per tick to prevent liquidity from
/// overflowing a uint128 at any point, and
/// also prevents out-of-range liquidity from being used to prevent adding
/// in-range liquidity to a pool
/// @return The max amount of liquidity per tick
function maxLiquidityPerTick() external view returns (uint128);
}
/// @title Pool state that can change
/// @notice These methods compose the pool's state, and can change with any
/// frequency including multiple times
/// per transaction
interface IUniswapV3PoolState {
/// @notice The 0th storage slot in the pool stores many values, and is
/// exposed as a single method to save gas
/// when accessed externally.
/// @return sqrtPriceX96 The current price of the pool as a
/// sqrt(token1/token0) Q64.96 value
/// @return tick The current tick of the pool, i.e. according to the last
/// tick transition that was run.
/// This value may not always be equal to
/// SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick
/// boundary.
/// @return observationIndex The index of the last oracle observation that
/// was written,
/// @return observationCardinality The current maximum number of
/// observations stored in the pool,
/// @return observationCardinalityNext The next maximum number of
/// observations, to be updated when the observation.
/// @return feeProtocol The protocol fee for both tokens of the pool.
/// Encoded as two 4 bit values, where the protocol fee of token1 is shifted
/// 4 bits and the protocol fee of token0
/// is the lower 4 bits. Used as the denominator of a fraction of the swap
/// fee, e.g. 4 means 1/4th of the swap fee.
/// unlocked Whether the pool is currently locked to reentrancy
function slot0()
external
view
returns (
uint160 sqrtPriceX96,
int24 tick,
uint16 observationIndex,
uint16 observationCardinality,
uint16 observationCardinalityNext,
uint8 feeProtocol,
bool unlocked
);
/// @notice The fee growth as a Q128.128 fees of token0 collected per unit
/// of liquidity for the entire life of the pool
/// @dev This value can overflow the uint256
function feeGrowthGlobal0X128() external view returns (uint256);
/// @notice The fee growth as a Q128.128 fees of token1 collected per unit
/// of liquidity for the entire life of the pool
/// @dev This value can overflow the uint256
function feeGrowthGlobal1X128() external view returns (uint256);
/// @notice The amounts of token0 and token1 that are owed to the protocol
/// @dev Protocol fees will never exceed uint128 max in either token
function protocolFees()
external
view
returns (uint128 token0, uint128 token1);
/// @notice The currently in range liquidity available to the pool
/// @dev This value has no relationship to the total liquidity across all
/// ticks
/// @return The liquidity at the current price of the pool
function liquidity() external view returns (uint128);
/// @notice Look up information about a specific tick in the pool
/// @param tick The tick to look up
/// @return liquidityGross the total amount of position liquidity that uses
/// the pool either as tick lower or
/// tick upper
/// @return liquidityNet how much liquidity changes when the pool price
/// crosses the tick,
/// @return feeGrowthOutside0X128 the fee growth on the other side of the
/// tick from the current tick in token0,
/// @return feeGrowthOutside1X128 the fee growth on the other side of the
/// tick from the current tick in token1,
/// @return tickCumulativeOutside the cumulative tick value on the other
/// side of the tick from the current tick
/// @return secondsPerLiquidityOutsideX128 the seconds spent per liquidity
/// on the other side of the tick from the current tick,
/// @return secondsOutside the seconds spent on the other side of the tick
/// from the current tick,
/// @return initialized Set to true if the tick is initialized, i.e.
/// liquidityGross is greater than 0, otherwise equal to false.
/// Outside values can only be used if the tick is initialized, i.e. if
/// liquidityGross is greater than 0.
/// In addition, these values are only relative and must be used only in
/// comparison to previous snapshots for
/// a specific position.
function ticks(
int24 tick
)
external
view
returns (
uint128 liquidityGross,
int128 liquidityNet,
uint256 feeGrowthOutside0X128,
uint256 feeGrowthOutside1X128,
int56 tickCumulativeOutside,
uint160 secondsPerLiquidityOutsideX128,
uint32 secondsOutside,
bool initialized
);
/// @notice Returns 256 packed tick initialized boolean values. See
/// TickBitmap for more information
function tickBitmap(
int16 wordPosition
) external view returns (uint256);
/// @notice Returns the information about a position by the position's key
/// @param key The position's key is a hash of a preimage composed by the
/// owner, tickLower and tickUpper
/// @return liquidity The amount of liquidity in the position,
/// @return feeGrowthInside0LastX128 fee growth of token0 inside the tick
/// range as of the last mint/burn/poke,
/// @return feeGrowthInside1LastX128 fee growth of token1 inside the tick
/// range as of the last mint/burn/poke,
/// @return tokensOwed0 the computed amount of token0 owed to the position
/// as of the last mint/burn/poke,
/// @return tokensOwed1 the computed amount of token1 owed to the position
/// as of the last mint/burn/poke
function positions(
bytes32 key
)
external
view
returns (
uint128 liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);
/// @notice Returns data about a specific observation index
/// @param index The element of the observations array to fetch
/// @dev You most likely want to use #observe() instead of this method to
/// get an observation as of some amount of time
/// ago, rather than at a specific index in the array.
/// @return blockTimestamp The timestamp of the observation,
/// @return tickCumulative the tick multiplied by seconds elapsed for the
/// life of the pool as of the observation timestamp,
/// @return secondsPerLiquidityCumulativeX128 the seconds per in range
/// liquidity for the life of the pool as of the observation timestamp,
/// @return initialized whether the observation has been initialized and the
/// values are safe to use
function observations(
uint256 index
)
external
view
returns (
uint32 blockTimestamp,
int56 tickCumulative,
uint160 secondsPerLiquidityCumulativeX128,
bool initialized
);
}
interface IUniswapV3Pool is IUniswapV3PoolImmutables, IUniswapV3PoolState {
function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import { SwapParams } from "contracts/structs/SwapStructs.sol";
import {
NftAddLiquidity,
NftRemoveLiquidity
} from "contracts/structs/NftLiquidityStructs.sol";
struct NftZapIn {
SwapParams[] swaps;
NftAddLiquidity addLiquidityParams;
}
struct NftZapOut {
NftRemoveLiquidity removeLiquidityParams;
SwapParams[] swaps;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
struct SwapParams {
address tokenApproval;
address router;
uint256 amountIn;
uint256 desiredAmountOut;
uint256 minAmountOut;
address tokenIn;
address tokenOut;
bytes extraData;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { SwapParams } from "contracts/structs/SwapStructs.sol";
import {
AddLiquidityParams,
RemoveLiquidityParams
} from "contracts/structs/LiquidityStructs.sol";
struct ZapIn {
SwapParams[] swaps;
AddLiquidityParams addLiquidityParams;
}
struct ZapOut {
RemoveLiquidityParams removeLiquidityParams;
SwapParams[] swaps;
}// SPDX-License-Identifier: MIT // 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;
struct AddLiquidityParams {
address router;
address lpToken;
address[] tokens;
uint256[] desiredAmounts;
uint256[] minAmounts;
bytes extraData;
}
struct RemoveLiquidityParams {
address router;
address lpToken;
address[] tokens;
uint256 lpAmountIn;
uint256[] minAmountsOut;
bytes extraData;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract ConnectorRegistry","name":"registry","type":"address"},{"components":[{"internalType":"address","name":"stakingContract","type":"address"},{"internalType":"uint256","name":"poolIndex","type":"uint256"}],"internalType":"struct Farm","name":"farm","type":"tuple"},{"internalType":"address","name":"user","type":"address"},{"internalType":"address[]","name":"rewardTokens","type":"address[]"}],"name":"getERC20PositionInfo","outputs":[{"components":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"bool","name":"isStaked","type":"bool"},{"internalType":"uint256[]","name":"tokenRewards","type":"uint256[]"}],"internalType":"struct ERC20PositionInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ConnectorRegistry","name":"registry","type":"address"},{"internalType":"address","name":"nftManager","type":"address"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes32","name":"poolId","type":"bytes32"}],"name":"getPoolInfo","outputs":[{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"uint24","name":"tickSpacing","type":"uint24"},{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"},{"internalType":"int24","name":"tick","type":"int24"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"uint256","name":"feeGrowthGlobal0X128","type":"uint256"},{"internalType":"uint256","name":"feeGrowthGlobal1X128","type":"uint256"}],"internalType":"struct NftPoolInfo","name":"poolInfo","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ConnectorRegistry","name":"registry","type":"address"},{"internalType":"address","name":"poolFactory","type":"address"},{"internalType":"address","name":"user","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"},{"internalType":"address[]","name":"rewardTokens","type":"address[]"}],"name":"getPositionInfo","outputs":[{"components":[{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"bool","name":"isStaked","type":"bool"},{"internalType":"uint256","name":"fees0","type":"uint256"},{"internalType":"uint256","name":"fees1","type":"uint256"},{"internalType":"uint256[]","name":"tokenRewards","type":"uint256[]"}],"internalType":"struct NftPositionInfo","name":"","type":"tuple"},{"components":[{"internalType":"address","name":"poolAddress","type":"address"},{"internalType":"bytes32","name":"poolId","type":"bytes32"}],"internalType":"struct NftPoolKey","name":"","type":"tuple"}],"stateMutability":"view","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b506112e5806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80633e5f0fc71461004657806359d6aaf01461006f578063e81c9e9414610090575b600080fd5b610059610054366004610b00565b6100b0565b6040516100669190610bc1565b60405180910390f35b61008261007d366004610bfa565b6102db565b604051610066929190610c93565b6100a361009e366004610d31565b61033a565b6040516100669190610d82565b6040805160608082018352600080835260208301529181019190915260006001600160a01b03871663c79aeaae6100ea6020890189610e39565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa15801561012e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101529190610e66565b90506000816001600160a01b031663dd9e02cd88886040518363ffffffff1660e01b8152600401610184929190610ea4565b602060405180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c59190610eca565b90506000826001600160a01b031663195ac61e89896040518363ffffffff1660e01b81526004016101f7929190610ea4565b602060405180830381865afa158015610214573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102389190610ee3565b90506000836001600160a01b0316639a47bf088a8a8a8a6040518563ffffffff1660e01b815260040161026e9493929190610f43565b600060405180830381865afa15801561028b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102b39190810190610fe6565b6040805160608101825294855292151560208501529183019190915250979650505050505050565b6102e3610a4e565b60408051808201909152600080825260208201526000610318898961030e60608a0160408b01610e39565b8960600135610470565b9050600061032a8a8a8a8a8a8a610578565b9a91995090975050505050505050565b6040805161012081018252600080825260208201819052818301819052606082018190526080820181905260a0820181905260c0820181905260e08201819052610100820181905291516363cd755760e11b81526001600160a01b03868116600483015291929187169063c79aeaae90602401602060405180830381865afa1580156103ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ee9190610e66565b60405163e85505e160e01b81526001600160a01b03868116600483015260248201869052919250829182169063e85505e19060440161012060405180830381865afa158015610441573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046591906110c8565b979650505050505050565b60408051808201909152600080825260208201526040516363cd755760e11b81526001600160a01b0384811660048301526000919087169063c79aeaae90602401602060405180830381865afa1580156104ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f29190610e66565b60405163dfe8addd60e01b81526001600160a01b0387811660048301528681166024830152604482018690529192509082169063dfe8addd906064016040805180830381865afa15801561054a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056e9190611172565b9695505050505050565b610580610a4e565b60006001600160a01b03881663c79aeaae6105a16060880160408901610e39565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156105e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106099190610e66565b9050600061061782876108ba565b905060006001600160a01b03831663dfe8addd8a61063b60608b0160408c01610e39565b6040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260608a013560448201526064016040805180830381865afa15801561068f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b39190611172565b905060006106d7846106cb60608b0160408c01610e39565b845160608c01356109a0565b905060006001600160a01b038c1663c79aeaae6106f760208c018c610e39565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa15801561073b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075f9190610e66565b90506000816001600160a01b0316631ae755628c8c6040518363ffffffff1660e01b81526004016107919291906111fb565b602060405180830381865afa1580156107ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d29190610ee3565b90506000826001600160a01b0316633f40c7fa8d8d8d8d6040518563ffffffff1660e01b81526004016108089493929190611218565b600060405180830381865afa158015610825573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261084d9190810190610fe6565b90506040518060e0016040528087604001516001600160801b03168152602001876000015160020b8152602001876020015160020b815260200183151581526020018560000151815260200185602001518152602001828152509750505050505050509695505050505050565b6040805160608101825260008082526020820181905291810191909152600080806001600160a01b03861663e759c4656108fa6060880160408901610e39565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260608801356024820152604401606060405180830381865afa158015610948573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096c9190611248565b60408051606081018252600294850b81529290930b60208301526001600160801b0316918101919091529695505050505050565b604080518082019091526000808252602082015260405163739a2c1d60e11b81526001600160a01b038581166004830152848116602483015260448201849052600091829188169063e734583a906064016040805180830381865afa158015610a0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a31919061128b565b604080518082019091529182526020820152979650505050505050565b6040518060e0016040528060006001600160801b03168152602001600060020b8152602001600060020b81526020016000151581526020016000815260200160008152602001606081525090565b6001600160a01b0381168114610ab157600080fd5b50565b60008083601f840112610ac657600080fd5b50813567ffffffffffffffff811115610ade57600080fd5b6020830191508360208260051b8501011115610af957600080fd5b9250929050565b600080600080600085870360a0811215610b1957600080fd5b8635610b2481610a9c565b95506040601f1982011215610b3857600080fd5b506020860193506060860135610b4d81610a9c565b9250608086013567ffffffffffffffff811115610b6957600080fd5b610b7588828901610ab4565b969995985093965092949392505050565b600081518084526020808501945080840160005b83811015610bb657815187529582019590820190600101610b9a565b509495945050505050565b602081528151602082015260208201511515604082015260006040830151606080840152610bf26080840182610b86565b949350505050565b600080600080600080868803610100811215610c1557600080fd5b8735610c2081610a9c565b96506020880135610c3081610a9c565b95506040880135610c4081610a9c565b94506080605f1982011215610c5457600080fd5b5060608701925060e087013567ffffffffffffffff811115610c7557600080fd5b610c8189828a01610ab4565b979a9699509497509295939492505050565b606081526001600160801b038351166060820152602083015160020b6080820152604083015160020b60a082015260006060840151610cd660c084018215159052565b50608084015160e083015260a084015161010083015260c084015160e0610120840152610d07610140840182610b86565b915050610d2a602083018480516001600160a01b03168252602090810151910152565b9392505050565b60008060008060808587031215610d4757600080fd5b8435610d5281610a9c565b93506020850135610d6281610a9c565b92506040850135610d7281610a9c565b9396929550929360600135925050565b81516001600160a01b03908116825260208084015190911690820152604080830151610120830191610dba9084018262ffffff169052565b506060830151610dd1606084018262ffffff169052565b506080830151610dec60808401826001600160a01b03169052565b5060a0830151610e0160a084018260020b9052565b5060c0830151610e1c60c08401826001600160801b03169052565b5060e083015160e083015261010080840151818401525092915050565b600060208284031215610e4b57600080fd5b8135610d2a81610a9c565b8051610e6181610a9c565b919050565b600060208284031215610e7857600080fd5b8151610d2a81610a9c565b8035610e8e81610a9c565b6001600160a01b03168252602090810135910152565b60608101610eb28285610e83565b6001600160a01b039290921660409190910152919050565b600060208284031215610edc57600080fd5b5051919050565b600060208284031215610ef557600080fd5b81518015158114610d2a57600080fd5b8183526000602080850194508260005b85811015610bb6578135610f2881610a9c565b6001600160a01b031687529582019590820190600101610f15565b610f4d8186610e83565b6001600160a01b038416604082015260806060820181905260009061056e9083018486610f05565b634e487b7160e01b600052604160045260246000fd5b604051610120810167ffffffffffffffff81118282101715610faf57610faf610f75565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610fde57610fde610f75565b604052919050565b60006020808385031215610ff957600080fd5b825167ffffffffffffffff8082111561101157600080fd5b818501915085601f83011261102557600080fd5b81518181111561103757611037610f75565b8060051b9150611048848301610fb5565b818152918301840191848101908884111561106257600080fd5b938501935b8385101561108057845182529385019390850190611067565b98975050505050505050565b805162ffffff81168114610e6157600080fd5b8051600281900b8114610e6157600080fd5b80516001600160801b0381168114610e6157600080fd5b600061012082840312156110db57600080fd5b6110e3610f8b565b6110ec83610e56565b81526110fa60208401610e56565b602082015261110b6040840161108c565b604082015261111c6060840161108c565b606082015261112d60808401610e56565b608082015261113e60a0840161109f565b60a082015261114f60c084016110b1565b60c082015260e08381015190820152610100928301519281019290925250919050565b60006040828403121561118457600080fd5b6040516040810181811067ffffffffffffffff821117156111a7576111a7610f75565b60405282516111b581610a9c565b81526020928301519281019290925250919050565b6111d48282610e83565b60408101356111e281610a9c565b6001600160a01b03166040830152606090810135910152565b6001600160a01b038316815260a08101610d2a60208301846111ca565b6001600160a01b038516815261123160208201856111ca565b60c060a0820152600061056e60c083018486610f05565b60008060006060848603121561125d57600080fd5b6112668461109f565b92506112746020850161109f565b9150611282604085016110b1565b90509250925092565b6000806040838503121561129e57600080fd5b50508051602090910151909290915056fea264697066735822122012e4bbfb468218900a4f95a4aaa2b995144bc9cdfe9fac0c1963322c1c1a0ad964736f6c63430008130033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100415760003560e01c80633e5f0fc71461004657806359d6aaf01461006f578063e81c9e9414610090575b600080fd5b610059610054366004610b00565b6100b0565b6040516100669190610bc1565b60405180910390f35b61008261007d366004610bfa565b6102db565b604051610066929190610c93565b6100a361009e366004610d31565b61033a565b6040516100669190610d82565b6040805160608082018352600080835260208301529181019190915260006001600160a01b03871663c79aeaae6100ea6020890189610e39565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa15801561012e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101529190610e66565b90506000816001600160a01b031663dd9e02cd88886040518363ffffffff1660e01b8152600401610184929190610ea4565b602060405180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c59190610eca565b90506000826001600160a01b031663195ac61e89896040518363ffffffff1660e01b81526004016101f7929190610ea4565b602060405180830381865afa158015610214573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102389190610ee3565b90506000836001600160a01b0316639a47bf088a8a8a8a6040518563ffffffff1660e01b815260040161026e9493929190610f43565b600060405180830381865afa15801561028b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102b39190810190610fe6565b6040805160608101825294855292151560208501529183019190915250979650505050505050565b6102e3610a4e565b60408051808201909152600080825260208201526000610318898961030e60608a0160408b01610e39565b8960600135610470565b9050600061032a8a8a8a8a8a8a610578565b9a91995090975050505050505050565b6040805161012081018252600080825260208201819052818301819052606082018190526080820181905260a0820181905260c0820181905260e08201819052610100820181905291516363cd755760e11b81526001600160a01b03868116600483015291929187169063c79aeaae90602401602060405180830381865afa1580156103ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ee9190610e66565b60405163e85505e160e01b81526001600160a01b03868116600483015260248201869052919250829182169063e85505e19060440161012060405180830381865afa158015610441573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046591906110c8565b979650505050505050565b60408051808201909152600080825260208201526040516363cd755760e11b81526001600160a01b0384811660048301526000919087169063c79aeaae90602401602060405180830381865afa1580156104ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f29190610e66565b60405163dfe8addd60e01b81526001600160a01b0387811660048301528681166024830152604482018690529192509082169063dfe8addd906064016040805180830381865afa15801561054a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056e9190611172565b9695505050505050565b610580610a4e565b60006001600160a01b03881663c79aeaae6105a16060880160408901610e39565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156105e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106099190610e66565b9050600061061782876108ba565b905060006001600160a01b03831663dfe8addd8a61063b60608b0160408c01610e39565b6040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260608a013560448201526064016040805180830381865afa15801561068f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b39190611172565b905060006106d7846106cb60608b0160408c01610e39565b845160608c01356109a0565b905060006001600160a01b038c1663c79aeaae6106f760208c018c610e39565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa15801561073b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075f9190610e66565b90506000816001600160a01b0316631ae755628c8c6040518363ffffffff1660e01b81526004016107919291906111fb565b602060405180830381865afa1580156107ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d29190610ee3565b90506000826001600160a01b0316633f40c7fa8d8d8d8d6040518563ffffffff1660e01b81526004016108089493929190611218565b600060405180830381865afa158015610825573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261084d9190810190610fe6565b90506040518060e0016040528087604001516001600160801b03168152602001876000015160020b8152602001876020015160020b815260200183151581526020018560000151815260200185602001518152602001828152509750505050505050509695505050505050565b6040805160608101825260008082526020820181905291810191909152600080806001600160a01b03861663e759c4656108fa6060880160408901610e39565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260608801356024820152604401606060405180830381865afa158015610948573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096c9190611248565b60408051606081018252600294850b81529290930b60208301526001600160801b0316918101919091529695505050505050565b604080518082019091526000808252602082015260405163739a2c1d60e11b81526001600160a01b038581166004830152848116602483015260448201849052600091829188169063e734583a906064016040805180830381865afa158015610a0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a31919061128b565b604080518082019091529182526020820152979650505050505050565b6040518060e0016040528060006001600160801b03168152602001600060020b8152602001600060020b81526020016000151581526020016000815260200160008152602001606081525090565b6001600160a01b0381168114610ab157600080fd5b50565b60008083601f840112610ac657600080fd5b50813567ffffffffffffffff811115610ade57600080fd5b6020830191508360208260051b8501011115610af957600080fd5b9250929050565b600080600080600085870360a0811215610b1957600080fd5b8635610b2481610a9c565b95506040601f1982011215610b3857600080fd5b506020860193506060860135610b4d81610a9c565b9250608086013567ffffffffffffffff811115610b6957600080fd5b610b7588828901610ab4565b969995985093965092949392505050565b600081518084526020808501945080840160005b83811015610bb657815187529582019590820190600101610b9a565b509495945050505050565b602081528151602082015260208201511515604082015260006040830151606080840152610bf26080840182610b86565b949350505050565b600080600080600080868803610100811215610c1557600080fd5b8735610c2081610a9c565b96506020880135610c3081610a9c565b95506040880135610c4081610a9c565b94506080605f1982011215610c5457600080fd5b5060608701925060e087013567ffffffffffffffff811115610c7557600080fd5b610c8189828a01610ab4565b979a9699509497509295939492505050565b606081526001600160801b038351166060820152602083015160020b6080820152604083015160020b60a082015260006060840151610cd660c084018215159052565b50608084015160e083015260a084015161010083015260c084015160e0610120840152610d07610140840182610b86565b915050610d2a602083018480516001600160a01b03168252602090810151910152565b9392505050565b60008060008060808587031215610d4757600080fd5b8435610d5281610a9c565b93506020850135610d6281610a9c565b92506040850135610d7281610a9c565b9396929550929360600135925050565b81516001600160a01b03908116825260208084015190911690820152604080830151610120830191610dba9084018262ffffff169052565b506060830151610dd1606084018262ffffff169052565b506080830151610dec60808401826001600160a01b03169052565b5060a0830151610e0160a084018260020b9052565b5060c0830151610e1c60c08401826001600160801b03169052565b5060e083015160e083015261010080840151818401525092915050565b600060208284031215610e4b57600080fd5b8135610d2a81610a9c565b8051610e6181610a9c565b919050565b600060208284031215610e7857600080fd5b8151610d2a81610a9c565b8035610e8e81610a9c565b6001600160a01b03168252602090810135910152565b60608101610eb28285610e83565b6001600160a01b039290921660409190910152919050565b600060208284031215610edc57600080fd5b5051919050565b600060208284031215610ef557600080fd5b81518015158114610d2a57600080fd5b8183526000602080850194508260005b85811015610bb6578135610f2881610a9c565b6001600160a01b031687529582019590820190600101610f15565b610f4d8186610e83565b6001600160a01b038416604082015260806060820181905260009061056e9083018486610f05565b634e487b7160e01b600052604160045260246000fd5b604051610120810167ffffffffffffffff81118282101715610faf57610faf610f75565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610fde57610fde610f75565b604052919050565b60006020808385031215610ff957600080fd5b825167ffffffffffffffff8082111561101157600080fd5b818501915085601f83011261102557600080fd5b81518181111561103757611037610f75565b8060051b9150611048848301610fb5565b818152918301840191848101908884111561106257600080fd5b938501935b8385101561108057845182529385019390850190611067565b98975050505050505050565b805162ffffff81168114610e6157600080fd5b8051600281900b8114610e6157600080fd5b80516001600160801b0381168114610e6157600080fd5b600061012082840312156110db57600080fd5b6110e3610f8b565b6110ec83610e56565b81526110fa60208401610e56565b602082015261110b6040840161108c565b604082015261111c6060840161108c565b606082015261112d60808401610e56565b608082015261113e60a0840161109f565b60a082015261114f60c084016110b1565b60c082015260e08381015190820152610100928301519281019290925250919050565b60006040828403121561118457600080fd5b6040516040810181811067ffffffffffffffff821117156111a7576111a7610f75565b60405282516111b581610a9c565b81526020928301519281019290925250919050565b6111d48282610e83565b60408101356111e281610a9c565b6001600160a01b03166040830152606090810135910152565b6001600160a01b038316815260a08101610d2a60208301846111ca565b6001600160a01b038516815261123160208201856111ca565b60c060a0820152600061056e60c083018486610f05565b60008060006060848603121561125d57600080fd5b6112668461109f565b92506112746020850161109f565b9150611282604085016110b1565b90509250925092565b6000806040838503121561129e57600080fd5b50508051602090910151909290915056fea264697066735822122012e4bbfb468218900a4f95a4aaa2b995144bc9cdfe9fac0c1963322c1c1a0ad964736f6c63430008130033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.