Source Code
Overview
S Balance
S Value
$0.00Latest 25 from a total of 170 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Zap Out ETH | 37845410 | 201 days ago | IN | 0 S | 0.01492425 | ||||
| Zap Out ETH | 37845204 | 201 days ago | IN | 0 S | 0.01762223 | ||||
| Zap Out ETH | 36132164 | 214 days ago | IN | 0 S | 0.01161822 | ||||
| Zap Out ETH | 36132015 | 214 days ago | IN | 0 S | 0.01411862 | ||||
| Zap In Token | 33632020 | 229 days ago | IN | 0 S | 0.01451592 | ||||
| Zap In Token | 31647624 | 238 days ago | IN | 0 S | 0.01101922 | ||||
| Zap In Token | 31647436 | 238 days ago | IN | 0 S | 0.01187422 | ||||
| Zap Out ETH | 30164714 | 244 days ago | IN | 0 S | 0.01646203 | ||||
| Zap In Token | 29814385 | 246 days ago | IN | 0 S | 0.01659278 | ||||
| Zap In Token | 29347847 | 248 days ago | IN | 0 S | 0.01659278 | ||||
| Zap In Token | 29196006 | 248 days ago | IN | 0 S | 0.01513093 | ||||
| Zap Out ETH | 28245888 | 252 days ago | IN | 0 S | 0.02146204 | ||||
| Zap In Token | 28094206 | 253 days ago | IN | 0 S | 0.01758031 | ||||
| Zap Out ETH | 27597635 | 255 days ago | IN | 0 S | 0.01226932 | ||||
| Zap In ETH | 27488211 | 255 days ago | IN | 108 S | 0.01946153 | ||||
| Zap Out ETH | 27224544 | 256 days ago | IN | 0 S | 0.01423369 | ||||
| Zap Out ETH | 26969698 | 257 days ago | IN | 0 S | 0.01161582 | ||||
| Zap Out ETH | 26969491 | 257 days ago | IN | 0 S | 0.01409747 | ||||
| Zap Out ETH | 26455145 | 259 days ago | IN | 0 S | 0.01848924 | ||||
| Zap In Token | 26355138 | 260 days ago | IN | 0 S | 0.01294777 | ||||
| Zap Out ETH | 26206196 | 260 days ago | IN | 0 S | 0.01887135 | ||||
| Zap Out ETH | 26204716 | 260 days ago | IN | 0 S | 0.01776826 | ||||
| Zap Out ETH | 25881899 | 262 days ago | IN | 0 S | 0.01226332 | ||||
| Zap In Token | 25863738 | 262 days ago | IN | 0 S | 0.01654576 | ||||
| Zap In ETH | 25604360 | 263 days ago | IN | 20 S | 0.01747271 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 37845410 | 201 days ago | 1.35114792 S | ||||
| 37845410 | 201 days ago | 1.35114792 S | ||||
| 37845204 | 201 days ago | 199.58796666 S | ||||
| 37845204 | 201 days ago | 199.58796666 S | ||||
| 36132164 | 214 days ago | 14.74319927 S | ||||
| 36132164 | 214 days ago | 14.74319927 S | ||||
| 36132015 | 214 days ago | 5,973.89168859 S | ||||
| 36132015 | 214 days ago | 5,973.89168859 S | ||||
| 30164714 | 244 days ago | 0.05091702 S | ||||
| 30164714 | 244 days ago | 0.05091702 S | ||||
| 28245888 | 252 days ago | 93.48943494 S | ||||
| 28245888 | 252 days ago | 93.48943494 S | ||||
| 27597635 | 255 days ago | 19.73071404 S | ||||
| 27597635 | 255 days ago | 19.73071404 S | ||||
| 27488211 | 255 days ago | 108 S | ||||
| 27224544 | 256 days ago | 254.14610432 S | ||||
| 27224544 | 256 days ago | 254.14610432 S | ||||
| 26969698 | 257 days ago | 658.05390001 S | ||||
| 26969698 | 257 days ago | 658.05390001 S | ||||
| 26969491 | 257 days ago | 0.01433233 S | ||||
| 26969491 | 257 days ago | 0.01433233 S | ||||
| 26455145 | 259 days ago | 44.08641886 S | ||||
| 26455145 | 259 days ago | 44.08641886 S | ||||
| 26206196 | 260 days ago | 13.51283728 S | ||||
| 26206196 | 260 days ago | 13.51283728 S |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ZapV1
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IUniswapPair} from "./interfaces/IUniswapPair.sol";
import {IUniswapRouter02} from "./interfaces/IUniswapRouter02.sol";
import {IWETH} from "./interfaces/IWETH.sol";
import {Babylonian} from "./libraries/Babylonian.sol";
import {IUniswapRouter01} from "./interfaces/IUniswapRouter01.sol";
/*
* @author Inspiration from the work of Zapper and Beefy.
* Implemented and modified for Uniswap.
*/
contract ZapV1 is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
// Interface for Wrapped ETH (WETH)
IWETH public WETH;
// UniswapRouter interface
IUniswapRouter02 public uniswapRouter;
// Maximum integer (used for managing allowance)
uint256 public constant MAX_INT = 2**256 - 1;
// Minimum amount for a swap (derived from Uniswap)
uint256 public constant MINIMUM_AMOUNT = 1000;
// Maximum reverse zap ratio (100 --> 1%, 1000 --> 0.1%)
uint256 public maxZapReverseRatio;
// Address UniswapRouter
address private uniswapRouterAddress;
// Address Wrapped ETH (WETH)
address private WETHAddress;
// Owner recovers token
event AdminTokenRecovery(address indexed tokenAddress, uint256 amountTokens);
// Owner changes the maxZapReverseRatio
event NewMaxZapReverseRatio(uint256 maxZapReverseRatio);
// tokenToZap = 0x00 address if ETH
event ZapIn(
address indexed tokenToZap,
address indexed lpToken,
uint256 tokenAmountIn,
uint256 lpTokenAmountReceived,
address indexed user
);
// token0ToZap = 0x00 address if ETH
event ZapInRebalancing(
address indexed token0ToZap,
address indexed token1ToZap,
address lpToken,
uint256 token0AmountIn,
uint256 token1AmountIn,
uint256 lpTokenAmountReceived,
address indexed user
);
// tokenToReceive = 0x00 address if ETH
event ZapOut(
address indexed lpToken,
address indexed tokenToReceive,
uint256 lpTokenAmount,
uint256 tokenAmountReceived,
address indexed user
);
/*
* @notice Fallback for WETH
*/
receive() external payable {
assert(msg.sender == WETHAddress);
}
/*
* @notice Constructor
* @param _WETHAddress: address of the WETH contract
* @param _uniswapRouter: address of the UniswapRouter
* @param _maxZapReverseRatio: maximum zap ratio
*/
constructor(
address _WETHAddress,
address _uniswapRouter,
uint256 _maxZapReverseRatio
) {
WETHAddress = _WETHAddress;
WETH = IWETH(_WETHAddress);
uniswapRouterAddress = _uniswapRouter;
uniswapRouter = IUniswapRouter02(_uniswapRouter);
maxZapReverseRatio = _maxZapReverseRatio;
}
/*
* @notice Zap ETH in a WETH pool (e.g. WETH/token)
* @param _lpToken: LP token address (e.g. TOKEN/ETH)
* @param _tokenAmountOutMin: minimum token amount (e.g. TOKEN) to receive in the intermediary swap (e.g. ETH --> TOKEN)
*/
function zapInETH(address _lpToken, uint256 _tokenAmountOutMin) external payable nonReentrant {
WETH.deposit{value: msg.value}();
address token0 = IUniswapPair(_lpToken).token0();
address token1 = IUniswapPair(_lpToken).token1();
bool isStable = IUniswapPair(_lpToken).stable();
// Ensure one of the tokens is WETH
require(token0 == WETHAddress || token1 == WETHAddress, "Zap: LP token must contain WETH");
// Define the other token in the pair
address tokenAddress = token0 == WETHAddress ? token1 : token0;
// Calculate amount to swap (approximately half)
uint256 halfETH = msg.value / 2;
// Approve WETH if needed
_approveTokenIfNeeded(WETHAddress);
// Create route
IUniswapRouter01.route[] memory routes = new IUniswapRouter01.route[](1);
routes[0] = IUniswapRouter01.route({
from: WETHAddress,
to: tokenAddress,
stable: isStable
});
// Swap half of ETH for the other token
uint256[] memory swapped = uniswapRouter.swapExactTokensForTokens(
halfETH,
_tokenAmountOutMin,
routes,
address(this),
block.timestamp
);
// Approve the other token
_approveTokenIfNeeded(tokenAddress);
// Add liquidity
(, , uint256 lpTokenReceived) = uniswapRouter.addLiquidity(
WETHAddress,
tokenAddress,
isStable,
msg.value - halfETH,
swapped[1],
1,
1,
address(msg.sender),
block.timestamp
);
// Emit event
emit ZapIn(
address(0x0000000000000000000000000000000000000000),
_lpToken,
msg.value,
lpTokenReceived,
address(msg.sender)
);
}
/*
* @notice Zap a token in (e.g. token/other token)
* @param _tokenToZap: token to zap
* @param _tokenAmountIn: amount of token to swap
* @param _lpToken: LP token address (e.g. TOKEN/BUSD)
* @param _tokenAmountOutMin: minimum token to receive (e.g. TOKEN) in the intermediary swap (e.g. BUSD --> TOKEN)
*/
function zapInToken(
address _tokenToZap,
uint256 _tokenAmountIn,
address _lpToken,
uint256 _tokenAmountOutMin
) external nonReentrant {
// Transfer tokens to this contract
IERC20(_tokenToZap).safeTransferFrom(address(msg.sender), address(this), _tokenAmountIn);
// Call zap function
uint256 lpTokenAmountTransferred = _zapIn(_tokenToZap, _tokenAmountIn, _lpToken, _tokenAmountOutMin);
// Emit event
emit ZapIn(_tokenToZap, _lpToken, _tokenAmountIn, lpTokenAmountTransferred, address(msg.sender));
}
/*
* @notice Zap two tokens in, rebalance them to 50-50, before adding them to LP
* @param _token0ToZap: address of token0 to zap
* @param _token1ToZap: address of token1 to zap
* @param _token0AmountIn: amount of token0 to zap
* @param _token1AmountIn: amount of token1 to zap
* @param _lpToken: LP token address (token0/token1)
* @param _tokenAmountInMax: maximum token amount to sell (in token to sell in the intermediary swap)
* @param _tokenAmountOutMin: minimum token to receive in the intermediary swap
* @param _isToken0Sold: whether token0 is expected to be sold (if false, sell token1)
*/
function zapInTokenRebalancing(
address _token0ToZap,
address _token1ToZap,
uint256 _token0AmountIn,
uint256 _token1AmountIn,
address _lpToken,
uint256 _tokenAmountInMax,
uint256 _tokenAmountOutMin,
bool _isToken0Sold
) external nonReentrant {
// Transfer tokens to this contract
IERC20(_token0ToZap).safeTransferFrom(address(msg.sender), address(this), _token0AmountIn);
IERC20(_token1ToZap).safeTransferFrom(address(msg.sender), address(this), _token1AmountIn);
// Call zapIn function
uint256 lpTokenAmountTransferred = _zapInRebalancing(
_token0ToZap,
_token1ToZap,
_token0AmountIn,
_token1AmountIn,
_lpToken,
_tokenAmountInMax,
_tokenAmountOutMin,
_isToken0Sold
);
// Emit event
emit ZapInRebalancing(
_token0ToZap,
_token1ToZap,
_lpToken,
_token0AmountIn,
_token1AmountIn,
lpTokenAmountTransferred,
address(msg.sender)
);
}
/*
* @notice Zap 1 token and ETH, rebalance them to 50-50, before adding them to LP
* @param _token1ToZap: address of token1 to zap
* @param _token1AmountIn: amount of token1 to zap
* @param _lpToken: LP token address
* @param _tokenAmountInMax: maximum token amount to sell (in token to sell in the intermediary swap)
* @param _tokenAmountOutMin: minimum token to receive in the intermediary swap
* @param _isToken0Sold: whether token0 is expected to be sold (if false, sell token1)
*/
function zapInETHRebalancing(
address _token1ToZap,
uint256 _token1AmountIn,
address _lpToken,
uint256 _tokenAmountInMax,
uint256 _tokenAmountOutMin,
bool _isToken0Sold
) external payable nonReentrant {
WETH.deposit{value: msg.value}();
IERC20(_token1ToZap).safeTransferFrom(address(msg.sender), address(this), _token1AmountIn);
// Call zapIn function
uint256 lpTokenAmountTransferred = _zapInRebalancing(
WETHAddress,
_token1ToZap,
msg.value,
_token1AmountIn,
_lpToken,
_tokenAmountInMax,
_tokenAmountOutMin,
_isToken0Sold
);
// Emit event
emit ZapInRebalancing(
address(0x0000000000000000000000000000000000000000),
_token1ToZap,
_lpToken,
msg.value,
_token1AmountIn,
lpTokenAmountTransferred,
address(msg.sender)
);
}
/*
* @notice Zap a LP token out to receive ETH
* @param _lpToken: LP token address (e.g. TOKEN/WETH)
* @param _lpTokenAmount: amount of LP tokens to zap out
* @param _tokenAmountOutMin: minimum amount to receive (in ETH/WETH) in the intermediary swap (e.g. TOKEN --> ETH)
*/
function zapOutETH(
address _lpToken,
uint256 _lpTokenAmount,
uint256 _tokenAmountOutMin
) external nonReentrant {
// Transfer LP token to this address
IERC20(_lpToken).safeTransferFrom(address(msg.sender), address(_lpToken), _lpTokenAmount);
// Call zapOut
uint256 tokenAmountToTransfer = _zapOut(_lpToken, WETHAddress, _tokenAmountOutMin);
// Unwrap ETH
WETH.withdraw(tokenAmountToTransfer);
// Transfer ETH to the msg.sender
(bool success, ) = msg.sender.call{value: tokenAmountToTransfer}(new bytes(0));
require(success, "ETH: transfer fail");
// Emit event
emit ZapOut(
_lpToken,
address(0x0000000000000000000000000000000000000000),
_lpTokenAmount,
tokenAmountToTransfer,
address(msg.sender)
);
}
/*
* @notice Zap a LP token out (to receive a token)
* @param _lpToken: LP token address (e.g. TOKEN/BUSD)
* @param _tokenToReceive: one of the 2 tokens from the LP (e.g. TOKEN or BUSD)
* @param _lpTokenAmount: amount of LP tokens to zap out
* @param _tokenAmountOutMin: minimum token to receive (e.g. TOKEN) in the intermediary swap (e.g. BUSD --> TOKEN)
*/
function zapOutToken(
address _lpToken,
address _tokenToReceive,
uint256 _lpTokenAmount,
uint256 _tokenAmountOutMin
) external nonReentrant {
// Transfer LP token to this address
IERC20(_lpToken).safeTransferFrom(address(msg.sender), address(_lpToken), _lpTokenAmount);
uint256 tokenAmountToTransfer = _zapOut(_lpToken, _tokenToReceive, _tokenAmountOutMin);
IERC20(_tokenToReceive).safeTransfer(address(msg.sender), tokenAmountToTransfer);
emit ZapOut(_lpToken, _tokenToReceive, _lpTokenAmount, tokenAmountToTransfer, msg.sender);
}
/**
* @notice It allows the owner to change the risk parameter for quantities
* @param _maxZapInverseRatio: new inverse ratio
* @dev This function is only callable by owner.
*/
function updateMaxZapInverseRatio(uint256 _maxZapInverseRatio) external onlyOwner {
maxZapReverseRatio = _maxZapInverseRatio;
emit NewMaxZapReverseRatio(_maxZapInverseRatio);
}
/**
* @notice It allows the owner to recover wrong tokens sent to the contract
* @param _tokenAddress: the address of the token to withdraw (18 decimals)
* @param _tokenAmount: the number of token amount to withdraw
* @dev This function is only callable by owner.
*/
function recoverWrongTokens(address _tokenAddress, uint256 _tokenAmount) external onlyOwner {
IERC20(_tokenAddress).safeTransfer(address(msg.sender), _tokenAmount);
emit AdminTokenRecovery(_tokenAddress, _tokenAmount);
}
/*
* @notice View the details for single zap
* @dev Use WETH for _tokenToZap (if ETH is the input)
* @param _tokenToZap: address of the token to zap
* @param _tokenAmountIn: amount of token to zap inputed
* @param _lpToken: address of the LP token
* @return swapAmountIn: amount that is expected to get swapped in intermediary swap
* @return swapAmountOut: amount that is expected to get received in intermediary swap
* @return swapTokenOut: token address of the token that is used in the intermediary swap
*/
function estimateZapInSwap(
address _tokenToZap,
uint256 _tokenAmountIn,
address _lpToken
)
external
view
returns (
uint256 swapAmountIn,
uint256 swapAmountOut,
address swapTokenOut
)
{
address token0 = IUniswapPair(_lpToken).token0();
address token1 = IUniswapPair(_lpToken).token1();
require(_tokenToZap == token0 || _tokenToZap == token1, "Zap: Wrong tokens");
// Convert to uint256 (from uint112)
(uint256 reserveA, uint256 reserveB, ) = IUniswapPair(_lpToken).getReserves();
if (token0 == _tokenToZap) {
swapTokenOut = token1;
swapAmountIn = _calculateAmountToSwap(_tokenAmountIn, token0, token1, reserveA, reserveB);
swapAmountOut = _getAmountOut(swapAmountIn, token0, token1);
} else {
swapTokenOut = token0;
swapAmountIn = _calculateAmountToSwap(_tokenAmountIn, token1, token0, reserveB, reserveA);
swapAmountOut = _getAmountOut(swapAmountIn, token1, token0);
}
return (swapAmountIn, swapAmountOut, swapTokenOut);
}
/*
* @notice View the details for a rebalancing zap
* @dev Use WETH for _token0ToZap (if ETH is the input)
* @param _token0ToZap: address of the token0 to zap
* @param _token1ToZap: address of the token0 to zap
* @param _token0AmountIn: amount for token0 to zap
* @param _token1AmountIn: amount for token1 to zap
* @param _lpToken: address of the LP token
* @return swapAmountIn: amount that is expected to get swapped in intermediary swap
* @return swapAmountOut: amount that is expected to get received in intermediary swap
* @return isToken0Sold: whether the token0 is sold (false --> token1 is sold in the intermediary swap)
*/
function estimateZapInRebalancingSwap(
address _token0ToZap,
address _token1ToZap,
uint256 _token0AmountIn,
uint256 _token1AmountIn,
address _lpToken
)
external
view
returns (
uint256 swapAmountIn,
uint256 swapAmountOut,
bool sellToken0
)
{
require(
_token0ToZap == IUniswapPair(_lpToken).token0() || _token0ToZap == IUniswapPair(_lpToken).token1(),
"Zap: Wrong token0"
);
require(
_token1ToZap == IUniswapPair(_lpToken).token0() || _token1ToZap == IUniswapPair(_lpToken).token1(),
"Zap: Wrong token1"
);
require(_token0ToZap != _token1ToZap, "Zap: Same tokens");
// Convert to uint256 (from uint112)
(uint256 reserveA, uint256 reserveB, ) = IUniswapPair(_lpToken).getReserves();
if (_token0ToZap == IUniswapPair(_lpToken).token0()) {
sellToken0 = (_token0AmountIn * reserveB > _token1AmountIn * reserveA) ? true : false;
// Calculate the amount that is expected to be swapped
swapAmountIn = _calculateAmountToSwapForRebalancing(
_token0AmountIn,
_token1AmountIn,
reserveA,
reserveB,
sellToken0
);
// Calculate the amount expected to be received in the intermediary swap
if (sellToken0) {
swapAmountOut = _getAmountOut(swapAmountIn, _token0ToZap, _token1ToZap);
} else {
swapAmountOut = _getAmountOut(swapAmountIn, _token1ToZap, _token0ToZap);
}
} else {
sellToken0 = (_token0AmountIn * reserveA > _token1AmountIn * reserveB) ? true : false;
// Calculate the amount that is expected to be swapped
swapAmountIn = _calculateAmountToSwapForRebalancing(
_token0AmountIn,
_token1AmountIn,
reserveB,
reserveA,
sellToken0
);
// Calculate the amount expected to be received in the intermediary swap
if (sellToken0) {
swapAmountOut = _getAmountOut(swapAmountIn, _token1ToZap, _token0ToZap);
} else {
swapAmountOut = _getAmountOut(swapAmountIn, _token0ToZap, _token1ToZap);
}
}
return (swapAmountIn, swapAmountOut, sellToken0);
}
/*
* @notice View the details for single zap
* @dev Use WETH for _tokenToReceive (if ETH is the asset to be received)
* @param _lpToken: address of the LP token to zap out
* @param _lpTokenAmount: amount of LP token to zap out
* @param _tokenToReceive: token address to receive
* @return swapAmountIn: amount that is expected to get swapped for intermediary swap
* @return swapAmountOut: amount that is expected to get received for intermediary swap
* @return swapTokenOut: address of the token that is sold in the intermediary swap
*/
function estimateZapOutSwap(
address _lpToken,
uint256 _lpTokenAmount,
address _tokenToReceive
)
external
view
returns (
uint256 swapAmountIn,
uint256 swapAmountOut,
address swapTokenOut
)
{
address token0 = IUniswapPair(_lpToken).token0();
address token1 = IUniswapPair(_lpToken).token1();
require(_tokenToReceive == token0 || _tokenToReceive == token1, "Zap: Token not in LP");
// Convert to uint256 (from uint112)
(uint256 reserveA, uint256 reserveB, ) = IUniswapPair(_lpToken).getReserves();
if (token1 == _tokenToReceive) {
// sell token0
uint256 tokenAmountIn = (_lpTokenAmount * reserveA) / IUniswapPair(_lpToken).totalSupply();
swapAmountIn = _calculateAmountToSwap(tokenAmountIn, token0, token1, reserveA, reserveB);
swapAmountOut = _getAmountOut(swapAmountIn, token0, token1);
swapTokenOut = token0;
} else {
// sell token1
uint256 tokenAmountIn = (_lpTokenAmount * reserveB) / IUniswapPair(_lpToken).totalSupply();
swapAmountIn = _calculateAmountToSwap(tokenAmountIn, token0, token1, reserveB, reserveA);
swapAmountOut = _getAmountOut(swapAmountIn, token0, token1);
swapTokenOut = token1;
}
return (swapAmountIn, swapAmountOut, swapTokenOut);
}
/*
* @notice Zap a token in (e.g. token/other token)
* @param _tokenToZap: token to zap
* @param _tokenAmountIn: amount of token to swap
* @param _lpToken: LP token address
* @param _tokenAmountOutMin: minimum token to receive in the intermediary swap
*/
function _zapIn(
address _tokenToZap,
uint256 _tokenAmountIn,
address _lpToken,
uint256 _tokenAmountOutMin
) internal returns (uint256 lpTokenReceived) {
require(_tokenAmountIn >= MINIMUM_AMOUNT, "Zap: Amount too low");
address token0 = IUniswapPair(_lpToken).token0();
address token1 = IUniswapPair(_lpToken).token1();
bool isStable = IUniswapPair(_lpToken).stable();
require(_tokenToZap == token0 || _tokenToZap == token1, "Zap: Wrong tokens");
// Create route structure for the swap
IUniswapRouter01.route[] memory routes = new IUniswapRouter01.route[](1);
routes[0] = IUniswapRouter01.route({
from: _tokenToZap,
to: _tokenToZap == token0 ? token1 : token0,
stable: isStable
});
// Initiates an estimation to swap
uint256 swapAmountIn;
{
// Convert to uint256 (from uint112)
(uint256 reserveA, uint256 reserveB, ) = IUniswapPair(_lpToken).getReserves();
require((reserveA >= MINIMUM_AMOUNT) && (reserveB >= MINIMUM_AMOUNT), "Zap: Reserves too low");
if (token0 == _tokenToZap) {
swapAmountIn = _calculateAmountToSwapSolidly(_tokenAmountIn, _tokenToZap, routes[0].to);
require(reserveA / swapAmountIn >= maxZapReverseRatio, "Zap: Quantity higher than limit");
} else {
swapAmountIn = _calculateAmountToSwapSolidly(_tokenAmountIn, _tokenToZap, routes[0].to);
require(reserveB / swapAmountIn >= maxZapReverseRatio, "Zap: Quantity higher than limit");
}
}
// Approve token to zap if necessary
_approveTokenIfNeeded(_tokenToZap);
uint256[] memory swapedAmounts = uniswapRouter.swapExactTokensForTokens(
swapAmountIn,
_tokenAmountOutMin,
routes,
address(this),
block.timestamp
);
// Approve other token if necessary
if (token0 == _tokenToZap) {
_approveTokenIfNeeded(token1);
} else {
_approveTokenIfNeeded(token0);
}
// Add liquidity and return the amount of LP received
(, , lpTokenReceived) = uniswapRouter.addLiquidity(
routes[0].from,
routes[0].to,
isStable,
_tokenAmountIn - swapedAmounts[0],
swapedAmounts[1],
1,
1,
address(msg.sender),
block.timestamp
);
return lpTokenReceived;
}
/*
* @notice Zap two tokens in, rebalance them to 50-50, before adding them to LP
* @param _token0ToZap: address of token0 to zap
* @param _token1ToZap: address of token1 to zap
* @param _token0AmountIn: amount of token0 to zap
* @param _token1AmountIn: amount of token1 to zap
* @param _lpToken: LP token address
* @param _tokenAmountInMax: maximum token amount to sell (in token to sell in the intermediary swap)
* @param _tokenAmountOutMin: minimum token to receive in the intermediary swap
* @param _isToken0Sold: whether token0 is expected to be sold (if false, sell token1)
*/
function _zapInRebalancing(
address _token0ToZap,
address _token1ToZap,
uint256 _token0AmountIn,
uint256 _token1AmountIn,
address _lpToken,
uint256 _tokenAmountInMax,
uint256 _tokenAmountOutMin,
bool _isToken0Sold
) internal returns (uint256 lpTokenReceived) {
// Validate tokens
_validateTokensForRebalancing(_token0ToZap, _token1ToZap, _lpToken);
// Calculate the amount to swap
uint256 swapAmountIn = _calculateSwapAmountForRebalancing(
_token0ToZap, _token1ToZap, _token0AmountIn, _token1AmountIn, _lpToken, _isToken0Sold
);
require(swapAmountIn <= _tokenAmountInMax, "Zap: Amount to swap too high");
// Execute swap
uint256[] memory swapedAmounts = _executeSwap(
_token0ToZap, _token1ToZap, swapAmountIn, _tokenAmountOutMin, _isToken0Sold, _lpToken
);
// Add liquidity and return the amount of LP received
return _addLiquidityAfterRebalancing(
_token0ToZap, _token1ToZap, _token0AmountIn, _token1AmountIn,
swapedAmounts, _isToken0Sold
);
}
// New helper functions to decompose the logic
function _validateTokensForRebalancing(
address _token0ToZap,
address _token1ToZap,
address _lpToken
) private view {
require(
_token0ToZap == IUniswapPair(_lpToken).token0() || _token0ToZap == IUniswapPair(_lpToken).token1(),
"Zap: Wrong token0"
);
require(
_token1ToZap == IUniswapPair(_lpToken).token0() || _token1ToZap == IUniswapPair(_lpToken).token1(),
"Zap: Wrong token1"
);
require(_token0ToZap != _token1ToZap, "Zap: Same tokens");
}
function _calculateSwapAmountForRebalancing(
address _token0ToZap,
address _token1ToZap,
uint256 _token0AmountIn,
uint256 _token1AmountIn,
address _lpToken,
bool _isToken0Sold
) private view returns (uint256 amountToSwap) {
// Convert to uint256 (from uint112)
(uint256 reserveA, uint256 reserveB, ) = IUniswapPair(_lpToken).getReserves();
uint256 swapAmountIn;
if (_token0ToZap == IUniswapPair(_lpToken).token0()) {
swapAmountIn = _calculateAmountToSwapForRebalancing(
_token0AmountIn, _token1AmountIn, reserveA, reserveB, _isToken0Sold
);
require(reserveA / swapAmountIn >= maxZapReverseRatio, "Zap: Quantity higher than limit");
} else {
swapAmountIn = _calculateAmountToSwapForRebalancing(
_token0AmountIn, _token1AmountIn, reserveB, reserveA, _isToken0Sold
);
require(reserveB / swapAmountIn >= maxZapReverseRatio, "Zap: Quantity higher than limit");
}
return swapAmountIn;
}
function _executeSwap(
address _token0ToZap,
address _token1ToZap,
uint256 _swapAmountIn,
uint256 _tokenAmountOutMin,
bool _isToken0Sold,
address _lpToken
) private returns (uint256[] memory) {
IUniswapRouter01.route[] memory routes = new IUniswapRouter01.route[](1);
bool isStable = IUniswapPair(_lpToken).stable();
// Define the route for the swap and check if token approval is needed
if (_isToken0Sold) {
routes[0] = IUniswapRouter01.route({
from: _token0ToZap,
to: _token1ToZap,
stable: isStable
});
_approveTokenIfNeeded(_token0ToZap);
} else {
routes[0] = IUniswapRouter01.route({
from: _token1ToZap,
to: _token0ToZap,
stable: isStable
});
_approveTokenIfNeeded(_token1ToZap);
}
// Execute the swap and retrieve the received amount
return uniswapRouter.swapExactTokensForTokens(
_swapAmountIn,
_tokenAmountOutMin,
routes,
address(this),
block.timestamp
);
}
function _addLiquidityAfterRebalancing(
address _token0ToZap,
address _token1ToZap,
uint256 _token0AmountIn,
uint256 _token1AmountIn,
uint256[] memory swapedAmounts,
bool _isToken0Sold
) private returns (uint256 lpTokenReceived) {
if (_isToken0Sold) {
_approveTokenIfNeeded(_token1ToZap);
address[] memory path = new address[](2);
path[0] = _token0ToZap;
path[1] = _token1ToZap;
(, , lpTokenReceived) = uniswapRouter.addLiquidity(
path[0],
path[1],
false, // stable = false
(_token0AmountIn - swapedAmounts[0]),
(_token1AmountIn + swapedAmounts[1]),
1,
1,
address(msg.sender),
block.timestamp
);
} else {
_approveTokenIfNeeded(_token0ToZap);
address[] memory path = new address[](2);
path[0] = _token1ToZap;
path[1] = _token0ToZap;
(, , lpTokenReceived) = uniswapRouter.addLiquidity(
path[0],
path[1],
false, // stable = false
(_token1AmountIn - swapedAmounts[0]),
(_token0AmountIn + swapedAmounts[1]),
1,
1,
address(msg.sender),
block.timestamp
);
}
return lpTokenReceived;
}
/*
* @notice Zap a LP token out to a token (e.g. token/other token)
* @param _lpToken: LP token address
* @param _tokenToReceive: token address
* @param _tokenAmountOutMin: minimum token to receive in the intermediary swap
*/
function _zapOut(
address _lpToken,
address _tokenToReceive,
uint256 _tokenAmountOutMin
) internal returns (uint256) {
address token0 = IUniswapPair(_lpToken).token0();
address token1 = IUniswapPair(_lpToken).token1();
bool isStable = IUniswapPair(_lpToken).stable();
require(_tokenToReceive == token0 || _tokenToReceive == token1, "Zap: Token not in LP");
// Burn all LP tokens to receive the two tokens to this address
(uint256 amount0, uint256 amount1) = IUniswapPair(_lpToken).burn(address(this));
require(amount0 >= MINIMUM_AMOUNT, "Zap: INSUFFICIENT_A_AMOUNT");
require(amount1 >= MINIMUM_AMOUNT, "Zap: INSUFFICIENT_B_AMOUNT");
IUniswapRouter01.route[] memory routes = new IUniswapRouter01.route[](1);
uint256 swapAmountIn;
if (token0 == _tokenToReceive) {
routes[0] = IUniswapRouter01.route({
from: token1,
to: token0,
stable: isStable
});
swapAmountIn = IERC20(token1).balanceOf(address(this));
// Approve token to sell if necessary
_approveTokenIfNeeded(token1);
} else {
routes[0] = IUniswapRouter01.route({
from: token0,
to: token1,
stable: isStable
});
swapAmountIn = IERC20(token0).balanceOf(address(this));
// Approve token to sell if necessary
_approveTokenIfNeeded(token0);
}
// Swap tokens
uniswapRouter.swapExactTokensForTokens(
swapAmountIn,
_tokenAmountOutMin,
routes,
address(this),
block.timestamp
);
// Return full balance for the token to receive by the sender
return IERC20(_tokenToReceive).balanceOf(address(this));
}
/*
* @notice Allows to zap a token in (e.g. token/other token)
* @param _token: token address
*/
function _approveTokenIfNeeded(address _token) private {
if (IERC20(_token).allowance(address(this), uniswapRouterAddress) < 1e24) {
// Re-approve
IERC20(_token).safeApprove(uniswapRouterAddress, MAX_INT);
}
}
/*
* @notice Calculate the swap amount to get the price at 50/50 split
* @param _token0AmountIn: amount of token 0
* @param _token0: address of token0
* @param _token1: address of token1
* @param _reserve0: amount in reserve for token0
* @param _reserve1: amount in reserve for token1
* @return amountToSwap: swapped amount (in token0)
*/
function _calculateAmountToSwap(
uint256 _token0AmountIn,
address _token0,
address _token1,
uint256 _reserve0,
uint256 _reserve1
) private view returns (uint256 amountToSwap) {
uint256 halfToken0Amount = _token0AmountIn / 2;
(uint256 nominator, ) = uniswapRouter.getAmountOut(halfToken0Amount, _token0, _token1);
uint256 denominator = uniswapRouter.quote(
halfToken0Amount,
_reserve0 + halfToken0Amount,
_reserve1 - nominator
);
// Adjustment for price impact
amountToSwap =
_token0AmountIn -
Babylonian.sqrt((halfToken0Amount * halfToken0Amount * nominator) / denominator);
return amountToSwap;
}
/*
* @notice Calculate the amount to swap to get the tokens at a 50/50 split
* @param _token0AmountIn: amount of token 0
* @param _token1AmountIn: amount of token 1
* @param _reserve0: amount in reserve for token0
* @param _reserve1: amount in reserve for token1
* @param _isToken0Sold: whether token0 is expected to be sold (if false, sell token1)
* @return amountToSwap: swapped amount in token0 (if _isToken0Sold is true) or token1 (if _isToken0Sold is false)
*/
function _calculateAmountToSwapForRebalancing(
uint256 _token0AmountIn,
uint256 _token1AmountIn,
uint256 _reserve0,
uint256 _reserve1,
bool _isToken0Sold
) private view returns (uint256 amountToSwap) {
bool sellToken0 = (_token0AmountIn * _reserve1 > _token1AmountIn * _reserve0) ? true : false;
require(sellToken0 == _isToken0Sold, "Zap: Wrong trade direction");
// For Solidly/Velodrome, we cannot use the same complex logic
// that depends on getAmountOut with reserves. We'll simplify:
// Swap about half the amount to achieve a 50/50 distribution
amountToSwap = _token0AmountIn / 2;
return amountToSwap;
}
// New function to calculate swap amounts with Solidly/Velodrome
function _calculateAmountToSwapSolidly(
uint256 _tokenAmountIn,
address _tokenIn,
address _tokenOut
) private view returns (uint256) {
uint256 halfTokenAmount = _tokenAmountIn / 2;
(uint256 amountOut, ) = uniswapRouter.getAmountOut(halfTokenAmount, _tokenIn, _tokenOut);
// For Solidly/Velodrome, we cannot use the same complex logic
// that depends on getAmountOut with reserves. We'll simplify:
// Swap about half the amount to achieve a 50/50 distribution
return halfTokenAmount;
}
function _getAmountOut(uint256 amountIn, address tokenIn, address tokenOut) private view returns (uint256) {
(uint256 amount, ) = uniswapRouter.getAmountOut(amountIn, tokenIn, tokenOut);
return amount;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @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;
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
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// 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: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
* Revert on invalid signature.
*/
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.5.0;
interface IUniswapPair {
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 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 (uint256);
function balanceOf(address owner) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 value) external returns (bool);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(
address from,
address to,
uint256 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 (uint256);
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
event Mint(address indexed sender, uint256 amount0, uint256 amount1);
event Burn(address indexed sender, uint256 amount0, uint256 amount1, address indexed to);
event Swap(
address indexed sender,
uint256 amount0In,
uint256 amount1In,
uint256 amount0Out,
uint256 amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint256);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function stable() external view returns (bool);
function getReserves()
external
view
returns (
uint112 reserve0,
uint112 reserve1,
uint32 blockTimestampLast
);
function price0CumulativeLast() external view returns (uint256);
function price1CumulativeLast() external view returns (uint256);
function kLast() external view returns (uint256);
function mint(address to) external returns (uint256 liquidity);
function burn(address to) external returns (uint256 amount0, uint256 amount1);
function swap(
uint256 amount0Out,
uint256 amount1Out,
address to,
bytes calldata data
) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.6.2;
interface IUniswapRouter01 {
struct route {
address from;
address to;
bool stable;
}
function factory() external view returns (address);
function WETH() external view returns (address);
function addLiquidity(
address tokenA,
address tokenB,
bool stable,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);
function addLiquidityETH(
address token,
bool stable,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
bool stable,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB);
function removeLiquidityETH(
address token,
bool stable,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountToken, uint256 amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
bool stable,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountA, uint256 amountB);
function removeLiquidityETHWithPermit(
address token,
bool stable,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountToken, uint256 amountETH);
function getAmountOut(
uint256 amountIn,
address tokenIn,
address tokenOut
) external view returns (uint256 amount, bool stable);
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
route[] calldata routes,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapTokensForExactTokens(
uint256 amountOut,
uint256 amountInMax,
route[] calldata routes,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapExactETHForTokens(
uint256 amountOutMin,
route[] calldata routes,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function swapTokensForExactETH(
uint256 amountOut,
uint256 amountInMax,
route[] calldata routes,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapExactTokensForETH(
uint256 amountIn,
uint256 amountOutMin,
route[] calldata routes,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapETHForExactTokens(
uint256 amountOut,
route[] calldata routes,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function quote(
uint256 amountA,
uint256 reserveA,
uint256 reserveB
) external pure returns (uint256 amountB);
function getAmountsOut(
uint256 amountIn,
route[] calldata routes
) external view returns (uint256[] memory amounts);
function getAmountsIn(
uint256 amountOut,
route[] calldata routes
) external view returns (uint256[] memory amounts);
function pairFor(
address tokenA,
address tokenB,
bool stable
) external view returns (address pair);
function getReserves(
address tokenA,
address tokenB,
bool stable
) external view returns (uint256 reserveA, uint256 reserveB);
}// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.6.2;
import "./IUniswapRouter01.sol";
interface IUniswapRouter02 is IUniswapRouter01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
bool stable,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
bool stable,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
route[] calldata routes,
address to,
uint256 deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint256 amountOutMin,
route[] calldata routes,
address to,
uint256 deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
route[] calldata routes,
address to,
uint256 deadline
) external;
}// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.5.0;
interface IWETH {
function deposit() external payable;
function transfer(address to, uint256 value) external returns (bool);
function withdraw(uint256) external;
}// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.4;
/*
* @author Uniswap
* @notice Library from Uniswap
*/
library Babylonian {
function sqrt(uint256 x) internal pure returns (uint256) {
if (x == 0) return 0;
uint256 xx = x;
uint256 r = 1;
if (xx >= 0x100000000000000000000000000000000) {
xx >>= 128;
r <<= 64;
}
if (xx >= 0x10000000000000000) {
xx >>= 64;
r <<= 32;
}
if (xx >= 0x100000000) {
xx >>= 32;
r <<= 16;
}
if (xx >= 0x10000) {
xx >>= 16;
r <<= 8;
}
if (xx >= 0x100) {
xx >>= 8;
r <<= 4;
}
if (xx >= 0x10) {
xx >>= 4;
r <<= 2;
}
if (xx >= 0x8) {
r <<= 1;
}
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
uint256 r1 = x / r;
return (r < r1 ? r : r1);
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_WETHAddress","type":"address"},{"internalType":"address","name":"_uniswapRouter","type":"address"},{"internalType":"uint256","name":"_maxZapReverseRatio","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountTokens","type":"uint256"}],"name":"AdminTokenRecovery","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxZapReverseRatio","type":"uint256"}],"name":"NewMaxZapReverseRatio","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenToZap","type":"address"},{"indexed":true,"internalType":"address","name":"lpToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lpTokenAmountReceived","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"ZapIn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token0ToZap","type":"address"},{"indexed":true,"internalType":"address","name":"token1ToZap","type":"address"},{"indexed":false,"internalType":"address","name":"lpToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"token0AmountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"token1AmountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lpTokenAmountReceived","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"ZapInRebalancing","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"lpToken","type":"address"},{"indexed":true,"internalType":"address","name":"tokenToReceive","type":"address"},{"indexed":false,"internalType":"uint256","name":"lpTokenAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenAmountReceived","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"ZapOut","type":"event"},{"inputs":[],"name":"MAX_INT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINIMUM_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token0ToZap","type":"address"},{"internalType":"address","name":"_token1ToZap","type":"address"},{"internalType":"uint256","name":"_token0AmountIn","type":"uint256"},{"internalType":"uint256","name":"_token1AmountIn","type":"uint256"},{"internalType":"address","name":"_lpToken","type":"address"}],"name":"estimateZapInRebalancingSwap","outputs":[{"internalType":"uint256","name":"swapAmountIn","type":"uint256"},{"internalType":"uint256","name":"swapAmountOut","type":"uint256"},{"internalType":"bool","name":"sellToken0","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenToZap","type":"address"},{"internalType":"uint256","name":"_tokenAmountIn","type":"uint256"},{"internalType":"address","name":"_lpToken","type":"address"}],"name":"estimateZapInSwap","outputs":[{"internalType":"uint256","name":"swapAmountIn","type":"uint256"},{"internalType":"uint256","name":"swapAmountOut","type":"uint256"},{"internalType":"address","name":"swapTokenOut","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_lpToken","type":"address"},{"internalType":"uint256","name":"_lpTokenAmount","type":"uint256"},{"internalType":"address","name":"_tokenToReceive","type":"address"}],"name":"estimateZapOutSwap","outputs":[{"internalType":"uint256","name":"swapAmountIn","type":"uint256"},{"internalType":"uint256","name":"swapAmountOut","type":"uint256"},{"internalType":"address","name":"swapTokenOut","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxZapReverseRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"uint256","name":"_tokenAmount","type":"uint256"}],"name":"recoverWrongTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniswapRouter","outputs":[{"internalType":"contract IUniswapRouter02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxZapInverseRatio","type":"uint256"}],"name":"updateMaxZapInverseRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_lpToken","type":"address"},{"internalType":"uint256","name":"_tokenAmountOutMin","type":"uint256"}],"name":"zapInETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_token1ToZap","type":"address"},{"internalType":"uint256","name":"_token1AmountIn","type":"uint256"},{"internalType":"address","name":"_lpToken","type":"address"},{"internalType":"uint256","name":"_tokenAmountInMax","type":"uint256"},{"internalType":"uint256","name":"_tokenAmountOutMin","type":"uint256"},{"internalType":"bool","name":"_isToken0Sold","type":"bool"}],"name":"zapInETHRebalancing","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenToZap","type":"address"},{"internalType":"uint256","name":"_tokenAmountIn","type":"uint256"},{"internalType":"address","name":"_lpToken","type":"address"},{"internalType":"uint256","name":"_tokenAmountOutMin","type":"uint256"}],"name":"zapInToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token0ToZap","type":"address"},{"internalType":"address","name":"_token1ToZap","type":"address"},{"internalType":"uint256","name":"_token0AmountIn","type":"uint256"},{"internalType":"uint256","name":"_token1AmountIn","type":"uint256"},{"internalType":"address","name":"_lpToken","type":"address"},{"internalType":"uint256","name":"_tokenAmountInMax","type":"uint256"},{"internalType":"uint256","name":"_tokenAmountOutMin","type":"uint256"},{"internalType":"bool","name":"_isToken0Sold","type":"bool"}],"name":"zapInTokenRebalancing","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_lpToken","type":"address"},{"internalType":"uint256","name":"_lpTokenAmount","type":"uint256"},{"internalType":"uint256","name":"_tokenAmountOutMin","type":"uint256"}],"name":"zapOutETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_lpToken","type":"address"},{"internalType":"address","name":"_tokenToReceive","type":"address"},{"internalType":"uint256","name":"_lpTokenAmount","type":"uint256"},{"internalType":"uint256","name":"_tokenAmountOutMin","type":"uint256"}],"name":"zapOutToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60806040523480156200001157600080fd5b5060405162003fbc38038062003fbc833981016040819052620000349162000102565b6200003f3362000095565b60018055600680546001600160a01b039485166001600160a01b03199182168117909255600280548216909217909155600580549390941692811683179093556003805490931690911790915560045562000143565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000fd57600080fd5b919050565b6000806000606084860312156200011857600080fd5b6200012384620000e5565b92506200013360208501620000e5565b9150604084015190509250925092565b613e6980620001536000396000f3fe6080604052600436106101185760003560e01c8063735de9f7116100a05780638c0cc5ce116100645780638c0cc5ce146103345780638da5cb5b14610347578063ad5c464814610365578063b421e91e14610385578063f2fde38b146103a557600080fd5b8063735de9f71461026c5780637db9b1f4146102a457806382c98b2d146102b757806384b73115146102f457806387e3f21c1461031457600080fd5b80632dabc536116100e75780632dabc536146101b35780632f883da4146101d35780633b0a48bb146102175780633f138d4b14610237578063715018a61461025757600080fd5b8063098d32281461013e5780630f4e4e6314610167578063257d9bb81461017d5780632b4652eb1461019357600080fd5b36610139576006546001600160a01b0316331461013757610137613718565b005b600080fd5b34801561014a57600080fd5b5061015460001981565b6040519081526020015b60405180910390f35b34801561017357600080fd5b5061015460045481565b34801561018957600080fd5b506101546103e881565b34801561019f57600080fd5b506101376101ae36600461372e565b6103c5565b3480156101bf57600080fd5b506101376101ce36600461375c565b610408565b3480156101df57600080fd5b506101f36101ee366004613791565b6105a5565b6040805193845260208401929092526001600160a01b03169082015260600161015e565b34801561022357600080fd5b506101f3610232366004613791565b6108c5565b34801561024357600080fd5b506101376102523660046137d3565b610aeb565b34801561026357600080fd5b50610137610b4e565b34801561027857600080fd5b5060035461028c906001600160a01b031681565b6040516001600160a01b03909116815260200161015e565b6101376102b23660046137d3565b610b62565b3480156102c357600080fd5b506102d76102d23660046137ff565b610fef565b60408051938452602084019290925215159082015260600161015e565b34801561030057600080fd5b5061013761030f36600461385e565b61145b565b34801561032057600080fd5b5061013761032f3660046138a4565b6114f7565b6101376103423660046138fa565b61157c565b34801561035357600080fd5b506000546001600160a01b031661028c565b34801561037157600080fd5b5060025461028c906001600160a01b031681565b34801561039157600080fd5b506101376103a0366004613961565b611692565b3480156103b157600080fd5b506101376103c03660046139e6565b611748565b6103cd6117c1565b60048190556040518181527fc7e29c44236bfea8bef0d337e382f5f27ec5bc4d425d82437f115f9b59d2ba799060200160405180910390a150565b61041061181b565b6104256001600160a01b038416338585611874565b6006546000906104409085906001600160a01b0316846118df565b600254604051632e1a7d4d60e01b8152600481018390529192506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561048757600080fd5b505af115801561049b573d6000803e3d6000fd5b50506040805160008082526020820192839052935033925084916104bf9190613a44565b60006040518083038185875af1925050503d80600081146104fc576040519150601f19603f3d011682016040523d82523d6000602084013e610501565b606091505b505090508061054c5760405162461bcd60e51b81526020600482015260126024820152711155120e881d1c985b9cd9995c8819985a5b60721b60448201526064015b60405180910390fd5b604080518581526020810184905233916000916001600160a01b038916917f20ef8a4c975ec6c340089d8171a0f9c6a6324b11e3ecc4353155186f6c638c28910160405180910390a450506105a060018055565b505050565b600080600080866001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060d9190613a60565b90506000876001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561064f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106739190613a60565b9050816001600160a01b0316866001600160a01b031614806106a65750806001600160a01b0316866001600160a01b0316145b6106e95760405162461bcd60e51b815260206004820152601460248201527305a61703a20546f6b656e206e6f7420696e204c560641b6044820152606401610543565b600080896001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa15801561072a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074e9190613a99565b506001600160701b031691506001600160701b03169150876001600160a01b0316836001600160a01b03160361081d5760008a6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e29190613ade565b6107ec848c613b0d565b6107f69190613b2a565b90506108058186868686611e79565b9750610812888686611fe4565b9650849550506108b8565b60008a6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561085d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108819190613ade565b61088b838c613b0d565b6108959190613b2a565b90506108a48186868587611e79565b97506108b1888686611fe4565b9650839550505b5050505093509350939050565b600080600080846001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610909573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092d9190613a60565b90506000856001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561096f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109939190613a60565b9050816001600160a01b0316886001600160a01b031614806109c65750806001600160a01b0316886001600160a01b0316145b610a065760405162461bcd60e51b81526020600482015260116024820152705a61703a2057726f6e6720746f6b656e7360781b6044820152606401610543565b600080876001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6b9190613a99565b506001600160701b031691506001600160701b03169150896001600160a01b0316846001600160a01b031603610abf57829450610aab8985858585611e79565b9650610ab8878585611fe4565b95506108b8565b839450610acf8984868486611e79565b9650610adc878486611fe4565b95505050505093509350939050565b610af36117c1565b610b076001600160a01b038316338361206e565b816001600160a01b03167f74545154aac348a3eac92596bd1971957ca94795f4e954ec5f613b55fab7812982604051610b4291815260200190565b60405180910390a25050565b610b566117c1565b610b60600061209e565b565b610b6a61181b565b600260009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b158015610bba57600080fd5b505af1158015610bce573d6000803e3d6000fd5b50505050506000826001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c379190613a60565b90506000836001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9d9190613a60565b90506000846001600160a01b03166322be3de16040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d039190613b4c565b6006549091506001600160a01b0384811691161480610d2f57506006546001600160a01b038381169116145b610d7b5760405162461bcd60e51b815260206004820152601f60248201527f5a61703a204c5020746f6b656e206d75737420636f6e7461696e2057455448006044820152606401610543565b6006546000906001600160a01b03858116911614610d995783610d9b565b825b90506000610daa600234613b2a565b600654909150610dc2906001600160a01b03166120ee565b604080516001808252818301909252600091816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181610dd9575050604080516060810182526006546001600160a01b03908116825286166020820152861515918101919091528151919250908290600090610e4757610e47613b69565b6020908102919091010152600354604051631e82ecdb60e31b81526000916001600160a01b03169063f41766d890610e8b9086908c90879030904290600401613b7f565b6000604051808303816000875af1158015610eaa573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ed29190810190613c14565b9050610edd846120ee565b6003546006546000916001600160a01b0390811691635a47ddc391168789610f058934613cd2565b87600181518110610f1857610f18613b69565b602002602001015160018033426040518a63ffffffff1660e01b8152600401610f4999989796959493929190613ce5565b6060604051808303816000875af1158015610f68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8c9190613d34565b60408051348152602081018390529194503393506001600160a01b038e1692506000917fa71185a0ff368de4e9e445d8601c4fbd50d9b674e4e43f5f8feafb8d64a2e13e910160405180910390a45050505050505050610feb60018055565b5050565b6000806000836001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611032573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110569190613a60565b6001600160a01b0316886001600160a01b031614806110e75750836001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d29190613a60565b6001600160a01b0316886001600160a01b0316145b6111275760405162461bcd60e51b815260206004820152601160248201527005a61703a2057726f6e6720746f6b656e3607c1b6044820152606401610543565b836001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611165573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111899190613a60565b6001600160a01b0316876001600160a01b0316148061121a5750836001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112059190613a60565b6001600160a01b0316876001600160a01b0316145b61125a5760405162461bcd60e51b81526020600482015260116024820152705a61703a2057726f6e6720746f6b656e3160781b6044820152606401610543565b866001600160a01b0316886001600160a01b0316036112ae5760405162461bcd60e51b815260206004820152601060248201526f5a61703a2053616d6520746f6b656e7360801b6044820152606401610543565b600080856001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156112ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113139190613a99565b506001600160701b031691506001600160701b03169150856001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611368573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138c9190613a60565b6001600160a01b03168a6001600160a01b0316036113fb576113ae8288613b0d565b6113b8828a613b0d565b116113c45760006113c7565b60015b92506113d6888884848761218f565b945082156113f0576113e9858b8b611fe4565b935061144e565b6113e9858a8c611fe4565b6114058188613b0d565b61140f838a613b0d565b1161141b57600061141e565b60015b925061142d888883858761218f565b94508215611440576113e9858a8c611fe4565b61144b858b8b611fe4565b93505b5050955095509592505050565b61146361181b565b6114786001600160a01b038516338685611874565b60006114858585846118df565b905061149b6001600160a01b038516338361206e565b604080518481526020810183905233916001600160a01b0387811692908916917f20ef8a4c975ec6c340089d8171a0f9c6a6324b11e3ecc4353155186f6c638c2891015b60405180910390a4506114f160018055565b50505050565b6114ff61181b565b6115146001600160a01b038516333086611874565b600061152285858585612220565b9050336001600160a01b0316836001600160a01b0316866001600160a01b03167fa71185a0ff368de4e9e445d8601c4fbd50d9b674e4e43f5f8feafb8d64a2e13e87856040516114df929190918252602082015260400190565b61158461181b565b600260009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156115d457600080fd5b505af11580156115e8573d6000803e3d6000fd5b50611604935050506001600160a01b0388169050333088611874565b600654600090611623906001600160a01b031688348989898989612822565b604080516001600160a01b038881168252346020830152918101899052606081018390529192503391908916906000907f4ff29158e89c3af93365bf0fa1d14c5768109fb139f24b97c8a7d510b2d5e3f69060800160405180910390a45061168a60018055565b505050505050565b61169a61181b565b6116af6001600160a01b038916333089611874565b6116c46001600160a01b038816333088611874565b60006116d68989898989898989612822565b604080516001600160a01b038881168252602082018b90529181018990526060810183905291925033918a8216918c16907f4ff29158e89c3af93365bf0fa1d14c5768109fb139f24b97c8a7d510b2d5e3f69060800160405180910390a45061173e60018055565b5050505050505050565b6117506117c1565b6001600160a01b0381166117b55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610543565b6117be8161209e565b50565b6000546001600160a01b03163314610b605760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610543565b60026001540361186d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610543565b6002600155565b6040516001600160a01b03808516602483015283166044820152606481018290526114f19085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526128b1565b600080846001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611920573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119449190613a60565b90506000856001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611986573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119aa9190613a60565b90506000866001600160a01b03166322be3de16040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a109190613b4c565b9050826001600160a01b0316866001600160a01b03161480611a435750816001600160a01b0316866001600160a01b0316145b611a865760405162461bcd60e51b815260206004820152601460248201527305a61703a20546f6b656e206e6f7420696e204c560641b6044820152606401610543565b60405163226bf2d160e21b815230600482015260009081906001600160a01b038a16906389afcb449060240160408051808303816000875af1158015611ad0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611af49190613d62565b915091506103e8821015611b4a5760405162461bcd60e51b815260206004820152601a60248201527f5a61703a20494e53554646494349454e545f415f414d4f554e540000000000006044820152606401610543565b6103e8811015611b9c5760405162461bcd60e51b815260206004820152601a60248201527f5a61703a20494e53554646494349454e545f425f414d4f554e540000000000006044820152606401610543565b604080516001808252818301909252600091816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181611bb35790505090506000896001600160a01b0316876001600160a01b031603611cc2576040518060600160405280876001600160a01b03168152602001886001600160a01b0316815260200186151581525082600081518110611c3f57611c3f613b69565b60209081029190910101526040516370a0823160e01b81523060048201526001600160a01b038716906370a0823190602401602060405180830381865afa158015611c8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cb29190613ade565b9050611cbd866120ee565b611d82565b6040518060600160405280886001600160a01b03168152602001876001600160a01b0316815260200186151581525082600081518110611d0457611d04613b69565b60209081029190910101526040516370a0823160e01b81523060048201526001600160a01b038816906370a0823190602401602060405180830381865afa158015611d53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d779190613ade565b9050611d82876120ee565b600354604051631e82ecdb60e31b81526001600160a01b039091169063f41766d890611dba9084908d90879030904290600401613b7f565b6000604051808303816000875af1158015611dd9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611e019190810190613c14565b506040516370a0823160e01b81523060048201526001600160a01b038b16906370a0823190602401602060405180830381865afa158015611e46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e6a9190613ade565b9b9a5050505050505050505050565b600080611e87600288613b2a565b600354604051635e1e632560e01b8152600481018390526001600160a01b038981166024830152888116604483015292935060009290911690635e1e6325906064016040805180830381865afa158015611ee5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f099190613d86565b506003549091506000906001600160a01b031663ad615dec84611f2c818a613db6565b611f36868a613cd2565b6040516001600160e01b031960e086901b168152600481019390935260248301919091526044820152606401602060405180830381865afa158015611f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa39190613ade565b9050611fcd8183611fb48680613b0d565b611fbe9190613b0d565b611fc89190613b2a565b612986565b611fd7908a613cd2565b9998505050505050505050565b600354604051635e1e632560e01b8152600481018590526001600160a01b03848116602483015283811660448301526000928392911690635e1e6325906064016040805180830381865afa158015612040573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120649190613d86565b5095945050505050565b6040516001600160a01b0383166024820152604481018290526105a090849063a9059cbb60e01b906064016118a8565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600554604051636eb1769f60e11b81523060048201526001600160a01b03918216602482015269d3c21bcecceda10000009183169063dd62ed3e90604401602060405180830381865afa158015612149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061216d9190613ade565b10156117be576005546117be906001600160a01b038381169116600019612b07565b60008061219c8587613b0d565b6121a68589613b0d565b116121b25760006121b5565b60015b90508215158115151461220a5760405162461bcd60e51b815260206004820152601a60248201527f5a61703a2057726f6e6720747261646520646972656374696f6e0000000000006044820152606401610543565b612215600288613b2a565b979650505050505050565b60006103e884101561226a5760405162461bcd60e51b81526020600482015260136024820152725a61703a20416d6f756e7420746f6f206c6f7760681b6044820152606401610543565b6000836001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156122aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ce9190613a60565b90506000846001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015612310573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123349190613a60565b90506000856001600160a01b03166322be3de16040518163ffffffff1660e01b8152600401602060405180830381865afa158015612376573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061239a9190613b4c565b9050826001600160a01b0316886001600160a01b031614806123cd5750816001600160a01b0316886001600160a01b0316145b61240d5760405162461bcd60e51b81526020600482015260116024820152705a61703a2057726f6e6720746f6b656e7360781b6044820152606401610543565b604080516001808252818301909252600091816020015b604080516060810182526000808252602080830182905292820152825260001990920191018161242457905050905060405180606001604052808a6001600160a01b03168152602001856001600160a01b03168b6001600160a01b03161461248c578561248e565b845b6001600160a01b03168152602001831515815250816000815181106124b5576124b5613b69565b60200260200101819052506000806000896001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015612503573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125279190613a99565b506001600160701b031691506001600160701b031691506103e8821015801561255257506103e88110155b6125965760405162461bcd60e51b81526020600482015260156024820152745a61703a20526573657276657320746f6f206c6f7760581b6044820152606401610543565b8b6001600160a01b0316876001600160a01b03160361260b576125d88b8d866000815181106125c7576125c7613b69565b602002602001015160200151612c1c565b6004549093506125e88484613b2a565b10156126065760405162461bcd60e51b815260040161054390613dc9565b612651565b6126238b8d866000815181106125c7576125c7613b69565b6004549093506126338483613b2a565b10156126515760405162461bcd60e51b815260040161054390613dc9565b505061265c8a6120ee565b600354604051631e82ecdb60e31b81526000916001600160a01b03169063f41766d8906126959085908c90889030904290600401613b7f565b6000604051808303816000875af11580156126b4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526126dc9190810190613c14565b90508a6001600160a01b0316866001600160a01b03160361270557612700856120ee565b61270e565b61270e866120ee565b60035483516001600160a01b0390911690635a47ddc390859060009061273657612736613b69565b6020026020010151600001518560008151811061275557612755613b69565b602002602001015160200151878560008151811061277557612775613b69565b60200260200101518f6127889190613cd2565b8660018151811061279b5761279b613b69565b602002602001015160018033426040518a63ffffffff1660e01b81526004016127cc99989796959493929190613ce5565b6060604051808303816000875af11580156127eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061280f9190613d34565b985050505050505050505b949350505050565b600061282f898987612cb8565b600061283f8a8a8a8a8a88612f72565b9050848111156128915760405162461bcd60e51b815260206004820152601c60248201527f5a61703a20416d6f756e7420746f207377617020746f6f2068696768000000006044820152606401610543565b60006128a18b8b8488888c6130f6565b9050611e6a8b8b8b8b85896132dc565b6000612906826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166136059092919063ffffffff16565b90508051600014806129275750808060200190518101906129279190613b4c565b6105a05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610543565b60008160000361299857506000919050565b816001600160801b82106129b15760809190911c9060401b5b6801000000000000000082106129cc5760409190911c9060201b5b64010000000082106129e35760209190911c9060101b5b6201000082106129f85760109190911c9060081b5b6101008210612a0c5760089190911c9060041b5b60108210612a1f5760049190911c9060021b5b60088210612a2b5760011b5b6001612a378286613b2a565b612a419083613db6565b901c90506001612a518286613b2a565b612a5b9083613db6565b901c90506001612a6b8286613b2a565b612a759083613db6565b901c90506001612a858286613b2a565b612a8f9083613db6565b901c90506001612a9f8286613b2a565b612aa99083613db6565b901c90506001612ab98286613b2a565b612ac39083613db6565b901c90506001612ad38286613b2a565b612add9083613db6565b901c90506000612aed8286613b2a565b9050808210612afc5780612afe565b815b95945050505050565b801580612b815750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015612b5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b7f9190613ade565b155b612bec5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610543565b6040516001600160a01b0383166024820152604481018290526105a090849063095ea7b360e01b906064016118a8565b600080612c2a600286613b2a565b600354604051635e1e632560e01b8152600481018390526001600160a01b038781166024830152868116604483015292935060009290911690635e1e6325906064016040805180830381865afa158015612c88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cac9190613d86565b50919695505050505050565b806001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015612cf6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d1a9190613a60565b6001600160a01b0316836001600160a01b03161480612dab5750806001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d969190613a60565b6001600160a01b0316836001600160a01b0316145b612deb5760405162461bcd60e51b815260206004820152601160248201527005a61703a2057726f6e6720746f6b656e3607c1b6044820152606401610543565b806001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015612e29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e4d9190613a60565b6001600160a01b0316826001600160a01b03161480612ede5750806001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ea5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ec99190613a60565b6001600160a01b0316826001600160a01b0316145b612f1e5760405162461bcd60e51b81526020600482015260116024820152705a61703a2057726f6e6720746f6b656e3160781b6044820152606401610543565b816001600160a01b0316836001600160a01b0316036105a05760405162461bcd60e51b815260206004820152601060248201526f5a61703a2053616d6520746f6b656e7360801b6044820152606401610543565b6000806000846001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015612fb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fd99190613a99565b506001600160701b031691506001600160701b031691506000856001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015613030573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130549190613a60565b6001600160a01b03168a6001600160a01b0316036130ac57613079888885858961218f565b6004549091506130898285613b2a565b10156130a75760405162461bcd60e51b815260040161054390613dc9565b6130e7565b6130b9888884868961218f565b6004549091506130c98284613b2a565b10156130e75760405162461bcd60e51b815260040161054390613dc9565b925050505b9695505050505050565b60408051600180825281830190925260609160009190816020015b60408051606081018252600080825260208083018290529282015282526000199092019101816131115790505090506000836001600160a01b03166322be3de16040518163ffffffff1660e01b8152600401602060405180830381865afa158015613180573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131a49190613b4c565b905084156132075760405180606001604052808a6001600160a01b03168152602001896001600160a01b03168152602001821515815250826000815181106131ee576131ee613b69565b6020026020010181905250613202896120ee565b61325d565b6040518060600160405280896001600160a01b031681526020018a6001600160a01b031681526020018215158152508260008151811061324957613249613b69565b602002602001018190525061325d886120ee565b600354604051631e82ecdb60e31b81526001600160a01b039091169063f41766d890613295908a908a90879030904290600401613b7f565b6000604051808303816000875af11580156132b4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526130e79190810190613c14565b60008115613473576132ed866120ee565b604080516002808252606082018352600092602083019080368337019050509050878160008151811061332257613322613b69565b60200260200101906001600160a01b031690816001600160a01b031681525050868160018151811061335657613356613b69565b6001600160a01b0392831660209182029290920101526003548251911690635a47ddc390839060009061338b5761338b613b69565b6020026020010151836001815181106133a6576133a6613b69565b60200260200101516000886000815181106133c3576133c3613b69565b60200260200101518b6133d69190613cd2565b896001815181106133e9576133e9613b69565b60200260200101518b6133fc9190613db6565b60018033426040518a63ffffffff1660e01b815260040161342599989796959493929190613ce5565b6060604051808303816000875af1158015613444573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134689190613d34565b93506130ec92505050565b61347c876120ee565b60408051600280825260608201835260009260208301908036833701905050905086816000815181106134b1576134b1613b69565b60200260200101906001600160a01b031690816001600160a01b03168152505087816001815181106134e5576134e5613b69565b6001600160a01b0392831660209182029290920101526003548251911690635a47ddc390839060009061351a5761351a613b69565b60200260200101518360018151811061353557613535613b69565b602002602001015160008860008151811061355257613552613b69565b60200260200101518a6135659190613cd2565b8960018151811061357857613578613b69565b60200260200101518c61358b9190613db6565b60018033426040518a63ffffffff1660e01b81526004016135b499989796959493929190613ce5565b6060604051808303816000875af11580156135d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135f79190613d34565b9a9950505050505050505050565b606061281a848460008585600080866001600160a01b0316858760405161362c9190613a44565b60006040518083038185875af1925050503d8060008114613669576040519150601f19603f3d011682016040523d82523d6000602084013e61366e565b606091505b509150915061221587838387606083156136e95782516000036136e2576001600160a01b0385163b6136e25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610543565b508161281a565b61281a83838151156136fe5781518083602001fd5b8060405162461bcd60e51b81526004016105439190613e00565b634e487b7160e01b600052600160045260246000fd5b60006020828403121561374057600080fd5b5035919050565b6001600160a01b03811681146117be57600080fd5b60008060006060848603121561377157600080fd5b833561377c81613747565b95602085013595506040909401359392505050565b6000806000606084860312156137a657600080fd5b83356137b181613747565b92506020840135915060408401356137c881613747565b809150509250925092565b600080604083850312156137e657600080fd5b82356137f181613747565b946020939093013593505050565b600080600080600060a0868803121561381757600080fd5b853561382281613747565b9450602086013561383281613747565b93506040860135925060608601359150608086013561385081613747565b809150509295509295909350565b6000806000806080858703121561387457600080fd5b843561387f81613747565b9350602085013561388f81613747565b93969395505050506040820135916060013590565b600080600080608085870312156138ba57600080fd5b84356138c581613747565b93506020850135925060408501356138dc81613747565b9396929550929360600135925050565b80151581146117be57600080fd5b60008060008060008060c0878903121561391357600080fd5b863561391e81613747565b955060208701359450604087013561393581613747565b9350606087013592506080870135915060a0870135613953816138ec565b809150509295509295509295565b600080600080600080600080610100898b03121561397e57600080fd5b883561398981613747565b9750602089013561399981613747565b9650604089013595506060890135945060808901356139b781613747565b935060a0890135925060c0890135915060e08901356139d5816138ec565b809150509295985092959890939650565b6000602082840312156139f857600080fd5b8135613a0381613747565b9392505050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015613a3b578181015183820152602001613a23565b50506000910152565b60008251613a56818460208701613a20565b9190910192915050565b600060208284031215613a7257600080fd5b8151613a0381613747565b80516001600160701b0381168114613a9457600080fd5b919050565b600080600060608486031215613aae57600080fd5b613ab784613a7d565b9250613ac560208501613a7d565b9150604084015163ffffffff811681146137c857600080fd5b600060208284031215613af057600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417613b2457613b24613af7565b92915050565b600082613b4757634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215613b5e57600080fd5b8151613a03816138ec565b634e487b7160e01b600052603260045260246000fd5b600060a0820187835260208781850152604060a08186015282885180855260c087019150838a01945060005b81811015613be857855180516001600160a01b03908116855286820151168685015284015115158484015294840194606090920191600101613bab565b50506001600160a01b03881660608701529350613c0492505050565b8260808301529695505050505050565b60006020808385031215613c2757600080fd5b825167ffffffffffffffff80821115613c3f57600080fd5b818501915085601f830112613c5357600080fd5b815181811115613c6557613c65613a0a565b8060051b604051601f19603f83011681018181108582111715613c8a57613c8a613a0a565b604052918252848201925083810185019188831115613ca857600080fd5b938501935b82851015613cc657845184529385019392850192613cad565b98975050505050505050565b81810381811115613b2457613b24613af7565b6001600160a01b03998a168152978916602089015295151560408801526060870194909452608086019290925260a085015260c084015290921660e08201526101008101919091526101200190565b600080600060608486031215613d4957600080fd5b8351925060208401519150604084015190509250925092565b60008060408385031215613d7557600080fd5b505080516020909101519092909150565b60008060408385031215613d9957600080fd5b825191506020830151613dab816138ec565b809150509250929050565b80820180821115613b2457613b24613af7565b6020808252601f908201527f5a61703a205175616e7469747920686967686572207468616e206c696d697400604082015260600190565b6020815260008251806020840152613e1f816040850160208701613a20565b601f01601f1916919091016040019291505056fea264697066735822122067d7b6a9fa892a518177b94da6a74d5172c7ff9ae310ca48d292f021c29f7c5164736f6c63430008130033000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad380000000000000000000000001d368773735ee1e678950b7a97bca2cafb330cdc0000000000000000000000000000000000000000000000000000000000000002
Deployed Bytecode
0x6080604052600436106101185760003560e01c8063735de9f7116100a05780638c0cc5ce116100645780638c0cc5ce146103345780638da5cb5b14610347578063ad5c464814610365578063b421e91e14610385578063f2fde38b146103a557600080fd5b8063735de9f71461026c5780637db9b1f4146102a457806382c98b2d146102b757806384b73115146102f457806387e3f21c1461031457600080fd5b80632dabc536116100e75780632dabc536146101b35780632f883da4146101d35780633b0a48bb146102175780633f138d4b14610237578063715018a61461025757600080fd5b8063098d32281461013e5780630f4e4e6314610167578063257d9bb81461017d5780632b4652eb1461019357600080fd5b36610139576006546001600160a01b0316331461013757610137613718565b005b600080fd5b34801561014a57600080fd5b5061015460001981565b6040519081526020015b60405180910390f35b34801561017357600080fd5b5061015460045481565b34801561018957600080fd5b506101546103e881565b34801561019f57600080fd5b506101376101ae36600461372e565b6103c5565b3480156101bf57600080fd5b506101376101ce36600461375c565b610408565b3480156101df57600080fd5b506101f36101ee366004613791565b6105a5565b6040805193845260208401929092526001600160a01b03169082015260600161015e565b34801561022357600080fd5b506101f3610232366004613791565b6108c5565b34801561024357600080fd5b506101376102523660046137d3565b610aeb565b34801561026357600080fd5b50610137610b4e565b34801561027857600080fd5b5060035461028c906001600160a01b031681565b6040516001600160a01b03909116815260200161015e565b6101376102b23660046137d3565b610b62565b3480156102c357600080fd5b506102d76102d23660046137ff565b610fef565b60408051938452602084019290925215159082015260600161015e565b34801561030057600080fd5b5061013761030f36600461385e565b61145b565b34801561032057600080fd5b5061013761032f3660046138a4565b6114f7565b6101376103423660046138fa565b61157c565b34801561035357600080fd5b506000546001600160a01b031661028c565b34801561037157600080fd5b5060025461028c906001600160a01b031681565b34801561039157600080fd5b506101376103a0366004613961565b611692565b3480156103b157600080fd5b506101376103c03660046139e6565b611748565b6103cd6117c1565b60048190556040518181527fc7e29c44236bfea8bef0d337e382f5f27ec5bc4d425d82437f115f9b59d2ba799060200160405180910390a150565b61041061181b565b6104256001600160a01b038416338585611874565b6006546000906104409085906001600160a01b0316846118df565b600254604051632e1a7d4d60e01b8152600481018390529192506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561048757600080fd5b505af115801561049b573d6000803e3d6000fd5b50506040805160008082526020820192839052935033925084916104bf9190613a44565b60006040518083038185875af1925050503d80600081146104fc576040519150601f19603f3d011682016040523d82523d6000602084013e610501565b606091505b505090508061054c5760405162461bcd60e51b81526020600482015260126024820152711155120e881d1c985b9cd9995c8819985a5b60721b60448201526064015b60405180910390fd5b604080518581526020810184905233916000916001600160a01b038916917f20ef8a4c975ec6c340089d8171a0f9c6a6324b11e3ecc4353155186f6c638c28910160405180910390a450506105a060018055565b505050565b600080600080866001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060d9190613a60565b90506000876001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561064f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106739190613a60565b9050816001600160a01b0316866001600160a01b031614806106a65750806001600160a01b0316866001600160a01b0316145b6106e95760405162461bcd60e51b815260206004820152601460248201527305a61703a20546f6b656e206e6f7420696e204c560641b6044820152606401610543565b600080896001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa15801561072a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074e9190613a99565b506001600160701b031691506001600160701b03169150876001600160a01b0316836001600160a01b03160361081d5760008a6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e29190613ade565b6107ec848c613b0d565b6107f69190613b2a565b90506108058186868686611e79565b9750610812888686611fe4565b9650849550506108b8565b60008a6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561085d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108819190613ade565b61088b838c613b0d565b6108959190613b2a565b90506108a48186868587611e79565b97506108b1888686611fe4565b9650839550505b5050505093509350939050565b600080600080846001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610909573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092d9190613a60565b90506000856001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561096f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109939190613a60565b9050816001600160a01b0316886001600160a01b031614806109c65750806001600160a01b0316886001600160a01b0316145b610a065760405162461bcd60e51b81526020600482015260116024820152705a61703a2057726f6e6720746f6b656e7360781b6044820152606401610543565b600080876001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6b9190613a99565b506001600160701b031691506001600160701b03169150896001600160a01b0316846001600160a01b031603610abf57829450610aab8985858585611e79565b9650610ab8878585611fe4565b95506108b8565b839450610acf8984868486611e79565b9650610adc878486611fe4565b95505050505093509350939050565b610af36117c1565b610b076001600160a01b038316338361206e565b816001600160a01b03167f74545154aac348a3eac92596bd1971957ca94795f4e954ec5f613b55fab7812982604051610b4291815260200190565b60405180910390a25050565b610b566117c1565b610b60600061209e565b565b610b6a61181b565b600260009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b158015610bba57600080fd5b505af1158015610bce573d6000803e3d6000fd5b50505050506000826001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c379190613a60565b90506000836001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9d9190613a60565b90506000846001600160a01b03166322be3de16040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d039190613b4c565b6006549091506001600160a01b0384811691161480610d2f57506006546001600160a01b038381169116145b610d7b5760405162461bcd60e51b815260206004820152601f60248201527f5a61703a204c5020746f6b656e206d75737420636f6e7461696e2057455448006044820152606401610543565b6006546000906001600160a01b03858116911614610d995783610d9b565b825b90506000610daa600234613b2a565b600654909150610dc2906001600160a01b03166120ee565b604080516001808252818301909252600091816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181610dd9575050604080516060810182526006546001600160a01b03908116825286166020820152861515918101919091528151919250908290600090610e4757610e47613b69565b6020908102919091010152600354604051631e82ecdb60e31b81526000916001600160a01b03169063f41766d890610e8b9086908c90879030904290600401613b7f565b6000604051808303816000875af1158015610eaa573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ed29190810190613c14565b9050610edd846120ee565b6003546006546000916001600160a01b0390811691635a47ddc391168789610f058934613cd2565b87600181518110610f1857610f18613b69565b602002602001015160018033426040518a63ffffffff1660e01b8152600401610f4999989796959493929190613ce5565b6060604051808303816000875af1158015610f68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8c9190613d34565b60408051348152602081018390529194503393506001600160a01b038e1692506000917fa71185a0ff368de4e9e445d8601c4fbd50d9b674e4e43f5f8feafb8d64a2e13e910160405180910390a45050505050505050610feb60018055565b5050565b6000806000836001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611032573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110569190613a60565b6001600160a01b0316886001600160a01b031614806110e75750836001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d29190613a60565b6001600160a01b0316886001600160a01b0316145b6111275760405162461bcd60e51b815260206004820152601160248201527005a61703a2057726f6e6720746f6b656e3607c1b6044820152606401610543565b836001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611165573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111899190613a60565b6001600160a01b0316876001600160a01b0316148061121a5750836001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112059190613a60565b6001600160a01b0316876001600160a01b0316145b61125a5760405162461bcd60e51b81526020600482015260116024820152705a61703a2057726f6e6720746f6b656e3160781b6044820152606401610543565b866001600160a01b0316886001600160a01b0316036112ae5760405162461bcd60e51b815260206004820152601060248201526f5a61703a2053616d6520746f6b656e7360801b6044820152606401610543565b600080856001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156112ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113139190613a99565b506001600160701b031691506001600160701b03169150856001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611368573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138c9190613a60565b6001600160a01b03168a6001600160a01b0316036113fb576113ae8288613b0d565b6113b8828a613b0d565b116113c45760006113c7565b60015b92506113d6888884848761218f565b945082156113f0576113e9858b8b611fe4565b935061144e565b6113e9858a8c611fe4565b6114058188613b0d565b61140f838a613b0d565b1161141b57600061141e565b60015b925061142d888883858761218f565b94508215611440576113e9858a8c611fe4565b61144b858b8b611fe4565b93505b5050955095509592505050565b61146361181b565b6114786001600160a01b038516338685611874565b60006114858585846118df565b905061149b6001600160a01b038516338361206e565b604080518481526020810183905233916001600160a01b0387811692908916917f20ef8a4c975ec6c340089d8171a0f9c6a6324b11e3ecc4353155186f6c638c2891015b60405180910390a4506114f160018055565b50505050565b6114ff61181b565b6115146001600160a01b038516333086611874565b600061152285858585612220565b9050336001600160a01b0316836001600160a01b0316866001600160a01b03167fa71185a0ff368de4e9e445d8601c4fbd50d9b674e4e43f5f8feafb8d64a2e13e87856040516114df929190918252602082015260400190565b61158461181b565b600260009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156115d457600080fd5b505af11580156115e8573d6000803e3d6000fd5b50611604935050506001600160a01b0388169050333088611874565b600654600090611623906001600160a01b031688348989898989612822565b604080516001600160a01b038881168252346020830152918101899052606081018390529192503391908916906000907f4ff29158e89c3af93365bf0fa1d14c5768109fb139f24b97c8a7d510b2d5e3f69060800160405180910390a45061168a60018055565b505050505050565b61169a61181b565b6116af6001600160a01b038916333089611874565b6116c46001600160a01b038816333088611874565b60006116d68989898989898989612822565b604080516001600160a01b038881168252602082018b90529181018990526060810183905291925033918a8216918c16907f4ff29158e89c3af93365bf0fa1d14c5768109fb139f24b97c8a7d510b2d5e3f69060800160405180910390a45061173e60018055565b5050505050505050565b6117506117c1565b6001600160a01b0381166117b55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610543565b6117be8161209e565b50565b6000546001600160a01b03163314610b605760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610543565b60026001540361186d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610543565b6002600155565b6040516001600160a01b03808516602483015283166044820152606481018290526114f19085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526128b1565b600080846001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611920573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119449190613a60565b90506000856001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611986573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119aa9190613a60565b90506000866001600160a01b03166322be3de16040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a109190613b4c565b9050826001600160a01b0316866001600160a01b03161480611a435750816001600160a01b0316866001600160a01b0316145b611a865760405162461bcd60e51b815260206004820152601460248201527305a61703a20546f6b656e206e6f7420696e204c560641b6044820152606401610543565b60405163226bf2d160e21b815230600482015260009081906001600160a01b038a16906389afcb449060240160408051808303816000875af1158015611ad0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611af49190613d62565b915091506103e8821015611b4a5760405162461bcd60e51b815260206004820152601a60248201527f5a61703a20494e53554646494349454e545f415f414d4f554e540000000000006044820152606401610543565b6103e8811015611b9c5760405162461bcd60e51b815260206004820152601a60248201527f5a61703a20494e53554646494349454e545f425f414d4f554e540000000000006044820152606401610543565b604080516001808252818301909252600091816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181611bb35790505090506000896001600160a01b0316876001600160a01b031603611cc2576040518060600160405280876001600160a01b03168152602001886001600160a01b0316815260200186151581525082600081518110611c3f57611c3f613b69565b60209081029190910101526040516370a0823160e01b81523060048201526001600160a01b038716906370a0823190602401602060405180830381865afa158015611c8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cb29190613ade565b9050611cbd866120ee565b611d82565b6040518060600160405280886001600160a01b03168152602001876001600160a01b0316815260200186151581525082600081518110611d0457611d04613b69565b60209081029190910101526040516370a0823160e01b81523060048201526001600160a01b038816906370a0823190602401602060405180830381865afa158015611d53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d779190613ade565b9050611d82876120ee565b600354604051631e82ecdb60e31b81526001600160a01b039091169063f41766d890611dba9084908d90879030904290600401613b7f565b6000604051808303816000875af1158015611dd9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611e019190810190613c14565b506040516370a0823160e01b81523060048201526001600160a01b038b16906370a0823190602401602060405180830381865afa158015611e46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e6a9190613ade565b9b9a5050505050505050505050565b600080611e87600288613b2a565b600354604051635e1e632560e01b8152600481018390526001600160a01b038981166024830152888116604483015292935060009290911690635e1e6325906064016040805180830381865afa158015611ee5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f099190613d86565b506003549091506000906001600160a01b031663ad615dec84611f2c818a613db6565b611f36868a613cd2565b6040516001600160e01b031960e086901b168152600481019390935260248301919091526044820152606401602060405180830381865afa158015611f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa39190613ade565b9050611fcd8183611fb48680613b0d565b611fbe9190613b0d565b611fc89190613b2a565b612986565b611fd7908a613cd2565b9998505050505050505050565b600354604051635e1e632560e01b8152600481018590526001600160a01b03848116602483015283811660448301526000928392911690635e1e6325906064016040805180830381865afa158015612040573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120649190613d86565b5095945050505050565b6040516001600160a01b0383166024820152604481018290526105a090849063a9059cbb60e01b906064016118a8565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600554604051636eb1769f60e11b81523060048201526001600160a01b03918216602482015269d3c21bcecceda10000009183169063dd62ed3e90604401602060405180830381865afa158015612149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061216d9190613ade565b10156117be576005546117be906001600160a01b038381169116600019612b07565b60008061219c8587613b0d565b6121a68589613b0d565b116121b25760006121b5565b60015b90508215158115151461220a5760405162461bcd60e51b815260206004820152601a60248201527f5a61703a2057726f6e6720747261646520646972656374696f6e0000000000006044820152606401610543565b612215600288613b2a565b979650505050505050565b60006103e884101561226a5760405162461bcd60e51b81526020600482015260136024820152725a61703a20416d6f756e7420746f6f206c6f7760681b6044820152606401610543565b6000836001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156122aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ce9190613a60565b90506000846001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015612310573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123349190613a60565b90506000856001600160a01b03166322be3de16040518163ffffffff1660e01b8152600401602060405180830381865afa158015612376573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061239a9190613b4c565b9050826001600160a01b0316886001600160a01b031614806123cd5750816001600160a01b0316886001600160a01b0316145b61240d5760405162461bcd60e51b81526020600482015260116024820152705a61703a2057726f6e6720746f6b656e7360781b6044820152606401610543565b604080516001808252818301909252600091816020015b604080516060810182526000808252602080830182905292820152825260001990920191018161242457905050905060405180606001604052808a6001600160a01b03168152602001856001600160a01b03168b6001600160a01b03161461248c578561248e565b845b6001600160a01b03168152602001831515815250816000815181106124b5576124b5613b69565b60200260200101819052506000806000896001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015612503573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125279190613a99565b506001600160701b031691506001600160701b031691506103e8821015801561255257506103e88110155b6125965760405162461bcd60e51b81526020600482015260156024820152745a61703a20526573657276657320746f6f206c6f7760581b6044820152606401610543565b8b6001600160a01b0316876001600160a01b03160361260b576125d88b8d866000815181106125c7576125c7613b69565b602002602001015160200151612c1c565b6004549093506125e88484613b2a565b10156126065760405162461bcd60e51b815260040161054390613dc9565b612651565b6126238b8d866000815181106125c7576125c7613b69565b6004549093506126338483613b2a565b10156126515760405162461bcd60e51b815260040161054390613dc9565b505061265c8a6120ee565b600354604051631e82ecdb60e31b81526000916001600160a01b03169063f41766d8906126959085908c90889030904290600401613b7f565b6000604051808303816000875af11580156126b4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526126dc9190810190613c14565b90508a6001600160a01b0316866001600160a01b03160361270557612700856120ee565b61270e565b61270e866120ee565b60035483516001600160a01b0390911690635a47ddc390859060009061273657612736613b69565b6020026020010151600001518560008151811061275557612755613b69565b602002602001015160200151878560008151811061277557612775613b69565b60200260200101518f6127889190613cd2565b8660018151811061279b5761279b613b69565b602002602001015160018033426040518a63ffffffff1660e01b81526004016127cc99989796959493929190613ce5565b6060604051808303816000875af11580156127eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061280f9190613d34565b985050505050505050505b949350505050565b600061282f898987612cb8565b600061283f8a8a8a8a8a88612f72565b9050848111156128915760405162461bcd60e51b815260206004820152601c60248201527f5a61703a20416d6f756e7420746f207377617020746f6f2068696768000000006044820152606401610543565b60006128a18b8b8488888c6130f6565b9050611e6a8b8b8b8b85896132dc565b6000612906826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166136059092919063ffffffff16565b90508051600014806129275750808060200190518101906129279190613b4c565b6105a05760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610543565b60008160000361299857506000919050565b816001600160801b82106129b15760809190911c9060401b5b6801000000000000000082106129cc5760409190911c9060201b5b64010000000082106129e35760209190911c9060101b5b6201000082106129f85760109190911c9060081b5b6101008210612a0c5760089190911c9060041b5b60108210612a1f5760049190911c9060021b5b60088210612a2b5760011b5b6001612a378286613b2a565b612a419083613db6565b901c90506001612a518286613b2a565b612a5b9083613db6565b901c90506001612a6b8286613b2a565b612a759083613db6565b901c90506001612a858286613b2a565b612a8f9083613db6565b901c90506001612a9f8286613b2a565b612aa99083613db6565b901c90506001612ab98286613b2a565b612ac39083613db6565b901c90506001612ad38286613b2a565b612add9083613db6565b901c90506000612aed8286613b2a565b9050808210612afc5780612afe565b815b95945050505050565b801580612b815750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015612b5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b7f9190613ade565b155b612bec5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610543565b6040516001600160a01b0383166024820152604481018290526105a090849063095ea7b360e01b906064016118a8565b600080612c2a600286613b2a565b600354604051635e1e632560e01b8152600481018390526001600160a01b038781166024830152868116604483015292935060009290911690635e1e6325906064016040805180830381865afa158015612c88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cac9190613d86565b50919695505050505050565b806001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015612cf6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d1a9190613a60565b6001600160a01b0316836001600160a01b03161480612dab5750806001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d969190613a60565b6001600160a01b0316836001600160a01b0316145b612deb5760405162461bcd60e51b815260206004820152601160248201527005a61703a2057726f6e6720746f6b656e3607c1b6044820152606401610543565b806001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015612e29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e4d9190613a60565b6001600160a01b0316826001600160a01b03161480612ede5750806001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ea5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ec99190613a60565b6001600160a01b0316826001600160a01b0316145b612f1e5760405162461bcd60e51b81526020600482015260116024820152705a61703a2057726f6e6720746f6b656e3160781b6044820152606401610543565b816001600160a01b0316836001600160a01b0316036105a05760405162461bcd60e51b815260206004820152601060248201526f5a61703a2053616d6520746f6b656e7360801b6044820152606401610543565b6000806000846001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015612fb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fd99190613a99565b506001600160701b031691506001600160701b031691506000856001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015613030573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130549190613a60565b6001600160a01b03168a6001600160a01b0316036130ac57613079888885858961218f565b6004549091506130898285613b2a565b10156130a75760405162461bcd60e51b815260040161054390613dc9565b6130e7565b6130b9888884868961218f565b6004549091506130c98284613b2a565b10156130e75760405162461bcd60e51b815260040161054390613dc9565b925050505b9695505050505050565b60408051600180825281830190925260609160009190816020015b60408051606081018252600080825260208083018290529282015282526000199092019101816131115790505090506000836001600160a01b03166322be3de16040518163ffffffff1660e01b8152600401602060405180830381865afa158015613180573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131a49190613b4c565b905084156132075760405180606001604052808a6001600160a01b03168152602001896001600160a01b03168152602001821515815250826000815181106131ee576131ee613b69565b6020026020010181905250613202896120ee565b61325d565b6040518060600160405280896001600160a01b031681526020018a6001600160a01b031681526020018215158152508260008151811061324957613249613b69565b602002602001018190525061325d886120ee565b600354604051631e82ecdb60e31b81526001600160a01b039091169063f41766d890613295908a908a90879030904290600401613b7f565b6000604051808303816000875af11580156132b4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526130e79190810190613c14565b60008115613473576132ed866120ee565b604080516002808252606082018352600092602083019080368337019050509050878160008151811061332257613322613b69565b60200260200101906001600160a01b031690816001600160a01b031681525050868160018151811061335657613356613b69565b6001600160a01b0392831660209182029290920101526003548251911690635a47ddc390839060009061338b5761338b613b69565b6020026020010151836001815181106133a6576133a6613b69565b60200260200101516000886000815181106133c3576133c3613b69565b60200260200101518b6133d69190613cd2565b896001815181106133e9576133e9613b69565b60200260200101518b6133fc9190613db6565b60018033426040518a63ffffffff1660e01b815260040161342599989796959493929190613ce5565b6060604051808303816000875af1158015613444573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134689190613d34565b93506130ec92505050565b61347c876120ee565b60408051600280825260608201835260009260208301908036833701905050905086816000815181106134b1576134b1613b69565b60200260200101906001600160a01b031690816001600160a01b03168152505087816001815181106134e5576134e5613b69565b6001600160a01b0392831660209182029290920101526003548251911690635a47ddc390839060009061351a5761351a613b69565b60200260200101518360018151811061353557613535613b69565b602002602001015160008860008151811061355257613552613b69565b60200260200101518a6135659190613cd2565b8960018151811061357857613578613b69565b60200260200101518c61358b9190613db6565b60018033426040518a63ffffffff1660e01b81526004016135b499989796959493929190613ce5565b6060604051808303816000875af11580156135d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135f79190613d34565b9a9950505050505050505050565b606061281a848460008585600080866001600160a01b0316858760405161362c9190613a44565b60006040518083038185875af1925050503d8060008114613669576040519150601f19603f3d011682016040523d82523d6000602084013e61366e565b606091505b509150915061221587838387606083156136e95782516000036136e2576001600160a01b0385163b6136e25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610543565b508161281a565b61281a83838151156136fe5781518083602001fd5b8060405162461bcd60e51b81526004016105439190613e00565b634e487b7160e01b600052600160045260246000fd5b60006020828403121561374057600080fd5b5035919050565b6001600160a01b03811681146117be57600080fd5b60008060006060848603121561377157600080fd5b833561377c81613747565b95602085013595506040909401359392505050565b6000806000606084860312156137a657600080fd5b83356137b181613747565b92506020840135915060408401356137c881613747565b809150509250925092565b600080604083850312156137e657600080fd5b82356137f181613747565b946020939093013593505050565b600080600080600060a0868803121561381757600080fd5b853561382281613747565b9450602086013561383281613747565b93506040860135925060608601359150608086013561385081613747565b809150509295509295909350565b6000806000806080858703121561387457600080fd5b843561387f81613747565b9350602085013561388f81613747565b93969395505050506040820135916060013590565b600080600080608085870312156138ba57600080fd5b84356138c581613747565b93506020850135925060408501356138dc81613747565b9396929550929360600135925050565b80151581146117be57600080fd5b60008060008060008060c0878903121561391357600080fd5b863561391e81613747565b955060208701359450604087013561393581613747565b9350606087013592506080870135915060a0870135613953816138ec565b809150509295509295509295565b600080600080600080600080610100898b03121561397e57600080fd5b883561398981613747565b9750602089013561399981613747565b9650604089013595506060890135945060808901356139b781613747565b935060a0890135925060c0890135915060e08901356139d5816138ec565b809150509295985092959890939650565b6000602082840312156139f857600080fd5b8135613a0381613747565b9392505050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015613a3b578181015183820152602001613a23565b50506000910152565b60008251613a56818460208701613a20565b9190910192915050565b600060208284031215613a7257600080fd5b8151613a0381613747565b80516001600160701b0381168114613a9457600080fd5b919050565b600080600060608486031215613aae57600080fd5b613ab784613a7d565b9250613ac560208501613a7d565b9150604084015163ffffffff811681146137c857600080fd5b600060208284031215613af057600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417613b2457613b24613af7565b92915050565b600082613b4757634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215613b5e57600080fd5b8151613a03816138ec565b634e487b7160e01b600052603260045260246000fd5b600060a0820187835260208781850152604060a08186015282885180855260c087019150838a01945060005b81811015613be857855180516001600160a01b03908116855286820151168685015284015115158484015294840194606090920191600101613bab565b50506001600160a01b03881660608701529350613c0492505050565b8260808301529695505050505050565b60006020808385031215613c2757600080fd5b825167ffffffffffffffff80821115613c3f57600080fd5b818501915085601f830112613c5357600080fd5b815181811115613c6557613c65613a0a565b8060051b604051601f19603f83011681018181108582111715613c8a57613c8a613a0a565b604052918252848201925083810185019188831115613ca857600080fd5b938501935b82851015613cc657845184529385019392850192613cad565b98975050505050505050565b81810381811115613b2457613b24613af7565b6001600160a01b03998a168152978916602089015295151560408801526060870194909452608086019290925260a085015260c084015290921660e08201526101008101919091526101200190565b600080600060608486031215613d4957600080fd5b8351925060208401519150604084015190509250925092565b60008060408385031215613d7557600080fd5b505080516020909101519092909150565b60008060408385031215613d9957600080fd5b825191506020830151613dab816138ec565b809150509250929050565b80820180821115613b2457613b24613af7565b6020808252601f908201527f5a61703a205175616e7469747920686967686572207468616e206c696d697400604082015260600190565b6020815260008251806020840152613e1f816040850160208701613a20565b601f01601f1916919091016040019291505056fea264697066735822122067d7b6a9fa892a518177b94da6a74d5172c7ff9ae310ca48d292f021c29f7c5164736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad380000000000000000000000001d368773735ee1e678950b7a97bca2cafb330cdc0000000000000000000000000000000000000000000000000000000000000002
-----Decoded View---------------
Arg [0] : _WETHAddress (address): 0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38
Arg [1] : _uniswapRouter (address): 0x1D368773735ee1E678950B7A97bcA2CafB330CDc
Arg [2] : _maxZapReverseRatio (uint256): 2
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad38
Arg [1] : 0000000000000000000000001d368773735ee1e678950b7a97bca2cafb330cdc
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000002
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in S
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.