ERC-20
Overview
Max Total Supply
9,953,417,742.693749342083639456 EXCESS
Holders
354
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
2,247,111.697292919130326911 EXCESSValue
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
Debauchery
Compiler Version
v0.7.6+commit.7338295f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// https://debauchery.io // https://x.com/EthExcess // https://t.me/DebaucheryExcess // // SPDX-License-Identifier: MIT pragma solidity ^0.7.6; pragma abicoder v2; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol'; import '@uniswap/v3-core/contracts/libraries/FixedPoint96.sol'; import '@uniswap/v3-core/contracts/libraries/FullMath.sol'; import '@uniswap/v3-core/contracts/libraries/TickMath.sol'; import '@uniswap/v3-periphery/contracts/interfaces/INonfungiblePositionManager.sol'; import './interfaces/IERC20Metadata.sol'; contract Debauchery is ERC20, Ownable { uint8 constant PLAYERS_PER_GAME = 10; uint8 constant PERCENTAGE_WIN = 90; // 90% address constant V3MANAGER = 0xC36442b4a4522E871399CD717aBDD847Ab11FE88; address constant V3FACTORY = 0x1F98431c8aD98523631AE4a59f267346ea31F984; address constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; address constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48; address _creator; uint256 _activity; bool public gameEnabled = true; uint256 public gameCostUSDX96 = 100 * FixedPoint96.Q96; // $100 uint256 public currentGame; // game number => selected wallets (1-PLAYERS_PER_GAME) => player mapping(uint256 => mapping(address => address)) public gamePlayers; // game number => token cost per game, set when first player selects a game wallet for consistency mapping(uint256 => uint256) public gameCostTokens; // game number => winning wallet (1-PLAYERS_PER_GAME) mapping(uint256 => address) public gameResults; uint256 _currentGamePlayers; uint256[] _pendingGameOutcomes; event ProcessWinner( uint256 indexed _game, address indexed _winningSelection, address _winner, uint256 _amountWon ); event GameWalletSelected( uint256 indexed _game, address indexed gameWallet, address indexed userWallet, uint256 _cost ); constructor() ERC20('Debauchery', 'EXCESS') { _creator = _msgSender(); _activity = block.timestamp; _mint(_creator, 10_000_000_000 * 10 ** 18); } function _transfer( address from, address to, uint256 amount ) internal virtual override { _activity = block.timestamp; if (gameEnabled) { if (_isGameWallet(to)) { if (_currentGamePlayers == 0) { currentGame++; _currentGamePlayers++; gamePlayers[currentGame][to] = from; gameCostTokens[currentGame] = _getGameCostTokens(); to = address(0); amount = gameCostTokens[currentGame]; emit GameWalletSelected(currentGame, to, from, amount); } else if (gamePlayers[currentGame][to] == address(0)) { _currentGamePlayers++; gamePlayers[currentGame][to] = from; to = address(0); amount = gameCostTokens[currentGame]; emit GameWalletSelected(currentGame, to, from, amount); if (_currentGamePlayers == PLAYERS_PER_GAME) { _pendingGameOutcomes.push(currentGame); _currentGamePlayers = 0; } } else { // already an entry, noop transfer amount = 0; } } else if ( _pendingGameOutcomes.length > 0 && _isProcessableTxn(from, to, amount) ) { _processGameResult(); } } if (to == address(0)) { _burn(from, amount); } else { super._transfer(from, to, amount); } } function _processGameResult() internal { uint256 _game = _pendingGameOutcomes[0]; _pendingGameOutcomes[0] = _pendingGameOutcomes[ _pendingGameOutcomes.length - 1 ]; _pendingGameOutcomes.pop(); uint256 _resultRaw = uint256( keccak256( abi.encodePacked( block.difficulty, block.timestamp, _game, gameCostTokens[_game], _tokenPriceUSDX96(), balanceOf(address(_getMainV3Pool())), IERC20(USDC).balanceOf(address(_getWETHUSDCV3Pool())) ) ) ); uint256 _resultFinal = (_resultRaw % PLAYERS_PER_GAME) + 1; address _winner = gamePlayers[_game][address(_resultFinal)]; uint256 _winAmount = (gameCostTokens[_game] * PLAYERS_PER_GAME * PERCENTAGE_WIN) / 100; gameResults[_game] = address(_resultFinal); _mint(_winner, _winAmount); emit ProcessWinner(_game, address(_resultFinal), _winner, _winAmount); } // allows game processing if it's a buy/sell transaction against the main pool // of greater than or equal to 2x an entry for a game function _isProcessableTxn( address _sender, address _recipient, uint256 _amount ) internal view returns (bool) { IUniswapV3Pool _mainTokenPool = _getMainV3Pool(); if ( _sender == address(_mainTokenPool) || _recipient == address(_mainTokenPool) ) { return (_tokenPriceUSDX96() * _amount) / 10 ** decimals() >= 2 * gameCostUSDX96; } return false; } function _getMainV3Pool() internal view returns (IUniswapV3Pool) { return _getV3Pool(address(this), WETH, 10000); } function _getWETHUSDCV3Pool() internal pure returns (IUniswapV3Pool) { return _getV3Pool(WETH, USDC, 500); } function _isGameWallet(address _wallet) internal pure returns (bool) { return _wallet > address(0) && _wallet <= address(PLAYERS_PER_GAME); } function _getGameCostTokens() internal view returns (uint256) { return (gameCostUSDX96 * 10 ** decimals()) / _tokenPriceUSDX96(); } function _tokenPriceUSDX96() internal view returns (uint256) { IUniswapV3Pool _wethUSDCPool = _getWETHUSDCV3Pool(); IUniswapV3Pool _tokenPool = _getMainV3Pool(); uint256 _usdcWETHPriceX96 = _poolRatioPriceX96(_wethUSDCPool, USDC); uint256 _wethTokenPriceX96 = _poolRatioPriceX96(_tokenPool, WETH); return (_usdcWETHPriceX96 * _wethTokenPriceX96) / FixedPoint96.Q96; } function _getV3Pool( address _token0, address _token1, uint24 _fee ) internal pure returns (IUniswapV3Pool) { (address _t0, address _t1) = _tokensOrdered(_token0, _token1); PoolAddress.PoolKey memory _key = PoolAddress.PoolKey({ token0: _t0, token1: _t1, fee: _fee }); address pool = PoolAddress.computeAddress(V3FACTORY, _key); return IUniswapV3Pool(pool); } function _poolSqrtPriceX96(address _pool) internal view returns (uint160) { uint32 _twapInterval = 5 minutes; IUniswapV3Pool _v3Pool = IUniswapV3Pool(_pool); uint32[] memory _secAgo = new uint32[](2); _secAgo[0] = _twapInterval; _secAgo[1] = 0; (int56[] memory _tickCums, ) = _v3Pool.observe(_secAgo); return TickMath.getSqrtRatioAtTick( int24((_tickCums[1] - _tickCums[0]) / _twapInterval) ); } function _priceX96FromSqrtPriceX96( uint160 _sqrtPriceX96 ) internal pure returns (uint256) { return FullMath.mulDiv(_sqrtPriceX96, _sqrtPriceX96, FixedPoint96.Q96); } function _tokensOrdered( address _token0, address _token1 ) internal pure returns (address, address) { return _token0 < _token1 ? (_token0, _token1) : (_token1, _token0); } function _poolRatioPriceX96( IUniswapV3Pool _pool, address _numerator ) internal view returns (uint256) { address _t1 = _pool.token1(); uint8 _decimals0 = IERC20Metadata(_pool.token0()).decimals(); uint8 _decimals1 = IERC20Metadata(_t1).decimals(); uint160 _sqrtPriceX96 = _poolSqrtPriceX96(address(_pool)); uint256 _priceX96 = _priceX96FromSqrtPriceX96(_sqrtPriceX96); uint256 _ratiodPriceX96 = _t1 == _numerator ? _priceX96 : FixedPoint96.Q96 ** 2 / _priceX96; return _t1 == _numerator ? (_ratiodPriceX96 * 10 ** _decimals0) / 10 ** _decimals1 : (_ratiodPriceX96 * 10 ** _decimals1) / 10 ** _decimals0; } function getGameCostTokens() external view returns (uint256) { return _getGameCostTokens(); } function safeTokenPriceUSDX96() external view returns (uint256) { return _tokenPriceUSDX96(); } function collectFees(uint256 _tokenId) external { INonfungiblePositionManager(V3MANAGER).collect( INonfungiblePositionManager.CollectParams({ tokenId: _tokenId, recipient: _creator, amount0Max: type(uint128).max, amount1Max: type(uint128).max }) ); } // send to creator ONLY after 60 minutes of no token transfers (inactivity) function withdrawLP(uint256 _tokenId) external { require(block.timestamp > _activity + 60 minutes); INonfungiblePositionManager(V3MANAGER).transferFrom( address(this), _creator, _tokenId ); } function setGameCostUSDX96(uint256 _newPriceX96) external onlyOwner { require(_newPriceX96 > 0); gameCostUSDX96 = _newPriceX96; } function setGameEnabled(bool _is) external onlyOwner { require(gameEnabled != _is); gameEnabled = _is; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../../utils/Context.sol"; import "./IERC20.sol"; import "../../math/SafeMath.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) public { _name = name_; _symbol = symbol_; _decimals = 18; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal virtual { _decimals = decimals_; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @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); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; import "../../introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; import "./IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; import "./IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN 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 payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// 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 ); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.4.0; /// @title FixedPoint96 /// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format) /// @dev Used in SqrtPriceMath.sol library FixedPoint96 { uint8 internal constant RESOLUTION = 96; uint256 internal constant Q96 = 0x1000000000000000000000000; }
// SPDX-License-Identifier: MIT pragma solidity >=0.4.0 <0.8.0; /// @title Contains 512-bit math functions /// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision /// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits library FullMath { /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 /// @param a The multiplicand /// @param b The multiplier /// @param denominator The divisor /// @return result The 256-bit result /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv function mulDiv( uint256 a, uint256 b, uint256 denominator ) internal pure returns (uint256 result) { // 512-bit multiply [prod1 prod0] = a * b // Compute the product mod 2**256 and mod 2**256 - 1 // then use the Chinese Remainder Theorem to reconstruct // the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2**256 + prod0 uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(a, b, not(0)) prod0 := mul(a, b) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division if (prod1 == 0) { require(denominator > 0); assembly { result := div(prod0, denominator) } return result; } // Make sure the result is less than 2**256. // Also prevents denominator == 0 require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0] // Compute remainder using mulmod uint256 remainder; assembly { remainder := mulmod(a, b, denominator) } // Subtract 256 bit number from 512 bit number assembly { prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator // Compute largest power of two divisor of denominator. // Always >= 1. uint256 twos = -denominator & denominator; // Divide denominator by power of two assembly { denominator := div(denominator, twos) } // Divide [prod1 prod0] by the factors of two assembly { prod0 := div(prod0, twos) } // Shift in bits from prod1 into prod0. For this we need // to flip `twos` such that it is 2**256 / twos. // If twos is zero, then it becomes one assembly { twos := add(div(sub(0, twos), twos), 1) } prod0 |= prod1 * twos; // Invert denominator mod 2**256 // Now that denominator is an odd number, it has an inverse // modulo 2**256 such that denominator * inv = 1 mod 2**256. // Compute the inverse by starting with a seed that is correct // correct for four bits. That is, denominator * inv = 1 mod 2**4 uint256 inv = (3 * denominator) ^ 2; // Now use Newton-Raphson iteration to improve the precision. // Thanks to Hensel's lifting lemma, this also works in modular // arithmetic, doubling the correct bits in each step. inv *= 2 - denominator * inv; // inverse mod 2**8 inv *= 2 - denominator * inv; // inverse mod 2**16 inv *= 2 - denominator * inv; // inverse mod 2**32 inv *= 2 - denominator * inv; // inverse mod 2**64 inv *= 2 - denominator * inv; // inverse mod 2**128 inv *= 2 - denominator * inv; // inverse mod 2**256 // Because the division is now exact we can divide by multiplying // with the modular inverse of denominator. This will give us the // correct result modulo 2**256. Since the precoditions guarantee // that the outcome is less than 2**256, this is the final result. // We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inv; return result; } /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 /// @param a The multiplicand /// @param b The multiplier /// @param denominator The divisor /// @return result The 256-bit result function mulDivRoundingUp( uint256 a, uint256 b, uint256 denominator ) internal pure returns (uint256 result) { result = mulDiv(a, b, denominator); if (mulmod(a, b, denominator) > 0) { require(result < type(uint256).max); result++; } } }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0 <0.8.0; /// @title Math library for computing sqrt prices from ticks and vice versa /// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports /// prices between 2**-128 and 2**128 library TickMath { /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128 int24 internal constant MIN_TICK = -887272; /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128 int24 internal constant MAX_TICK = -MIN_TICK; /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK) uint160 internal constant MIN_SQRT_RATIO = 4295128739; /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK) uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; /// @notice Calculates sqrt(1.0001^tick) * 2^96 /// @dev Throws if |tick| > max tick /// @param tick The input tick for the above formula /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0) /// at the given tick function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) { uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick)); require(absTick <= uint256(MAX_TICK), 'T'); uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000; if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128; if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128; if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128; if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128; if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128; if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128; if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128; if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128; if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128; if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128; if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128; if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128; if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128; if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128; if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128; if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128; if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128; if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128; if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128; if (tick > 0) ratio = type(uint256).max / ratio; // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96. // we then downcast because we know the result always fits within 160 bits due to our tick input constraint // we round up in the division so getTickAtSqrtRatio of the output price is always consistent sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)); } /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may /// ever return. /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96 /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) { // second inequality must be < because the price can never reach the price at the max tick require(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO, 'R'); uint256 ratio = uint256(sqrtPriceX96) << 32; uint256 r = ratio; uint256 msb = 0; assembly { let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(5, gt(r, 0xFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(4, gt(r, 0xFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(3, gt(r, 0xFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(2, gt(r, 0xF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(1, gt(r, 0x3)) msb := or(msb, f) r := shr(f, r) } assembly { let f := gt(r, 0x1) msb := or(msb, f) } if (msb >= 128) r = ratio >> (msb - 127); else r = ratio << (127 - msb); int256 log_2 = (int256(msb) - 128) << 64; assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(63, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(62, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(61, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(60, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(59, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(58, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(57, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(56, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(55, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(54, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(53, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(52, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(51, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(50, f)) } int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128); int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128); tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow; } }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.7.5; import '@openzeppelin/contracts/token/ERC721/IERC721.sol'; /// @title ERC721 with permit /// @notice Extension to ERC721 that includes a permit function for signature based approvals interface IERC721Permit is IERC721 { /// @notice The permit typehash used in the permit signature /// @return The typehash for the permit function PERMIT_TYPEHASH() external pure returns (bytes32); /// @notice The domain separator used in the permit signature /// @return The domain seperator used in encoding of permit signature function DOMAIN_SEPARATOR() external view returns (bytes32); /// @notice Approve of a specific token ID for spending by spender via signature /// @param spender The account that is being approved /// @param tokenId The ID of the token that is being approved for spending /// @param deadline The deadline timestamp by which the call must be mined for the approve to work /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s` /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s` /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v` function permit( address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external payable; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.7.5; pragma abicoder v2; import '@openzeppelin/contracts/token/ERC721/IERC721Metadata.sol'; import '@openzeppelin/contracts/token/ERC721/IERC721Enumerable.sol'; import './IPoolInitializer.sol'; import './IERC721Permit.sol'; import './IPeripheryPayments.sol'; import './IPeripheryImmutableState.sol'; import '../libraries/PoolAddress.sol'; /// @title Non-fungible token for positions /// @notice Wraps Uniswap V3 positions in a non-fungible token interface which allows for them to be transferred /// and authorized. interface INonfungiblePositionManager is IPoolInitializer, IPeripheryPayments, IPeripheryImmutableState, IERC721Metadata, IERC721Enumerable, IERC721Permit { /// @notice Emitted when liquidity is increased for a position NFT /// @dev Also emitted when a token is minted /// @param tokenId The ID of the token for which liquidity was increased /// @param liquidity The amount by which liquidity for the NFT position was increased /// @param amount0 The amount of token0 that was paid for the increase in liquidity /// @param amount1 The amount of token1 that was paid for the increase in liquidity event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1); /// @notice Emitted when liquidity is decreased for a position NFT /// @param tokenId The ID of the token for which liquidity was decreased /// @param liquidity The amount by which liquidity for the NFT position was decreased /// @param amount0 The amount of token0 that was accounted for the decrease in liquidity /// @param amount1 The amount of token1 that was accounted for the decrease in liquidity event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1); /// @notice Emitted when tokens are collected for a position NFT /// @dev The amounts reported may not be exactly equivalent to the amounts transferred, due to rounding behavior /// @param tokenId The ID of the token for which underlying tokens were collected /// @param recipient The address of the account that received the collected tokens /// @param amount0 The amount of token0 owed to the position that was collected /// @param amount1 The amount of token1 owed to the position that was collected event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1); /// @notice Returns the position information associated with a given token ID. /// @dev Throws if the token ID is not valid. /// @param tokenId The ID of the token that represents the position /// @return nonce The nonce for permits /// @return operator The address that is approved for spending /// @return token0 The address of the token0 for a specific pool /// @return token1 The address of the token1 for a specific pool /// @return fee The fee associated with the pool /// @return tickLower The lower end of the tick range for the position /// @return tickUpper The higher end of the tick range for the position /// @return liquidity The liquidity of the position /// @return feeGrowthInside0LastX128 The fee growth of token0 as of the last action on the individual position /// @return feeGrowthInside1LastX128 The fee growth of token1 as of the last action on the individual position /// @return tokensOwed0 The uncollected amount of token0 owed to the position as of the last computation /// @return tokensOwed1 The uncollected amount of token1 owed to the position as of the last computation function positions(uint256 tokenId) external view returns ( uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1 ); struct MintParams { address token0; address token1; uint24 fee; int24 tickLower; int24 tickUpper; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; address recipient; uint256 deadline; } /// @notice Creates a new position wrapped in a NFT /// @dev Call this when the pool does exist and is initialized. Note that if the pool is created but not initialized /// a method does not exist, i.e. the pool is assumed to be initialized. /// @param params The params necessary to mint a position, encoded as `MintParams` in calldata /// @return tokenId The ID of the token that represents the minted position /// @return liquidity The amount of liquidity for this position /// @return amount0 The amount of token0 /// @return amount1 The amount of token1 function mint(MintParams calldata params) external payable returns ( uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1 ); struct IncreaseLiquidityParams { uint256 tokenId; uint256 amount0Desired; uint256 amount1Desired; uint256 amount0Min; uint256 amount1Min; uint256 deadline; } /// @notice Increases the amount of liquidity in a position, with tokens paid by the `msg.sender` /// @param params tokenId The ID of the token for which liquidity is being increased, /// amount0Desired The desired amount of token0 to be spent, /// amount1Desired The desired amount of token1 to be spent, /// amount0Min The minimum amount of token0 to spend, which serves as a slippage check, /// amount1Min The minimum amount of token1 to spend, which serves as a slippage check, /// deadline The time by which the transaction must be included to effect the change /// @return liquidity The new liquidity amount as a result of the increase /// @return amount0 The amount of token0 to acheive resulting liquidity /// @return amount1 The amount of token1 to acheive resulting liquidity function increaseLiquidity(IncreaseLiquidityParams calldata params) external payable returns ( uint128 liquidity, uint256 amount0, uint256 amount1 ); struct DecreaseLiquidityParams { uint256 tokenId; uint128 liquidity; uint256 amount0Min; uint256 amount1Min; uint256 deadline; } /// @notice Decreases the amount of liquidity in a position and accounts it to the position /// @param params tokenId The ID of the token for which liquidity is being decreased, /// amount The amount by which liquidity will be decreased, /// amount0Min The minimum amount of token0 that should be accounted for the burned liquidity, /// amount1Min The minimum amount of token1 that should be accounted for the burned liquidity, /// deadline The time by which the transaction must be included to effect the change /// @return amount0 The amount of token0 accounted to the position's tokens owed /// @return amount1 The amount of token1 accounted to the position's tokens owed function decreaseLiquidity(DecreaseLiquidityParams calldata params) external payable returns (uint256 amount0, uint256 amount1); struct CollectParams { uint256 tokenId; address recipient; uint128 amount0Max; uint128 amount1Max; } /// @notice Collects up to a maximum amount of fees owed to a specific position to the recipient /// @param params tokenId The ID of the NFT for which tokens are being collected, /// recipient The account that should receive the tokens, /// amount0Max The maximum amount of token0 to collect, /// amount1Max The maximum amount of token1 to collect /// @return amount0 The amount of fees collected in token0 /// @return amount1 The amount of fees collected in token1 function collect(CollectParams calldata params) external payable returns (uint256 amount0, uint256 amount1); /// @notice Burns a token ID, which deletes it from the NFT contract. The token must have 0 liquidity and all tokens /// must be collected first. /// @param tokenId The ID of the token that is being burned function burn(uint256 tokenId) external payable; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Immutable state /// @notice Functions that return immutable state of the router interface IPeripheryImmutableState { /// @return Returns the address of the Uniswap V3 factory function factory() external view returns (address); /// @return Returns the address of WETH9 function WETH9() external view returns (address); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.7.5; /// @title Periphery Payments /// @notice Functions to ease deposits and withdrawals of ETH interface IPeripheryPayments { /// @notice Unwraps the contract's WETH9 balance and sends it to recipient as ETH. /// @dev The amountMinimum parameter prevents malicious contracts from stealing WETH9 from users. /// @param amountMinimum The minimum amount of WETH9 to unwrap /// @param recipient The address receiving ETH function unwrapWETH9(uint256 amountMinimum, address recipient) external payable; /// @notice Refunds any ETH balance held by this contract to the `msg.sender` /// @dev Useful for bundling with mint or increase liquidity that uses ether, or exact output swaps /// that use ether for the input amount function refundETH() external payable; /// @notice Transfers the full amount of a token held by this contract to recipient /// @dev The amountMinimum parameter prevents malicious contracts from stealing the token from users /// @param token The contract address of the token which will be transferred to `recipient` /// @param amountMinimum The minimum amount of token required for a transfer /// @param recipient The destination address of the token function sweepToken( address token, uint256 amountMinimum, address recipient ) external payable; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.7.5; pragma abicoder v2; /// @title Creates and initializes V3 Pools /// @notice Provides a method for creating and initializing a pool, if necessary, for bundling with other methods that /// require the pool to exist. interface IPoolInitializer { /// @notice Creates a new pool if it does not exist, then initializes if not initialized /// @dev This method can be bundled with others via IMulticall for the first action (e.g. mint) performed against a pool /// @param token0 The contract address of token0 of the pool /// @param token1 The contract address of token1 of the pool /// @param fee The fee amount of the v3 pool for the specified token pair /// @param sqrtPriceX96 The initial square root price of the pool as a Q64.96 value /// @return pool Returns the pool address based on the pair of tokens and fee, will return the newly created pool address if necessary function createAndInitializePoolIfNecessary( address token0, address token1, uint24 fee, uint160 sqrtPriceX96 ) external payable returns (address pool); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Provides functions for deriving a pool address from the factory, tokens, and the fee library PoolAddress { bytes32 internal constant POOL_INIT_CODE_HASH = 0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54; /// @notice The identifying key of the pool struct PoolKey { address token0; address token1; uint24 fee; } /// @notice Returns PoolKey: the ordered tokens with the matched fee levels /// @param tokenA The first token of a pool, unsorted /// @param tokenB The second token of a pool, unsorted /// @param fee The fee level of the pool /// @return Poolkey The pool details with ordered token0 and token1 assignments function getPoolKey( address tokenA, address tokenB, uint24 fee ) internal pure returns (PoolKey memory) { if (tokenA > tokenB) (tokenA, tokenB) = (tokenB, tokenA); return PoolKey({token0: tokenA, token1: tokenB, fee: fee}); } /// @notice Deterministically computes the pool address given the factory and PoolKey /// @param factory The Uniswap V3 factory contract address /// @param key The PoolKey /// @return pool The contract address of the V3 pool function computeAddress(address factory, PoolKey memory key) internal pure returns (address pool) { require(key.token0 < key.token1); pool = address( uint256( keccak256( abi.encodePacked( hex'ff', factory, keccak256(abi.encode(key.token0, key.token1, key.fee)), POOL_INIT_CODE_HASH ) ) ) ); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.6; interface IERC20Metadata { function decimals() external view returns (uint8); }
{ "metadata": { "bytecodeHash": "none" }, "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_game","type":"uint256"},{"indexed":true,"internalType":"address","name":"gameWallet","type":"address"},{"indexed":true,"internalType":"address","name":"userWallet","type":"address"},{"indexed":false,"internalType":"uint256","name":"_cost","type":"uint256"}],"name":"GameWalletSelected","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":"uint256","name":"_game","type":"uint256"},{"indexed":true,"internalType":"address","name":"_winningSelection","type":"address"},{"indexed":false,"internalType":"address","name":"_winner","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountWon","type":"uint256"}],"name":"ProcessWinner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"collectFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentGame","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"gameCostTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gameCostUSDX96","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gameEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"gamePlayers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"gameResults","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGameCostTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"safeTokenPriceUSDX96","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newPriceX96","type":"uint256"}],"name":"setGameCostUSDX96","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_is","type":"bool"}],"name":"setGameEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"withdrawLP","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040526008805460ff191660011790556c640000000000000000000000006009553480156200002f57600080fd5b50604080518082018252600a8152694465626175636865727960b01b60208083019182528351808501909452600684526545584345535360d01b9084015281519192916200008091600391620002cd565b50805162000096906004906020840190620002cd565b50506005805460ff19166012179055506000620000b262000153565b60058054610100600160a81b0319166101006001600160a01b03841690810291909117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506200011262000153565b600680546001600160a01b0319166001600160a01b039283161790819055426007556200014d91166b204fce5e3e2502611000000062000157565b62000379565b3390565b6001600160a01b038216620001b3576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b620001c16000838362000266565b620001dd816002546200026b60201b62000aae1790919060201c565b6002556001600160a01b038216600090815260208181526040909120546200021091839062000aae6200026b821b17901c565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b505050565b600082820183811015620002c6576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b828054600181600116156101000203166002900490600052602060002090601f01602090048101928262000305576000855562000350565b82601f106200032057805160ff191683800117855562000350565b8280016001018555821562000350579182015b828111156200035057825182559160200191906001019062000333565b506200035e92915062000362565b5090565b5b808211156200035e576000815560010162000363565b6125b080620003896000396000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c8063715018a6116100de578063d145c89511610097578063e4456ecb11610071578063e4456ecb14610313578063e68e917e14610326578063f2fde38b1461032e578063fdba1b7c146103415761018e565b8063d145c895146102f0578063dd62ed3e146102f8578063e1565ca91461030b5761018e565b8063715018a61461029f5780638da5cb5b146102a757806395d89b41146102af578063a457c2d7146102b7578063a9059cbb146102ca578063b17acdcd146102dd5761018e565b8063313ce5671161014b5780635f01b1d1116101255780635f01b1d11461025c57806360b663bb1461026457806362e2961b1461026c57806370a082311461028c5761018e565b8063313ce567146102215780633870c1991461023657806339509351146102495761018e565b806306fdde0314610193578063095ea7b3146101b15780631297a1f7146101d157806318160ddd146101e657806323b872dd146101fb57806330a542a51461020e575b600080fd5b61019b610354565b6040516101a89190612312565b60405180910390f35b6101c46101bf366004612091565b6103ea565b6040516101a89190612307565b6101e46101df366004612184565b610407565b005b6101ee610492565b6040516101a891906123a8565b6101c4610209366004612051565b610498565b6101ee61021c3660046121a4565b610520565b610229610532565b6040516101a891906123b1565b6101e46102443660046121a4565b61053b565b6101c4610257366004612091565b6105af565b6101ee6105fd565b6101ee61060c565b61027f61027a3660046121d4565b610612565b6040516101a8919061226c565b6101ee61029a366004611fe1565b610638565b6101e4610653565b61027f610705565b61019b610719565b6101c46102c5366004612091565b61077a565b6101c46102d8366004612091565b6107e2565b6101e46102eb3660046121a4565b6107f6565b6101ee6108b2565b6101ee610306366004612019565b6108bc565b6101c46108e7565b6101e46103213660046121a4565b6108f0565b6101ee61097f565b6101e461033c366004611fe1565b610985565b61027f61034f3660046121a4565b610a93565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103e05780601f106103b5576101008083540402835291602001916103e0565b820191906000526020600020905b8154815290600101906020018083116103c357829003601f168201915b5050505050905090565b60006103fe6103f7610b08565b8484610b0c565b50600192915050565b61040f610b08565b6001600160a01b0316610420610705565b6001600160a01b031614610469576040805162461bcd60e51b815260206004820181905260248201526000805160206124f5833981519152604482015290519081900360640190fd5b60085460ff161515811515141561047f57600080fd5b6008805460ff1916911515919091179055565b60025490565b60006104a5848484610bf8565b610515846104b1610b08565b610510856040518060600160405280602881526020016124cd602891396001600160a01b038a166000908152600160205260408120906104ef610b08565b6001600160a01b031681526020810191909152604001600020549190610e3e565b610b0c565b5060015b9392505050565b600c6020526000908152604090205481565b60055460ff1690565b610543610b08565b6001600160a01b0316610554610705565b6001600160a01b03161461059d576040805162461bcd60e51b815260206004820181905260248201526000805160206124f5833981519152604482015290519081900360640190fd5b600081116105aa57600080fd5b600955565b60006103fe6105bc610b08565b8461051085600160006105cd610b08565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490610aae565b6000610607610ed5565b905090565b600a5481565b600b6020908152600092835260408084209091529082529020546001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b61065b610b08565b6001600160a01b031661066c610705565b6001600160a01b0316146106b5576040805162461bcd60e51b815260206004820181905260248201526000805160206124f5833981519152604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103e05780601f106103b5576101008083540402835291602001916103e0565b60006103fe610787610b08565b846105108560405180606001604052806025815260200161257f60259139600160006107b1610b08565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190610e3e565b60006103fe6107ef610b08565b8484610bf8565b604080516080810182528281526006546001600160a01b031660208201526001600160801b038183018190526060820152905163fc6f786560e01b815273c36442b4a4522e871399cd717abdd847ab11fe889163fc6f78659161085c9190600401612365565b6040805180830381600087803b15801561087557600080fd5b505af1158015610889573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ad91906121f8565b505050565b6000610607610efe565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60085460ff1681565b600754610e1001421161090257600080fd5b6006546040516323b872dd60e01b815273c36442b4a4522e871399cd717abdd847ab11fe88916323b872dd9161094a9130916001600160a01b03909116908690600401612280565b600060405180830381600087803b15801561096457600080fd5b505af1158015610978573d6000803e3d6000fd5b5050505050565b60095481565b61098d610b08565b6001600160a01b031661099e610705565b6001600160a01b0316146109e7576040805162461bcd60e51b815260206004820181905260248201526000805160206124f5833981519152604482015290519081900360640190fd5b6001600160a01b038116610a2c5760405162461bcd60e51b815260040180806020018281038252602681526020018061245f6026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600d602052600090815260409020546001600160a01b031681565b600082820183811015610519576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b3390565b6001600160a01b038316610b515760405162461bcd60e51b815260040180806020018281038252602481526020018061255b6024913960400191505060405180910390fd5b6001600160a01b038216610b965760405162461bcd60e51b81526004018080602001828103825260228152602001806124856022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b4260075560085460ff1615610e1657610c1082610f6c565b15610df257600e54610ce157600a8054600190810191829055600e805490910190556000908152600b602090815260408083206001600160a01b038681168552925290912080546001600160a01b031916918516919091179055610c72610ed5565b600a80546000908152600c60205260408082209390935590548082528282205492519194509192506001600160a01b0385169184917f889ee12c04a79a360d375c6079356f2686c941fa79559c9a21fd739c2dbdb74e90610cd49086906123a8565b60405180910390a4610ded565b600a546000908152600b602090815260408083206001600160a01b03868116855292529091205416610de95750600e80546001019055600a80546000908152600b602090815260408083206001600160a01b039586168452825280832080546001600160a01b03191695871695861790559254808352600c9091528282205492519193918491907f889ee12c04a79a360d375c6079356f2686c941fa79559c9a21fd739c2dbdb74e90610d959086906123a8565b60405180910390a4600e54600a1415610de457600a54600f805460018101825560009182527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac8020191909155600e555b610ded565b5060005b610e16565b600f5415801590610e095750610e09838383610f96565b15610e1657610e16611014565b6001600160a01b038216610e3357610e2e8382611227565b6108ad565b6108ad838383611323565b60008184841115610ecd5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610e92578181015183820152602001610e7a565b50505050905090810190601f168015610ebf5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000610edf610efe565b610ee7610532565b60ff16600a0a6009540281610ef857fe5b04905090565b600080610f0961147e565b90506000610f156114b5565b90506000610f378373a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486114d8565b90506000610f598373c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26114d8565b600160601b920291909104949350505050565b60006001600160a01b03821615801590610f905750600a6001600160a01b03831611155b92915050565b600080610fa16114b5565b9050806001600160a01b0316856001600160a01b03161480610fd45750806001600160a01b0316846001600160a01b0316145b1561100957600954600202610fe7610532565b60ff16600a0a84610ff6610efe565b0281610ffe57fe5b041015915050610519565b506000949350505050565b6000600f60008154811061102457fe5b90600052602060002001549050600f6001600f80549050038154811061104657fe5b9060005260206000200154600f60008154811061105f57fe5b600091825260209091200155600f80548061107657fe5b600190038181906000526020600020016000905590556000444283600c6000868152602001908152602001600020546110ad610efe565b6110b861029a6114b5565b73a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486370a082316110da61147e565b6040518263ffffffff1660e01b81526004016110f6919061226c565b60206040518083038186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114691906121bc565b60405160200161115c979695949392919061223c565b60408051808303601f1901815291815281516020928301206000858152600b84528281206001600160a01b036001600a85060181811680855292875285842054898552600c885286852054600d9098529590932080546001600160a01b031916909217909155919450929116906064610384909102046111dc8282611750565b826001600160a01b0316857f9cb0994495978043df8ed94b4a35910e143f5b9aa8d442d8d817fa0caf656bed84846040516112189291906122a4565b60405180910390a35050505050565b6001600160a01b03821661126c5760405162461bcd60e51b81526004018080602001828103825260218152602001806125156021913960400191505060405180910390fd5b611278826000836108ad565b6112b58160405180606001604052806022815260200161243d602291396001600160a01b0385166000908152602081905260409020549190610e3e565b6001600160a01b0383166000908152602081905260409020556002546112db9082611840565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b0383166113685760405162461bcd60e51b81526004018080602001828103825260258152602001806125366025913960400191505060405180910390fd5b6001600160a01b0382166113ad5760405162461bcd60e51b815260040180806020018281038252602381526020018061241a6023913960400191505060405180910390fd5b6113b88383836108ad565b6113f5816040518060600160405280602681526020016124a7602691396001600160a01b0386166000908152602081905260409020549190610e3e565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546114249082610aae565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600061060773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486101f461189d565b60006106073073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc261271061189d565b600080836001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561151457600080fd5b505afa158015611528573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154c9190611ffd565b90506000846001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561158957600080fd5b505afa15801561159d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c19190611ffd565b6001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156115f957600080fd5b505afa15801561160d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611631919061221b565b90506000826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561166e57600080fd5b505afa158015611682573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a6919061221b565b905060006116b387611912565b905060006116c082611a5c565b90506000876001600160a01b0316866001600160a01b0316146116f05781600160c01b816116ea57fe5b046116f2565b815b9050876001600160a01b0316866001600160a01b03161461172a578460ff16600a0a8460ff16600a0a82028161172457fe5b04611743565b8360ff16600a0a8560ff16600a0a82028161174157fe5b045b9998505050505050505050565b6001600160a01b0382166117ab576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6117b7600083836108ad565b6002546117c49082610aae565b6002556001600160a01b0382166000908152602081905260409020546117ea9082610aae565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b600082821115611897576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008060006118ac8686611a76565b9150915060006040518060600160405280846001600160a01b03168152602001836001600160a01b031681526020018662ffffff1681525090506000611906731f98431c8ad98523631ae4a59f267346ea31f98483611aa7565b98975050505050505050565b60408051600280825260608201835260009261012c9285928592602083019080368337019050509050828160008151811061194957fe5b602002602001019063ffffffff16908163ffffffff168152505060008160018151811061197257fe5b63ffffffff9092166020928302919091019091015260405163883bdbfd60e01b81526000906001600160a01b0384169063883bdbfd906119b69085906004016122bd565b60006040518083038186803b1580156119ce57600080fd5b505afa1580156119e2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611a0a91908101906120bc565b509050611a528463ffffffff1682600081518110611a2457fe5b602002602001015183600181518110611a3957fe5b60200260200101510360060b81611a4c57fe5b05611b8b565b9695505050505050565b6000610f906001600160a01b03831680600160601b611ebd565b600080826001600160a01b0316846001600160a01b031610611a99578284611a9c565b83835b915091509250929050565b600081602001516001600160a01b031682600001516001600160a01b031610611acf57600080fd5b50805160208083015160409384015184516001600160a01b0394851681850152939091168385015262ffffff166060808401919091528351808403820181526080840185528051908301206001600160f81b031960a085015294901b6bffffffffffffffffffffffff191660a183015260b58201939093527fe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b5460d5808301919091528251808303909101815260f5909101909152805191012090565b60008060008360020b12611ba2578260020b611baa565b8260020b6000035b9050620d89e8811115611be8576040805162461bcd60e51b81526020600482015260016024820152601560fa1b604482015290519081900360640190fd5b600060018216611bfc57600160801b611c0e565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615611c42576ffff97272373d413259a46990580e213a0260801c5b6004821615611c61576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b6008821615611c80576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b6010821615611c9f576fffcb9843d60f6159c9db58835c9266440260801c5b6020821615611cbe576fff973b41fa98c081472e6896dfb254c00260801c5b6040821615611cdd576fff2ea16466c96a3843ec78b326b528610260801c5b6080821615611cfc576ffe5dee046a99a2a811c461f1969c30530260801c5b610100821615611d1c576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b610200821615611d3c576ff987a7253ac413176f2b074cf7815e540260801c5b610400821615611d5c576ff3392b0822b70005940c7a398e4b70f30260801c5b610800821615611d7c576fe7159475a2c29b7443b29c7fa6e889d90260801c5b611000821615611d9c576fd097f3bdfd2022b8845ad8f792aa58250260801c5b612000821615611dbc576fa9f746462d870fdf8a65dc1f90e061e50260801c5b614000821615611ddc576f70d869a156d2a1b890bb3df62baf32f70260801c5b618000821615611dfc576f31be135f97d08fd981231505542fcfa60260801c5b62010000821615611e1d576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b62020000821615611e3d576e5d6af8dedb81196699c329225ee6040260801c5b62040000821615611e5c576d2216e584f5fa1ea926041bedfe980260801c5b62080000821615611e79576b048a170391f7dc42444e8fa20260801c5b60008460020b1315611e94578060001981611e9057fe5b0490505b640100000000810615611ea8576001611eab565b60005b60ff16602082901c0192505050919050565b6000808060001985870986860292508281109083900303905080611ef35760008411611ee857600080fd5b508290049050610519565b808411611eff57600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b600082601f830112611f7c578081fd5b81516020611f91611f8c836123e3565b6123bf565b8281528181019085830183850287018401881015611fad578586fd5b855b85811015611fd4578151611fc281612401565b84529284019290840190600101611faf565b5090979650505050505050565b600060208284031215611ff2578081fd5b813561051981612401565b60006020828403121561200e578081fd5b815161051981612401565b6000806040838503121561202b578081fd5b823561203681612401565b9150602083013561204681612401565b809150509250929050565b600080600060608486031215612065578081fd5b833561207081612401565b9250602084013561208081612401565b929592945050506040919091013590565b600080604083850312156120a3578182fd5b82356120ae81612401565b946020939093013593505050565b600080604083850312156120ce578182fd5b825167ffffffffffffffff808211156120e5578384fd5b818501915085601f8301126120f8578384fd5b81516020612108611f8c836123e3565b82815281810190858301838502870184018b1015612124578889fd5b8896505b848710156121545780518060060b811461214057898afd5b835260019690960195918301918301612128565b509188015191965090935050508082111561216d578283fd5b5061217a85828601611f6c565b9150509250929050565b600060208284031215612195578081fd5b81358015158114610519578182fd5b6000602082840312156121b5578081fd5b5035919050565b6000602082840312156121cd578081fd5b5051919050565b600080604083850312156121e6578182fd5b82359150602083013561204681612401565b6000806040838503121561220a578182fd5b505080516020909101519092909150565b60006020828403121561222c578081fd5b815160ff81168114610519578182fd5b968752602087019590955260408601939093526060850191909152608084015260a083015260c082015260e00190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b818110156122fb57835163ffffffff16835292840192918401916001016122d9565b50909695505050505050565b901515815260200190565b6000602080835283518082850152825b8181101561233e57858101830151858201604001528201612322565b8181111561234f5783604083870101525b50601f01601f1916929092016040019392505050565b815181526020808301516001600160a01b0316908201526040808301516001600160801b0390811691830191909152606092830151169181019190915260800190565b90815260200190565b60ff91909116815260200190565b60405181810167ffffffffffffffff811182821017156123db57fe5b604052919050565b600067ffffffffffffffff8211156123f757fe5b5060209081020190565b6001600160a01b038116811461241657600080fd5b5056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa164736f6c6343000706000a
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c8063715018a6116100de578063d145c89511610097578063e4456ecb11610071578063e4456ecb14610313578063e68e917e14610326578063f2fde38b1461032e578063fdba1b7c146103415761018e565b8063d145c895146102f0578063dd62ed3e146102f8578063e1565ca91461030b5761018e565b8063715018a61461029f5780638da5cb5b146102a757806395d89b41146102af578063a457c2d7146102b7578063a9059cbb146102ca578063b17acdcd146102dd5761018e565b8063313ce5671161014b5780635f01b1d1116101255780635f01b1d11461025c57806360b663bb1461026457806362e2961b1461026c57806370a082311461028c5761018e565b8063313ce567146102215780633870c1991461023657806339509351146102495761018e565b806306fdde0314610193578063095ea7b3146101b15780631297a1f7146101d157806318160ddd146101e657806323b872dd146101fb57806330a542a51461020e575b600080fd5b61019b610354565b6040516101a89190612312565b60405180910390f35b6101c46101bf366004612091565b6103ea565b6040516101a89190612307565b6101e46101df366004612184565b610407565b005b6101ee610492565b6040516101a891906123a8565b6101c4610209366004612051565b610498565b6101ee61021c3660046121a4565b610520565b610229610532565b6040516101a891906123b1565b6101e46102443660046121a4565b61053b565b6101c4610257366004612091565b6105af565b6101ee6105fd565b6101ee61060c565b61027f61027a3660046121d4565b610612565b6040516101a8919061226c565b6101ee61029a366004611fe1565b610638565b6101e4610653565b61027f610705565b61019b610719565b6101c46102c5366004612091565b61077a565b6101c46102d8366004612091565b6107e2565b6101e46102eb3660046121a4565b6107f6565b6101ee6108b2565b6101ee610306366004612019565b6108bc565b6101c46108e7565b6101e46103213660046121a4565b6108f0565b6101ee61097f565b6101e461033c366004611fe1565b610985565b61027f61034f3660046121a4565b610a93565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103e05780601f106103b5576101008083540402835291602001916103e0565b820191906000526020600020905b8154815290600101906020018083116103c357829003601f168201915b5050505050905090565b60006103fe6103f7610b08565b8484610b0c565b50600192915050565b61040f610b08565b6001600160a01b0316610420610705565b6001600160a01b031614610469576040805162461bcd60e51b815260206004820181905260248201526000805160206124f5833981519152604482015290519081900360640190fd5b60085460ff161515811515141561047f57600080fd5b6008805460ff1916911515919091179055565b60025490565b60006104a5848484610bf8565b610515846104b1610b08565b610510856040518060600160405280602881526020016124cd602891396001600160a01b038a166000908152600160205260408120906104ef610b08565b6001600160a01b031681526020810191909152604001600020549190610e3e565b610b0c565b5060015b9392505050565b600c6020526000908152604090205481565b60055460ff1690565b610543610b08565b6001600160a01b0316610554610705565b6001600160a01b03161461059d576040805162461bcd60e51b815260206004820181905260248201526000805160206124f5833981519152604482015290519081900360640190fd5b600081116105aa57600080fd5b600955565b60006103fe6105bc610b08565b8461051085600160006105cd610b08565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490610aae565b6000610607610ed5565b905090565b600a5481565b600b6020908152600092835260408084209091529082529020546001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b61065b610b08565b6001600160a01b031661066c610705565b6001600160a01b0316146106b5576040805162461bcd60e51b815260206004820181905260248201526000805160206124f5833981519152604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103e05780601f106103b5576101008083540402835291602001916103e0565b60006103fe610787610b08565b846105108560405180606001604052806025815260200161257f60259139600160006107b1610b08565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190610e3e565b60006103fe6107ef610b08565b8484610bf8565b604080516080810182528281526006546001600160a01b031660208201526001600160801b038183018190526060820152905163fc6f786560e01b815273c36442b4a4522e871399cd717abdd847ab11fe889163fc6f78659161085c9190600401612365565b6040805180830381600087803b15801561087557600080fd5b505af1158015610889573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ad91906121f8565b505050565b6000610607610efe565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60085460ff1681565b600754610e1001421161090257600080fd5b6006546040516323b872dd60e01b815273c36442b4a4522e871399cd717abdd847ab11fe88916323b872dd9161094a9130916001600160a01b03909116908690600401612280565b600060405180830381600087803b15801561096457600080fd5b505af1158015610978573d6000803e3d6000fd5b5050505050565b60095481565b61098d610b08565b6001600160a01b031661099e610705565b6001600160a01b0316146109e7576040805162461bcd60e51b815260206004820181905260248201526000805160206124f5833981519152604482015290519081900360640190fd5b6001600160a01b038116610a2c5760405162461bcd60e51b815260040180806020018281038252602681526020018061245f6026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600d602052600090815260409020546001600160a01b031681565b600082820183811015610519576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b3390565b6001600160a01b038316610b515760405162461bcd60e51b815260040180806020018281038252602481526020018061255b6024913960400191505060405180910390fd5b6001600160a01b038216610b965760405162461bcd60e51b81526004018080602001828103825260228152602001806124856022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b4260075560085460ff1615610e1657610c1082610f6c565b15610df257600e54610ce157600a8054600190810191829055600e805490910190556000908152600b602090815260408083206001600160a01b038681168552925290912080546001600160a01b031916918516919091179055610c72610ed5565b600a80546000908152600c60205260408082209390935590548082528282205492519194509192506001600160a01b0385169184917f889ee12c04a79a360d375c6079356f2686c941fa79559c9a21fd739c2dbdb74e90610cd49086906123a8565b60405180910390a4610ded565b600a546000908152600b602090815260408083206001600160a01b03868116855292529091205416610de95750600e80546001019055600a80546000908152600b602090815260408083206001600160a01b039586168452825280832080546001600160a01b03191695871695861790559254808352600c9091528282205492519193918491907f889ee12c04a79a360d375c6079356f2686c941fa79559c9a21fd739c2dbdb74e90610d959086906123a8565b60405180910390a4600e54600a1415610de457600a54600f805460018101825560009182527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac8020191909155600e555b610ded565b5060005b610e16565b600f5415801590610e095750610e09838383610f96565b15610e1657610e16611014565b6001600160a01b038216610e3357610e2e8382611227565b6108ad565b6108ad838383611323565b60008184841115610ecd5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610e92578181015183820152602001610e7a565b50505050905090810190601f168015610ebf5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000610edf610efe565b610ee7610532565b60ff16600a0a6009540281610ef857fe5b04905090565b600080610f0961147e565b90506000610f156114b5565b90506000610f378373a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486114d8565b90506000610f598373c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26114d8565b600160601b920291909104949350505050565b60006001600160a01b03821615801590610f905750600a6001600160a01b03831611155b92915050565b600080610fa16114b5565b9050806001600160a01b0316856001600160a01b03161480610fd45750806001600160a01b0316846001600160a01b0316145b1561100957600954600202610fe7610532565b60ff16600a0a84610ff6610efe565b0281610ffe57fe5b041015915050610519565b506000949350505050565b6000600f60008154811061102457fe5b90600052602060002001549050600f6001600f80549050038154811061104657fe5b9060005260206000200154600f60008154811061105f57fe5b600091825260209091200155600f80548061107657fe5b600190038181906000526020600020016000905590556000444283600c6000868152602001908152602001600020546110ad610efe565b6110b861029a6114b5565b73a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486370a082316110da61147e565b6040518263ffffffff1660e01b81526004016110f6919061226c565b60206040518083038186803b15801561110e57600080fd5b505afa158015611122573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114691906121bc565b60405160200161115c979695949392919061223c565b60408051808303601f1901815291815281516020928301206000858152600b84528281206001600160a01b036001600a85060181811680855292875285842054898552600c885286852054600d9098529590932080546001600160a01b031916909217909155919450929116906064610384909102046111dc8282611750565b826001600160a01b0316857f9cb0994495978043df8ed94b4a35910e143f5b9aa8d442d8d817fa0caf656bed84846040516112189291906122a4565b60405180910390a35050505050565b6001600160a01b03821661126c5760405162461bcd60e51b81526004018080602001828103825260218152602001806125156021913960400191505060405180910390fd5b611278826000836108ad565b6112b58160405180606001604052806022815260200161243d602291396001600160a01b0385166000908152602081905260409020549190610e3e565b6001600160a01b0383166000908152602081905260409020556002546112db9082611840565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b0383166113685760405162461bcd60e51b81526004018080602001828103825260258152602001806125366025913960400191505060405180910390fd5b6001600160a01b0382166113ad5760405162461bcd60e51b815260040180806020018281038252602381526020018061241a6023913960400191505060405180910390fd5b6113b88383836108ad565b6113f5816040518060600160405280602681526020016124a7602691396001600160a01b0386166000908152602081905260409020549190610e3e565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546114249082610aae565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600061060773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486101f461189d565b60006106073073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc261271061189d565b600080836001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561151457600080fd5b505afa158015611528573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154c9190611ffd565b90506000846001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561158957600080fd5b505afa15801561159d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c19190611ffd565b6001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156115f957600080fd5b505afa15801561160d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611631919061221b565b90506000826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561166e57600080fd5b505afa158015611682573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a6919061221b565b905060006116b387611912565b905060006116c082611a5c565b90506000876001600160a01b0316866001600160a01b0316146116f05781600160c01b816116ea57fe5b046116f2565b815b9050876001600160a01b0316866001600160a01b03161461172a578460ff16600a0a8460ff16600a0a82028161172457fe5b04611743565b8360ff16600a0a8560ff16600a0a82028161174157fe5b045b9998505050505050505050565b6001600160a01b0382166117ab576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6117b7600083836108ad565b6002546117c49082610aae565b6002556001600160a01b0382166000908152602081905260409020546117ea9082610aae565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b600082821115611897576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008060006118ac8686611a76565b9150915060006040518060600160405280846001600160a01b03168152602001836001600160a01b031681526020018662ffffff1681525090506000611906731f98431c8ad98523631ae4a59f267346ea31f98483611aa7565b98975050505050505050565b60408051600280825260608201835260009261012c9285928592602083019080368337019050509050828160008151811061194957fe5b602002602001019063ffffffff16908163ffffffff168152505060008160018151811061197257fe5b63ffffffff9092166020928302919091019091015260405163883bdbfd60e01b81526000906001600160a01b0384169063883bdbfd906119b69085906004016122bd565b60006040518083038186803b1580156119ce57600080fd5b505afa1580156119e2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611a0a91908101906120bc565b509050611a528463ffffffff1682600081518110611a2457fe5b602002602001015183600181518110611a3957fe5b60200260200101510360060b81611a4c57fe5b05611b8b565b9695505050505050565b6000610f906001600160a01b03831680600160601b611ebd565b600080826001600160a01b0316846001600160a01b031610611a99578284611a9c565b83835b915091509250929050565b600081602001516001600160a01b031682600001516001600160a01b031610611acf57600080fd5b50805160208083015160409384015184516001600160a01b0394851681850152939091168385015262ffffff166060808401919091528351808403820181526080840185528051908301206001600160f81b031960a085015294901b6bffffffffffffffffffffffff191660a183015260b58201939093527fe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b5460d5808301919091528251808303909101815260f5909101909152805191012090565b60008060008360020b12611ba2578260020b611baa565b8260020b6000035b9050620d89e8811115611be8576040805162461bcd60e51b81526020600482015260016024820152601560fa1b604482015290519081900360640190fd5b600060018216611bfc57600160801b611c0e565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615611c42576ffff97272373d413259a46990580e213a0260801c5b6004821615611c61576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b6008821615611c80576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b6010821615611c9f576fffcb9843d60f6159c9db58835c9266440260801c5b6020821615611cbe576fff973b41fa98c081472e6896dfb254c00260801c5b6040821615611cdd576fff2ea16466c96a3843ec78b326b528610260801c5b6080821615611cfc576ffe5dee046a99a2a811c461f1969c30530260801c5b610100821615611d1c576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b610200821615611d3c576ff987a7253ac413176f2b074cf7815e540260801c5b610400821615611d5c576ff3392b0822b70005940c7a398e4b70f30260801c5b610800821615611d7c576fe7159475a2c29b7443b29c7fa6e889d90260801c5b611000821615611d9c576fd097f3bdfd2022b8845ad8f792aa58250260801c5b612000821615611dbc576fa9f746462d870fdf8a65dc1f90e061e50260801c5b614000821615611ddc576f70d869a156d2a1b890bb3df62baf32f70260801c5b618000821615611dfc576f31be135f97d08fd981231505542fcfa60260801c5b62010000821615611e1d576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b62020000821615611e3d576e5d6af8dedb81196699c329225ee6040260801c5b62040000821615611e5c576d2216e584f5fa1ea926041bedfe980260801c5b62080000821615611e79576b048a170391f7dc42444e8fa20260801c5b60008460020b1315611e94578060001981611e9057fe5b0490505b640100000000810615611ea8576001611eab565b60005b60ff16602082901c0192505050919050565b6000808060001985870986860292508281109083900303905080611ef35760008411611ee857600080fd5b508290049050610519565b808411611eff57600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b600082601f830112611f7c578081fd5b81516020611f91611f8c836123e3565b6123bf565b8281528181019085830183850287018401881015611fad578586fd5b855b85811015611fd4578151611fc281612401565b84529284019290840190600101611faf565b5090979650505050505050565b600060208284031215611ff2578081fd5b813561051981612401565b60006020828403121561200e578081fd5b815161051981612401565b6000806040838503121561202b578081fd5b823561203681612401565b9150602083013561204681612401565b809150509250929050565b600080600060608486031215612065578081fd5b833561207081612401565b9250602084013561208081612401565b929592945050506040919091013590565b600080604083850312156120a3578182fd5b82356120ae81612401565b946020939093013593505050565b600080604083850312156120ce578182fd5b825167ffffffffffffffff808211156120e5578384fd5b818501915085601f8301126120f8578384fd5b81516020612108611f8c836123e3565b82815281810190858301838502870184018b1015612124578889fd5b8896505b848710156121545780518060060b811461214057898afd5b835260019690960195918301918301612128565b509188015191965090935050508082111561216d578283fd5b5061217a85828601611f6c565b9150509250929050565b600060208284031215612195578081fd5b81358015158114610519578182fd5b6000602082840312156121b5578081fd5b5035919050565b6000602082840312156121cd578081fd5b5051919050565b600080604083850312156121e6578182fd5b82359150602083013561204681612401565b6000806040838503121561220a578182fd5b505080516020909101519092909150565b60006020828403121561222c578081fd5b815160ff81168114610519578182fd5b968752602087019590955260408601939093526060850191909152608084015260a083015260c082015260e00190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b818110156122fb57835163ffffffff16835292840192918401916001016122d9565b50909695505050505050565b901515815260200190565b6000602080835283518082850152825b8181101561233e57858101830151858201604001528201612322565b8181111561234f5783604083870101525b50601f01601f1916929092016040019392505050565b815181526020808301516001600160a01b0316908201526040808301516001600160801b0390811691830191909152606092830151169181019190915260800190565b90815260200190565b60ff91909116815260200190565b60405181810167ffffffffffffffff811182821017156123db57fe5b604052919050565b600067ffffffffffffffff8211156123f757fe5b5060209081020190565b6001600160a01b038116811461241657600080fd5b5056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa164736f6c6343000706000a
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.