More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 2,118 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Swap Exact Token... | 17321228 | 606 days ago | IN | 0 ETH | 0.00868423 | ||||
Swap Exact Token... | 17320953 | 606 days ago | IN | 0 ETH | 0.00956995 | ||||
Swap Exact Token... | 17320945 | 606 days ago | IN | 0 ETH | 0.00988632 | ||||
Swap Exact Token... | 17320936 | 606 days ago | IN | 0 ETH | 0.00784761 | ||||
Add Liquidity ET... | 16728845 | 690 days ago | IN | 0.02936166 ETH | 0.00508594 | ||||
Remove Liquidity... | 16575527 | 711 days ago | IN | 0 ETH | 0.00443498 | ||||
Swap Exact ETH F... | 16523946 | 719 days ago | IN | 0.02 ETH | 0.00337234 | ||||
Swap Exact ETH F... | 16519041 | 719 days ago | IN | 0.004 ETH | 0.00341774 | ||||
Remove Liquidity... | 16451375 | 729 days ago | IN | 0 ETH | 0.00380914 | ||||
Remove Liquidity... | 16451370 | 729 days ago | IN | 0 ETH | 0.00350269 | ||||
Remove Liquidity... | 16447368 | 729 days ago | IN | 0 ETH | 0.00290533 | ||||
Remove Liquidity... | 16336095 | 745 days ago | IN | 0 ETH | 0.00363481 | ||||
Remove Liquidity... | 16336075 | 745 days ago | IN | 0 ETH | 0.00049487 | ||||
Add Liquidity ET... | 16335519 | 745 days ago | IN | 0.01813003 ETH | 0.00322095 | ||||
Remove Liquidity... | 16335512 | 745 days ago | IN | 0 ETH | 0.00533543 | ||||
Remove Liquidity... | 16335510 | 745 days ago | IN | 0 ETH | 0.00424207 | ||||
Remove Liquidity... | 16283011 | 752 days ago | IN | 0 ETH | 0.00290146 | ||||
Remove Liquidity... | 16188484 | 765 days ago | IN | 0 ETH | 0.00354903 | ||||
Swap Exact Token... | 16076250 | 781 days ago | IN | 0 ETH | 0.00508587 | ||||
Remove Liquidity... | 16076244 | 781 days ago | IN | 0 ETH | 0.00291662 | ||||
Add Liquidity ET... | 15872131 | 810 days ago | IN | 0.0039733 ETH | 0.00138029 | ||||
Swap Exact ETH F... | 15854033 | 812 days ago | IN | 0.03 ETH | 0.00277254 | ||||
Swap Exact ETH F... | 15853989 | 812 days ago | IN | 0.0125 ETH | 0.00274319 | ||||
Swap Exact Token... | 15853313 | 812 days ago | IN | 0 ETH | 0.00489207 | ||||
Remove Liquidity... | 15853190 | 812 days ago | IN | 0 ETH | 0.00163331 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
20981370 | 94 days ago | 0.02064984 ETH | ||||
20981370 | 94 days ago | 0.02064984 ETH | ||||
18145411 | 491 days ago | 0.02226514 ETH | ||||
18145411 | 491 days ago | 0.02226514 ETH | ||||
17613687 | 565 days ago | 0.06557196 ETH | ||||
17613687 | 565 days ago | 0.06557196 ETH | ||||
17321228 | 606 days ago | 0.16192567 ETH | ||||
17321228 | 606 days ago | 0.16192567 ETH | ||||
17320953 | 606 days ago | 0.0288357 ETH | ||||
17320953 | 606 days ago | 0.0288357 ETH | ||||
17320945 | 606 days ago | 0.03364157 ETH | ||||
17320945 | 606 days ago | 0.03364157 ETH | ||||
17320936 | 606 days ago | 0.03931018 ETH | ||||
17320936 | 606 days ago | 0.03931018 ETH | ||||
16728845 | 690 days ago | 0.02936166 ETH | ||||
16575527 | 711 days ago | 0.02088213 ETH | ||||
16575527 | 711 days ago | 0.02088213 ETH | ||||
16523946 | 719 days ago | 0.02 ETH | ||||
16519041 | 719 days ago | 0.004 ETH | ||||
16451375 | 729 days ago | 0.00107984 ETH | ||||
16451375 | 729 days ago | 0.00107984 ETH | ||||
16447368 | 729 days ago | 0.01732392 ETH | ||||
16447368 | 729 days ago | 0.01732392 ETH | ||||
16336095 | 745 days ago | 0.01941657 ETH | ||||
16336095 | 745 days ago | 0.01941657 ETH |
Loading...
Loading
Contract Name:
HelixRouterV1
Compiler Version
v0.8.10+commit.fc410830
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import "./HelixPair.sol"; import "../libraries/HelixLibrary.sol"; import "../interfaces/IHelixV2Router02.sol"; import "../interfaces/ISwapRewards.sol"; import "@uniswap/lib/contracts/libraries/TransferHelper.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@uniswap/v2-periphery/contracts/interfaces/IWETH.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; contract HelixRouterV1 is IHelixV2Router02, Pausable, Ownable { address public immutable _factory; address public immutable _WETH; address public swapRewards; // Emitted when liquidity is added event AddLiquidity( address indexed tokenA, address indexed tokenB, uint256 amountAReturned, uint256 amountBReturned, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin ); // Emitted when liquidity is removed event RemoveLiquidity( address indexed tokenA, address indexed tokenB, address indexed pair, address to, uint256 amountARemoved, uint256 amountBRemoved ); // Emitted when tokens are swapped event Swap( uint256[] indexed amounts, address[] indexed path, address indexed to ); // Emitted when tokens supporting fees are swapped event SwapSupportingFeeOnTransferTokens(address[] indexed path, address indexed to); modifier onlyValidDeadline(uint256 deadline) { require(deadline >= block.timestamp, "Router: invalid deadline"); _; } constructor(address factory_, address WETH_) Ownable() { _factory = factory_; _WETH = WETH_; } receive() external payable { require(msg.sender == _WETH, "Router: caller not weth"); } function factory() external view override returns (address) { return _factory; } function WETH() external view returns (address) { return _WETH; } function setSwapRewards(address _swapRewards) external onlyOwner { swapRewards = _swapRewards; } // **** ADD LIQUIDITY **** function _addLiquidity( address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin ) internal virtual whenNotPaused returns (uint256 amountA, uint256 amountB) { // create the pair if it doesn't exist yet if (IUniswapV2Factory(_factory).getPair(tokenA, tokenB) == address(0)) { IUniswapV2Factory(_factory).createPair(tokenA, tokenB); } (uint256 reserveA, uint256 reserveB) = HelixLibrary.getReserves(_factory, tokenA, tokenB); if (reserveA == 0 && reserveB == 0) { (amountA, amountB) = (amountADesired, amountBDesired); } else { uint256 amountBOptimal = HelixLibrary.quote(amountADesired, reserveA, reserveB); if (amountBOptimal <= amountBDesired) { _requireGEQ(amountBOptimal, amountBMin); (amountA, amountB) = (amountADesired, amountBOptimal); } else { uint256 amountAOptimal = HelixLibrary.quote(amountBDesired, reserveB, reserveA); assert(amountAOptimal <= amountADesired); _requireGEQ(amountAOptimal, amountAMin); (amountA, amountB) = (amountAOptimal, amountBDesired); } } emit AddLiquidity( tokenA, tokenB, amountA, amountB, amountADesired, amountBDesired, amountAMin, amountBMin ); } function addLiquidity( address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external virtual override onlyValidDeadline(deadline) returns (uint256 amountA, uint256 amountB, uint256 liquidity) { (amountA, amountB) = _addLiquidity( tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin ); address pair = HelixLibrary.pairFor(_factory, tokenA, tokenB); TransferHelper.safeTransferFrom(tokenA, msg.sender, pair, amountA); TransferHelper.safeTransferFrom(tokenB, msg.sender, pair, amountB); liquidity = HelixPair(pair).mint(to); } function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external virtual override payable onlyValidDeadline(deadline) returns (uint256 amountToken, uint256 amountETH, uint256 liquidity) { (amountToken, amountETH) = _addLiquidity( token, _WETH, amountTokenDesired, msg.value, amountTokenMin, amountETHMin ); address pair = HelixLibrary.pairFor(_factory, token, _WETH); TransferHelper.safeTransferFrom(token, msg.sender, pair, amountToken); IWETH(_WETH).deposit{value: amountETH}(); assert(IWETH(_WETH).transfer(pair, amountETH)); liquidity = HelixPair(pair).mint(to); // refund dust eth, if any if (msg.value > amountETH) { TransferHelper.safeTransferETH(msg.sender, msg.value - amountETH); } } // **** REMOVE LIQUIDITY **** function removeLiquidity( address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) public virtual override whenNotPaused onlyValidDeadline(deadline) returns (uint256 amountA, uint256 amountB) { address pair = HelixLibrary.pairFor(_factory, tokenA, tokenB); HelixPair(pair).transferFrom(msg.sender, pair, liquidity); (uint256 amount0, uint256 amount1) = HelixPair(pair).burn(to); (address token0,) = HelixLibrary.sortTokens(tokenA, tokenB); (amountA, amountB) = tokenA == token0 ? (amount0, amount1) : (amount1, amount0); _requireGEQ(amountA, amountAMin); _requireGEQ(amountB, amountBMin); emit RemoveLiquidity( tokenA, tokenB, pair, to, amountA, amountB ); } function removeLiquidityETH( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) public virtual override onlyValidDeadline(deadline) returns (uint256 amountToken, uint256 amountETH) { (amountToken, amountETH) = removeLiquidity( token, _WETH, liquidity, amountTokenMin, amountETHMin, address(this), deadline ); TransferHelper.safeTransfer(token, to, amountToken); IWETH(_WETH).withdraw(amountETH); TransferHelper.safeTransferETH(to, amountETH); } function removeLiquidityWithPermit( address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external virtual override returns (uint256 amountA, uint256 amountB) { address pair = HelixLibrary.pairFor(_factory, tokenA, tokenB); uint256 value = approveMax ? type(uint).max : liquidity; HelixPair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); (amountA, amountB) = removeLiquidity( tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline ); } function removeLiquidityETHWithPermit( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external virtual override returns (uint256 amountToken, uint256 amountETH) { address pair = HelixLibrary.pairFor(_factory, token, _WETH); uint256 value = approveMax ? type(uint).max : liquidity; HelixPair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); (amountToken, amountETH) = removeLiquidityETH( token, liquidity, amountTokenMin, amountETHMin, to, deadline ); } // **** REMOVE LIQUIDITY (supporting fee-on-transfer tokens) **** function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) public virtual override onlyValidDeadline(deadline) returns (uint256 amountETH) { (, amountETH) = removeLiquidity( token, _WETH, liquidity, amountTokenMin, amountETHMin, address(this), deadline ); TransferHelper.safeTransfer(token, to, IERC20(token).balanceOf(address(this))); IWETH(_WETH).withdraw(amountETH); TransferHelper.safeTransferETH(to, amountETH); } function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external virtual override returns (uint256 amountETH) { address pair = HelixLibrary.pairFor(_factory, token, _WETH); uint256 value = approveMax ? type(uint).max : liquidity; HelixPair(pair).permit(msg.sender, address(this), value, deadline, v, r, s); amountETH = removeLiquidityETHSupportingFeeOnTransferTokens( token, liquidity, amountTokenMin, amountETHMin, to, deadline ); } // **** SWAP **** // requires the initial amount to have already been sent to the first pair function _swap(uint256[] memory amounts, address[] memory path, address _to) internal virtual whenNotPaused { uint256 length = path.length - 1; for (uint256 i; i < length; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0,) = HelixLibrary.sortTokens(input, output); uint256 amountOut = amounts[i + 1]; (uint256 amount0Out, uint256 amount1Out) = input == token0 ? (uint(0), amountOut) : (amountOut, uint(0)); address to = i < path.length - 2 ? HelixLibrary.pairFor(_factory, output, path[i + 2]) : _to; HelixPair(HelixLibrary.pairFor(_factory, input, output)).swap( amount0Out, amount1Out, to ); if (swapRewards != address(0)) { ISwapRewards(swapRewards).swap(msg.sender, output, amountOut); } } emit Swap(amounts, path, _to); } function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external virtual override onlyValidDeadline(deadline) returns (uint256[] memory amounts) { amounts = HelixLibrary.getAmountsOut(_factory, amountIn, path); _requireGEQ(amounts[amounts.length - 1], amountOutMin); TransferHelper.safeTransferFrom( path[0], msg.sender, HelixLibrary.pairFor(_factory, path[0], path[1]), amounts[0] ); _swap(amounts, path, to); } function swapTokensForExactTokens( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline ) external virtual override onlyValidDeadline(deadline) returns (uint256[] memory amounts) { amounts = HelixLibrary.getAmountsIn(_factory, amountOut, path); _requireLEQ(amounts[0], amountInMax); TransferHelper.safeTransferFrom( path[0], msg.sender, HelixLibrary.pairFor(_factory, path[0], path[1]), amounts[0] ); _swap(amounts, path, to); } function swapExactETHForTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external virtual override payable onlyValidDeadline(deadline) returns (uint256[] memory amounts) { _requireValidPath(path[0]); amounts = HelixLibrary.getAmountsOut(_factory, msg.value, path); _requireGEQ(amounts[amounts.length - 1], amountOutMin); IWETH(_WETH).deposit{value: amounts[0]}(); assert(IWETH(_WETH).transfer(HelixLibrary.pairFor(_factory, path[0], path[1]), amounts[0])); _swap(amounts, path, to); } function swapTokensForExactETH( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline ) external virtual override onlyValidDeadline(deadline) returns (uint256[] memory amounts) { _requireValidPath(path[path.length - 1]); amounts = HelixLibrary.getAmountsIn(_factory, amountOut, path); _requireLEQ(amounts[0], amountInMax); TransferHelper.safeTransferFrom( path[0], msg.sender, HelixLibrary.pairFor(_factory, path[0], path[1]), amounts[0] ); _swap(amounts, path, address(this)); IWETH(_WETH).withdraw(amounts[amounts.length - 1]); TransferHelper.safeTransferETH(to, amounts[amounts.length - 1]); } function swapExactTokensForETH( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external virtual override onlyValidDeadline(deadline) returns (uint256[] memory amounts) { _requireValidPath(path[path.length - 1]); amounts = HelixLibrary.getAmountsOut(_factory, amountIn, path); _requireGEQ(amounts[amounts.length - 1], amountOutMin); TransferHelper.safeTransferFrom( path[0], msg.sender, HelixLibrary.pairFor(_factory, path[0], path[1]), amounts[0] ); _swap(amounts, path, address(this)); IWETH(_WETH).withdraw(amounts[amounts.length - 1]); TransferHelper.safeTransferETH(to, amounts[amounts.length - 1]); } function swapETHForExactTokens( uint256 amountOut, address[] calldata path, address to, uint256 deadline ) external virtual override payable onlyValidDeadline(deadline) returns (uint256[] memory amounts) { _requireValidPath(path[0]); amounts = HelixLibrary.getAmountsIn(_factory, amountOut, path); _requireLEQ(amounts[0], msg.value); IWETH(_WETH).deposit{value: amounts[0]}(); assert( IWETH(_WETH).transfer(HelixLibrary.pairFor(_factory, path[0], path[1]), amounts[0]) ); _swap(amounts, path, to); // refund dust eth, if any if (msg.value > amounts[0]) { TransferHelper.safeTransferETH(msg.sender, msg.value - amounts[0]); } } // **** SWAP (supporting fee-on-transfer tokens) **** // requires the initial amount to have already been sent to the first pair function _swapSupportingFeeOnTransferTokens( address[] memory path, address _to ) internal virtual whenNotPaused { uint256 length = path.length - 1; for (uint256 i; i < length; i++) { (address input, address output) = (path[i], path[i + 1]); (address token0,) = HelixLibrary.sortTokens(input, output); HelixPair pair = HelixPair(HelixLibrary.pairFor(_factory, input, output)); uint256 amountInput; uint256 amountOutput; { // scope to avoid stack too deep errors (uint256 reserve0, uint256 reserve1,) = pair.getReserves(); (uint256 reserveInput, uint256 reserveOutput) = input == token0 ? (reserve0, reserve1) : (reserve1, reserve0); amountInput = IERC20(input).balanceOf(address(pair)) - reserveInput; amountOutput = HelixLibrary.getAmountOut( amountInput, reserveInput, reserveOutput, pair.swapFee() ); } (uint256 amount0Out, uint256 amount1Out) = input == token0 ? (uint(0), amountOutput) : (amountOutput, uint(0)); address to = i < path.length - 2 ? HelixLibrary.pairFor(_factory, output, path[i + 2]) : _to; pair.swap(amount0Out, amount1Out, to); if (swapRewards != address(0)) { ISwapRewards(swapRewards).swap(msg.sender, output, amountOutput); } } emit SwapSupportingFeeOnTransferTokens(path, _to); } function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external virtual override onlyValidDeadline(deadline) { TransferHelper.safeTransferFrom( path[0], msg.sender, HelixLibrary.pairFor(_factory, path[0], path[1]), amountIn ); uint256 balanceBefore = IERC20(path[path.length - 1]).balanceOf(to); _swapSupportingFeeOnTransferTokens(path, to); _requireGEQ(IERC20(path[path.length - 1]).balanceOf(to) - balanceBefore, amountOutMin); } function swapExactETHForTokensSupportingFeeOnTransferTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external virtual override payable onlyValidDeadline(deadline) { _requireValidPath(path[0]); uint256 amountIn = msg.value; IWETH(_WETH).deposit{value: amountIn}(); assert( IWETH(_WETH).transfer(HelixLibrary.pairFor(_factory, path[0], path[1]), amountIn) ); uint256 balanceBefore = IERC20(path[path.length - 1]).balanceOf(to); _swapSupportingFeeOnTransferTokens(path, to); _requireGEQ(IERC20(path[path.length - 1]).balanceOf(to) - balanceBefore, amountOutMin); } function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external virtual override onlyValidDeadline(deadline) { _requireValidPath(path[path.length - 1]); TransferHelper.safeTransferFrom( path[0], msg.sender, HelixLibrary.pairFor(_factory, path[0], path[1]), amountIn ); _swapSupportingFeeOnTransferTokens(path, address(this)); uint256 amountOut = IERC20(_WETH).balanceOf(address(this)); _requireGEQ(amountOut, amountOutMin); IWETH(_WETH).withdraw(amountOut); TransferHelper.safeTransferETH(to, amountOut); } // **** LIBRARY FUNCTIONS **** function quote( uint256 amountA, uint256 reserveA, uint256 reserveB ) public pure virtual override returns (uint256 amountB) { return HelixLibrary.quote(amountA, reserveA, reserveB); } function getAmountOut( uint256 amountIn, uint256 reserveIn, uint256 reserveOut, uint256 swapFee ) public pure virtual returns (uint256 amountOut) { return HelixLibrary.getAmountOut(amountIn, reserveIn, reserveOut, swapFee); } function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) external pure virtual override returns (uint256 amountOut) { return HelixLibrary.getAmountOut(amountIn, reserveIn, reserveOut, 0); } function getAmountIn( uint256 amountOut, uint256 reserveIn, uint256 reserveOut, uint256 swapFee ) public pure virtual returns (uint256 amountIn) { return HelixLibrary.getAmountIn(amountOut, reserveIn, reserveOut, swapFee); } function getAmountIn(uint256 amountOut, uint256 reserveIn, uint256 reserveOut) public pure virtual override returns (uint256 amountIn) { return HelixLibrary.getAmountIn(amountOut, reserveIn, reserveOut, /*swapFee=*/0); } function getAmountsOut(uint256 amountIn, address[] memory path) public view virtual override returns (uint256[] memory amounts) { return HelixLibrary.getAmountsOut(_factory, amountIn, path); } function getAmountsIn(uint256 amountOut, address[] memory path) external view virtual override returns (uint256[] memory amounts) { return HelixLibrary.getAmountsIn(_factory, amountOut, path); } /// Called by the owner to pause the contract function pause() external onlyOwner { _pause(); } /// Called by the owner to unpause the contract function unpause() external onlyOwner { _unpause(); } // require amount to be greater than or equal to min function _requireGEQ(uint256 amount, uint256 min) private pure { require(amount >= min, "Router: insufficient amount"); } function _requireLEQ(uint256 amount, uint256 max) private pure { require(amount <= max, "Router: excessive amount"); } function _requireValidPath(address path) private view { require(path == _WETH, "Router: invalid path"); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import "../tokens/HelixLP.sol"; import "../libraries/UQ112x112.sol"; import "../libraries/ExtraMath.sol"; import "./HelixFactory.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; import "@uniswap/lib/contracts/libraries/TransferHelper.sol"; contract HelixPair is Initializable, HelixLP, ReentrancyGuardUpgradeable { using UQ112x112 for uint224; uint256 public constant MINIMUM_LIQUIDITY = 10**3; address public factory; address public token0; address public token1; uint112 private reserve0; // uses single storage slot, accessible via getReserves uint112 private reserve1; // uses single storage slot, accessible via getReserves uint32 private blockTimestampLast; // uses single storage slot, accessible via getReserves uint256 public price0CumulativeLast; uint256 public price1CumulativeLast; uint256 public kLast; // reserve0 * reserve1, as of immediately after the most recent liquidity event uint32 public swapFee; // uses 0.1% default uint32 public devFee; // uses 0.5% default from swap fee event Mint( address indexed sender, address indexed to, uint256 amount0, uint256 amount1 ); event Burn( address indexed sender, address indexed to, uint256 amount0, uint256 amount1 ); event Swap( address indexed sender, address indexed to, uint256 amount0In, uint256 amount1In, uint256 amount0Out, uint256 amount1Out ); event Update(uint112 reserve0, uint112 reserve1); modifier onlyFactory() { require(msg.sender == factory, "Pair: not factory"); _; } modifier onlyAboveZero(uint256 number) { require(number > 0, "Pair: not above zero"); _; } function initialize(address _token0, address _token1, uint32 _swapFee) external initializer { __ReentrancyGuard_init(); factory = msg.sender; token0 = _token0; token1 = _token1; swapFee = _swapFee; // uses 0.1% default devFee = 0; // Do not send fees to factory.feeTo } function getReserves() public view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast) { _reserve0 = reserve0; _reserve1 = reserve1; _blockTimestampLast = blockTimestampLast; } function setSwapFee(uint32 _swapFee) external onlyFactory onlyAboveZero(_swapFee) { require(_swapFee <= 1000, "Pair: invalid fee"); swapFee = _swapFee; } function setDevFee(uint32 _devFee) external onlyFactory onlyAboveZero(_devFee) { require(_devFee <= 500, "Pair: invalid fee"); devFee = _devFee; } // update reserves and, on the first call per block, price accumulators function _update(uint256 balance0, uint256 balance1, uint112 _reserve0, uint112 _reserve1) private { require(balance0 <= type(uint112).max && balance1 <= type(uint112).max, "Pair: overflow"); uint32 blockTimestamp = uint32(block.timestamp % 2**32); uint32 timeElapsed = blockTimestamp - blockTimestampLast; // overflow is desired if (timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0) { // * never overflows, and + overflow is desired price0CumulativeLast += uint(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed; price1CumulativeLast += uint(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed; } reserve0 = uint112(balance0); reserve1 = uint112(balance1); blockTimestampLast = blockTimestamp; emit Update(reserve0, reserve1); } // if fee is on, mint liquidity equivalent to 1/6th of the growth in sqrt(k) function _mintFee(uint112 _reserve0, uint112 _reserve1) private returns (bool feeOn) { address feeTo = IUniswapV2Factory(factory).feeTo(); feeOn = feeTo != address(0); uint256 _kLast = kLast; // gas savings if (feeOn) { if (_kLast != 0) { uint256 rootK = ExtraMath.sqrt(uint(_reserve0) * _reserve1); uint256 rootKLast = ExtraMath.sqrt(_kLast); if (rootK > rootKLast) { uint256 numerator = totalSupply * (rootK - rootKLast); uint256 denominator = rootK * devFee + rootKLast; uint256 liquidity = numerator / denominator; if (liquidity > 0) _mint(feeTo, liquidity); } } } else if (_kLast != 0) { kLast = 0; } } // this low-level function should be called from a contract which performs important safety checks function mint(address to) external nonReentrant returns (uint256 liquidity) { (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings uint256 balance0 = IERC20(token0).balanceOf(address(this)); uint256 balance1 = IERC20(token1).balanceOf(address(this)); uint256 amount0 = balance0 - _reserve0; uint256 amount1 = balance1 - _reserve1; bool feeOn = _mintFee(_reserve0, _reserve1); uint256 _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee if (_totalSupply == 0) { liquidity = ExtraMath.sqrt(amount0 * amount1) - MINIMUM_LIQUIDITY; _mint(address(0), MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens } else { liquidity = MathUpgradeable.min(amount0 * _totalSupply / _reserve0, amount1 * _totalSupply / _reserve1); } require(liquidity > 0, "Pair: insufficient minted"); _mint(to, liquidity); _update(balance0, balance1, _reserve0, _reserve1); if (feeOn) kLast = uint(reserve0) * reserve1; // reserve0 and reserve1 are up-to-date emit Mint(msg.sender, to, amount0, amount1); } // this low-level function should be called from a contract which performs important safety checks function burn(address to) external nonReentrant returns (uint256 amount0, uint256 amount1) { (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings address _token0 = token0; // gas savings address _token1 = token1; // gas savings uint256 balance0 = IERC20(_token0).balanceOf(address(this)); uint256 balance1 = IERC20(_token1).balanceOf(address(this)); uint256 liquidity = balanceOf[address(this)]; bool feeOn = _mintFee(_reserve0, _reserve1); uint256 _totalSupply = totalSupply; // gas savings, must be defined here since totalSupply can update in _mintFee amount0 = liquidity * balance0 / _totalSupply; // using balances ensures pro-rata distribution amount1 = liquidity * balance1 / _totalSupply; // using balances ensures pro-rata distribution require(amount0 > 0 && amount1 > 0, "Pair: insufficient burned"); // Set the expected balance by subtracting amountX before _burn and safeTransfer calls // to perform all state changes before external calls and protect against reentrancy balance0 = IERC20(_token0).balanceOf(address(this)) - amount0; balance1 = IERC20(_token1).balanceOf(address(this)) - amount1; _update(balance0, balance1, _reserve0, _reserve1); if (feeOn) kLast = uint(reserve0) * reserve1; // reserve0 and reserve1 are up-to-date _burn(address(this), liquidity); TransferHelper.safeTransfer(_token0, to, amount0); TransferHelper.safeTransfer(_token1, to, amount1); emit Burn(msg.sender, to, amount0, amount1); } // this low-level function should be called from a contract which performs important safety checks function swap(uint256 amount0Out, uint256 amount1Out, address to) external nonReentrant { require(amount0Out > 0 || amount1Out > 0, "Pair: insufficient amount out"); (uint112 _reserve0, uint112 _reserve1,) = getReserves(); // gas savings require(amount0Out < _reserve0 && amount1Out < _reserve1, "Pair: insufficient liquidity"); uint256 balance0; uint256 balance1; { // scope for _token{0,1}, avoids stack too deep errors address _token0 = token0; address _token1 = token1; require(to != _token0 && to != _token1, "Pair: invalid to"); if (amount0Out > 0) TransferHelper.safeTransfer(_token0, to, amount0Out); if (amount1Out > 0) TransferHelper.safeTransfer(_token1, to, amount1Out); balance0 = IERC20(_token0).balanceOf(address(this)); balance1 = IERC20(_token1).balanceOf(address(this)); } uint256 amount0In = balance0 > _reserve0 - amount0Out ? balance0 - (_reserve0 - amount0Out) : 0; uint256 amount1In = balance1 > _reserve1 - amount1Out ? balance1 - (_reserve1 - amount1Out) : 0; require(amount0In > 0 || amount1In > 0, "Pair: insufficient amount in"); { // scope for reserve{0,1}Adjusted, avoids stack too deep errors uint256 _swapFee = swapFee; uint256 balance0Adjusted = balance0 * (1000) - (amount0In * _swapFee); uint256 balance1Adjusted = balance1 * (1000) - (amount1In * _swapFee); require( balance0Adjusted * balance1Adjusted >= uint(_reserve0) * (_reserve1) * (1000**2), "Pair: insufficient reserves" ); } _update(balance0, balance1, _reserve0, _reserve1); HelixFactory(factory).updateOracle(token0, token1); emit Swap(msg.sender, to, amount0In, amount1In, amount0Out, amount1Out); } // force balances to match reserves function skim(address to) external nonReentrant { address _token0 = token0; // gas savings address _token1 = token1; // gas savings TransferHelper.safeTransfer(_token0, to, IERC20(_token0).balanceOf(address(this)) - reserve0); TransferHelper.safeTransfer(_token1, to, IERC20(_token1).balanceOf(address(this)) - reserve1); } // force reserves to match balances function sync() external nonReentrant { _update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this)), reserve0, reserve1); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import "../swaps/HelixPair.sol"; library HelixLibrary { modifier notZeroAmount(uint256 amount) { require(amount > 0, "HelixLibrary: zero amount"); _; } modifier notZeroLiquidity(uint256 liquidity) { require(liquidity > 0, "HelixLibrary: zero liquidity"); _; } modifier isValidPath(address[] memory path) { require(path.length >= 2, "HelixLibrary: invalid path"); _; } // 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, "HelixLibrary: identical addresses"); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), "HelixLibrary: zero address"); } // calculates the CREATE2 address for a pair without making any external calls function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint160(uint256(keccak256(abi.encodePacked( hex"ff", factory, keccak256(abi.encodePacked(token0, token1)), // hex"c982a01a3d96a6bfb7f46c8cdfa12bbe67c0deeaac07310f3cc6327e92f7fbce" // ropsten // hex"368552104b0dcaacb939b1fe4370f68e358d806ee5d5c9a95193874dd004841a" // rinkeby hex"df06dacc3c0f420f3e881baed6af2087e5ab8bc910d926f439c1081ec11fc885" // mainnet ))))); } function getSwapFee(address factory, address tokenA, address tokenB) internal view returns (uint256 swapFee) { swapFee = HelixPair(pairFor(factory, tokenA, tokenB)).swapFee(); } // 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,) = HelixPair(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 notZeroAmount(amountA) notZeroLiquidity(reserveA) notZeroLiquidity(reserveB) returns (uint256 amountB) { 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, uint256 swapFee) internal pure notZeroAmount(amountIn) notZeroLiquidity(reserveIn) notZeroLiquidity(reserveOut) returns (uint256 amountOut) { uint256 amountInWithFee = amountIn * (uint(1000) - swapFee); uint256 numerator = amountInWithFee * reserveOut; uint256 denominator = reserveIn * 1000 + amountInWithFee; 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, uint256 swapFee) internal pure notZeroAmount(amountOut) notZeroLiquidity(reserveIn) notZeroLiquidity(reserveOut) returns (uint256 amountIn) { uint256 numerator = reserveIn * amountOut * 1000; uint256 denominator = (reserveOut - amountOut) * (uint(1000) - swapFee); amountIn = (numerator / denominator) + 1; } // performs chained getAmountOut calculations on any number of pairs function getAmountsOut(address factory, uint256 amountIn, address[] memory path) internal view isValidPath(path) returns (uint[] memory amounts) { amounts = new uint[](path.length); amounts[0] = amountIn; uint256 length = path.length - 1; for (uint256 i; i < length; i++) { (uint256 reserveIn, uint256 reserveOut) = getReserves(factory, path[i], path[i + 1]); amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut, getSwapFee(factory, path[i], path[i + 1])); } } // performs chained getAmountIn calculations on any number of pairs function getAmountsIn(address factory, uint256 amountOut, address[] memory path) internal view isValidPath(path) returns (uint[] memory amounts) { amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; uint256 length = path.length - 1; for (uint256 i = length; i > 0; i--) { (uint256 reserveIn, uint256 reserveOut) = getReserves(factory, path[i - 1], path[i]); amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut, getSwapFee(factory, path[i - 1], path[i])); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import "./IHelixV2Router01.sol"; interface IHelixV2Router02 is IHelixV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external returns (uint256 amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; interface ISwapRewards { function swap(address user, address tokenIn, uint256 amountIn) external; }
pragma solidity >=0.6.0; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove(address token, address to, uint value) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED'); } function safeTransfer(address token, address to, uint value) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED'); } function safeTransferFrom(address token, address from, address to, uint value) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED'); } function safeTransferETH(address to, uint value) internal { (bool success,) = to.call{value:value}(new bytes(0)); require(success, 'TransferHelper: ETH_TRANSFER_FAILED'); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { 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.5.0; interface IWETH { function deposit() external payable; function transfer(address to, uint value) external returns (bool); function withdraw(uint) external; }
pragma solidity >=0.5.0; interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); 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(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import "@rari-capital/solmate/src/tokens/ERC20.sol"; contract HelixLP is ERC20 { constructor () ERC20(/*name=*/"Helix LPs", /*symbol=*/"HELIX-LP", /*decimals=*/18) {} }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; // NOTE: Taken from https://github.com/Uniswap/v2-core/blob/master/contracts/libraries/UQ112x112.sol // with only two changes: // * MIT License // * solidity version >= 0.8.0 // a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format)) // range: [0, 2**112 - 1] // resolution: 1 / 2**112 library UQ112x112 { uint224 constant Q112 = 2**112; // encode a uint112 as a UQ112x112 function encode(uint112 y) internal pure returns (uint224 z) { z = uint224(y) * Q112; // never overflows } // divide a UQ112x112 by a uint112, returning a UQ112x112 function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) { z = x / uint224(y); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; // Library when openzepplin Math is not enough library ExtraMath { function min(uint256 x, uint256 y) internal pure returns (uint256 z) { z = x < y ? x : y; } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) function sqrt(uint256 y) internal pure returns (uint256 z) { if (y > 3) { z = y; uint256 x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } } else if (y != 0) { z = 1; } } }
//SPDX-License-Identifier:MIT pragma solidity >=0.8.0; import "./HelixPair.sol"; import "../interfaces/IOracleFactory.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; contract HelixFactory is Initializable { address public feeTo; address public feeToSetter; address public oracleFactory; bytes32 public INIT_CODE_HASH; /// Default value used when creating a pair without a defined swapFee uint32 public defaultSwapFee; mapping(address => mapping(address => address)) public getPair; address[] public allPairs; // Emitted when a new pair is created event CreatePair(address indexed token0, address indexed token1, address pair, uint); // Emitted when the owner sets the "feeTo" event SetFeeTo(address indexed feeTo); // Emitted when the owner sets the "feeToSetter" event SetFeeToSetter(address indexed feeToSetter); // Emitted when a pair's dev fee is set event SetDevFee(address indexed pair, uint256 devFee); // Emitted when a pair's swap fee is set event SetSwapFee(address indexed pair, uint256 swapFee); // Emitted when the owner sets the Oracle Factory contract event SetOracleFactory(address oracleFactory); // Emitted when the defaultSwapFee is set event SetDefaultSwapFee(address indexed setter, uint32 defaultSwapFee); modifier onlyFeeToSetter() { require(msg.sender == feeToSetter, "Factory: not feeToSetter"); _; } function initialize() external initializer { INIT_CODE_HASH = keccak256(abi.encodePacked(type(HelixPair).creationCode)); feeToSetter = msg.sender; defaultSwapFee = 1; } function allPairsLength() external view returns (uint) { return allPairs.length; } function createPair(address tokenA, address tokenB) public returns (address pair) { require(tokenA != tokenB, "Factory: identical addresses"); (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), "Factory: zero address"); require(getPair[token0][token1] == address(0), "Factory: pair exists"); // single check is sufficient bytes memory bytecode = type(HelixPair).creationCode; bytes32 salt = keccak256(abi.encodePacked(token0, token1)); assembly { pair := create2(0, add(bytecode, 32), mload(bytecode), salt) } HelixPair(pair).initialize(token0, token1, defaultSwapFee); getPair[token0][token1] = pair; getPair[token1][token0] = pair; // populate mapping in the reverse direction allPairs.push(pair); IOracleFactory(oracleFactory).create(token0, token1); emit CreatePair(token0, token1, pair, allPairs.length); } function setFeeTo(address _feeTo) external onlyFeeToSetter { feeTo = _feeTo; emit SetFeeTo(_feeTo); } function setFeeToSetter(address _feeToSetter) external onlyFeeToSetter { feeToSetter = _feeToSetter; emit SetFeeToSetter(_feeToSetter); } function setDevFee(address _pair, uint8 _devFee) external onlyFeeToSetter { require(_devFee > 0, "Factory: invalid fee"); HelixPair(_pair).setDevFee(_devFee); emit SetDevFee(_pair, _devFee); } function setSwapFee(address _pair, uint32 _swapFee) external onlyFeeToSetter { HelixPair(_pair).setSwapFee(_swapFee); emit SetSwapFee(_pair, _swapFee); } function setOracleFactory(address _oracleFactory) external onlyFeeToSetter { oracleFactory = _oracleFactory; emit SetOracleFactory(_oracleFactory); } function updateOracle(address token0, address token1) external { IOracleFactory(oracleFactory).update(token0, token1); } function setDefaultSwapFee(uint32 _defaultSwapFee) external onlyFeeToSetter { defaultSwapFee = _defaultSwapFee; emit SetDefaultSwapFee(msg.sender, _defaultSwapFee); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`. */ modifier initializer() { bool isTopLevelCall = _setInitializedVersion(1); if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original * initialization step. This is essential to configure modules that are added through upgrades and that require * initialization. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. */ modifier reinitializer(uint8 version) { bool isTopLevelCall = _setInitializedVersion(version); if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(version); } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. */ function _disableInitializers() internal virtual { _setInitializedVersion(type(uint8).max); } function _setInitializedVersion(uint8 version) private returns (bool) { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, and for the lowest level // of initializers, because in other contexts the contract may have been reentered. if (_initializing) { require( version == 1 && !AddressUpgradeable.isContract(address(this)), "Initializable: contract is already initialized" ); return false; } else { require(_initialized < version, "Initializable: contract is already initialized"); _initialized = version; return true; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a / b + (a % b == 0 ? 0 : 1); } }
// 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: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Modern and gas efficient ERC20 + EIP-2612 implementation. /// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol) /// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol) /// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it. abstract contract ERC20 { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); /*////////////////////////////////////////////////////////////// METADATA STORAGE //////////////////////////////////////////////////////////////*/ string public name; string public symbol; uint8 public immutable decimals; /*////////////////////////////////////////////////////////////// ERC20 STORAGE //////////////////////////////////////////////////////////////*/ uint256 public totalSupply; mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowance; /*////////////////////////////////////////////////////////////// EIP-2612 STORAGE //////////////////////////////////////////////////////////////*/ uint256 internal immutable INITIAL_CHAIN_ID; bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR; mapping(address => uint256) public nonces; /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor( string memory _name, string memory _symbol, uint8 _decimals ) { name = _name; symbol = _symbol; decimals = _decimals; INITIAL_CHAIN_ID = block.chainid; INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator(); } /*////////////////////////////////////////////////////////////// ERC20 LOGIC //////////////////////////////////////////////////////////////*/ function approve(address spender, uint256 amount) public virtual returns (bool) { allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function transfer(address to, uint256 amount) public virtual returns (bool) { balanceOf[msg.sender] -= amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(msg.sender, to, amount); return true; } function transferFrom( address from, address to, uint256 amount ) public virtual returns (bool) { uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals. if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount; balanceOf[from] -= amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(from, to, amount); return true; } /*////////////////////////////////////////////////////////////// EIP-2612 LOGIC //////////////////////////////////////////////////////////////*/ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual { require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED"); // Unchecked because the only math done is incrementing // the owner's nonce which cannot realistically overflow. unchecked { address recoveredAddress = ecrecover( keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR(), keccak256( abi.encode( keccak256( "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)" ), owner, spender, value, nonces[owner]++, deadline ) ) ) ), v, r, s ); require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER"); allowance[recoveredAddress][spender] = value; } emit Approval(owner, spender, value); } function DOMAIN_SEPARATOR() public view virtual returns (bytes32) { return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator(); } function computeDomainSeparator() internal view virtual returns (bytes32) { return keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(name)), keccak256("1"), block.chainid, address(this) ) ); } /*////////////////////////////////////////////////////////////// INTERNAL MINT/BURN LOGIC //////////////////////////////////////////////////////////////*/ function _mint(address to, uint256 amount) internal virtual { totalSupply += amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(address(0), to, amount); } function _burn(address from, uint256 amount) internal virtual { balanceOf[from] -= amount; // Cannot underflow because a user's balance // will never be larger than the total supply. unchecked { totalSupply -= amount; } emit Transfer(from, address(0), amount); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; interface IOracleFactory { function create(address token0, address token1) external; function update(address token0, address token1) external; function consult(address tokenIn, uint256 amountIn, address tokenOut) external view returns (uint256 amountOut); function getOracle(address token0, address token1) external view returns (address oracle); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @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 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; interface IHelixV2Router01 { function factory() external view returns (address); function WETH() external view returns (address); function addLiquidity( address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); function removeLiquidity( address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns (uint256 amountA, uint256 amountB); function removeLiquidityETH( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external returns (uint256 amountToken, uint256 amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountA, uint256 amountB); function removeLiquidityETHWithPermit( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountToken, uint256 amountETH); function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint256 amountOutMin, address[] calldata path, address to, uint256 deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint256 amountOut, address[] calldata path, address to, uint256 deadline) external payable returns (uint[] memory amounts); function quote(uint256 amountA, uint256 reserveA, uint256 reserveB) external pure returns (uint256 amountB); function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut) external pure returns (uint256 amountOut); function getAmountIn(uint256 amountOut, uint256 reserveIn, uint256 reserveOut) external pure returns (uint256 amountIn); function getAmountsOut(uint256 amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint256 amountOut, address[] calldata path) external view returns (uint[] memory amounts); }
// 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; } }
{ "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
[{"inputs":[{"internalType":"address","name":"factory_","type":"address"},{"internalType":"address","name":"WETH_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenA","type":"address"},{"indexed":true,"internalType":"address","name":"tokenB","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountAReturned","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountBReturned","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountADesired","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountBDesired","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountAMin","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountBMin","type":"uint256"}],"name":"AddLiquidity","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenA","type":"address"},{"indexed":true,"internalType":"address","name":"tokenB","type":"address"},{"indexed":true,"internalType":"address","name":"pair","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountARemoved","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountBRemoved","type":"uint256"}],"name":"RemoveLiquidity","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"indexed":true,"internalType":"address[]","name":"path","type":"address[]"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Swap","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address[]","name":"path","type":"address[]"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"SwapSupportingFeeOnTransferTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"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":"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":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountTokenDesired","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidityETH","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountETH","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"reserveIn","type":"uint256"},{"internalType":"uint256","name":"reserveOut","type":"uint256"},{"internalType":"uint256","name":"swapFee","type":"uint256"}],"name":"getAmountIn","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"reserveIn","type":"uint256"},{"internalType":"uint256","name":"reserveOut","type":"uint256"}],"name":"getAmountIn","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"reserveIn","type":"uint256"},{"internalType":"uint256","name":"reserveOut","type":"uint256"}],"name":"getAmountOut","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"reserveIn","type":"uint256"},{"internalType":"uint256","name":"reserveOut","type":"uint256"},{"internalType":"uint256","name":"swapFee","type":"uint256"}],"name":"getAmountOut","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsIn","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"reserveA","type":"uint256"},{"internalType":"uint256","name":"reserveB","type":"uint256"}],"name":"quote","outputs":[{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"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":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidityETH","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidityETHSupportingFeeOnTransferTokens","outputs":[{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"approveMax","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"removeLiquidityETHWithPermit","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"approveMax","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"removeLiquidityETHWithPermitSupportingFeeOnTransferTokens","outputs":[{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"approveMax","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"removeLiquidityWithPermit","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":[{"internalType":"address","name":"_swapRewards","type":"address"}],"name":"setSwapRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapETHForExactTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactETHForTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactETHForTokensSupportingFeeOnTransferTokens","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForETH","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForETHSupportingFeeOnTransferTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForTokensSupportingFeeOnTransferTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapRewards","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapTokensForExactETH","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapTokensForExactTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60c06040523480156200001157600080fd5b50604051620049e7380380620049e78339810160408190526200003491620000d7565b6000805460ff19169055620000493362000061565b6001600160a01b039182166080521660a0526200010f565b600080546001600160a01b03838116610100818102610100600160a81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b80516001600160a01b0381168114620000d257600080fd5b919050565b60008060408385031215620000eb57600080fd5b620000f683620000ba565b91506200010660208401620000ba565b90509250929050565b60805160a05161475b6200028c600039600081816102230152818161056c015281816106dc015281816107a9015281816107f801528181610a7b01528181610e91015281816112770152818161130c01528181611427015281816114b5015281816117650152818161181d015281816118c90152818161193d01528181611e3d015281816120cf0152818161212501528181612159015281816121ee015281816123c10152818161244f015261288501526000818161061201528181610648015281816108ea015281816109a601528181610b6101528181610b9801528181610c8f01528181610dc301528181610e6f01528181610fa6015281816113b8015281816114e70152818161166c0152818161196f01528181611c0201528181611deb01528181611e1b01528181611f4401528181612103015281816123400152818161248101528181612e3b01528181612e8b0152818161341a0152818161362b01528181613a2801528181613acb0152613b42015261475b6000f3fe6080604052600436106102135760003560e01c80638803dbee11610118578063c5cc6b6a116100a0578063e0af36161161006f578063e0af3616146106ca578063e8e33700146106fe578063f2fde38b14610739578063f305d71914610759578063fb3bdb411461076c57600080fd5b8063c5cc6b6a14610636578063d06ca61f1461066a578063d0f9a0851461068a578063ded9382a146106aa57600080fd5b8063ad615dec116100e7578063ad615dec14610590578063af2979eb146105b0578063b6f9de95146105d0578063baa2abde146105e3578063c45a01551461060357600080fd5b80638803dbee146104e65780638a731795146105065780638da5cb5b14610526578063ad5c46481461055d57600080fd5b8063571fd0121161019b578063715018a61161016a578063715018a614610469578063791ac9471461047e5780637ff36ab51461049e5780638456cb59146104b157806385f8c259146104c657600080fd5b8063571fd012146103e65780635b0d5984146104065780635c11d795146104265780635c975abb1461044657600080fd5b80632195995c116101e25780632195995c1461035157806338ed1739146103715780633f4ba83a146103915780634a25d94a146103a657806352707d8c146103c657600080fd5b806302751cec1461029c578063054d50d4146102d657806318cbafe5146103045780631f00ca741461033157600080fd5b3661029757336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146102955760405162461bcd60e51b815260206004820152601760248201527f526f757465723a2063616c6c6572206e6f74207765746800000000000000000060448201526064015b60405180910390fd5b005b600080fd5b3480156102a857600080fd5b506102bc6102b7366004613dc4565b61077f565b604080519283526020830191909152015b60405180910390f35b3480156102e257600080fd5b506102f66102f1366004613e22565b610872565b6040519081526020016102cd565b34801561031057600080fd5b5061032461031f366004613e93565b610889565b6040516102cd9190613f06565b34801561033d57600080fd5b5061032461034c366004613f60565b610b5a565b34801561035d57600080fd5b506102bc61036c366004614050565b610b8e565b34801561037d57600080fd5b5061032461038c366004613e93565b610c67565b34801561039d57600080fd5b50610295610d51565b3480156103b257600080fd5b506103246103c1366004613e93565b610d8b565b3480156103d257600080fd5b506102f66103e13660046140fa565b610e42565b3480156103f257600080fd5b506102f66104013660046140fa565b610e59565b34801561041257600080fd5b506102f661042136600461412c565b610e67565b34801561043257600080fd5b50610295610441366004613e93565b610f54565b34801561045257600080fd5b5060005460ff1660405190151581526020016102cd565b34801561047557600080fd5b506102956111a0565b34801561048a57600080fd5b50610295610499366004613e93565b6111da565b6103246104ac3660046141c2565b61137a565b3480156104bd57600080fd5b506102956115fd565b3480156104d257600080fd5b506102f66104e1366004613e22565b611635565b3480156104f257600080fd5b50610324610501366004613e93565b611644565b34801561051257600080fd5b50610295610521366004614229565b6116dd565b34801561053257600080fd5b5060005461010090046001600160a01b03165b6040516001600160a01b0390911681526020016102cd565b34801561056957600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610545565b34801561059c57600080fd5b506102f66105ab366004613e22565b61172f565b3480156105bc57600080fd5b506102f66105cb366004613dc4565b61173c565b6102956105de3660046141c2565b61188b565b3480156105ef57600080fd5b506102bc6105fe366004614246565b611bae565b34801561060f57600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610545565b34801561064257600080fd5b506105457f000000000000000000000000000000000000000000000000000000000000000081565b34801561067657600080fd5b50610324610685366004613f60565b611de4565b34801561069657600080fd5b50600154610545906001600160a01b031681565b3480156106b657600080fd5b506102bc6106c536600461412c565b611e11565b3480156106d657600080fd5b506105457f000000000000000000000000000000000000000000000000000000000000000081565b34801561070a57600080fd5b5061071e6107193660046142b8565b611f04565b604080519384526020840192909252908201526060016102cd565b34801561074557600080fd5b50610295610754366004614229565b612002565b61071e610767366004613dc4565b6120a3565b61032461077a3660046141c2565b612302565b60008082428110156107a35760405162461bcd60e51b815260040161028c90614334565b6107d2897f00000000000000000000000000000000000000000000000000000000000000008a8a8a308a611bae565b90935091506107e28986856125d9565b604051632e1a7d4d60e01b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561084457600080fd5b505af1158015610858573d6000803e3d6000fd5b5050505061086685836126f4565b50965096945050505050565b600061088184848460006127c2565b949350505050565b606081428110156108ac5760405162461bcd60e51b815260040161028c90614334565b6108e586866108bc600182614381565b8181106108cb576108cb614398565b90506020020160208101906108e09190614229565b612883565b6109437f0000000000000000000000000000000000000000000000000000000000000000898888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506128fb92505050565b915061097582600184516109579190614381565b8151811061096757610967614398565b602002602001015188612ad7565b610a3a8686600081811061098b5761098b614398565b90506020020160208101906109a09190614229565b33610a1a7f00000000000000000000000000000000000000000000000000000000000000008a8a60008181106109d8576109d8614398565b90506020020160208101906109ed9190614229565b8b8b6001818110610a0057610a00614398565b9050602002016020810190610a159190614229565b612b2b565b85600081518110610a2d57610a2d614398565b6020026020010151612c04565b610a7982878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250309250612d30915050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632e1a7d4d8360018551610ab79190614381565b81518110610ac757610ac7614398565b60200260200101516040518263ffffffff1660e01b8152600401610aed91815260200190565b600060405180830381600087803b158015610b0757600080fd5b505af1158015610b1b573d6000803e3d6000fd5b50505050610b4f848360018551610b329190614381565b81518110610b4257610b42614398565b60200260200101516126f4565b509695505050505050565b6060610b877f00000000000000000000000000000000000000000000000000000000000000008484613015565b9392505050565b6000806000610bbe7f00000000000000000000000000000000000000000000000000000000000000008f8f612b2b565b9050600087610bcd578c610bd1565b6000195b60405163d505accf60e01b81529091506001600160a01b0383169063d505accf90610c0c903390309086908f908e908e908e906004016143ae565b600060405180830381600087803b158015610c2657600080fd5b505af1158015610c3a573d6000803e3d6000fd5b50505050610c4d8f8f8f8f8f8f8f611bae565b809450819550505050509b509b9950505050505050505050565b60608142811015610c8a5760405162461bcd60e51b815260040161028c90614334565b610ce87f0000000000000000000000000000000000000000000000000000000000000000898888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506128fb92505050565b9150610cfc82600184516109579190614381565b610d128686600081811061098b5761098b614398565b610b4f82878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250899250612d30915050565b6000546001600160a01b03610100909104163314610d815760405162461bcd60e51b815260040161028c906143ef565b610d896131d4565b565b60608142811015610dae5760405162461bcd60e51b815260040161028c90614334565b610dbe86866108bc600182614381565b610e1c7f00000000000000000000000000000000000000000000000000000000000000008988888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061301592505050565b915061097582600081518110610e3457610e34614398565b602002602001015188613267565b6000610e50858585856127c2565b95945050505050565b6000610e50858585856132b7565b600080610eb57f00000000000000000000000000000000000000000000000000000000000000008d7f0000000000000000000000000000000000000000000000000000000000000000612b2b565b9050600086610ec4578b610ec8565b6000195b60405163d505accf60e01b81529091506001600160a01b0383169063d505accf90610f03903390309086908e908d908d908d906004016143ae565b600060405180830381600087803b158015610f1d57600080fd5b505af1158015610f31573d6000803e3d6000fd5b50505050610f438d8d8d8d8d8d61173c565b9d9c50505050505050505050505050565b8042811015610f755760405162461bcd60e51b815260040161028c90614334565b61100685856000818110610f8b57610f8b614398565b9050602002016020810190610fa09190614229565b336110007f000000000000000000000000000000000000000000000000000000000000000089896000818110610fd857610fd8614398565b9050602002016020810190610fed9190614229565b8a8a6001818110610a0057610a00614398565b8a612c04565b60008585611015600182614381565b81811061102457611024614398565b90506020020160208101906110399190614229565b6040516370a0823160e01b81526001600160a01b03868116600483015291909116906370a0823190602401602060405180830381865afa158015611081573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a59190614424565b90506110e586868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525088925061337d915050565b6111968187876110f6600182614381565b81811061110557611105614398565b905060200201602081019061111a9190614229565b6040516370a0823160e01b81526001600160a01b03888116600483015291909116906370a0823190602401602060405180830381865afa158015611162573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111869190614424565b6111909190614381565b88612ad7565b5050505050505050565b6000546001600160a01b036101009091041633146111d05760405162461bcd60e51b815260040161028c906143ef565b610d8960006137a8565b80428110156111fb5760405162461bcd60e51b815260040161028c90614334565b61120b85856108bc600182614381565b61122185856000818110610f8b57610f8b614398565b61125f85858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525030925061337d915050565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156112c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ea9190614424565b90506112f68188612ad7565b604051632e1a7d4d60e01b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561135857600080fd5b505af115801561136c573d6000803e3d6000fd5b5050505061119684826126f4565b6060814281101561139d5760405162461bcd60e51b815260040161028c90614334565b6113b3868660008181106108cb576108cb614398565b6114117f0000000000000000000000000000000000000000000000000000000000000000348888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506128fb92505050565b915061142582600184516109579190614381565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db08360008151811061146757611467614398565b60200260200101516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561149a57600080fd5b505af11580156114ae573d6000803e3d6000fd5b50505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb6115197f000000000000000000000000000000000000000000000000000000000000000089896000818110610fd857610fd8614398565b8460008151811061152c5761152c614398565b60200260200101516040518363ffffffff1660e01b81526004016115659291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af1158015611584573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a8919061443d565b6115b4576115b461445a565b6115f382878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250899250612d30915050565b5095945050505050565b6000546001600160a01b0361010090910416331461162d5760405162461bcd60e51b815260040161028c906143ef565b610d89613801565b600061088184848460006132b7565b606081428110156116675760405162461bcd60e51b815260040161028c90614334565b6116c57f00000000000000000000000000000000000000000000000000000000000000008988888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061301592505050565b9150610cfc82600081518110610e3457610e34614398565b6000546001600160a01b0361010090910416331461170d5760405162461bcd60e51b815260040161028c906143ef565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000610881848484613859565b6000814281101561175f5760405162461bcd60e51b815260040161028c90614334565b61178e887f00000000000000000000000000000000000000000000000000000000000000008989893089611bae565b6040516370a0823160e01b81523060048201529093506118079150899086906001600160a01b038316906370a0823190602401602060405180830381865afa1580156117de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118029190614424565b6125d9565b604051632e1a7d4d60e01b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561186957600080fd5b505af115801561187d573d6000803e3d6000fd5b50505050610b4f84836126f4565b80428110156118ac5760405162461bcd60e51b815260040161028c90614334565b6118c2858560008181106108cb576108cb614398565b60003490507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561192257600080fd5b505af1158015611936573d6000803e3d6000fd5b50505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb6119a17f000000000000000000000000000000000000000000000000000000000000000089896000818110610fd857610fd8614398565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af11580156119ee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a12919061443d565b611a1e57611a1e61445a565b60008686611a2d600182614381565b818110611a3c57611a3c614398565b9050602002016020810190611a519190614229565b6040516370a0823160e01b81526001600160a01b03878116600483015291909116906370a0823190602401602060405180830381865afa158015611a99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611abd9190614424565b9050611afd87878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525089925061337d915050565b611196818888611b0e600182614381565b818110611b1d57611b1d614398565b9050602002016020810190611b329190614229565b6040516370a0823160e01b81526001600160a01b03898116600483015291909116906370a0823190602401602060405180830381865afa158015611b7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9e9190614424565b611ba89190614381565b89612ad7565b600080611bbd60005460ff1690565b15611bda5760405162461bcd60e51b815260040161028c90614470565b8242811015611bfb5760405162461bcd60e51b815260040161028c90614334565b6000611c287f00000000000000000000000000000000000000000000000000000000000000008c8c612b2b565b6040516323b872dd60e01b81529091506001600160a01b038216906323b872dd90611c5b90339085908e9060040161449a565b6020604051808303816000875af1158015611c7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c9e919061443d565b5060405163226bf2d160e21b81526001600160a01b03878116600483015260009182918416906389afcb449060240160408051808303816000875af1158015611ceb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d0f91906144be565b915091506000611d1f8e8e6138de565b509050806001600160a01b03168e6001600160a01b031614611d42578183611d45565b82825b9097509550611d54878c612ad7565b611d5e868b612ad7565b836001600160a01b03168d6001600160a01b03168f6001600160a01b03167f25fd06a669e99246a924fd8ed377847953a2e1d1db8d91245c9f200de51769538c8b8b604051611dcb939291906001600160a01b039390931683526020830191909152604082015260600190565b60405180910390a4505050505097509795505050505050565b6060610b877f000000000000000000000000000000000000000000000000000000000000000084846128fb565b6000806000611e617f00000000000000000000000000000000000000000000000000000000000000008e7f0000000000000000000000000000000000000000000000000000000000000000612b2b565b9050600087611e70578c611e74565b6000195b60405163d505accf60e01b81529091506001600160a01b0383169063d505accf90611eaf903390309086908f908e908e908e906004016143ae565b600060405180830381600087803b158015611ec957600080fd5b505af1158015611edd573d6000803e3d6000fd5b50505050611eef8e8e8e8e8e8e61077f565b909f909e509c50505050505050505050505050565b60008060008342811015611f2a5760405162461bcd60e51b815260040161028c90614334565b611f388c8c8c8c8c8c6139d2565b90945092506000611f6a7f00000000000000000000000000000000000000000000000000000000000000008e8e612b2b565b9050611f788d338388612c04565b611f848c338387612c04565b6040516335313c2160e11b81526001600160a01b038881166004830152821690636a627842906024016020604051808303816000875af1158015611fcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ff09190614424565b92505050985098509895505050505050565b6000546001600160a01b036101009091041633146120325760405162461bcd60e51b815260040161028c906143ef565b6001600160a01b0381166120975760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161028c565b6120a0816137a8565b50565b600080600083428110156120c95760405162461bcd60e51b815260040161028c90614334565b6120f78a7f00000000000000000000000000000000000000000000000000000000000000008b348c8c6139d2565b909450925060006121497f00000000000000000000000000000000000000000000000000000000000000008c7f0000000000000000000000000000000000000000000000000000000000000000612b2b565b90506121578b338388612c04565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0856040518263ffffffff1660e01b81526004016000604051808303818588803b1580156121b257600080fd5b505af11580156121c6573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b038581166004830152602482018990527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb925060440190506020604051808303816000875af115801561223b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061225f919061443d565b61226b5761226b61445a565b6040516335313c2160e11b81526001600160a01b038881166004830152821690636a627842906024016020604051808303816000875af11580156122b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122d79190614424565b9250833411156122f4576122f4336122ef8634614381565b6126f4565b505096509650969350505050565b606081428110156123255760405162461bcd60e51b815260040161028c90614334565b61233b868660008181106108cb576108cb614398565b6123997f00000000000000000000000000000000000000000000000000000000000000008888888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061301592505050565b91506123bf826000815181106123b1576123b1614398565b602002602001015134613267565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db08360008151811061240157612401614398565b60200260200101516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561243457600080fd5b505af1158015612448573d6000803e3d6000fd5b50505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb6124b37f000000000000000000000000000000000000000000000000000000000000000089896000818110610fd857610fd8614398565b846000815181106124c6576124c6614398565b60200260200101516040518363ffffffff1660e01b81526004016124ff9291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af115801561251e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612542919061443d565b61254e5761254e61445a565b61258d82878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250899250612d30915050565b816000815181106125a0576125a0614398565b60200260200101513411156115f3576115f333836000815181106125c6576125c6614398565b6020026020010151346122ef9190614381565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b179052915160009283929087169161263591906144e2565b6000604051808303816000865af19150503d8060008114612672576040519150601f19603f3d011682016040523d82523d6000602084013e612677565b606091505b50915091508180156126a15750805115806126a15750808060200190518101906126a1919061443d565b6126ed5760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604482015260640161028c565b5050505050565b604080516000808252602082019092526001600160a01b03841690839060405161271e91906144e2565b60006040518083038185875af1925050503d806000811461275b576040519150601f19603f3d011682016040523d82523d6000602084013e612760565b606091505b50509050806127bd5760405162461bcd60e51b815260206004820152602360248201527f5472616e7366657248656c7065723a204554485f5452414e534645525f46414960448201526213115160ea1b606482015260840161028c565b505050565b600084600081116127e55760405162461bcd60e51b815260040161028c9061451d565b84600081116128065760405162461bcd60e51b815260040161028c90614554565b84600081116128275760405162461bcd60e51b815260040161028c90614554565b6000612835866103e8614381565b61283f908a61458b565b9050600061284d888361458b565b905060008261285e8b6103e861458b565b61286891906145aa565b905061287481836145c2565b9b9a5050505050505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b0316146120a05760405162461bcd60e51b81526020600482015260146024820152730a4deeae8cae47440d2dcecc2d8d2c840e0c2e8d60631b604482015260640161028c565b6060816002815110156129505760405162461bcd60e51b815260206004820152601a60248201527f48656c69784c6962726172793a20696e76616c69642070617468000000000000604482015260640161028c565b825167ffffffffffffffff81111561296a5761296a613f4a565b604051908082528060200260200182016040528015612993578160200160208202803683370190505b50915083826000815181106129aa576129aa614398565b6020026020010181815250506000600184516129c69190614381565b905060005b81811015612acd57600080612a1f898885815181106129ec576129ec614398565b602002602001015189866001612a0291906145aa565b81518110612a1257612a12614398565b6020026020010151613c59565b91509150612a90868481518110612a3857612a38614398565b60200260200101518383612a8b8d8c8981518110612a5857612a58614398565b60200260200101518d8a6001612a6e91906145aa565b81518110612a7e57612a7e614398565b6020026020010151613d23565b6127c2565b86612a9c8560016145aa565b81518110612aac57612aac614398565b60200260200101818152505050508080612ac5906145e4565b9150506129cb565b5050509392505050565b80821015612b275760405162461bcd60e51b815260206004820152601b60248201527f526f757465723a20696e73756666696369656e7420616d6f756e740000000000604482015260640161028c565b5050565b6000806000612b3a85856138de565b6040516bffffffffffffffffffffffff19606084811b8216602084015283901b1660348201529193509150869060480160405160208183030381529060405280519060200120604051602001612be29291906001600160f81b0319815260609290921b6bffffffffffffffffffffffff1916600183015260158201527fdf06dacc3c0f420f3e881baed6af2087e5ab8bc910d926f439c1081ec11fc885603582015260550190565b60408051601f1981840301815291905280516020909101209695505050505050565b600080856001600160a01b03166323b872dd868686604051602401612c2b9392919061449a565b6040516020818303038152906040529060e01b6020820180516001600160e01b038381831617835250505050604051612c6491906144e2565b6000604051808303816000865af19150503d8060008114612ca1576040519150601f19603f3d011682016040523d82523d6000602084013e612ca6565b606091505b5091509150818015612cd0575080511580612cd0575080806020019051810190612cd0919061443d565b612d285760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f46416044820152631253115160e21b606482015260840161028c565b505050505050565b60005460ff1615612d535760405162461bcd60e51b815260040161028c90614470565b600060018351612d639190614381565b905060005b81811015612fb057600080858381518110612d8557612d85614398565b602002602001015186846001612d9b91906145aa565b81518110612dab57612dab614398565b6020026020010151915091506000612dc383836138de565b509050600088612dd48660016145aa565b81518110612de457612de4614398565b60200260200101519050600080836001600160a01b0316866001600160a01b031614612e1257826000612e16565b6000835b91509150600060028b51612e2a9190614381565b8810612e365789612e84565b612e847f0000000000000000000000000000000000000000000000000000000000000000878d612e678c60026145aa565b81518110612e7757612e77614398565b6020026020010151612b2b565b9050612eb17f00000000000000000000000000000000000000000000000000000000000000008888612b2b565b6040516336cd320560e11b815260048101859052602481018490526001600160a01b0383811660448301529190911690636d9a640a90606401600060405180830381600087803b158015612f0457600080fd5b505af1158015612f18573d6000803e3d6000fd5b50506001546001600160a01b0316159150612f96905057600154604051630df791e560e41b81526001600160a01b039091169063df791e5090612f639033908a90899060040161449a565b600060405180830381600087803b158015612f7d57600080fd5b505af1158015612f91573d6000803e3d6000fd5b505050505b505050505050508080612fa8906145e4565b915050612d68565b50816001600160a01b031683604051612fc991906145ff565b604051809103902085604051612fdf919061463e565b604051908190038120907f8f43ab3cb378db622a7074b85f11cc9e2defa4d31d1f5a48f435fbc0a1b1c1e490600090a450505050565b60608160028151101561306a5760405162461bcd60e51b815260206004820152601a60248201527f48656c69784c6962726172793a20696e76616c69642070617468000000000000604482015260640161028c565b825167ffffffffffffffff81111561308457613084613f4a565b6040519080825280602002602001820160405280156130ad578160200160208202803683370190505b5091508382600184516130c09190614381565b815181106130d0576130d0614398565b6020026020010181815250506000600184516130ec9190614381565b9050805b8015612acd576000806131338988613109600187614381565b8151811061311957613119614398565b6020026020010151898681518110612a1257612a12614398565b9150915061319786848151811061314c5761314c614398565b602002602001015183836131928d8c60018a6131689190614381565b8151811061317857613178614398565b60200260200101518d8a81518110612a7e57612a7e614398565b6132b7565b866131a3600186614381565b815181106131b3576131b3614398565b602002602001018181525050505080806131cc90614668565b9150506130f0565b60005460ff1661321d5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161028c565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b80821115612b275760405162461bcd60e51b815260206004820152601860248201527f526f757465723a2065786365737369766520616d6f756e740000000000000000604482015260640161028c565b600084600081116132da5760405162461bcd60e51b815260040161028c9061451d565b84600081116132fb5760405162461bcd60e51b815260040161028c90614554565b846000811161331c5760405162461bcd60e51b815260040161028c90614554565b6000613328898961458b565b613334906103e861458b565b90506000613344876103e8614381565b61334e8b8a614381565b613358919061458b565b905061336481836145c2565b61336f9060016145aa565b9a9950505050505050505050565b60005460ff16156133a05760405162461bcd60e51b815260040161028c90614470565b6000600183516133b09190614381565b905060005b8181101561375a576000808583815181106133d2576133d2614398565b6020026020010151868460016133e891906145aa565b815181106133f8576133f8614398565b602002602001015191509150600061341083836138de565b50905060006134407f00000000000000000000000000000000000000000000000000000000000000008585612b2b565b9050600080600080846001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015613486573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134aa91906146aa565b506001600160701b031691506001600160701b03169150600080876001600160a01b03168a6001600160a01b0316146134e45782846134e7565b83835b6040516370a0823160e01b81526001600160a01b038a8116600483015292945090925083918c16906370a0823190602401602060405180830381865afa158015613535573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135599190614424565b6135639190614381565b95506135d88683838a6001600160a01b03166354cf2aeb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156135a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135cd91906146ed565b63ffffffff166127c2565b945050505050600080856001600160a01b0316886001600160a01b03161461360257826000613606565b6000835b91509150600060028d5161361a9190614381565b8a10613626578b613657565b6136577f0000000000000000000000000000000000000000000000000000000000000000898f612e678e60026145aa565b6040516336cd320560e11b815260048101859052602481018490526001600160a01b03808316604483015291925090871690636d9a640a90606401600060405180830381600087803b1580156136ac57600080fd5b505af11580156136c0573d6000803e3d6000fd5b50506001546001600160a01b031615915061373e905057600154604051630df791e560e41b81526001600160a01b039091169063df791e509061370b9033908c90899060040161449a565b600060405180830381600087803b15801561372557600080fd5b505af1158015613739573d6000803e3d6000fd5b505050505b5050505050505050508080613752906145e4565b9150506133b5565b50816001600160a01b03168360405161377391906145ff565b604051908190038120907f656a8c71622603d968e0862dba3427a1669e4839e2ae2ecb8ecd81794592e9b990600090a3505050565b600080546001600160a01b03838116610100818102610100600160a81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60005460ff16156138245760405162461bcd60e51b815260040161028c90614470565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861324a3390565b6000836000811161387c5760405162461bcd60e51b815260040161028c9061451d565b836000811161389d5760405162461bcd60e51b815260040161028c90614554565b83600081116138be5760405162461bcd60e51b815260040161028c90614554565b856138c9868961458b565b6138d391906145c2565b979650505050505050565b600080826001600160a01b0316846001600160a01b0316141561394d5760405162461bcd60e51b815260206004820152602160248201527f48656c69784c6962726172793a206964656e746963616c2061646472657373656044820152607360f81b606482015260840161028c565b826001600160a01b0316846001600160a01b03161061396d578284613970565b83835b90925090506001600160a01b0382166139cb5760405162461bcd60e51b815260206004820152601a60248201527f48656c69784c6962726172793a207a65726f2061646472657373000000000000604482015260640161028c565b9250929050565b6000806139e160005460ff1690565b156139fe5760405162461bcd60e51b815260040161028c90614470565b60405163e6a4390560e01b81526001600160a01b03898116600483015288811660248301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063e6a4390590604401602060405180830381865afa158015613a71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a959190614708565b6001600160a01b03161415613b3a576040516364e329cb60e11b81526001600160a01b03898116600483015288811660248301527f0000000000000000000000000000000000000000000000000000000000000000169063c9c65396906044016020604051808303816000875af1158015613b14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b389190614708565b505b600080613b687f00000000000000000000000000000000000000000000000000000000000000008b8b613c59565b91509150816000148015613b7a575080155b15613b8a57879350869250613be6565b6000613b97898484613859565b9050878111613bb557613baa8187612ad7565b889450925082613be4565b6000613bc2898486613859565b905089811115613bd457613bd461445a565b613bde8189612ad7565b94508793505b505b6040805185815260208101859052908101899052606081018890526080810187905260a081018690526001600160a01b03808b1691908c16907f746bdd62bec95d9a4d5dc284b09b3cd18e7f5f5426535b7ba2b13a418da1cdf79060c00160405180910390a35050965096945050505050565b6000806000613c6885856138de565b509050600080613c79888888612b2b565b6001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015613cb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cda91906146aa565b506001600160701b031691506001600160701b03169150826001600160a01b0316876001600160a01b031614613d11578082613d14565b81815b90999098509650505050505050565b6000613d30848484612b2b565b6001600160a01b03166354cf2aeb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613d6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d9191906146ed565b63ffffffff16949350505050565b6001600160a01b03811681146120a057600080fd5b8035613dbf81613d9f565b919050565b60008060008060008060c08789031215613ddd57600080fd5b8635613de881613d9f565b95506020870135945060408701359350606087013592506080870135613e0d81613d9f565b8092505060a087013590509295509295509295565b600080600060608486031215613e3757600080fd5b505081359360208301359350604090920135919050565b60008083601f840112613e6057600080fd5b50813567ffffffffffffffff811115613e7857600080fd5b6020830191508360208260051b85010111156139cb57600080fd5b60008060008060008060a08789031215613eac57600080fd5b8635955060208701359450604087013567ffffffffffffffff811115613ed157600080fd5b613edd89828a01613e4e565b9095509350506060870135613ef181613d9f565b80925050608087013590509295509295509295565b6020808252825182820181905260009190848201906040850190845b81811015613f3e57835183529284019291840191600101613f22565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215613f7357600080fd5b8235915060208084013567ffffffffffffffff80821115613f9357600080fd5b818601915086601f830112613fa757600080fd5b813581811115613fb957613fb9613f4a565b8060051b604051601f19603f83011681018181108582111715613fde57613fde613f4a565b604052918252848201925083810185019189831115613ffc57600080fd5b938501935b828510156140215761401285613db4565b84529385019392850192614001565b8096505050505050509250929050565b80151581146120a057600080fd5b803560ff81168114613dbf57600080fd5b60008060008060008060008060008060006101608c8e03121561407257600080fd5b8b3561407d81613d9f565b9a5060208c013561408d81613d9f565b995060408c0135985060608c0135975060808c0135965060a08c01356140b281613d9f565b955060c08c0135945060e08c01356140c981614031565b93506140d86101008d0161403f565b92506101208c013591506101408c013590509295989b509295989b9093969950565b6000806000806080858703121561411057600080fd5b5050823594602084013594506040840135936060013592509050565b6000806000806000806000806000806101408b8d03121561414c57600080fd5b8a3561415781613d9f565b995060208b0135985060408b0135975060608b0135965060808b013561417c81613d9f565b955060a08b0135945060c08b013561419381614031565b93506141a160e08c0161403f565b92506101008b013591506101208b013590509295989b9194979a5092959850565b6000806000806000608086880312156141da57600080fd5b85359450602086013567ffffffffffffffff8111156141f857600080fd5b61420488828901613e4e565b909550935050604086013561421881613d9f565b949793965091946060013592915050565b60006020828403121561423b57600080fd5b8135610b8781613d9f565b600080600080600080600060e0888a03121561426157600080fd5b873561426c81613d9f565b9650602088013561427c81613d9f565b955060408801359450606088013593506080880135925060a08801356142a181613d9f565b8092505060c0880135905092959891949750929550565b600080600080600080600080610100898b0312156142d557600080fd5b88356142e081613d9f565b975060208901356142f081613d9f565b965060408901359550606089013594506080890135935060a0890135925060c089013561431c81613d9f565b8092505060e089013590509295985092959890939650565b60208082526018908201527f526f757465723a20696e76616c696420646561646c696e650000000000000000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000828210156143935761439361436b565b500390565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b0397881681529590961660208601526040850193909352606084019190915260ff16608083015260a082015260c081019190915260e00190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561443657600080fd5b5051919050565b60006020828403121561444f57600080fd5b8151610b8781614031565b634e487b7160e01b600052600160045260246000fd5b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600080604083850312156144d157600080fd5b505080516020909101519092909150565b6000825160005b8181101561450357602081860181015185830152016144e9565b81811115614512576000828501525b509190910192915050565b60208082526019908201527f48656c69784c6962726172793a207a65726f20616d6f756e7400000000000000604082015260600190565b6020808252601c908201527f48656c69784c6962726172793a207a65726f206c697175696469747900000000604082015260600190565b60008160001904831182151516156145a5576145a561436b565b500290565b600082198211156145bd576145bd61436b565b500190565b6000826145df57634e487b7160e01b600052601260045260246000fd5b500490565b60006000198214156145f8576145f861436b565b5060010190565b815160009082906020808601845b838110156146325781516001600160a01b03168552938201939082019060010161460d565b50929695505050505050565b815160009082906020808601845b838110156146325781518552938201939082019060010161464c565b6000816146775761467761436b565b506000190190565b80516001600160701b0381168114613dbf57600080fd5b805163ffffffff81168114613dbf57600080fd5b6000806000606084860312156146bf57600080fd5b6146c88461467f565b92506146d66020850161467f565b91506146e460408501614696565b90509250925092565b6000602082840312156146ff57600080fd5b610b8782614696565b60006020828403121561471a57600080fd5b8151610b8781613d9f56fea2646970667358221220205289e2a7f47b20d55b92d00026ccd347d5e368f4b0502ce8221db895242e6d64736f6c634300080a00330000000000000000000000008891dd75ed91fe531bc065882b579ffae9a20284000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Deployed Bytecode
0x6080604052600436106102135760003560e01c80638803dbee11610118578063c5cc6b6a116100a0578063e0af36161161006f578063e0af3616146106ca578063e8e33700146106fe578063f2fde38b14610739578063f305d71914610759578063fb3bdb411461076c57600080fd5b8063c5cc6b6a14610636578063d06ca61f1461066a578063d0f9a0851461068a578063ded9382a146106aa57600080fd5b8063ad615dec116100e7578063ad615dec14610590578063af2979eb146105b0578063b6f9de95146105d0578063baa2abde146105e3578063c45a01551461060357600080fd5b80638803dbee146104e65780638a731795146105065780638da5cb5b14610526578063ad5c46481461055d57600080fd5b8063571fd0121161019b578063715018a61161016a578063715018a614610469578063791ac9471461047e5780637ff36ab51461049e5780638456cb59146104b157806385f8c259146104c657600080fd5b8063571fd012146103e65780635b0d5984146104065780635c11d795146104265780635c975abb1461044657600080fd5b80632195995c116101e25780632195995c1461035157806338ed1739146103715780633f4ba83a146103915780634a25d94a146103a657806352707d8c146103c657600080fd5b806302751cec1461029c578063054d50d4146102d657806318cbafe5146103045780631f00ca741461033157600080fd5b3661029757336001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216146102955760405162461bcd60e51b815260206004820152601760248201527f526f757465723a2063616c6c6572206e6f74207765746800000000000000000060448201526064015b60405180910390fd5b005b600080fd5b3480156102a857600080fd5b506102bc6102b7366004613dc4565b61077f565b604080519283526020830191909152015b60405180910390f35b3480156102e257600080fd5b506102f66102f1366004613e22565b610872565b6040519081526020016102cd565b34801561031057600080fd5b5061032461031f366004613e93565b610889565b6040516102cd9190613f06565b34801561033d57600080fd5b5061032461034c366004613f60565b610b5a565b34801561035d57600080fd5b506102bc61036c366004614050565b610b8e565b34801561037d57600080fd5b5061032461038c366004613e93565b610c67565b34801561039d57600080fd5b50610295610d51565b3480156103b257600080fd5b506103246103c1366004613e93565b610d8b565b3480156103d257600080fd5b506102f66103e13660046140fa565b610e42565b3480156103f257600080fd5b506102f66104013660046140fa565b610e59565b34801561041257600080fd5b506102f661042136600461412c565b610e67565b34801561043257600080fd5b50610295610441366004613e93565b610f54565b34801561045257600080fd5b5060005460ff1660405190151581526020016102cd565b34801561047557600080fd5b506102956111a0565b34801561048a57600080fd5b50610295610499366004613e93565b6111da565b6103246104ac3660046141c2565b61137a565b3480156104bd57600080fd5b506102956115fd565b3480156104d257600080fd5b506102f66104e1366004613e22565b611635565b3480156104f257600080fd5b50610324610501366004613e93565b611644565b34801561051257600080fd5b50610295610521366004614229565b6116dd565b34801561053257600080fd5b5060005461010090046001600160a01b03165b6040516001600160a01b0390911681526020016102cd565b34801561056957600080fd5b507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2610545565b34801561059c57600080fd5b506102f66105ab366004613e22565b61172f565b3480156105bc57600080fd5b506102f66105cb366004613dc4565b61173c565b6102956105de3660046141c2565b61188b565b3480156105ef57600080fd5b506102bc6105fe366004614246565b611bae565b34801561060f57600080fd5b507f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a20284610545565b34801561064257600080fd5b506105457f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a2028481565b34801561067657600080fd5b50610324610685366004613f60565b611de4565b34801561069657600080fd5b50600154610545906001600160a01b031681565b3480156106b657600080fd5b506102bc6106c536600461412c565b611e11565b3480156106d657600080fd5b506105457f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b34801561070a57600080fd5b5061071e6107193660046142b8565b611f04565b604080519384526020840192909252908201526060016102cd565b34801561074557600080fd5b50610295610754366004614229565b612002565b61071e610767366004613dc4565b6120a3565b61032461077a3660046141c2565b612302565b60008082428110156107a35760405162461bcd60e51b815260040161028c90614334565b6107d2897f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28a8a8a308a611bae565b90935091506107e28986856125d9565b604051632e1a7d4d60e01b8152600481018390527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561084457600080fd5b505af1158015610858573d6000803e3d6000fd5b5050505061086685836126f4565b50965096945050505050565b600061088184848460006127c2565b949350505050565b606081428110156108ac5760405162461bcd60e51b815260040161028c90614334565b6108e586866108bc600182614381565b8181106108cb576108cb614398565b90506020020160208101906108e09190614229565b612883565b6109437f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a20284898888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506128fb92505050565b915061097582600184516109579190614381565b8151811061096757610967614398565b602002602001015188612ad7565b610a3a8686600081811061098b5761098b614398565b90506020020160208101906109a09190614229565b33610a1a7f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a202848a8a60008181106109d8576109d8614398565b90506020020160208101906109ed9190614229565b8b8b6001818110610a0057610a00614398565b9050602002016020810190610a159190614229565b612b2b565b85600081518110610a2d57610a2d614398565b6020026020010151612c04565b610a7982878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250309250612d30915050565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316632e1a7d4d8360018551610ab79190614381565b81518110610ac757610ac7614398565b60200260200101516040518263ffffffff1660e01b8152600401610aed91815260200190565b600060405180830381600087803b158015610b0757600080fd5b505af1158015610b1b573d6000803e3d6000fd5b50505050610b4f848360018551610b329190614381565b81518110610b4257610b42614398565b60200260200101516126f4565b509695505050505050565b6060610b877f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a202848484613015565b9392505050565b6000806000610bbe7f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a202848f8f612b2b565b9050600087610bcd578c610bd1565b6000195b60405163d505accf60e01b81529091506001600160a01b0383169063d505accf90610c0c903390309086908f908e908e908e906004016143ae565b600060405180830381600087803b158015610c2657600080fd5b505af1158015610c3a573d6000803e3d6000fd5b50505050610c4d8f8f8f8f8f8f8f611bae565b809450819550505050509b509b9950505050505050505050565b60608142811015610c8a5760405162461bcd60e51b815260040161028c90614334565b610ce87f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a20284898888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506128fb92505050565b9150610cfc82600184516109579190614381565b610d128686600081811061098b5761098b614398565b610b4f82878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250899250612d30915050565b6000546001600160a01b03610100909104163314610d815760405162461bcd60e51b815260040161028c906143ef565b610d896131d4565b565b60608142811015610dae5760405162461bcd60e51b815260040161028c90614334565b610dbe86866108bc600182614381565b610e1c7f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a202848988888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061301592505050565b915061097582600081518110610e3457610e34614398565b602002602001015188613267565b6000610e50858585856127c2565b95945050505050565b6000610e50858585856132b7565b600080610eb57f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a202848d7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2612b2b565b9050600086610ec4578b610ec8565b6000195b60405163d505accf60e01b81529091506001600160a01b0383169063d505accf90610f03903390309086908e908d908d908d906004016143ae565b600060405180830381600087803b158015610f1d57600080fd5b505af1158015610f31573d6000803e3d6000fd5b50505050610f438d8d8d8d8d8d61173c565b9d9c50505050505050505050505050565b8042811015610f755760405162461bcd60e51b815260040161028c90614334565b61100685856000818110610f8b57610f8b614398565b9050602002016020810190610fa09190614229565b336110007f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a2028489896000818110610fd857610fd8614398565b9050602002016020810190610fed9190614229565b8a8a6001818110610a0057610a00614398565b8a612c04565b60008585611015600182614381565b81811061102457611024614398565b90506020020160208101906110399190614229565b6040516370a0823160e01b81526001600160a01b03868116600483015291909116906370a0823190602401602060405180830381865afa158015611081573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a59190614424565b90506110e586868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525088925061337d915050565b6111968187876110f6600182614381565b81811061110557611105614398565b905060200201602081019061111a9190614229565b6040516370a0823160e01b81526001600160a01b03888116600483015291909116906370a0823190602401602060405180830381865afa158015611162573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111869190614424565b6111909190614381565b88612ad7565b5050505050505050565b6000546001600160a01b036101009091041633146111d05760405162461bcd60e51b815260040161028c906143ef565b610d8960006137a8565b80428110156111fb5760405162461bcd60e51b815260040161028c90614334565b61120b85856108bc600182614381565b61122185856000818110610f8b57610f8b614398565b61125f85858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525030925061337d915050565b6040516370a0823160e01b81523060048201526000907f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316906370a0823190602401602060405180830381865afa1580156112c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ea9190614424565b90506112f68188612ad7565b604051632e1a7d4d60e01b8152600481018290527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561135857600080fd5b505af115801561136c573d6000803e3d6000fd5b5050505061119684826126f4565b6060814281101561139d5760405162461bcd60e51b815260040161028c90614334565b6113b3868660008181106108cb576108cb614398565b6114117f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a20284348888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506128fb92505050565b915061142582600184516109579190614381565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db08360008151811061146757611467614398565b60200260200101516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561149a57600080fd5b505af11580156114ae573d6000803e3d6000fd5b50505050507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663a9059cbb6115197f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a2028489896000818110610fd857610fd8614398565b8460008151811061152c5761152c614398565b60200260200101516040518363ffffffff1660e01b81526004016115659291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af1158015611584573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a8919061443d565b6115b4576115b461445a565b6115f382878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250899250612d30915050565b5095945050505050565b6000546001600160a01b0361010090910416331461162d5760405162461bcd60e51b815260040161028c906143ef565b610d89613801565b600061088184848460006132b7565b606081428110156116675760405162461bcd60e51b815260040161028c90614334565b6116c57f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a202848988888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061301592505050565b9150610cfc82600081518110610e3457610e34614398565b6000546001600160a01b0361010090910416331461170d5760405162461bcd60e51b815260040161028c906143ef565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000610881848484613859565b6000814281101561175f5760405162461bcd60e51b815260040161028c90614334565b61178e887f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28989893089611bae565b6040516370a0823160e01b81523060048201529093506118079150899086906001600160a01b038316906370a0823190602401602060405180830381865afa1580156117de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118029190614424565b6125d9565b604051632e1a7d4d60e01b8152600481018390527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561186957600080fd5b505af115801561187d573d6000803e3d6000fd5b50505050610b4f84836126f4565b80428110156118ac5760405162461bcd60e51b815260040161028c90614334565b6118c2858560008181106108cb576108cb614398565b60003490507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561192257600080fd5b505af1158015611936573d6000803e3d6000fd5b50505050507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663a9059cbb6119a17f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a2028489896000818110610fd857610fd8614398565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af11580156119ee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a12919061443d565b611a1e57611a1e61445a565b60008686611a2d600182614381565b818110611a3c57611a3c614398565b9050602002016020810190611a519190614229565b6040516370a0823160e01b81526001600160a01b03878116600483015291909116906370a0823190602401602060405180830381865afa158015611a99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611abd9190614424565b9050611afd87878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525089925061337d915050565b611196818888611b0e600182614381565b818110611b1d57611b1d614398565b9050602002016020810190611b329190614229565b6040516370a0823160e01b81526001600160a01b03898116600483015291909116906370a0823190602401602060405180830381865afa158015611b7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9e9190614424565b611ba89190614381565b89612ad7565b600080611bbd60005460ff1690565b15611bda5760405162461bcd60e51b815260040161028c90614470565b8242811015611bfb5760405162461bcd60e51b815260040161028c90614334565b6000611c287f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a202848c8c612b2b565b6040516323b872dd60e01b81529091506001600160a01b038216906323b872dd90611c5b90339085908e9060040161449a565b6020604051808303816000875af1158015611c7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c9e919061443d565b5060405163226bf2d160e21b81526001600160a01b03878116600483015260009182918416906389afcb449060240160408051808303816000875af1158015611ceb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d0f91906144be565b915091506000611d1f8e8e6138de565b509050806001600160a01b03168e6001600160a01b031614611d42578183611d45565b82825b9097509550611d54878c612ad7565b611d5e868b612ad7565b836001600160a01b03168d6001600160a01b03168f6001600160a01b03167f25fd06a669e99246a924fd8ed377847953a2e1d1db8d91245c9f200de51769538c8b8b604051611dcb939291906001600160a01b039390931683526020830191909152604082015260600190565b60405180910390a4505050505097509795505050505050565b6060610b877f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a2028484846128fb565b6000806000611e617f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a202848e7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2612b2b565b9050600087611e70578c611e74565b6000195b60405163d505accf60e01b81529091506001600160a01b0383169063d505accf90611eaf903390309086908f908e908e908e906004016143ae565b600060405180830381600087803b158015611ec957600080fd5b505af1158015611edd573d6000803e3d6000fd5b50505050611eef8e8e8e8e8e8e61077f565b909f909e509c50505050505050505050505050565b60008060008342811015611f2a5760405162461bcd60e51b815260040161028c90614334565b611f388c8c8c8c8c8c6139d2565b90945092506000611f6a7f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a202848e8e612b2b565b9050611f788d338388612c04565b611f848c338387612c04565b6040516335313c2160e11b81526001600160a01b038881166004830152821690636a627842906024016020604051808303816000875af1158015611fcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ff09190614424565b92505050985098509895505050505050565b6000546001600160a01b036101009091041633146120325760405162461bcd60e51b815260040161028c906143ef565b6001600160a01b0381166120975760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161028c565b6120a0816137a8565b50565b600080600083428110156120c95760405162461bcd60e51b815260040161028c90614334565b6120f78a7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28b348c8c6139d2565b909450925060006121497f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a202848c7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2612b2b565b90506121578b338388612c04565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0856040518263ffffffff1660e01b81526004016000604051808303818588803b1580156121b257600080fd5b505af11580156121c6573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b038581166004830152602482018990527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216935063a9059cbb925060440190506020604051808303816000875af115801561223b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061225f919061443d565b61226b5761226b61445a565b6040516335313c2160e11b81526001600160a01b038881166004830152821690636a627842906024016020604051808303816000875af11580156122b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122d79190614424565b9250833411156122f4576122f4336122ef8634614381565b6126f4565b505096509650969350505050565b606081428110156123255760405162461bcd60e51b815260040161028c90614334565b61233b868660008181106108cb576108cb614398565b6123997f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a202848888888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061301592505050565b91506123bf826000815181106123b1576123b1614398565b602002602001015134613267565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db08360008151811061240157612401614398565b60200260200101516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561243457600080fd5b505af1158015612448573d6000803e3d6000fd5b50505050507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663a9059cbb6124b37f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a2028489896000818110610fd857610fd8614398565b846000815181106124c6576124c6614398565b60200260200101516040518363ffffffff1660e01b81526004016124ff9291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af115801561251e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612542919061443d565b61254e5761254e61445a565b61258d82878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250899250612d30915050565b816000815181106125a0576125a0614398565b60200260200101513411156115f3576115f333836000815181106125c6576125c6614398565b6020026020010151346122ef9190614381565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b179052915160009283929087169161263591906144e2565b6000604051808303816000865af19150503d8060008114612672576040519150601f19603f3d011682016040523d82523d6000602084013e612677565b606091505b50915091508180156126a15750805115806126a15750808060200190518101906126a1919061443d565b6126ed5760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604482015260640161028c565b5050505050565b604080516000808252602082019092526001600160a01b03841690839060405161271e91906144e2565b60006040518083038185875af1925050503d806000811461275b576040519150601f19603f3d011682016040523d82523d6000602084013e612760565b606091505b50509050806127bd5760405162461bcd60e51b815260206004820152602360248201527f5472616e7366657248656c7065723a204554485f5452414e534645525f46414960448201526213115160ea1b606482015260840161028c565b505050565b600084600081116127e55760405162461bcd60e51b815260040161028c9061451d565b84600081116128065760405162461bcd60e51b815260040161028c90614554565b84600081116128275760405162461bcd60e51b815260040161028c90614554565b6000612835866103e8614381565b61283f908a61458b565b9050600061284d888361458b565b905060008261285e8b6103e861458b565b61286891906145aa565b905061287481836145c2565b9b9a5050505050505050505050565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316816001600160a01b0316146120a05760405162461bcd60e51b81526020600482015260146024820152730a4deeae8cae47440d2dcecc2d8d2c840e0c2e8d60631b604482015260640161028c565b6060816002815110156129505760405162461bcd60e51b815260206004820152601a60248201527f48656c69784c6962726172793a20696e76616c69642070617468000000000000604482015260640161028c565b825167ffffffffffffffff81111561296a5761296a613f4a565b604051908082528060200260200182016040528015612993578160200160208202803683370190505b50915083826000815181106129aa576129aa614398565b6020026020010181815250506000600184516129c69190614381565b905060005b81811015612acd57600080612a1f898885815181106129ec576129ec614398565b602002602001015189866001612a0291906145aa565b81518110612a1257612a12614398565b6020026020010151613c59565b91509150612a90868481518110612a3857612a38614398565b60200260200101518383612a8b8d8c8981518110612a5857612a58614398565b60200260200101518d8a6001612a6e91906145aa565b81518110612a7e57612a7e614398565b6020026020010151613d23565b6127c2565b86612a9c8560016145aa565b81518110612aac57612aac614398565b60200260200101818152505050508080612ac5906145e4565b9150506129cb565b5050509392505050565b80821015612b275760405162461bcd60e51b815260206004820152601b60248201527f526f757465723a20696e73756666696369656e7420616d6f756e740000000000604482015260640161028c565b5050565b6000806000612b3a85856138de565b6040516bffffffffffffffffffffffff19606084811b8216602084015283901b1660348201529193509150869060480160405160208183030381529060405280519060200120604051602001612be29291906001600160f81b0319815260609290921b6bffffffffffffffffffffffff1916600183015260158201527fdf06dacc3c0f420f3e881baed6af2087e5ab8bc910d926f439c1081ec11fc885603582015260550190565b60408051601f1981840301815291905280516020909101209695505050505050565b600080856001600160a01b03166323b872dd868686604051602401612c2b9392919061449a565b6040516020818303038152906040529060e01b6020820180516001600160e01b038381831617835250505050604051612c6491906144e2565b6000604051808303816000865af19150503d8060008114612ca1576040519150601f19603f3d011682016040523d82523d6000602084013e612ca6565b606091505b5091509150818015612cd0575080511580612cd0575080806020019051810190612cd0919061443d565b612d285760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f46416044820152631253115160e21b606482015260840161028c565b505050505050565b60005460ff1615612d535760405162461bcd60e51b815260040161028c90614470565b600060018351612d639190614381565b905060005b81811015612fb057600080858381518110612d8557612d85614398565b602002602001015186846001612d9b91906145aa565b81518110612dab57612dab614398565b6020026020010151915091506000612dc383836138de565b509050600088612dd48660016145aa565b81518110612de457612de4614398565b60200260200101519050600080836001600160a01b0316866001600160a01b031614612e1257826000612e16565b6000835b91509150600060028b51612e2a9190614381565b8810612e365789612e84565b612e847f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a20284878d612e678c60026145aa565b81518110612e7757612e77614398565b6020026020010151612b2b565b9050612eb17f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a202848888612b2b565b6040516336cd320560e11b815260048101859052602481018490526001600160a01b0383811660448301529190911690636d9a640a90606401600060405180830381600087803b158015612f0457600080fd5b505af1158015612f18573d6000803e3d6000fd5b50506001546001600160a01b0316159150612f96905057600154604051630df791e560e41b81526001600160a01b039091169063df791e5090612f639033908a90899060040161449a565b600060405180830381600087803b158015612f7d57600080fd5b505af1158015612f91573d6000803e3d6000fd5b505050505b505050505050508080612fa8906145e4565b915050612d68565b50816001600160a01b031683604051612fc991906145ff565b604051809103902085604051612fdf919061463e565b604051908190038120907f8f43ab3cb378db622a7074b85f11cc9e2defa4d31d1f5a48f435fbc0a1b1c1e490600090a450505050565b60608160028151101561306a5760405162461bcd60e51b815260206004820152601a60248201527f48656c69784c6962726172793a20696e76616c69642070617468000000000000604482015260640161028c565b825167ffffffffffffffff81111561308457613084613f4a565b6040519080825280602002602001820160405280156130ad578160200160208202803683370190505b5091508382600184516130c09190614381565b815181106130d0576130d0614398565b6020026020010181815250506000600184516130ec9190614381565b9050805b8015612acd576000806131338988613109600187614381565b8151811061311957613119614398565b6020026020010151898681518110612a1257612a12614398565b9150915061319786848151811061314c5761314c614398565b602002602001015183836131928d8c60018a6131689190614381565b8151811061317857613178614398565b60200260200101518d8a81518110612a7e57612a7e614398565b6132b7565b866131a3600186614381565b815181106131b3576131b3614398565b602002602001018181525050505080806131cc90614668565b9150506130f0565b60005460ff1661321d5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161028c565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b80821115612b275760405162461bcd60e51b815260206004820152601860248201527f526f757465723a2065786365737369766520616d6f756e740000000000000000604482015260640161028c565b600084600081116132da5760405162461bcd60e51b815260040161028c9061451d565b84600081116132fb5760405162461bcd60e51b815260040161028c90614554565b846000811161331c5760405162461bcd60e51b815260040161028c90614554565b6000613328898961458b565b613334906103e861458b565b90506000613344876103e8614381565b61334e8b8a614381565b613358919061458b565b905061336481836145c2565b61336f9060016145aa565b9a9950505050505050505050565b60005460ff16156133a05760405162461bcd60e51b815260040161028c90614470565b6000600183516133b09190614381565b905060005b8181101561375a576000808583815181106133d2576133d2614398565b6020026020010151868460016133e891906145aa565b815181106133f8576133f8614398565b602002602001015191509150600061341083836138de565b50905060006134407f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a202848585612b2b565b9050600080600080846001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015613486573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134aa91906146aa565b506001600160701b031691506001600160701b03169150600080876001600160a01b03168a6001600160a01b0316146134e45782846134e7565b83835b6040516370a0823160e01b81526001600160a01b038a8116600483015292945090925083918c16906370a0823190602401602060405180830381865afa158015613535573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135599190614424565b6135639190614381565b95506135d88683838a6001600160a01b03166354cf2aeb6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156135a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135cd91906146ed565b63ffffffff166127c2565b945050505050600080856001600160a01b0316886001600160a01b03161461360257826000613606565b6000835b91509150600060028d5161361a9190614381565b8a10613626578b613657565b6136577f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a20284898f612e678e60026145aa565b6040516336cd320560e11b815260048101859052602481018490526001600160a01b03808316604483015291925090871690636d9a640a90606401600060405180830381600087803b1580156136ac57600080fd5b505af11580156136c0573d6000803e3d6000fd5b50506001546001600160a01b031615915061373e905057600154604051630df791e560e41b81526001600160a01b039091169063df791e509061370b9033908c90899060040161449a565b600060405180830381600087803b15801561372557600080fd5b505af1158015613739573d6000803e3d6000fd5b505050505b5050505050505050508080613752906145e4565b9150506133b5565b50816001600160a01b03168360405161377391906145ff565b604051908190038120907f656a8c71622603d968e0862dba3427a1669e4839e2ae2ecb8ecd81794592e9b990600090a3505050565b600080546001600160a01b03838116610100818102610100600160a81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60005460ff16156138245760405162461bcd60e51b815260040161028c90614470565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861324a3390565b6000836000811161387c5760405162461bcd60e51b815260040161028c9061451d565b836000811161389d5760405162461bcd60e51b815260040161028c90614554565b83600081116138be5760405162461bcd60e51b815260040161028c90614554565b856138c9868961458b565b6138d391906145c2565b979650505050505050565b600080826001600160a01b0316846001600160a01b0316141561394d5760405162461bcd60e51b815260206004820152602160248201527f48656c69784c6962726172793a206964656e746963616c2061646472657373656044820152607360f81b606482015260840161028c565b826001600160a01b0316846001600160a01b03161061396d578284613970565b83835b90925090506001600160a01b0382166139cb5760405162461bcd60e51b815260206004820152601a60248201527f48656c69784c6962726172793a207a65726f2061646472657373000000000000604482015260640161028c565b9250929050565b6000806139e160005460ff1690565b156139fe5760405162461bcd60e51b815260040161028c90614470565b60405163e6a4390560e01b81526001600160a01b03898116600483015288811660248301526000917f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a202849091169063e6a4390590604401602060405180830381865afa158015613a71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a959190614708565b6001600160a01b03161415613b3a576040516364e329cb60e11b81526001600160a01b03898116600483015288811660248301527f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a20284169063c9c65396906044016020604051808303816000875af1158015613b14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b389190614708565b505b600080613b687f0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a202848b8b613c59565b91509150816000148015613b7a575080155b15613b8a57879350869250613be6565b6000613b97898484613859565b9050878111613bb557613baa8187612ad7565b889450925082613be4565b6000613bc2898486613859565b905089811115613bd457613bd461445a565b613bde8189612ad7565b94508793505b505b6040805185815260208101859052908101899052606081018890526080810187905260a081018690526001600160a01b03808b1691908c16907f746bdd62bec95d9a4d5dc284b09b3cd18e7f5f5426535b7ba2b13a418da1cdf79060c00160405180910390a35050965096945050505050565b6000806000613c6885856138de565b509050600080613c79888888612b2b565b6001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015613cb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cda91906146aa565b506001600160701b031691506001600160701b03169150826001600160a01b0316876001600160a01b031614613d11578082613d14565b81815b90999098509650505050505050565b6000613d30848484612b2b565b6001600160a01b03166354cf2aeb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613d6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d9191906146ed565b63ffffffff16949350505050565b6001600160a01b03811681146120a057600080fd5b8035613dbf81613d9f565b919050565b60008060008060008060c08789031215613ddd57600080fd5b8635613de881613d9f565b95506020870135945060408701359350606087013592506080870135613e0d81613d9f565b8092505060a087013590509295509295509295565b600080600060608486031215613e3757600080fd5b505081359360208301359350604090920135919050565b60008083601f840112613e6057600080fd5b50813567ffffffffffffffff811115613e7857600080fd5b6020830191508360208260051b85010111156139cb57600080fd5b60008060008060008060a08789031215613eac57600080fd5b8635955060208701359450604087013567ffffffffffffffff811115613ed157600080fd5b613edd89828a01613e4e565b9095509350506060870135613ef181613d9f565b80925050608087013590509295509295509295565b6020808252825182820181905260009190848201906040850190845b81811015613f3e57835183529284019291840191600101613f22565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215613f7357600080fd5b8235915060208084013567ffffffffffffffff80821115613f9357600080fd5b818601915086601f830112613fa757600080fd5b813581811115613fb957613fb9613f4a565b8060051b604051601f19603f83011681018181108582111715613fde57613fde613f4a565b604052918252848201925083810185019189831115613ffc57600080fd5b938501935b828510156140215761401285613db4565b84529385019392850192614001565b8096505050505050509250929050565b80151581146120a057600080fd5b803560ff81168114613dbf57600080fd5b60008060008060008060008060008060006101608c8e03121561407257600080fd5b8b3561407d81613d9f565b9a5060208c013561408d81613d9f565b995060408c0135985060608c0135975060808c0135965060a08c01356140b281613d9f565b955060c08c0135945060e08c01356140c981614031565b93506140d86101008d0161403f565b92506101208c013591506101408c013590509295989b509295989b9093969950565b6000806000806080858703121561411057600080fd5b5050823594602084013594506040840135936060013592509050565b6000806000806000806000806000806101408b8d03121561414c57600080fd5b8a3561415781613d9f565b995060208b0135985060408b0135975060608b0135965060808b013561417c81613d9f565b955060a08b0135945060c08b013561419381614031565b93506141a160e08c0161403f565b92506101008b013591506101208b013590509295989b9194979a5092959850565b6000806000806000608086880312156141da57600080fd5b85359450602086013567ffffffffffffffff8111156141f857600080fd5b61420488828901613e4e565b909550935050604086013561421881613d9f565b949793965091946060013592915050565b60006020828403121561423b57600080fd5b8135610b8781613d9f565b600080600080600080600060e0888a03121561426157600080fd5b873561426c81613d9f565b9650602088013561427c81613d9f565b955060408801359450606088013593506080880135925060a08801356142a181613d9f565b8092505060c0880135905092959891949750929550565b600080600080600080600080610100898b0312156142d557600080fd5b88356142e081613d9f565b975060208901356142f081613d9f565b965060408901359550606089013594506080890135935060a0890135925060c089013561431c81613d9f565b8092505060e089013590509295985092959890939650565b60208082526018908201527f526f757465723a20696e76616c696420646561646c696e650000000000000000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000828210156143935761439361436b565b500390565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b0397881681529590961660208601526040850193909352606084019190915260ff16608083015260a082015260c081019190915260e00190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561443657600080fd5b5051919050565b60006020828403121561444f57600080fd5b8151610b8781614031565b634e487b7160e01b600052600160045260246000fd5b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600080604083850312156144d157600080fd5b505080516020909101519092909150565b6000825160005b8181101561450357602081860181015185830152016144e9565b81811115614512576000828501525b509190910192915050565b60208082526019908201527f48656c69784c6962726172793a207a65726f20616d6f756e7400000000000000604082015260600190565b6020808252601c908201527f48656c69784c6962726172793a207a65726f206c697175696469747900000000604082015260600190565b60008160001904831182151516156145a5576145a561436b565b500290565b600082198211156145bd576145bd61436b565b500190565b6000826145df57634e487b7160e01b600052601260045260246000fd5b500490565b60006000198214156145f8576145f861436b565b5060010190565b815160009082906020808601845b838110156146325781516001600160a01b03168552938201939082019060010161460d565b50929695505050505050565b815160009082906020808601845b838110156146325781518552938201939082019060010161464c565b6000816146775761467761436b565b506000190190565b80516001600160701b0381168114613dbf57600080fd5b805163ffffffff81168114613dbf57600080fd5b6000806000606084860312156146bf57600080fd5b6146c88461467f565b92506146d66020850161467f565b91506146e460408501614696565b90509250925092565b6000602082840312156146ff57600080fd5b610b8782614696565b60006020828403121561471a57600080fd5b8151610b8781613d9f56fea2646970667358221220205289e2a7f47b20d55b92d00026ccd347d5e368f4b0502ce8221db895242e6d64736f6c634300080a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a20284000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
-----Decoded View---------------
Arg [0] : factory_ (address): 0x8891Dd75ED91Fe531BC065882B579fFAE9a20284
Arg [1] : WETH_ (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000008891dd75ed91fe531bc065882b579ffae9a20284
Arg [1] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.