Source Code
Overview
FRAX Balance | FXTL Balance
0 FRAX | 0 FXTL
FRAX Value
$0.00| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
NuriRouterConnector
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 { RamsesRouterConnector } from
"contracts/connectors/ramses/RamsesRouterConnector.sol";
contract NuriRouterConnector is RamsesRouterConnector { }// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IRamsesRouter } from
"contracts/interfaces/external/ramses/IRamsesRouter.sol";
import {
VelodromeRouterConnector,
SwapParams
} from "contracts/connectors/velodrome/VelodromeRouterConnector.sol";
struct RamsesSwapExtraData {
IRamsesRouter.Route[] routes;
}
contract RamsesRouterConnector is VelodromeRouterConnector {
function swapExactTokensForTokens(
SwapParams memory swap
) external payable override {
RamsesSwapExtraData memory _extraData =
abi.decode(swap.extraData, (RamsesSwapExtraData));
IRamsesRouter(swap.router).swapExactTokensForTokens(
swap.amountIn,
swap.minAmountOut,
_extraData.routes,
address(this),
block.timestamp
);
}
function swapExactETHForTokens(
SwapParams memory swap
) external payable override {
RamsesSwapExtraData memory _extraData =
abi.decode(swap.extraData, (RamsesSwapExtraData));
IRamsesRouter(swap.router).swapExactETHForTokens{ value: swap.amountIn }(
swap.minAmountOut, _extraData.routes, address(this), block.timestamp
);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IEqualizerRouter } from
"contracts/interfaces/external/equalizer/IEqualizerRouter.sol";
interface IRamsesRouter is IEqualizerRouter {
function getAmountOut(
uint256 amountIn,
address tokenIn,
address tokenOut
) external view returns (uint256 amountOut, bool stable);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IRouter } from "contracts/interfaces/external/aerodrome/IRouter.sol";
import { ICLPool } from "contracts/interfaces/external/aerodrome/ICLPool.sol";
import {
ILiquidityConnector,
AddLiquidityParams,
RemoveLiquidityParams,
SwapParams
} from "contracts/interfaces/ILiquidityConnector.sol";
struct VelodromeLiquidityExtraData {
bool isStablePool;
}
struct VelodromeSwapExtraData {
IRouter.Route[] routes;
}
contract VelodromeRouterConnector is ILiquidityConnector {
function addLiquidity(
AddLiquidityParams memory addLiquidityParams
) external payable override {
VelodromeLiquidityExtraData memory _extraData = abi.decode(
addLiquidityParams.extraData, (VelodromeLiquidityExtraData)
);
IRouter(addLiquidityParams.router).addLiquidity(
addLiquidityParams.tokens[0],
addLiquidityParams.tokens[1],
_extraData.isStablePool,
addLiquidityParams.desiredAmounts[0],
addLiquidityParams.desiredAmounts[1],
addLiquidityParams.minAmounts[0],
addLiquidityParams.minAmounts[1],
address(this),
block.timestamp
);
}
function removeLiquidity(
RemoveLiquidityParams memory removeLiquidityParams
) external override {
VelodromeLiquidityExtraData memory _extraData = abi.decode(
removeLiquidityParams.extraData, (VelodromeLiquidityExtraData)
);
IRouter(removeLiquidityParams.router).removeLiquidity(
removeLiquidityParams.tokens[0],
removeLiquidityParams.tokens[1],
_extraData.isStablePool,
removeLiquidityParams.lpAmountIn,
removeLiquidityParams.minAmountsOut[0],
removeLiquidityParams.minAmountsOut[1],
address(this),
block.timestamp
);
}
function swapExactTokensForTokens(
SwapParams memory swap
) external payable virtual override {
VelodromeSwapExtraData memory _extraData =
abi.decode(swap.extraData, (VelodromeSwapExtraData));
IRouter(swap.router).swapExactTokensForTokens(
swap.amountIn,
swap.minAmountOut,
_extraData.routes,
address(this),
block.timestamp
);
}
function swapExactETHForTokens(
SwapParams memory swap
) external payable virtual override {
VelodromeSwapExtraData memory _extraData =
abi.decode(swap.extraData, (VelodromeSwapExtraData));
IRouter(swap.router).swapExactETHForTokens{ value: swap.amountIn }(
swap.minAmountOut, _extraData.routes, address(this), block.timestamp
);
}
function getPoolPrice(
address lpToken,
uint256 baseTokenIndex,
uint256 // quoteTokenIndex
) external view virtual override returns (uint256 price) {
address token0 = ICLPool(lpToken).token0();
address token1 = ICLPool(lpToken).token1();
uint256 amountOut0 = ICLPool(lpToken).getAmountOut(1, token0);
if (amountOut0 > 0) {
price = amountOut0 * 1e18;
} else {
uint256 amountOut1 = ICLPool(lpToken).getAmountOut(1, token1);
if (amountOut1 == 0) {
revert InvalidPrice();
}
price = 1e18 / amountOut1;
}
if (price == 0) {
revert InvalidPrice();
}
if (baseTokenIndex == 1) {
price = 1e36 / price;
}
}
function getReserves(
address lpToken
) external view override returns (uint256[] memory reserves) {
(uint256 reserve0, uint256 reserve1,) = ICLPool(lpToken).getReserves();
reserves = new uint256[](2);
reserves[0] = reserve0;
reserves[1] = reserve1;
}
function getTokens(
address lpToken
) external view override returns (address[] memory tokens) {
tokens = new address[](2);
tokens[0] = ICLPool(lpToken).token0();
tokens[1] = ICLPool(lpToken).token1();
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol";
interface IEqualizerRouter {
struct Route {
address from;
address to;
bool stable;
}
error ETHTransferFailed();
error Expired();
error InsufficientAmount();
error InsufficientAmountA();
error InsufficientAmountB();
error InsufficientAmountADesired();
error InsufficientAmountBDesired();
error InsufficientAmountAOptimal();
error InsufficientLiquidity();
error InsufficientOutputAmount();
error InvalidAmountInForETHDeposit();
error InvalidTokenInForETHDeposit();
error InvalidPath();
error InvalidRouteA();
error InvalidRouteB();
error OnlyWETH();
error PoolDoesNotExist();
error PoolFactoryDoesNotExist();
error SameAddresses();
error ZeroAddress();
/// @notice Address of FactoryRegistry.sol
function factoryRegistry() external view returns (address);
/// @notice Address of Protocol PoolFactory.sol
function defaultFactory() external view returns (address);
/// @notice Address of Voter.sol
function voter() external view returns (address);
/// @notice Interface of WETH contract used for WETH => ETH
/// wrapping/unwrapping
function weth() external view returns (address);
/// @dev Represents Ether. Used by zapper to determine whether to return
/// assets as ETH/WETH.
function ETHER() external view returns (address);
/// @dev Struct containing information necessary to zap in and out of pools
/// @param tokenA .
/// @param tokenB .
/// @param stable Stable or volatile pool
/// @param factory factory of pool
/// @param amountOutMinA Minimum amount expected from swap leg of zap via
/// routesA
/// @param amountOutMinB Minimum amount expected from swap leg of zap via
/// routesB
/// @param amountAMin Minimum amount of tokenA expected from liquidity
/// leg of zap
/// @param amountBMin Minimum amount of tokenB expected from liquidity
/// leg of zap
struct Zap {
address tokenA;
address tokenB;
bool stable;
address factory;
uint256 amountOutMinA;
uint256 amountOutMinB;
uint256 amountAMin;
uint256 amountBMin;
}
/// @notice Sort two tokens by which address value is less than the other
/// @param tokenA Address of token to sort
/// @param tokenB Address of token to sort
/// @return token0 Lower address value between tokenA and tokenB
/// @return token1 Higher address value between tokenA and tokenB
function sortTokens(
address tokenA,
address tokenB
) external pure returns (address token0, address token1);
/// @notice Calculate the address of a pool by its' factory.
/// Used by all Router functions containing a `Route[]` or
/// `_factory` argument.
/// Reverts if _factory is not approved by the FactoryRegistry
/// @dev Returns a randomly generated address for a nonexistent pool
/// @param tokenA Address of token to query
/// @param tokenB Address of token to query
/// @param stable True if pool is stable, false if volatile
/// @param _factory Address of factory which created the pool
function poolFor(
address tokenA,
address tokenB,
bool stable,
address _factory
) external view returns (address pool);
/// @notice Fetch and sort the reserves for a pool
/// @param tokenA .
/// @param tokenB .
/// @param stable True if pool is stable, false if volatile
/// @param _factory Address of PoolFactory for tokenA and tokenB
/// @return reserveA Amount of reserves of the sorted token A
/// @return reserveB Amount of reserves of the sorted token B
function getReserves(
address tokenA,
address tokenB,
bool stable,
address _factory
) external view returns (uint256 reserveA, uint256 reserveB);
/// @notice Perform chained getAmountOut calculations on any number of pools
function getAmountsOut(
uint256 amountIn,
Route[] memory routes
) external view returns (uint256[] memory amounts);
// **** ADD LIQUIDITY ****
/// @notice Quote the amount deposited into a Pool
/// @param tokenA .
/// @param tokenB .
/// @param stable True if pool is stable, false if volatile
/// @param _factory Address of PoolFactory for tokenA and tokenB
/// @param amountADesired Amount of tokenA desired to deposit
/// @param amountBDesired Amount of tokenB desired to deposit
/// @return amountA Amount of tokenA to actually deposit
/// @return amountB Amount of tokenB to actually deposit
/// @return liquidity Amount of liquidity token returned from deposit
function quoteAddLiquidity(
address tokenA,
address tokenB,
bool stable,
address _factory,
uint256 amountADesired,
uint256 amountBDesired
)
external
view
returns (uint256 amountA, uint256 amountB, uint256 liquidity);
/// @notice Quote the amount of liquidity removed from a Pool
/// @param tokenA .
/// @param tokenB .
/// @param stable True if pool is stable, false if volatile
/// @param liquidity Amount of liquidity to remove
/// @return amountA Amount of tokenA received
/// @return amountB Amount of tokenB received
function quoteRemoveLiquidity(
address tokenA,
address tokenB,
bool stable,
uint256 liquidity
) external view returns (uint256 amountA, uint256 amountB);
/// @notice Add liquidity of two tokens to a Pool
/// @param tokenA .
/// @param tokenB .
/// @param stable True if pool is stable, false if volatile
/// @param amountADesired Amount of tokenA desired to deposit
/// @param amountBDesired Amount of tokenB desired to deposit
/// @param amountAMin Minimum amount of tokenA to deposit
/// @param amountBMin Minimum amount of tokenB to deposit
/// @param to Recipient of liquidity token
/// @param deadline Deadline to receive liquidity
/// @return amountA Amount of tokenA to actually deposit
/// @return amountB Amount of tokenB to actually deposit
/// @return liquidity Amount of liquidity token returned from deposit
function addLiquidity(
address tokenA,
address tokenB,
bool stable,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);
/// @notice Add liquidity of a token and WETH (transferred as ETH) to a Pool
/// @param token .
/// @param stable True if pool is stable, false if volatile
/// @param amountTokenDesired Amount of token desired to deposit
/// @param amountTokenMin Minimum amount of token to deposit
/// @param amountETHMin Minimum amount of ETH to deposit
/// @param to Recipient of liquidity token
/// @param deadline Deadline to add liquidity
/// @return amountToken Amount of token to actually deposit
/// @return amountETH Amount of tokenETH to actually deposit
/// @return liquidity Amount of liquidity token returned from
/// deposit
function addLiquidityETH(
address token,
bool stable,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
// **** REMOVE LIQUIDITY ****
/// @notice Remove liquidity of two tokens from a Pool
/// @param tokenA .
/// @param tokenB .
/// @param stable True if pool is stable, false if volatile
/// @param liquidity Amount of liquidity to remove
/// @param amountAMin Minimum amount of tokenA to receive
/// @param amountBMin Minimum amount of tokenB to receive
/// @param to Recipient of tokens received
/// @param deadline Deadline to remove liquidity
/// @return amountA Amount of tokenA received
/// @return amountB Amount of tokenB received
function removeLiquidity(
address tokenA,
address tokenB,
bool stable,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB);
/// @notice Remove liquidity of a token and WETH (returned as ETH) from a
/// Pool
/// @param token .
/// @param stable True if pool is stable, false if volatile
/// @param liquidity Amount of liquidity to remove
/// @param amountTokenMin Minimum amount of token to receive
/// @param amountETHMin Minimum amount of ETH to receive
/// @param to Recipient of liquidity token
/// @param deadline Deadline to receive liquidity
/// @return amountToken Amount of token received
/// @return amountETH Amount of ETH received
function removeLiquidityETH(
address token,
bool stable,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountToken, uint256 amountETH);
/// @notice Remove liquidity of a fee-on-transfer token and WETH (returned
/// as ETH) from a Pool
/// @param token .
/// @param stable True if pool is stable, false if volatile
/// @param liquidity Amount of liquidity to remove
/// @param amountTokenMin Minimum amount of token to receive
/// @param amountETHMin Minimum amount of ETH to receive
/// @param to Recipient of liquidity token
/// @param deadline Deadline to receive liquidity
/// @return amountETH Amount of ETH received
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
bool stable,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountETH);
// **** SWAP ****
/// @notice Swap one token for another
/// @param amountIn Amount of token in
/// @param amountOutMin Minimum amount of desired token received
/// @param routes Array of trade routes used in the swap
/// @param to Recipient of the tokens received
/// @param deadline Deadline to receive tokens
/// @return amounts Array of amounts returned per route
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
Route[] calldata routes,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
/// @notice Swap ETH for a token
/// @param amountOutMin Minimum amount of desired token received
/// @param routes Array of trade routes used in the swap
/// @param to Recipient of the tokens received
/// @param deadline Deadline to receive tokens
/// @return amounts Array of amounts returned per route
function swapExactETHForTokens(
uint256 amountOutMin,
Route[] calldata routes,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
/// @notice Swap a token for WETH (returned as ETH)
/// @param amountIn Amount of token in
/// @param amountOutMin Minimum amount of desired ETH
/// @param routes Array of trade routes used in the swap
/// @param to Recipient of the tokens received
/// @param deadline Deadline to receive tokens
/// @return amounts Array of amounts returned per route
function swapExactTokensForETH(
uint256 amountIn,
uint256 amountOutMin,
Route[] calldata routes,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
/// @notice Swap one token for another without slippage protection
/// @return amounts Array of amounts to swap per route
/// @param routes Array of trade routes used in the swap
/// @param to Recipient of the tokens received
/// @param deadline Deadline to receive tokens
function UNSAFE_swapExactTokensForTokens(
uint256[] memory amounts,
Route[] calldata routes,
address to,
uint256 deadline
) external returns (uint256[] memory);
// **** SWAP (supporting fee-on-transfer tokens) ****
/// @notice Swap one token for another supporting fee-on-transfer tokens
/// @param amountIn Amount of token in
/// @param amountOutMin Minimum amount of desired token received
/// @param routes Array of trade routes used in the swap
/// @param to Recipient of the tokens received
/// @param deadline Deadline to receive tokens
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
Route[] calldata routes,
address to,
uint256 deadline
) external;
/// @notice Swap ETH for a token supporting fee-on-transfer tokens
/// @param amountOutMin Minimum amount of desired token received
/// @param routes Array of trade routes used in the swap
/// @param to Recipient of the tokens received
/// @param deadline Deadline to receive tokens
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint256 amountOutMin,
Route[] calldata routes,
address to,
uint256 deadline
) external payable;
/// @notice Swap a token for WETH (returned as ETH) supporting
/// fee-on-transfer tokens
/// @param amountIn Amount of token in
/// @param amountOutMin Minimum amount of desired ETH
/// @param routes Array of trade routes used in the swap
/// @param to Recipient of the tokens received
/// @param deadline Deadline to receive tokens
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
Route[] calldata routes,
address to,
uint256 deadline
) external;
/// @notice Zap a token A into a pool (B, C). (A can be equal to B or C).
/// Supports standard ERC20 tokens only (i.e. not fee-on-transfer
/// tokens etc).
/// Slippage is required for the initial swap.
/// Additional slippage may be required when adding liquidity as the
/// price of the token may have changed.
/// @param tokenIn Token you are zapping in from (i.e. input token).
/// @param amountInA Amount of input token you wish to send down routesA
/// @param amountInB Amount of input token you wish to send down routesB
/// @param zapInPool Contains zap struct information. See Zap struct.
/// @param routesA Route used to convert input token to tokenA
/// @param routesB Route used to convert input token to tokenB
/// @param to Address you wish to mint liquidity to.
/// @param stake Auto-stake liquidity in corresponding gauge.
/// @return liquidity Amount of LP tokens created from zapping in.
function zapIn(
address tokenIn,
uint256 amountInA,
uint256 amountInB,
Zap calldata zapInPool,
Route[] calldata routesA,
Route[] calldata routesB,
address to,
bool stake
) external payable returns (uint256 liquidity);
/// @notice Zap out a pool (B, C) into A.
/// Supports standard ERC20 tokens only (i.e. not fee-on-transfer
/// tokens etc).
/// Slippage is required for the removal of liquidity.
/// Additional slippage may be required on the swap as the
/// price of the token may have changed.
/// @param tokenOut Token you are zapping out to (i.e. output token).
/// @param liquidity Amount of liquidity you wish to remove.
/// @param zapOutPool Contains zap struct information. See Zap struct.
/// @param routesA Route used to convert tokenA into output token.
/// @param routesB Route used to convert tokenB into output token.
function zapOut(
address tokenOut,
uint256 liquidity,
Zap calldata zapOutPool,
Route[] calldata routesA,
Route[] calldata routesB
) external;
/// @notice Used to generate params required for zapping in.
/// Zap in => remove liquidity then swap.
/// Apply slippage to expected swap values to account for changes in
/// reserves in between.
/// @dev Output token refers to the token you want to zap in from.
/// @param tokenA .
/// @param tokenB .
/// @param stable .
/// @param _factory .
/// @param amountInA Amount of input token you wish to send down
/// routesA
/// @param amountInB Amount of input token you wish to send down
/// routesB
/// @param routesA Route used to convert input token to tokenA
/// @param routesB Route used to convert input token to tokenB
/// @return amountOutMinA Minimum output expected from swapping input
/// token to tokenA.
/// @return amountOutMinB Minimum output expected from swapping input
/// token to tokenB.
/// @return amountAMin Minimum amount of tokenA expected from
/// depositing liquidity.
/// @return amountBMin Minimum amount of tokenB expected from
/// depositing liquidity.
function generateZapInParams(
address tokenA,
address tokenB,
bool stable,
address _factory,
uint256 amountInA,
uint256 amountInB,
Route[] calldata routesA,
Route[] calldata routesB
)
external
view
returns (
uint256 amountOutMinA,
uint256 amountOutMinB,
uint256 amountAMin,
uint256 amountBMin
);
/// @notice Used to generate params required for zapping out.
/// Zap out => swap then add liquidity.
/// Apply slippage to expected liquidity values to account for
/// changes in reserves in between.
/// @dev Output token refers to the token you want to zap out of.
/// @param tokenA .
/// @param tokenB .
/// @param stable .
/// @param _factory .
/// @param liquidity Amount of liquidity being zapped out of into a
/// given output token.
/// @param routesA Route used to convert tokenA into output token.
/// @param routesB Route used to convert tokenB into output token.
/// @return amountOutMinA Minimum output expected from swapping tokenA
/// into output token.
/// @return amountOutMinB Minimum output expected from swapping tokenB
/// into output token.
/// @return amountAMin Minimum amount of tokenA expected from
/// withdrawing liquidity.
/// @return amountBMin Minimum amount of tokenB expected from
/// withdrawing liquidity.
function generateZapOutParams(
address tokenA,
address tokenB,
bool stable,
address _factory,
uint256 liquidity,
Route[] calldata routesA,
Route[] calldata routesB
)
external
view
returns (
uint256 amountOutMinA,
uint256 amountOutMinB,
uint256 amountAMin,
uint256 amountBMin
);
/// @notice Used by zapper to determine appropriate ratio of A to B to
/// deposit liquidity. Assumes stable pool.
/// @dev Returns stable liquidity ratio of B to (A + B).
/// E.g. if ratio is 0.4, it means there is more of A than there is of
/// B.
/// Therefore you should deposit more of token A than B.
/// @param tokenA tokenA of stable pool you are zapping into.
/// @param tokenB tokenB of stable pool you are zapping into.
/// @param factory Factory that created stable pool.
/// @return ratio Ratio of token0 to token1 required to deposit into zap.
function quoteStableLiquidityRatio(
address tokenA,
address tokenB,
address factory
) external view returns (uint256 ratio);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol";
interface IWETH is IERC20 {
function deposit() external payable;
function withdraw(uint256) external;
}
interface IRouter {
struct Route {
address from;
address to;
bool stable;
address factory;
}
error ETHTransferFailed();
error Expired();
error InsufficientAmount();
error InsufficientAmountA();
error InsufficientAmountB();
error InsufficientAmountADesired();
error InsufficientAmountBDesired();
error InsufficientAmountAOptimal();
error InsufficientLiquidity();
error InsufficientOutputAmount();
error InvalidAmountInForETHDeposit();
error InvalidTokenInForETHDeposit();
error InvalidPath();
error InvalidRouteA();
error InvalidRouteB();
error OnlyWETH();
error PoolDoesNotExist();
error PoolFactoryDoesNotExist();
error SameAddresses();
error ZeroAddress();
/// @notice Address of FactoryRegistry.sol
function factoryRegistry() external view returns (address);
/// @notice Address of Protocol PoolFactory.sol
function defaultFactory() external view returns (address);
/// @notice Address of Voter.sol
function voter() external view returns (address);
/// @notice Interface of WETH contract used for WETH => ETH
/// wrapping/unwrapping
function weth() external view returns (IWETH);
/// @dev Represents Ether. Used by zapper to determine whether to return
/// assets as ETH/WETH.
function ETHER() external view returns (address);
/// @dev Struct containing information necessary to zap in and out of pools
/// @param tokenA .
/// @param tokenB .
/// @param stable Stable or volatile pool
/// @param factory factory of pool
/// @param amountOutMinA Minimum amount expected from swap leg of zap via
/// routesA
/// @param amountOutMinB Minimum amount expected from swap leg of zap via
/// routesB
/// @param amountAMin Minimum amount of tokenA expected from liquidity
/// leg of zap
/// @param amountBMin Minimum amount of tokenB expected from liquidity
/// leg of zap
struct Zap {
address tokenA;
address tokenB;
bool stable;
address factory;
uint256 amountOutMinA;
uint256 amountOutMinB;
uint256 amountAMin;
uint256 amountBMin;
}
/// @notice Sort two tokens by which address value is less than the other
/// @param tokenA Address of token to sort
/// @param tokenB Address of token to sort
/// @return token0 Lower address value between tokenA and tokenB
/// @return token1 Higher address value between tokenA and tokenB
function sortTokens(
address tokenA,
address tokenB
) external pure returns (address token0, address token1);
/// @notice Calculate the address of a pool by its' factory.
/// Used by all Router functions containing a `Route[]` or
/// `_factory` argument.
/// Reverts if _factory is not approved by the FactoryRegistry
/// @dev Returns a randomly generated address for a nonexistent pool
/// @param tokenA Address of token to query
/// @param tokenB Address of token to query
/// @param stable True if pool is stable, false if volatile
/// @param _factory Address of factory which created the pool
function poolFor(
address tokenA,
address tokenB,
bool stable,
address _factory
) external view returns (address pool);
/// @notice Fetch and sort the reserves for a pool
/// @param tokenA .
/// @param tokenB .
/// @param stable True if pool is stable, false if volatile
/// @param _factory Address of PoolFactory for tokenA and tokenB
/// @return reserveA Amount of reserves of the sorted token A
/// @return reserveB Amount of reserves of the sorted token B
function getReserves(
address tokenA,
address tokenB,
bool stable,
address _factory
) external view returns (uint256 reserveA, uint256 reserveB);
/// @notice Perform chained getAmountOut calculations on any number of pools
function getAmountsOut(
uint256 amountIn,
Route[] memory routes
) external view returns (uint256[] memory amounts);
// **** ADD LIQUIDITY ****
/// @notice Quote the amount deposited into a Pool
/// @param tokenA .
/// @param tokenB .
/// @param stable True if pool is stable, false if volatile
/// @param _factory Address of PoolFactory for tokenA and tokenB
/// @param amountADesired Amount of tokenA desired to deposit
/// @param amountBDesired Amount of tokenB desired to deposit
/// @return amountA Amount of tokenA to actually deposit
/// @return amountB Amount of tokenB to actually deposit
/// @return liquidity Amount of liquidity token returned from deposit
function quoteAddLiquidity(
address tokenA,
address tokenB,
bool stable,
address _factory,
uint256 amountADesired,
uint256 amountBDesired
)
external
view
returns (uint256 amountA, uint256 amountB, uint256 liquidity);
/// @notice Quote the amount of liquidity removed from a Pool
/// @param tokenA .
/// @param tokenB .
/// @param stable True if pool is stable, false if volatile
/// @param _factory Address of PoolFactory for tokenA and tokenB
/// @param liquidity Amount of liquidity to remove
/// @return amountA Amount of tokenA received
/// @return amountB Amount of tokenB received
function quoteRemoveLiquidity(
address tokenA,
address tokenB,
bool stable,
address _factory,
uint256 liquidity
) external view returns (uint256 amountA, uint256 amountB);
/// @notice Add liquidity of two tokens to a Pool
/// @param tokenA .
/// @param tokenB .
/// @param stable True if pool is stable, false if volatile
/// @param amountADesired Amount of tokenA desired to deposit
/// @param amountBDesired Amount of tokenB desired to deposit
/// @param amountAMin Minimum amount of tokenA to deposit
/// @param amountBMin Minimum amount of tokenB to deposit
/// @param to Recipient of liquidity token
/// @param deadline Deadline to receive liquidity
/// @return amountA Amount of tokenA to actually deposit
/// @return amountB Amount of tokenB to actually deposit
/// @return liquidity Amount of liquidity token returned from deposit
function addLiquidity(
address tokenA,
address tokenB,
bool stable,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);
/// @notice Add liquidity of a token and WETH (transferred as ETH) to a Pool
/// @param token .
/// @param stable True if pool is stable, false if volatile
/// @param amountTokenDesired Amount of token desired to deposit
/// @param amountTokenMin Minimum amount of token to deposit
/// @param amountETHMin Minimum amount of ETH to deposit
/// @param to Recipient of liquidity token
/// @param deadline Deadline to add liquidity
/// @return amountToken Amount of token to actually deposit
/// @return amountETH Amount of tokenETH to actually deposit
/// @return liquidity Amount of liquidity token returned from
/// deposit
function addLiquidityETH(
address token,
bool stable,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
// **** REMOVE LIQUIDITY ****
/// @notice Remove liquidity of two tokens from a Pool
/// @param tokenA .
/// @param tokenB .
/// @param stable True if pool is stable, false if volatile
/// @param liquidity Amount of liquidity to remove
/// @param amountAMin Minimum amount of tokenA to receive
/// @param amountBMin Minimum amount of tokenB to receive
/// @param to Recipient of tokens received
/// @param deadline Deadline to remove liquidity
/// @return amountA Amount of tokenA received
/// @return amountB Amount of tokenB received
function removeLiquidity(
address tokenA,
address tokenB,
bool stable,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB);
/// @notice Remove liquidity of a token and WETH (returned as ETH) from a
/// Pool
/// @param token .
/// @param stable True if pool is stable, false if volatile
/// @param liquidity Amount of liquidity to remove
/// @param amountTokenMin Minimum amount of token to receive
/// @param amountETHMin Minimum amount of ETH to receive
/// @param to Recipient of liquidity token
/// @param deadline Deadline to receive liquidity
/// @return amountToken Amount of token received
/// @return amountETH Amount of ETH received
function removeLiquidityETH(
address token,
bool stable,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountToken, uint256 amountETH);
/// @notice Remove liquidity of a fee-on-transfer token and WETH (returned
/// as ETH) from a Pool
/// @param token .
/// @param stable True if pool is stable, false if volatile
/// @param liquidity Amount of liquidity to remove
/// @param amountTokenMin Minimum amount of token to receive
/// @param amountETHMin Minimum amount of ETH to receive
/// @param to Recipient of liquidity token
/// @param deadline Deadline to receive liquidity
/// @return amountETH Amount of ETH received
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
bool stable,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountETH);
// **** SWAP ****
/// @notice Swap one token for another
/// @param amountIn Amount of token in
/// @param amountOutMin Minimum amount of desired token received
/// @param routes Array of trade routes used in the swap
/// @param to Recipient of the tokens received
/// @param deadline Deadline to receive tokens
/// @return amounts Array of amounts returned per route
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
Route[] calldata routes,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
/// @notice Swap ETH for a token
/// @param amountOutMin Minimum amount of desired token received
/// @param routes Array of trade routes used in the swap
/// @param to Recipient of the tokens received
/// @param deadline Deadline to receive tokens
/// @return amounts Array of amounts returned per route
function swapExactETHForTokens(
uint256 amountOutMin,
Route[] calldata routes,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
/// @notice Swap a token for WETH (returned as ETH)
/// @param amountIn Amount of token in
/// @param amountOutMin Minimum amount of desired ETH
/// @param routes Array of trade routes used in the swap
/// @param to Recipient of the tokens received
/// @param deadline Deadline to receive tokens
/// @return amounts Array of amounts returned per route
function swapExactTokensForETH(
uint256 amountIn,
uint256 amountOutMin,
Route[] calldata routes,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
/// @notice Swap one token for another without slippage protection
/// @return amounts Array of amounts to swap per route
/// @param routes Array of trade routes used in the swap
/// @param to Recipient of the tokens received
/// @param deadline Deadline to receive tokens
function UNSAFE_swapExactTokensForTokens(
uint256[] memory amounts,
Route[] calldata routes,
address to,
uint256 deadline
) external returns (uint256[] memory);
// **** SWAP (supporting fee-on-transfer tokens) ****
/// @notice Swap one token for another supporting fee-on-transfer tokens
/// @param amountIn Amount of token in
/// @param amountOutMin Minimum amount of desired token received
/// @param routes Array of trade routes used in the swap
/// @param to Recipient of the tokens received
/// @param deadline Deadline to receive tokens
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
Route[] calldata routes,
address to,
uint256 deadline
) external;
/// @notice Swap ETH for a token supporting fee-on-transfer tokens
/// @param amountOutMin Minimum amount of desired token received
/// @param routes Array of trade routes used in the swap
/// @param to Recipient of the tokens received
/// @param deadline Deadline to receive tokens
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint256 amountOutMin,
Route[] calldata routes,
address to,
uint256 deadline
) external payable;
/// @notice Swap a token for WETH (returned as ETH) supporting
/// fee-on-transfer tokens
/// @param amountIn Amount of token in
/// @param amountOutMin Minimum amount of desired ETH
/// @param routes Array of trade routes used in the swap
/// @param to Recipient of the tokens received
/// @param deadline Deadline to receive tokens
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
Route[] calldata routes,
address to,
uint256 deadline
) external;
/// @notice Zap a token A into a pool (B, C). (A can be equal to B or C).
/// Supports standard ERC20 tokens only (i.e. not fee-on-transfer
/// tokens etc).
/// Slippage is required for the initial swap.
/// Additional slippage may be required when adding liquidity as the
/// price of the token may have changed.
/// @param tokenIn Token you are zapping in from (i.e. input token).
/// @param amountInA Amount of input token you wish to send down routesA
/// @param amountInB Amount of input token you wish to send down routesB
/// @param zapInPool Contains zap struct information. See Zap struct.
/// @param routesA Route used to convert input token to tokenA
/// @param routesB Route used to convert input token to tokenB
/// @param to Address you wish to mint liquidity to.
/// @param stake Auto-stake liquidity in corresponding gauge.
/// @return liquidity Amount of LP tokens created from zapping in.
function zapIn(
address tokenIn,
uint256 amountInA,
uint256 amountInB,
Zap calldata zapInPool,
Route[] calldata routesA,
Route[] calldata routesB,
address to,
bool stake
) external payable returns (uint256 liquidity);
/// @notice Zap out a pool (B, C) into A.
/// Supports standard ERC20 tokens only (i.e. not fee-on-transfer
/// tokens etc).
/// Slippage is required for the removal of liquidity.
/// Additional slippage may be required on the swap as the
/// price of the token may have changed.
/// @param tokenOut Token you are zapping out to (i.e. output token).
/// @param liquidity Amount of liquidity you wish to remove.
/// @param zapOutPool Contains zap struct information. See Zap struct.
/// @param routesA Route used to convert tokenA into output token.
/// @param routesB Route used to convert tokenB into output token.
function zapOut(
address tokenOut,
uint256 liquidity,
Zap calldata zapOutPool,
Route[] calldata routesA,
Route[] calldata routesB
) external;
/// @notice Used to generate params required for zapping in.
/// Zap in => remove liquidity then swap.
/// Apply slippage to expected swap values to account for changes in
/// reserves in between.
/// @dev Output token refers to the token you want to zap in from.
/// @param tokenA .
/// @param tokenB .
/// @param stable .
/// @param _factory .
/// @param amountInA Amount of input token you wish to send down
/// routesA
/// @param amountInB Amount of input token you wish to send down
/// routesB
/// @param routesA Route used to convert input token to tokenA
/// @param routesB Route used to convert input token to tokenB
/// @return amountOutMinA Minimum output expected from swapping input
/// token to tokenA.
/// @return amountOutMinB Minimum output expected from swapping input
/// token to tokenB.
/// @return amountAMin Minimum amount of tokenA expected from
/// depositing liquidity.
/// @return amountBMin Minimum amount of tokenB expected from
/// depositing liquidity.
function generateZapInParams(
address tokenA,
address tokenB,
bool stable,
address _factory,
uint256 amountInA,
uint256 amountInB,
Route[] calldata routesA,
Route[] calldata routesB
)
external
view
returns (
uint256 amountOutMinA,
uint256 amountOutMinB,
uint256 amountAMin,
uint256 amountBMin
);
/// @notice Used to generate params required for zapping out.
/// Zap out => swap then add liquidity.
/// Apply slippage to expected liquidity values to account for
/// changes in reserves in between.
/// @dev Output token refers to the token you want to zap out of.
/// @param tokenA .
/// @param tokenB .
/// @param stable .
/// @param _factory .
/// @param liquidity Amount of liquidity being zapped out of into a
/// given output token.
/// @param routesA Route used to convert tokenA into output token.
/// @param routesB Route used to convert tokenB into output token.
/// @return amountOutMinA Minimum output expected from swapping tokenA
/// into output token.
/// @return amountOutMinB Minimum output expected from swapping tokenB
/// into output token.
/// @return amountAMin Minimum amount of tokenA expected from
/// withdrawing liquidity.
/// @return amountBMin Minimum amount of tokenB expected from
/// withdrawing liquidity.
function generateZapOutParams(
address tokenA,
address tokenB,
bool stable,
address _factory,
uint256 liquidity,
Route[] calldata routesA,
Route[] calldata routesB
)
external
view
returns (
uint256 amountOutMinA,
uint256 amountOutMinB,
uint256 amountAMin,
uint256 amountBMin
);
/// @notice Used by zapper to determine appropriate ratio of A to B to
/// deposit liquidity. Assumes stable pool.
/// @dev Returns stable liquidity ratio of B to (A + B).
/// E.g. if ratio is 0.4, it means there is more of A than there is of
/// B.
/// Therefore you should deposit more of token A than B.
/// @param tokenA tokenA of stable pool you are zapping into.
/// @param tokenB tokenB of stable pool you are zapping into.
/// @param factory Factory that created stable pool.
/// @return ratio Ratio of token0 to token1 required to deposit into zap.
function quoteStableLiquidityRatio(
address tokenA,
address tokenB,
address factory
) external view returns (uint256 ratio);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface ICLPool {
error DepositsNotEqual();
error BelowMinimumK();
error FactoryAlreadySet();
error InsufficientLiquidity();
error InsufficientLiquidityMinted();
error InsufficientLiquidityBurned();
error InsufficientOutputAmount();
error InsufficientInputAmount();
error IsPaused();
error InvalidTo();
error K();
error NotEmergencyCouncil();
event Fees(address indexed sender, uint256 amount0, uint256 amount1);
event Mint(address indexed sender, uint256 amount0, uint256 amount1);
event Burn(
address indexed sender,
address indexed to,
uint256 amount0,
uint256 amount1
);
event Swap(
address indexed sender,
address indexed to,
uint256 amount0In,
uint256 amount1In,
uint256 amount0Out,
uint256 amount1Out
);
event Sync(uint256 reserve0, uint256 reserve1);
event Claim(
address indexed sender,
address indexed recipient,
uint256 amount0,
uint256 amount1
);
// Struct to capture time period obervations every 30 minutes, used for
// local oracles
struct Observation {
uint256 timestamp;
uint256 reserve0Cumulative;
uint256 reserve1Cumulative;
}
/// @notice 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
/// 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,
bool unlocked
);
/// @notice Returns the decimal (dec), reserves (r), stable (st), and tokens
/// (t) of token0 and token1
function metadata()
external
view
returns (
uint256 dec0,
uint256 dec1,
uint256 r0,
uint256 r1,
bool st,
address t0,
address t1
);
/// @notice Claim accumulated but unclaimed fees (claimable0 and claimable1)
function claimFees() external returns (uint256, uint256);
/// @notice Returns [token0, token1]
function tokens() external view returns (address, address);
/// @notice Address of token in the pool with the lower address value
function token0() external view returns (address);
/// @notice Address of token in the poool with the higher address value
function token1() external view returns (address);
/// @notice Address of linked PoolFees.sol
function poolFees() external view returns (address);
/// @notice Address of PoolFactory that created this contract
function factory() external view returns (address);
/// @notice Capture oracle reading every 30 minutes (1800 seconds)
function periodSize() external view returns (uint256);
/// @notice Amount of token0 in pool
function reserve0() external view returns (uint256);
/// @notice Amount of token1 in pool
function reserve1() external view returns (uint256);
/// @notice Timestamp of last update to pool
function blockTimestampLast() external view returns (uint256);
/// @notice Cumulative of reserve0 factoring in time elapsed
function reserve0CumulativeLast() external view returns (uint256);
/// @notice Cumulative of reserve1 factoring in time elapsed
function reserve1CumulativeLast() external view returns (uint256);
/// @notice Accumulated fees of token0 (global)
function index0() external view returns (uint256);
/// @notice Accumulated fees of token1 (global)
function index1() external view returns (uint256);
/// @notice Get an LP's relative index0 to index0
function supplyIndex0(
address
) external view returns (uint256);
/// @notice Get an LP's relative index1 to index1
function supplyIndex1(
address
) external view returns (uint256);
/// @notice Amount of unclaimed, but claimable tokens from fees of token0
/// for an LP
function claimable0(
address
) external view returns (uint256);
/// @notice Amount of unclaimed, but claimable tokens from fees of token1
/// for an LP
function claimable1(
address
) external view returns (uint256);
/// @notice Returns the value of K in the Pool, based on its reserves.
function getK() external returns (uint256);
/// @notice Set pool name
/// Only callable by Voter.emergencyCouncil()
/// @param __name String of new name
function setName(
string calldata __name
) external;
/// @notice Set pool symbol
/// Only callable by Voter.emergencyCouncil()
/// @param __symbol String of new symbol
function setSymbol(
string calldata __symbol
) external;
/// @notice Get the number of observations recorded
function observationLength() external view returns (uint256);
/// @notice Get the value of the most recent observation
function lastObservation() external view returns (Observation memory);
/// @notice True if pool is stable, false if volatile
function stable() external view returns (bool);
/// @notice Produces the cumulative price using counterfactuals to save gas
/// and avoid a call to sync.
function currentCumulativePrices()
external
view
returns (
uint256 reserve0Cumulative,
uint256 reserve1Cumulative,
uint256 blockTimestamp
);
/// @notice Provides twap price with user configured granularity, up to the
/// full window size
/// @param tokenIn .
/// @param amountIn .
/// @param granularity .
/// @return amountOut .
function quote(
address tokenIn,
uint256 amountIn,
uint256 granularity
) external view returns (uint256 amountOut);
/// @notice Returns a memory set of TWAP prices
/// Same as calling sample(tokenIn, amountIn, points, 1)
/// @param tokenIn .
/// @param amountIn .
/// @param points Number of points to return
/// @return Array of TWAP prices
function prices(
address tokenIn,
uint256 amountIn,
uint256 points
) external view returns (uint256[] memory);
/// @notice Same as prices with with an additional window argument.
/// Window = 2 means 2 * 30min (or 1 hr) between observations
/// @param tokenIn .
/// @param amountIn .
/// @param points .
/// @param window .
/// @return Array of TWAP prices
function sample(
address tokenIn,
uint256 amountIn,
uint256 points,
uint256 window
) external view returns (uint256[] memory);
/// @notice This low-level function should be called from a contract which
/// performs important safety checks
/// @param amount0Out Amount of token0 to send to `to`
/// @param amount1Out Amount of token1 to send to `to`
/// @param to Address to recieve the swapped output
/// @param data Additional calldata for flashloans
function swap(
uint256 amount0Out,
uint256 amount1Out,
address to,
bytes calldata data
) external;
/// @notice This low-level function should be called from a contract which
/// performs important safety checks
/// standard uniswap v2 implementation
/// @param to Address to receive token0 and token1 from burning the pool
/// token
/// @return amount0 Amount of token0 returned
/// @return amount1 Amount of token1 returned
function burn(
address to
) external returns (uint256 amount0, uint256 amount1);
/// @notice This low-level function should be called by addLiquidity
/// functions in Router.sol, which performs important safety checks
/// standard uniswap v2 implementation
/// @param to Address to receive the minted LP token
/// @return liquidity Amount of LP token minted
function mint(
address to
) external returns (uint256 liquidity);
/// @notice Update reserves and, on the first call per block, price
/// accumulators
/// @return _reserve0 .
/// @return _reserve1 .
/// @return _blockTimestampLast .
function getReserves()
external
view
returns (
uint256 _reserve0,
uint256 _reserve1,
uint256 _blockTimestampLast
);
/// @notice Get the amount of tokenOut given the amount of tokenIn
/// @param amountIn Amount of token in
/// @param tokenIn Address of token
/// @return Amount out
function getAmountOut(
uint256 amountIn,
address tokenIn
) external view returns (uint256);
/// @notice Force balances to match reserves
/// @param to Address to receive any skimmed rewards
function skim(
address to
) external;
/// @notice Force reserves to match balances
function sync() external;
/// @notice Called on pool creation by PoolFactory
/// @param _token0 Address of token0
/// @param _token1 Address of token1
/// @param _stable True if stable, false if volatile
function initialize(
address _token0,
address _token1,
bool _stable
) external;
/// @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,
/// liquidityNet how much liquidity changes when the pool price crosses the
/// tick,
/// stakedLiquidityNet how much staked liquidity changes when the pool price
/// crosses the tick,
/// feeGrowthOutside0X128 the fee growth on the other side of the tick from
/// the current tick in token0,
/// feeGrowthOutside1X128 the fee growth on the other side of the tick from
/// the current tick in token1,
/// rewardGrowthOutsideX128 the reward growth on the other side of the tick
/// from the current tick in emission token
/// tickCumulativeOutside the cumulative tick value on the other side of the
/// tick from the current tick
/// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the
/// other side of the tick from the current tick,
/// secondsOutside the seconds spent on the other side of the tick from the
/// current tick,
/// 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,
int128 stakedLiquidityNet,
uint256 feeGrowthOutside0X128,
uint256 feeGrowthOutside1X128,
uint256 rewardGrowthOutsideX128,
int56 tickCumulativeOutside,
uint160 secondsPerLiquidityOutsideX128,
uint32 secondsOutside,
bool initialized
);
function fee() external view returns (uint24);
function tickSpacing() external view returns (int24);
function liquidity() external view returns (uint128);
function feeGrowthGlobal0X128() external view returns (uint256);
function feeGrowthGlobal1X128() external view returns (uint256);
}// 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 // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol) pragma solidity ^0.8.0; import "../token/ERC20/IERC20.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;
}
struct SwapParams {
address router;
uint256 amountIn;
uint256 minAmountOut;
address tokenIn;
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);
}{
"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":[],"name":"InvalidPrice","type":"error"},{"inputs":[{"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"}],"name":"addLiquidity","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"lpToken","type":"address"},{"internalType":"uint256","name":"baseTokenIndex","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"getPoolPrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"lpToken","type":"address"}],"name":"getReserves","outputs":[{"internalType":"uint256[]","name":"reserves","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"lpToken","type":"address"}],"name":"getTokens","outputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"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"}],"name":"removeLiquidity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"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":"swap","type":"tuple"}],"name":"swapExactETHForTokens","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"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":"swap","type":"tuple"}],"name":"swapExactTokensForTokens","outputs":[],"stateMutability":"payable","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b5061136a806100206000396000f3fe6080604052600436106100705760003560e01c8063450efe211161004e578063450efe21146100f75780638abfa5d514610124578063fb986deb14610137578063ff781feb1461014a57600080fd5b80633941dc18146100755780633e99c1e4146100a857806341d07dc0146100d5575b600080fd5b34801561008157600080fd5b50610095610090366004610a41565b61015d565b6040519081526020015b60405180910390f35b3480156100b457600080fd5b506100c86100c3366004610a76565b6103bb565b60405161009f9190610a9a565b3480156100e157600080fd5b506100f56100f0366004610d1a565b610492565b005b34801561010357600080fd5b50610117610112366004610a76565b6105e6565b60405161009f9190610dfb565b6100f5610132366004610e3c565b610735565b6100f5610145366004610ee5565b6107dd565b6100f5610158366004610e3c565b610975565b600080846001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa15801561019e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c29190610fa1565b90506000856001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610204573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102289190610fa1565b6040516378a051ad60e11b8152600160048201526001600160a01b03848116602483015291925060009188169063f140a35a90604401602060405180830381865afa15801561027b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029f9190610fbe565b905080156102c0576102b981670de0b6b3a7640000610fd7565b935061036d565b6040516378a051ad60e11b8152600160048201526001600160a01b0383811660248301526000919089169063f140a35a90604401602060405180830381865afa158015610311573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103359190610fbe565b9050806000036103575760405162bfc92160e01b815260040160405180910390fd5b61036981670de0b6b3a7640000611002565b9450505b8360000361038d5760405162bfc92160e01b815260040160405180910390fd5b856001036103b1576103ae846ec097ce7bc90715b34b9f1000000000611002565b93505b5050509392505050565b6060600080836001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156103fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104229190611024565b5060408051600280825260608201909252929450909250816020016020820280368337019050509250818360008151811061045f5761045f611052565b602002602001018181525050808360018151811061047f5761047f611052565b6020026020010181815250505050919050565b60008160a001518060200190518101906104ac9190611078565b905081600001516001600160a01b0316630dede6c483604001516000815181106104d8576104d8611052565b602002602001015184604001516001815181106104f7576104f7611052565b602002602001015184600001518660600151876080015160008151811061052057610520611052565b6020026020010151886080015160018151811061053f5761053f611052565b60209081029190910101516040516001600160e01b031960e089901b1681526001600160a01b03968716600482015295909416602486015291151560448501526064840152608483015260a48201523060c48201524260e48201526101040160408051808303816000875af11580156105bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e091906110a4565b50505050565b6040805160028082526060808301845292602083019080368337019050509050816001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610644573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106689190610fa1565b8160008151811061067b5761067b611052565b60200260200101906001600160a01b031690816001600160a01b031681525050816001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fd9190610fa1565b8160018151811061071057610710611052565b60200260200101906001600160a01b031690816001600160a01b031681525050919050565b6000816080015180602001905181019061074f91906110c8565b82516020840151604080860151845191516333ffdb3560e11b81529495506001600160a01b03909316936367ffb66a9361079192909130904290600401611232565b60006040518083038185885af11580156107af573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526107d89190810190611267565b505050565b60008160a001518060200190518101906107f79190611078565b905081600001516001600160a01b0316635a47ddc3836040015160008151811061082357610823611052565b6020026020010151846040015160018151811061084257610842611052565b60200260200101518460000151866060015160008151811061086657610866611052565b6020026020010151876060015160018151811061088557610885611052565b602002602001015188608001516000815181106108a4576108a4611052565b602002602001015189608001516001815181106108c3576108c3611052565b60209081029190910101516040516001600160e01b031960e08a901b1681526001600160a01b03978816600482015296909516602487015292151560448601526064850191909152608484015260a483015260c48201523060e482015242610104820152610124016060604051808303816000875af115801561094a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096e9190611024565b5050505050565b6000816080015180602001905181019061098f91906110c8565b8251602084015160408086015184519151631e82ecdb60e31b81529495506001600160a01b039093169363f41766d8936109d293929091309042906004016112f8565b6000604051808303816000875af11580156109f1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107d89190810190611267565b6001600160a01b0381168114610a2e57600080fd5b50565b8035610a3c81610a19565b919050565b600080600060608486031215610a5657600080fd5b8335610a6181610a19565b95602085013595506040909401359392505050565b600060208284031215610a8857600080fd5b8135610a9381610a19565b9392505050565b6020808252825182820181905260009190848201906040850190845b81811015610ad257835183529284019291840191600101610ab6565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff81118282101715610b1757610b17610ade565b60405290565b60405160a0810167ffffffffffffffff81118282101715610b1757610b17610ade565b6040516020810167ffffffffffffffff81118282101715610b1757610b17610ade565b6040516060810167ffffffffffffffff81118282101715610b1757610b17610ade565b604051601f8201601f1916810167ffffffffffffffff81118282101715610baf57610baf610ade565b604052919050565b600067ffffffffffffffff821115610bd157610bd1610ade565b5060051b60200190565b600082601f830112610bec57600080fd5b81356020610c01610bfc83610bb7565b610b86565b82815260059290921b84018101918181019086841115610c2057600080fd5b8286015b84811015610c44578035610c3781610a19565b8352918301918301610c24565b509695505050505050565b600082601f830112610c6057600080fd5b81356020610c70610bfc83610bb7565b82815260059290921b84018101918181019086841115610c8f57600080fd5b8286015b84811015610c445780358352918301918301610c93565b600082601f830112610cbb57600080fd5b813567ffffffffffffffff811115610cd557610cd5610ade565b610ce8601f8201601f1916602001610b86565b818152846020838601011115610cfd57600080fd5b816020850160208301376000918101602001919091529392505050565b600060208284031215610d2c57600080fd5b813567ffffffffffffffff80821115610d4457600080fd5b9083019060c08286031215610d5857600080fd5b610d60610af4565b610d6983610a31565b8152610d7760208401610a31565b6020820152604083013582811115610d8e57600080fd5b610d9a87828601610bdb565b60408301525060608301356060820152608083013582811115610dbc57600080fd5b610dc887828601610c4f565b60808301525060a083013582811115610de057600080fd5b610dec87828601610caa565b60a08301525095945050505050565b6020808252825182820181905260009190848201906040850190845b81811015610ad25783516001600160a01b031683529284019291840191600101610e17565b600060208284031215610e4e57600080fd5b813567ffffffffffffffff80821115610e6657600080fd5b9083019060a08286031215610e7a57600080fd5b610e82610b1d565b8235610e8d81610a19565b8082525060208301356020820152604083013560408201526060830135610eb381610a19565b6060820152608083013582811115610eca57600080fd5b610ed687828601610caa565b60808301525095945050505050565b600060208284031215610ef757600080fd5b813567ffffffffffffffff80821115610f0f57600080fd5b9083019060c08286031215610f2357600080fd5b610f2b610af4565b610f3483610a31565b8152610f4260208401610a31565b6020820152604083013582811115610f5957600080fd5b610f6587828601610bdb565b604083015250606083013582811115610f7d57600080fd5b610f8987828601610c4f565b606083015250608083013582811115610dbc57600080fd5b600060208284031215610fb357600080fd5b8151610a9381610a19565b600060208284031215610fd057600080fd5b5051919050565b8082028115828204841417610ffc57634e487b7160e01b600052601160045260246000fd5b92915050565b60008261101f57634e487b7160e01b600052601260045260246000fd5b500490565b60008060006060848603121561103957600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052603260045260246000fd5b80518015158114610a3c57600080fd5b60006020828403121561108a57600080fd5b611092610b40565b61109b83611068565b81529392505050565b600080604083850312156110b757600080fd5b505080516020909101519092909150565b600060208083850312156110db57600080fd5b825167ffffffffffffffff808211156110f357600080fd5b818501915082828703121561110757600080fd5b61110f610b40565b82518281111561111e57600080fd5b80840193505086601f84011261113357600080fd5b82519150611143610bfc83610bb7565b8281526060928302840185019285820191908985111561116257600080fd5b948601945b848610156111c55780868b03121561117f5760008081fd5b611187610b63565b865161119281610a19565b8152868801516111a181610a19565b8189015260406111b2888201611068565b9082015283529485019491860191611167565b508252509695505050505050565b600081518084526020808501945080840160005b8381101561122757815180516001600160a01b039081168952848201511684890152604090810151151590880152606090960195908201906001016111e7565b509495945050505050565b84815260806020820152600061124b60808301866111d3565b6001600160a01b03949094166040830152506060015292915050565b6000602080838503121561127a57600080fd5b825167ffffffffffffffff81111561129157600080fd5b8301601f810185136112a257600080fd5b80516112b0610bfc82610bb7565b81815260059190911b820183019083810190878311156112cf57600080fd5b928401925b828410156112ed578351825292840192908401906112d4565b979650505050505050565b85815284602082015260a06040820152600061131760a08301866111d3565b6001600160a01b039490941660608301525060800152939250505056fea264697066735822122035347a32513f89f5de99d79a14d190b8732f529f88f682ce1920d8c996836cd264736f6c63430008130033
Deployed Bytecode
0x6080604052600436106100705760003560e01c8063450efe211161004e578063450efe21146100f75780638abfa5d514610124578063fb986deb14610137578063ff781feb1461014a57600080fd5b80633941dc18146100755780633e99c1e4146100a857806341d07dc0146100d5575b600080fd5b34801561008157600080fd5b50610095610090366004610a41565b61015d565b6040519081526020015b60405180910390f35b3480156100b457600080fd5b506100c86100c3366004610a76565b6103bb565b60405161009f9190610a9a565b3480156100e157600080fd5b506100f56100f0366004610d1a565b610492565b005b34801561010357600080fd5b50610117610112366004610a76565b6105e6565b60405161009f9190610dfb565b6100f5610132366004610e3c565b610735565b6100f5610145366004610ee5565b6107dd565b6100f5610158366004610e3c565b610975565b600080846001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa15801561019e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c29190610fa1565b90506000856001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610204573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102289190610fa1565b6040516378a051ad60e11b8152600160048201526001600160a01b03848116602483015291925060009188169063f140a35a90604401602060405180830381865afa15801561027b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029f9190610fbe565b905080156102c0576102b981670de0b6b3a7640000610fd7565b935061036d565b6040516378a051ad60e11b8152600160048201526001600160a01b0383811660248301526000919089169063f140a35a90604401602060405180830381865afa158015610311573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103359190610fbe565b9050806000036103575760405162bfc92160e01b815260040160405180910390fd5b61036981670de0b6b3a7640000611002565b9450505b8360000361038d5760405162bfc92160e01b815260040160405180910390fd5b856001036103b1576103ae846ec097ce7bc90715b34b9f1000000000611002565b93505b5050509392505050565b6060600080836001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156103fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104229190611024565b5060408051600280825260608201909252929450909250816020016020820280368337019050509250818360008151811061045f5761045f611052565b602002602001018181525050808360018151811061047f5761047f611052565b6020026020010181815250505050919050565b60008160a001518060200190518101906104ac9190611078565b905081600001516001600160a01b0316630dede6c483604001516000815181106104d8576104d8611052565b602002602001015184604001516001815181106104f7576104f7611052565b602002602001015184600001518660600151876080015160008151811061052057610520611052565b6020026020010151886080015160018151811061053f5761053f611052565b60209081029190910101516040516001600160e01b031960e089901b1681526001600160a01b03968716600482015295909416602486015291151560448501526064840152608483015260a48201523060c48201524260e48201526101040160408051808303816000875af11580156105bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e091906110a4565b50505050565b6040805160028082526060808301845292602083019080368337019050509050816001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610644573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106689190610fa1565b8160008151811061067b5761067b611052565b60200260200101906001600160a01b031690816001600160a01b031681525050816001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fd9190610fa1565b8160018151811061071057610710611052565b60200260200101906001600160a01b031690816001600160a01b031681525050919050565b6000816080015180602001905181019061074f91906110c8565b82516020840151604080860151845191516333ffdb3560e11b81529495506001600160a01b03909316936367ffb66a9361079192909130904290600401611232565b60006040518083038185885af11580156107af573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526107d89190810190611267565b505050565b60008160a001518060200190518101906107f79190611078565b905081600001516001600160a01b0316635a47ddc3836040015160008151811061082357610823611052565b6020026020010151846040015160018151811061084257610842611052565b60200260200101518460000151866060015160008151811061086657610866611052565b6020026020010151876060015160018151811061088557610885611052565b602002602001015188608001516000815181106108a4576108a4611052565b602002602001015189608001516001815181106108c3576108c3611052565b60209081029190910101516040516001600160e01b031960e08a901b1681526001600160a01b03978816600482015296909516602487015292151560448601526064850191909152608484015260a483015260c48201523060e482015242610104820152610124016060604051808303816000875af115801561094a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096e9190611024565b5050505050565b6000816080015180602001905181019061098f91906110c8565b8251602084015160408086015184519151631e82ecdb60e31b81529495506001600160a01b039093169363f41766d8936109d293929091309042906004016112f8565b6000604051808303816000875af11580156109f1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107d89190810190611267565b6001600160a01b0381168114610a2e57600080fd5b50565b8035610a3c81610a19565b919050565b600080600060608486031215610a5657600080fd5b8335610a6181610a19565b95602085013595506040909401359392505050565b600060208284031215610a8857600080fd5b8135610a9381610a19565b9392505050565b6020808252825182820181905260009190848201906040850190845b81811015610ad257835183529284019291840191600101610ab6565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff81118282101715610b1757610b17610ade565b60405290565b60405160a0810167ffffffffffffffff81118282101715610b1757610b17610ade565b6040516020810167ffffffffffffffff81118282101715610b1757610b17610ade565b6040516060810167ffffffffffffffff81118282101715610b1757610b17610ade565b604051601f8201601f1916810167ffffffffffffffff81118282101715610baf57610baf610ade565b604052919050565b600067ffffffffffffffff821115610bd157610bd1610ade565b5060051b60200190565b600082601f830112610bec57600080fd5b81356020610c01610bfc83610bb7565b610b86565b82815260059290921b84018101918181019086841115610c2057600080fd5b8286015b84811015610c44578035610c3781610a19565b8352918301918301610c24565b509695505050505050565b600082601f830112610c6057600080fd5b81356020610c70610bfc83610bb7565b82815260059290921b84018101918181019086841115610c8f57600080fd5b8286015b84811015610c445780358352918301918301610c93565b600082601f830112610cbb57600080fd5b813567ffffffffffffffff811115610cd557610cd5610ade565b610ce8601f8201601f1916602001610b86565b818152846020838601011115610cfd57600080fd5b816020850160208301376000918101602001919091529392505050565b600060208284031215610d2c57600080fd5b813567ffffffffffffffff80821115610d4457600080fd5b9083019060c08286031215610d5857600080fd5b610d60610af4565b610d6983610a31565b8152610d7760208401610a31565b6020820152604083013582811115610d8e57600080fd5b610d9a87828601610bdb565b60408301525060608301356060820152608083013582811115610dbc57600080fd5b610dc887828601610c4f565b60808301525060a083013582811115610de057600080fd5b610dec87828601610caa565b60a08301525095945050505050565b6020808252825182820181905260009190848201906040850190845b81811015610ad25783516001600160a01b031683529284019291840191600101610e17565b600060208284031215610e4e57600080fd5b813567ffffffffffffffff80821115610e6657600080fd5b9083019060a08286031215610e7a57600080fd5b610e82610b1d565b8235610e8d81610a19565b8082525060208301356020820152604083013560408201526060830135610eb381610a19565b6060820152608083013582811115610eca57600080fd5b610ed687828601610caa565b60808301525095945050505050565b600060208284031215610ef757600080fd5b813567ffffffffffffffff80821115610f0f57600080fd5b9083019060c08286031215610f2357600080fd5b610f2b610af4565b610f3483610a31565b8152610f4260208401610a31565b6020820152604083013582811115610f5957600080fd5b610f6587828601610bdb565b604083015250606083013582811115610f7d57600080fd5b610f8987828601610c4f565b606083015250608083013582811115610dbc57600080fd5b600060208284031215610fb357600080fd5b8151610a9381610a19565b600060208284031215610fd057600080fd5b5051919050565b8082028115828204841417610ffc57634e487b7160e01b600052601160045260246000fd5b92915050565b60008261101f57634e487b7160e01b600052601260045260246000fd5b500490565b60008060006060848603121561103957600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052603260045260246000fd5b80518015158114610a3c57600080fd5b60006020828403121561108a57600080fd5b611092610b40565b61109b83611068565b81529392505050565b600080604083850312156110b757600080fd5b505080516020909101519092909150565b600060208083850312156110db57600080fd5b825167ffffffffffffffff808211156110f357600080fd5b818501915082828703121561110757600080fd5b61110f610b40565b82518281111561111e57600080fd5b80840193505086601f84011261113357600080fd5b82519150611143610bfc83610bb7565b8281526060928302840185019285820191908985111561116257600080fd5b948601945b848610156111c55780868b03121561117f5760008081fd5b611187610b63565b865161119281610a19565b8152868801516111a181610a19565b8189015260406111b2888201611068565b9082015283529485019491860191611167565b508252509695505050505050565b600081518084526020808501945080840160005b8381101561122757815180516001600160a01b039081168952848201511684890152604090810151151590880152606090960195908201906001016111e7565b509495945050505050565b84815260806020820152600061124b60808301866111d3565b6001600160a01b03949094166040830152506060015292915050565b6000602080838503121561127a57600080fd5b825167ffffffffffffffff81111561129157600080fd5b8301601f810185136112a257600080fd5b80516112b0610bfc82610bb7565b81815260059190911b820183019083810190878311156112cf57600080fd5b928401925b828410156112ed578351825292840192908401906112d4565b979650505050505050565b85815284602082015260a06040820152600061131760a08301866111d3565b6001600160a01b039490941660608301525060800152939250505056fea264697066735822122035347a32513f89f5de99d79a14d190b8732f529f88f682ce1920d8c996836cd264736f6c63430008130033
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
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.