Verified contractPartialBUSL-1.1
UniswapV3Pool
Address0x49228c8a08fe69bd34228491e4ae712dfd6c3e4e
- Balance
0 ETH
- Transactions
1
- Compiler
solc 0.7.6
- Same code
31,750 more contracts
Details
- Compiler
- solc 0.7.6+commit.7338295f
- Language
- solidity
- Optimization
- Yes, 800 runs
- EVM version
- istanbul
- License
- BUSL-1.1
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 20,018,289
- Creation transaction
- 0xec8d36791f…28577b50f7
- Main copy (most transactions)
- 0xe0554a47…6d32939f
96 files
The source code is large: one file is shown at a time. Choose a file in the list.
- contracts/UniswapV3Pool.solmain35.5 KB
- ./contracts/NoDelegateCall.sol1.08 KB
- ./contracts/UniswapV3Pool.sol35.5 KB
- ./contracts/interfaces/IERC20Minimal.sol3.07 KB
- ./contracts/interfaces/IUniswapV3Factory.sol4.04 KB
- ./contracts/interfaces/IUniswapV3Pool.sol809 B
- ./contracts/interfaces/IUniswapV3PoolDeployer.sol1.3 KB
- ./contracts/interfaces/callback/IUniswapV3FlashCallback.sol982 B
- ./contracts/interfaces/callback/IUniswapV3MintCallback.sol980 B
- ./contracts/interfaces/callback/IUniswapV3SwapCallback.sol1.29 KB
- ./contracts/interfaces/pool/IUniswapV3PoolActions.sol6.3 KB
- ./contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol2.6 KB
- ./contracts/interfaces/pool/IUniswapV3PoolEvents.sol5.96 KB
- ./contracts/interfaces/pool/IUniswapV3PoolImmutables.sol1.81 KB
- ./contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol1.19 KB
- ./contracts/interfaces/pool/IUniswapV3PoolState.sol6.51 KB
- ./contracts/libraries/BitMath.sol2.79 KB
- ./contracts/libraries/FixedPoint128.sol311 B
- ./contracts/libraries/FixedPoint96.sol380 B
- ./contracts/libraries/FullMath.sol5.12 KB
- ./contracts/libraries/LiquidityMath.sol622 B
- ./contracts/libraries/LowGasSafeMath.sol1.7 KB
- ./contracts/libraries/Oracle.sol16.41 KB
- ./contracts/libraries/Position.sol3.58 KB
- ./contracts/libraries/SafeCast.sol1.05 KB
- ./contracts/libraries/SqrtPriceMath.sol10.77 KB
- ./contracts/libraries/SwapMath.sol4.63 KB
- ./contracts/libraries/Tick.sol9.52 KB
- ./contracts/libraries/TickBitmap.sol4.11 KB
- ./contracts/libraries/TickMath.sol8.64 KB
- ./contracts/libraries/TransferHelper.sol933 B
- ./contracts/libraries/UnsafeMath.sol660 B
- contracts/@uniswap/v3-core/contracts/NoDelegateCall.sol1.08 KB
- contracts/@uniswap/v3-core/contracts/VitDEXPool.sol35.5 KB
- contracts/@uniswap/v3-core/contracts/interfaces/IERC20Minimal.sol3.07 KB
- contracts/@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol4.04 KB
- contracts/@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol809 B
- contracts/@uniswap/v3-core/contracts/interfaces/IUniswapV3PoolDeployer.sol1.3 KB
- contracts/@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3FlashCallback.sol982 B
- contracts/@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3MintCallback.sol980 B
- contracts/@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol1.29 KB
- contracts/@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolActions.sol6.3 KB
- contracts/@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol2.6 KB
- contracts/@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolEvents.sol5.96 KB
- contracts/@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol1.81 KB
- contracts/@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol1.19 KB
- contracts/@uniswap/v3-core/contracts/interfaces/pool/IUniswapV3PoolState.sol6.51 KB
- contracts/@uniswap/v3-core/contracts/libraries/BitMath.sol2.79 KB
- contracts/@uniswap/v3-core/contracts/libraries/FixedPoint128.sol311 B
- contracts/@uniswap/v3-core/contracts/libraries/FixedPoint96.sol380 B
- contracts/@uniswap/v3-core/contracts/libraries/FullMath.sol5.13 KB
- contracts/@uniswap/v3-core/contracts/libraries/LiquidityMath.sol622 B
- contracts/@uniswap/v3-core/contracts/libraries/LowGasSafeMath.sol1.7 KB
- contracts/@uniswap/v3-core/contracts/libraries/Oracle.sol16.42 KB
- contracts/@uniswap/v3-core/contracts/libraries/Position.sol3.58 KB
- contracts/@uniswap/v3-core/contracts/libraries/SafeCast.sol1.05 KB
- contracts/@uniswap/v3-core/contracts/libraries/SqrtPriceMath.sol10.77 KB
- contracts/@uniswap/v3-core/contracts/libraries/SwapMath.sol4.63 KB
- contracts/@uniswap/v3-core/contracts/libraries/Tick.sol9.71 KB
- contracts/@uniswap/v3-core/contracts/libraries/TickBitmap.sol4.11 KB
- contracts/@uniswap/v3-core/contracts/libraries/TickMath.sol8.65 KB
- contracts/@uniswap/v3-core/contracts/libraries/TransferHelper.sol933 B
- contracts/@uniswap/v3-core/contracts/libraries/UnsafeMath.sol660 B
- contracts/NoDelegateCall.sol1.08 KB
- contracts/UniswapV3Factory.sol2.85 KB
- contracts/UniswapV3PoolDeployer.sol1.41 KB
- contracts/UniswapV3Pool_VerifiedByNG.sol35.51 KB
- contracts/interfaces/IERC20Minimal.sol3.07 KB
- contracts/interfaces/IUniswapV3Factory.sol4.04 KB
- contracts/interfaces/IUniswapV3Pool.sol809 B
- contracts/interfaces/IUniswapV3PoolDeployer.sol1.3 KB
- contracts/interfaces/callback/IUniswapV3FlashCallback.sol982 B
- contracts/interfaces/callback/IUniswapV3MintCallback.sol980 B
- contracts/interfaces/callback/IUniswapV3SwapCallback.sol1.29 KB
- contracts/interfaces/pool/IUniswapV3PoolActions.sol6.3 KB
- contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol2.6 KB
- contracts/interfaces/pool/IUniswapV3PoolEvents.sol5.96 KB
- contracts/interfaces/pool/IUniswapV3PoolImmutables.sol1.81 KB
- contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol1.19 KB
- contracts/interfaces/pool/IUniswapV3PoolState.sol6.51 KB
- contracts/libraries/BitMath.sol2.79 KB
- contracts/libraries/FixedPoint128.sol311 B
- contracts/libraries/FixedPoint96.sol380 B
- contracts/libraries/FullMath.sol5.13 KB
- contracts/libraries/LiquidityMath.sol622 B
- contracts/libraries/LowGasSafeMath.sol1.7 KB
- contracts/libraries/Oracle.sol16.42 KB
- contracts/libraries/Position.sol3.58 KB
- contracts/libraries/SafeCast.sol1.05 KB
- contracts/libraries/SqrtPriceMath.sol10.77 KB
- contracts/libraries/SwapMath.sol4.63 KB
- contracts/libraries/Tick.sol9.71 KB
- contracts/libraries/TickBitmap.sol4.11 KB
- contracts/libraries/TickMath.sol8.65 KB
- contracts/libraries/TransferHelper.sol933 B
- contracts/libraries/UnsafeMath.sol660 B
contracts/libraries/TickBitmap.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.5.0;
import './BitMath.sol';
/// @title Packed tick initialized state library
/// @notice Stores a packed mapping of tick index to its initialized state
/// @dev The mapping uses int16 for keys since ticks are represented as int24 and there are 256 (2^8) values per word.
library TickBitmap {
/// @notice Computes the position in the mapping where the initialized bit for a tick lives
/// @param tick The tick for which to compute the position
/// @return wordPos The key in the mapping containing the word in which the bit is stored
/// @return bitPos The bit position in the word where the flag is stored
function position(int24 tick) private pure returns (int16 wordPos, uint8 bitPos) {
wordPos = int16(tick >> 8);
bitPos = uint8(tick % 256);
}
/// @notice Flips the initialized state for a given tick from false to true, or vice versa
/// @param self The mapping in which to flip the tick
/// @param tick The tick to flip
/// @param tickSpacing The spacing between usable ticks
function flipTick(
mapping(int16 => uint256) storage self,
int24 tick,
int24 tickSpacing
) internal {
require(tick % tickSpacing == 0); // ensure that the tick is spaced
(int16 wordPos, uint8 bitPos) = position(tick / tickSpacing);
uint256 mask = 1 << bitPos;
self[wordPos] ^= mask;
}
/// @notice Returns the next initialized tick contained in the same word (or adjacent word) as the tick that is either
/// to the left (less than or equal to) or right (greater than) of the given tick
/// @param self The mapping in which to compute the next initialized tick
/// @param tick The starting tick
/// @param tickSpacing The spacing between usable ticks
/// @param lte Whether to search for the next initialized tick to the left (less than or equal to the starting tick)
/// @return next The next initialized or uninitialized tick up to 256 ticks away from the current tick
/// @return initialized Whether the next tick is initialized, as the function only searches within up to 256 ticks
function nextInitializedTickWithinOneWord(
mapping(int16 => uint256) storage self,
int24 tick,
int24 tickSpacing,
bool lte
) internal view returns (int24 next, bool initialized) {
int24 compressed = tick / tickSpacing;
if (tick < 0 && tick % tickSpacing != 0) compressed--; // round towards negative infinity
if (lte) {
(int16 wordPos, uint8 bitPos) = position(compressed);
// all the 1s at or to the right of the current bitPos
uint256 mask = (1 << bitPos) - 1 + (1 << bitPos);
uint256 masked = self[wordPos] & mask;
// if there are no initialized ticks to the right of or at the current tick, return rightmost in the word
initialized = masked != 0;
// overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick
next = initialized
? (compressed - int24(bitPos - BitMath.mostSignificantBit(masked))) * tickSpacing
: (compressed - int24(bitPos)) * tickSpacing;
} else {
// start from the word of the next tick, since the current tick state doesn't matter
(int16 wordPos, uint8 bitPos) = position(compressed + 1);
// all the 1s at or to the left of the bitPos
uint256 mask = ~((1 << bitPos) - 1);
uint256 masked = self[wordPos] & mask;
// if there are no initialized ticks to the left of the current tick, return leftmost in the word
initialized = masked != 0;
// overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick
next = initialized
? (compressed + 1 + int24(BitMath.leastSignificantBit(masked) - bitPos)) * tickSpacing
: (compressed + 1 + int24(type(uint8).max - bitPos)) * tickSpacing;
}
}
}
Compiler settingsShow
{
"metadata": {
"bytecodeHash": "none"
},
"libraries": {},
"optimizer": {
"runs": 800,
"enabled": true
},
"evmVersion": "istanbul",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.