Source Code
Latest 25 from a total of 488 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Remove Liquidity... | 379926880 | 137 days ago | IN | 0 ETH | 0.00000183 | ||||
| Remove Liquidity... | 378764973 | 140 days ago | IN | 0 ETH | 0.00000189 | ||||
| Remove Liquidity... | 378763184 | 140 days ago | IN | 0 ETH | 0.00000046 | ||||
| Remove Liquidity... | 378758977 | 140 days ago | IN | 0 ETH | 0.00000049 | ||||
| Remove Liquidity... | 378756458 | 140 days ago | IN | 0 ETH | 0.00000045 | ||||
| Remove Liquidity... | 378756022 | 140 days ago | IN | 0 ETH | 0.0000004 | ||||
| Remove Liquidity... | 378755564 | 140 days ago | IN | 0 ETH | 0.0000004 | ||||
| Remove Liquidity... | 347537824 | 230 days ago | IN | 0 ETH | 0.00000187 | ||||
| Remove Liquidity... | 345640602 | 236 days ago | IN | 0 ETH | 0.000002 | ||||
| Remove Liquidity... | 343066504 | 243 days ago | IN | 0 ETH | 0.00000198 | ||||
| Remove Liquidity... | 335084501 | 267 days ago | IN | 0 ETH | 0.00000192 | ||||
| Remove Liquidity... | 328559091 | 286 days ago | IN | 0 ETH | 0.00000188 | ||||
| Remove Liquidity... | 249296018 | 516 days ago | IN | 0 ETH | 0.00000209 | ||||
| Remove Liquidity... | 245765300 | 527 days ago | IN | 0 ETH | 0.00000192 | ||||
| Remove Liquidity... | 240108715 | 543 days ago | IN | 0 ETH | 0.00000323 | ||||
| Remove Liquidity... | 239239665 | 546 days ago | IN | 0 ETH | 0.00000197 | ||||
| Remove Liquidity... | 238918302 | 546 days ago | IN | 0 ETH | 0.00000213 | ||||
| Remove Liquidity... | 238359486 | 548 days ago | IN | 0 ETH | 0.00000815 | ||||
| Remove Liquidity... | 236835032 | 552 days ago | IN | 0 ETH | 0.00000211 | ||||
| Remove Liquidity... | 231451337 | 568 days ago | IN | 0 ETH | 0.00000265 | ||||
| Remove Liquidity... | 229760679 | 573 days ago | IN | 0 ETH | 0.00000207 | ||||
| Remove Liquidity... | 228973778 | 575 days ago | IN | 0 ETH | 0.0000031 | ||||
| Remove Liquidity... | 227991064 | 578 days ago | IN | 0 ETH | 0.00000313 | ||||
| Remove Liquidity... | 227990702 | 578 days ago | IN | 0 ETH | 0.000003 | ||||
| Remove Liquidity... | 227980068 | 578 days ago | IN | 0 ETH | 0.00000236 |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ArkenRouterV1
Compiler Version
v0.8.16+commit.07a7930e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity =0.8.16;
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
import '../token/interfaces/IArkenOptionRewarder.sol';
import './interfaces/IUniswapV2Pair.sol';
import './interfaces/IArkenPairLongTerm.sol';
import './interfaces/IArkenRouter.sol';
import './interfaces/IUniswapV2Factory.sol';
import './libraries/ArkenLPLibrary.sol';
// import 'hardhat/console.sol';
contract ArkenRouterV1 is Ownable, IArkenRouter {
using SafeERC20 for IERC20;
address public immutable WETH;
address public factory;
address public factoryLongTerm;
address public rewarder;
modifier ensure(uint deadline) {
require(deadline >= block.timestamp, 'ArkenRouter: EXPIRED');
_;
}
constructor(
address weth_,
address factory_,
address factoryLongTerm_,
address rewarder_
) {
WETH = weth_;
factory = factory_;
factoryLongTerm = factoryLongTerm_;
rewarder = rewarder_;
}
function updateRewarder(address rewarder_) external onlyOwner {
rewarder = rewarder_;
emit UpdateOptionRewarder(rewarder_);
}
function updateFactory(address factory_) external onlyOwner {
factory = factory_;
emit UpdateFactory(factory_);
}
function updateFactoryLongTerm(
address factoryLongTerm_
) external onlyOwner {
factoryLongTerm = factoryLongTerm_;
emit UpdateFactoryLongTerm(factoryLongTerm_);
}
function _swapForLiquidity(
address tokenIn,
uint256 amountIn,
address pair,
address tokenA,
address tokenB,
uint256 amountAMin,
uint256 amountBMin
) internal returns (uint256 amountA, uint256 amountB) {
(address token0, address token1) = ArkenLPLibrary.sortTokens(
tokenA,
tokenB
);
if (tokenIn == token0) {
(uint256 amount0In, uint256 amount1Out) = ArkenLPLibrary
.getAmountSwapRetainRatio(pair, tokenIn, amountIn);
IERC20(token0).safeTransferFrom(msg.sender, pair, amount0In);
IUniswapV2Pair(pair).swap(0, amount1Out, address(this), '');
IERC20(token0).safeTransferFrom(
msg.sender,
pair,
amountIn - amount0In
);
IERC20(token1).safeTransfer(pair, amount1Out);
(amountA, amountB) = tokenA == token0
? (amountIn - amount0In, amount1Out)
: (amount1Out, amountIn - amount0In);
} else {
(uint256 amount1In, uint256 amount0Out) = ArkenLPLibrary
.getAmountSwapRetainRatio(pair, tokenIn, amountIn);
IERC20(token1).safeTransferFrom(msg.sender, pair, amount1In);
IUniswapV2Pair(pair).swap(amount0Out, 0, address(this), '');
IERC20(token0).safeTransfer(pair, amount0Out);
IERC20(token1).safeTransferFrom(
msg.sender,
pair,
amountIn - amount1In
);
(amountA, amountB) = tokenA == token0
? (amount0Out, amountIn - amount1In)
: (amountIn - amount1In, amount0Out);
}
require(amountAMin <= amountA, 'ArkenRouter: INSUFFICIENT_A_AMOUNT');
require(amountBMin <= amountB, 'ArkenRouter: INSUFFICIENT_B_AMOUNT');
}
// **** ADD LIQUIDITY ****
function _addLiquidity(
uint256 reserveA,
uint256 reserveB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin
) internal virtual returns (uint amountA, uint amountB) {
if (reserveA == 0 && reserveB == 0) {
(amountA, amountB) = (amountADesired, amountBDesired);
} else {
uint amountBOptimal = ArkenLPLibrary.quote(
amountADesired,
reserveA,
reserveB
);
if (amountBOptimal <= amountBDesired) {
require(
amountBOptimal >= amountBMin,
'ArkenRouter: INSUFFICIENT_B_AMOUNT'
);
(amountA, amountB) = (amountADesired, amountBOptimal);
} else {
uint amountAOptimal = ArkenLPLibrary.quote(
amountBDesired,
reserveB,
reserveA
);
assert(amountAOptimal <= amountADesired);
require(
amountAOptimal >= amountAMin,
'ArkenRouter: INSUFFICIENT_A_AMOUNT'
);
(amountA, amountB) = (amountAOptimal, amountBDesired);
}
}
}
function addLiquidity(
AddLiquidityData calldata data,
uint256 deadline
)
external
ensure(deadline)
returns (uint256 amountA, uint256 amountB, uint256 liquidity)
{
(uint reserveA, uint reserveB) = ArkenLPLibrary.getReserves(
factory,
data.tokenA,
data.tokenB
);
(amountA, amountB) = _addLiquidity(
reserveA,
reserveB,
data.amountADesired,
data.amountBDesired,
data.amountAMin,
data.amountBMin
);
require(
data.amountAMin <= amountA,
'ArkenRouter: INSUFFICIENT_A_AMOUNT'
);
require(
data.amountBMin <= amountB,
'ArkenRouter: INSUFFICIENT_B_AMOUNT'
);
address pair = ArkenLPLibrary.pairFor(
factory,
data.tokenA,
data.tokenB
);
IERC20(data.tokenA).safeTransferFrom(msg.sender, pair, amountA);
IERC20(data.tokenB).safeTransferFrom(msg.sender, pair, amountB);
liquidity = IUniswapV2Pair(pair).mint(data.to);
}
function addLiquiditySingle(
AddLiquiditySingleData calldata data,
uint256 deadline
)
external
ensure(deadline)
returns (uint256 amountA, uint256 amountB, uint256 liquidity)
{
require(
data.tokenIn == data.tokenA || data.tokenIn == data.tokenB,
'ArkenRouter: INVALID_TOKEN_IN'
);
address pair = ArkenLPLibrary.pairFor(
factory,
data.tokenA,
data.tokenB
);
(amountA, amountB) = _swapForLiquidity(
data.tokenIn,
data.amountIn,
pair,
data.tokenA,
data.tokenB,
data.amountAMin,
data.amountBMin
);
liquidity = IUniswapV2Pair(pair).mint(data.to);
}
function addLiquidityLongTerm(
AddLiquidityData calldata addData,
AddLongTermInputData calldata longtermData,
uint256 deadline
)
external
ensure(deadline)
returns (AddLongTermOutputData memory outputData)
{
(uint reserveA, uint reserveB) = ArkenLPLibrary.getReserves(
factoryLongTerm,
addData.tokenA,
addData.tokenB
);
(outputData.amountA, outputData.amountB) = _addLiquidity(
reserveA,
reserveB,
addData.amountADesired,
addData.amountBDesired,
addData.amountAMin,
addData.amountBMin
);
require(
addData.amountAMin <= outputData.amountA,
'ArkenRouter: INSUFFICIENT_A_AMOUNT'
);
require(
addData.amountBMin <= outputData.amountB,
'ArkenRouter: INSUFFICIENT_B_AMOUNT'
);
address pair = ArkenLPLibrary.pairFor(
factoryLongTerm,
addData.tokenA,
addData.tokenB
);
IERC20(addData.tokenA).safeTransferFrom(
msg.sender,
pair,
outputData.amountA
);
IERC20(addData.tokenB).safeTransferFrom(
msg.sender,
pair,
outputData.amountB
);
(outputData.liquidity, outputData.positionTokenId) = IArkenPairLongTerm(
pair
).mint(rewarder, longtermData.lockTime);
IArkenOptionRewarder(rewarder).rewardLongTerm(
addData.to,
pair,
outputData.positionTokenId,
longtermData.rewardData
);
}
function addLiquidityLongTermSingle(
AddLiquiditySingleData calldata addData,
AddLongTermInputData calldata longtermData,
uint256 deadline
)
external
ensure(deadline)
returns (AddLongTermOutputData memory outputData)
{
require(
addData.tokenIn == addData.tokenA ||
addData.tokenIn == addData.tokenB,
'ArkenRouter: INVALID_TOKEN_IN'
);
address pair = ArkenLPLibrary.pairFor(
factoryLongTerm,
addData.tokenA,
addData.tokenB
);
(outputData.amountA, outputData.amountB) = _swapForLiquidity(
addData.tokenIn,
addData.amountIn,
pair,
addData.tokenA,
addData.tokenB,
addData.amountAMin,
addData.amountBMin
);
(outputData.liquidity, outputData.positionTokenId) = IArkenPairLongTerm(
pair
).mint(rewarder, longtermData.lockTime);
IArkenOptionRewarder(rewarder).rewardLongTerm(
addData.to,
pair,
outputData.positionTokenId,
longtermData.rewardData
);
}
/**
* REMOVE LIQUIDITY
*/
function _removeLiquidity(
address tokenA,
address tokenB,
uint256 liquidity,
address to
) internal returns (uint256 amountA, uint256 amountB) {
address pair = ArkenLPLibrary.pairFor(factory, tokenA, tokenB);
IUniswapV2Pair(pair).transferFrom(msg.sender, pair, liquidity); // send liquidity to pair
(uint amount0, uint amount1) = IUniswapV2Pair(pair).burn(to);
(address token0, ) = ArkenLPLibrary.sortTokens(tokenA, tokenB);
(amountA, amountB) = tokenA == token0
? (amount0, amount1)
: (amount1, amount0);
}
function _removeLiquidityLongTerm(
address tokenA,
address tokenB,
uint256 positionTokenId,
address to
) internal returns (uint256 amountA, uint256 amountB, address pair) {
pair = ArkenLPLibrary.pairFor(factoryLongTerm, tokenA, tokenB);
IArkenPairLongTerm(pair).transferFrom(
msg.sender,
pair,
positionTokenId
); // send token to pair
(uint amount0, uint amount1) = IArkenPairLongTerm(pair).burn(
to,
positionTokenId
);
(address token0, ) = ArkenLPLibrary.sortTokens(tokenA, tokenB);
(amountA, amountB) = tokenA == token0
? (amount0, amount1)
: (amount1, amount0);
}
function _returnLiquiditySingle(
address tokenOut,
address tokenA,
address tokenB,
address pair,
uint256 amountALiquidity,
uint256 amountBLiquidity,
address to
) internal returns (uint256 amountA, uint256 amountB) {
amountA = amountALiquidity;
amountB = amountBLiquidity;
(address token0, ) = ArkenLPLibrary.sortTokens(tokenA, tokenB);
uint256 reserveA;
uint256 reserveB;
if (tokenA == token0) {
(reserveA, reserveB, ) = IUniswapV2Pair(pair).getReserves();
} else {
(reserveB, reserveA, ) = IUniswapV2Pair(pair).getReserves();
}
uint256 amountOut;
if (tokenA == tokenOut) {
amountOut = ArkenLPLibrary.getAmountOut(
amountB,
reserveB,
reserveA
);
IERC20(tokenA).safeTransfer(to, amountA);
IERC20(tokenB).safeTransfer(pair, amountB);
amountA = amountA + amountOut;
amountB = 0;
} else {
amountOut = ArkenLPLibrary.getAmountOut(
amountA,
reserveA,
reserveB
);
IERC20(tokenA).safeTransfer(pair, amountA);
IERC20(tokenB).safeTransfer(to, amountB);
amountA = 0;
amountB = amountB + amountOut;
}
if (token0 == tokenOut) {
IUniswapV2Pair(pair).swap(amountOut, 0, to, '');
} else {
IUniswapV2Pair(pair).swap(0, amountOut, to, '');
}
}
function removeLiquidity(
RemoveLiquidityData calldata data,
uint256 liquidity,
uint256 deadline
) external ensure(deadline) returns (uint256 amountA, uint256 amountB) {
(amountA, amountB) = _removeLiquidity(
data.tokenA,
data.tokenB,
liquidity,
data.to
);
require(
amountA >= data.amountAMin,
'ArkenRouter: INSUFFICIENT_A_AMOUNT'
);
require(
amountB >= data.amountBMin,
'ArkenRouter: INSUFFICIENT_B_AMOUNT'
);
}
function removeLiquiditySingle(
RemoveLiquidityData calldata data,
address tokenOut,
uint256 liquidity,
uint256 deadline
) external ensure(deadline) returns (uint256 amountA, uint256 amountB) {
require(
tokenOut == data.tokenA || tokenOut == data.tokenB,
'ArkenRouter: INVALID_TOKEN_OUT'
);
(amountA, amountB) = _removeLiquidity(
data.tokenA,
data.tokenB,
liquidity,
address(this)
);
address pair = ArkenLPLibrary.pairFor(
factory,
data.tokenA,
data.tokenB
);
(amountA, amountB) = _returnLiquiditySingle(
tokenOut,
data.tokenA,
data.tokenB,
pair,
amountA,
amountB,
data.to
);
require(
amountA >= data.amountAMin,
'ArkenRouter: INSUFFICIENT_A_AMOUNT'
);
require(
amountB >= data.amountBMin,
'ArkenRouter: INSUFFICIENT_B_AMOUNT'
);
}
function removeLiquidityLongTerm(
RemoveLiquidityData calldata data,
uint256 positionTokenId,
uint256 deadline
) external ensure(deadline) returns (uint256 amountA, uint256 amountB) {
(amountA, amountB, ) = _removeLiquidityLongTerm(
data.tokenA,
data.tokenB,
positionTokenId,
data.to
);
require(
amountA >= data.amountAMin,
'ArkenRouter: INSUFFICIENT_A_AMOUNT'
);
require(
amountB >= data.amountBMin,
'ArkenRouter: INSUFFICIENT_B_AMOUNT'
);
}
function removeLiquidityLongTermSingle(
RemoveLiquidityData calldata data,
address tokenOut,
uint256 positionTokenId,
uint256 deadline
) external ensure(deadline) returns (uint256 amountA, uint256 amountB) {
require(
tokenOut == data.tokenA || tokenOut == data.tokenB,
'ArkenRouter: INVALID_TOKEN_OUT'
);
address pair;
(amountA, amountB, pair) = _removeLiquidityLongTerm(
data.tokenA,
data.tokenB,
positionTokenId,
address(this)
);
(amountA, amountB) = _returnLiquiditySingle(
tokenOut,
data.tokenA,
data.tokenB,
pair,
amountA,
amountB,
data.to
);
require(
amountA >= data.amountAMin,
'ArkenRouter: INSUFFICIENT_A_AMOUNT'
);
require(
amountB >= data.amountBMin,
'ArkenRouter: INSUFFICIENT_B_AMOUNT'
);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-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;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
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));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
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");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
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");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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 anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing 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);
}
}pragma solidity >0.8.0;
interface IArkenOptionRewarder {
error NoPosition();
error PositionRewarded(uint256 positionTokenId);
error InvalidExerciseAmountMinLength(
uint256 length,
uint256 expectedLength
);
error InsufficientRemainingArken();
error InsufficientExerciseAmount(uint256 amount, uint256 amountMin);
error InsufficientLockTime(uint256 lockTime, uint256 minimumLockTime);
error NotSupportedPair(address pair);
error InsufficientTotalReward(
uint256 totalRewardArken,
uint256 rewardedArken
);
event SetConfiguration(
address indexed pair,
address sender,
RewardConfiguration[] configs
);
event DeleteConfiguration(address indexed pair, address sender);
event SetTotalRewardArken(uint256 totalRewardArken, address sender);
event RewardOptionNFT(
uint256 tokenId,
address pair,
uint256 unlockedAt,
uint256 expiredAt,
uint256 unlockPrice,
uint256 exercisePrice,
uint256 exerciseAmount
);
function arken() external view returns (address);
function optionNFT() external view returns (address);
function totalRewardArken() external view returns (uint256);
function rewardedArken() external view returns (uint256);
function setTotalRewardArken(uint256) external;
struct RewardConfiguration {
uint256 lockTime;
uint256 expiredTime;
uint256 unlockPrice;
uint256 exercisePrice;
uint256 exerciseAmountFactor;
uint256 optionType;
}
function setConfiguration(
address pair,
RewardConfiguration[] memory configs
) external;
function deleteConfiguration(address pair) external;
function configurations(
address pair
) external view returns (RewardConfiguration[] memory);
function configuration(
address pair,
uint256 idx
) external view returns (RewardConfiguration memory);
struct RewardLongTermData {
uint256[] exerciseAmountMins;
}
function rewardLongTerm(
address to,
address pair,
uint256 positionTokenId,
bytes calldata data
) external returns (uint256[] memory tokenIds);
}// SPDX-License-Identifier: GPL-3.0-or-later
//solhint-disable-next-line compiler-version
pragma solidity >=0.5.0;
//solhint-disable func-name-mixedcase
import "./IUniswapV2ERC20.sol";
interface IUniswapV2Pair is IUniswapV2ERC20 {
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 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-or-later
pragma solidity >=0.8.0;
import './IUniswapV2ERC721.sol';
interface IArkenPairLongTerm is IUniswapV2ERC721 {
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 MINIMUM_LOCK_TIME() external pure returns (uint256);
function mintedAt(uint256 tokenId) external view returns (uint256);
function unlockedAt(uint256 tokenId) external view returns (uint256);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves()
external
view
returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint256);
function price1CumulativeLast() external view returns (uint256);
function kLast() external view returns (uint256);
function mint(
address to,
uint256 lockTime
) external returns (uint256 liquidity, uint256 tokenId);
function burn(
address to,
uint256 tokenId
) 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;
function getLiquidity(
uint256 tokenId
)
external
view
returns (uint256 amount0, uint256 amount1, uint256 liquidity);
function pauser() external view returns (address);
function pause() external;
function unpause() external;
function setPauser(address newPauser) external;
}pragma solidity >0.8.0;
interface IArkenRouter {
event UpdateOptionRewarder(address indexed optionRewarder);
event UpdateFactory(address indexed factory);
event UpdateFactoryLongTerm(address indexed factoryLongTerm);
function WETH() external view returns (address);
function factory() external view returns (address);
function factoryLongTerm() external view returns (address);
function rewarder() external view returns (address);
struct AddLiquidityData {
address tokenA;
address tokenB;
uint256 amountADesired;
uint256 amountBDesired;
uint256 amountAMin;
uint256 amountBMin;
address to;
}
struct AddLiquiditySingleData {
address tokenIn;
uint256 amountIn;
address tokenA;
address tokenB;
uint256 amountAMin;
uint256 amountBMin;
address to;
}
struct RemoveLiquidityData {
address tokenA;
address tokenB;
uint256 amountAMin;
uint256 amountBMin;
address to;
}
// Short Term
function addLiquidity(
AddLiquidityData calldata data,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);
function addLiquiditySingle(
AddLiquiditySingleData calldata data,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);
function removeLiquidity(
RemoveLiquidityData calldata data,
uint256 liquidity,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB);
function removeLiquiditySingle(
RemoveLiquidityData calldata data,
address tokenOut,
uint256 liquidity,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB);
// Long Term
struct AddLongTermInputData {
uint256 lockTime;
bytes rewardData;
}
struct AddLongTermOutputData {
uint256 amountA;
uint256 amountB;
uint256 liquidity;
uint256 positionTokenId;
}
function addLiquidityLongTerm(
AddLiquidityData calldata addData,
AddLongTermInputData calldata longtermData,
uint256 deadline
) external returns (AddLongTermOutputData memory outputData);
function addLiquidityLongTermSingle(
AddLiquiditySingleData calldata addData,
AddLongTermInputData calldata longtermData,
uint256 deadline
) external returns (AddLongTermOutputData memory outputData);
function removeLiquidityLongTerm(
RemoveLiquidityData calldata data,
uint256 positionTokenId,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB);
function removeLiquidityLongTermSingle(
RemoveLiquidityData calldata data,
address tokenOut,
uint256 positionTokenId,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB);
}// SPDX-License-Identifier: GPL-3.0-or-later
//solhint-disable-next-line compiler-version
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(
address indexed token0,
address indexed token1,
address pair,
uint256
);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB)
external
view
returns (address pair);
function allPairs(uint256) external view returns (address pair);
function allPairsLength() external view returns (uint256);
function createPair(address tokenA, address tokenB)
external
returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
//solhint-disable reason-string
// import 'hardhat/console.sol';
import '../../lib/Babylonian.sol';
import '../interfaces/IUniswapV2Pair.sol';
import '../interfaces/IUniswapV2Factory.sol';
library ArkenLPLibrary {
// returns sorted token addresses, used to handle return values from pairs sorted in this order
function sortTokens(
address tokenA,
address tokenB
) internal pure returns (address token0, address token1) {
require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES');
(token0, token1) = tokenA < tokenB
? (tokenA, tokenB)
: (tokenB, tokenA);
require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS');
}
// get pair address on factory from tokenA, tokenB
function pairFor(
address factory,
address tokenA,
address tokenB
) internal view returns (address pair) {
return IUniswapV2Factory(factory).getPair(tokenA, tokenB);
}
// fetches and sorts the reserves for a pair
function getReserves(
address factory,
address tokenA,
address tokenB
) internal view returns (uint256 reserveA, uint256 reserveB) {
(address token0, ) = sortTokens(tokenA, tokenB);
(uint256 reserve0, uint256 reserve1, ) = IUniswapV2Pair(
pairFor(factory, tokenA, tokenB)
).getReserves();
(reserveA, reserveB) = tokenA == token0
? (reserve0, reserve1)
: (reserve1, reserve0);
}
// given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
function quote(
uint256 amountA,
uint256 reserveA,
uint256 reserveB
) internal pure returns (uint256 amountB) {
require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT');
require(
reserveA > 0 && reserveB > 0,
'UniswapV2Library: INSUFFICIENT_LIQUIDITY'
);
amountB = (amountA * reserveB) / reserveA;
}
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(
uint256 amountIn,
uint256 reserveIn,
uint256 reserveOut
) internal pure returns (uint256 amountOut) {
require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
require(
reserveIn > 0 && reserveOut > 0,
'UniswapV2Library: INSUFFICIENT_LIQUIDITY'
);
uint256 amountInWithFee = amountIn * 997; // af = h * 1000
uint256 numerator = amountInWithFee * reserveOut; // n = h * y
uint256 denominator = reserveIn * 1000 + amountInWithFee; // d = x * 1000 + af
amountOut = numerator / denominator;
}
// given an output amount of an asset and pair reserves, returns a required input amount of the other asset
function getAmountIn(
uint256 amountOut,
uint256 reserveIn,
uint256 reserveOut
) internal pure returns (uint256 amountIn) {
require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT');
require(
reserveIn > 0 && reserveOut > 0,
'UniswapV2Library: INSUFFICIENT_LIQUIDITY'
);
uint256 numerator = reserveIn * amountOut * 1000;
uint256 denominator = (reserveOut - amountOut) * 997;
amountIn = numerator / denominator + 1;
}
// performs chained getAmountOut calculations on any number of pairs
function getAmountsOut(
address factory,
uint256 amountIn,
address[] memory path
) internal view returns (uint256[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint256[](path.length);
amounts[0] = amountIn;
for (uint256 i; i < path.length - 1; i++) {
(uint256 reserveIn, uint256 reserveOut) = getReserves(
factory,
path[i],
path[i + 1]
);
amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
}
}
// performs chained getAmountIn calculations on any number of pairs
function getAmountsIn(
address factory,
uint256 amountOut,
address[] memory path
) internal view returns (uint256[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint256[](path.length);
amounts[amounts.length - 1] = amountOut;
for (uint256 i = path.length - 1; i > 0; i--) {
(uint256 reserveIn, uint256 reserveOut) = getReserves(
factory,
path[i - 1],
path[i]
);
amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
}
}
function getAmountSwapRetainRatio(
address pair,
address tokenIn,
uint256 amountIn
) internal view returns (uint256 amountInSwap, uint256 amountOut) {
(uint256 reserveIn, uint256 reserveOut, ) = IUniswapV2Pair(pair)
.getReserves();
if (IUniswapV2Pair(pair).token1() == tokenIn)
(reserveIn, reserveOut) = (reserveOut, reserveIn);
uint256 nominator = Babylonian.sqrt(
(3988000 * amountIn + 3988009 * reserveIn) * reserveIn
) - (1997 * reserveIn);
uint256 denominator = 1994;
amountInSwap = nominator / denominator;
amountOut = getAmountOut(amountInSwap, reserveIn, reserveOut);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-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.
*/
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].
*/
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.7.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "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");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(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) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(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) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason 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 {
// 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 v4.4.1 (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;
}
}// SPDX-License-Identifier: GPL-3.0-or-later
//solhint-disable-next-line compiler-version
pragma solidity >=0.5.0;
//solhint-disable func-name-mixedcase
interface IUniswapV2ERC20 {
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;
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.0;
import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol';
interface IUniswapV2ERC721 is IERC721, IERC721Metadata {
function decimals() external view returns (uint8);
function liquidityOf(uint256 tokenId) external view returns (uint256);
function totalLiquidityOf(address owner) external view returns (uint256);
function tokenIdCounter() external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
library Babylonian {
// credit for this implementation goes to
// https://github.com/abdk-consulting/abdk-libraries-solidity/blob/master/ABDKMath64x64.sol#L687
function sqrt(uint256 x) internal pure returns (uint256) {
if (x == 0) return 0;
// this block is equivalent to r = uint256(1) << (BitMath.mostSignificantBit(x) / 2);
// however that code costs significantly more gas
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; // Seven iterations should be enough
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":"weth_","type":"address"},{"internalType":"address","name":"factory_","type":"address"},{"internalType":"address","name":"factoryLongTerm_","type":"address"},{"internalType":"address","name":"rewarder_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"factory","type":"address"}],"name":"UpdateFactory","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"factoryLongTerm","type":"address"}],"name":"UpdateFactoryLongTerm","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"optionRewarder","type":"address"}],"name":"UpdateOptionRewarder","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountADesired","type":"uint256"},{"internalType":"uint256","name":"amountBDesired","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct IArkenRouter.AddLiquidityData","name":"data","type":"tuple"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidity","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountADesired","type":"uint256"},{"internalType":"uint256","name":"amountBDesired","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct IArkenRouter.AddLiquidityData","name":"addData","type":"tuple"},{"components":[{"internalType":"uint256","name":"lockTime","type":"uint256"},{"internalType":"bytes","name":"rewardData","type":"bytes"}],"internalType":"struct IArkenRouter.AddLongTermInputData","name":"longtermData","type":"tuple"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidityLongTerm","outputs":[{"components":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"positionTokenId","type":"uint256"}],"internalType":"struct IArkenRouter.AddLongTermOutputData","name":"outputData","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct IArkenRouter.AddLiquiditySingleData","name":"addData","type":"tuple"},{"components":[{"internalType":"uint256","name":"lockTime","type":"uint256"},{"internalType":"bytes","name":"rewardData","type":"bytes"}],"internalType":"struct IArkenRouter.AddLongTermInputData","name":"longtermData","type":"tuple"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidityLongTermSingle","outputs":[{"components":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"positionTokenId","type":"uint256"}],"internalType":"struct IArkenRouter.AddLongTermOutputData","name":"outputData","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct IArkenRouter.AddLiquiditySingleData","name":"data","type":"tuple"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquiditySingle","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factoryLongTerm","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct IArkenRouter.RemoveLiquidityData","name":"data","type":"tuple"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidity","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct IArkenRouter.RemoveLiquidityData","name":"data","type":"tuple"},{"internalType":"uint256","name":"positionTokenId","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidityLongTerm","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct IArkenRouter.RemoveLiquidityData","name":"data","type":"tuple"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"positionTokenId","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidityLongTermSingle","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct IArkenRouter.RemoveLiquidityData","name":"data","type":"tuple"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquiditySingle","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewarder","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"factory_","type":"address"}],"name":"updateFactory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"factoryLongTerm_","type":"address"}],"name":"updateFactoryLongTerm","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"rewarder_","type":"address"}],"name":"updateRewarder","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a06040523480156200001157600080fd5b5060405162002b2d38038062002b2d8339810160408190526200003491620000f4565b6200003f3362000087565b6001600160a01b03938416608052600180549385166001600160a01b031994851617905560028054928516928416929092179091556003805491909316911617905562000151565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000ef57600080fd5b919050565b600080600080608085870312156200010b57600080fd5b6200011685620000d7565b93506200012660208601620000d7565b92506200013660408601620000d7565b91506200014660608601620000d7565b905092959194509250565b6080516129c06200016d600039600061027501526129c06000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c80638da5cb5b116100a2578063c45a015511610071578063c45a015514610297578063cd14bd21146102aa578063d9f165dc146102bd578063dcc3e06e146102d0578063f2fde38b146102e357600080fd5b80638da5cb5b1461022557806391eaa2861461024a57806397d147141461025d578063ad5c46481461027057600080fd5b8063542eaf80116100e9578063542eaf80146101cf5780635f95ac2e146101e2578063633075eb146101f7578063641a28891461020a578063715018a61461021d57600080fd5b80631f9033dc1461011b5780631fe9f6091461014e5780633cdb5b2a1461017657806351ff64e5146101bc575b600080fd5b61012e6101293660046123a9565b6102f6565b604080519384526020840192909252908201526060015b60405180910390f35b61016161015c3660046123e7565b6104f0565b60408051928352602083019190915201610145565b61018961018436600461242d565b6105a0565b60405161014591908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b6101896101ca36600461242d565b610846565b6101616101dd36600461249c565b610ade565b6101f56101f03660046124e2565b610c7c565b005b61016161020536600461249c565b610ccd565b61012e6102183660046123a9565b610dca565b6101f5610f82565b6000546001600160a01b03165b6040516001600160a01b039091168152602001610145565b6101616102583660046123e7565b610f96565b6101f561026b3660046124e2565b61101a565b6102327f000000000000000000000000000000000000000000000000000000000000000081565b600154610232906001600160a01b031681565b600254610232906001600160a01b031681565b6101f56102cb3660046124e2565b61106c565b600354610232906001600160a01b031681565b6101f56102f13660046124e2565b6110be565b600080600083428110156103255760405162461bcd60e51b815260040161031c906124ff565b60405180910390fd5b61033560608701604088016124e2565b6001600160a01b031661034b60208801886124e2565b6001600160a01b0316148061038c575061036b60808701606088016124e2565b6001600160a01b031661038160208801886124e2565b6001600160a01b0316145b6103d85760405162461bcd60e51b815260206004820152601d60248201527f41726b656e526f757465723a20494e56414c49445f544f4b454e5f494e000000604482015260640161031c565b600154600090610410906001600160a01b03166103fb60608a0160408b016124e2565b61040b60808b0160608c016124e2565b611137565b905061045761042260208901896124e2565b60208901358361043860608c0160408d016124e2565b61044860808d0160608e016124e2565b8c608001358d60a001356111b7565b90955093506001600160a01b038116636a62784261047b60e08a0160c08b016124e2565b6040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016020604051808303816000875af11580156104c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e5919061252d565b925050509250925092565b60008082428110156105145760405162461bcd60e51b815260040161031c906124ff565b61054a61052460208801886124e2565b6105346040890160208a016124e2565b8761054560a08b0160808c016124e2565b611435565b909350915060408601358310156105735760405162461bcd60e51b815260040161031c90612546565b85606001358210156105975760405162461bcd60e51b815260040161031c90612588565b50935093915050565b6105cb6040518060800160405280600081526020016000815260200160008152602001600081525090565b81428110156105ec5760405162461bcd60e51b815260040161031c906124ff565b6105fc60608601604087016124e2565b6001600160a01b031661061260208701876124e2565b6001600160a01b03161480610653575061063260808601606087016124e2565b6001600160a01b031661064860208701876124e2565b6001600160a01b0316145b61069f5760405162461bcd60e51b815260206004820152601d60248201527f41726b656e526f757465723a20494e56414c49445f544f4b454e5f494e000000604482015260640161031c565b6002546000906106d2906001600160a01b03166106c26060890160408a016124e2565b61040b60808a0160608b016124e2565b90506107196106e460208801886124e2565b6020880135836106fa60608b0160408c016124e2565b61070a60808c0160608d016124e2565b8b608001358c60a001356111b7565b602085015283526003546040516340c10f1960e01b81526001600160a01b03918216600482015286356024820152908216906340c10f199060440160408051808303816000875af1158015610772573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079691906125ca565b606085015260408401526003546001600160a01b031663a96a212b6107c160e0890160c08a016124e2565b606086015184906107d560208b018b6125ee565b6040518663ffffffff1660e01b81526004016107f5959493929190612635565b6000604051808303816000875af1158015610814573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261083c919081019061269f565b5050509392505050565b6108716040518060800160405280600081526020016000815260200160008152602001600081525090565b81428110156108925760405162461bcd60e51b815260040161031c906124ff565b60025460009081906108c9906001600160a01b03166108b460208a018a6124e2565b6108c460408b0160208c016124e2565b611585565b915091506108eb828289604001358a606001358b608001358c60a0013561164f565b6020860152808552608088013511156109165760405162461bcd60e51b815260040161031c90612546565b83602001518760a00135111561093e5760405162461bcd60e51b815260040161031c90612588565b60025460009061096e906001600160a01b031661095e60208b018b6124e2565b61040b60408c0160208d016124e2565b8551909150610999903390839061098860208d018d6124e2565b6001600160a01b0316929190611700565b6109b6338287602001518b602001602081019061098891906124e2565b6003546040516340c10f1960e01b81526001600160a01b03918216600482015288356024820152908216906340c10f199060440160408051808303816000875af1158015610a08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2c91906125ca565b606087015260408601526003546001600160a01b031663a96a212b610a5760e08b0160c08c016124e2565b60608801518490610a6b60208d018d6125ee565b6040518663ffffffff1660e01b8152600401610a8b959493929190612635565b6000604051808303816000875af1158015610aaa573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ad2919081019061269f565b50505050509392505050565b6000808242811015610b025760405162461bcd60e51b815260040161031c906124ff565b610b0f60208801886124e2565b6001600160a01b0316866001600160a01b03161480610b4e5750610b3960408801602089016124e2565b6001600160a01b0316866001600160a01b0316145b610b9a5760405162461bcd60e51b815260206004820152601e60248201527f41726b656e526f757465723a20494e56414c49445f544f4b454e5f4f55540000604482015260640161031c565b610bc1610baa60208901896124e2565b610bba60408a0160208b016124e2565b8730611435565b6001549194509250600090610be6906001600160a01b031661095e60208b018b6124e2565b9050610c2487610bf960208b018b6124e2565b610c0960408c0160208d016124e2565b8488888e6080016020810190610c1f91906124e2565b611771565b90945092506040880135841015610c4d5760405162461bcd60e51b815260040161031c90612546565b8760600135831015610c715760405162461bcd60e51b815260040161031c90612588565b505094509492505050565b610c84611a2a565b600280546001600160a01b0319166001600160a01b0383169081179091556040517e593f5f10df6b6786f77e6cdc7f12b7968f0e24134570e2fe44918134a303a390600090a250565b6000808242811015610cf15760405162461bcd60e51b815260040161031c906124ff565b610cfe60208801886124e2565b6001600160a01b0316866001600160a01b03161480610d3d5750610d2860408801602089016124e2565b6001600160a01b0316866001600160a01b0316145b610d895760405162461bcd60e51b815260206004820152601e60248201527f41726b656e526f757465723a20494e56414c49445f544f4b454e5f4f55540000604482015260640161031c565b6000610db2610d9b60208a018a6124e2565b610dab60408b0160208c016124e2565b8830611a84565b91955093509050610c2487610bf960208b018b6124e2565b60008060008342811015610df05760405162461bcd60e51b815260040161031c906124ff565b6001546000908190610e22906001600160a01b0316610e1260208b018b6124e2565b6108c460408c0160208d016124e2565b91509150610e4482828a604001358b606001358c608001358d60a0013561164f565b90965094506080880135861015610e6d5760405162461bcd60e51b815260040161031c90612546565b848860a001351115610e915760405162461bcd60e51b815260040161031c90612588565b600154600090610ec1906001600160a01b0316610eb160208c018c6124e2565b61040b60408d0160208e016124e2565b9050610ed633828961098860208e018e6124e2565b610eec33828861098860408e0160208f016124e2565b6001600160a01b038116636a627842610f0b60e08c0160c08d016124e2565b6040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016020604051808303816000875af1158015610f51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f75919061252d565b9450505050509250925092565b610f8a611a2a565b610f946000611bcb565b565b6000808242811015610fba5760405162461bcd60e51b815260040161031c906124ff565b610ff0610fca60208801886124e2565b610fda6040890160208a016124e2565b87610feb60a08b0160808c016124e2565b611a84565b50909350915060408601358310156105735760405162461bcd60e51b815260040161031c90612546565b611022611a2a565b600380546001600160a01b0319166001600160a01b0383169081179091556040517f69f3055d4490c4b7f05642c3b01f41ec6a8a5579b39b3509fc017a26dd4f745090600090a250565b611074611a2a565b600180546001600160a01b0319166001600160a01b0383169081179091556040517f20690ae37b722d1d6265acdad124822baeb394891cc396d0722cbdb5fa2a683d90600090a250565b6110c6611a2a565b6001600160a01b03811661112b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161031c565b61113481611bcb565b50565b60405163e6a4390560e01b81526001600160a01b03838116600483015282811660248301526000919085169063e6a4390590604401602060405180830381865afa158015611189573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ad919061275d565b90505b9392505050565b6000806000806111c78888611c1b565b91509150816001600160a01b03168b6001600160a01b0316036112e8576000806111f28b8e8e611d12565b909250905061120c6001600160a01b038516338d85611700565b60405163022c0d9f60e01b81526001600160a01b038c169063022c0d9f9061123d906000908590309060040161277a565b600060405180830381600087803b15801561125757600080fd5b505af115801561126b573d6000803e3d6000fd5b50505050611292338c848f61128091906127be565b6001600160a01b038816929190611700565b6112a66001600160a01b0384168c83611e86565b836001600160a01b03168a6001600160a01b0316146112cf57806112ca838e6127be565b6112db565b6112d9828d6127be565b815b90965094506113e7915050565b6000806112f68b8e8e611d12565b90925090506113106001600160a01b038416338d85611700565b60405163022c0d9f60e01b81526001600160a01b038c169063022c0d9f90611341908490600090309060040161277a565b600060405180830381600087803b15801561135b57600080fd5b505af115801561136f573d6000803e3d6000fd5b50611388925050506001600160a01b0385168c83611e86565b6113ab338c848f61139991906127be565b6001600160a01b038716929190611700565b836001600160a01b03168a6001600160a01b0316146113d4576113ce828d6127be565b816113df565b806113df838e6127be565b909650945050505b838611156114075760405162461bcd60e51b815260040161031c90612546565b828511156114275760405162461bcd60e51b815260040161031c90612588565b505097509795505050505050565b60015460009081908190611453906001600160a01b03168888611137565b6040516323b872dd60e01b81523360048201526001600160a01b03821660248201819052604482018890529192506323b872dd906064016020604051808303816000875af11580156114a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114cd91906127d7565b5060405163226bf2d160e21b81526001600160a01b03858116600483015260009182918416906389afcb449060240160408051808303816000875af115801561151a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061153e91906125ca565b91509150600061154e8a8a611c1b565b509050806001600160a01b03168a6001600160a01b031614611571578183611574565b82825b909b909a5098505050505050505050565b60008060006115948585611c1b565b5090506000806115a5888888611137565b6001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156115e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116069190612815565b506001600160701b031691506001600160701b03169150826001600160a01b0316876001600160a01b03161461163d578082611640565b81815b90999098509650505050505050565b6000808715801561165e575086155b1561166d5750849050836116f5565b600061167a878a8a611ebb565b90508581116116ae57838110156116a35760405162461bcd60e51b815260040161031c90612588565b8692509050806116f3565b60006116bb878a8c611ebb565b9050878111156116cd576116cd612865565b858110156116ed5760405162461bcd60e51b815260040161031c90612546565b92508591505b505b965096945050505050565b6040516001600160a01b038085166024830152831660448201526064810182905261176b9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611f5b565b50505050565b8282600061177f8989611c1b565b509050600080826001600160a01b03168b6001600160a01b03160361181657886001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156117dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118009190612815565b506001600160701b03918216935016905061188a565b886001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015611854573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118789190612815565b506001600160701b0390811693501690505b60008c6001600160a01b03168c6001600160a01b0316036118ef576118b085838561202d565b90506118c66001600160a01b038d168888611e86565b6118da6001600160a01b038c168b87611e86565b6118e4818761287b565b955060009450611935565b6118fa86848461202d565b90506119106001600160a01b038d168b88611e86565b6119246001600160a01b038c168887611e86565b60009550611932818661287b565b94505b8c6001600160a01b0316846001600160a01b0316036119b65760405163022c0d9f60e01b81526001600160a01b038b169063022c0d9f9061197f9084906000908c9060040161277a565b600060405180830381600087803b15801561199957600080fd5b505af11580156119ad573d6000803e3d6000fd5b50505050611a1a565b60405163022c0d9f60e01b81526001600160a01b038b169063022c0d9f906119e79060009085908c9060040161277a565b600060405180830381600087803b158015611a0157600080fd5b505af1158015611a15573d6000803e3d6000fd5b505050505b5050505097509795505050505050565b6000546001600160a01b03163314610f945760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161031c565b60025460009081908190611aa2906001600160a01b03168888611137565b6040516323b872dd60e01b81523360048201526001600160a01b03821660248201819052604482018890529192506323b872dd90606401600060405180830381600087803b158015611af357600080fd5b505af1158015611b07573d6000803e3d6000fd5b5050604051632770a7eb60e21b81526001600160a01b0387811660048301526024820189905260009350839250841690639dc29fac9060440160408051808303816000875af1158015611b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8291906125ca565b915091506000611b928a8a611c1b565b509050806001600160a01b03168a6001600160a01b031614611bb5578183611bb8565b82825b909b909a50939850929650505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080826001600160a01b0316846001600160a01b031603611c8d5760405162461bcd60e51b815260206004820152602560248201527f556e697377617056324c6962726172793a204944454e544943414c5f41444452604482015264455353455360d81b606482015260840161031c565b826001600160a01b0316846001600160a01b031610611cad578284611cb0565b83835b90925090506001600160a01b038216611d0b5760405162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015260640161031c565b9250929050565b600080600080866001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015611d56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7a9190612815565b506001600160701b031691506001600160701b03169150856001600160a01b0316876001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611dd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dfd919061275d565b6001600160a01b031603611e0d57905b6000611e1b836107cd61288e565b611e5284611e2c81623cda2961288e565b611e398a623cda2061288e565b611e43919061287b565b611e4d919061288e565b61210c565b611e5c91906127be565b90506107ca611e6b81836128ad565b9550611e7886858561202d565b945050505050935093915050565b6040516001600160a01b038316602482015260448101829052611eb690849063a9059cbb60e01b90606401611734565b505050565b6000808411611f1a5760405162461bcd60e51b815260206004820152602560248201527f556e697377617056324c6962726172793a20494e53554646494349454e545f416044820152641353d5539560da1b606482015260840161031c565b600083118015611f2a5750600082115b611f465760405162461bcd60e51b815260040161031c906128cf565b82611f51838661288e565b6111ad91906128ad565b6000611fb0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661228d9092919063ffffffff16565b805190915015611eb65780806020019051810190611fce91906127d7565b611eb65760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161031c565b60008084116120925760405162461bcd60e51b815260206004820152602b60248201527f556e697377617056324c6962726172793a20494e53554646494349454e545f4960448201526a1394155517d05353d5539560aa1b606482015260840161031c565b6000831180156120a25750600082115b6120be5760405162461bcd60e51b815260040161031c906128cf565b60006120cc856103e561288e565b905060006120da848361288e565b90506000826120eb876103e861288e565b6120f5919061287b565b905061210181836128ad565b979650505050505050565b60008160000361211e57506000919050565b816001600160801b82106121375760809190911c9060401b5b6801000000000000000082106121525760409190911c9060201b5b64010000000082106121695760209190911c9060101b5b62010000821061217e5760109190911c9060081b5b61010082106121925760089190911c9060041b5b601082106121a55760049190911c9060021b5b600882106121b15760011b5b60016121bd82866128ad565b6121c7908361287b565b901c905060016121d782866128ad565b6121e1908361287b565b901c905060016121f182866128ad565b6121fb908361287b565b901c9050600161220b82866128ad565b612215908361287b565b901c9050600161222582866128ad565b61222f908361287b565b901c9050600161223f82866128ad565b612249908361287b565b901c9050600161225982866128ad565b612263908361287b565b901c9050600061227382866128ad565b90508082106122825780612284565b815b95945050505050565b60606111ad8484600085856001600160a01b0385163b6122ef5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161031c565b600080866001600160a01b0316858760405161230b919061293b565b60006040518083038185875af1925050503d8060008114612348576040519150601f19603f3d011682016040523d82523d6000602084013e61234d565b606091505b5091509150612101828286606083156123675750816111b0565b8251156123775782518084602001fd5b8160405162461bcd60e51b815260040161031c9190612957565b600060e082840312156123a357600080fd5b50919050565b60008061010083850312156123bd57600080fd5b6123c78484612391565b9460e0939093013593505050565b600060a082840312156123a357600080fd5b600080600060e084860312156123fc57600080fd5b61240685856123d5565b9560a0850135955060c0909401359392505050565b6000604082840312156123a357600080fd5b6000806000610120848603121561244357600080fd5b61244d8585612391565b925060e084013567ffffffffffffffff81111561246957600080fd5b6124758682870161241b565b92505061010084013590509250925092565b6001600160a01b038116811461113457600080fd5b60008060008061010085870312156124b357600080fd5b6124bd86866123d5565b935060a08501356124cd81612487565b939693955050505060c08201359160e0013590565b6000602082840312156124f457600080fd5b81356111b081612487565b602080825260149082015273105c9ad95b949bdd5d195c8e881156141254915160621b604082015260600190565b60006020828403121561253f57600080fd5b5051919050565b60208082526022908201527f41726b656e526f757465723a20494e53554646494349454e545f415f414d4f55604082015261139560f21b606082015260800190565b60208082526022908201527f41726b656e526f757465723a20494e53554646494349454e545f425f414d4f55604082015261139560f21b606082015260800190565b600080604083850312156125dd57600080fd5b505080516020909101519092909150565b6000808335601e1984360301811261260557600080fd5b83018035915067ffffffffffffffff82111561262057600080fd5b602001915036819003821315611d0b57600080fd5b6001600160a01b038681168252851660208201526040810184905260806060820181905281018290526000828460a0840137600060a0848401015260a0601f19601f85011683010190509695505050505050565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156126b257600080fd5b825167ffffffffffffffff808211156126ca57600080fd5b818501915085601f8301126126de57600080fd5b8151818111156126f0576126f0612689565b8060051b604051601f19603f8301168101818110858211171561271557612715612689565b60405291825284820192508381018501918883111561273357600080fd5b938501935b8285101561275157845184529385019392850192612738565b98975050505050505050565b60006020828403121561276f57600080fd5b81516111b081612487565b92835260208301919091526001600160a01b0316604082015260806060820181905260009082015260a00190565b634e487b7160e01b600052601160045260246000fd5b818103818111156127d1576127d16127a8565b92915050565b6000602082840312156127e957600080fd5b815180151581146111b057600080fd5b80516001600160701b038116811461281057600080fd5b919050565b60008060006060848603121561282a57600080fd5b612833846127f9565b9250612841602085016127f9565b9150604084015163ffffffff8116811461285a57600080fd5b809150509250925092565b634e487b7160e01b600052600160045260246000fd5b808201808211156127d1576127d16127a8565b60008160001904831182151516156128a8576128a86127a8565b500290565b6000826128ca57634e487b7160e01b600052601260045260246000fd5b500490565b60208082526028908201527f556e697377617056324c6962726172793a20494e53554646494349454e545f4c604082015267495155494449545960c01b606082015260800190565b60005b8381101561293257818101518382015260200161291a565b50506000910152565b6000825161294d818460208701612917565b9190910192915050565b6020815260008251806020840152612976816040850160208701612917565b601f01601f1916919091016040019291505056fea2646970667358221220c2e5a3e4627c7afaacfdc7896e6adba6cc0d61c41f844efd997183ad5034e00264736f6c6343000810003300000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab100000000000000000000000000000000000000000000000000000000000000000000000000000000000000006f61689dcafde0d96dbc23a749b18bbc40903a78000000000000000000000000278e453e50b8ef8d2dd41765c5aec28eff953342
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101165760003560e01c80638da5cb5b116100a2578063c45a015511610071578063c45a015514610297578063cd14bd21146102aa578063d9f165dc146102bd578063dcc3e06e146102d0578063f2fde38b146102e357600080fd5b80638da5cb5b1461022557806391eaa2861461024a57806397d147141461025d578063ad5c46481461027057600080fd5b8063542eaf80116100e9578063542eaf80146101cf5780635f95ac2e146101e2578063633075eb146101f7578063641a28891461020a578063715018a61461021d57600080fd5b80631f9033dc1461011b5780631fe9f6091461014e5780633cdb5b2a1461017657806351ff64e5146101bc575b600080fd5b61012e6101293660046123a9565b6102f6565b604080519384526020840192909252908201526060015b60405180910390f35b61016161015c3660046123e7565b6104f0565b60408051928352602083019190915201610145565b61018961018436600461242d565b6105a0565b60405161014591908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b6101896101ca36600461242d565b610846565b6101616101dd36600461249c565b610ade565b6101f56101f03660046124e2565b610c7c565b005b61016161020536600461249c565b610ccd565b61012e6102183660046123a9565b610dca565b6101f5610f82565b6000546001600160a01b03165b6040516001600160a01b039091168152602001610145565b6101616102583660046123e7565b610f96565b6101f561026b3660046124e2565b61101a565b6102327f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab181565b600154610232906001600160a01b031681565b600254610232906001600160a01b031681565b6101f56102cb3660046124e2565b61106c565b600354610232906001600160a01b031681565b6101f56102f13660046124e2565b6110be565b600080600083428110156103255760405162461bcd60e51b815260040161031c906124ff565b60405180910390fd5b61033560608701604088016124e2565b6001600160a01b031661034b60208801886124e2565b6001600160a01b0316148061038c575061036b60808701606088016124e2565b6001600160a01b031661038160208801886124e2565b6001600160a01b0316145b6103d85760405162461bcd60e51b815260206004820152601d60248201527f41726b656e526f757465723a20494e56414c49445f544f4b454e5f494e000000604482015260640161031c565b600154600090610410906001600160a01b03166103fb60608a0160408b016124e2565b61040b60808b0160608c016124e2565b611137565b905061045761042260208901896124e2565b60208901358361043860608c0160408d016124e2565b61044860808d0160608e016124e2565b8c608001358d60a001356111b7565b90955093506001600160a01b038116636a62784261047b60e08a0160c08b016124e2565b6040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016020604051808303816000875af11580156104c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e5919061252d565b925050509250925092565b60008082428110156105145760405162461bcd60e51b815260040161031c906124ff565b61054a61052460208801886124e2565b6105346040890160208a016124e2565b8761054560a08b0160808c016124e2565b611435565b909350915060408601358310156105735760405162461bcd60e51b815260040161031c90612546565b85606001358210156105975760405162461bcd60e51b815260040161031c90612588565b50935093915050565b6105cb6040518060800160405280600081526020016000815260200160008152602001600081525090565b81428110156105ec5760405162461bcd60e51b815260040161031c906124ff565b6105fc60608601604087016124e2565b6001600160a01b031661061260208701876124e2565b6001600160a01b03161480610653575061063260808601606087016124e2565b6001600160a01b031661064860208701876124e2565b6001600160a01b0316145b61069f5760405162461bcd60e51b815260206004820152601d60248201527f41726b656e526f757465723a20494e56414c49445f544f4b454e5f494e000000604482015260640161031c565b6002546000906106d2906001600160a01b03166106c26060890160408a016124e2565b61040b60808a0160608b016124e2565b90506107196106e460208801886124e2565b6020880135836106fa60608b0160408c016124e2565b61070a60808c0160608d016124e2565b8b608001358c60a001356111b7565b602085015283526003546040516340c10f1960e01b81526001600160a01b03918216600482015286356024820152908216906340c10f199060440160408051808303816000875af1158015610772573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079691906125ca565b606085015260408401526003546001600160a01b031663a96a212b6107c160e0890160c08a016124e2565b606086015184906107d560208b018b6125ee565b6040518663ffffffff1660e01b81526004016107f5959493929190612635565b6000604051808303816000875af1158015610814573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261083c919081019061269f565b5050509392505050565b6108716040518060800160405280600081526020016000815260200160008152602001600081525090565b81428110156108925760405162461bcd60e51b815260040161031c906124ff565b60025460009081906108c9906001600160a01b03166108b460208a018a6124e2565b6108c460408b0160208c016124e2565b611585565b915091506108eb828289604001358a606001358b608001358c60a0013561164f565b6020860152808552608088013511156109165760405162461bcd60e51b815260040161031c90612546565b83602001518760a00135111561093e5760405162461bcd60e51b815260040161031c90612588565b60025460009061096e906001600160a01b031661095e60208b018b6124e2565b61040b60408c0160208d016124e2565b8551909150610999903390839061098860208d018d6124e2565b6001600160a01b0316929190611700565b6109b6338287602001518b602001602081019061098891906124e2565b6003546040516340c10f1960e01b81526001600160a01b03918216600482015288356024820152908216906340c10f199060440160408051808303816000875af1158015610a08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2c91906125ca565b606087015260408601526003546001600160a01b031663a96a212b610a5760e08b0160c08c016124e2565b60608801518490610a6b60208d018d6125ee565b6040518663ffffffff1660e01b8152600401610a8b959493929190612635565b6000604051808303816000875af1158015610aaa573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ad2919081019061269f565b50505050509392505050565b6000808242811015610b025760405162461bcd60e51b815260040161031c906124ff565b610b0f60208801886124e2565b6001600160a01b0316866001600160a01b03161480610b4e5750610b3960408801602089016124e2565b6001600160a01b0316866001600160a01b0316145b610b9a5760405162461bcd60e51b815260206004820152601e60248201527f41726b656e526f757465723a20494e56414c49445f544f4b454e5f4f55540000604482015260640161031c565b610bc1610baa60208901896124e2565b610bba60408a0160208b016124e2565b8730611435565b6001549194509250600090610be6906001600160a01b031661095e60208b018b6124e2565b9050610c2487610bf960208b018b6124e2565b610c0960408c0160208d016124e2565b8488888e6080016020810190610c1f91906124e2565b611771565b90945092506040880135841015610c4d5760405162461bcd60e51b815260040161031c90612546565b8760600135831015610c715760405162461bcd60e51b815260040161031c90612588565b505094509492505050565b610c84611a2a565b600280546001600160a01b0319166001600160a01b0383169081179091556040517e593f5f10df6b6786f77e6cdc7f12b7968f0e24134570e2fe44918134a303a390600090a250565b6000808242811015610cf15760405162461bcd60e51b815260040161031c906124ff565b610cfe60208801886124e2565b6001600160a01b0316866001600160a01b03161480610d3d5750610d2860408801602089016124e2565b6001600160a01b0316866001600160a01b0316145b610d895760405162461bcd60e51b815260206004820152601e60248201527f41726b656e526f757465723a20494e56414c49445f544f4b454e5f4f55540000604482015260640161031c565b6000610db2610d9b60208a018a6124e2565b610dab60408b0160208c016124e2565b8830611a84565b91955093509050610c2487610bf960208b018b6124e2565b60008060008342811015610df05760405162461bcd60e51b815260040161031c906124ff565b6001546000908190610e22906001600160a01b0316610e1260208b018b6124e2565b6108c460408c0160208d016124e2565b91509150610e4482828a604001358b606001358c608001358d60a0013561164f565b90965094506080880135861015610e6d5760405162461bcd60e51b815260040161031c90612546565b848860a001351115610e915760405162461bcd60e51b815260040161031c90612588565b600154600090610ec1906001600160a01b0316610eb160208c018c6124e2565b61040b60408d0160208e016124e2565b9050610ed633828961098860208e018e6124e2565b610eec33828861098860408e0160208f016124e2565b6001600160a01b038116636a627842610f0b60e08c0160c08d016124e2565b6040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016020604051808303816000875af1158015610f51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f75919061252d565b9450505050509250925092565b610f8a611a2a565b610f946000611bcb565b565b6000808242811015610fba5760405162461bcd60e51b815260040161031c906124ff565b610ff0610fca60208801886124e2565b610fda6040890160208a016124e2565b87610feb60a08b0160808c016124e2565b611a84565b50909350915060408601358310156105735760405162461bcd60e51b815260040161031c90612546565b611022611a2a565b600380546001600160a01b0319166001600160a01b0383169081179091556040517f69f3055d4490c4b7f05642c3b01f41ec6a8a5579b39b3509fc017a26dd4f745090600090a250565b611074611a2a565b600180546001600160a01b0319166001600160a01b0383169081179091556040517f20690ae37b722d1d6265acdad124822baeb394891cc396d0722cbdb5fa2a683d90600090a250565b6110c6611a2a565b6001600160a01b03811661112b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161031c565b61113481611bcb565b50565b60405163e6a4390560e01b81526001600160a01b03838116600483015282811660248301526000919085169063e6a4390590604401602060405180830381865afa158015611189573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ad919061275d565b90505b9392505050565b6000806000806111c78888611c1b565b91509150816001600160a01b03168b6001600160a01b0316036112e8576000806111f28b8e8e611d12565b909250905061120c6001600160a01b038516338d85611700565b60405163022c0d9f60e01b81526001600160a01b038c169063022c0d9f9061123d906000908590309060040161277a565b600060405180830381600087803b15801561125757600080fd5b505af115801561126b573d6000803e3d6000fd5b50505050611292338c848f61128091906127be565b6001600160a01b038816929190611700565b6112a66001600160a01b0384168c83611e86565b836001600160a01b03168a6001600160a01b0316146112cf57806112ca838e6127be565b6112db565b6112d9828d6127be565b815b90965094506113e7915050565b6000806112f68b8e8e611d12565b90925090506113106001600160a01b038416338d85611700565b60405163022c0d9f60e01b81526001600160a01b038c169063022c0d9f90611341908490600090309060040161277a565b600060405180830381600087803b15801561135b57600080fd5b505af115801561136f573d6000803e3d6000fd5b50611388925050506001600160a01b0385168c83611e86565b6113ab338c848f61139991906127be565b6001600160a01b038716929190611700565b836001600160a01b03168a6001600160a01b0316146113d4576113ce828d6127be565b816113df565b806113df838e6127be565b909650945050505b838611156114075760405162461bcd60e51b815260040161031c90612546565b828511156114275760405162461bcd60e51b815260040161031c90612588565b505097509795505050505050565b60015460009081908190611453906001600160a01b03168888611137565b6040516323b872dd60e01b81523360048201526001600160a01b03821660248201819052604482018890529192506323b872dd906064016020604051808303816000875af11580156114a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114cd91906127d7565b5060405163226bf2d160e21b81526001600160a01b03858116600483015260009182918416906389afcb449060240160408051808303816000875af115801561151a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061153e91906125ca565b91509150600061154e8a8a611c1b565b509050806001600160a01b03168a6001600160a01b031614611571578183611574565b82825b909b909a5098505050505050505050565b60008060006115948585611c1b565b5090506000806115a5888888611137565b6001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156115e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116069190612815565b506001600160701b031691506001600160701b03169150826001600160a01b0316876001600160a01b03161461163d578082611640565b81815b90999098509650505050505050565b6000808715801561165e575086155b1561166d5750849050836116f5565b600061167a878a8a611ebb565b90508581116116ae57838110156116a35760405162461bcd60e51b815260040161031c90612588565b8692509050806116f3565b60006116bb878a8c611ebb565b9050878111156116cd576116cd612865565b858110156116ed5760405162461bcd60e51b815260040161031c90612546565b92508591505b505b965096945050505050565b6040516001600160a01b038085166024830152831660448201526064810182905261176b9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611f5b565b50505050565b8282600061177f8989611c1b565b509050600080826001600160a01b03168b6001600160a01b03160361181657886001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156117dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118009190612815565b506001600160701b03918216935016905061188a565b886001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015611854573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118789190612815565b506001600160701b0390811693501690505b60008c6001600160a01b03168c6001600160a01b0316036118ef576118b085838561202d565b90506118c66001600160a01b038d168888611e86565b6118da6001600160a01b038c168b87611e86565b6118e4818761287b565b955060009450611935565b6118fa86848461202d565b90506119106001600160a01b038d168b88611e86565b6119246001600160a01b038c168887611e86565b60009550611932818661287b565b94505b8c6001600160a01b0316846001600160a01b0316036119b65760405163022c0d9f60e01b81526001600160a01b038b169063022c0d9f9061197f9084906000908c9060040161277a565b600060405180830381600087803b15801561199957600080fd5b505af11580156119ad573d6000803e3d6000fd5b50505050611a1a565b60405163022c0d9f60e01b81526001600160a01b038b169063022c0d9f906119e79060009085908c9060040161277a565b600060405180830381600087803b158015611a0157600080fd5b505af1158015611a15573d6000803e3d6000fd5b505050505b5050505097509795505050505050565b6000546001600160a01b03163314610f945760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161031c565b60025460009081908190611aa2906001600160a01b03168888611137565b6040516323b872dd60e01b81523360048201526001600160a01b03821660248201819052604482018890529192506323b872dd90606401600060405180830381600087803b158015611af357600080fd5b505af1158015611b07573d6000803e3d6000fd5b5050604051632770a7eb60e21b81526001600160a01b0387811660048301526024820189905260009350839250841690639dc29fac9060440160408051808303816000875af1158015611b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8291906125ca565b915091506000611b928a8a611c1b565b509050806001600160a01b03168a6001600160a01b031614611bb5578183611bb8565b82825b909b909a50939850929650505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080826001600160a01b0316846001600160a01b031603611c8d5760405162461bcd60e51b815260206004820152602560248201527f556e697377617056324c6962726172793a204944454e544943414c5f41444452604482015264455353455360d81b606482015260840161031c565b826001600160a01b0316846001600160a01b031610611cad578284611cb0565b83835b90925090506001600160a01b038216611d0b5760405162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015260640161031c565b9250929050565b600080600080866001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015611d56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7a9190612815565b506001600160701b031691506001600160701b03169150856001600160a01b0316876001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611dd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dfd919061275d565b6001600160a01b031603611e0d57905b6000611e1b836107cd61288e565b611e5284611e2c81623cda2961288e565b611e398a623cda2061288e565b611e43919061287b565b611e4d919061288e565b61210c565b611e5c91906127be565b90506107ca611e6b81836128ad565b9550611e7886858561202d565b945050505050935093915050565b6040516001600160a01b038316602482015260448101829052611eb690849063a9059cbb60e01b90606401611734565b505050565b6000808411611f1a5760405162461bcd60e51b815260206004820152602560248201527f556e697377617056324c6962726172793a20494e53554646494349454e545f416044820152641353d5539560da1b606482015260840161031c565b600083118015611f2a5750600082115b611f465760405162461bcd60e51b815260040161031c906128cf565b82611f51838661288e565b6111ad91906128ad565b6000611fb0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661228d9092919063ffffffff16565b805190915015611eb65780806020019051810190611fce91906127d7565b611eb65760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161031c565b60008084116120925760405162461bcd60e51b815260206004820152602b60248201527f556e697377617056324c6962726172793a20494e53554646494349454e545f4960448201526a1394155517d05353d5539560aa1b606482015260840161031c565b6000831180156120a25750600082115b6120be5760405162461bcd60e51b815260040161031c906128cf565b60006120cc856103e561288e565b905060006120da848361288e565b90506000826120eb876103e861288e565b6120f5919061287b565b905061210181836128ad565b979650505050505050565b60008160000361211e57506000919050565b816001600160801b82106121375760809190911c9060401b5b6801000000000000000082106121525760409190911c9060201b5b64010000000082106121695760209190911c9060101b5b62010000821061217e5760109190911c9060081b5b61010082106121925760089190911c9060041b5b601082106121a55760049190911c9060021b5b600882106121b15760011b5b60016121bd82866128ad565b6121c7908361287b565b901c905060016121d782866128ad565b6121e1908361287b565b901c905060016121f182866128ad565b6121fb908361287b565b901c9050600161220b82866128ad565b612215908361287b565b901c9050600161222582866128ad565b61222f908361287b565b901c9050600161223f82866128ad565b612249908361287b565b901c9050600161225982866128ad565b612263908361287b565b901c9050600061227382866128ad565b90508082106122825780612284565b815b95945050505050565b60606111ad8484600085856001600160a01b0385163b6122ef5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161031c565b600080866001600160a01b0316858760405161230b919061293b565b60006040518083038185875af1925050503d8060008114612348576040519150601f19603f3d011682016040523d82523d6000602084013e61234d565b606091505b5091509150612101828286606083156123675750816111b0565b8251156123775782518084602001fd5b8160405162461bcd60e51b815260040161031c9190612957565b600060e082840312156123a357600080fd5b50919050565b60008061010083850312156123bd57600080fd5b6123c78484612391565b9460e0939093013593505050565b600060a082840312156123a357600080fd5b600080600060e084860312156123fc57600080fd5b61240685856123d5565b9560a0850135955060c0909401359392505050565b6000604082840312156123a357600080fd5b6000806000610120848603121561244357600080fd5b61244d8585612391565b925060e084013567ffffffffffffffff81111561246957600080fd5b6124758682870161241b565b92505061010084013590509250925092565b6001600160a01b038116811461113457600080fd5b60008060008061010085870312156124b357600080fd5b6124bd86866123d5565b935060a08501356124cd81612487565b939693955050505060c08201359160e0013590565b6000602082840312156124f457600080fd5b81356111b081612487565b602080825260149082015273105c9ad95b949bdd5d195c8e881156141254915160621b604082015260600190565b60006020828403121561253f57600080fd5b5051919050565b60208082526022908201527f41726b656e526f757465723a20494e53554646494349454e545f415f414d4f55604082015261139560f21b606082015260800190565b60208082526022908201527f41726b656e526f757465723a20494e53554646494349454e545f425f414d4f55604082015261139560f21b606082015260800190565b600080604083850312156125dd57600080fd5b505080516020909101519092909150565b6000808335601e1984360301811261260557600080fd5b83018035915067ffffffffffffffff82111561262057600080fd5b602001915036819003821315611d0b57600080fd5b6001600160a01b038681168252851660208201526040810184905260806060820181905281018290526000828460a0840137600060a0848401015260a0601f19601f85011683010190509695505050505050565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156126b257600080fd5b825167ffffffffffffffff808211156126ca57600080fd5b818501915085601f8301126126de57600080fd5b8151818111156126f0576126f0612689565b8060051b604051601f19603f8301168101818110858211171561271557612715612689565b60405291825284820192508381018501918883111561273357600080fd5b938501935b8285101561275157845184529385019392850192612738565b98975050505050505050565b60006020828403121561276f57600080fd5b81516111b081612487565b92835260208301919091526001600160a01b0316604082015260806060820181905260009082015260a00190565b634e487b7160e01b600052601160045260246000fd5b818103818111156127d1576127d16127a8565b92915050565b6000602082840312156127e957600080fd5b815180151581146111b057600080fd5b80516001600160701b038116811461281057600080fd5b919050565b60008060006060848603121561282a57600080fd5b612833846127f9565b9250612841602085016127f9565b9150604084015163ffffffff8116811461285a57600080fd5b809150509250925092565b634e487b7160e01b600052600160045260246000fd5b808201808211156127d1576127d16127a8565b60008160001904831182151516156128a8576128a86127a8565b500290565b6000826128ca57634e487b7160e01b600052601260045260246000fd5b500490565b60208082526028908201527f556e697377617056324c6962726172793a20494e53554646494349454e545f4c604082015267495155494449545960c01b606082015260800190565b60005b8381101561293257818101518382015260200161291a565b50506000910152565b6000825161294d818460208701612917565b9190910192915050565b6020815260008251806020840152612976816040850160208701612917565b601f01601f1916919091016040019291505056fea2646970667358221220c2e5a3e4627c7afaacfdc7896e6adba6cc0d61c41f844efd997183ad5034e00264736f6c63430008100033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab100000000000000000000000000000000000000000000000000000000000000000000000000000000000000006f61689dcafde0d96dbc23a749b18bbc40903a78000000000000000000000000278e453e50b8ef8d2dd41765c5aec28eff953342
-----Decoded View---------------
Arg [0] : weth_ (address): 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1
Arg [1] : factory_ (address): 0x0000000000000000000000000000000000000000
Arg [2] : factoryLongTerm_ (address): 0x6f61689DCafDE0d96DBC23a749b18BBc40903A78
Arg [3] : rewarder_ (address): 0x278e453e50B8EF8D2Dd41765C5AEc28Eff953342
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 0000000000000000000000006f61689dcafde0d96dbc23a749b18bbc40903a78
Arg [3] : 000000000000000000000000278e453e50b8ef8d2dd41765c5aec28eff953342
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.