Source Code
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 26468934 | 110 days ago | 0.00000892 FRAX | ||||
| 26405061 | 111 days ago | 0.00000892 FRAX | ||||
| 14084673 | 397 days ago | 0.0009565 FRAX | ||||
| 14084673 | 397 days ago | 0.0009565 FRAX | ||||
| 12910043 | 424 days ago | 1.00248827 FRAX | ||||
| 12910043 | 424 days ago | 1.00248827 FRAX | ||||
| 12313948 | 438 days ago | 0.0001 FRAX | ||||
| 12266245 | 439 days ago | 0.10126114 FRAX | ||||
| 12266245 | 439 days ago | 0.10126114 FRAX | ||||
| 10804048 | 473 days ago | 0.01 FRAX | ||||
| 10570237 | 478 days ago | 0.10546456 FRAX | ||||
| 10570237 | 478 days ago | 0.10546456 FRAX | ||||
| 10570167 | 478 days ago | 0.04222914 FRAX | ||||
| 10570167 | 478 days ago | 0.04222914 FRAX | ||||
| 10570147 | 478 days ago | 0.04225798 FRAX | ||||
| 10570147 | 478 days ago | 0.04225798 FRAX | ||||
| 10570114 | 478 days ago | 0.04228838 FRAX | ||||
| 10570114 | 478 days ago | 0.04228838 FRAX | ||||
| 10570076 | 478 days ago | 0.04230402 FRAX | ||||
| 10570076 | 478 days ago | 0.04230402 FRAX | ||||
| 9965614 | 492 days ago | 0.001 FRAX | ||||
| 9937354 | 493 days ago | 0.0076 FRAX | ||||
| 9930549 | 493 days ago | 0.0035 FRAX | ||||
| 9881120 | 494 days ago | 0.001 FRAX | ||||
| 9721151 | 498 days ago | 0.001 FRAX |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
FraxswapRouterMultihop
Compiler Version
v0.8.25+commit.b61c2a91
Optimization Enabled:
No with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.0;
pragma abicoder v2;
// ====================================================================
// | ______ _______ |
// | / _____________ __ __ / ____(_____ ____ _____ ________ |
// | / /_ / ___/ __ `| |/_/ / /_ / / __ \/ __ `/ __ \/ ___/ _ \ |
// | / __/ / / / /_/ _> < / __/ / / / / / /_/ / / / / /__/ __/ |
// | /_/ /_/ \__,_/_/|_| /_/ /_/_/ /_/\__,_/_/ /_/\___/\___/ |
// | |
// ====================================================================
// ===================== Fraxswap Router Multihop =====================
// ====================================================================
// Fraxswap Router Multihop
// Frax Finance: https://github.com/FraxFinance
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@uniswap/v3-core/contracts/libraries/SafeCast.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IWETH.sol";
import "@uniswap/v3-periphery/contracts/libraries/TransferHelper.sol";
import "@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol";
import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol";
/// @title Fraxswap Router Multihop
/// @dev Router for swapping across the majority of the FRAX liquidity
contract FraxswapRouterMultihop is ReentrancyGuard {
using SafeCast for uint256;
using SafeCast for int256;
IWETH public immutable WETH9;
address public immutable FRAX;
bool public immutable CHECK_AMOUNTOUT_IN_ROUTER;
constructor(IWETH _WETH9, address _FRAX, bool _CHECK_AMOUNTOUT_IN_ROUTER) {
WETH9 = _WETH9;
FRAX = _FRAX;
CHECK_AMOUNTOUT_IN_ROUTER = _CHECK_AMOUNTOUT_IN_ROUTER;
}
/// @notice modifier for checking deadline
modifier checkDeadline(uint256 deadline) {
require(block.timestamp <= deadline, "Transaction too old");
_;
}
/// @notice accept ETH
receive() external payable {}
/// ---------------------------
/// --------- Public ----------
/// ---------------------------
/// @notice Main external swap function
/// @param params all parameters for this swap
/// @return amountOut output amount from this swap
function swap(
FraxswapParams memory params
) external payable nonReentrant checkDeadline(params.deadline) returns (uint256 amountOut) {
if (params.recipient == address(0)) params.recipient = msg.sender;
FraxswapRoute memory route = abi.decode(params.route, (FraxswapRoute));
route.tokenOut = params.tokenIn;
route.amountOut = params.amountIn;
FraxswapRoute memory firstRoute = abi.decode(route.nextHops[0], (FraxswapRoute));
if (params.tokenIn == address(0)) {
// ETH sent in via msg.value
require(msg.value == params.amountIn, "FSR:II"); // Insufficient input ETH
} else if (params.tokenIn == address(WETH9) && msg.value > 0) {
// ETH sent in via msg.value
require(msg.value == params.amountIn, "FSR:II"); // Insufficient input ETH
WETH9.deposit{ value: msg.value }();
} else {
require(msg.value == 0, "FSR:IE"); // ETH transfer that is not used, prevent mistakes
if (params.v != 0) {
// use permit instead of approval
uint256 amount = params.approveMax ? type(uint256).max : params.amountIn;
IERC20Permit(params.tokenIn).permit(
msg.sender,
address(this),
amount,
params.deadline,
params.v,
params.r,
params.s
);
}
address targetPool = address(this);
if (firstRoute.steps.length > 0) {
FraxswapStepData memory step = abi.decode(firstRoute.steps[0], (FraxswapStepData));
if (step.directFundThisPool == 1) targetPool = step.pool;
}
// Pull tokens into the Router Contract
TransferHelper.safeTransferFrom(params.tokenIn, msg.sender, targetPool, params.amountIn);
}
bool outputETH = params.tokenOut == address(0); // save gas
uint256 initialBalance;
if (!CHECK_AMOUNTOUT_IN_ROUTER) {
initialBalance = outputETH ? params.recipient.balance : IERC20(params.tokenOut).balanceOf(params.recipient);
}
for (uint256 i; i < route.nextHops.length; ++i) {
FraxswapRoute memory nextRoute = i == 0 ? firstRoute : abi.decode(route.nextHops[i], (FraxswapRoute));
executeAllHops(route, nextRoute, params.recipient);
}
amountOut = outputETH ? address(this).balance : IERC20(params.tokenOut).balanceOf(address(this));
if (outputETH && amountOut == 0) {
amountOut = IERC20(address(WETH9)).balanceOf(address(this));
if (amountOut > 0) WETH9.withdraw(amountOut);
}
if (amountOut > 0) {
if (outputETH) {
// sending ETH
(bool success, ) = payable(params.recipient).call{ value: amountOut }("");
require(success, "FSR:Invalid transfer");
} else {
TransferHelper.safeTransfer(params.tokenOut, params.recipient, amountOut);
}
}
if (!CHECK_AMOUNTOUT_IN_ROUTER) {
amountOut = outputETH
? params.recipient.balance
: IERC20(params.tokenOut).balanceOf(params.recipient) - initialBalance;
}
// Check output amounts (IMPORTANT CHECK)
require(amountOut >= params.amountOutMinimum, "FSR:IO"); // Insufficient output
emit Routed(params.tokenIn, params.tokenOut, params.amountIn, amountOut);
}
/// @notice Uniswap V3 callback function
function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes calldata _data) external {
require(amount0Delta > 0 || amount1Delta > 0);
SwapCallbackData memory data = abi.decode(_data, (SwapCallbackData));
if (!data.directFundThisPool) {
// it isn't directly funded we pay from the router address
TransferHelper.safeTransfer(
data.tokenIn,
msg.sender,
uint256(amount0Delta > 0 ? amount0Delta : amount1Delta)
);
}
}
/// ---------------------------
/// --------- Internal --------
/// ---------------------------
/// @notice Function that will execute a particular swap step
/// @param prevRoute previous hop of the route
/// @param route current hop of the route
/// @param step swap to execute
/// @return amountOut actual output from this swap step
function executeSwap(
FraxswapRoute memory prevRoute,
FraxswapRoute memory route,
FraxswapStepData memory step,
address recipient
) internal returns (uint256 amountOut) {
uint256 amountIn = getAmountForPct(step.percentOfHop, route.percentOfHop, prevRoute.amountOut);
if (step.swapType < 2) {
// Fraxswap/Uni v2
bool zeroForOne = (step.extraParam2 == 0 && prevRoute.tokenOut < step.tokenOut) || step.extraParam2 == 1;
if (step.swapType == 0) {
// Execute virtual orders for Fraxswap
PoolInterface(step.pool).executeVirtualOrders(block.timestamp);
}
if (step.extraParam1 == 1) {
// Fraxswap V2 has getAmountOut in the pair (different fees)
amountOut = PoolInterface(step.pool).getAmountOut(amountIn, prevRoute.tokenOut);
} else {
// use the reserves and helper function for Uniswap V2 and Fraxswap V1
(uint112 reserve0, uint112 reserve1, ) = IUniswapV2Pair(step.pool).getReserves();
amountOut = getAmountOut(amountIn, zeroForOne ? reserve0 : reserve1, zeroForOne ? reserve1 : reserve0);
}
if (step.directFundThisPool == 0) {
// this pool is funded by router
TransferHelper.safeTransfer(prevRoute.tokenOut, step.pool, amountIn);
}
IUniswapV2Pair(step.pool).swap(
zeroForOne ? 0 : amountOut,
zeroForOne ? amountOut : 0,
step.directFundNextPool == 1 ? getNextDirectFundingPool(route, recipient) : address(this),
new bytes(0)
);
} else if (step.swapType == 2) {
// Uni v3
bool zeroForOne = (step.extraParam2 == 0 && prevRoute.tokenOut < step.tokenOut) || step.extraParam2 == 1;
bytes memory callBackData = abi.encode(
SwapCallbackData({ tokenIn: prevRoute.tokenOut, directFundThisPool: step.directFundThisPool == 1 })
);
(int256 amount0, int256 amount1) = IUniswapV3Pool(step.pool).swap(
step.directFundNextPool == 1 ? getNextDirectFundingPool(route, recipient) : address(this),
zeroForOne,
amountIn.toInt256(),
zeroForOne ? 4_295_128_740 : 1_461_446_703_485_210_103_287_273_052_203_988_822_378_723_970_341, // Do not fail because of price
callBackData
);
amountOut = uint256(zeroForOne ? -amount1 : -amount0);
} else if (step.swapType == 3) {
// Curve exchange V2
TransferHelper.safeApprove(prevRoute.tokenOut, step.pool, amountIn);
PoolInterface(step.pool).exchange(step.extraParam1, step.extraParam2, amountIn, 0);
amountOut = IERC20(step.tokenOut).balanceOf(address(this));
} else if (step.swapType == 4) {
// Curve exchange, with returns (no ETH)
TransferHelper.safeApprove(prevRoute.tokenOut, step.pool, amountIn);
amountOut = PoolInterface(step.pool).exchange(
int128(int256(step.extraParam1)),
int128(int256(step.extraParam2)),
amountIn,
0
);
} else if (step.swapType == 5) {
// Curve exchange_underlying
TransferHelper.safeApprove(prevRoute.tokenOut, step.pool, amountIn);
amountOut = PoolInterface(step.pool).exchange_underlying(
int128(int256(step.extraParam1)),
int128(int256(step.extraParam2)),
amountIn,
0
);
} else if (step.swapType == 6) {
// Saddle
TransferHelper.safeApprove(prevRoute.tokenOut, step.pool, amountIn);
amountOut = PoolInterface(step.pool).swap(
uint8(step.extraParam1),
uint8(step.extraParam2),
amountIn,
0,
block.timestamp
);
} else if (step.swapType == 7) {
// FPIController
TransferHelper.safeApprove(prevRoute.tokenOut, step.pool, amountIn);
if (prevRoute.tokenOut == FRAX) {
amountOut = PoolInterface(step.pool).mintFPI(amountIn, 0);
} else {
amountOut = PoolInterface(step.pool).redeemFPI(amountIn, 0);
}
} else if (step.swapType == 8) {
// ERC4626/Fraxlend deposit
TransferHelper.safeApprove(prevRoute.tokenOut, step.pool, amountIn);
amountOut = PoolInterface(step.pool).deposit(
amountIn,
step.directFundNextPool == 1 ? getNextDirectFundingPool(route, recipient) : address(this)
);
} else if (step.swapType == 9) {
// FrxETHMinter
if (step.extraParam1 == 0 && prevRoute.tokenOut == address(WETH9)) {
// Unwrap WETH
WETH9.withdraw(amountIn);
}
PoolInterface(step.pool).submitAndGive{ value: amountIn }(
step.directFundNextPool == 1 ? getNextDirectFundingPool(route, recipient) : address(this)
);
amountOut = amountIn; // exchange 1 for 1
} else if (step.swapType == 10) {
// WETH
if (prevRoute.tokenOut == address(WETH9)) {
// Unwrap WETH
WETH9.withdraw(amountIn);
} else {
// Wrap the ETH
WETH9.deposit{ value: amountIn }();
}
amountOut = amountIn; // exchange 1 for 1
} else if (step.swapType == 11) {
// Curve exchange, with returns and ETH
uint256 value = 0;
if (prevRoute.tokenOut == address(WETH9)) {
// WETH send as ETH
WETH9.withdraw(amountIn);
value = amountIn;
} else if (prevRoute.tokenOut == address(0)) {
value = amountIn;
} else {
TransferHelper.safeApprove(prevRoute.tokenOut, step.pool, amountIn);
}
amountOut = PoolInterface(step.pool).exchange{ value: value }(
int128(int256(step.extraParam1)),
int128(int256(step.extraParam2)),
amountIn,
0
);
if (route.tokenOut == address(WETH9)) {
// Wrap the received ETH as WETH
WETH9.deposit{ value: amountOut }();
}
} else if (step.swapType == 12) {
// Curve exchange_received (NG)
if (step.directFundThisPool == 0) {
// this pool is funded by router
TransferHelper.safeTransfer(prevRoute.tokenOut, step.pool, amountIn);
}
amountOut = PoolInterface(step.pool).exchange_received(
int128(int256(step.extraParam1)),
int128(int256(step.extraParam2)),
amountIn,
0,
step.directFundNextPool == 1 ? getNextDirectFundingPool(route, recipient) : address(this)
);
} else if (step.swapType == 13) {
// Redeem ERC4626
amountOut = PoolInterface(step.pool).redeem(
amountIn,
step.directFundNextPool == 1 ? getNextDirectFundingPool(route, recipient) : address(this),
address(this)
);
} else if (step.swapType == 14) {
// Curve exchange, with returns + receiver (no ETH)
TransferHelper.safeApprove(prevRoute.tokenOut, step.pool, amountIn);
amountOut = PoolInterface(step.pool).exchange(
int128(int256(step.extraParam1)),
int128(int256(step.extraParam2)),
amountIn,
0,
step.directFundNextPool == 1 ? getNextDirectFundingPool(route, recipient) : address(this)
);
} else if (step.swapType == 255) {
// Plugin
address plugin = address(uint160(step.extraParam1));
if (step.directFundThisPool == 0) TransferHelper.safeApprove(prevRoute.tokenOut, plugin, amountIn);
amountOut = IPluginSwaptype(plugin).swap(
prevRoute.tokenOut,
step.tokenOut,
amountIn,
step.pool,
step.directFundThisPool,
step.directFundNextPool == 1 ? getNextDirectFundingPool(route, recipient) : address(this),
step.extraParam2
);
}
}
/// @notice Function that will loop through and execute swap steps
/// @param prevRoute previous hop of the route
/// @param route current hop of the route
function executeAllStepsForRoute(
FraxswapRoute memory prevRoute,
FraxswapRoute memory route,
address recipient
) internal {
for (uint256 j; j < route.steps.length; ++j) {
FraxswapStepData memory step = abi.decode(route.steps[j], (FraxswapStepData));
route.amountOut += executeSwap(
prevRoute,
route,
step,
j == route.steps.length - 1 ? recipient : address(0)
);
}
}
/// @notice Function that will loop through and execute route hops and execute all steps for each hop
/// @param prevRoute previous hop of the route
/// @param route current hop of the route
function executeAllHops(FraxswapRoute memory prevRoute, FraxswapRoute memory route, address recipient) internal {
executeAllStepsForRoute(prevRoute, route, route.nextHops.length == 0 ? recipient : address(0));
for (uint256 i; i < route.nextHops.length; ++i) {
FraxswapRoute memory nextRoute = abi.decode(route.nextHops[i], (FraxswapRoute));
executeAllHops(route, nextRoute, recipient);
}
}
/// ---------------------------
/// ------ Views / Pure -------
/// ---------------------------
/// @notice Utility function to build an encoded hop of route
/// @param tokenOut output token address
/// @param percentOfHop amount of output tokens from the previous hop going into this hop
/// @param steps list of swaps from the same input token to the same output token
/// @param nextHops next hops from this one, the next hops' input token is the tokenOut
/// @return out encoded FraxswapRoute
function encodeRoute(
address tokenOut,
uint256 percentOfHop,
bytes[] memory steps,
bytes[] memory nextHops
) external pure returns (bytes memory out) {
FraxswapRoute memory route;
route.tokenOut = tokenOut;
route.amountOut = 0;
route.percentOfHop = percentOfHop;
route.steps = steps;
route.nextHops = nextHops;
out = abi.encode(route);
}
/// @notice Utility function to build an encoded step
/// @param swapType type of the swap performed (Uniswap V2, Fraxswap,Curve, etc)
/// @param directFundNextPool 0 = funds go via router, 1 = fund are sent directly to pool
/// @param directFundThisPool 0 = funds go via router, 1 = fund are sent directly to pool
/// @param tokenOut the target token of the step. output token address
/// @param pool address of the pool to use in the step
/// @param extraParam1 extra data used in the step
/// @param extraParam2 extra data used in the step
/// @param percentOfHop percentage of all of the steps in this route (hop)
/// @return out encoded FraxswapStepData
function encodeStep(
uint8 swapType,
uint8 directFundNextPool,
uint8 directFundThisPool,
address tokenOut,
address pool,
uint256 extraParam1,
uint256 extraParam2,
uint256 percentOfHop
) external pure returns (bytes memory out) {
FraxswapStepData memory step;
step.swapType = swapType;
step.directFundNextPool = directFundNextPool;
step.directFundThisPool = directFundThisPool;
step.tokenOut = tokenOut;
step.pool = pool;
step.extraParam1 = extraParam1;
step.extraParam2 = extraParam2;
step.percentOfHop = percentOfHop;
out = abi.encode(step);
}
/// @notice Utility function to calculate the amount given the percentage of hop and route 10000 = 100%
/// @return amountOut amount of input token
function getAmountForPct(
uint256 pctOfHop1,
uint256 pctOfHop2,
uint256 amountIn
) internal pure returns (uint256 amountOut) {
return (pctOfHop1 * pctOfHop2 * amountIn) / 100_000_000;
}
/// @notice Utility function to get the next pool to directly fund
/// @return nextPoolAddress address of the next pool
function getNextDirectFundingPool(
FraxswapRoute memory route,
address recipient
) internal pure returns (address nextPoolAddress) {
if (recipient != address(0)) return recipient;
require(route.steps.length == 1 && route.nextHops.length == 1, "FSR: DFRoutes"); // directFunding
FraxswapRoute memory nextRoute = abi.decode(route.nextHops[0], (FraxswapRoute));
require(nextRoute.steps.length == 1, "FSR: DFSteps"); // directFunding
FraxswapStepData memory nextStep = abi.decode(nextRoute.steps[0], (FraxswapStepData));
return nextStep.pool; // pool to send funds to
}
/// @notice given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
/// @return amountOut constant product curve expected output amount
function getAmountOut(
uint256 amountIn,
uint256 reserveIn,
uint256 reserveOut
) internal pure returns (uint256 amountOut) {
require(amountIn > 0, "UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT");
require(reserveIn > 0 && reserveOut > 0, "UniswapV2Library: INSUFFICIENT_LIQUIDITY");
uint256 amountInWithFee = amountIn * 997;
uint256 numerator = amountInWithFee * reserveOut;
uint256 denominator = reserveIn * 1000 + amountInWithFee;
amountOut = numerator / denominator;
}
/// ---------------------------
/// --------- Structs ---------
/// ---------------------------
/// @notice Input to the swap function
/// @dev contains the top level info for the swap
/// @param tokenIn input token address
/// @param amountIn input token amount
/// @param tokenOut output token address
/// @param amountOutMinimum output token minimum amount (reverts if lower)
/// @param recipient recipient of the output token
/// @param deadline deadline for this swap transaction (reverts if exceeded)
/// @param v v value for permit signature if supported
/// @param r r value for permit signature if supported
/// @param s s value for permit signature if supported
/// @param route byte encoded
struct FraxswapParams {
address tokenIn;
uint256 amountIn;
address tokenOut;
uint256 amountOutMinimum;
address recipient;
uint256 deadline;
bool approveMax;
uint8 v;
bytes32 r;
bytes32 s;
bytes route;
}
/// @notice A hop along the swap route
/// @dev a series of swaps (steps) containing the same input token and output token
/// @param tokenOut output token address
/// @param amountOut output token amount
/// @param percentOfHop amount of output tokens from the previous hop going into this hop
/// @param steps list of swaps from the same input token to the same output token
/// @param nextHops next hops from this one, the next hops' input token is the tokenOut
struct FraxswapRoute {
address tokenOut;
uint256 amountOut;
uint256 percentOfHop;
bytes[] steps;
bytes[] nextHops;
}
/// @notice A swap step in a specific route. routes can have multiple swap steps
/// @dev a single swap to a token from the token of the previous hop in the route
/// @param swapType type of the swap performed (Uniswap V2, Fraxswap,Curve, etc)
/// @param directFundNextPool 0 = funds go via router, 1 = fund are sent directly to pool
/// @param directFundThisPool 0 = funds go via router, 1 = fund are sent directly to pool
/// @param tokenOut the target token of the step. output token address
/// @param pool address of the pool to use in the step
/// @param extraParam1 extra data used in the step
/// @param extraParam2 extra data used in the step
/// @param percentOfHop percentage of all of the steps in this route (hop)
struct FraxswapStepData {
uint8 swapType;
uint8 directFundNextPool;
uint8 directFundThisPool;
address tokenOut;
address pool;
uint256 extraParam1;
uint256 extraParam2;
uint256 percentOfHop;
}
/// @notice struct for Uniswap V3 callback
/// @param tokenIn address of input token
/// @param directFundThisPool this pool already been funded
struct SwapCallbackData {
address tokenIn;
bool directFundThisPool;
}
/// ---------------------------
/// --------- Events ----------
/// ---------------------------
/// @notice Routing event emitted every swap
/// @param tokenIn address of the original input token
/// @param tokenOut address of the final output token
/// @param amountIn input amount for original input token
/// @param amountOut output amount for the final output token
event Routed(address tokenIn, address tokenOut, uint256 amountIn, uint256 amountOut);
}
// Interface for ERC20 Permit
interface IERC20Permit is IERC20 {
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
}
interface IPluginSwaptype {
function swap(
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
address _pool,
uint8 _directFundThisPool,
address _receiver,
uint256 _extraParam2
) external returns (uint256 _amountOut);
}
// Interface used to call pool specific functions
interface PoolInterface {
// Fraxswap
function executeVirtualOrders(uint256 blockNumber) external;
function getAmountOut(uint256 amountIn, address tokenIn) external view returns (uint256);
// Fraxlend
function deposit(uint256 userId, address userAddress) external returns (uint256 _sharesReceived);
// FrxETHMinter
function submitAndGive(address recipient) external payable;
// Curve
function exchange(uint256 i, uint256 j, uint256 dx, uint256 min_dy) external;
function exchange(int128 i, int128 j, uint256 dx, uint256 min_dy) external payable returns (uint256);
function exchange(
int128 i,
int128 j,
uint256 dx,
uint256 min_dy,
address receiver
) external payable returns (uint256);
function exchange_underlying(int128 i, int128 j, uint256 dx, uint256 min_dy) external returns (uint256);
function exchange_received(
int128 i,
int128 j,
uint256 dx,
uint256 min_dy,
address receiver
) external returns (uint256);
// Saddle
function swap(
uint8 tokenIndexFrom,
uint8 tokenIndexTo,
uint256 dx,
uint256 minDy,
uint256 deadline
) external returns (uint256);
//FPI Mint/Redeem
function mintFPI(uint256 frax_in, uint256 min_fpi_out) external returns (uint256 fpi_out);
function redeemFPI(uint256 fpi_in, uint256 min_frax_out) external returns (uint256 frax_out);
// ERC4626 redeem
function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);
// generic swap wrapper
function swap(
address tokenIn,
address tokenOut,
uint256 amountIn,
address target
) external returns (uint256 amountOut);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @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 value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Safe casting methods
/// @notice Contains methods for safely casting between types
library SafeCast {
/// @notice Cast a uint256 to a uint160, revert on overflow
/// @param y The uint256 to be downcasted
/// @return z The downcasted integer, now type uint160
function toUint160(uint256 y) internal pure returns (uint160 z) {
require((z = uint160(y)) == y);
}
/// @notice Cast a int256 to a int128, revert on overflow or underflow
/// @param y The int256 to be downcasted
/// @return z The downcasted integer, now type int128
function toInt128(int256 y) internal pure returns (int128 z) {
require((z = int128(y)) == y);
}
/// @notice Cast a uint256 to a int256, revert on overflow
/// @param y The uint256 to be casted
/// @return z The casted integer, now type int256
function toInt256(uint256 y) internal pure returns (int256 z) {
require(y < 2**255);
z = int256(y);
}
}pragma solidity >=0.5.0;
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function withdraw(uint) external;
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.0;
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
library TransferHelper {
/// @notice Transfers tokens from the targeted address to the given destination
/// @notice Errors with 'STF' if transfer fails
/// @param token The contract address of the token to be transferred
/// @param from The originating address from which the tokens will be transferred
/// @param to The destination address of the transfer
/// @param value The amount to be transferred
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
(bool success, bytes memory data) =
token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'STF');
}
/// @notice Transfers tokens from msg.sender to a recipient
/// @dev Errors with ST if transfer fails
/// @param token The contract address of the token which will be transferred
/// @param to The recipient of the transfer
/// @param value The value of the transfer
function safeTransfer(
address token,
address to,
uint256 value
) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST');
}
/// @notice Approves the stipulated contract to spend the given allowance in the given token
/// @dev Errors with 'SA' if transfer fails
/// @param token The contract address of the token to be approved
/// @param to The target of the approval
/// @param value The amount of the given token the target will be allowed to spend
function safeApprove(
address token,
address to,
uint256 value
) internal {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'SA');
}
/// @notice Transfers ETH to the recipient address
/// @dev Fails with `STE`
/// @param to The destination of the transfer
/// @param value The value to be transferred
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{value: value}(new bytes(0));
require(success, 'STE');
}
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Callback for IUniswapV3PoolActions#swap
/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface
interface IUniswapV3SwapCallback {
/// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.
/// @dev In the implementation you must pay the pool tokens owed for the swap.
/// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
/// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.
/// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
/// the end of the swap. If positive, the callback must send that amount of token0 to the pool.
/// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
/// the end of the swap. If positive, the callback must send that amount of token1 to the pool.
/// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call
function uniswapV3SwapCallback(
int256 amount0Delta,
int256 amount1Delta,
bytes calldata data
) external;
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
import './pool/IUniswapV3PoolImmutables.sol';
import './pool/IUniswapV3PoolState.sol';
import './pool/IUniswapV3PoolDerivedState.sol';
import './pool/IUniswapV3PoolActions.sol';
import './pool/IUniswapV3PoolOwnerActions.sol';
import './pool/IUniswapV3PoolEvents.sol';
/// @title The interface for a Uniswap V3 Pool
/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform
/// to the ERC20 specification
/// @dev The pool interface is broken up into many smaller pieces
interface IUniswapV3Pool is
IUniswapV3PoolImmutables,
IUniswapV3PoolState,
IUniswapV3PoolDerivedState,
IUniswapV3PoolActions,
IUniswapV3PoolOwnerActions,
IUniswapV3PoolEvents
{
}pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}// 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);
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @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
/// 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.
/// observationIndex The index of the last oracle observation that was written,
/// observationCardinality The current maximum number of observations stored in the pool,
/// observationCardinalityNext The next maximum number of observations, to be updated when the observation.
/// 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
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,
/// liquidityNet how much 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,
/// 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,
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,
/// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,
/// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,
/// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,
/// Returns 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,
/// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,
/// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,
/// Returns 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
);
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Pool state that is not stored
/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the
/// blockchain. The functions here may have variable gas costs.
interface IUniswapV3PoolDerivedState {
/// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp
/// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing
/// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,
/// you must call it with secondsAgos = [3600, 0].
/// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in
/// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.
/// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned
/// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp
/// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block
/// timestamp
function observe(uint32[] calldata secondsAgos)
external
view
returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);
/// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range
/// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.
/// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first
/// snapshot is taken and the second snapshot is taken.
/// @param tickLower The lower tick of the range
/// @param tickUpper The upper tick of the range
/// @return tickCumulativeInside The snapshot of the tick accumulator for the range
/// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range
/// @return secondsInside The snapshot of seconds per liquidity for the range
function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
external
view
returns (
int56 tickCumulativeInside,
uint160 secondsPerLiquidityInsideX128,
uint32 secondsInside
);
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Permissionless pool actions
/// @notice Contains pool methods that can be called by anyone
interface IUniswapV3PoolActions {
/// @notice Sets the initial price for the pool
/// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value
/// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96
function initialize(uint160 sqrtPriceX96) external;
/// @notice Adds liquidity for the given recipient/tickLower/tickUpper position
/// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback
/// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends
/// on tickLower, tickUpper, the amount of liquidity, and the current price.
/// @param recipient The address for which the liquidity will be created
/// @param tickLower The lower tick of the position in which to add liquidity
/// @param tickUpper The upper tick of the position in which to add liquidity
/// @param amount The amount of liquidity to mint
/// @param data Any data that should be passed through to the callback
/// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback
/// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback
function mint(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount,
bytes calldata data
) external returns (uint256 amount0, uint256 amount1);
/// @notice Collects tokens owed to a position
/// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.
/// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or
/// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the
/// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.
/// @param recipient The address which should receive the fees collected
/// @param tickLower The lower tick of the position for which to collect fees
/// @param tickUpper The upper tick of the position for which to collect fees
/// @param amount0Requested How much token0 should be withdrawn from the fees owed
/// @param amount1Requested How much token1 should be withdrawn from the fees owed
/// @return amount0 The amount of fees collected in token0
/// @return amount1 The amount of fees collected in token1
function collect(
address recipient,
int24 tickLower,
int24 tickUpper,
uint128 amount0Requested,
uint128 amount1Requested
) external returns (uint128 amount0, uint128 amount1);
/// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position
/// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0
/// @dev Fees must be collected separately via a call to #collect
/// @param tickLower The lower tick of the position for which to burn liquidity
/// @param tickUpper The upper tick of the position for which to burn liquidity
/// @param amount How much liquidity to burn
/// @return amount0 The amount of token0 sent to the recipient
/// @return amount1 The amount of token1 sent to the recipient
function burn(
int24 tickLower,
int24 tickUpper,
uint128 amount
) external returns (uint256 amount0, uint256 amount1);
/// @notice Swap token0 for token1, or token1 for token0
/// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback
/// @param recipient The address to receive the output of the swap
/// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0
/// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
/// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this
/// value after the swap. If one for zero, the price cannot be greater than this value after the swap
/// @param data Any data to be passed through to the callback
/// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive
/// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive
function swap(
address recipient,
bool zeroForOne,
int256 amountSpecified,
uint160 sqrtPriceLimitX96,
bytes calldata data
) external returns (int256 amount0, int256 amount1);
/// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback
/// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback
/// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling
/// with 0 amount{0,1} and sending the donation amount(s) from the callback
/// @param recipient The address which will receive the token0 and token1 amounts
/// @param amount0 The amount of token0 to send
/// @param amount1 The amount of token1 to send
/// @param data Any data to be passed through to the callback
function flash(
address recipient,
uint256 amount0,
uint256 amount1,
bytes calldata data
) external;
/// @notice Increase the maximum number of price and liquidity observations that this pool will store
/// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to
/// the input observationCardinalityNext.
/// @param observationCardinalityNext The desired minimum number of observations for the pool to store
function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Permissioned pool actions
/// @notice Contains pool methods that may only be called by the factory owner
interface IUniswapV3PoolOwnerActions {
/// @notice Set the denominator of the protocol's % share of the fees
/// @param feeProtocol0 new protocol fee for token0 of the pool
/// @param feeProtocol1 new protocol fee for token1 of the pool
function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;
/// @notice Collect the protocol fee accrued to the pool
/// @param recipient The address to which collected protocol fees should be sent
/// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1
/// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0
/// @return amount0 The protocol fee collected in token0
/// @return amount1 The protocol fee collected in token1
function collectProtocol(
address recipient,
uint128 amount0Requested,
uint128 amount1Requested
) external returns (uint128 amount0, uint128 amount1);
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Events emitted by a pool
/// @notice Contains all events emitted by the pool
interface IUniswapV3PoolEvents {
/// @notice Emitted exactly once by a pool when #initialize is first called on the pool
/// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize
/// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96
/// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool
event Initialize(uint160 sqrtPriceX96, int24 tick);
/// @notice Emitted when liquidity is minted for a given position
/// @param sender The address that minted the liquidity
/// @param owner The owner of the position and recipient of any minted liquidity
/// @param tickLower The lower tick of the position
/// @param tickUpper The upper tick of the position
/// @param amount The amount of liquidity minted to the position range
/// @param amount0 How much token0 was required for the minted liquidity
/// @param amount1 How much token1 was required for the minted liquidity
event Mint(
address sender,
address indexed owner,
int24 indexed tickLower,
int24 indexed tickUpper,
uint128 amount,
uint256 amount0,
uint256 amount1
);
/// @notice Emitted when fees are collected by the owner of a position
/// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees
/// @param owner The owner of the position for which fees are collected
/// @param tickLower The lower tick of the position
/// @param tickUpper The upper tick of the position
/// @param amount0 The amount of token0 fees collected
/// @param amount1 The amount of token1 fees collected
event Collect(
address indexed owner,
address recipient,
int24 indexed tickLower,
int24 indexed tickUpper,
uint128 amount0,
uint128 amount1
);
/// @notice Emitted when a position's liquidity is removed
/// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect
/// @param owner The owner of the position for which liquidity is removed
/// @param tickLower The lower tick of the position
/// @param tickUpper The upper tick of the position
/// @param amount The amount of liquidity to remove
/// @param amount0 The amount of token0 withdrawn
/// @param amount1 The amount of token1 withdrawn
event Burn(
address indexed owner,
int24 indexed tickLower,
int24 indexed tickUpper,
uint128 amount,
uint256 amount0,
uint256 amount1
);
/// @notice Emitted by the pool for any swaps between token0 and token1
/// @param sender The address that initiated the swap call, and that received the callback
/// @param recipient The address that received the output of the swap
/// @param amount0 The delta of the token0 balance of the pool
/// @param amount1 The delta of the token1 balance of the pool
/// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96
/// @param liquidity The liquidity of the pool after the swap
/// @param tick The log base 1.0001 of price of the pool after the swap
event Swap(
address indexed sender,
address indexed recipient,
int256 amount0,
int256 amount1,
uint160 sqrtPriceX96,
uint128 liquidity,
int24 tick
);
/// @notice Emitted by the pool for any flashes of token0/token1
/// @param sender The address that initiated the swap call, and that received the callback
/// @param recipient The address that received the tokens from flash
/// @param amount0 The amount of token0 that was flashed
/// @param amount1 The amount of token1 that was flashed
/// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee
/// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee
event Flash(
address indexed sender,
address indexed recipient,
uint256 amount0,
uint256 amount1,
uint256 paid0,
uint256 paid1
);
/// @notice Emitted by the pool for increases to the number of observations that can be stored
/// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index
/// just before a mint/swap/burn.
/// @param observationCardinalityNextOld The previous value of the next observation cardinality
/// @param observationCardinalityNextNew The updated value of the next observation cardinality
event IncreaseObservationCardinalityNext(
uint16 observationCardinalityNextOld,
uint16 observationCardinalityNextNew
);
/// @notice Emitted when the protocol fee is changed by the pool
/// @param feeProtocol0Old The previous value of the token0 protocol fee
/// @param feeProtocol1Old The previous value of the token1 protocol fee
/// @param feeProtocol0New The updated value of the token0 protocol fee
/// @param feeProtocol1New The updated value of the token1 protocol fee
event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);
/// @notice Emitted when the collected protocol fees are withdrawn by the factory owner
/// @param sender The address that collects the protocol fees
/// @param recipient The address that receives the collected protocol fees
/// @param amount0 The amount of token0 protocol fees that is withdrawn
/// @param amount0 The amount of token1 protocol fees that is withdrawn
event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);
}{
"remappings": [
"frax-std/=node_modules/frax-standard-solidity/src/",
"@prb/test/=node_modules/@prb/test/",
"forge-std/=node_modules/forge-std/src/",
"ds-test/=node_modules/ds-test/src/",
"@uniswap/v2-core/=lib/v2-core/",
"@uniswap/v2-periphery/=lib/v2-periphery/",
"@uniswap/v3-core/=lib/v3-core/",
"@uniswap/v3-periphery/=lib/v3-periphery/",
"@chainlink/=node_modules/@chainlink/",
"@eth-optimism/=node_modules/@eth-optimism/",
"@openzeppelin/=node_modules/@openzeppelin/",
"frax-standard-solidity/=node_modules/frax-standard-solidity/",
"solidity-bytes-utils/=node_modules/solidity-bytes-utils/",
"v2-core/=lib/v2-core/contracts/",
"v2-periphery/=lib/v2-periphery/contracts/",
"v3-core/=lib/v3-core/",
"v3-periphery/=lib/v3-periphery/contracts/"
],
"optimizer": {
"enabled": false,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "none",
"appendCBOR": false
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IWETH","name":"_WETH9","type":"address"},{"internalType":"address","name":"_FRAX","type":"address"},{"internalType":"bool","name":"_CHECK_AMOUNTOUT_IN_ROUTER","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":false,"internalType":"address","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountOut","type":"uint256"}],"name":"Routed","type":"event"},{"inputs":[],"name":"CHECK_AMOUNTOUT_IN_ROUTER","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FRAX","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH9","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"percentOfHop","type":"uint256"},{"internalType":"bytes[]","name":"steps","type":"bytes[]"},{"internalType":"bytes[]","name":"nextHops","type":"bytes[]"}],"name":"encodeRoute","outputs":[{"internalType":"bytes","name":"out","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint8","name":"swapType","type":"uint8"},{"internalType":"uint8","name":"directFundNextPool","type":"uint8"},{"internalType":"uint8","name":"directFundThisPool","type":"uint8"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint256","name":"extraParam1","type":"uint256"},{"internalType":"uint256","name":"extraParam2","type":"uint256"},{"internalType":"uint256","name":"percentOfHop","type":"uint256"}],"name":"encodeStep","outputs":[{"internalType":"bytes","name":"out","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amountOutMinimum","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"approveMax","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"bytes","name":"route","type":"bytes"}],"internalType":"struct FraxswapRouterMultihop.FraxswapParams","name":"params","type":"tuple"}],"name":"swap","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"int256","name":"amount0Delta","type":"int256"},{"internalType":"int256","name":"amount1Delta","type":"int256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"uniswapV3SwapCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60e060405234801561001057600080fd5b50604051614ba0380380614ba08339818101604052810190610032919061018f565b60016000819055508273ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508173ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff168152505080151560c0811515815250505050506101e2565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100e6826100bb565b9050919050565b60006100f8826100db565b9050919050565b610108816100ed565b811461011357600080fd5b50565b600081519050610125816100ff565b92915050565b610134816100db565b811461013f57600080fd5b50565b6000815190506101518161012b565b92915050565b60008115159050919050565b61016c81610157565b811461017757600080fd5b50565b60008151905061018981610163565b92915050565b6000806000606084860312156101a8576101a76100b6565b5b60006101b686828701610116565b93505060206101c786828701610142565b92505060406101d88682870161017a565b9150509250925092565b60805160a05160c05161491f6102816000396000818161089001528181610c7b0152610df90152600081816102f70152611b500152600081816102d3015281816105930152818161063d01528181610a6f01528181610b1401528181611da401528181611dfd01528181611f2f01528181611f8601528181612016015281816120b1015281816121080152818161228201526122d9015261491f6000f3fe6080604052600436106100745760003560e01c8063b60650d71161004e578063b60650d714610113578063d2c9041114610150578063dcd6c4d514610180578063fa461e33146101ab5761007b565b80634a264940146100805780634aa4a4fc146100bd578063b0e4556f146100e85761007b565b3661007b57005b600080fd5b34801561008c57600080fd5b506100a760048036038101906100a29190612c89565b6101d4565b6040516100b49190612dcf565b60405180910390f35b3480156100c957600080fd5b506100d26102d1565b6040516100df9190612e50565b60405180910390f35b3480156100f457600080fd5b506100fd6102f5565b60405161010a9190612e7a565b60405180910390f35b34801561011f57600080fd5b5061013a600480360381019061013591906130b0565b610319565b6040516101479190612dcf565b60405180910390f35b61016a600480360381019061016591906132ef565b6103ad565b6040516101779190613347565b60405180910390f35b34801561018c57600080fd5b50610195610df7565b6040516101a29190613371565b60405180910390f35b3480156101b757600080fd5b506101d260048036038101906101cd919061341d565b610e1b565b005b60606101de612ae9565b89816000019060ff16908160ff168152505088816020019060ff16908160ff168152505087816040019060ff16908160ff168152505086816060019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505085816080019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050848160a0018181525050838160c0018181525050828160e0018181525050806040516020016102b39190613560565b60405160208183030381529060405291505098975050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b6060610323612b63565b85816000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600081602001818152505084816040018181525050838160600181905250828160800181905250806040516020016103939190613705565b604051602081830303815290604052915050949350505050565b60006103b7610e75565b8160a00151804211156103ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103f690613784565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16836080015173ffffffffffffffffffffffffffffffffffffffff16036104705733836080019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b600083610140015180602001905181019061048b91906139b7565b90508360000151816000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508360200151816020018181525050600081608001516000815181106104f1576104f0613a00565b5b602002602001015180602001905181019061050c91906139b7565b9050600073ffffffffffffffffffffffffffffffffffffffff16856000015173ffffffffffffffffffffffffffffffffffffffff1603610591578460200151341461058c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161058390613a7b565b60405180910390fd5b610855565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16856000015173ffffffffffffffffffffffffffffffffffffffff161480156105f05750600034115b156106c1578460200151341461063b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063290613a7b565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156106a357600080fd5b505af11580156106b7573d6000803e3d6000fd5b5050505050610854565b60003414610704576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106fb90613ae7565b60405180910390fd5b60008560e0015160ff16146107db5760008560c0015161072857856020015161074a565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b9050856000015173ffffffffffffffffffffffffffffffffffffffff1663d505accf3330848a60a001518b60e001518c61010001518d61012001516040518863ffffffff1660e01b81526004016107a79796959493929190613b25565b600060405180830381600087803b1580156107c157600080fd5b505af11580156107d5573d6000803e3d6000fd5b50505050505b60003090506000826060015151111561083e576000826060015160008151811061080857610807613a00565b5b60200260200101518060200190518101906108239190613c73565b90506001816040015160ff160361083c57806080015191505b505b610852866000015133838960200151610ebb565b505b5b60008073ffffffffffffffffffffffffffffffffffffffff16866040015173ffffffffffffffffffffffffffffffffffffffff1614905060007f000000000000000000000000000000000000000000000000000000000000000061095f578161093f57866040015173ffffffffffffffffffffffffffffffffffffffff166370a0823188608001516040518263ffffffff1660e01b81526004016108f99190612e7a565b602060405180830381865afa158015610916573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093a9190613ca1565b61095c565b866080015173ffffffffffffffffffffffffffffffffffffffff16315b90505b60005b8460800151518110156109ce5760008082146109af578560800151828151811061098f5761098e613a00565b5b60200260200101518060200190518101906109aa91906139b7565b6109b1565b845b90506109c286828b60800151611013565b50806001019050610962565b5081610a5757866040015173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a119190612e7a565b602060405180830381865afa158015610a2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a529190613ca1565b610a59565b475b9550818015610a685750600086145b15610b9f577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610ac69190612e7a565b602060405180830381865afa158015610ae3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b079190613ca1565b95506000861115610b9e577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d876040518263ffffffff1660e01b8152600401610b6b9190613347565b600060405180830381600087803b158015610b8557600080fd5b505af1158015610b99573d6000803e3d6000fd5b505050505b5b6000861115610c79578115610c64576000876080015173ffffffffffffffffffffffffffffffffffffffff1687604051610bd890613cff565b60006040518083038185875af1925050503d8060008114610c15576040519150601f19603f3d011682016040523d82523d6000602084013e610c1a565b606091505b5050905080610c5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5590613d60565b60405180910390fd5b50610c78565b610c778760400151886080015188611096565b5b5b7f0000000000000000000000000000000000000000000000000000000000000000610d555781610d355780876040015173ffffffffffffffffffffffffffffffffffffffff166370a0823189608001516040518263ffffffff1660e01b8152600401610ce59190612e7a565b602060405180830381865afa158015610d02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d269190613ca1565b610d309190613daf565b610d52565b866080015173ffffffffffffffffffffffffffffffffffffffff16315b95505b8660600151861015610d9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9390613e2f565b60405180910390fd5b7f95c81fee1a892bf5851845efaa51f1f7941266f2f0da809680e6d37fbd3562b387600001518860400151896020015189604051610ddd9493929190613e4f565b60405180910390a15050505050610df26111eb565b919050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000841380610e2a5750600083135b610e3357600080fd5b60008282810190610e449190613ee4565b90508060200151610e6e57610e6d81600001513360008813610e665786610e68565b875b611096565b5b5050505050565b600260005403610eb1576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600081905550565b6000808573ffffffffffffffffffffffffffffffffffffffff166323b872dd60e01b868686604051602401610ef293929190613f11565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610f5c9190613f79565b6000604051808303816000865af19150503d8060008114610f99576040519150601f19603f3d011682016040523d82523d6000602084013e610f9e565b606091505b5091509150818015610fcc5750600081511480610fcb575080806020019051810190610fca9190613fa5565b5b5b61100b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110029061401e565b60405180910390fd5b505050505050565b611033838360008560800151511461102c57600061102e565b835b6111f5565b60005b8260800151518110156110905760008360800151828151811061105c5761105b613a00565b5b602002602001015180602001905181019061107791906139b7565b9050611084848285611013565b50806001019050611036565b50505050565b6000808473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b85856040516024016110cb92919061403e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516111359190613f79565b6000604051808303816000865af19150503d8060008114611172576040519150601f19603f3d011682016040523d82523d6000602084013e611177565b606091505b50915091508180156111a557506000815114806111a45750808060200190518101906111a39190613fa5565b5b5b6111e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111db906140b3565b60405180910390fd5b5050505050565b6001600081905550565b60005b82606001515181101561128b5760008360600151828151811061121e5761121d613a00565b5b60200260200101518060200190518101906112399190613c73565b905061126785858360018860600151516112539190613daf565b8614611260576000611262565b865b611291565b8460200181815161127891906140d3565b91508181525050508060010190506111f8565b50505050565b6000806112ab8460e00151866040015188602001516126e7565b90506002846000015160ff161015611613576000808560c001511480156113055750846060015173ffffffffffffffffffffffffffffffffffffffff16876000015173ffffffffffffffffffffffffffffffffffffffff16105b80611314575060018560c00151145b90506000856000015160ff160361139557846080015173ffffffffffffffffffffffffffffffffffffffff16632e0ae375426040518263ffffffff1660e01b81526004016113629190613347565b600060405180830381600087803b15801561137c57600080fd5b505af1158015611390573d6000803e3d6000fd5b505050505b60018560a001510361142c57846080015173ffffffffffffffffffffffffffffffffffffffff1663f140a35a8389600001516040518363ffffffff1660e01b81526004016113e4929190614107565b602060405180830381865afa158015611401573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114259190613ca1565b92506114ef565b600080866080015173ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa15801561147e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114a291906141b2565b50915091506114ea84846114b657826114b8565b835b6dffffffffffffffffffffffffffff16856114d357846114d5565b835b6dffffffffffffffffffffffffffff16612718565b945050505b6000856040015160ff1603611512576115118760000151866080015184611096565b5b846080015173ffffffffffffffffffffffffffffffffffffffff1663022c0d9f8261153d5784611540565b60005b8361154c57600061154e565b855b6001896020015160ff1614611563573061156e565b61156d8a89612802565b5b600067ffffffffffffffff81111561158957611588612e9a565b5b6040519080825280601f01601f1916602001820160405280156115bb5781602001600182028036833780820191505090505b506040518563ffffffff1660e01b81526004016115db9493929190614205565b600060405180830381600087803b1580156115f557600080fd5b505af1158015611609573d6000803e3d6000fd5b50505050506126de565b6002846000015160ff16036117dd576000808560c0015114801561166a5750846060015173ffffffffffffffffffffffffffffffffffffffff16876000015173ffffffffffffffffffffffffffffffffffffffff16105b80611679575060018560c00151145b905060006040518060400160405280896000015173ffffffffffffffffffffffffffffffffffffffff1681526020016001886040015160ff161415158152506040516020016116c8919061428f565b6040516020818303038152906040529050600080876080015173ffffffffffffffffffffffffffffffffffffffff1663128acb0860018a6020015160ff1614611711573061171c565b61171b8b8a612802565b5b866117268961295e565b886117455773fffd8963efd1fc6a506488495d951d5263988d2561174c565b6401000276a45b886040518663ffffffff1660e01b815260040161176d9594939291906142c8565b60408051808303816000875af115801561178b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117af9190614337565b91509150836117c757816117c290614377565b6117d2565b806117d190614377565b5b9550505050506126dd565b6003846000015160ff1603611902576117ff8660000151856080015183612994565b836080015173ffffffffffffffffffffffffffffffffffffffff16635b41b9088560a001518660c001518460006040518563ffffffff1660e01b815260040161184b94939291906143fa565b600060405180830381600087803b15801561186557600080fd5b505af1158015611879573d6000803e3d6000fd5b50505050836060015173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016118ba9190612e7a565b602060405180830381865afa1580156118d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118fb9190613ca1565b91506126dc565b6004846000015160ff16036119ba576119248660000151856080015183612994565b836080015173ffffffffffffffffffffffffffffffffffffffff16633df021248560a001518660c001518460006040518563ffffffff1660e01b8152600401611970949392919061445b565b6020604051808303816000875af115801561198f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119b39190613ca1565b91506126db565b6005846000015160ff1603611a72576119dc8660000151856080015183612994565b836080015173ffffffffffffffffffffffffffffffffffffffff1663a6417ed68560a001518660c001518460006040518563ffffffff1660e01b8152600401611a28949392919061445b565b6020604051808303816000875af1158015611a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6b9190613ca1565b91506126da565b6006846000015160ff1603611b2c57611a948660000151856080015183612994565b836080015173ffffffffffffffffffffffffffffffffffffffff1663916955868560a001518660c00151846000426040518663ffffffff1660e01b8152600401611ae29594939291906144a0565b6020604051808303816000875af1158015611b01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b259190613ca1565b91506126d9565b6007846000015160ff1603611cba57611b4e8660000151856080015183612994565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16866000015173ffffffffffffffffffffffffffffffffffffffff1603611c2f57836080015173ffffffffffffffffffffffffffffffffffffffff16634d6f9ef28260006040518363ffffffff1660e01b8152600401611be59291906144f3565b6020604051808303816000875af1158015611c04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c289190613ca1565b9150611cb5565b836080015173ffffffffffffffffffffffffffffffffffffffff1663c5a36df18260006040518363ffffffff1660e01b8152600401611c6f9291906144f3565b6020604051808303816000875af1158015611c8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cb29190613ca1565b91505b6126d8565b6008846000015160ff1603611d8457611cdc8660000151856080015183612994565b836080015173ffffffffffffffffffffffffffffffffffffffff16636e553f65826001876020015160ff1614611d125730611d1d565b611d1c8887612802565b5b6040518363ffffffff1660e01b8152600401611d3a929190614107565b6020604051808303816000875af1158015611d59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7d9190613ca1565b91506126d7565b6009846000015160ff1603611f1e5760008460a00151148015611df657507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16866000015173ffffffffffffffffffffffffffffffffffffffff16145b15611e87577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b8152600401611e549190613347565b600060405180830381600087803b158015611e6e57600080fd5b505af1158015611e82573d6000803e3d6000fd5b505050505b836080015173ffffffffffffffffffffffffffffffffffffffff1663bfda0c8c826001876020015160ff1614611ebd5730611ec8565b611ec78887612802565b5b6040518363ffffffff1660e01b8152600401611ee49190612e7a565b6000604051808303818588803b158015611efd57600080fd5b505af1158015611f11573d6000803e3d6000fd5b50505050508091506126d6565b600a846000015160ff160361209e577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16866000015173ffffffffffffffffffffffffffffffffffffffff1603612014577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b8152600401611fdd9190613347565b600060405180830381600087803b158015611ff757600080fd5b505af115801561200b573d6000803e3d6000fd5b50505050612096565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561207c57600080fd5b505af1158015612090573d6000803e3d6000fd5b50505050505b8091506126d5565b600b846000015160ff160361235f5760007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16876000015173ffffffffffffffffffffffffffffffffffffffff1603612199577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836040518263ffffffff1660e01b815260040161215f9190613347565b600060405180830381600087803b15801561217957600080fd5b505af115801561218d573d6000803e3d6000fd5b505050508190506121ee565b600073ffffffffffffffffffffffffffffffffffffffff16876000015173ffffffffffffffffffffffffffffffffffffffff16036121d9578190506121ed565b6121ec8760000151866080015184612994565b5b5b846080015173ffffffffffffffffffffffffffffffffffffffff16633df02124828760a001518860c001518660006040518663ffffffff1660e01b815260040161223b949392919061445b565b60206040518083038185885af1158015612259573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061227e9190613ca1565b92507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16866000015173ffffffffffffffffffffffffffffffffffffffff1603612359577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b15801561233f57600080fd5b505af1158015612353573d6000803e3d6000fd5b50505050505b506126d4565b600c846000015160ff1603612448576000846040015160ff1603612391576123908660000151856080015183611096565b5b836080015173ffffffffffffffffffffffffffffffffffffffff1663afb430128560a001518660c0015184600060018a6020015160ff16146123d357306123de565b6123dd8b8a612802565b5b6040518663ffffffff1660e01b81526004016123fe95949392919061451c565b6020604051808303816000875af115801561241d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124419190613ca1565b91506126d3565b600d846000015160ff160361250157836080015173ffffffffffffffffffffffffffffffffffffffff1663ba087652826001876020015160ff161461248d5730612498565b6124978887612802565b5b306040518463ffffffff1660e01b81526004016124b79392919061456f565b6020604051808303816000875af11580156124d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124fa9190613ca1565b91506126d2565b600e846000015160ff16036125da576125238660000151856080015183612994565b836080015173ffffffffffffffffffffffffffffffffffffffff1663ddc1f59d8560a001518660c0015184600060018a6020015160ff16146125655730612570565b61256f8b8a612802565b5b6040518663ffffffff1660e01b815260040161259095949392919061451c565b6020604051808303816000875af11580156125af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125d39190613ca1565b91506126d1565b60ff846000015160ff16036126d05760008460a0015190506000856040015160ff16036126115761261087600001518284612994565b5b8073ffffffffffffffffffffffffffffffffffffffff166364074c70886000015187606001518589608001518a6040015160018c6020015160ff16146126575730612662565b6126618d8c612802565b5b8c60c001516040518863ffffffff1660e01b815260040161268997969594939291906145a6565b6020604051808303816000875af11580156126a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126cc9190613ca1565b9250505b5b5b5b5b5b5b5b5b5b5b5b5b5b5b50949350505050565b60006305f5e1008284866126fb9190614615565b6127059190614615565b61270f9190614686565b90509392505050565b600080841161275c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161275390614729565b60405180910390fd5b60008311801561276c5750600082115b6127ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127a2906147bb565b60405180910390fd5b60006103e5856127bb9190614615565b9050600083826127cb9190614615565b90506000826103e8876127de9190614615565b6127e891906140d3565b905080826127f69190614686565b93505050509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461283f57819050612958565b600183606001515114801561285957506001836080015151145b612898576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161288f90614827565b60405180910390fd5b600083608001516000815181106128b2576128b1613a00565b5b60200260200101518060200190518101906128cd91906139b7565b9050600181606001515114612917576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161290e90614893565b60405180910390fd5b6000816060015160008151811061293157612930613a00565b5b602002602001015180602001905181019061294c9190613c73565b90508060800151925050505b92915050565b60007f8000000000000000000000000000000000000000000000000000000000000000821061298c57600080fd5b819050919050565b6000808473ffffffffffffffffffffffffffffffffffffffff1663095ea7b360e01b85856040516024016129c992919061403e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051612a339190613f79565b6000604051808303816000865af19150503d8060008114612a70576040519150601f19603f3d011682016040523d82523d6000602084013e612a75565b606091505b5091509150818015612aa35750600081511480612aa2575080806020019051810190612aa19190613fa5565b5b5b612ae2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ad9906148ff565b60405180910390fd5b5050505050565b604051806101000160405280600060ff168152602001600060ff168152602001600060ff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b6040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000815260200160608152602001606081525090565b6000604051905090565b600080fd5b600080fd5b600060ff82169050919050565b612bd281612bbc565b8114612bdd57600080fd5b50565b600081359050612bef81612bc9565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612c2082612bf5565b9050919050565b612c3081612c15565b8114612c3b57600080fd5b50565b600081359050612c4d81612c27565b92915050565b6000819050919050565b612c6681612c53565b8114612c7157600080fd5b50565b600081359050612c8381612c5d565b92915050565b600080600080600080600080610100898b031215612caa57612ca9612bb2565b5b6000612cb88b828c01612be0565b9850506020612cc98b828c01612be0565b9750506040612cda8b828c01612be0565b9650506060612ceb8b828c01612c3e565b9550506080612cfc8b828c01612c3e565b94505060a0612d0d8b828c01612c74565b93505060c0612d1e8b828c01612c74565b92505060e0612d2f8b828c01612c74565b9150509295985092959890939650565b600081519050919050565b600082825260208201905092915050565b60005b83811015612d79578082015181840152602081019050612d5e565b60008484015250505050565b6000601f19601f8301169050919050565b6000612da182612d3f565b612dab8185612d4a565b9350612dbb818560208601612d5b565b612dc481612d85565b840191505092915050565b60006020820190508181036000830152612de98184612d96565b905092915050565b6000819050919050565b6000612e16612e11612e0c84612bf5565b612df1565b612bf5565b9050919050565b6000612e2882612dfb565b9050919050565b6000612e3a82612e1d565b9050919050565b612e4a81612e2f565b82525050565b6000602082019050612e656000830184612e41565b92915050565b612e7481612c15565b82525050565b6000602082019050612e8f6000830184612e6b565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612ed282612d85565b810181811067ffffffffffffffff82111715612ef157612ef0612e9a565b5b80604052505050565b6000612f04612ba8565b9050612f108282612ec9565b919050565b600067ffffffffffffffff821115612f3057612f2f612e9a565b5b602082029050602081019050919050565b600080fd5b600080fd5b600067ffffffffffffffff821115612f6657612f65612e9a565b5b612f6f82612d85565b9050602081019050919050565b82818337600083830152505050565b6000612f9e612f9984612f4b565b612efa565b905082815260208101848484011115612fba57612fb9612f46565b5b612fc5848285612f7c565b509392505050565b600082601f830112612fe257612fe1612e95565b5b8135612ff2848260208601612f8b565b91505092915050565b600061300e61300984612f15565b612efa565b9050808382526020820190506020840283018581111561303157613030612f41565b5b835b8181101561307857803567ffffffffffffffff81111561305657613055612e95565b5b8086016130638982612fcd565b85526020850194505050602081019050613033565b5050509392505050565b600082601f83011261309757613096612e95565b5b81356130a7848260208601612ffb565b91505092915050565b600080600080608085870312156130ca576130c9612bb2565b5b60006130d887828801612c3e565b94505060206130e987828801612c74565b935050604085013567ffffffffffffffff81111561310a57613109612bb7565b5b61311687828801613082565b925050606085013567ffffffffffffffff81111561313757613136612bb7565b5b61314387828801613082565b91505092959194509250565b600080fd5b600080fd5b60008115159050919050565b61316e81613159565b811461317957600080fd5b50565b60008135905061318b81613165565b92915050565b6000819050919050565b6131a481613191565b81146131af57600080fd5b50565b6000813590506131c18161319b565b92915050565b600061016082840312156131de576131dd61314f565b5b6131e9610160612efa565b905060006131f984828501612c3e565b600083015250602061320d84828501612c74565b602083015250604061322184828501612c3e565b604083015250606061323584828501612c74565b606083015250608061324984828501612c3e565b60808301525060a061325d84828501612c74565b60a08301525060c06132718482850161317c565b60c08301525060e061328584828501612be0565b60e08301525061010061329a848285016131b2565b610100830152506101206132b0848285016131b2565b6101208301525061014082013567ffffffffffffffff8111156132d6576132d5613154565b5b6132e284828501612fcd565b6101408301525092915050565b60006020828403121561330557613304612bb2565b5b600082013567ffffffffffffffff81111561332357613322612bb7565b5b61332f848285016131c7565b91505092915050565b61334181612c53565b82525050565b600060208201905061335c6000830184613338565b92915050565b61336b81613159565b82525050565b60006020820190506133866000830184613362565b92915050565b6000819050919050565b61339f8161338c565b81146133aa57600080fd5b50565b6000813590506133bc81613396565b92915050565b600080fd5b60008083601f8401126133dd576133dc612e95565b5b8235905067ffffffffffffffff8111156133fa576133f96133c2565b5b60208301915083600182028301111561341657613415612f41565b5b9250929050565b6000806000806060858703121561343757613436612bb2565b5b6000613445878288016133ad565b9450506020613456878288016133ad565b935050604085013567ffffffffffffffff81111561347757613476612bb7565b5b613483878288016133c7565b925092505092959194509250565b61349a81612bbc565b82525050565b6134a981612c15565b82525050565b6134b881612c53565b82525050565b610100820160008201516134d56000850182613491565b5060208201516134e86020850182613491565b5060408201516134fb6040850182613491565b50606082015161350e60608501826134a0565b50608082015161352160808501826134a0565b5060a082015161353460a08501826134af565b5060c082015161354760c08501826134af565b5060e082015161355a60e08501826134af565b50505050565b60006101008201905061357660008301846134be565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600082825260208201905092915050565b60006135c482612d3f565b6135ce81856135a8565b93506135de818560208601612d5b565b6135e781612d85565b840191505092915050565b60006135fe83836135b9565b905092915050565b6000602082019050919050565b600061361e8261357c565b6136288185613587565b93508360208202850161363a85613598565b8060005b85811015613676578484038952815161365785826135f2565b945061366283613606565b925060208a0199505060018101905061363e565b50829750879550505050505092915050565b600060a0830160008301516136a060008601826134a0565b5060208301516136b360208601826134af565b5060408301516136c660408601826134af565b50606083015184820360608601526136de8282613613565b915050608083015184820360808601526136f88282613613565b9150508091505092915050565b6000602082019050818103600083015261371f8184613688565b905092915050565b600082825260208201905092915050565b7f5472616e73616374696f6e20746f6f206f6c6400000000000000000000000000600082015250565b600061376e601383613727565b915061377982613738565b602082019050919050565b6000602082019050818103600083015261379d81613761565b9050919050565b6000815190506137b381612c27565b92915050565b6000815190506137c881612c5d565b92915050565b60006137e16137dc84612f4b565b612efa565b9050828152602081018484840111156137fd576137fc612f46565b5b613808848285612d5b565b509392505050565b600082601f83011261382557613824612e95565b5b81516138358482602086016137ce565b91505092915050565b600061385161384c84612f15565b612efa565b9050808382526020820190506020840283018581111561387457613873612f41565b5b835b818110156138bb57805167ffffffffffffffff81111561389957613898612e95565b5b8086016138a68982613810565b85526020850194505050602081019050613876565b5050509392505050565b600082601f8301126138da576138d9612e95565b5b81516138ea84826020860161383e565b91505092915050565b600060a082840312156139095761390861314f565b5b61391360a0612efa565b90506000613923848285016137a4565b6000830152506020613937848285016137b9565b602083015250604061394b848285016137b9565b604083015250606082015167ffffffffffffffff81111561396f5761396e613154565b5b61397b848285016138c5565b606083015250608082015167ffffffffffffffff81111561399f5761399e613154565b5b6139ab848285016138c5565b60808301525092915050565b6000602082840312156139cd576139cc612bb2565b5b600082015167ffffffffffffffff8111156139eb576139ea612bb7565b5b6139f7848285016138f3565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4653523a49490000000000000000000000000000000000000000000000000000600082015250565b6000613a65600683613727565b9150613a7082613a2f565b602082019050919050565b60006020820190508181036000830152613a9481613a58565b9050919050565b7f4653523a49450000000000000000000000000000000000000000000000000000600082015250565b6000613ad1600683613727565b9150613adc82613a9b565b602082019050919050565b60006020820190508181036000830152613b0081613ac4565b9050919050565b613b1081612bbc565b82525050565b613b1f81613191565b82525050565b600060e082019050613b3a600083018a612e6b565b613b476020830189612e6b565b613b546040830188613338565b613b616060830187613338565b613b6e6080830186613b07565b613b7b60a0830185613b16565b613b8860c0830184613b16565b98975050505050505050565b600081519050613ba381612bc9565b92915050565b60006101008284031215613bc057613bbf61314f565b5b613bcb610100612efa565b90506000613bdb84828501613b94565b6000830152506020613bef84828501613b94565b6020830152506040613c0384828501613b94565b6040830152506060613c17848285016137a4565b6060830152506080613c2b848285016137a4565b60808301525060a0613c3f848285016137b9565b60a08301525060c0613c53848285016137b9565b60c08301525060e0613c67848285016137b9565b60e08301525092915050565b60006101008284031215613c8a57613c89612bb2565b5b6000613c9884828501613ba9565b91505092915050565b600060208284031215613cb757613cb6612bb2565b5b6000613cc5848285016137b9565b91505092915050565b600081905092915050565b50565b6000613ce9600083613cce565b9150613cf482613cd9565b600082019050919050565b6000613d0a82613cdc565b9150819050919050565b7f4653523a496e76616c6964207472616e73666572000000000000000000000000600082015250565b6000613d4a601483613727565b9150613d5582613d14565b602082019050919050565b60006020820190508181036000830152613d7981613d3d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613dba82612c53565b9150613dc583612c53565b9250828203905081811115613ddd57613ddc613d80565b5b92915050565b7f4653523a494f0000000000000000000000000000000000000000000000000000600082015250565b6000613e19600683613727565b9150613e2482613de3565b602082019050919050565b60006020820190508181036000830152613e4881613e0c565b9050919050565b6000608082019050613e646000830187612e6b565b613e716020830186612e6b565b613e7e6040830185613338565b613e8b6060830184613338565b95945050505050565b600060408284031215613eaa57613ea961314f565b5b613eb46040612efa565b90506000613ec484828501612c3e565b6000830152506020613ed88482850161317c565b60208301525092915050565b600060408284031215613efa57613ef9612bb2565b5b6000613f0884828501613e94565b91505092915050565b6000606082019050613f266000830186612e6b565b613f336020830185612e6b565b613f406040830184613338565b949350505050565b6000613f5382612d3f565b613f5d8185613cce565b9350613f6d818560208601612d5b565b80840191505092915050565b6000613f858284613f48565b915081905092915050565b600081519050613f9f81613165565b92915050565b600060208284031215613fbb57613fba612bb2565b5b6000613fc984828501613f90565b91505092915050565b7f5354460000000000000000000000000000000000000000000000000000000000600082015250565b6000614008600383613727565b915061401382613fd2565b602082019050919050565b6000602082019050818103600083015261403781613ffb565b9050919050565b60006040820190506140536000830185612e6b565b6140606020830184613338565b9392505050565b7f5354000000000000000000000000000000000000000000000000000000000000600082015250565b600061409d600283613727565b91506140a882614067565b602082019050919050565b600060208201905081810360008301526140cc81614090565b9050919050565b60006140de82612c53565b91506140e983612c53565b925082820190508082111561410157614100613d80565b5b92915050565b600060408201905061411c6000830185613338565b6141296020830184612e6b565b9392505050565b60006dffffffffffffffffffffffffffff82169050919050565b61415381614130565b811461415e57600080fd5b50565b6000815190506141708161414a565b92915050565b600063ffffffff82169050919050565b61418f81614176565b811461419a57600080fd5b50565b6000815190506141ac81614186565b92915050565b6000806000606084860312156141cb576141ca612bb2565b5b60006141d986828701614161565b93505060206141ea86828701614161565b92505060406141fb8682870161419d565b9150509250925092565b600060808201905061421a6000830187613338565b6142276020830186613338565b6142346040830185612e6b565b81810360608301526142468184612d96565b905095945050505050565b61425a81613159565b82525050565b60408201600082015161427660008501826134a0565b5060208201516142896020850182614251565b50505050565b60006040820190506142a46000830184614260565b92915050565b6142b38161338c565b82525050565b6142c281612bf5565b82525050565b600060a0820190506142dd6000830188612e6b565b6142ea6020830187613362565b6142f760408301866142aa565b61430460608301856142b9565b81810360808301526143168184612d96565b90509695505050505050565b60008151905061433181613396565b92915050565b6000806040838503121561434e5761434d612bb2565b5b600061435c85828601614322565b925050602061436d85828601614322565b9150509250929050565b60006143828261338c565b91507f800000000000000000000000000000000000000000000000000000000000000082036143b4576143b3613d80565b5b816000039050919050565b6000819050919050565b60006143e46143df6143da846143bf565b612df1565b612c53565b9050919050565b6143f4816143c9565b82525050565b600060808201905061440f6000830187613338565b61441c6020830186613338565b6144296040830185613338565b61443660608301846143eb565b95945050505050565b600081600f0b9050919050565b6144558161443f565b82525050565b6000608082019050614470600083018761444c565b61447d602083018661444c565b61448a6040830185613338565b61449760608301846143eb565b95945050505050565b600060a0820190506144b56000830188613b07565b6144c26020830187613b07565b6144cf6040830186613338565b6144dc60608301856143eb565b6144e96080830184613338565b9695505050505050565b60006040820190506145086000830185613338565b61451560208301846143eb565b9392505050565b600060a082019050614531600083018861444c565b61453e602083018761444c565b61454b6040830186613338565b61455860608301856143eb565b6145656080830184612e6b565b9695505050505050565b60006060820190506145846000830186613338565b6145916020830185612e6b565b61459e6040830184612e6b565b949350505050565b600060e0820190506145bb600083018a612e6b565b6145c86020830189612e6b565b6145d56040830188613338565b6145e26060830187612e6b565b6145ef6080830186613b07565b6145fc60a0830185612e6b565b61460960c0830184613338565b98975050505050505050565b600061462082612c53565b915061462b83612c53565b925082820261463981612c53565b915082820484148315176146505761464f613d80565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061469182612c53565b915061469c83612c53565b9250826146ac576146ab614657565b5b828204905092915050565b7f556e697377617056324c6962726172793a20494e53554646494349454e545f4960008201527f4e5055545f414d4f554e54000000000000000000000000000000000000000000602082015250565b6000614713602b83613727565b915061471e826146b7565b604082019050919050565b6000602082019050818103600083015261474281614706565b9050919050565b7f556e697377617056324c6962726172793a20494e53554646494349454e545f4c60008201527f4951554944495459000000000000000000000000000000000000000000000000602082015250565b60006147a5602883613727565b91506147b082614749565b604082019050919050565b600060208201905081810360008301526147d481614798565b9050919050565b7f4653523a204446526f7574657300000000000000000000000000000000000000600082015250565b6000614811600d83613727565b915061481c826147db565b602082019050919050565b6000602082019050818103600083015261484081614804565b9050919050565b7f4653523a20444653746570730000000000000000000000000000000000000000600082015250565b600061487d600c83613727565b915061488882614847565b602082019050919050565b600060208201905081810360008301526148ac81614870565b9050919050565b7f5341000000000000000000000000000000000000000000000000000000000000600082015250565b60006148e9600283613727565b91506148f4826148b3565b602082019050919050565b60006020820190508181036000830152614918816148dc565b905091905056000000000000000000000000fc00000000000000000000000000000000000006000000000000000000000000fc000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001
Deployed Bytecode
0x6080604052600436106100745760003560e01c8063b60650d71161004e578063b60650d714610113578063d2c9041114610150578063dcd6c4d514610180578063fa461e33146101ab5761007b565b80634a264940146100805780634aa4a4fc146100bd578063b0e4556f146100e85761007b565b3661007b57005b600080fd5b34801561008c57600080fd5b506100a760048036038101906100a29190612c89565b6101d4565b6040516100b49190612dcf565b60405180910390f35b3480156100c957600080fd5b506100d26102d1565b6040516100df9190612e50565b60405180910390f35b3480156100f457600080fd5b506100fd6102f5565b60405161010a9190612e7a565b60405180910390f35b34801561011f57600080fd5b5061013a600480360381019061013591906130b0565b610319565b6040516101479190612dcf565b60405180910390f35b61016a600480360381019061016591906132ef565b6103ad565b6040516101779190613347565b60405180910390f35b34801561018c57600080fd5b50610195610df7565b6040516101a29190613371565b60405180910390f35b3480156101b757600080fd5b506101d260048036038101906101cd919061341d565b610e1b565b005b60606101de612ae9565b89816000019060ff16908160ff168152505088816020019060ff16908160ff168152505087816040019060ff16908160ff168152505086816060019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505085816080019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050848160a0018181525050838160c0018181525050828160e0018181525050806040516020016102b39190613560565b60405160208183030381529060405291505098975050505050505050565b7f000000000000000000000000fc0000000000000000000000000000000000000681565b7f000000000000000000000000fc0000000000000000000000000000000000000181565b6060610323612b63565b85816000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600081602001818152505084816040018181525050838160600181905250828160800181905250806040516020016103939190613705565b604051602081830303815290604052915050949350505050565b60006103b7610e75565b8160a00151804211156103ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103f690613784565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16836080015173ffffffffffffffffffffffffffffffffffffffff16036104705733836080019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b600083610140015180602001905181019061048b91906139b7565b90508360000151816000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508360200151816020018181525050600081608001516000815181106104f1576104f0613a00565b5b602002602001015180602001905181019061050c91906139b7565b9050600073ffffffffffffffffffffffffffffffffffffffff16856000015173ffffffffffffffffffffffffffffffffffffffff1603610591578460200151341461058c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161058390613a7b565b60405180910390fd5b610855565b7f000000000000000000000000fc0000000000000000000000000000000000000673ffffffffffffffffffffffffffffffffffffffff16856000015173ffffffffffffffffffffffffffffffffffffffff161480156105f05750600034115b156106c1578460200151341461063b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063290613a7b565b60405180910390fd5b7f000000000000000000000000fc0000000000000000000000000000000000000673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156106a357600080fd5b505af11580156106b7573d6000803e3d6000fd5b5050505050610854565b60003414610704576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106fb90613ae7565b60405180910390fd5b60008560e0015160ff16146107db5760008560c0015161072857856020015161074a565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b9050856000015173ffffffffffffffffffffffffffffffffffffffff1663d505accf3330848a60a001518b60e001518c61010001518d61012001516040518863ffffffff1660e01b81526004016107a79796959493929190613b25565b600060405180830381600087803b1580156107c157600080fd5b505af11580156107d5573d6000803e3d6000fd5b50505050505b60003090506000826060015151111561083e576000826060015160008151811061080857610807613a00565b5b60200260200101518060200190518101906108239190613c73565b90506001816040015160ff160361083c57806080015191505b505b610852866000015133838960200151610ebb565b505b5b60008073ffffffffffffffffffffffffffffffffffffffff16866040015173ffffffffffffffffffffffffffffffffffffffff1614905060007f000000000000000000000000000000000000000000000000000000000000000161095f578161093f57866040015173ffffffffffffffffffffffffffffffffffffffff166370a0823188608001516040518263ffffffff1660e01b81526004016108f99190612e7a565b602060405180830381865afa158015610916573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093a9190613ca1565b61095c565b866080015173ffffffffffffffffffffffffffffffffffffffff16315b90505b60005b8460800151518110156109ce5760008082146109af578560800151828151811061098f5761098e613a00565b5b60200260200101518060200190518101906109aa91906139b7565b6109b1565b845b90506109c286828b60800151611013565b50806001019050610962565b5081610a5757866040015173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610a119190612e7a565b602060405180830381865afa158015610a2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a529190613ca1565b610a59565b475b9550818015610a685750600086145b15610b9f577f000000000000000000000000fc0000000000000000000000000000000000000673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610ac69190612e7a565b602060405180830381865afa158015610ae3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b079190613ca1565b95506000861115610b9e577f000000000000000000000000fc0000000000000000000000000000000000000673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d876040518263ffffffff1660e01b8152600401610b6b9190613347565b600060405180830381600087803b158015610b8557600080fd5b505af1158015610b99573d6000803e3d6000fd5b505050505b5b6000861115610c79578115610c64576000876080015173ffffffffffffffffffffffffffffffffffffffff1687604051610bd890613cff565b60006040518083038185875af1925050503d8060008114610c15576040519150601f19603f3d011682016040523d82523d6000602084013e610c1a565b606091505b5050905080610c5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5590613d60565b60405180910390fd5b50610c78565b610c778760400151886080015188611096565b5b5b7f0000000000000000000000000000000000000000000000000000000000000001610d555781610d355780876040015173ffffffffffffffffffffffffffffffffffffffff166370a0823189608001516040518263ffffffff1660e01b8152600401610ce59190612e7a565b602060405180830381865afa158015610d02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d269190613ca1565b610d309190613daf565b610d52565b866080015173ffffffffffffffffffffffffffffffffffffffff16315b95505b8660600151861015610d9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9390613e2f565b60405180910390fd5b7f95c81fee1a892bf5851845efaa51f1f7941266f2f0da809680e6d37fbd3562b387600001518860400151896020015189604051610ddd9493929190613e4f565b60405180910390a15050505050610df26111eb565b919050565b7f000000000000000000000000000000000000000000000000000000000000000181565b6000841380610e2a5750600083135b610e3357600080fd5b60008282810190610e449190613ee4565b90508060200151610e6e57610e6d81600001513360008813610e665786610e68565b875b611096565b5b5050505050565b600260005403610eb1576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600081905550565b6000808573ffffffffffffffffffffffffffffffffffffffff166323b872dd60e01b868686604051602401610ef293929190613f11565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610f5c9190613f79565b6000604051808303816000865af19150503d8060008114610f99576040519150601f19603f3d011682016040523d82523d6000602084013e610f9e565b606091505b5091509150818015610fcc5750600081511480610fcb575080806020019051810190610fca9190613fa5565b5b5b61100b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110029061401e565b60405180910390fd5b505050505050565b611033838360008560800151511461102c57600061102e565b835b6111f5565b60005b8260800151518110156110905760008360800151828151811061105c5761105b613a00565b5b602002602001015180602001905181019061107791906139b7565b9050611084848285611013565b50806001019050611036565b50505050565b6000808473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b85856040516024016110cb92919061403e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516111359190613f79565b6000604051808303816000865af19150503d8060008114611172576040519150601f19603f3d011682016040523d82523d6000602084013e611177565b606091505b50915091508180156111a557506000815114806111a45750808060200190518101906111a39190613fa5565b5b5b6111e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111db906140b3565b60405180910390fd5b5050505050565b6001600081905550565b60005b82606001515181101561128b5760008360600151828151811061121e5761121d613a00565b5b60200260200101518060200190518101906112399190613c73565b905061126785858360018860600151516112539190613daf565b8614611260576000611262565b865b611291565b8460200181815161127891906140d3565b91508181525050508060010190506111f8565b50505050565b6000806112ab8460e00151866040015188602001516126e7565b90506002846000015160ff161015611613576000808560c001511480156113055750846060015173ffffffffffffffffffffffffffffffffffffffff16876000015173ffffffffffffffffffffffffffffffffffffffff16105b80611314575060018560c00151145b90506000856000015160ff160361139557846080015173ffffffffffffffffffffffffffffffffffffffff16632e0ae375426040518263ffffffff1660e01b81526004016113629190613347565b600060405180830381600087803b15801561137c57600080fd5b505af1158015611390573d6000803e3d6000fd5b505050505b60018560a001510361142c57846080015173ffffffffffffffffffffffffffffffffffffffff1663f140a35a8389600001516040518363ffffffff1660e01b81526004016113e4929190614107565b602060405180830381865afa158015611401573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114259190613ca1565b92506114ef565b600080866080015173ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa15801561147e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114a291906141b2565b50915091506114ea84846114b657826114b8565b835b6dffffffffffffffffffffffffffff16856114d357846114d5565b835b6dffffffffffffffffffffffffffff16612718565b945050505b6000856040015160ff1603611512576115118760000151866080015184611096565b5b846080015173ffffffffffffffffffffffffffffffffffffffff1663022c0d9f8261153d5784611540565b60005b8361154c57600061154e565b855b6001896020015160ff1614611563573061156e565b61156d8a89612802565b5b600067ffffffffffffffff81111561158957611588612e9a565b5b6040519080825280601f01601f1916602001820160405280156115bb5781602001600182028036833780820191505090505b506040518563ffffffff1660e01b81526004016115db9493929190614205565b600060405180830381600087803b1580156115f557600080fd5b505af1158015611609573d6000803e3d6000fd5b50505050506126de565b6002846000015160ff16036117dd576000808560c0015114801561166a5750846060015173ffffffffffffffffffffffffffffffffffffffff16876000015173ffffffffffffffffffffffffffffffffffffffff16105b80611679575060018560c00151145b905060006040518060400160405280896000015173ffffffffffffffffffffffffffffffffffffffff1681526020016001886040015160ff161415158152506040516020016116c8919061428f565b6040516020818303038152906040529050600080876080015173ffffffffffffffffffffffffffffffffffffffff1663128acb0860018a6020015160ff1614611711573061171c565b61171b8b8a612802565b5b866117268961295e565b886117455773fffd8963efd1fc6a506488495d951d5263988d2561174c565b6401000276a45b886040518663ffffffff1660e01b815260040161176d9594939291906142c8565b60408051808303816000875af115801561178b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117af9190614337565b91509150836117c757816117c290614377565b6117d2565b806117d190614377565b5b9550505050506126dd565b6003846000015160ff1603611902576117ff8660000151856080015183612994565b836080015173ffffffffffffffffffffffffffffffffffffffff16635b41b9088560a001518660c001518460006040518563ffffffff1660e01b815260040161184b94939291906143fa565b600060405180830381600087803b15801561186557600080fd5b505af1158015611879573d6000803e3d6000fd5b50505050836060015173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016118ba9190612e7a565b602060405180830381865afa1580156118d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118fb9190613ca1565b91506126dc565b6004846000015160ff16036119ba576119248660000151856080015183612994565b836080015173ffffffffffffffffffffffffffffffffffffffff16633df021248560a001518660c001518460006040518563ffffffff1660e01b8152600401611970949392919061445b565b6020604051808303816000875af115801561198f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119b39190613ca1565b91506126db565b6005846000015160ff1603611a72576119dc8660000151856080015183612994565b836080015173ffffffffffffffffffffffffffffffffffffffff1663a6417ed68560a001518660c001518460006040518563ffffffff1660e01b8152600401611a28949392919061445b565b6020604051808303816000875af1158015611a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a6b9190613ca1565b91506126da565b6006846000015160ff1603611b2c57611a948660000151856080015183612994565b836080015173ffffffffffffffffffffffffffffffffffffffff1663916955868560a001518660c00151846000426040518663ffffffff1660e01b8152600401611ae29594939291906144a0565b6020604051808303816000875af1158015611b01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b259190613ca1565b91506126d9565b6007846000015160ff1603611cba57611b4e8660000151856080015183612994565b7f000000000000000000000000fc0000000000000000000000000000000000000173ffffffffffffffffffffffffffffffffffffffff16866000015173ffffffffffffffffffffffffffffffffffffffff1603611c2f57836080015173ffffffffffffffffffffffffffffffffffffffff16634d6f9ef28260006040518363ffffffff1660e01b8152600401611be59291906144f3565b6020604051808303816000875af1158015611c04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c289190613ca1565b9150611cb5565b836080015173ffffffffffffffffffffffffffffffffffffffff1663c5a36df18260006040518363ffffffff1660e01b8152600401611c6f9291906144f3565b6020604051808303816000875af1158015611c8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cb29190613ca1565b91505b6126d8565b6008846000015160ff1603611d8457611cdc8660000151856080015183612994565b836080015173ffffffffffffffffffffffffffffffffffffffff16636e553f65826001876020015160ff1614611d125730611d1d565b611d1c8887612802565b5b6040518363ffffffff1660e01b8152600401611d3a929190614107565b6020604051808303816000875af1158015611d59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7d9190613ca1565b91506126d7565b6009846000015160ff1603611f1e5760008460a00151148015611df657507f000000000000000000000000fc0000000000000000000000000000000000000673ffffffffffffffffffffffffffffffffffffffff16866000015173ffffffffffffffffffffffffffffffffffffffff16145b15611e87577f000000000000000000000000fc0000000000000000000000000000000000000673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b8152600401611e549190613347565b600060405180830381600087803b158015611e6e57600080fd5b505af1158015611e82573d6000803e3d6000fd5b505050505b836080015173ffffffffffffffffffffffffffffffffffffffff1663bfda0c8c826001876020015160ff1614611ebd5730611ec8565b611ec78887612802565b5b6040518363ffffffff1660e01b8152600401611ee49190612e7a565b6000604051808303818588803b158015611efd57600080fd5b505af1158015611f11573d6000803e3d6000fd5b50505050508091506126d6565b600a846000015160ff160361209e577f000000000000000000000000fc0000000000000000000000000000000000000673ffffffffffffffffffffffffffffffffffffffff16866000015173ffffffffffffffffffffffffffffffffffffffff1603612014577f000000000000000000000000fc0000000000000000000000000000000000000673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b8152600401611fdd9190613347565b600060405180830381600087803b158015611ff757600080fd5b505af115801561200b573d6000803e3d6000fd5b50505050612096565b7f000000000000000000000000fc0000000000000000000000000000000000000673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561207c57600080fd5b505af1158015612090573d6000803e3d6000fd5b50505050505b8091506126d5565b600b846000015160ff160361235f5760007f000000000000000000000000fc0000000000000000000000000000000000000673ffffffffffffffffffffffffffffffffffffffff16876000015173ffffffffffffffffffffffffffffffffffffffff1603612199577f000000000000000000000000fc0000000000000000000000000000000000000673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836040518263ffffffff1660e01b815260040161215f9190613347565b600060405180830381600087803b15801561217957600080fd5b505af115801561218d573d6000803e3d6000fd5b505050508190506121ee565b600073ffffffffffffffffffffffffffffffffffffffff16876000015173ffffffffffffffffffffffffffffffffffffffff16036121d9578190506121ed565b6121ec8760000151866080015184612994565b5b5b846080015173ffffffffffffffffffffffffffffffffffffffff16633df02124828760a001518860c001518660006040518663ffffffff1660e01b815260040161223b949392919061445b565b60206040518083038185885af1158015612259573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061227e9190613ca1565b92507f000000000000000000000000fc0000000000000000000000000000000000000673ffffffffffffffffffffffffffffffffffffffff16866000015173ffffffffffffffffffffffffffffffffffffffff1603612359577f000000000000000000000000fc0000000000000000000000000000000000000673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b15801561233f57600080fd5b505af1158015612353573d6000803e3d6000fd5b50505050505b506126d4565b600c846000015160ff1603612448576000846040015160ff1603612391576123908660000151856080015183611096565b5b836080015173ffffffffffffffffffffffffffffffffffffffff1663afb430128560a001518660c0015184600060018a6020015160ff16146123d357306123de565b6123dd8b8a612802565b5b6040518663ffffffff1660e01b81526004016123fe95949392919061451c565b6020604051808303816000875af115801561241d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124419190613ca1565b91506126d3565b600d846000015160ff160361250157836080015173ffffffffffffffffffffffffffffffffffffffff1663ba087652826001876020015160ff161461248d5730612498565b6124978887612802565b5b306040518463ffffffff1660e01b81526004016124b79392919061456f565b6020604051808303816000875af11580156124d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124fa9190613ca1565b91506126d2565b600e846000015160ff16036125da576125238660000151856080015183612994565b836080015173ffffffffffffffffffffffffffffffffffffffff1663ddc1f59d8560a001518660c0015184600060018a6020015160ff16146125655730612570565b61256f8b8a612802565b5b6040518663ffffffff1660e01b815260040161259095949392919061451c565b6020604051808303816000875af11580156125af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125d39190613ca1565b91506126d1565b60ff846000015160ff16036126d05760008460a0015190506000856040015160ff16036126115761261087600001518284612994565b5b8073ffffffffffffffffffffffffffffffffffffffff166364074c70886000015187606001518589608001518a6040015160018c6020015160ff16146126575730612662565b6126618d8c612802565b5b8c60c001516040518863ffffffff1660e01b815260040161268997969594939291906145a6565b6020604051808303816000875af11580156126a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126cc9190613ca1565b9250505b5b5b5b5b5b5b5b5b5b5b5b5b5b5b50949350505050565b60006305f5e1008284866126fb9190614615565b6127059190614615565b61270f9190614686565b90509392505050565b600080841161275c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161275390614729565b60405180910390fd5b60008311801561276c5750600082115b6127ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127a2906147bb565b60405180910390fd5b60006103e5856127bb9190614615565b9050600083826127cb9190614615565b90506000826103e8876127de9190614615565b6127e891906140d3565b905080826127f69190614686565b93505050509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461283f57819050612958565b600183606001515114801561285957506001836080015151145b612898576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161288f90614827565b60405180910390fd5b600083608001516000815181106128b2576128b1613a00565b5b60200260200101518060200190518101906128cd91906139b7565b9050600181606001515114612917576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161290e90614893565b60405180910390fd5b6000816060015160008151811061293157612930613a00565b5b602002602001015180602001905181019061294c9190613c73565b90508060800151925050505b92915050565b60007f8000000000000000000000000000000000000000000000000000000000000000821061298c57600080fd5b819050919050565b6000808473ffffffffffffffffffffffffffffffffffffffff1663095ea7b360e01b85856040516024016129c992919061403e565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051612a339190613f79565b6000604051808303816000865af19150503d8060008114612a70576040519150601f19603f3d011682016040523d82523d6000602084013e612a75565b606091505b5091509150818015612aa35750600081511480612aa2575080806020019051810190612aa19190613fa5565b5b5b612ae2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ad9906148ff565b60405180910390fd5b5050505050565b604051806101000160405280600060ff168152602001600060ff168152602001600060ff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b6040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000815260200160608152602001606081525090565b6000604051905090565b600080fd5b600080fd5b600060ff82169050919050565b612bd281612bbc565b8114612bdd57600080fd5b50565b600081359050612bef81612bc9565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612c2082612bf5565b9050919050565b612c3081612c15565b8114612c3b57600080fd5b50565b600081359050612c4d81612c27565b92915050565b6000819050919050565b612c6681612c53565b8114612c7157600080fd5b50565b600081359050612c8381612c5d565b92915050565b600080600080600080600080610100898b031215612caa57612ca9612bb2565b5b6000612cb88b828c01612be0565b9850506020612cc98b828c01612be0565b9750506040612cda8b828c01612be0565b9650506060612ceb8b828c01612c3e565b9550506080612cfc8b828c01612c3e565b94505060a0612d0d8b828c01612c74565b93505060c0612d1e8b828c01612c74565b92505060e0612d2f8b828c01612c74565b9150509295985092959890939650565b600081519050919050565b600082825260208201905092915050565b60005b83811015612d79578082015181840152602081019050612d5e565b60008484015250505050565b6000601f19601f8301169050919050565b6000612da182612d3f565b612dab8185612d4a565b9350612dbb818560208601612d5b565b612dc481612d85565b840191505092915050565b60006020820190508181036000830152612de98184612d96565b905092915050565b6000819050919050565b6000612e16612e11612e0c84612bf5565b612df1565b612bf5565b9050919050565b6000612e2882612dfb565b9050919050565b6000612e3a82612e1d565b9050919050565b612e4a81612e2f565b82525050565b6000602082019050612e656000830184612e41565b92915050565b612e7481612c15565b82525050565b6000602082019050612e8f6000830184612e6b565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612ed282612d85565b810181811067ffffffffffffffff82111715612ef157612ef0612e9a565b5b80604052505050565b6000612f04612ba8565b9050612f108282612ec9565b919050565b600067ffffffffffffffff821115612f3057612f2f612e9a565b5b602082029050602081019050919050565b600080fd5b600080fd5b600067ffffffffffffffff821115612f6657612f65612e9a565b5b612f6f82612d85565b9050602081019050919050565b82818337600083830152505050565b6000612f9e612f9984612f4b565b612efa565b905082815260208101848484011115612fba57612fb9612f46565b5b612fc5848285612f7c565b509392505050565b600082601f830112612fe257612fe1612e95565b5b8135612ff2848260208601612f8b565b91505092915050565b600061300e61300984612f15565b612efa565b9050808382526020820190506020840283018581111561303157613030612f41565b5b835b8181101561307857803567ffffffffffffffff81111561305657613055612e95565b5b8086016130638982612fcd565b85526020850194505050602081019050613033565b5050509392505050565b600082601f83011261309757613096612e95565b5b81356130a7848260208601612ffb565b91505092915050565b600080600080608085870312156130ca576130c9612bb2565b5b60006130d887828801612c3e565b94505060206130e987828801612c74565b935050604085013567ffffffffffffffff81111561310a57613109612bb7565b5b61311687828801613082565b925050606085013567ffffffffffffffff81111561313757613136612bb7565b5b61314387828801613082565b91505092959194509250565b600080fd5b600080fd5b60008115159050919050565b61316e81613159565b811461317957600080fd5b50565b60008135905061318b81613165565b92915050565b6000819050919050565b6131a481613191565b81146131af57600080fd5b50565b6000813590506131c18161319b565b92915050565b600061016082840312156131de576131dd61314f565b5b6131e9610160612efa565b905060006131f984828501612c3e565b600083015250602061320d84828501612c74565b602083015250604061322184828501612c3e565b604083015250606061323584828501612c74565b606083015250608061324984828501612c3e565b60808301525060a061325d84828501612c74565b60a08301525060c06132718482850161317c565b60c08301525060e061328584828501612be0565b60e08301525061010061329a848285016131b2565b610100830152506101206132b0848285016131b2565b6101208301525061014082013567ffffffffffffffff8111156132d6576132d5613154565b5b6132e284828501612fcd565b6101408301525092915050565b60006020828403121561330557613304612bb2565b5b600082013567ffffffffffffffff81111561332357613322612bb7565b5b61332f848285016131c7565b91505092915050565b61334181612c53565b82525050565b600060208201905061335c6000830184613338565b92915050565b61336b81613159565b82525050565b60006020820190506133866000830184613362565b92915050565b6000819050919050565b61339f8161338c565b81146133aa57600080fd5b50565b6000813590506133bc81613396565b92915050565b600080fd5b60008083601f8401126133dd576133dc612e95565b5b8235905067ffffffffffffffff8111156133fa576133f96133c2565b5b60208301915083600182028301111561341657613415612f41565b5b9250929050565b6000806000806060858703121561343757613436612bb2565b5b6000613445878288016133ad565b9450506020613456878288016133ad565b935050604085013567ffffffffffffffff81111561347757613476612bb7565b5b613483878288016133c7565b925092505092959194509250565b61349a81612bbc565b82525050565b6134a981612c15565b82525050565b6134b881612c53565b82525050565b610100820160008201516134d56000850182613491565b5060208201516134e86020850182613491565b5060408201516134fb6040850182613491565b50606082015161350e60608501826134a0565b50608082015161352160808501826134a0565b5060a082015161353460a08501826134af565b5060c082015161354760c08501826134af565b5060e082015161355a60e08501826134af565b50505050565b60006101008201905061357660008301846134be565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600082825260208201905092915050565b60006135c482612d3f565b6135ce81856135a8565b93506135de818560208601612d5b565b6135e781612d85565b840191505092915050565b60006135fe83836135b9565b905092915050565b6000602082019050919050565b600061361e8261357c565b6136288185613587565b93508360208202850161363a85613598565b8060005b85811015613676578484038952815161365785826135f2565b945061366283613606565b925060208a0199505060018101905061363e565b50829750879550505050505092915050565b600060a0830160008301516136a060008601826134a0565b5060208301516136b360208601826134af565b5060408301516136c660408601826134af565b50606083015184820360608601526136de8282613613565b915050608083015184820360808601526136f88282613613565b9150508091505092915050565b6000602082019050818103600083015261371f8184613688565b905092915050565b600082825260208201905092915050565b7f5472616e73616374696f6e20746f6f206f6c6400000000000000000000000000600082015250565b600061376e601383613727565b915061377982613738565b602082019050919050565b6000602082019050818103600083015261379d81613761565b9050919050565b6000815190506137b381612c27565b92915050565b6000815190506137c881612c5d565b92915050565b60006137e16137dc84612f4b565b612efa565b9050828152602081018484840111156137fd576137fc612f46565b5b613808848285612d5b565b509392505050565b600082601f83011261382557613824612e95565b5b81516138358482602086016137ce565b91505092915050565b600061385161384c84612f15565b612efa565b9050808382526020820190506020840283018581111561387457613873612f41565b5b835b818110156138bb57805167ffffffffffffffff81111561389957613898612e95565b5b8086016138a68982613810565b85526020850194505050602081019050613876565b5050509392505050565b600082601f8301126138da576138d9612e95565b5b81516138ea84826020860161383e565b91505092915050565b600060a082840312156139095761390861314f565b5b61391360a0612efa565b90506000613923848285016137a4565b6000830152506020613937848285016137b9565b602083015250604061394b848285016137b9565b604083015250606082015167ffffffffffffffff81111561396f5761396e613154565b5b61397b848285016138c5565b606083015250608082015167ffffffffffffffff81111561399f5761399e613154565b5b6139ab848285016138c5565b60808301525092915050565b6000602082840312156139cd576139cc612bb2565b5b600082015167ffffffffffffffff8111156139eb576139ea612bb7565b5b6139f7848285016138f3565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4653523a49490000000000000000000000000000000000000000000000000000600082015250565b6000613a65600683613727565b9150613a7082613a2f565b602082019050919050565b60006020820190508181036000830152613a9481613a58565b9050919050565b7f4653523a49450000000000000000000000000000000000000000000000000000600082015250565b6000613ad1600683613727565b9150613adc82613a9b565b602082019050919050565b60006020820190508181036000830152613b0081613ac4565b9050919050565b613b1081612bbc565b82525050565b613b1f81613191565b82525050565b600060e082019050613b3a600083018a612e6b565b613b476020830189612e6b565b613b546040830188613338565b613b616060830187613338565b613b6e6080830186613b07565b613b7b60a0830185613b16565b613b8860c0830184613b16565b98975050505050505050565b600081519050613ba381612bc9565b92915050565b60006101008284031215613bc057613bbf61314f565b5b613bcb610100612efa565b90506000613bdb84828501613b94565b6000830152506020613bef84828501613b94565b6020830152506040613c0384828501613b94565b6040830152506060613c17848285016137a4565b6060830152506080613c2b848285016137a4565b60808301525060a0613c3f848285016137b9565b60a08301525060c0613c53848285016137b9565b60c08301525060e0613c67848285016137b9565b60e08301525092915050565b60006101008284031215613c8a57613c89612bb2565b5b6000613c9884828501613ba9565b91505092915050565b600060208284031215613cb757613cb6612bb2565b5b6000613cc5848285016137b9565b91505092915050565b600081905092915050565b50565b6000613ce9600083613cce565b9150613cf482613cd9565b600082019050919050565b6000613d0a82613cdc565b9150819050919050565b7f4653523a496e76616c6964207472616e73666572000000000000000000000000600082015250565b6000613d4a601483613727565b9150613d5582613d14565b602082019050919050565b60006020820190508181036000830152613d7981613d3d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613dba82612c53565b9150613dc583612c53565b9250828203905081811115613ddd57613ddc613d80565b5b92915050565b7f4653523a494f0000000000000000000000000000000000000000000000000000600082015250565b6000613e19600683613727565b9150613e2482613de3565b602082019050919050565b60006020820190508181036000830152613e4881613e0c565b9050919050565b6000608082019050613e646000830187612e6b565b613e716020830186612e6b565b613e7e6040830185613338565b613e8b6060830184613338565b95945050505050565b600060408284031215613eaa57613ea961314f565b5b613eb46040612efa565b90506000613ec484828501612c3e565b6000830152506020613ed88482850161317c565b60208301525092915050565b600060408284031215613efa57613ef9612bb2565b5b6000613f0884828501613e94565b91505092915050565b6000606082019050613f266000830186612e6b565b613f336020830185612e6b565b613f406040830184613338565b949350505050565b6000613f5382612d3f565b613f5d8185613cce565b9350613f6d818560208601612d5b565b80840191505092915050565b6000613f858284613f48565b915081905092915050565b600081519050613f9f81613165565b92915050565b600060208284031215613fbb57613fba612bb2565b5b6000613fc984828501613f90565b91505092915050565b7f5354460000000000000000000000000000000000000000000000000000000000600082015250565b6000614008600383613727565b915061401382613fd2565b602082019050919050565b6000602082019050818103600083015261403781613ffb565b9050919050565b60006040820190506140536000830185612e6b565b6140606020830184613338565b9392505050565b7f5354000000000000000000000000000000000000000000000000000000000000600082015250565b600061409d600283613727565b91506140a882614067565b602082019050919050565b600060208201905081810360008301526140cc81614090565b9050919050565b60006140de82612c53565b91506140e983612c53565b925082820190508082111561410157614100613d80565b5b92915050565b600060408201905061411c6000830185613338565b6141296020830184612e6b565b9392505050565b60006dffffffffffffffffffffffffffff82169050919050565b61415381614130565b811461415e57600080fd5b50565b6000815190506141708161414a565b92915050565b600063ffffffff82169050919050565b61418f81614176565b811461419a57600080fd5b50565b6000815190506141ac81614186565b92915050565b6000806000606084860312156141cb576141ca612bb2565b5b60006141d986828701614161565b93505060206141ea86828701614161565b92505060406141fb8682870161419d565b9150509250925092565b600060808201905061421a6000830187613338565b6142276020830186613338565b6142346040830185612e6b565b81810360608301526142468184612d96565b905095945050505050565b61425a81613159565b82525050565b60408201600082015161427660008501826134a0565b5060208201516142896020850182614251565b50505050565b60006040820190506142a46000830184614260565b92915050565b6142b38161338c565b82525050565b6142c281612bf5565b82525050565b600060a0820190506142dd6000830188612e6b565b6142ea6020830187613362565b6142f760408301866142aa565b61430460608301856142b9565b81810360808301526143168184612d96565b90509695505050505050565b60008151905061433181613396565b92915050565b6000806040838503121561434e5761434d612bb2565b5b600061435c85828601614322565b925050602061436d85828601614322565b9150509250929050565b60006143828261338c565b91507f800000000000000000000000000000000000000000000000000000000000000082036143b4576143b3613d80565b5b816000039050919050565b6000819050919050565b60006143e46143df6143da846143bf565b612df1565b612c53565b9050919050565b6143f4816143c9565b82525050565b600060808201905061440f6000830187613338565b61441c6020830186613338565b6144296040830185613338565b61443660608301846143eb565b95945050505050565b600081600f0b9050919050565b6144558161443f565b82525050565b6000608082019050614470600083018761444c565b61447d602083018661444c565b61448a6040830185613338565b61449760608301846143eb565b95945050505050565b600060a0820190506144b56000830188613b07565b6144c26020830187613b07565b6144cf6040830186613338565b6144dc60608301856143eb565b6144e96080830184613338565b9695505050505050565b60006040820190506145086000830185613338565b61451560208301846143eb565b9392505050565b600060a082019050614531600083018861444c565b61453e602083018761444c565b61454b6040830186613338565b61455860608301856143eb565b6145656080830184612e6b565b9695505050505050565b60006060820190506145846000830186613338565b6145916020830185612e6b565b61459e6040830184612e6b565b949350505050565b600060e0820190506145bb600083018a612e6b565b6145c86020830189612e6b565b6145d56040830188613338565b6145e26060830187612e6b565b6145ef6080830186613b07565b6145fc60a0830185612e6b565b61460960c0830184613338565b98975050505050505050565b600061462082612c53565b915061462b83612c53565b925082820261463981612c53565b915082820484148315176146505761464f613d80565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061469182612c53565b915061469c83612c53565b9250826146ac576146ab614657565b5b828204905092915050565b7f556e697377617056324c6962726172793a20494e53554646494349454e545f4960008201527f4e5055545f414d4f554e54000000000000000000000000000000000000000000602082015250565b6000614713602b83613727565b915061471e826146b7565b604082019050919050565b6000602082019050818103600083015261474281614706565b9050919050565b7f556e697377617056324c6962726172793a20494e53554646494349454e545f4c60008201527f4951554944495459000000000000000000000000000000000000000000000000602082015250565b60006147a5602883613727565b91506147b082614749565b604082019050919050565b600060208201905081810360008301526147d481614798565b9050919050565b7f4653523a204446526f7574657300000000000000000000000000000000000000600082015250565b6000614811600d83613727565b915061481c826147db565b602082019050919050565b6000602082019050818103600083015261484081614804565b9050919050565b7f4653523a20444653746570730000000000000000000000000000000000000000600082015250565b600061487d600c83613727565b915061488882614847565b602082019050919050565b600060208201905081810360008301526148ac81614870565b9050919050565b7f5341000000000000000000000000000000000000000000000000000000000000600082015250565b60006148e9600283613727565b91506148f4826148b3565b602082019050919050565b60006020820190508181036000830152614918816148dc565b905091905056
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000fc00000000000000000000000000000000000006000000000000000000000000fc000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001
-----Decoded View---------------
Arg [0] : _WETH9 (address): 0xFC00000000000000000000000000000000000006
Arg [1] : _FRAX (address): 0xFc00000000000000000000000000000000000001
Arg [2] : _CHECK_AMOUNTOUT_IN_ROUTER (bool): True
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000fc00000000000000000000000000000000000006
Arg [1] : 000000000000000000000000fc00000000000000000000000000000000000001
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000001
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in FRAX
0.000018
Token Allocations
FRAX
100.00%
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| FRAXTAL | 100.00% | $1.04 | 0.00001784 | $0.000019 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.