Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 1,960 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Swap Once | 20125851 | 157 days ago | IN | 0 ETH | 0.00272256 | ||||
Swap Once | 20110779 | 159 days ago | IN | 0 ETH | 0.00101248 | ||||
Swap Once | 20110350 | 159 days ago | IN | 0 ETH | 0.00086874 | ||||
Swap Once | 20110342 | 159 days ago | IN | 0.14572864 ETH | 0.00068516 | ||||
Swap Once | 20110333 | 159 days ago | IN | 0 ETH | 0.00062134 | ||||
Swap Once | 20110235 | 159 days ago | IN | 0.03115577 ETH | 0.00078459 | ||||
Swap Once | 20109918 | 159 days ago | IN | 20.10050251 ETH | 0.00057106 | ||||
Swap Once | 20107629 | 159 days ago | IN | 0.01396984 ETH | 0.00078365 | ||||
Swap Once | 20106576 | 159 days ago | IN | 0 ETH | 0.0008736 | ||||
Swap Once | 20106357 | 160 days ago | IN | 0 ETH | 0.00101401 | ||||
Swap Once | 20106139 | 160 days ago | IN | 0 ETH | 0.00074886 | ||||
Swap Once | 20105648 | 160 days ago | IN | 0.01809045 ETH | 0.0008409 | ||||
Swap Once | 20105019 | 160 days ago | IN | 0.60301507 ETH | 0.00078865 | ||||
Swap Once | 20105013 | 160 days ago | IN | 0.50251256 ETH | 0.00077414 | ||||
Swap Once | 20102731 | 160 days ago | IN | 0.01708542 ETH | 0.00071113 | ||||
Swap Once | 20102180 | 160 days ago | IN | 0 ETH | 0.00063215 | ||||
Swap Once | 20100510 | 160 days ago | IN | 0 ETH | 0.00110994 | ||||
Swap Once | 20100430 | 160 days ago | IN | 0.27947632 ETH | 0.00102679 | ||||
Swap Once | 20100192 | 160 days ago | IN | 0.28743718 ETH | 0.00059612 | ||||
Swap Once | 20099879 | 160 days ago | IN | 0.14070351 ETH | 0.00071477 | ||||
Swap Once | 20099855 | 160 days ago | IN | 0.03015075 ETH | 0.00064976 | ||||
Swap Once | 20099757 | 160 days ago | IN | 0.08040201 ETH | 0.0006771 | ||||
Swap Once | 20099264 | 161 days ago | IN | 5.15864375 ETH | 0.00061089 | ||||
Swap Once | 20099256 | 161 days ago | IN | 0 ETH | 0.00084726 | ||||
Swap Once | 20099052 | 161 days ago | IN | 0.73366834 ETH | 0.00075501 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
20125851 | 157 days ago | 0.05558176 ETH | ||||
20125851 | 157 days ago | 0.05558176 ETH | ||||
20110779 | 159 days ago | 18.20410495 ETH | ||||
20110779 | 159 days ago | 18.20410495 ETH | ||||
20110350 | 159 days ago | 0.46855085 ETH | ||||
20110350 | 159 days ago | 0.46855085 ETH | ||||
20110342 | 159 days ago | 0.14572864 ETH | ||||
20110333 | 159 days ago | 0.09441983 ETH | ||||
20110333 | 159 days ago | 0.09441983 ETH | ||||
20110235 | 159 days ago | 0.03115577 ETH | ||||
20109918 | 159 days ago | 20.10050251 ETH | ||||
20107629 | 159 days ago | 0.01396984 ETH | ||||
20106576 | 159 days ago | 0.70957061 ETH | ||||
20106576 | 159 days ago | 0.70957061 ETH | ||||
20106357 | 160 days ago | 0.1467844 ETH | ||||
20106357 | 160 days ago | 0.1467844 ETH | ||||
20106139 | 160 days ago | 0.25070893 ETH | ||||
20106139 | 160 days ago | 0.25070893 ETH | ||||
20105648 | 160 days ago | 0.01809045 ETH | ||||
20105019 | 160 days ago | 0.60301507 ETH | ||||
20105013 | 160 days ago | 0.50251256 ETH | ||||
20102731 | 160 days ago | 0.01708542 ETH | ||||
20102180 | 160 days ago | 0.14201052 ETH | ||||
20102180 | 160 days ago | 0.14201052 ETH | ||||
20100510 | 160 days ago | 0.13314122 ETH |
Loading...
Loading
Contract Name:
OfficialSameChainSwap
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
No with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity =0.8.20; import "@openzeppelin/contracts/access/Ownable.sol"; import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol"; import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; interface IV3SwapRouter { struct ExactInputSingleParams { address tokenIn; address tokenOut; uint24 fee; address recipient; uint256 amountIn; uint256 amountOutMinimum; uint160 sqrtPriceLimitX96; } function exactInputSingle( ExactInputSingleParams calldata params ) external payable returns (uint256 amountOut); struct ExactInputParams { bytes path; address recipient; uint256 amountIn; uint256 amountOutMinimum; } function exactInput( ExactInputParams calldata params ) external payable returns (uint256 amountOut); struct ExactOutputSingleParams { address tokenIn; address tokenOut; uint24 fee; address recipient; uint256 amountOut; uint256 amountInMaximum; uint160 sqrtPriceLimitX96; } function exactOutputSingle( ExactOutputSingleParams calldata params ) external payable returns (uint256 amountIn); struct ExactOutputParams { bytes path; address recipient; uint256 amountOut; uint256 amountInMaximum; } function exactOutput( ExactOutputParams calldata params ) external payable returns (uint256 amountIn); function uniswapV3SwapCallback( int256 amount0Delta, int256 amount1Delta, bytes calldata data ) external; function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to ) external payable returns (uint256 amountOut); function swapTokensForExactTokens( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to ) external payable returns (uint256 amountIn); function WETH9() external view returns (address); } interface IUniswapV2Router02 { function WETH() external pure returns (address); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); } interface IWETH is IERC20 { function deposit() external payable; function withdraw(uint amount) external; } contract OfficialSameChainSwap is Ownable, ReentrancyGuard { using SafeERC20 for IERC20; mapping(address => bool) public feeTokens; uint256 public platformFee; // Fee must be by 1000, so if you want 5% this will be 5000 address public feeReceiver; uint256 public constant feeBps = 1000; // 1000 is 1% so we can have many decimals IUniswapV2Router02 public v2Router; IV3SwapRouter public v3Router; address public wethToken; //////////================= Events ==================================================== event SwapExecuted( address indexed tokenIn, address indexed tokenOut, uint amountIn, uint amountOut ); event FeeReceiverSet( address indexed _oldReceiver, address indexed _newReceiver ); event Fee( address indexed user, uint256 amount, address indexed token ); constructor( uint256 _fee, address _feeReceiver, address _v3Router, address _v2Router, address _weth ) Ownable(msg.sender) { platformFee = _fee; feeReceiver = _feeReceiver; v3Router = IV3SwapRouter(_v3Router); v2Router = IUniswapV2Router02(_v2Router); wethToken = _weth; } function changeFeeData(uint256 _fee, address _feeReceiver) external onlyOwner { address oldReceiver = feeReceiver; platformFee = _fee; feeReceiver = _feeReceiver; emit FeeReceiverSet(oldReceiver, _feeReceiver); } function swapOnce( address _tokenA, address _tokenB, bool _unwrappETH, uint256 _amountIn, uint256 _minAmountOutV2, uint256 _minAmountOutV3, uint8 _buyOneTwoOrThree, // 1 means buy only v2, 2 means buy v3 only, 3 means buy first v2 then v3, 4 means buy first v3 then v2 address[] memory _pathV2, bytes memory _pathV3, bool isWethIn ) public payable nonReentrant { // ETH -> Token if (!isWethIn && _tokenA == wethToken) { IWETH(wethToken).deposit{value: msg.value}(); } else { uint256 beforeTransfer = IERC20(_tokenA).balanceOf(address(this)); IERC20(_tokenA).safeTransferFrom(msg.sender, address(this), _amountIn); uint256 afterTransfer = IERC20(_tokenA).balanceOf(address(this)); _amountIn = afterTransfer - beforeTransfer; } address feeToken = identifyFeeToken(_tokenA, _tokenB); uint256 amountIn = (msg.value > 0 ? msg.value : _amountIn); uint256 amountToSwap = amountIn; if (feeToken == _tokenA || feeToken == address(0)) { amountToSwap = deductFees(amountIn, _tokenA); } uint256 output; if (_buyOneTwoOrThree == 1) { output = v2Swap(_pathV2, amountToSwap, _minAmountOutV2); } else if (_buyOneTwoOrThree == 2) { output = v3Swap(_tokenA, _pathV3, amountToSwap, _minAmountOutV3); } else if (_buyOneTwoOrThree == 3) { output = v2Swap(_pathV2, amountToSwap, _minAmountOutV2); output = v3Swap(_pathV2[_pathV2.length - 1], _pathV3, output, _minAmountOutV3); } else if (_buyOneTwoOrThree == 4) { output = v3Swap(_tokenA, _pathV3, amountToSwap, _minAmountOutV3); output = v2Swap(_pathV2, output, _minAmountOutV2); } if (feeToken == _tokenB) { output = deductFees(output, _tokenB); } if (_unwrappETH) { IWETH(wethToken).withdraw(output); payable(msg.sender).transfer(output); } else { IERC20(_tokenB).safeTransfer(msg.sender, output); } emit SwapExecuted(_tokenA, _tokenB, _amountIn, output); } function deductFees(uint _amount, address _token) internal returns(uint amountToSwap) { uint feeAmount = _amount * platformFee / (feeBps * 100); amountToSwap = _amount - feeAmount; IERC20(_token).safeTransfer(feeReceiver, feeAmount); emit Fee(msg.sender, feeAmount, _token); } function identifyFeeToken(address _tokenA, address _tokenB) internal view returns (address) { if (feeTokens[_tokenA]) { return _tokenA; } else if (feeTokens[_tokenB]) { return _tokenB; } return address(0); } function checkAndApproveAll(address _token, address _target, uint256 _amountToCheck) internal { if (IERC20(_token).allowance(address(this), _target) < _amountToCheck) { IERC20(_token).forceApprove(_target, 0); IERC20(_token).forceApprove(_target, ~uint256(0)); } } function v2Swap( address[] memory _path, uint256 _amountIn, uint256 _minAmountOut // Slippage in base of 1000 meaning 10 is 1% and 1 is 0.1% where 1000 is 1 ) internal returns (uint256) { address tokenOut = _path[_path.length - 1]; checkAndApproveAll(_path[0], address(v2Router), _amountIn); uint256 initial = IERC20(tokenOut).balanceOf(address(this)); v2Router.swapExactTokensForTokensSupportingFeeOnTransferTokens( _amountIn, _minAmountOut, _path, address(this), block.timestamp * 5 minutes ); uint256 finalAmount = IERC20(tokenOut).balanceOf(address(this)); return finalAmount - initial; } function v3Swap( address _tokenIn, bytes memory _path, uint256 _amountIn, uint256 _minAmountOut ) internal returns (uint256 amountOutput) { checkAndApproveAll(_tokenIn, address(v3Router), _amountIn); IV3SwapRouter.ExactInputParams memory params = IV3SwapRouter.ExactInputParams( _path, address(this), _amountIn, _minAmountOut ); amountOutput = v3Router.exactInput( params ); } function recoverStuckETH(address payable _beneficiary) public onlyOwner { _beneficiary.transfer(address(this).balance); } function recoverStuckTokens(address _token) external onlyOwner { uint256 amount = IERC20(_token).balanceOf(address(this)); IERC20(_token).safeTransfer(owner(), amount); } function addFeeToken(address _token) external onlyOwner { require(_token != address(0), "Invalid token address"); feeTokens[_token] = true; } function removeFeeToken(address _token) external onlyOwner { require(_token != address(0), "Invalid token address"); feeTokens[_token] = false; } receive() external payable {} fallback() external payable {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../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. * * The initial owner is set to the address provided by the deployer. 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; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * ==== Security Considerations * * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be * considered as an intention to spend the allowance in any specific way. The second is that because permits have * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be * generally recommended is: * * ```solidity * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} * doThing(..., value); * } * * function doThing(..., uint256 value) public { * token.safeTransferFrom(msg.sender, address(this), value); * ... * } * ``` * * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also * {SafeERC20-safeTransferFrom}). * * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so * contracts should have entry points that don't rely on permit. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. * * CAUTION: See Security Considerations above. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; import {IERC20Permit} from "../extensions/IERC20Permit.sol"; import {Address} from "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; /** * @dev An operation with an ERC20 token failed. */ error SafeERC20FailedOperation(address token); /** * @dev Indicates a failed `decreaseAllowance` request. */ error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease); /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value))); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value))); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); forceApprove(token, spender, oldAllowance + value); } /** * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no * value, non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal { unchecked { uint256 currentAllowance = token.allowance(address(this), spender); if (currentAllowance < requestedDecrease) { revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease); } forceApprove(token, spender, currentAllowance - requestedDecrease); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value)); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0))); _callOptionalReturn(token, approvalCall); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data); if (returndata.length != 0 && !abi.decode(returndata, (bool))) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol) pragma solidity ^0.8.20; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error AddressInsufficientBalance(address account); /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedInnerCall(); /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert AddressInsufficientBalance(address(this)); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert FailedInnerCall(); } } /** * @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 or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {FailedInnerCall} error. * * 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. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @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`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert AddressInsufficientBalance(address(this)); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an * unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {FailedInnerCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}. */ function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert FailedInnerCall(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title The interface for the Uniswap V3 Factory /// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees interface IUniswapV3Factory { /// @notice Emitted when the owner of the factory is changed /// @param oldOwner The owner before the owner was changed /// @param newOwner The owner after the owner was changed event OwnerChanged(address indexed oldOwner, address indexed newOwner); /// @notice Emitted when a pool is created /// @param token0 The first token of the pool by address sort order /// @param token1 The second token of the pool by address sort order /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip /// @param tickSpacing The minimum number of ticks between initialized ticks /// @param pool The address of the created pool event PoolCreated( address indexed token0, address indexed token1, uint24 indexed fee, int24 tickSpacing, address pool ); /// @notice Emitted when a new fee amount is enabled for pool creation via the factory /// @param fee The enabled fee, denominated in hundredths of a bip /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing); /// @notice Returns the current owner of the factory /// @dev Can be changed by the current owner via setOwner /// @return The address of the factory owner function owner() external view returns (address); /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee /// @return The tick spacing function feeAmountTickSpacing(uint24 fee) external view returns (int24); /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order /// @param tokenA The contract address of either token0 or token1 /// @param tokenB The contract address of the other token /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip /// @return pool The pool address function getPool( address tokenA, address tokenB, uint24 fee ) external view returns (address pool); /// @notice Creates a pool for the given two tokens and fee /// @param tokenA One of the two tokens in the desired pool /// @param tokenB The other of the two tokens in the desired pool /// @param fee The desired fee for the pool /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments /// are invalid. /// @return pool The address of the newly created pool function createPool( address tokenA, address tokenB, uint24 fee ) external returns (address pool); /// @notice Updates the owner of the factory /// @dev Must be called by the current owner /// @param _owner The new owner of the factory function setOwner(address _owner) external; /// @notice Enables a fee amount with the given tickSpacing /// @dev Fee amounts may never be removed once enabled /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6) /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount function enableFeeAmount(uint24 fee, int24 tickSpacing) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; import './pool/IUniswapV3PoolImmutables.sol'; import './pool/IUniswapV3PoolState.sol'; import './pool/IUniswapV3PoolDerivedState.sol'; import './pool/IUniswapV3PoolActions.sol'; import './pool/IUniswapV3PoolOwnerActions.sol'; import './pool/IUniswapV3PoolEvents.sol'; /// @title The interface for a Uniswap V3 Pool /// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform /// to the ERC20 specification /// @dev The pool interface is broken up into many smaller pieces interface IUniswapV3Pool is IUniswapV3PoolImmutables, IUniswapV3PoolState, IUniswapV3PoolDerivedState, IUniswapV3PoolActions, IUniswapV3PoolOwnerActions, IUniswapV3PoolEvents { }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Permissionless pool actions /// @notice Contains pool methods that can be called by anyone interface IUniswapV3PoolActions { /// @notice Sets the initial price for the pool /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96 function initialize(uint160 sqrtPriceX96) external; /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends /// on tickLower, tickUpper, the amount of liquidity, and the current price. /// @param recipient The address for which the liquidity will be created /// @param tickLower The lower tick of the position in which to add liquidity /// @param tickUpper The upper tick of the position in which to add liquidity /// @param amount The amount of liquidity to mint /// @param data Any data that should be passed through to the callback /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback function mint( address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes calldata data ) external returns (uint256 amount0, uint256 amount1); /// @notice Collects tokens owed to a position /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity. /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity. /// @param recipient The address which should receive the fees collected /// @param tickLower The lower tick of the position for which to collect fees /// @param tickUpper The upper tick of the position for which to collect fees /// @param amount0Requested How much token0 should be withdrawn from the fees owed /// @param amount1Requested How much token1 should be withdrawn from the fees owed /// @return amount0 The amount of fees collected in token0 /// @return amount1 The amount of fees collected in token1 function collect( address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested ) external returns (uint128 amount0, uint128 amount1); /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0 /// @dev Fees must be collected separately via a call to #collect /// @param tickLower The lower tick of the position for which to burn liquidity /// @param tickUpper The upper tick of the position for which to burn liquidity /// @param amount How much liquidity to burn /// @return amount0 The amount of token0 sent to the recipient /// @return amount1 The amount of token1 sent to the recipient function burn( int24 tickLower, int24 tickUpper, uint128 amount ) external returns (uint256 amount0, uint256 amount1); /// @notice Swap token0 for token1, or token1 for token0 /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback /// @param recipient The address to receive the output of the swap /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0 /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative) /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this /// value after the swap. If one for zero, the price cannot be greater than this value after the swap /// @param data Any data to be passed through to the callback /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive function swap( address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes calldata data ) external returns (int256 amount0, int256 amount1); /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling /// with 0 amount{0,1} and sending the donation amount(s) from the callback /// @param recipient The address which will receive the token0 and token1 amounts /// @param amount0 The amount of token0 to send /// @param amount1 The amount of token1 to send /// @param data Any data to be passed through to the callback function flash( address recipient, uint256 amount0, uint256 amount1, bytes calldata data ) external; /// @notice Increase the maximum number of price and liquidity observations that this pool will store /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to /// the input observationCardinalityNext. /// @param observationCardinalityNext The desired minimum number of observations for the pool to store function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Pool state that is not stored /// @notice Contains view functions to provide information about the pool that is computed rather than stored on the /// blockchain. The functions here may have variable gas costs. interface IUniswapV3PoolDerivedState { /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick, /// you must call it with secondsAgos = [3600, 0]. /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio. /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block /// timestamp function observe(uint32[] calldata secondsAgos) external view returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s); /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed. /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first /// snapshot is taken and the second snapshot is taken. /// @param tickLower The lower tick of the range /// @param tickUpper The upper tick of the range /// @return tickCumulativeInside The snapshot of the tick accumulator for the range /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range /// @return secondsInside The snapshot of seconds per liquidity for the range function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) external view returns ( int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside ); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Events emitted by a pool /// @notice Contains all events emitted by the pool interface IUniswapV3PoolEvents { /// @notice Emitted exactly once by a pool when #initialize is first called on the pool /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96 /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool event Initialize(uint160 sqrtPriceX96, int24 tick); /// @notice Emitted when liquidity is minted for a given position /// @param sender The address that minted the liquidity /// @param owner The owner of the position and recipient of any minted liquidity /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount The amount of liquidity minted to the position range /// @param amount0 How much token0 was required for the minted liquidity /// @param amount1 How much token1 was required for the minted liquidity event Mint( address sender, address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1 ); /// @notice Emitted when fees are collected by the owner of a position /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees /// @param owner The owner of the position for which fees are collected /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount0 The amount of token0 fees collected /// @param amount1 The amount of token1 fees collected event Collect( address indexed owner, address recipient, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount0, uint128 amount1 ); /// @notice Emitted when a position's liquidity is removed /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect /// @param owner The owner of the position for which liquidity is removed /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount The amount of liquidity to remove /// @param amount0 The amount of token0 withdrawn /// @param amount1 The amount of token1 withdrawn event Burn( address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1 ); /// @notice Emitted by the pool for any swaps between token0 and token1 /// @param sender The address that initiated the swap call, and that received the callback /// @param recipient The address that received the output of the swap /// @param amount0 The delta of the token0 balance of the pool /// @param amount1 The delta of the token1 balance of the pool /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96 /// @param liquidity The liquidity of the pool after the swap /// @param tick The log base 1.0001 of price of the pool after the swap event Swap( address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick ); /// @notice Emitted by the pool for any flashes of token0/token1 /// @param sender The address that initiated the swap call, and that received the callback /// @param recipient The address that received the tokens from flash /// @param amount0 The amount of token0 that was flashed /// @param amount1 The amount of token1 that was flashed /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee event Flash( address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1 ); /// @notice Emitted by the pool for increases to the number of observations that can be stored /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index /// just before a mint/swap/burn. /// @param observationCardinalityNextOld The previous value of the next observation cardinality /// @param observationCardinalityNextNew The updated value of the next observation cardinality event IncreaseObservationCardinalityNext( uint16 observationCardinalityNextOld, uint16 observationCardinalityNextNew ); /// @notice Emitted when the protocol fee is changed by the pool /// @param feeProtocol0Old The previous value of the token0 protocol fee /// @param feeProtocol1Old The previous value of the token1 protocol fee /// @param feeProtocol0New The updated value of the token0 protocol fee /// @param feeProtocol1New The updated value of the token1 protocol fee event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New); /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner /// @param sender The address that collects the protocol fees /// @param recipient The address that receives the collected protocol fees /// @param amount0 The amount of token0 protocol fees that is withdrawn /// @param amount0 The amount of token1 protocol fees that is withdrawn event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Pool state that never changes /// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values interface IUniswapV3PoolImmutables { /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface /// @return The contract address function factory() external view returns (address); /// @notice The first of the two tokens of the pool, sorted by address /// @return The token contract address function token0() external view returns (address); /// @notice The second of the two tokens of the pool, sorted by address /// @return The token contract address function token1() external view returns (address); /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6 /// @return The fee function fee() external view returns (uint24); /// @notice The pool tick spacing /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ... /// This value is an int24 to avoid casting even though it is always positive. /// @return The tick spacing function tickSpacing() external view returns (int24); /// @notice The maximum amount of position liquidity that can use any tick in the range /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool /// @return The max amount of liquidity per tick function maxLiquidityPerTick() external view returns (uint128); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Permissioned pool actions /// @notice Contains pool methods that may only be called by the factory owner interface IUniswapV3PoolOwnerActions { /// @notice Set the denominator of the protocol's % share of the fees /// @param feeProtocol0 new protocol fee for token0 of the pool /// @param feeProtocol1 new protocol fee for token1 of the pool function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external; /// @notice Collect the protocol fee accrued to the pool /// @param recipient The address to which collected protocol fees should be sent /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1 /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0 /// @return amount0 The protocol fee collected in token0 /// @return amount1 The protocol fee collected in token1 function collectProtocol( address recipient, uint128 amount0Requested, uint128 amount1Requested ) external returns (uint128 amount0, uint128 amount1); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Pool state that can change /// @notice These methods compose the pool's state, and can change with any frequency including multiple times /// per transaction interface IUniswapV3PoolState { /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas /// when accessed externally. /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value /// tick The current tick of the pool, i.e. according to the last tick transition that was run. /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick /// boundary. /// observationIndex The index of the last oracle observation that was written, /// observationCardinality The current maximum number of observations stored in the pool, /// observationCardinalityNext The next maximum number of observations, to be updated when the observation. /// feeProtocol The protocol fee for both tokens of the pool. /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0 /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee. /// unlocked Whether the pool is currently locked to reentrancy function slot0() external view returns ( uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked ); /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool /// @dev This value can overflow the uint256 function feeGrowthGlobal0X128() external view returns (uint256); /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool /// @dev This value can overflow the uint256 function feeGrowthGlobal1X128() external view returns (uint256); /// @notice The amounts of token0 and token1 that are owed to the protocol /// @dev Protocol fees will never exceed uint128 max in either token function protocolFees() external view returns (uint128 token0, uint128 token1); /// @notice The currently in range liquidity available to the pool /// @dev This value has no relationship to the total liquidity across all ticks function liquidity() external view returns (uint128); /// @notice Look up information about a specific tick in the pool /// @param tick The tick to look up /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or /// tick upper, /// liquidityNet how much liquidity changes when the pool price crosses the tick, /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0, /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1, /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick, /// secondsOutside the seconds spent on the other side of the tick from the current tick, /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false. /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0. /// In addition, these values are only relative and must be used only in comparison to previous snapshots for /// a specific position. function ticks(int24 tick) external view returns ( uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized ); /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information function tickBitmap(int16 wordPosition) external view returns (uint256); /// @notice Returns the information about a position by the position's key /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper /// @return _liquidity The amount of liquidity in the position, /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke, /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke, /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke, /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke function positions(bytes32 key) external view returns ( uint128 _liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1 ); /// @notice Returns data about a specific observation index /// @param index The element of the observations array to fetch /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time /// ago, rather than at a specific index in the array. /// @return blockTimestamp The timestamp of the observation, /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp, /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp, /// Returns initialized whether the observation has been initialized and the values are safe to use function observations(uint256 index) external view returns ( uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized ); }
{ "evmVersion": "paris", "optimizer": { "enabled": false, "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":"uint256","name":"_fee","type":"uint256"},{"internalType":"address","name":"_feeReceiver","type":"address"},{"internalType":"address","name":"_v3Router","type":"address"},{"internalType":"address","name":"_v2Router","type":"address"},{"internalType":"address","name":"_weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"Fee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_oldReceiver","type":"address"},{"indexed":true,"internalType":"address","name":"_newReceiver","type":"address"}],"name":"FeeReceiverSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":true,"internalType":"address","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountOut","type":"uint256"}],"name":"SwapExecuted","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"addFeeToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"},{"internalType":"address","name":"_feeReceiver","type":"address"}],"name":"changeFeeData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"feeTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"_beneficiary","type":"address"}],"name":"recoverStuckETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"recoverStuckTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"removeFeeToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenA","type":"address"},{"internalType":"address","name":"_tokenB","type":"address"},{"internalType":"bool","name":"_unwrappETH","type":"bool"},{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"uint256","name":"_minAmountOutV2","type":"uint256"},{"internalType":"uint256","name":"_minAmountOutV3","type":"uint256"},{"internalType":"uint8","name":"_buyOneTwoOrThree","type":"uint8"},{"internalType":"address[]","name":"_pathV2","type":"address[]"},{"internalType":"bytes","name":"_pathV3","type":"bytes"},{"internalType":"bool","name":"isWethIn","type":"bool"}],"name":"swapOnce","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"v2Router","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"v3Router","outputs":[{"internalType":"contract IV3SwapRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wethToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162002adc38038062002adc833981810160405281019062000037919062000345565b33600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603620000ad5760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401620000a49190620003de565b60405180910390fd5b620000be81620001dc60201b60201c565b50600180819055508460038190555083600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505050620003fb565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b6000819050919050565b620002ba81620002a5565b8114620002c657600080fd5b50565b600081519050620002da81620002af565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200030d82620002e0565b9050919050565b6200031f8162000300565b81146200032b57600080fd5b50565b6000815190506200033f8162000314565b92915050565b600080600080600060a08688031215620003645762000363620002a0565b5b60006200037488828901620002c9565b955050602062000387888289016200032e565b94505060406200039a888289016200032e565b9350506060620003ad888289016200032e565b9250506080620003c0888289016200032e565b9150509295509295909350565b620003d88162000300565b82525050565b6000602082019050620003f56000830184620003cd565b92915050565b6126d1806200040b6000396000f3fe6080604052600436106100f75760003560e01c8063715018a61161008a578063c142486911610059578063c1424869146102fa578063d8b499cd14610323578063deadbc141461033f578063f2fde38b1461036a576100fe565b8063715018a6146102645780638da5cb5b1461027b578063aa2eded2146102a6578063b3f00674146102cf576100fe565b80634b57b0be116100c65780634b57b0be146101be5780634be55d1f146101e957806367923c45146102125780636899cb701461023b576100fe565b80630dc913061461010057806316605a0d1461012b57806324a9d8531461016857806326232a2e14610193576100fe565b366100fe57005b005b34801561010c57600080fd5b50610115610393565b6040516101229190611b07565b60405180910390f35b34801561013757600080fd5b50610152600480360381019061014d9190611b74565b6103b9565b60405161015f9190611bbc565b60405180910390f35b34801561017457600080fd5b5061017d6103d9565b60405161018a9190611bf0565b60405180910390f35b34801561019f57600080fd5b506101a86103df565b6040516101b59190611bf0565b60405180910390f35b3480156101ca57600080fd5b506101d36103e5565b6040516101e09190611c1a565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190611b74565b61040b565b005b34801561021e57600080fd5b5061023960048036038101906102349190611b74565b6104c7565b005b34801561024757600080fd5b50610262600480360381019061025d9190611c73565b610599565b005b34801561027057600080fd5b506102796105eb565b005b34801561028757600080fd5b506102906105ff565b60405161029d9190611c1a565b60405180910390f35b3480156102b257600080fd5b506102cd60048036038101906102c89190611b74565b610628565b005b3480156102db57600080fd5b506102e46106fa565b6040516102f19190611c1a565b60405180910390f35b34801561030657600080fd5b50610321600480360381019061031c9190611ccc565b610720565b005b61033d60048036038101906103389190611f7f565b6107f6565b005b34801561034b57600080fd5b50610354610d41565b60405161036191906120b7565b60405180910390f35b34801561037657600080fd5b50610391600480360381019061038c9190611b74565b610d67565b005b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915054906101000a900460ff1681565b6103e881565b60035481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610413610ded565b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161044e9190611c1a565b602060405180830381865afa15801561046b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f91906120e7565b90506104c361049c6105ff565b828473ffffffffffffffffffffffffffffffffffffffff16610e749092919063ffffffff16565b5050565b6104cf610ded565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361053e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053590612171565b60405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6105a1610ded565b8073ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156105e7573d6000803e3d6000fd5b5050565b6105f3610ded565b6105fd6000610ef3565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610630610ded565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361069f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069690612171565b60405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610728610ded565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508260038190555081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f49bc8f1c292131e71bfca22660d0716072ff2442b58d72840474dd83a390411c60405160405180910390a3505050565b6107fe610fb7565b801580156108595750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16145b156108e657600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156108c857600080fd5b505af11580156108dc573d6000803e3d6000fd5b5050505050610a20565b60008a73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109219190611c1a565b602060405180830381865afa15801561093e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096291906120e7565b905061099133308a8e73ffffffffffffffffffffffffffffffffffffffff16610ffd909392919063ffffffff16565b60008b73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109cc9190611c1a565b602060405180830381865afa1580156109e9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0d91906120e7565b90508181610a1b91906121c0565b985050505b6000610a2c8b8b61107f565b90506000803411610a3d5788610a3f565b345b905060008190508c73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480610aac5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15610abe57610abb828e611140565b90505b600060018860ff1603610add57610ad687838c611233565b9050610b77565b60028860ff1603610afb57610af48e87848c61145e565b9050610b76565b60038860ff1603610b4d57610b1187838c611233565b9050610b468760018951610b2591906121c0565b81518110610b3657610b356121f4565b5b602002602001015187838c61145e565b9050610b75565b60048860ff1603610b7457610b648e87848c61145e565b9050610b7187828c611233565b90505b5b5b5b8c73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603610bb757610bb4818e611140565b90505b8b15610c9657600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b8152600401610c189190611bf0565b600060405180830381600087803b158015610c3257600080fd5b505af1158015610c46573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610c90573d6000803e3d6000fd5b50610cc2565b610cc133828f73ffffffffffffffffffffffffffffffffffffffff16610e749092919063ffffffff16565b5b8c73ffffffffffffffffffffffffffffffffffffffff168e73ffffffffffffffffffffffffffffffffffffffff167fdd36740e2a012d93061a0d99eaa9107860955de4e90027d3cf465a055026c4078d84604051610d21929190612223565b60405180910390a350505050610d35611571565b50505050505050505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610d6f610ded565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610de15760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610dd89190611c1a565b60405180910390fd5b610dea81610ef3565b50565b610df561157a565b73ffffffffffffffffffffffffffffffffffffffff16610e136105ff565b73ffffffffffffffffffffffffffffffffffffffff1614610e7257610e3661157a565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610e699190611c1a565b60405180910390fd5b565b610eee838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401610ea792919061224c565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611582565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600260015403610ff3576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600181905550565b611079848573ffffffffffffffffffffffffffffffffffffffff166323b872dd86868660405160240161103293929190612275565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611582565b50505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156110db5782905061113a565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111355781905061113a565b600090505b92915050565b60008060646103e861115291906122ac565b6003548561116091906122ac565b61116a919061231d565b9050808461117891906121c0565b91506111c7600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828573ffffffffffffffffffffffffffffffffffffffff16610e749092919063ffffffff16565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f306b73f37cb0b44d015b4435720a741fcc6b3bf17758c4d2567159e154f5b3a4836040516112249190611bf0565b60405180910390a35092915050565b600080846001865161124591906121c0565b81518110611256576112556121f4565b5b602002602001015190506112a885600081518110611277576112766121f4565b5b6020026020010151600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686611619565b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016112e39190611c1a565b602060405180830381865afa158015611300573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132491906120e7565b9050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c11d7958686893061012c4261137691906122ac565b6040518663ffffffff1660e01b815260040161139695949392919061240c565b600060405180830381600087803b1580156113b057600080fd5b505af11580156113c4573d6000803e3d6000fd5b5050505060008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016114039190611c1a565b602060405180830381865afa158015611420573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144491906120e7565b9050818161145291906121c0565b93505050509392505050565b600061148d85600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685611619565b600060405180608001604052808681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152509050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b858183f826040518263ffffffff1660e01b81526004016115239190612557565b6020604051808303816000875af1158015611542573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156691906120e7565b915050949350505050565b60018081905550565b600033905090565b60006115ad828473ffffffffffffffffffffffffffffffffffffffff166116fb90919063ffffffff16565b905060008151141580156115d25750808060200190518101906115d0919061258e565b155b1561161457826040517f5274afe700000000000000000000000000000000000000000000000000000000815260040161160b9190611c1a565b60405180910390fd5b505050565b808373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b81526004016116559291906125bb565b602060405180830381865afa158015611672573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169691906120e7565b10156116f6576116c88260008573ffffffffffffffffffffffffffffffffffffffff166117119092919063ffffffff16565b6116f5826000198573ffffffffffffffffffffffffffffffffffffffff166117119092919063ffffffff16565b5b505050565b606061170983836000611820565b905092915050565b60008373ffffffffffffffffffffffffffffffffffffffff1663095ea7b3848460405160240161174292919061224c565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050905061179084826118ed565b61181a5761180f848573ffffffffffffffffffffffffffffffffffffffff1663095ea7b38660006040516024016117c892919061261f565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611582565b6118198482611582565b5b50505050565b60608147101561186757306040517fcd78605900000000000000000000000000000000000000000000000000000000815260040161185e9190611c1a565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1684866040516118909190612684565b60006040518083038185875af1925050503d80600081146118cd576040519150601f19603f3d011682016040523d82523d6000602084013e6118d2565b606091505b50915091506118e28683836119b4565b925050509392505050565b60008060008473ffffffffffffffffffffffffffffffffffffffff16846040516119179190612684565b6000604051808303816000865af19150503d8060008114611954576040519150601f19603f3d011682016040523d82523d6000602084013e611959565b606091505b50915091508180156119875750600081511480611986575080806020019051810190611985919061258e565b5b5b80156119aa575060008573ffffffffffffffffffffffffffffffffffffffff163b115b9250505092915050565b6060826119c9576119c482611a43565b611a3b565b600082511480156119f1575060008473ffffffffffffffffffffffffffffffffffffffff163b145b15611a3357836040517f9996b315000000000000000000000000000000000000000000000000000000008152600401611a2a9190611c1a565b60405180910390fd5b819050611a3c565b5b9392505050565b600081511115611a565780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000611acd611ac8611ac384611a88565b611aa8565b611a88565b9050919050565b6000611adf82611ab2565b9050919050565b6000611af182611ad4565b9050919050565b611b0181611ae6565b82525050565b6000602082019050611b1c6000830184611af8565b92915050565b6000604051905090565b600080fd5b600080fd5b6000611b4182611a88565b9050919050565b611b5181611b36565b8114611b5c57600080fd5b50565b600081359050611b6e81611b48565b92915050565b600060208284031215611b8a57611b89611b2c565b5b6000611b9884828501611b5f565b91505092915050565b60008115159050919050565b611bb681611ba1565b82525050565b6000602082019050611bd16000830184611bad565b92915050565b6000819050919050565b611bea81611bd7565b82525050565b6000602082019050611c056000830184611be1565b92915050565b611c1481611b36565b82525050565b6000602082019050611c2f6000830184611c0b565b92915050565b6000611c4082611a88565b9050919050565b611c5081611c35565b8114611c5b57600080fd5b50565b600081359050611c6d81611c47565b92915050565b600060208284031215611c8957611c88611b2c565b5b6000611c9784828501611c5e565b91505092915050565b611ca981611bd7565b8114611cb457600080fd5b50565b600081359050611cc681611ca0565b92915050565b60008060408385031215611ce357611ce2611b2c565b5b6000611cf185828601611cb7565b9250506020611d0285828601611b5f565b9150509250929050565b611d1581611ba1565b8114611d2057600080fd5b50565b600081359050611d3281611d0c565b92915050565b600060ff82169050919050565b611d4e81611d38565b8114611d5957600080fd5b50565b600081359050611d6b81611d45565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611dbf82611d76565b810181811067ffffffffffffffff82111715611dde57611ddd611d87565b5b80604052505050565b6000611df1611b22565b9050611dfd8282611db6565b919050565b600067ffffffffffffffff821115611e1d57611e1c611d87565b5b602082029050602081019050919050565b600080fd5b6000611e46611e4184611e02565b611de7565b90508083825260208201905060208402830185811115611e6957611e68611e2e565b5b835b81811015611e925780611e7e8882611b5f565b845260208401935050602081019050611e6b565b5050509392505050565b600082601f830112611eb157611eb0611d71565b5b8135611ec1848260208601611e33565b91505092915050565b600080fd5b600067ffffffffffffffff821115611eea57611ee9611d87565b5b611ef382611d76565b9050602081019050919050565b82818337600083830152505050565b6000611f22611f1d84611ecf565b611de7565b905082815260208101848484011115611f3e57611f3d611eca565b5b611f49848285611f00565b509392505050565b600082601f830112611f6657611f65611d71565b5b8135611f76848260208601611f0f565b91505092915050565b6000806000806000806000806000806101408b8d031215611fa357611fa2611b2c565b5b6000611fb18d828e01611b5f565b9a50506020611fc28d828e01611b5f565b9950506040611fd38d828e01611d23565b9850506060611fe48d828e01611cb7565b9750506080611ff58d828e01611cb7565b96505060a06120068d828e01611cb7565b95505060c06120178d828e01611d5c565b94505060e08b013567ffffffffffffffff81111561203857612037611b31565b5b6120448d828e01611e9c565b9350506101008b013567ffffffffffffffff81111561206657612065611b31565b5b6120728d828e01611f51565b9250506101206120848d828e01611d23565b9150509295989b9194979a5092959850565b60006120a182611ad4565b9050919050565b6120b181612096565b82525050565b60006020820190506120cc60008301846120a8565b92915050565b6000815190506120e181611ca0565b92915050565b6000602082840312156120fd576120fc611b2c565b5b600061210b848285016120d2565b91505092915050565b600082825260208201905092915050565b7f496e76616c696420746f6b656e20616464726573730000000000000000000000600082015250565b600061215b601583612114565b915061216682612125565b602082019050919050565b6000602082019050818103600083015261218a8161214e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006121cb82611bd7565b91506121d683611bd7565b92508282039050818111156121ee576121ed612191565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006040820190506122386000830185611be1565b6122456020830184611be1565b9392505050565b60006040820190506122616000830185611c0b565b61226e6020830184611be1565b9392505050565b600060608201905061228a6000830186611c0b565b6122976020830185611c0b565b6122a46040830184611be1565b949350505050565b60006122b782611bd7565b91506122c283611bd7565b92508282026122d081611bd7565b915082820484148315176122e7576122e6612191565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061232882611bd7565b915061233383611bd7565b925082612343576123426122ee565b5b828204905092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61238381611b36565b82525050565b6000612395838361237a565b60208301905092915050565b6000602082019050919050565b60006123b98261234e565b6123c38185612359565b93506123ce8361236a565b8060005b838110156123ff5781516123e68882612389565b97506123f1836123a1565b9250506001810190506123d2565b5085935050505092915050565b600060a0820190506124216000830188611be1565b61242e6020830187611be1565b818103604083015261244081866123ae565b905061244f6060830185611c0b565b61245c6080830184611be1565b9695505050505050565b600081519050919050565b600082825260208201905092915050565b60005b838110156124a0578082015181840152602081019050612485565b60008484015250505050565b60006124b782612466565b6124c18185612471565b93506124d1818560208601612482565b6124da81611d76565b840191505092915050565b6124ee81611bd7565b82525050565b6000608083016000830151848203600086015261251182826124ac565b9150506020830151612526602086018261237a565b50604083015161253960408601826124e5565b50606083015161254c60608601826124e5565b508091505092915050565b6000602082019050818103600083015261257181846124f4565b905092915050565b60008151905061258881611d0c565b92915050565b6000602082840312156125a4576125a3611b2c565b5b60006125b284828501612579565b91505092915050565b60006040820190506125d06000830185611c0b565b6125dd6020830184611c0b565b9392505050565b6000819050919050565b60006126096126046125ff846125e4565b611aa8565b611bd7565b9050919050565b612619816125ee565b82525050565b60006040820190506126346000830185611c0b565b6126416020830184612610565b9392505050565b600081905092915050565b600061265e82612466565b6126688185612648565b9350612678818560208601612482565b80840191505092915050565b60006126908284612653565b91508190509291505056fea2646970667358221220e3e264a82e7ca4478f01386f16f46ba11a3f937100c3e541893de4887368445564736f6c6343000814003300000000000000000000000000000000000000000000000000000000000001f4000000000000000000000000415eec63c95e944d544b3088bc682b759edb854800000000000000000000000068b3465833fb72a70ecdf485e0e4c7bd8665fc450000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Deployed Bytecode
0x6080604052600436106100f75760003560e01c8063715018a61161008a578063c142486911610059578063c1424869146102fa578063d8b499cd14610323578063deadbc141461033f578063f2fde38b1461036a576100fe565b8063715018a6146102645780638da5cb5b1461027b578063aa2eded2146102a6578063b3f00674146102cf576100fe565b80634b57b0be116100c65780634b57b0be146101be5780634be55d1f146101e957806367923c45146102125780636899cb701461023b576100fe565b80630dc913061461010057806316605a0d1461012b57806324a9d8531461016857806326232a2e14610193576100fe565b366100fe57005b005b34801561010c57600080fd5b50610115610393565b6040516101229190611b07565b60405180910390f35b34801561013757600080fd5b50610152600480360381019061014d9190611b74565b6103b9565b60405161015f9190611bbc565b60405180910390f35b34801561017457600080fd5b5061017d6103d9565b60405161018a9190611bf0565b60405180910390f35b34801561019f57600080fd5b506101a86103df565b6040516101b59190611bf0565b60405180910390f35b3480156101ca57600080fd5b506101d36103e5565b6040516101e09190611c1a565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190611b74565b61040b565b005b34801561021e57600080fd5b5061023960048036038101906102349190611b74565b6104c7565b005b34801561024757600080fd5b50610262600480360381019061025d9190611c73565b610599565b005b34801561027057600080fd5b506102796105eb565b005b34801561028757600080fd5b506102906105ff565b60405161029d9190611c1a565b60405180910390f35b3480156102b257600080fd5b506102cd60048036038101906102c89190611b74565b610628565b005b3480156102db57600080fd5b506102e46106fa565b6040516102f19190611c1a565b60405180910390f35b34801561030657600080fd5b50610321600480360381019061031c9190611ccc565b610720565b005b61033d60048036038101906103389190611f7f565b6107f6565b005b34801561034b57600080fd5b50610354610d41565b60405161036191906120b7565b60405180910390f35b34801561037657600080fd5b50610391600480360381019061038c9190611b74565b610d67565b005b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915054906101000a900460ff1681565b6103e881565b60035481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610413610ded565b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161044e9190611c1a565b602060405180830381865afa15801561046b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f91906120e7565b90506104c361049c6105ff565b828473ffffffffffffffffffffffffffffffffffffffff16610e749092919063ffffffff16565b5050565b6104cf610ded565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361053e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053590612171565b60405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6105a1610ded565b8073ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156105e7573d6000803e3d6000fd5b5050565b6105f3610ded565b6105fd6000610ef3565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610630610ded565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361069f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069690612171565b60405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610728610ded565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508260038190555081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f49bc8f1c292131e71bfca22660d0716072ff2442b58d72840474dd83a390411c60405160405180910390a3505050565b6107fe610fb7565b801580156108595750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16145b156108e657600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156108c857600080fd5b505af11580156108dc573d6000803e3d6000fd5b5050505050610a20565b60008a73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109219190611c1a565b602060405180830381865afa15801561093e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096291906120e7565b905061099133308a8e73ffffffffffffffffffffffffffffffffffffffff16610ffd909392919063ffffffff16565b60008b73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109cc9190611c1a565b602060405180830381865afa1580156109e9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0d91906120e7565b90508181610a1b91906121c0565b985050505b6000610a2c8b8b61107f565b90506000803411610a3d5788610a3f565b345b905060008190508c73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480610aac5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15610abe57610abb828e611140565b90505b600060018860ff1603610add57610ad687838c611233565b9050610b77565b60028860ff1603610afb57610af48e87848c61145e565b9050610b76565b60038860ff1603610b4d57610b1187838c611233565b9050610b468760018951610b2591906121c0565b81518110610b3657610b356121f4565b5b602002602001015187838c61145e565b9050610b75565b60048860ff1603610b7457610b648e87848c61145e565b9050610b7187828c611233565b90505b5b5b5b8c73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603610bb757610bb4818e611140565b90505b8b15610c9657600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b8152600401610c189190611bf0565b600060405180830381600087803b158015610c3257600080fd5b505af1158015610c46573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610c90573d6000803e3d6000fd5b50610cc2565b610cc133828f73ffffffffffffffffffffffffffffffffffffffff16610e749092919063ffffffff16565b5b8c73ffffffffffffffffffffffffffffffffffffffff168e73ffffffffffffffffffffffffffffffffffffffff167fdd36740e2a012d93061a0d99eaa9107860955de4e90027d3cf465a055026c4078d84604051610d21929190612223565b60405180910390a350505050610d35611571565b50505050505050505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610d6f610ded565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610de15760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610dd89190611c1a565b60405180910390fd5b610dea81610ef3565b50565b610df561157a565b73ffffffffffffffffffffffffffffffffffffffff16610e136105ff565b73ffffffffffffffffffffffffffffffffffffffff1614610e7257610e3661157a565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610e699190611c1a565b60405180910390fd5b565b610eee838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401610ea792919061224c565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611582565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600260015403610ff3576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600181905550565b611079848573ffffffffffffffffffffffffffffffffffffffff166323b872dd86868660405160240161103293929190612275565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611582565b50505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156110db5782905061113a565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111355781905061113a565b600090505b92915050565b60008060646103e861115291906122ac565b6003548561116091906122ac565b61116a919061231d565b9050808461117891906121c0565b91506111c7600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828573ffffffffffffffffffffffffffffffffffffffff16610e749092919063ffffffff16565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f306b73f37cb0b44d015b4435720a741fcc6b3bf17758c4d2567159e154f5b3a4836040516112249190611bf0565b60405180910390a35092915050565b600080846001865161124591906121c0565b81518110611256576112556121f4565b5b602002602001015190506112a885600081518110611277576112766121f4565b5b6020026020010151600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686611619565b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016112e39190611c1a565b602060405180830381865afa158015611300573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132491906120e7565b9050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c11d7958686893061012c4261137691906122ac565b6040518663ffffffff1660e01b815260040161139695949392919061240c565b600060405180830381600087803b1580156113b057600080fd5b505af11580156113c4573d6000803e3d6000fd5b5050505060008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016114039190611c1a565b602060405180830381865afa158015611420573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144491906120e7565b9050818161145291906121c0565b93505050509392505050565b600061148d85600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685611619565b600060405180608001604052808681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152509050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b858183f826040518263ffffffff1660e01b81526004016115239190612557565b6020604051808303816000875af1158015611542573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156691906120e7565b915050949350505050565b60018081905550565b600033905090565b60006115ad828473ffffffffffffffffffffffffffffffffffffffff166116fb90919063ffffffff16565b905060008151141580156115d25750808060200190518101906115d0919061258e565b155b1561161457826040517f5274afe700000000000000000000000000000000000000000000000000000000815260040161160b9190611c1a565b60405180910390fd5b505050565b808373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b81526004016116559291906125bb565b602060405180830381865afa158015611672573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169691906120e7565b10156116f6576116c88260008573ffffffffffffffffffffffffffffffffffffffff166117119092919063ffffffff16565b6116f5826000198573ffffffffffffffffffffffffffffffffffffffff166117119092919063ffffffff16565b5b505050565b606061170983836000611820565b905092915050565b60008373ffffffffffffffffffffffffffffffffffffffff1663095ea7b3848460405160240161174292919061224c565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050905061179084826118ed565b61181a5761180f848573ffffffffffffffffffffffffffffffffffffffff1663095ea7b38660006040516024016117c892919061261f565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611582565b6118198482611582565b5b50505050565b60608147101561186757306040517fcd78605900000000000000000000000000000000000000000000000000000000815260040161185e9190611c1a565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1684866040516118909190612684565b60006040518083038185875af1925050503d80600081146118cd576040519150601f19603f3d011682016040523d82523d6000602084013e6118d2565b606091505b50915091506118e28683836119b4565b925050509392505050565b60008060008473ffffffffffffffffffffffffffffffffffffffff16846040516119179190612684565b6000604051808303816000865af19150503d8060008114611954576040519150601f19603f3d011682016040523d82523d6000602084013e611959565b606091505b50915091508180156119875750600081511480611986575080806020019051810190611985919061258e565b5b5b80156119aa575060008573ffffffffffffffffffffffffffffffffffffffff163b115b9250505092915050565b6060826119c9576119c482611a43565b611a3b565b600082511480156119f1575060008473ffffffffffffffffffffffffffffffffffffffff163b145b15611a3357836040517f9996b315000000000000000000000000000000000000000000000000000000008152600401611a2a9190611c1a565b60405180910390fd5b819050611a3c565b5b9392505050565b600081511115611a565780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000611acd611ac8611ac384611a88565b611aa8565b611a88565b9050919050565b6000611adf82611ab2565b9050919050565b6000611af182611ad4565b9050919050565b611b0181611ae6565b82525050565b6000602082019050611b1c6000830184611af8565b92915050565b6000604051905090565b600080fd5b600080fd5b6000611b4182611a88565b9050919050565b611b5181611b36565b8114611b5c57600080fd5b50565b600081359050611b6e81611b48565b92915050565b600060208284031215611b8a57611b89611b2c565b5b6000611b9884828501611b5f565b91505092915050565b60008115159050919050565b611bb681611ba1565b82525050565b6000602082019050611bd16000830184611bad565b92915050565b6000819050919050565b611bea81611bd7565b82525050565b6000602082019050611c056000830184611be1565b92915050565b611c1481611b36565b82525050565b6000602082019050611c2f6000830184611c0b565b92915050565b6000611c4082611a88565b9050919050565b611c5081611c35565b8114611c5b57600080fd5b50565b600081359050611c6d81611c47565b92915050565b600060208284031215611c8957611c88611b2c565b5b6000611c9784828501611c5e565b91505092915050565b611ca981611bd7565b8114611cb457600080fd5b50565b600081359050611cc681611ca0565b92915050565b60008060408385031215611ce357611ce2611b2c565b5b6000611cf185828601611cb7565b9250506020611d0285828601611b5f565b9150509250929050565b611d1581611ba1565b8114611d2057600080fd5b50565b600081359050611d3281611d0c565b92915050565b600060ff82169050919050565b611d4e81611d38565b8114611d5957600080fd5b50565b600081359050611d6b81611d45565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611dbf82611d76565b810181811067ffffffffffffffff82111715611dde57611ddd611d87565b5b80604052505050565b6000611df1611b22565b9050611dfd8282611db6565b919050565b600067ffffffffffffffff821115611e1d57611e1c611d87565b5b602082029050602081019050919050565b600080fd5b6000611e46611e4184611e02565b611de7565b90508083825260208201905060208402830185811115611e6957611e68611e2e565b5b835b81811015611e925780611e7e8882611b5f565b845260208401935050602081019050611e6b565b5050509392505050565b600082601f830112611eb157611eb0611d71565b5b8135611ec1848260208601611e33565b91505092915050565b600080fd5b600067ffffffffffffffff821115611eea57611ee9611d87565b5b611ef382611d76565b9050602081019050919050565b82818337600083830152505050565b6000611f22611f1d84611ecf565b611de7565b905082815260208101848484011115611f3e57611f3d611eca565b5b611f49848285611f00565b509392505050565b600082601f830112611f6657611f65611d71565b5b8135611f76848260208601611f0f565b91505092915050565b6000806000806000806000806000806101408b8d031215611fa357611fa2611b2c565b5b6000611fb18d828e01611b5f565b9a50506020611fc28d828e01611b5f565b9950506040611fd38d828e01611d23565b9850506060611fe48d828e01611cb7565b9750506080611ff58d828e01611cb7565b96505060a06120068d828e01611cb7565b95505060c06120178d828e01611d5c565b94505060e08b013567ffffffffffffffff81111561203857612037611b31565b5b6120448d828e01611e9c565b9350506101008b013567ffffffffffffffff81111561206657612065611b31565b5b6120728d828e01611f51565b9250506101206120848d828e01611d23565b9150509295989b9194979a5092959850565b60006120a182611ad4565b9050919050565b6120b181612096565b82525050565b60006020820190506120cc60008301846120a8565b92915050565b6000815190506120e181611ca0565b92915050565b6000602082840312156120fd576120fc611b2c565b5b600061210b848285016120d2565b91505092915050565b600082825260208201905092915050565b7f496e76616c696420746f6b656e20616464726573730000000000000000000000600082015250565b600061215b601583612114565b915061216682612125565b602082019050919050565b6000602082019050818103600083015261218a8161214e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006121cb82611bd7565b91506121d683611bd7565b92508282039050818111156121ee576121ed612191565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006040820190506122386000830185611be1565b6122456020830184611be1565b9392505050565b60006040820190506122616000830185611c0b565b61226e6020830184611be1565b9392505050565b600060608201905061228a6000830186611c0b565b6122976020830185611c0b565b6122a46040830184611be1565b949350505050565b60006122b782611bd7565b91506122c283611bd7565b92508282026122d081611bd7565b915082820484148315176122e7576122e6612191565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061232882611bd7565b915061233383611bd7565b925082612343576123426122ee565b5b828204905092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61238381611b36565b82525050565b6000612395838361237a565b60208301905092915050565b6000602082019050919050565b60006123b98261234e565b6123c38185612359565b93506123ce8361236a565b8060005b838110156123ff5781516123e68882612389565b97506123f1836123a1565b9250506001810190506123d2565b5085935050505092915050565b600060a0820190506124216000830188611be1565b61242e6020830187611be1565b818103604083015261244081866123ae565b905061244f6060830185611c0b565b61245c6080830184611be1565b9695505050505050565b600081519050919050565b600082825260208201905092915050565b60005b838110156124a0578082015181840152602081019050612485565b60008484015250505050565b60006124b782612466565b6124c18185612471565b93506124d1818560208601612482565b6124da81611d76565b840191505092915050565b6124ee81611bd7565b82525050565b6000608083016000830151848203600086015261251182826124ac565b9150506020830151612526602086018261237a565b50604083015161253960408601826124e5565b50606083015161254c60608601826124e5565b508091505092915050565b6000602082019050818103600083015261257181846124f4565b905092915050565b60008151905061258881611d0c565b92915050565b6000602082840312156125a4576125a3611b2c565b5b60006125b284828501612579565b91505092915050565b60006040820190506125d06000830185611c0b565b6125dd6020830184611c0b565b9392505050565b6000819050919050565b60006126096126046125ff846125e4565b611aa8565b611bd7565b9050919050565b612619816125ee565b82525050565b60006040820190506126346000830185611c0b565b6126416020830184612610565b9392505050565b600081905092915050565b600061265e82612466565b6126688185612648565b9350612678818560208601612482565b80840191505092915050565b60006126908284612653565b91508190509291505056fea2646970667358221220e3e264a82e7ca4478f01386f16f46ba11a3f937100c3e541893de4887368445564736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000001f4000000000000000000000000415eec63c95e944d544b3088bc682b759edb854800000000000000000000000068b3465833fb72a70ecdf485e0e4c7bd8665fc450000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
-----Decoded View---------------
Arg [0] : _fee (uint256): 500
Arg [1] : _feeReceiver (address): 0x415EEc63c95e944D544b3088bc682B759edB8548
Arg [2] : _v3Router (address): 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45
Arg [3] : _v2Router (address): 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
Arg [4] : _weth (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000001f4
Arg [1] : 000000000000000000000000415eec63c95e944d544b3088bc682b759edb8548
Arg [2] : 00000000000000000000000068b3465833fb72a70ecdf485e0e4c7bd8665fc45
Arg [3] : 0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d
Arg [4] : 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.