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/FullMath.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.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++;
}
}
}
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.