false
false
0

Contract Address Details

0x5D2cc072D1972f6a81696aCBd9bc51B324C45E57

Contract Name
ColdfiV3PoolDeployer
Creator
0x25a861–9aa76e at 0x2e1365–ed2375
Balance
0 CLO
Tokens
Fetching tokens...
Transactions
1 Transactions
Transfers
0 Transfers
Gas Used
45,048
Last Balance Update
16816070
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
ColdfiV3PoolDeployer




Optimization enabled
true
Compiler version
v0.7.6+commit.7338295f




Optimization runs
400
EVM Version
istanbul




Verified at
2024-11-17T12:17:54.550317Z

contracts/ColdfiV3PoolDeployer.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;
import './interfaces/IColdfiV3PoolDeployer.sol';
import './ColdfiV3Pool.sol';
contract ColdfiV3PoolDeployer is IColdfiV3PoolDeployer {
struct Parameters {
address factory;
address token0;
address token1;
uint24 fee;
int24 tickSpacing;
}
/// @inheritdoc IColdfiV3PoolDeployer
Parameters public override parameters;
address public factoryAddress;
/// @notice Emitted when factory address is set
event SetFactoryAddress(address indexed factory);
modifier onlyFactory() {
require(msg.sender == factoryAddress, "only factory can call deploy");
_;
}
function setFactoryAddress(address _factoryAddress) external {
require(factoryAddress == address(0), "already initialized");
factoryAddress = _factoryAddress;
emit SetFactoryAddress(_factoryAddress);
}
/// @dev Deploys a pool with the given parameters by transiently setting the parameters storage slot and then
/// clearing it after deploying the pool.
/// @param factory The contract address of the ColdfiSwap V3 factory
/// @param token0 The first token of the pool by address sort order
 
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/ColdfiV3Pool.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;
import './interfaces/IColdfiV3Pool.sol';
import './libraries/LowGasSafeMath.sol';
import './libraries/SafeCast.sol';
import './libraries/Tick.sol';
import './libraries/TickBitmap.sol';
import './libraries/Position.sol';
import './libraries/Oracle.sol';
import './libraries/FullMath.sol';
import './libraries/FixedPoint128.sol';
import './libraries/TransferHelper.sol';
import './libraries/TickMath.sol';
import './libraries/LiquidityMath.sol';
import './libraries/SqrtPriceMath.sol';
import './libraries/SwapMath.sol';
import './interfaces/IColdfiV3PoolDeployer.sol';
import './interfaces/IColdfiV3Factory.sol';
import './interfaces/IERC20Minimal.sol';
import './interfaces/callback/IColdfiV3MintCallback.sol';
import './interfaces/callback/IColdfiV3SwapCallback.sol';
import './interfaces/callback/IColdfiV3FlashCallback.sol';
contract ColdfiV3Pool is IColdfiV3Pool {
using LowGasSafeMath for uint256;
using LowGasSafeMath for int256;
using SafeCast for uint256;
using SafeCast for int256;
using Tick for mapping(int24 => Tick.Info);
using TickBitmap for mapping(int16 => uint256);
using Position for mapping(bytes32 => Position.Info);
using Position for Position.Info;
using Oracle for Oracle.Observation[65535];
/// @inheritdoc IColdfiV3PoolImmutables
address public immutable override factory;
 
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/interfaces/IColdfiV3Factory.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title The interface for the ColdfiSwap V3 Factory
/// @notice The ColdfiSwap V3 Factory facilitates creation of ColdfiSwap V3 pools and control over the protocol fees
interface IColdfiV3Factory {
struct TickSpacingExtraInfo {
bool whitelistRequested;
bool enabled;
}
/// @notice Emitted when the owner of the factory is changed
/// @param oldOwner The owner before the owner was changed
/// @param newOwner The owner after the owner was changed
event OwnerChanged(address indexed oldOwner, address indexed newOwner);
/// @notice Emitted when a pool is created
/// @param token0 The first token of the pool by address sort order
/// @param token1 The second token of the pool by address sort order
/// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
/// @param tickSpacing The minimum number of ticks between initialized ticks
/// @param pool The address of the created pool
event PoolCreated(
address indexed token0,
address indexed token1,
uint24 indexed fee,
int24 tickSpacing,
address pool
);
/// @notice Emitted when a new fee amount is enabled for pool creation via the factory
/// @param fee The enabled fee, denominated in hundredths of a bip
/// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee
event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);
event FeeAmountExtraInfoUpdated(uint24 indexed fee, bool whitelistRequested, bool enabled);
event WhiteListAdded(address indexed user, bool verified);
/// @notice Returns the current owner of the factory
/// @dev Can be changed by the current owner via setOwner
 
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/interfaces/IColdfiV3Pool.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
import './pool/IColdfiV3PoolImmutables.sol';
import './pool/IColdfiV3PoolState.sol';
import './pool/IColdfiV3PoolDerivedState.sol';
import './pool/IColdfiV3PoolActions.sol';
import './pool/IColdfiV3PoolOwnerActions.sol';
import './pool/IColdfiV3PoolEvents.sol';
/// @title The interface for a ColdfiSwap V3 Pool
/// @notice A ColdfiSwap 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 IColdfiV3Pool is
IColdfiV3PoolImmutables,
IColdfiV3PoolState,
IColdfiV3PoolDerivedState,
IColdfiV3PoolActions,
IColdfiV3PoolOwnerActions,
IColdfiV3PoolEvents
{
}
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/interfaces/IColdfiV3PoolDeployer.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title An interface for a contract that is capable of deploying ColdfiSwap V3 Pools
/// @notice A contract that constructs a pool must implement this to pass arguments to the pool
/// @dev This is used to avoid having constructor arguments in the pool contract, which results in the init code hash
/// of the pool being constant allowing the CREATE2 address of the pool to be cheaply computed on-chain
interface IColdfiV3PoolDeployer {
/// @notice Get the parameters to be used in constructing the pool, set transiently during pool creation.
/// @dev Called by the pool constructor to fetch the parameters of the pool
/// Returns factory The factory address
/// Returns token0 The first token of the pool by address sort order
/// Returns token1 The second token of the pool by address sort order
/// Returns fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
/// Returns tickSpacing The minimum number of ticks between initialized ticks
function parameters()
external
view
returns (
address factory,
address token0,
address token1,
uint24 fee,
int24 tickSpacing
);
function deploy(
address factory,
address token0,
address token1,
uint24 fee,
int24 tickSpacing
) external returns (address pool);
}
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/interfaces/IERC20Minimal.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Minimal ERC20 interface for ColdfiSwap
/// @notice Contains a subset of the full ERC20 interface that is used in ColdfiSwap V3
interface IERC20Minimal {
/// @notice Returns the balance of a token
/// @param account The account for which to look up the number of tokens it has, i.e. its balance
/// @return The number of tokens held by the account
function balanceOf(address account) external view returns (uint256);
/// @notice Transfers the amount of token from the `msg.sender` to the recipient
/// @param recipient The account that will receive the amount transferred
/// @param amount The number of tokens to send from the sender to the recipient
/// @return Returns true for a successful transfer, false for an unsuccessful transfer
function transfer(address recipient, uint256 amount) external returns (bool);
/// @notice Returns the current allowance given to a spender by an owner
/// @param owner The account of the token owner
/// @param spender The account of the token spender
/// @return The current allowance granted by `owner` to `spender`
function allowance(address owner, address spender) external view returns (uint256);
/// @notice Sets the allowance of a spender from the `msg.sender` to the value `amount`
/// @param spender The account which will be allowed to spend a given amount of the owners tokens
/// @param amount The amount of tokens allowed to be used by `spender`
/// @return Returns true for a successful approval, false for unsuccessful
function approve(address spender, uint256 amount) external returns (bool);
/// @notice Transfers `amount` tokens from `sender` to `recipient` up to the allowance given to the `msg.sender`
/// @param sender The account from which the transfer will be initiated
/// @param recipient The recipient of the transfer
/// @param amount The amount of the transfer
/// @return Returns true for a successful transfer, false for unsuccessful
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/// @notice Event emitted when tokens are transferred from one address to another, either via `#transfer` or `#transferFrom`.
 
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/interfaces/callback/IColdfiV3FlashCallback.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Callback for IColdfiV3PoolActions#flash
/// @notice Any contract that calls IColdfiV3PoolActions#flash must implement this interface
interface IColdfiV3FlashCallback {
/// @notice Called to `msg.sender` after transferring to the recipient from IColdfiV3Pool#flash.
/// @dev In the implementation you must repay the pool the tokens sent by flash plus the computed fee amounts.
/// The caller of this method must be checked to be a ColdfiV3Pool deployed by the canonical ColdfiV3Factory.
/// @param fee0 The fee amount in token0 due to the pool by the end of the flash
/// @param fee1 The fee amount in token1 due to the pool by the end of the flash
/// @param data Any data passed through by the caller via the IColdfiV3PoolActions#flash call
function coldfiV3FlashCallback(
uint256 fee0,
uint256 fee1,
bytes calldata data
) external;
}
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/interfaces/callback/IColdfiV3MintCallback.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Callback for IColdfiV3PoolActions#mint
/// @notice Any contract that calls IColdfiV3PoolActions#mint must implement this interface
interface IColdfiV3MintCallback {
/// @notice Called to `msg.sender` after minting liquidity to a position from IColdfiV3Pool#mint.
/// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.
/// The caller of this method must be checked to be a ColdfiV3Pool deployed by the canonical ColdfiV3Factory.
/// @param amount0Owed The amount of token0 due to the pool for the minted liquidity
/// @param amount1Owed The amount of token1 due to the pool for the minted liquidity
/// @param data Any data passed through by the caller via the IColdfiV3PoolActions#mint call
function coldfiV3MintCallback(
uint256 amount0Owed,
uint256 amount1Owed,
bytes calldata data
) external;
}
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/interfaces/callback/IColdfiV3SwapCallback.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Callback for IColdfiV3PoolActions#swap
/// @notice Any contract that calls IColdfiV3PoolActions#swap must implement this interface
interface IColdfiV3SwapCallback {
/// @notice Called to `msg.sender` after executing a swap via IColdfiV3Pool#swap.
/// @dev In the implementation you must pay the pool tokens owed for the swap.
/// The caller of this method must be checked to be a ColdfiV3Pool deployed by the canonical ColdfiV3Factory.
/// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.
/// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
/// the end of the swap. If positive, the callback must send that amount of token0 to the pool.
/// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
/// the end of the swap. If positive, the callback must send that amount of token1 to the pool.
/// @param data Any data passed through by the caller via the IColdfiV3PoolActions#swap call
function coldfiV3SwapCallback(
int256 amount0Delta,
int256 amount1Delta,
bytes calldata data
) external;
}
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/interfaces/pool/IColdfiV3PoolActions.sol

// 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 IColdfiV3PoolActions {
/// @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 IColdfiV3MintCallback#coldfiV3MintCallback
/// 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
 
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/interfaces/pool/IColdfiV3PoolDerivedState.sol

// 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 IColdfiV3PoolDerivedState {
/// @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
);
}
 
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/interfaces/pool/IColdfiV3PoolEvents.sol

// 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 IColdfiV3PoolEvents {
/// @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,
 
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/interfaces/pool/IColdfiV3PoolImmutables.sol

// 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 IColdfiV3PoolImmutables {
/// @notice The contract that deployed the pool, which must adhere to the IColdfiV3Factory 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);
}
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/interfaces/pool/IColdfiV3PoolOwnerActions.sol

// 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 IColdfiV3PoolOwnerActions {
/// @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(uint32 feeProtocol0, uint32 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);
}
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/interfaces/pool/IColdfiV3PoolState.sol

// 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 IColdfiV3PoolState {
/// @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,
uint32 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);
 
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/libraries/BitMath.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title BitMath
/// @dev This library provides functionality for computing bit properties of an unsigned integer
library BitMath {
/// @notice Returns the index of the most significant bit of the number,
/// where the least significant bit is at index 0 and the most significant bit is at index 255
/// @dev The function satisfies the property:
/// x >= 2**mostSignificantBit(x) and x < 2**(mostSignificantBit(x)+1)
/// @param x the value for which to compute the most significant bit, must be greater than 0
/// @return r the index of the most significant bit
function mostSignificantBit(uint256 x) internal pure returns (uint8 r) {
require(x > 0);
if (x >= 0x100000000000000000000000000000000) {
x >>= 128;
r += 128;
}
if (x >= 0x10000000000000000) {
x >>= 64;
r += 64;
}
if (x >= 0x100000000) {
x >>= 32;
r += 32;
}
if (x >= 0x10000) {
x >>= 16;
r += 16;
}
if (x >= 0x100) {
x >>= 8;
r += 8;
}
if (x >= 0x10) {
x >>= 4;
r += 4;
}
if (x >= 0x4) {
x >>= 2;
 
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/libraries/FixedPoint128.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.4.0;
/// @title FixedPoint128
/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format)
library FixedPoint128 {
uint256 internal constant Q128 = 0x100000000000000000000000000000000;
}
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/libraries/FixedPoint96.sol

// 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;
}
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/libraries/FullMath.sol

// SPDX-License-Identifier: GPL-2.0-or-later
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.
 
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/libraries/LiquidityMath.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Math library for liquidity
library LiquidityMath {
/// @notice Add a signed liquidity delta to liquidity and revert if it overflows or underflows
/// @param x The liquidity before change
/// @param y The delta by which liquidity should be changed
/// @return z The liquidity delta
function addDelta(uint128 x, int128 y) internal pure returns (uint128 z) {
if (y < 0) {
require((z = x - uint128(-y)) < x, 'LS');
} else {
require((z = x + uint128(y)) >= x, 'LA');
}
}
}
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/libraries/LowGasSafeMath.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.0;
/// @title Optimized overflow and underflow safe math operations
/// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost
library LowGasSafeMath {
/// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
/// @notice Returns x - y, reverts if underflows
/// @param x The minuend
/// @param y The subtrahend
/// @return z The difference of x and y
function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x - y) <= x);
}
/// @notice Returns x * y, reverts if overflows
/// @param x The multiplicand
/// @param y The multiplier
/// @return z The product of x and y
function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(x == 0 || (z = x * y) / x == y);
}
/// @notice Returns x + y, reverts if overflows or underflows
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(int256 x, int256 y) internal pure returns (int256 z) {
require((z = x + y) >= x == (y >= 0));
}
/// @notice Returns x - y, reverts if overflows or underflows
/// @param x The minuend
/// @param y The subtrahend
 
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/libraries/Oracle.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0 <0.8.0;
/// @title Oracle
/// @notice Provides price and liquidity data useful for a wide variety of system designs
/// @dev Instances of stored oracle data, "observations", are collected in the oracle array
/// Every pool is initialized with an oracle array length of 1. Anyone can pay the SSTOREs to increase the
/// maximum length of the oracle array. New slots will be added when the array is fully populated.
/// Observations are overwritten when the full length of the oracle array is populated.
/// The most recent observation is available, independent of the length of the oracle array, by passing 0 to observe()
library Oracle {
struct Observation {
// the block timestamp of the observation
uint32 blockTimestamp;
// the tick accumulator, i.e. tick * time elapsed since the pool was first initialized
int56 tickCumulative;
// the seconds per liquidity, i.e. seconds elapsed / max(1, liquidity) since the pool was first initialized
uint160 secondsPerLiquidityCumulativeX128;
// whether or not the observation is initialized
bool initialized;
}
/// @notice Transforms a previous observation into a new observation, given the passage of time and the current tick and liquidity values
/// @dev blockTimestamp _must_ be chronologically equal to or greater than last.blockTimestamp, safe for 0 or 1 overflows
/// @param last The specified observation to be transformed
/// @param blockTimestamp The timestamp of the new observation
/// @param tick The active tick at the time of the new observation
/// @param liquidity The total in-range liquidity at the time of the new observation
/// @return Observation The newly populated observation
function transform(
Observation memory last,
uint32 blockTimestamp,
int24 tick,
uint128 liquidity
) private pure returns (Observation memory) {
uint32 delta = blockTimestamp - last.blockTimestamp;
return
Observation({
blockTimestamp: blockTimestamp,
tickCumulative: last.tickCumulative + int56(tick) * delta,
secondsPerLiquidityCumulativeX128: last.secondsPerLiquidityCumulativeX128 +
 
 
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/libraries/Position.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0 <0.8.0;
import './FullMath.sol';
import './FixedPoint128.sol';
import './LiquidityMath.sol';
/// @title Position
/// @notice Positions represent an owner address' liquidity between a lower and upper tick boundary
/// @dev Positions store additional state for tracking fees owed to the position
library Position {
// info stored for each user's position
struct Info {
// the amount of liquidity owned by this position
uint128 liquidity;
// fee growth per unit of liquidity as of the last update to liquidity or fees owed
uint256 feeGrowthInside0LastX128;
uint256 feeGrowthInside1LastX128;
// the fees owed to the position owner in token0/token1
uint128 tokensOwed0;
uint128 tokensOwed1;
}
/// @notice Returns the Info struct of a position, given an owner and position boundaries
/// @param self The mapping containing all user positions
/// @param owner The address of the position owner
/// @param tickLower The lower tick boundary of the position
/// @param tickUpper The upper tick boundary of the position
/// @return position The position info struct of the given owners' position
function get(
mapping(bytes32 => Info) storage self,
address owner,
int24 tickLower,
int24 tickUpper
) internal view returns (Position.Info storage position) {
position = self[keccak256(abi.encodePacked(owner, tickLower, tickUpper))];
}
/// @notice Credits accumulated fees to a user's position
/// @param self The individual position to update
/// @param liquidityDelta The change in pool liquidity as a result of the position update
 
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/libraries/SafeCast.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Safe casting methods
/// @notice Contains methods for safely casting between types
library SafeCast {
/// @notice Cast a uint256 to a uint160, revert on overflow
/// @param y The uint256 to be downcasted
/// @return z The downcasted integer, now type uint160
function toUint160(uint256 y) internal pure returns (uint160 z) {
require((z = uint160(y)) == y);
}
/// @notice Cast a int256 to a int128, revert on overflow or underflow
/// @param y The int256 to be downcasted
/// @return z The downcasted integer, now type int128
function toInt128(int256 y) internal pure returns (int128 z) {
require((z = int128(y)) == y);
}
/// @notice Cast a uint256 to a int256, revert on overflow
/// @param y The uint256 to be casted
/// @return z The casted integer, now type int256
function toInt256(uint256 y) internal pure returns (int256 z) {
require(y < 2**255);
z = int256(y);
}
}
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/libraries/SqrtPriceMath.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
import './LowGasSafeMath.sol';
import './SafeCast.sol';
import './FullMath.sol';
import './UnsafeMath.sol';
import './FixedPoint96.sol';
/// @title Functions based on Q64.96 sqrt price and liquidity
/// @notice Contains the math that uses square root of price as a Q64.96 and liquidity to compute deltas
library SqrtPriceMath {
using LowGasSafeMath for uint256;
using SafeCast for uint256;
/// @notice Gets the next sqrt price given a delta of token0
/// @dev Always rounds up, because in the exact output case (increasing price) we need to move the price at least
/// far enough to get the desired output amount, and in the exact input case (decreasing price) we need to move the
/// price less in order to not send too much output.
/// The most precise formula for this is liquidity * sqrtPX96 / (liquidity +- amount * sqrtPX96),
/// if this is impossible because of overflow, we calculate liquidity / (liquidity / sqrtPX96 +- amount).
/// @param sqrtPX96 The starting price, i.e. before accounting for the token0 delta
/// @param liquidity The amount of usable liquidity
/// @param amount How much of token0 to add or remove from virtual reserves
/// @param add Whether to add or remove the amount of token0
/// @return The price after adding or removing amount, depending on add
function getNextSqrtPriceFromAmount0RoundingUp(
uint160 sqrtPX96,
uint128 liquidity,
uint256 amount,
bool add
) internal pure returns (uint160) {
// we short circuit amount == 0 because the result is otherwise not guaranteed to equal the input price
if (amount == 0) return sqrtPX96;
uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION;
if (add) {
uint256 product;
if ((product = amount * sqrtPX96) / amount == sqrtPX96) {
uint256 denominator = numerator1 + product;
 
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/libraries/SwapMath.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
import './FullMath.sol';
import './SqrtPriceMath.sol';
/// @title Computes the result of a swap within ticks
/// @notice Contains methods for computing the result of a swap within a single tick price range, i.e., a single tick.
library SwapMath {
/// @notice Computes the result of swapping some amount in, or amount out, given the parameters of the swap
/// @dev The fee, plus the amount in, will never exceed the amount remaining if the swap's `amountSpecified` is positive
/// @param sqrtRatioCurrentX96 The current sqrt price of the pool
/// @param sqrtRatioTargetX96 The price that cannot be exceeded, from which the direction of the swap is inferred
/// @param liquidity The usable liquidity
/// @param amountRemaining How much input or output amount is remaining to be swapped in/out
/// @param feePips The fee taken from the input amount, expressed in hundredths of a bip
/// @return sqrtRatioNextX96 The price after swapping the amount in/out, not to exceed the price target
/// @return amountIn The amount to be swapped in, of either token0 or token1, based on the direction of the swap
/// @return amountOut The amount to be received, of either token0 or token1, based on the direction of the swap
/// @return feeAmount The amount of input that will be taken as a fee
function computeSwapStep(
uint160 sqrtRatioCurrentX96,
uint160 sqrtRatioTargetX96,
uint128 liquidity,
int256 amountRemaining,
uint24 feePips
)
internal
pure
returns (
uint160 sqrtRatioNextX96,
uint256 amountIn,
uint256 amountOut,
uint256 feeAmount
)
{
bool zeroForOne = sqrtRatioCurrentX96 >= sqrtRatioTargetX96;
bool exactIn = amountRemaining >= 0;
if (exactIn) {
uint256 amountRemainingLessFee = FullMath.mulDiv(uint256(amountRemaining), 1e6 - feePips, 1e6);
 
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/libraries/Tick.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0 <0.8.0;
import './LowGasSafeMath.sol';
import './SafeCast.sol';
import './TickMath.sol';
import './LiquidityMath.sol';
/// @title Tick
/// @notice Contains functions for managing tick processes and relevant calculations
library Tick {
using LowGasSafeMath for int256;
using SafeCast for int256;
// info stored for each initialized individual tick
struct Info {
// the total position liquidity that references this tick
uint128 liquidityGross;
// amount of net liquidity added (subtracted) when tick is crossed from left to right (right to left),
int128 liquidityNet;
// fee growth per unit of liquidity on the _other_ side of this tick (relative to the current tick)
// only has relative meaning, not absolute — the value depends on when the tick is initialized
uint256 feeGrowthOutside0X128;
uint256 feeGrowthOutside1X128;
// the cumulative tick value on the other side of the tick
int56 tickCumulativeOutside;
// the seconds per unit of liquidity on the _other_ side of this tick (relative to the current tick)
// only has relative meaning, not absolute — the value depends on when the tick is initialized
uint160 secondsPerLiquidityOutsideX128;
// the seconds spent on the other side of the tick (relative to the current tick)
// only has relative meaning, not absolute — the value depends on when the tick is initialized
uint32 secondsOutside;
// true iff the tick is initialized, i.e. the value is exactly equivalent to the expression liquidityGross != 0
// these 8 bits are set to prevent fresh sstores when crossing newly initialized ticks
bool initialized;
}
/// @notice Derives max liquidity per tick from given tick spacing
/// @dev Executed within the pool constructor
/// @param tickSpacing The amount of required tick separation, realized in multiples of `tickSpacing`
 
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/libraries/TickBitmap.sol

// SPDX-License-Identifier: GPL-2.0-or-later
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
 
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/libraries/TickMath.sol

// 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;
 
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/libraries/TransferHelper.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.0;
import '../interfaces/IERC20Minimal.sol';
/// @title TransferHelper
/// @notice Contains helper methods for interacting with ERC20 tokens that do not consistently return true/false
library TransferHelper {
/// @notice Transfers tokens from msg.sender to a recipient
/// @dev Calls transfer on token contract, errors with TF if transfer fails
/// @param token The contract address of the token which will be transferred
/// @param to The recipient of the transfer
/// @param value The value of the transfer
function safeTransfer(
address token,
address to,
uint256 value
) internal {
(bool success, bytes memory data) = token.call(
abi.encodeWithSelector(IERC20Minimal.transfer.selector, to, value)
);
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TF');
}
}
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

contracts/libraries/UnsafeMath.sol

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;
/// @title Math functions that do not check inputs or outputs
/// @notice Contains methods that perform common math functions but do not do any overflow or underflow checks
library UnsafeMath {
/// @notice Returns ceil(x / y)
/// @dev division by 0 has unspecified behavior, and must be checked externally
/// @param x The dividend
/// @param y The divisor
/// @return z The quotient, ceil(x / y)
function divRoundingUp(uint256 x, uint256 y) internal pure returns (uint256 z) {
assembly {
z := add(div(x, y), gt(mod(x, y), 0))
}
}
}
×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”×”
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compiler Settings

{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata"],"":["ast"]}},"optimizer":{"runs":400,"enabled":true},"metadata":{"bytecodeHash":"none"},"libraries":{},"evmVersion":"istanbul"}
              

Contract ABI

[{"type":"event","name":"SetFactoryAddress","inputs":[{"type":"address","name":"factory","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"address","name":"pool","internalType":"address"}],"name":"deploy","inputs":[{"type":"address","name":"factory","internalType":"address"},{"type":"address","name":"token0","internalType":"address"},{"type":"address","name":"token1","internalType":"address"},{"type":"uint24","name":"fee","internalType":"uint24"},{"type":"int24","name":"tickSpacing","internalType":"int24"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"factoryAddress","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"factory","internalType":"address"},{"type":"address","name":"token0","internalType":"address"},{"type":"address","name":"token1","internalType":"address"},{"type":"uint24","name":"fee","internalType":"uint24"},{"type":"int24","name":"tickSpacing","internalType":"int24"}],"name":"parameters","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFactoryAddress","inputs":[{"type":"address","name":"_factoryAddress","internalType":"address"}]}]
              

Contract Creation Code

Verify & Publish
0x608060405234801561001057600080fd5b50615d68806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806383c17c55146100515780638903573014610079578063966dae0e146100c3578063fad5359f146100e7575b600080fd5b6100776004803603602081101561006757600080fd5b50356001600160a01b0316610131565b005b6100816101d9565b604080516001600160a01b0396871681529486166020860152929094168383015262ffffff16606083015260029290920b608082015290519081900360a00190f35b6100cb61020f565b604080516001600160a01b039092168252519081900360200190f35b6100cb600480360360a08110156100fd57600080fd5b506001600160a01b03813581169160208101358216916040820135169062ffffff606082013516906080013560020b61021e565b6003546001600160a01b03161561018f576040805162461bcd60e51b815260206004820152601360248201527f616c726561647920696e697469616c697a656400000000000000000000000000604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0383169081179091556040517fb4dd887347efc97a6ad35fc9824a2ac4c0a6a04344d89bf05f3308c854325a6490600090a250565b600054600154600280546001600160a01b03938416939283169281169162ffffff600160a01b83041691600160b81b9004900b85565b6003546001600160a01b031681565b6003546000906001600160a01b03163314610280576040805162461bcd60e51b815260206004820152601c60248201527f6f6e6c7920666163746f72792063616e2063616c6c206465706c6f7900000000604482015290519081900360640190fd5b6040805160a0810182526001600160a01b03888116808352888216602080850182905292891684860181905262ffffff898116606080880182905260028b810b6080998a01819052600080546001600160a01b03199081169099179055600180548916881790558154909716851762ffffff60a01b1916600160a01b84021762ffffff60b81b1916600160b81b97820b909416969096029290921790945586518086019390935282870191909152818101929092528451808203909201825290920192839052815191012090610355906103c4565b8190604051809103906000f5905080158015610375573d6000803e3d6000fd5b50600080546001600160a01b0319908116909155600180549091169055600280547fffffffffffff00000000000000000000000000000000000000000000000000001690559695505050505050565b61598a806103d28339019056fe6101406040523480156200001257600080fd5b506000336001600160a01b031663890357306040518163ffffffff1660e01b815260040160a06040518083038186803b1580156200004f57600080fd5b505afa15801562000064573d6000803e3d6000fd5b505050506040513d60a08110156200007b57600080fd5b50805160208083015160408401516060808601516080968701516001600160e81b031960e892831b1660e0526001600160601b031993831b841660c05293821b831660a05294901b16909352600283810b900b90911b61010052909150620000ee90829062002ce462000106821b17901c565b60801b6001600160801b031916610120525062000174565b60008082600281900b620d89e719816200011c57fe5b05029050600083600281900b620d89e8816200013457fe5b0502905060008460020b83830360020b816200014c57fe5b0560010190508062ffffff166001600160801b038016816200016a57fe5b0495945050505050565b60805160601c60a05160601c60c05160601c60e05160e81c6101005160e81c6101205160801c615738620002526000398061201b5280614c535280614c8a525080610bf5528061296f5280614cbe5280614cf0525080610ce45280611a005280611a3752806129b75280612b865280612bc85280612c0f5280612c565250806111cd5280611aba5280611f2152806122a052806129935280613f835250806108d052806112fb5280611a895280611ebb528061221a5280613e3a52508061209e52806120c7528061277d52806127a6528061294b52506157386000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c806370cf754a116100ee578063c45a015511610097578063ddca3f4311610071578063ddca3f43146107fe578063f30583991461081e578063f30dba9314610826578063f637731d146108a8576101ae565b8063c45a0155146107cf578063d0c93a7c146107d7578063d21220a7146107f6576101ae565b8063a34123a7116100c8578063a34123a71461070f578063a38807f214610749578063b0d0d211146107a4576101ae565b806370cf754a146105c357806385b66729146105cb578063883bdbfd14610608576101ae565b80633850c7bd1161015b578063490e6cbc11610135578063490e6cbc1461046f5780634f1eb3d8146104f9578063514ea4bf1461054a5780635339c296146105a3576101ae565b80633850c7bd146103595780633c8a7d8d146103b55780634614131914610455576101ae565b80631ad8b03b1161018c5780631ad8b03b146102a8578063252c09d7146102df57806332148f6714610336576101ae565b80630dfe1681146101b3578063128acb08146101d75780631a68650214610284575b600080fd5b6101bb6108ce565b604080516001600160a01b039092168252519081900360200190f35b61026b600480360360a08110156101ed57600080fd5b6001600160a01b0382358116926020810135151592604082013592606083013516919081019060a081016080820135600160201b81111561022d57600080fd5b82018360208201111561023f57600080fd5b803590602001918460018302840111600160201b8311171561026057600080fd5b5090925090506108f2565b6040805192835260208301919091528051918290030190f35b61028c6114ec565b604080516001600160801b039092168252519081900360200190f35b6102b06114fb565b60405180836001600160801b03168152602001826001600160801b031681526020019250505060405180910390f35b6102fc600480360360208110156102f557600080fd5b5035611515565b6040805163ffffffff909516855260069390930b60208501526001600160a01b039091168383015215156060830152519081900360800190f35b6103576004803603602081101561034c57600080fd5b503561ffff1661155a565b005b61036161164c565b604080516001600160a01b03909816885260029690960b602088015261ffff9485168787015292841660608701529216608085015263ffffffff90911660a0840152151560c0830152519081900360e00190f35b61026b600480360360a08110156103cb57600080fd5b6001600160a01b03823516916020810135600290810b92604083013590910b916001600160801b036060820135169181019060a081016080820135600160201b81111561041757600080fd5b82018360208201111561042957600080fd5b803590602001918460018302840111600160201b8311171561044a57600080fd5b5090925090506116a1565b61045d61195f565b60408051918252519081900360200190f35b6103576004803603608081101561048557600080fd5b6001600160a01b038235169160208101359160408201359190810190608081016060820135600160201b8111156104bb57600080fd5b8201836020820111156104cd57600080fd5b803590602001918460018302840111600160201b831117156104ee57600080fd5b509092509050611965565b6102b0600480360360a081101561050f57600080fd5b506001600160a01b03813516906020810135600290810b91604081013590910b906001600160801b0360608201358116916080013516611dac565b6105676004803603602081101561056057600080fd5b5035611fca565b604080516001600160801b0396871681526020810195909552848101939093529084166060840152909216608082015290519081900360a00190f35b61045d600480360360208110156105b957600080fd5b503560010b612007565b61028c612019565b6102b0600480360360608110156105e157600080fd5b506001600160a01b03813516906001600160801b036020820135811691604001351661203d565b6106766004803603602081101561061e57600080fd5b810190602081018135600160201b81111561063857600080fd5b82018360208201111561064a57600080fd5b803590602001918460208302840111600160201b8311171561066b57600080fd5b509092509050612338565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156106ba5781810151838201526020016106a2565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156106f95781810151838201526020016106e1565b5050505090500194505050505060405180910390f35b61026b6004803603606081101561072557600080fd5b508035600290810b91602081013590910b90604001356001600160801b03166123bd565b6107736004803603604081101561075f57600080fd5b508035600290810b9160200135900b612539565b6040805160069490940b84526001600160a01b03909216602084015263ffffffff1682820152519081900360600190f35b610357600480360360408110156107ba57600080fd5b5063ffffffff81358116916020013516612721565b6101bb612949565b6107df61296d565b6040805160029290920b8252519081900360200190f35b6101bb612991565b6108066129b5565b6040805162ffffff9092168252519081900360200190f35b61045d6129d9565b6108466004803603602081101561083c57600080fd5b503560020b6129df565b604080516001600160801b039099168952600f9790970b602089015287870195909552606087019390935260069190910b60808601526001600160a01b031660a085015263ffffffff1660c0840152151560e083015251908190036101000190f35b610357600480360360208110156108be57600080fd5b50356001600160a01b0316612a4b565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000808561092c576040805162461bcd60e51b8152602060048201526002602482015261415360f01b604482015290519081900360640190fd5b6040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b900b602083015261ffff600160b81b8204811693830193909352600160c81b810483166060830152600160d81b9004909116608082015260015463ffffffff811660a083015260ff600160201b90910416151560c082018190526109e4576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b87610a2f5780600001516001600160a01b0316866001600160a01b0316118015610a2a575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038716105b610a61565b80600001516001600160a01b0316866001600160a01b0316108015610a6157506401000276a36001600160a01b038716115b610a98576040805162461bcd60e51b815260206004820152600360248201526214d41360ea1b604482015290519081900360640190fd5b6001805460ff60201b191690556040805160c08101909152600090808a610acd5760108460a0015163ffffffff16901c610ad7565b60a084015161ffff165b63ffffffff1681526005546001600160801b03166020820152604001610afb612d50565b63ffffffff168152602001600060060b815260200160006001600160a01b031681526020016000151581525090506000808913905060006040518060e001604052808b81526020016000815260200185600001516001600160a01b03168152602001856020015160020b81526020018c610b7757600354610b7b565b6002545b815260200160006001600160801b0316815260200184602001516001600160801b031681525090505b805115801590610bca5750886001600160a01b031681604001516001600160a01b031614155b15610fae57610bd76156c8565b60408201516001600160a01b031681526060820151610c1a906007907f00000000000000000000000000000000000000000000000000000000000000008f612d54565b15156040830152600290810b810b60208301819052620d89e719910b1215610c4b57620d89e7196020820152610c6a565b6020810151620d89e860029190910b1315610c6a57620d89e860208201525b610c778160200151612e96565b6001600160a01b031660608201526040820151610d08908d610cb1578b6001600160a01b031683606001516001600160a01b031611610ccb565b8b6001600160a01b031683606001516001600160a01b0316105b610cd9578260600151610cdb565b8b5b60c085015185517f00000000000000000000000000000000000000000000000000000000000000006131c7565b60c085015260a084015260808301526001600160a01b031660408301528215610d6a57610d3e8160c001518260800151016133b9565b825103825260a0810151610d6090610d55906133b9565b6020840151906133cf565b6020830152610da5565b610d778160a001516133b9565b825101825260c08101516080820151610d9f91610d9491016133b9565b6020840151906133eb565b60208301525b835163ffffffff1615610e05576000612710610dd8866000015163ffffffff168460c0015161340190919063ffffffff16565b81610ddf57fe5b60c0840180519290910491829003905260a0840180519091016001600160801b03169052505b60c08201516001600160801b031615610e4457610e388160c00151600160801b8460c001516001600160801b0316613425565b60808301805190910190525b80606001516001600160a01b031682604001516001600160a01b03161415610f6d57806040015115610f44578360a00151610ece57610eac846040015160008760200151886040015188602001518a6060015160096134d5909695949392919063ffffffff16565b6001600160a01b03166080860152600690810b900b6060850152600160a08501525b6000610f1a82602001518e610ee557600254610eeb565b84608001515b8f610efa578560800151610efe565b6003545b608089015160608a015160408b01516006959493929190613667565b90508c15610f26576000035b610f348360c0015182613725565b6001600160801b031660c0840152505b8b610f53578060200151610f5c565b60018160200151035b600290810b900b6060830152610fa8565b80600001516001600160a01b031682604001516001600160a01b031614610fa857610f9b82604001516137db565b600290810b900b60608301525b50610ba4565b836020015160020b816060015160020b1461107c57600080610ffc86604001518660400151886020015188602001518a606001518b608001516009613b03909695949392919063ffffffff16565b604085015160608601516000805461ffff60c81b1916600160c81b61ffff958616021761ffff60b81b1916600160b81b95909416949094029290921762ffffff60a01b1916600160a01b62ffffff60029490940b9390931692909202919091176001600160a01b0319166001600160a01b03909116179055506110a19050565b6040810151600080546001600160a01b0319166001600160a01b039092169190911790555b8060c001516001600160801b031683602001516001600160801b0316146110e75760c0810151600580546001600160801b0319166001600160801b039092169190911790555b6000808c1561114157608083015160025560a08301516001600160801b0316156111355760a0830151600480546001600160801b031981166001600160801b03918216909301169190911790555b8260a00151915061118e565b608083015160035560a08301516001600160801b0316156111875760a0830151600480546001600160801b03808216600160801b92839004821690940116029190911790555b5060a08201515b8315158d1515146111a757602083015183518d036111b4565b82600001518c0383602001515b90985096508c156112ed5760008712156111f6576111f67f00000000000000000000000000000000000000000000000000000000000000008f89600003613c9e565b6000611200613dec565b9050336001600160a01b0316635229374c8a8a8e8e6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b15801561128457600080fd5b505af1158015611298573d6000803e3d6000fd5b505050506112a4613dec565b6112ae828b613f25565b11156112e7576040805162461bcd60e51b815260206004820152600360248201526249494160e81b604482015290519081900360640190fd5b50611417565b6000881215611324576113247f00000000000000000000000000000000000000000000000000000000000000008f8a600003613c9e565b600061132e613f35565b9050336001600160a01b0316635229374c8a8a8e8e6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b1580156113b257600080fd5b505af11580156113c6573d6000803e3d6000fd5b505050506113d2613f35565b6113dc828a613f25565b1115611415576040805162461bcd60e51b815260206004820152600360248201526249494160e81b604482015290519081900360640190fd5b505b8d6001600160a01b0316336001600160a01b03167f19b47279256b2a23a1665c810c8d55a1758940ee09377d4f8d26497a3577dc838a8a87604001518860c001518960600151898960405180888152602001878152602001866001600160a01b03168152602001856001600160801b031681526020018460020b8152602001836001600160801b03168152602001826001600160801b0316815260200197505050505050505060405180910390a350506001805460ff60201b1916600160201b17905550939a92995091975050505050505050565b6005546001600160801b031681565b6004546001600160801b0380821691600160801b90041682565b60098161ffff811061152657600080fd5b015463ffffffff81169150600160201b810460060b90600160581b81046001600160a01b031690600160f81b900460ff1684565b600154600160201b900460ff1661159e576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6001805460ff60201b1916905560008054600160d81b900461ffff16906115c760098385613fcd565b6000805461ffff808416600160d81b810261ffff60d81b1990931692909217909255919250831614611634576040805161ffff80851682528316602082015281517fac49e518f90a358f652e4400164f05a5d8f7e35e7747279bc3a93dbf584e125a929181900390910190a15b50506001805460ff60201b1916600160201b17905550565b6000546001546001600160a01b03821691600160a01b810460020b9161ffff600160b81b8304811692600160c81b8104821692600160d81b9091049091169063ffffffff81169060ff600160201b9091041687565b6001546000908190600160201b900460ff166116ea576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6001805460ff60201b191690556001600160801b03851661170a57600080fd5b60008061175860405180608001604052808c6001600160a01b031681526020018b60020b81526020018a60020b815260200161174e8a6001600160801b0316614070565b600f0b9052614081565b9250925050819350809250600080600086111561177a57611777613dec565b91505b841561178b57611788613f35565b90505b336001600160a01b031663f2d65e2587878b8b6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b15801561180d57600080fd5b505af1158015611821573d6000803e3d6000fd5b50505050600086111561187857611836613dec565b6118408388613f25565b1115611878576040805162461bcd60e51b815260206004820152600260248201526104d360f41b604482015290519081900360640190fd5b84156118c857611886613f35565b6118908287613f25565b11156118c8576040805162461bcd60e51b81526020600482015260026024820152614d3160f01b604482015290519081900360640190fd5b8960020b8b60020b8d6001600160a01b03167f7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde338d8b8b60405180856001600160a01b03168152602001846001600160801b0316815260200183815260200182815260200194505050505060405180910390a450506001805460ff60201b1916600160201b17905550919890975095505050505050565b60035481565b600154600160201b900460ff166119a9576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6001805460ff60201b191690556005546001600160801b0316806119f8576040805162461bcd60e51b81526020600482015260016024820152601360fa1b604482015290519081900360640190fd5b6000611a2d867f000000000000000000000000000000000000000000000000000000000000000062ffffff16620f42406142b7565b90506000611a64867f000000000000000000000000000000000000000000000000000000000000000062ffffff16620f42406142b7565b90506000611a70613dec565b90506000611a7c613f35565b90508815611aaf57611aaf7f00000000000000000000000000000000000000000000000000000000000000008b8b613c9e565b8715611ae057611ae07f00000000000000000000000000000000000000000000000000000000000000008b8a613c9e565b336001600160a01b031663a0cfc3e485858a8a6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b158015611b6257600080fd5b505af1158015611b76573d6000803e3d6000fd5b505050506000611b84613dec565b90506000611b90613f35565b905081611b9d8588613f25565b1115611bd5576040805162461bcd60e51b8152602060048201526002602482015261046360f41b604482015290519081900360640190fd5b80611be08487613f25565b1115611c18576040805162461bcd60e51b8152602060048201526002602482015261463160f01b604482015290519081900360640190fd5b8382038382038115611ca15760015461ffff1660008115611c455761271063ffffffff8316850204611c48565b60005b90506001600160801b03811615611c7b57600480546001600160801b038082168401166001600160801b03199091161790555b611c95818503600160801b8d6001600160801b0316613425565b60028054909101905550505b8015611d265760015460101c61ffff1660008115611ccb5761271063ffffffff8316840204611cce565b60005b90506001600160801b03811615611d0057600480546001600160801b03600160801b8083048216850182160291161790555b611d1a818403600160801b8d6001600160801b0316613425565b60038054909101905550505b8d6001600160a01b0316336001600160a01b03167fbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca6338f8f86866040518085815260200184815260200183815260200182815260200194505050505060405180910390a350506001805460ff60201b1916600160201b179055505050505050505050505050565b6001546000908190600160201b900460ff16611df5576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6001805460ff60201b191690556000611e1160083389896142f1565b60038101549091506001600160801b0390811690861611611e325784611e41565b60038101546001600160801b03165b60038201549093506001600160801b03600160801b909104811690851611611e695783611e7f565b6003810154600160801b90046001600160801b03165b91506001600160801b03831615611ee4576003810180546001600160801b031981166001600160801b03918216869003821617909155611ee4907f0000000000000000000000000000000000000000000000000000000000000000908a908616613c9e565b6001600160801b03821615611f4a576003810180546001600160801b03600160801b808304821686900382160291811691909117909155611f4a907f0000000000000000000000000000000000000000000000000000000000000000908a908516613c9e565b604080516001600160a01b038a1681526001600160801b0380861660208301528416818301529051600288810b92908a900b9133917f70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0919081900360600190a4506001805460ff60201b1916600160201b17905590969095509350505050565b60086020526000908152604090208054600182015460028301546003909301546001600160801b0392831693919281811691600160801b90041685565b60076020526000908152604090205481565b7f000000000000000000000000000000000000000000000000000000000000000081565b6001546000908190600160201b900460ff16612086576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6001805460ff60201b19169055336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061215657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561211e57600080fd5b505afa158015612132573d6000803e3d6000fd5b505050506040513d602081101561214857600080fd5b50516001600160a01b031633145b61215f57600080fd5b6004546001600160801b039081169085161161217b5783612188565b6004546001600160801b03165b6004549092506001600160801b03600160801b9091048116908416116121ae57826121c2565b600454600160801b90046001600160801b03165b90506001600160801b03821615612243576004546001600160801b03838116911614156121f157600019909101905b600480546001600160801b031981166001600160801b03918216859003821617909155612243907f00000000000000000000000000000000000000000000000000000000000000009087908516613c9e565b6001600160801b038116156122c9576004546001600160801b03828116600160801b90920416141561227457600019015b600480546001600160801b03600160801b8083048216859003821602918116919091179091556122c9907f00000000000000000000000000000000000000000000000000000000000000009087908416613c9e565b604080516001600160801b0380851682528316602082015281516001600160a01b0388169233927f596b573906218d3411850b26a6b437d6c4522fdb43d2d2386263f86d50b8b151929081900390910190a36001805460ff60201b1916600160201b1790559094909350915050565b6060806123b2612346612d50565b858580806020026020016040519081016040528093929190818152602001838360200280828437600092018290525054600554600996959450600160a01b820460020b935061ffff600160b81b8304811693506001600160801b0390911691600160c81b900416614355565b915091509250929050565b6001546000908190600160201b900460ff16612406576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6001805460ff60201b1916905560408051608081018252338152600287810b602083015286900b918101919091526000908190819061246290606081016124556001600160801b038a16614070565b600003600f0b9052614081565b92509250925081600003945080600003935060008511806124835750600084115b156124c2576003830180546001600160801b038082168089018216600160801b93849004831689019092169092029091176001600160801b0319161790555b604080516001600160801b0388168152602081018790528082018690529051600289810b92908b900b9133917f0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c919081900360600190a450506001805460ff60201b1916600160201b179055509094909350915050565b600080600061254885856144af565b600285810b810b600090815260066020819052604080832088850b90940b8352822060038401549182900b93600160381b83046001600160a01b0316928492600160d81b820463ffffffff16928492909190600160f81b900460ff16806125ae57600080fd5b6003820154600681900b9850600160381b81046001600160a01b03169650600160d81b810463ffffffff169450600160f81b900460ff16806125ef57600080fd5b50506040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b810b6020840181905261ffff600160b81b8404811695850195909552600160c81b830485166060850152600160d81b909204909316608083015260015463ffffffff811660a084015260ff600160201b90910416151560c08301529093508e820b910b121590506126975750939094039650900393509003905061271a565b8a60020b816020015160020b121561270b5760006126b3612d50565b60208301516040840151600554606086015193945060009384936126e9936009938893879392916001600160801b0316906134d5565b9a9003989098039b50509490960392909203965090910303925061271a915050565b50949093039650039350900390505b9250925092565b600154600160201b900460ff16612765576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6001805460ff60201b19169055336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061283557507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156127fd57600080fd5b505afa158015612811573d6000803e3d6000fd5b505050506040513d602081101561282757600080fd5b50516001600160a01b031633145b61283e57600080fd5b63ffffffff8216158061286c57506103e88263ffffffff161015801561286c5750610fa08263ffffffff1611155b80156128a1575063ffffffff811615806128a157506103e88163ffffffff16101580156128a15750610fa08163ffffffff1611155b6128aa57600080fd5b6001805465ffffffff0000601084901b16840163ffffffff90811663ffffffff19831617909255167fb3159fed3ddfba67bae294599eafe2d0ec98c08bb38e0e5fb87d33154b6e05aa62010000826040805163ffffffff939092068316825261ffff601086901c16602083015286831682820152918516606082015290519081900360800190a150506001805460ff60201b1916600160201b17905550565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b60025481565b60066020819052600091825260409091208054600182015460028301546003909301546001600160801b03831694600160801b909304600f0b93919281900b90600160381b81046001600160a01b031690600160d81b810463ffffffff1690600160f81b900460ff1688565b6000546001600160a01b031615612a8e576040805162461bcd60e51b8152602060048201526002602482015261414960f01b604482015290519081900360640190fd5b6000612a99826137db565b9050600080612ab1612aa9612d50565b600990614578565b6040805160e0810182526001600160a01b038816808252600288810b60208401819052600094840185905261ffff8781166060860181905290871660808601819052630c800c8060a08701819052600160c090970187905287546001600160a01b03191690951762ffffff60a01b1916600160a01b62ffffff9490950b8416949094029390931763ffffffff60b81b1916600160c81b9091021761ffff60d81b1916600160d81b909202919091179093558154600160201b63ffffffff1990911690911760ff60201b191617905591935091507f00000000000000000000000000000000000000000000000000000000000000001660641415612bc6576001805463ffffffff1916630ce40ce4179055612c97565b7f000000000000000000000000000000000000000000000000000000000000000062ffffff166101f41415612c0d576001805463ffffffff1916630d480d48179055612c97565b7f000000000000000000000000000000000000000000000000000000000000000062ffffff166109c41415612c54576001805463ffffffff1916630c800c80179055612c97565b7f000000000000000000000000000000000000000000000000000000000000000062ffffff166127101415612c97576001805463ffffffff1916630c800c801790555b604080516001600160a01b0386168152600285900b602082015281517f98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c95929181900390910190a150505050565b60008082600281900b620d89e71981612cf957fe5b05029050600083600281900b620d89e881612d1057fe5b0502905060008460020b83830360020b81612d2757fe5b0560010190508062ffffff166001600160801b03801681612d4457fe5b0493505050505b919050565b4290565b60008060008460020b8660020b81612d6857fe5b05905060008660020b128015612d8f57508460020b8660020b81612d8857fe5b0760020b15155b15612d9957600019015b8315612e0e57600080612dab836145c4565b600182810b810b600090815260208d9052604090205460ff83169190911b80016000190190811680151597509294509092509085612df057888360ff16860302612e03565b88612dfa826145d6565b840360ff168603025b965050505050612e8c565b600080612e1d836001016145c4565b91509150600060018260ff166001901b031990506000818b60008660010b60010b8152602001908152602001600020541690508060001415955085612e6f57888360ff0360ff16866001010102612e85565b8883612e7a83614675565b0360ff168660010101025b9650505050505b5094509492505050565b60008060008360020b12612ead578260020b612eb5565b8260020b6000035b9050620d89e8811115612ef3576040805162461bcd60e51b81526020600482015260016024820152601560fa1b604482015290519081900360640190fd5b600060018216612f0757600160801b612f19565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615612f4d576ffff97272373d413259a46990580e213a0260801c5b6004821615612f6c576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b6008821615612f8b576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b6010821615612faa576fffcb9843d60f6159c9db58835c9266440260801c5b6020821615612fc9576fff973b41fa98c081472e6896dfb254c00260801c5b6040821615612fe8576fff2ea16466c96a3843ec78b326b528610260801c5b6080821615613007576ffe5dee046a99a2a811c461f1969c30530260801c5b610100821615613027576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b610200821615613047576ff987a7253ac413176f2b074cf7815e540260801c5b610400821615613067576ff3392b0822b70005940c7a398e4b70f30260801c5b610800821615613087576fe7159475a2c29b7443b29c7fa6e889d90260801c5b6110008216156130a7576fd097f3bdfd2022b8845ad8f792aa58250260801c5b6120008216156130c7576fa9f746462d870fdf8a65dc1f90e061e50260801c5b6140008216156130e7576f70d869a156d2a1b890bb3df62baf32f70260801c5b618000821615613107576f31be135f97d08fd981231505542fcfa60260801c5b62010000821615613128576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b62020000821615613148576e5d6af8dedb81196699c329225ee6040260801c5b62040000821615613167576d2216e584f5fa1ea926041bedfe980260801c5b62080000821615613184576b048a170391f7dc42444e8fa20260801c5b60008460020b131561319f57806000198161319b57fe5b0490505b600160201b8106156131b25760016131b5565b60005b60ff16602082901c0192505050919050565b60008080806001600160a01b03808916908a16101581871280159061324c5760006132008989620f42400362ffffff16620f4240613425565b905082613219576132148c8c8c600161475f565b613226565b6132268b8d8c60016147da565b9550858110613237578a9650613246565b6132438c8b838661488e565b96505b50613296565b816132635761325e8b8b8b60006147da565b613270565b6132708a8c8b600061475f565b935083886000031061328457899550613296565b6132938b8a8a600003856148da565b95505b6001600160a01b038a81169087161482156132f9578080156132b55750815b6132cb576132c6878d8c60016147da565b6132cd565b855b95508080156132da575081155b6132f0576132eb878d8c600061475f565b6132f2565b845b9450613343565b8080156133035750815b613319576133148c888c600161475f565b61331b565b855b9550808015613328575081155b61333e576133398c888c60006147da565b613340565b845b94505b8115801561335357508860000385115b1561335f578860000394505b81801561337e57508a6001600160a01b0316876001600160a01b031614155b1561338d5785890393506133aa565b6133a7868962ffffff168a620f42400362ffffff166142b7565b93505b50505095509550955095915050565b6000600160ff1b82106133cb57600080fd5b5090565b808203828113156000831215146133e557600080fd5b92915050565b818101828112156000831215146133e557600080fd5b600082158061341c5750508181028183828161341957fe5b04145b6133e557600080fd5b600080806000198587098686029250828110908390030390508061345b576000841161345057600080fd5b5082900490506134ce565b80841161346757600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150505b9392505050565b60008063ffffffff871661357b576000898661ffff1661ffff81106134f657fe5b60408051608081018252919092015463ffffffff808216808452600160201b8304600690810b810b900b6020850152600160581b83046001600160a01b031694840194909452600160f81b90910460ff16151560608301529092508a161461356757613564818a8988614926565b90505b80602001518160400151925092505061365b565b8688036000806135908c8c858c8c8c8c6149c9565b91509150816000015163ffffffff168363ffffffff1614156135c257816020015182604001519450945050505061365b565b805163ffffffff848116911614156135ea57806020015181604001519450945050505061365b565b8151815160208085015190840151918390039286039163ffffffff80841692908516910360060b8161361857fe5b05028460200151018263ffffffff168263ffffffff1686604001518660400151036001600160a01b0316028161364a57fe5b048560400151019650965050505050505b97509795505050505050565b600295860b860b60009081526020979097526040909620600181018054909503909455938301805490920390915560038201805463ffffffff600160d81b6001600160a01b03600160381b808504821690960316909402670100000000000000600160d81b031990921691909117600681810b90960390950b66ffffffffffffff1666ffffffffffffff199095169490941782810485169095039093160263ffffffff60d81b1990931692909217905554600160801b9004600f0b90565b60008082600f0b121561378a57826001600160801b03168260000384039150816001600160801b031610613785576040805162461bcd60e51b81526020600482015260026024820152614c5360f01b604482015290519081900360640190fd5b6133e5565b826001600160801b03168284019150816001600160801b031610156133e5576040805162461bcd60e51b81526020600482015260026024820152614c4160f01b604482015290519081900360640190fd5b60006401000276a36001600160a01b03831610801590613817575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038316105b61384c576040805162461bcd60e51b81526020600482015260016024820152602960f91b604482015290519081900360640190fd5b77ffffffffffffffffffffffffffffffffffffffff00000000602083901b166001600160801b03811160071b81811c67ffffffffffffffff811160061b90811c63ffffffff811160051b90811c61ffff811160041b90811c60ff8111600390811b91821c600f811160021b90811c918211600190811b92831c979088119617909417909217179091171717608081106138ed57607f810383901c91506138f7565b80607f0383901b91505b908002607f81811c60ff83811c9190911c800280831c81831c1c800280841c81841c1c800280851c81851c1c800280861c81861c1c800280871c81871c1c800280881c81881c1c800280891c81891c1c8002808a1c818a1c1c8002808b1c818b1c1c8002808c1c818c1c1c8002808d1c818d1c1c8002808e1c9c81901c9c909c1c80029c8d901c9e9d607f198f0160401b60c09190911c678000000000000000161760c19b909b1c674000000000000000169a909a1760c29990991c672000000000000000169890981760c39790971c671000000000000000169690961760c49590951c670800000000000000169490941760c59390931c670400000000000000169290921760c69190911c670200000000000000161760c79190911c600160381b161760c89190911c6680000000000000161760c99190911c6640000000000000161760ca9190911c6620000000000000161760cb9190911c6610000000000000161760cc9190911c6608000000000000161760cd9190911c66040000000000001617693627a301d71055774c8581026f028f6481ab7f045a5af012a19d003aa9198101608090811d906fdb2df09e81959a81455e260799a0632f8301901d600281810b9083900b14613af457886001600160a01b0316613ad882612e96565b6001600160a01b03161115613aed5781613aef565b805b613af6565b815b9998505050505050505050565b6000806000898961ffff1661ffff8110613b1957fe5b60408051608081018252919092015463ffffffff808216808452600160201b8304600690810b810b900b6020850152600160581b83046001600160a01b031694840194909452600160f81b90910460ff161515606083015290925089161415613b88578885925092505061365b565b8461ffff168461ffff16118015613ba957506001850361ffff168961ffff16145b15613bb657839150613bba565b8491505b8161ffff168960010161ffff1681613bce57fe5b069250613bdd81898989614926565b8a8461ffff1661ffff8110613bee57fe5b825191018054602084015160408501516060909501511515600160f81b026001600160f81b036001600160a01b03909616600160581b027fff0000000000000000000000000000000000000000ffffffffffffffffffffff60069390930b66ffffffffffffff16600160201b026affffffffffffff000000001963ffffffff90971663ffffffff199095169490941795909516929092171692909217929092161790555097509795505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1781529251825160009485949389169392918291908083835b60208310613d1a5780518252601f199092019160209182019101613cfb565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613d7c576040519150601f19603f3d011682016040523d82523d6000602084013e613d81565b606091505b5091509150818015613daf575080511580613daf5750808060200190516020811015613dac57600080fd5b50515b613de5576040805162461bcd60e51b81526020600482015260026024820152612a2360f11b604482015290519081900360640190fd5b5050505050565b604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17815291518151600093849384936001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001693919290918291908083835b60208310613e855780518252601f199092019160209182019101613e66565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d8060008114613ee5576040519150601f19603f3d011682016040523d82523d6000602084013e613eea565b606091505b5091509150818015613efe57506020815110155b613f0757600080fd5b808060200190516020811015613f1c57600080fd5b50519250505090565b808201828110156133e557600080fd5b604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17815291518151600093849384936001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016939192909182919080838360208310613e855780518252601f199092019160209182019101613e66565b6000808361ffff161161400b576040805162461bcd60e51b81526020600482015260016024820152604960f81b604482015290519081900360640190fd5b8261ffff168261ffff16116140215750816134ce565b825b8261ffff168161ffff161015614067576001858261ffff1661ffff811061404657fe5b01805463ffffffff191663ffffffff92909216919091179055600101614023565b50909392505050565b80600f81900b8114612d4b57600080fd5b6000806000614098846020015185604001516144af565b6040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b900b602080840182905261ffff600160b81b8404811685870152600160c81b84048116606080870191909152600160d81b90940416608085015260015463ffffffff811660a086015260ff600160201b90910416151560c08501528851908901519489015192890151939461413a9491939092909190614bc3565b93508460600151600f0b6000146142af57846020015160020b816020015160020b121561418f576141886141718660200151612e96565b61417e8760400151612e96565b8760600151614d78565b92506142af565b846040015160020b816020015160020b12156142855760055460408201516001600160801b03909116906141e1906141c5612d50565b6020850151606086015160808701516009949392918791613b03565b6000805461ffff60c81b1916600160c81b61ffff938416021761ffff60b81b1916600160b81b939092169290920217905581516040870151614231919061422790612e96565b8860600151614d78565b935061424f6142438760200151612e96565b83516060890151614dbc565b925061425f818760600151613725565b600580546001600160801b0319166001600160801b0392909216919091179055506142af565b6142ac6142958660200151612e96565b6142a28760400151612e96565b8760600151614dbc565b91505b509193909250565b60006142c4848484613425565b9050600082806142d057fe5b84860911156134ce5760001981106142e757600080fd5b6001019392505050565b6040805160609490941b6bffffffffffffffffffffffff1916602080860191909152600293840b60e890811b60348701529290930b90911b60378401528051808403601a018152603a90930181528251928201929092206000908152929052902090565b60608060008361ffff1611614395576040805162461bcd60e51b81526020600482015260016024820152604960f81b604482015290519081900360640190fd5b865167ffffffffffffffff811180156143ad57600080fd5b506040519080825280602002602001820160405280156143d7578160200160208202803683370190505b509150865167ffffffffffffffff811180156143f257600080fd5b5060405190808252806020026020018201604052801561441c578160200160208202803683370190505b50905060005b87518110156144a25761444d8a8a8a848151811061443c57fe5b60200260200101518a8a8a8a6134d5565b84838151811061445957fe5b6020026020010184848151811061446c57fe5b60200260200101826001600160a01b03166001600160a01b03168152508260060b60060b81525050508080600101915050614422565b5097509795505050505050565b8060020b8260020b126144ef576040805162461bcd60e51b8152602060048201526003602482015262544c5560e81b604482015290519081900360640190fd5b620d89e719600283900b1215614532576040805162461bcd60e51b8152602060048201526003602482015262544c4d60e81b604482015290519081900360640190fd5b620d89e8600282900b1315614574576040805162461bcd60e51b815260206004820152600360248201526254554d60e81b604482015290519081900360640190fd5b5050565b6040805160808101825263ffffffff9283168082526000602083018190529282019290925260016060909101819052835463ffffffff1916909117909116600160f81b17909155908190565b60020b600881901d9161010090910790565b60008082116145e457600080fd5b600160801b82106145f757608091821c91015b68010000000000000000821061460f57604091821c91015b600160201b821061462257602091821c91015b62010000821061463457601091821c91015b610100821061464557600891821c91015b6010821061465557600491821c91015b6004821061466557600291821c91015b60028210612d4b57600101919050565b600080821161468357600080fd5b5060ff6001600160801b0382161561469e57607f19016146a6565b608082901c91505b67ffffffffffffffff8216156146bf57603f19016146c7565b604082901c91505b63ffffffff8216156146dc57601f19016146e4565b602082901c91505b61ffff8216156146f757600f19016146ff565b601082901c91505b60ff8216156147115760071901614719565b600882901c91505b600f82161561472b5760031901614733565b600482901c91505b6003821615614745576001190161474d565b600282901c91505b6001821615612d4b5760001901919050565b6000836001600160a01b0316856001600160a01b0316111561477f579293925b816147ac576147a7836001600160801b03168686036001600160a01b0316600160601b613425565b6147cf565b6147cf836001600160801b03168686036001600160a01b0316600160601b6142b7565b90505b949350505050565b6000836001600160a01b0316856001600160a01b031611156147fa579293925b6fffffffffffffffffffffffffffffffff60601b606084901b166001600160a01b03868603811690871661482d57600080fd5b8361485d57866001600160a01b03166148508383896001600160a01b0316613425565b8161485757fe5b04614883565b6148836148748383896001600160a01b03166142b7565b886001600160a01b0316614deb565b979650505050505050565b600080856001600160a01b0316116148a557600080fd5b6000846001600160801b0316116148bb57600080fd5b816148cd576147a78585856001614df6565b6147cf8585856001614ed7565b600080856001600160a01b0316116148f157600080fd5b6000846001600160801b03161161490757600080fd5b81614919576147a78585856000614ed7565b6147cf8585856000614df6565b61492e615704565b600085600001518503905060405180608001604052808663ffffffff1681526020018263ffffffff168660020b0288602001510160060b81526020016000856001600160801b031611614982576001614984565b845b6001600160801b031663ffffffff60801b608085901b16816149a257fe5b048860400151016001600160a01b0316815260200160011515815250915050949350505050565b6149d1615704565b6149d9615704565b888561ffff1661ffff81106149ea57fe5b60408051608081018252919092015463ffffffff8116808352600160201b8204600690810b810b900b6020840152600160581b82046001600160a01b031693830193909352600160f81b900460ff16151560608201529250614a4e90899089614fc3565b15614a86578663ffffffff16826000015163ffffffff161415614a705761365b565b81614a7d83898988614926565b9150915061365b565b888361ffff168660010161ffff1681614a9b57fe5b0661ffff1661ffff8110614aab57fe5b60408051608081018252929091015463ffffffff81168352600160201b8104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b90910416151560608201819052909250614b6057604080516080810182528a5463ffffffff81168252600160201b8104600690810b810b900b6020830152600160581b81046001600160a01b031692820192909252600160f81b90910460ff161515606082015291505b614b6f88836000015189614fc3565b614ba6576040805162461bcd60e51b815260206004820152600360248201526213d31160ea1b604482015290519081900360640190fd5b614bb38989898887615084565b9150915097509795505050505050565b6000614bd260088787876142f1565b60025460035491925090600080600f87900b15614d18576000614bf3612d50565b6000805460055492935090918291614c3d9160099186918591600160a01b810460020b9161ffff600160b81b83048116926001600160801b0390921691600160c81b9004166134d5565b9092509050614c7760068d8b8d8b8b87898b60007f0000000000000000000000000000000000000000000000000000000000000000615222565b9450614cae60068c8b8d8b8b87898b60017f0000000000000000000000000000000000000000000000000000000000000000615222565b93508415614ce257614ce260078d7f00000000000000000000000000000000000000000000000000000000000000006153df565b8315614d1457614d1460078c7f00000000000000000000000000000000000000000000000000000000000000006153df565b5050505b600080614d2a60068c8c8b8a8a615445565b9092509050614d3b878a84846154f1565b600089600f0b1215614d69578315614d5857614d5860068c615686565b8215614d6957614d6960068b615686565b50505050505095945050505050565b60008082600f0b12614d9e57614d99614d9485858560016147da565b6133b9565b6147d2565b614db1614d9485858560000360006147da565b600003949350505050565b60008082600f0b12614dd857614d99614d94858585600161475f565b614db1614d94858585600003600061475f565b808204910615150190565b60008115614e695760006001600160a01b03841115614e2c57614e2784600160601b876001600160801b0316613425565b614e44565b6001600160801b038516606085901b81614e4257fe5b045b9050614e61614e5c6001600160a01b03881683613f25565b6156b2565b9150506147d2565b60006001600160a01b03841115614e9757614e9284600160601b876001600160801b03166142b7565b614eae565b614eae606085901b6001600160801b038716614deb565b905080866001600160a01b031611614ec557600080fd5b6001600160a01b0386160390506147d2565b600082614ee55750836147d2565b6fffffffffffffffffffffffffffffffff60601b606085901b168215614f7c576001600160a01b03861684810290858281614f1c57fe5b041415614f4d57818101828110614f4b57614f4183896001600160a01b0316836142b7565b93505050506147d2565b505b614f7382614f6e878a6001600160a01b03168681614f6757fe5b0490613f25565b614deb565b925050506147d2565b6001600160a01b03861684810290858281614f9357fe5b04148015614fa057508082115b614fa957600080fd5b808203614f41614e5c846001600160a01b038b16846142b7565b60008363ffffffff168363ffffffff1611158015614fed57508363ffffffff168263ffffffff1611155b15615009578163ffffffff168363ffffffff16111590506134ce565b60008463ffffffff168463ffffffff1611615030578363ffffffff16600160201b01615038565b8363ffffffff165b64ffffffffff16905060008563ffffffff168463ffffffff1611615068578363ffffffff16600160201b01615070565b8363ffffffff165b64ffffffffff169091111595945050505050565b61508c615704565b615094615704565b60008361ffff168560010161ffff16816150aa57fe5b0661ffff169050600060018561ffff16830103905060005b506002818301048961ffff871682816150d757fe5b0661ffff81106150e357fe5b60408051608081018252929091015463ffffffff81168352600160201b8104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b9091041615156060820181905290955061514d578060010192506150c2565b898661ffff16826001018161515e57fe5b0661ffff811061516a57fe5b60408051608081018252929091015463ffffffff81168352600160201b8104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b909104161515606082015285519094506000906151d4908b908b614fc3565b90508080156151ed57506151ed8a8a8760000151614fc3565b156151f85750615215565b806152085760018203925061520f565b8160010193505b506150c2565b5050509550959350505050565b60028a810b900b600090815260208c90526040812080546001600160801b03168261524d828d613725565b9050846001600160801b0316816001600160801b0316111561529b576040805162461bcd60e51b81526020600482015260026024820152614c4f60f01b604482015290519081900360640190fd5b6001600160801b038281161590821615811415945015615344578c60020b8e60020b1361532c57600183018b9055600283018a9055600383018054670100000000000000600160d81b031916600160381b6001600160a01b038c16021766ffffffffffffff191666ffffffffffffff60068b900b161763ffffffff60d81b1916600160d81b63ffffffff8a16021790555b6003830180546001600160f81b0316600160f81b1790555b82546001600160801b0319166001600160801b0382161783558561538d5782546153889061538390600160801b9004600f90810b810b908f900b6133eb565b614070565b6153ae565b82546153ae9061538390600160801b9004600f90810b810b908f900b6133cf565b8354600f9190910b6001600160801b03908116600160801b0291161790925550909c9b505050505050505050505050565b8060020b8260020b816153ee57fe5b0760020b156153fc57600080fd5b6000806154178360020b8560020b8161541157fe5b056145c4565b600191820b820b60009081526020979097526040909620805460ff9097169190911b90951890945550505050565b600285810b80820b60009081526020899052604080822088850b850b83529082209193849391929184918291908a900b1261548b5750506001820154600283015461549e565b8360010154880391508360020154870390505b6000808b60020b8b60020b12156154c0575050600183015460028401546154d3565b84600101548a0391508460020154890390505b92909803979097039b96909503949094039850939650505050505050565b6040805160a08101825285546001600160801b0390811682526001870154602083015260028701549282019290925260038601548083166060830152600160801b900490911660808201526000600f85900b6155905781516001600160801b0316615588576040805162461bcd60e51b815260206004820152600260248201526104e560f41b604482015290519081900360640190fd5b50805161559f565b815161559c9086613725565b90505b60006155c38360200151860384600001516001600160801b0316600160801b613425565b905060006155e98460400151860385600001516001600160801b0316600160801b613425565b905086600f0b6000146156105787546001600160801b0319166001600160801b0384161788555b60018801869055600288018590556001600160801b03821615158061563e57506000816001600160801b0316115b1561567c576003880180546001600160801b031981166001600160801b039182168501821617808216600160801b9182900483168501909216021790555b5050505050505050565b600290810b810b6000908152602092909252604082208281556001810183905590810182905560030155565b806001600160a01b0381168114612d4b57600080fd5b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b6040805160808101825260008082526020820181905291810182905260608101919091529056fea164736f6c6343000706000aa164736f6c6343000706000a

Deployed ByteCode

0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806383c17c55146100515780638903573014610079578063966dae0e146100c3578063fad5359f146100e7575b600080fd5b6100776004803603602081101561006757600080fd5b50356001600160a01b0316610131565b005b6100816101d9565b604080516001600160a01b0396871681529486166020860152929094168383015262ffffff16606083015260029290920b608082015290519081900360a00190f35b6100cb61020f565b604080516001600160a01b039092168252519081900360200190f35b6100cb600480360360a08110156100fd57600080fd5b506001600160a01b03813581169160208101358216916040820135169062ffffff606082013516906080013560020b61021e565b6003546001600160a01b03161561018f576040805162461bcd60e51b815260206004820152601360248201527f616c726561647920696e697469616c697a656400000000000000000000000000604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0383169081179091556040517fb4dd887347efc97a6ad35fc9824a2ac4c0a6a04344d89bf05f3308c854325a6490600090a250565b600054600154600280546001600160a01b03938416939283169281169162ffffff600160a01b83041691600160b81b9004900b85565b6003546001600160a01b031681565b6003546000906001600160a01b03163314610280576040805162461bcd60e51b815260206004820152601c60248201527f6f6e6c7920666163746f72792063616e2063616c6c206465706c6f7900000000604482015290519081900360640190fd5b6040805160a0810182526001600160a01b03888116808352888216602080850182905292891684860181905262ffffff898116606080880182905260028b810b6080998a01819052600080546001600160a01b03199081169099179055600180548916881790558154909716851762ffffff60a01b1916600160a01b84021762ffffff60b81b1916600160b81b97820b909416969096029290921790945586518086019390935282870191909152818101929092528451808203909201825290920192839052815191012090610355906103c4565b8190604051809103906000f5905080158015610375573d6000803e3d6000fd5b50600080546001600160a01b0319908116909155600180549091169055600280547fffffffffffff00000000000000000000000000000000000000000000000000001690559695505050505050565b61598a806103d28339019056fe6101406040523480156200001257600080fd5b506000336001600160a01b031663890357306040518163ffffffff1660e01b815260040160a06040518083038186803b1580156200004f57600080fd5b505afa15801562000064573d6000803e3d6000fd5b505050506040513d60a08110156200007b57600080fd5b50805160208083015160408401516060808601516080968701516001600160e81b031960e892831b1660e0526001600160601b031993831b841660c05293821b831660a05294901b16909352600283810b900b90911b61010052909150620000ee90829062002ce462000106821b17901c565b60801b6001600160801b031916610120525062000174565b60008082600281900b620d89e719816200011c57fe5b05029050600083600281900b620d89e8816200013457fe5b0502905060008460020b83830360020b816200014c57fe5b0560010190508062ffffff166001600160801b038016816200016a57fe5b0495945050505050565b60805160601c60a05160601c60c05160601c60e05160e81c6101005160e81c6101205160801c615738620002526000398061201b5280614c535280614c8a525080610bf5528061296f5280614cbe5280614cf0525080610ce45280611a005280611a3752806129b75280612b865280612bc85280612c0f5280612c565250806111cd5280611aba5280611f2152806122a052806129935280613f835250806108d052806112fb5280611a895280611ebb528061221a5280613e3a52508061209e52806120c7528061277d52806127a6528061294b52506157386000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c806370cf754a116100ee578063c45a015511610097578063ddca3f4311610071578063ddca3f43146107fe578063f30583991461081e578063f30dba9314610826578063f637731d146108a8576101ae565b8063c45a0155146107cf578063d0c93a7c146107d7578063d21220a7146107f6576101ae565b8063a34123a7116100c8578063a34123a71461070f578063a38807f214610749578063b0d0d211146107a4576101ae565b806370cf754a146105c357806385b66729146105cb578063883bdbfd14610608576101ae565b80633850c7bd1161015b578063490e6cbc11610135578063490e6cbc1461046f5780634f1eb3d8146104f9578063514ea4bf1461054a5780635339c296146105a3576101ae565b80633850c7bd146103595780633c8a7d8d146103b55780634614131914610455576101ae565b80631ad8b03b1161018c5780631ad8b03b146102a8578063252c09d7146102df57806332148f6714610336576101ae565b80630dfe1681146101b3578063128acb08146101d75780631a68650214610284575b600080fd5b6101bb6108ce565b604080516001600160a01b039092168252519081900360200190f35b61026b600480360360a08110156101ed57600080fd5b6001600160a01b0382358116926020810135151592604082013592606083013516919081019060a081016080820135600160201b81111561022d57600080fd5b82018360208201111561023f57600080fd5b803590602001918460018302840111600160201b8311171561026057600080fd5b5090925090506108f2565b6040805192835260208301919091528051918290030190f35b61028c6114ec565b604080516001600160801b039092168252519081900360200190f35b6102b06114fb565b60405180836001600160801b03168152602001826001600160801b031681526020019250505060405180910390f35b6102fc600480360360208110156102f557600080fd5b5035611515565b6040805163ffffffff909516855260069390930b60208501526001600160a01b039091168383015215156060830152519081900360800190f35b6103576004803603602081101561034c57600080fd5b503561ffff1661155a565b005b61036161164c565b604080516001600160a01b03909816885260029690960b602088015261ffff9485168787015292841660608701529216608085015263ffffffff90911660a0840152151560c0830152519081900360e00190f35b61026b600480360360a08110156103cb57600080fd5b6001600160a01b03823516916020810135600290810b92604083013590910b916001600160801b036060820135169181019060a081016080820135600160201b81111561041757600080fd5b82018360208201111561042957600080fd5b803590602001918460018302840111600160201b8311171561044a57600080fd5b5090925090506116a1565b61045d61195f565b60408051918252519081900360200190f35b6103576004803603608081101561048557600080fd5b6001600160a01b038235169160208101359160408201359190810190608081016060820135600160201b8111156104bb57600080fd5b8201836020820111156104cd57600080fd5b803590602001918460018302840111600160201b831117156104ee57600080fd5b509092509050611965565b6102b0600480360360a081101561050f57600080fd5b506001600160a01b03813516906020810135600290810b91604081013590910b906001600160801b0360608201358116916080013516611dac565b6105676004803603602081101561056057600080fd5b5035611fca565b604080516001600160801b0396871681526020810195909552848101939093529084166060840152909216608082015290519081900360a00190f35b61045d600480360360208110156105b957600080fd5b503560010b612007565b61028c612019565b6102b0600480360360608110156105e157600080fd5b506001600160a01b03813516906001600160801b036020820135811691604001351661203d565b6106766004803603602081101561061e57600080fd5b810190602081018135600160201b81111561063857600080fd5b82018360208201111561064a57600080fd5b803590602001918460208302840111600160201b8311171561066b57600080fd5b509092509050612338565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156106ba5781810151838201526020016106a2565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156106f95781810151838201526020016106e1565b5050505090500194505050505060405180910390f35b61026b6004803603606081101561072557600080fd5b508035600290810b91602081013590910b90604001356001600160801b03166123bd565b6107736004803603604081101561075f57600080fd5b508035600290810b9160200135900b612539565b6040805160069490940b84526001600160a01b03909216602084015263ffffffff1682820152519081900360600190f35b610357600480360360408110156107ba57600080fd5b5063ffffffff81358116916020013516612721565b6101bb612949565b6107df61296d565b6040805160029290920b8252519081900360200190f35b6101bb612991565b6108066129b5565b6040805162ffffff9092168252519081900360200190f35b61045d6129d9565b6108466004803603602081101561083c57600080fd5b503560020b6129df565b604080516001600160801b039099168952600f9790970b602089015287870195909552606087019390935260069190910b60808601526001600160a01b031660a085015263ffffffff1660c0840152151560e083015251908190036101000190f35b610357600480360360208110156108be57600080fd5b50356001600160a01b0316612a4b565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000808561092c576040805162461bcd60e51b8152602060048201526002602482015261415360f01b604482015290519081900360640190fd5b6040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b900b602083015261ffff600160b81b8204811693830193909352600160c81b810483166060830152600160d81b9004909116608082015260015463ffffffff811660a083015260ff600160201b90910416151560c082018190526109e4576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b87610a2f5780600001516001600160a01b0316866001600160a01b0316118015610a2a575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038716105b610a61565b80600001516001600160a01b0316866001600160a01b0316108015610a6157506401000276a36001600160a01b038716115b610a98576040805162461bcd60e51b815260206004820152600360248201526214d41360ea1b604482015290519081900360640190fd5b6001805460ff60201b191690556040805160c08101909152600090808a610acd5760108460a0015163ffffffff16901c610ad7565b60a084015161ffff165b63ffffffff1681526005546001600160801b03166020820152604001610afb612d50565b63ffffffff168152602001600060060b815260200160006001600160a01b031681526020016000151581525090506000808913905060006040518060e001604052808b81526020016000815260200185600001516001600160a01b03168152602001856020015160020b81526020018c610b7757600354610b7b565b6002545b815260200160006001600160801b0316815260200184602001516001600160801b031681525090505b805115801590610bca5750886001600160a01b031681604001516001600160a01b031614155b15610fae57610bd76156c8565b60408201516001600160a01b031681526060820151610c1a906007907f00000000000000000000000000000000000000000000000000000000000000008f612d54565b15156040830152600290810b810b60208301819052620d89e719910b1215610c4b57620d89e7196020820152610c6a565b6020810151620d89e860029190910b1315610c6a57620d89e860208201525b610c778160200151612e96565b6001600160a01b031660608201526040820151610d08908d610cb1578b6001600160a01b031683606001516001600160a01b031611610ccb565b8b6001600160a01b031683606001516001600160a01b0316105b610cd9578260600151610cdb565b8b5b60c085015185517f00000000000000000000000000000000000000000000000000000000000000006131c7565b60c085015260a084015260808301526001600160a01b031660408301528215610d6a57610d3e8160c001518260800151016133b9565b825103825260a0810151610d6090610d55906133b9565b6020840151906133cf565b6020830152610da5565b610d778160a001516133b9565b825101825260c08101516080820151610d9f91610d9491016133b9565b6020840151906133eb565b60208301525b835163ffffffff1615610e05576000612710610dd8866000015163ffffffff168460c0015161340190919063ffffffff16565b81610ddf57fe5b60c0840180519290910491829003905260a0840180519091016001600160801b03169052505b60c08201516001600160801b031615610e4457610e388160c00151600160801b8460c001516001600160801b0316613425565b60808301805190910190525b80606001516001600160a01b031682604001516001600160a01b03161415610f6d57806040015115610f44578360a00151610ece57610eac846040015160008760200151886040015188602001518a6060015160096134d5909695949392919063ffffffff16565b6001600160a01b03166080860152600690810b900b6060850152600160a08501525b6000610f1a82602001518e610ee557600254610eeb565b84608001515b8f610efa578560800151610efe565b6003545b608089015160608a015160408b01516006959493929190613667565b90508c15610f26576000035b610f348360c0015182613725565b6001600160801b031660c0840152505b8b610f53578060200151610f5c565b60018160200151035b600290810b900b6060830152610fa8565b80600001516001600160a01b031682604001516001600160a01b031614610fa857610f9b82604001516137db565b600290810b900b60608301525b50610ba4565b836020015160020b816060015160020b1461107c57600080610ffc86604001518660400151886020015188602001518a606001518b608001516009613b03909695949392919063ffffffff16565b604085015160608601516000805461ffff60c81b1916600160c81b61ffff958616021761ffff60b81b1916600160b81b95909416949094029290921762ffffff60a01b1916600160a01b62ffffff60029490940b9390931692909202919091176001600160a01b0319166001600160a01b03909116179055506110a19050565b6040810151600080546001600160a01b0319166001600160a01b039092169190911790555b8060c001516001600160801b031683602001516001600160801b0316146110e75760c0810151600580546001600160801b0319166001600160801b039092169190911790555b6000808c1561114157608083015160025560a08301516001600160801b0316156111355760a0830151600480546001600160801b031981166001600160801b03918216909301169190911790555b8260a00151915061118e565b608083015160035560a08301516001600160801b0316156111875760a0830151600480546001600160801b03808216600160801b92839004821690940116029190911790555b5060a08201515b8315158d1515146111a757602083015183518d036111b4565b82600001518c0383602001515b90985096508c156112ed5760008712156111f6576111f67f00000000000000000000000000000000000000000000000000000000000000008f89600003613c9e565b6000611200613dec565b9050336001600160a01b0316635229374c8a8a8e8e6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b15801561128457600080fd5b505af1158015611298573d6000803e3d6000fd5b505050506112a4613dec565b6112ae828b613f25565b11156112e7576040805162461bcd60e51b815260206004820152600360248201526249494160e81b604482015290519081900360640190fd5b50611417565b6000881215611324576113247f00000000000000000000000000000000000000000000000000000000000000008f8a600003613c9e565b600061132e613f35565b9050336001600160a01b0316635229374c8a8a8e8e6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b1580156113b257600080fd5b505af11580156113c6573d6000803e3d6000fd5b505050506113d2613f35565b6113dc828a613f25565b1115611415576040805162461bcd60e51b815260206004820152600360248201526249494160e81b604482015290519081900360640190fd5b505b8d6001600160a01b0316336001600160a01b03167f19b47279256b2a23a1665c810c8d55a1758940ee09377d4f8d26497a3577dc838a8a87604001518860c001518960600151898960405180888152602001878152602001866001600160a01b03168152602001856001600160801b031681526020018460020b8152602001836001600160801b03168152602001826001600160801b0316815260200197505050505050505060405180910390a350506001805460ff60201b1916600160201b17905550939a92995091975050505050505050565b6005546001600160801b031681565b6004546001600160801b0380821691600160801b90041682565b60098161ffff811061152657600080fd5b015463ffffffff81169150600160201b810460060b90600160581b81046001600160a01b031690600160f81b900460ff1684565b600154600160201b900460ff1661159e576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6001805460ff60201b1916905560008054600160d81b900461ffff16906115c760098385613fcd565b6000805461ffff808416600160d81b810261ffff60d81b1990931692909217909255919250831614611634576040805161ffff80851682528316602082015281517fac49e518f90a358f652e4400164f05a5d8f7e35e7747279bc3a93dbf584e125a929181900390910190a15b50506001805460ff60201b1916600160201b17905550565b6000546001546001600160a01b03821691600160a01b810460020b9161ffff600160b81b8304811692600160c81b8104821692600160d81b9091049091169063ffffffff81169060ff600160201b9091041687565b6001546000908190600160201b900460ff166116ea576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6001805460ff60201b191690556001600160801b03851661170a57600080fd5b60008061175860405180608001604052808c6001600160a01b031681526020018b60020b81526020018a60020b815260200161174e8a6001600160801b0316614070565b600f0b9052614081565b9250925050819350809250600080600086111561177a57611777613dec565b91505b841561178b57611788613f35565b90505b336001600160a01b031663f2d65e2587878b8b6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b15801561180d57600080fd5b505af1158015611821573d6000803e3d6000fd5b50505050600086111561187857611836613dec565b6118408388613f25565b1115611878576040805162461bcd60e51b815260206004820152600260248201526104d360f41b604482015290519081900360640190fd5b84156118c857611886613f35565b6118908287613f25565b11156118c8576040805162461bcd60e51b81526020600482015260026024820152614d3160f01b604482015290519081900360640190fd5b8960020b8b60020b8d6001600160a01b03167f7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde338d8b8b60405180856001600160a01b03168152602001846001600160801b0316815260200183815260200182815260200194505050505060405180910390a450506001805460ff60201b1916600160201b17905550919890975095505050505050565b60035481565b600154600160201b900460ff166119a9576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6001805460ff60201b191690556005546001600160801b0316806119f8576040805162461bcd60e51b81526020600482015260016024820152601360fa1b604482015290519081900360640190fd5b6000611a2d867f000000000000000000000000000000000000000000000000000000000000000062ffffff16620f42406142b7565b90506000611a64867f000000000000000000000000000000000000000000000000000000000000000062ffffff16620f42406142b7565b90506000611a70613dec565b90506000611a7c613f35565b90508815611aaf57611aaf7f00000000000000000000000000000000000000000000000000000000000000008b8b613c9e565b8715611ae057611ae07f00000000000000000000000000000000000000000000000000000000000000008b8a613c9e565b336001600160a01b031663a0cfc3e485858a8a6040518563ffffffff1660e01b815260040180858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b158015611b6257600080fd5b505af1158015611b76573d6000803e3d6000fd5b505050506000611b84613dec565b90506000611b90613f35565b905081611b9d8588613f25565b1115611bd5576040805162461bcd60e51b8152602060048201526002602482015261046360f41b604482015290519081900360640190fd5b80611be08487613f25565b1115611c18576040805162461bcd60e51b8152602060048201526002602482015261463160f01b604482015290519081900360640190fd5b8382038382038115611ca15760015461ffff1660008115611c455761271063ffffffff8316850204611c48565b60005b90506001600160801b03811615611c7b57600480546001600160801b038082168401166001600160801b03199091161790555b611c95818503600160801b8d6001600160801b0316613425565b60028054909101905550505b8015611d265760015460101c61ffff1660008115611ccb5761271063ffffffff8316840204611cce565b60005b90506001600160801b03811615611d0057600480546001600160801b03600160801b8083048216850182160291161790555b611d1a818403600160801b8d6001600160801b0316613425565b60038054909101905550505b8d6001600160a01b0316336001600160a01b03167fbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca6338f8f86866040518085815260200184815260200183815260200182815260200194505050505060405180910390a350506001805460ff60201b1916600160201b179055505050505050505050505050565b6001546000908190600160201b900460ff16611df5576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6001805460ff60201b191690556000611e1160083389896142f1565b60038101549091506001600160801b0390811690861611611e325784611e41565b60038101546001600160801b03165b60038201549093506001600160801b03600160801b909104811690851611611e695783611e7f565b6003810154600160801b90046001600160801b03165b91506001600160801b03831615611ee4576003810180546001600160801b031981166001600160801b03918216869003821617909155611ee4907f0000000000000000000000000000000000000000000000000000000000000000908a908616613c9e565b6001600160801b03821615611f4a576003810180546001600160801b03600160801b808304821686900382160291811691909117909155611f4a907f0000000000000000000000000000000000000000000000000000000000000000908a908516613c9e565b604080516001600160a01b038a1681526001600160801b0380861660208301528416818301529051600288810b92908a900b9133917f70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0919081900360600190a4506001805460ff60201b1916600160201b17905590969095509350505050565b60086020526000908152604090208054600182015460028301546003909301546001600160801b0392831693919281811691600160801b90041685565b60076020526000908152604090205481565b7f000000000000000000000000000000000000000000000000000000000000000081565b6001546000908190600160201b900460ff16612086576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6001805460ff60201b19169055336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061215657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561211e57600080fd5b505afa158015612132573d6000803e3d6000fd5b505050506040513d602081101561214857600080fd5b50516001600160a01b031633145b61215f57600080fd5b6004546001600160801b039081169085161161217b5783612188565b6004546001600160801b03165b6004549092506001600160801b03600160801b9091048116908416116121ae57826121c2565b600454600160801b90046001600160801b03165b90506001600160801b03821615612243576004546001600160801b03838116911614156121f157600019909101905b600480546001600160801b031981166001600160801b03918216859003821617909155612243907f00000000000000000000000000000000000000000000000000000000000000009087908516613c9e565b6001600160801b038116156122c9576004546001600160801b03828116600160801b90920416141561227457600019015b600480546001600160801b03600160801b8083048216859003821602918116919091179091556122c9907f00000000000000000000000000000000000000000000000000000000000000009087908416613c9e565b604080516001600160801b0380851682528316602082015281516001600160a01b0388169233927f596b573906218d3411850b26a6b437d6c4522fdb43d2d2386263f86d50b8b151929081900390910190a36001805460ff60201b1916600160201b1790559094909350915050565b6060806123b2612346612d50565b858580806020026020016040519081016040528093929190818152602001838360200280828437600092018290525054600554600996959450600160a01b820460020b935061ffff600160b81b8304811693506001600160801b0390911691600160c81b900416614355565b915091509250929050565b6001546000908190600160201b900460ff16612406576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6001805460ff60201b1916905560408051608081018252338152600287810b602083015286900b918101919091526000908190819061246290606081016124556001600160801b038a16614070565b600003600f0b9052614081565b92509250925081600003945080600003935060008511806124835750600084115b156124c2576003830180546001600160801b038082168089018216600160801b93849004831689019092169092029091176001600160801b0319161790555b604080516001600160801b0388168152602081018790528082018690529051600289810b92908b900b9133917f0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c919081900360600190a450506001805460ff60201b1916600160201b179055509094909350915050565b600080600061254885856144af565b600285810b810b600090815260066020819052604080832088850b90940b8352822060038401549182900b93600160381b83046001600160a01b0316928492600160d81b820463ffffffff16928492909190600160f81b900460ff16806125ae57600080fd5b6003820154600681900b9850600160381b81046001600160a01b03169650600160d81b810463ffffffff169450600160f81b900460ff16806125ef57600080fd5b50506040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b810b6020840181905261ffff600160b81b8404811695850195909552600160c81b830485166060850152600160d81b909204909316608083015260015463ffffffff811660a084015260ff600160201b90910416151560c08301529093508e820b910b121590506126975750939094039650900393509003905061271a565b8a60020b816020015160020b121561270b5760006126b3612d50565b60208301516040840151600554606086015193945060009384936126e9936009938893879392916001600160801b0316906134d5565b9a9003989098039b50509490960392909203965090910303925061271a915050565b50949093039650039350900390505b9250925092565b600154600160201b900460ff16612765576040805162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b604482015290519081900360640190fd5b6001805460ff60201b19169055336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061283557507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156127fd57600080fd5b505afa158015612811573d6000803e3d6000fd5b505050506040513d602081101561282757600080fd5b50516001600160a01b031633145b61283e57600080fd5b63ffffffff8216158061286c57506103e88263ffffffff161015801561286c5750610fa08263ffffffff1611155b80156128a1575063ffffffff811615806128a157506103e88163ffffffff16101580156128a15750610fa08163ffffffff1611155b6128aa57600080fd5b6001805465ffffffff0000601084901b16840163ffffffff90811663ffffffff19831617909255167fb3159fed3ddfba67bae294599eafe2d0ec98c08bb38e0e5fb87d33154b6e05aa62010000826040805163ffffffff939092068316825261ffff601086901c16602083015286831682820152918516606082015290519081900360800190a150506001805460ff60201b1916600160201b17905550565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b60025481565b60066020819052600091825260409091208054600182015460028301546003909301546001600160801b03831694600160801b909304600f0b93919281900b90600160381b81046001600160a01b031690600160d81b810463ffffffff1690600160f81b900460ff1688565b6000546001600160a01b031615612a8e576040805162461bcd60e51b8152602060048201526002602482015261414960f01b604482015290519081900360640190fd5b6000612a99826137db565b9050600080612ab1612aa9612d50565b600990614578565b6040805160e0810182526001600160a01b038816808252600288810b60208401819052600094840185905261ffff8781166060860181905290871660808601819052630c800c8060a08701819052600160c090970187905287546001600160a01b03191690951762ffffff60a01b1916600160a01b62ffffff9490950b8416949094029390931763ffffffff60b81b1916600160c81b9091021761ffff60d81b1916600160d81b909202919091179093558154600160201b63ffffffff1990911690911760ff60201b191617905591935091507f00000000000000000000000000000000000000000000000000000000000000001660641415612bc6576001805463ffffffff1916630ce40ce4179055612c97565b7f000000000000000000000000000000000000000000000000000000000000000062ffffff166101f41415612c0d576001805463ffffffff1916630d480d48179055612c97565b7f000000000000000000000000000000000000000000000000000000000000000062ffffff166109c41415612c54576001805463ffffffff1916630c800c80179055612c97565b7f000000000000000000000000000000000000000000000000000000000000000062ffffff166127101415612c97576001805463ffffffff1916630c800c801790555b604080516001600160a01b0386168152600285900b602082015281517f98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c95929181900390910190a150505050565b60008082600281900b620d89e71981612cf957fe5b05029050600083600281900b620d89e881612d1057fe5b0502905060008460020b83830360020b81612d2757fe5b0560010190508062ffffff166001600160801b03801681612d4457fe5b0493505050505b919050565b4290565b60008060008460020b8660020b81612d6857fe5b05905060008660020b128015612d8f57508460020b8660020b81612d8857fe5b0760020b15155b15612d9957600019015b8315612e0e57600080612dab836145c4565b600182810b810b600090815260208d9052604090205460ff83169190911b80016000190190811680151597509294509092509085612df057888360ff16860302612e03565b88612dfa826145d6565b840360ff168603025b965050505050612e8c565b600080612e1d836001016145c4565b91509150600060018260ff166001901b031990506000818b60008660010b60010b8152602001908152602001600020541690508060001415955085612e6f57888360ff0360ff16866001010102612e85565b8883612e7a83614675565b0360ff168660010101025b9650505050505b5094509492505050565b60008060008360020b12612ead578260020b612eb5565b8260020b6000035b9050620d89e8811115612ef3576040805162461bcd60e51b81526020600482015260016024820152601560fa1b604482015290519081900360640190fd5b600060018216612f0757600160801b612f19565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690506002821615612f4d576ffff97272373d413259a46990580e213a0260801c5b6004821615612f6c576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b6008821615612f8b576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b6010821615612faa576fffcb9843d60f6159c9db58835c9266440260801c5b6020821615612fc9576fff973b41fa98c081472e6896dfb254c00260801c5b6040821615612fe8576fff2ea16466c96a3843ec78b326b528610260801c5b6080821615613007576ffe5dee046a99a2a811c461f1969c30530260801c5b610100821615613027576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b610200821615613047576ff987a7253ac413176f2b074cf7815e540260801c5b610400821615613067576ff3392b0822b70005940c7a398e4b70f30260801c5b610800821615613087576fe7159475a2c29b7443b29c7fa6e889d90260801c5b6110008216156130a7576fd097f3bdfd2022b8845ad8f792aa58250260801c5b6120008216156130c7576fa9f746462d870fdf8a65dc1f90e061e50260801c5b6140008216156130e7576f70d869a156d2a1b890bb3df62baf32f70260801c5b618000821615613107576f31be135f97d08fd981231505542fcfa60260801c5b62010000821615613128576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b62020000821615613148576e5d6af8dedb81196699c329225ee6040260801c5b62040000821615613167576d2216e584f5fa1ea926041bedfe980260801c5b62080000821615613184576b048a170391f7dc42444e8fa20260801c5b60008460020b131561319f57806000198161319b57fe5b0490505b600160201b8106156131b25760016131b5565b60005b60ff16602082901c0192505050919050565b60008080806001600160a01b03808916908a16101581871280159061324c5760006132008989620f42400362ffffff16620f4240613425565b905082613219576132148c8c8c600161475f565b613226565b6132268b8d8c60016147da565b9550858110613237578a9650613246565b6132438c8b838661488e565b96505b50613296565b816132635761325e8b8b8b60006147da565b613270565b6132708a8c8b600061475f565b935083886000031061328457899550613296565b6132938b8a8a600003856148da565b95505b6001600160a01b038a81169087161482156132f9578080156132b55750815b6132cb576132c6878d8c60016147da565b6132cd565b855b95508080156132da575081155b6132f0576132eb878d8c600061475f565b6132f2565b845b9450613343565b8080156133035750815b613319576133148c888c600161475f565b61331b565b855b9550808015613328575081155b61333e576133398c888c60006147da565b613340565b845b94505b8115801561335357508860000385115b1561335f578860000394505b81801561337e57508a6001600160a01b0316876001600160a01b031614155b1561338d5785890393506133aa565b6133a7868962ffffff168a620f42400362ffffff166142b7565b93505b50505095509550955095915050565b6000600160ff1b82106133cb57600080fd5b5090565b808203828113156000831215146133e557600080fd5b92915050565b818101828112156000831215146133e557600080fd5b600082158061341c5750508181028183828161341957fe5b04145b6133e557600080fd5b600080806000198587098686029250828110908390030390508061345b576000841161345057600080fd5b5082900490506134ce565b80841161346757600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150505b9392505050565b60008063ffffffff871661357b576000898661ffff1661ffff81106134f657fe5b60408051608081018252919092015463ffffffff808216808452600160201b8304600690810b810b900b6020850152600160581b83046001600160a01b031694840194909452600160f81b90910460ff16151560608301529092508a161461356757613564818a8988614926565b90505b80602001518160400151925092505061365b565b8688036000806135908c8c858c8c8c8c6149c9565b91509150816000015163ffffffff168363ffffffff1614156135c257816020015182604001519450945050505061365b565b805163ffffffff848116911614156135ea57806020015181604001519450945050505061365b565b8151815160208085015190840151918390039286039163ffffffff80841692908516910360060b8161361857fe5b05028460200151018263ffffffff168263ffffffff1686604001518660400151036001600160a01b0316028161364a57fe5b048560400151019650965050505050505b97509795505050505050565b600295860b860b60009081526020979097526040909620600181018054909503909455938301805490920390915560038201805463ffffffff600160d81b6001600160a01b03600160381b808504821690960316909402670100000000000000600160d81b031990921691909117600681810b90960390950b66ffffffffffffff1666ffffffffffffff199095169490941782810485169095039093160263ffffffff60d81b1990931692909217905554600160801b9004600f0b90565b60008082600f0b121561378a57826001600160801b03168260000384039150816001600160801b031610613785576040805162461bcd60e51b81526020600482015260026024820152614c5360f01b604482015290519081900360640190fd5b6133e5565b826001600160801b03168284019150816001600160801b031610156133e5576040805162461bcd60e51b81526020600482015260026024820152614c4160f01b604482015290519081900360640190fd5b60006401000276a36001600160a01b03831610801590613817575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b038316105b61384c576040805162461bcd60e51b81526020600482015260016024820152602960f91b604482015290519081900360640190fd5b77ffffffffffffffffffffffffffffffffffffffff00000000602083901b166001600160801b03811160071b81811c67ffffffffffffffff811160061b90811c63ffffffff811160051b90811c61ffff811160041b90811c60ff8111600390811b91821c600f811160021b90811c918211600190811b92831c979088119617909417909217179091171717608081106138ed57607f810383901c91506138f7565b80607f0383901b91505b908002607f81811c60ff83811c9190911c800280831c81831c1c800280841c81841c1c800280851c81851c1c800280861c81861c1c800280871c81871c1c800280881c81881c1c800280891c81891c1c8002808a1c818a1c1c8002808b1c818b1c1c8002808c1c818c1c1c8002808d1c818d1c1c8002808e1c9c81901c9c909c1c80029c8d901c9e9d607f198f0160401b60c09190911c678000000000000000161760c19b909b1c674000000000000000169a909a1760c29990991c672000000000000000169890981760c39790971c671000000000000000169690961760c49590951c670800000000000000169490941760c59390931c670400000000000000169290921760c69190911c670200000000000000161760c79190911c600160381b161760c89190911c6680000000000000161760c99190911c6640000000000000161760ca9190911c6620000000000000161760cb9190911c6610000000000000161760cc9190911c6608000000000000161760cd9190911c66040000000000001617693627a301d71055774c8581026f028f6481ab7f045a5af012a19d003aa9198101608090811d906fdb2df09e81959a81455e260799a0632f8301901d600281810b9083900b14613af457886001600160a01b0316613ad882612e96565b6001600160a01b03161115613aed5781613aef565b805b613af6565b815b9998505050505050505050565b6000806000898961ffff1661ffff8110613b1957fe5b60408051608081018252919092015463ffffffff808216808452600160201b8304600690810b810b900b6020850152600160581b83046001600160a01b031694840194909452600160f81b90910460ff161515606083015290925089161415613b88578885925092505061365b565b8461ffff168461ffff16118015613ba957506001850361ffff168961ffff16145b15613bb657839150613bba565b8491505b8161ffff168960010161ffff1681613bce57fe5b069250613bdd81898989614926565b8a8461ffff1661ffff8110613bee57fe5b825191018054602084015160408501516060909501511515600160f81b026001600160f81b036001600160a01b03909616600160581b027fff0000000000000000000000000000000000000000ffffffffffffffffffffff60069390930b66ffffffffffffff16600160201b026affffffffffffff000000001963ffffffff90971663ffffffff199095169490941795909516929092171692909217929092161790555097509795505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1781529251825160009485949389169392918291908083835b60208310613d1a5780518252601f199092019160209182019101613cfb565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613d7c576040519150601f19603f3d011682016040523d82523d6000602084013e613d81565b606091505b5091509150818015613daf575080511580613daf5750808060200190516020811015613dac57600080fd5b50515b613de5576040805162461bcd60e51b81526020600482015260026024820152612a2360f11b604482015290519081900360640190fd5b5050505050565b604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17815291518151600093849384936001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001693919290918291908083835b60208310613e855780518252601f199092019160209182019101613e66565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d8060008114613ee5576040519150601f19603f3d011682016040523d82523d6000602084013e613eea565b606091505b5091509150818015613efe57506020815110155b613f0757600080fd5b808060200190516020811015613f1c57600080fd5b50519250505090565b808201828110156133e557600080fd5b604080513060248083019190915282518083039091018152604490910182526020810180516001600160e01b03166370a0823160e01b17815291518151600093849384936001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016939192909182919080838360208310613e855780518252601f199092019160209182019101613e66565b6000808361ffff161161400b576040805162461bcd60e51b81526020600482015260016024820152604960f81b604482015290519081900360640190fd5b8261ffff168261ffff16116140215750816134ce565b825b8261ffff168161ffff161015614067576001858261ffff1661ffff811061404657fe5b01805463ffffffff191663ffffffff92909216919091179055600101614023565b50909392505050565b80600f81900b8114612d4b57600080fd5b6000806000614098846020015185604001516144af565b6040805160e0810182526000546001600160a01b0381168252600160a01b8104600290810b810b900b602080840182905261ffff600160b81b8404811685870152600160c81b84048116606080870191909152600160d81b90940416608085015260015463ffffffff811660a086015260ff600160201b90910416151560c08501528851908901519489015192890151939461413a9491939092909190614bc3565b93508460600151600f0b6000146142af57846020015160020b816020015160020b121561418f576141886141718660200151612e96565b61417e8760400151612e96565b8760600151614d78565b92506142af565b846040015160020b816020015160020b12156142855760055460408201516001600160801b03909116906141e1906141c5612d50565b6020850151606086015160808701516009949392918791613b03565b6000805461ffff60c81b1916600160c81b61ffff938416021761ffff60b81b1916600160b81b939092169290920217905581516040870151614231919061422790612e96565b8860600151614d78565b935061424f6142438760200151612e96565b83516060890151614dbc565b925061425f818760600151613725565b600580546001600160801b0319166001600160801b0392909216919091179055506142af565b6142ac6142958660200151612e96565b6142a28760400151612e96565b8760600151614dbc565b91505b509193909250565b60006142c4848484613425565b9050600082806142d057fe5b84860911156134ce5760001981106142e757600080fd5b6001019392505050565b6040805160609490941b6bffffffffffffffffffffffff1916602080860191909152600293840b60e890811b60348701529290930b90911b60378401528051808403601a018152603a90930181528251928201929092206000908152929052902090565b60608060008361ffff1611614395576040805162461bcd60e51b81526020600482015260016024820152604960f81b604482015290519081900360640190fd5b865167ffffffffffffffff811180156143ad57600080fd5b506040519080825280602002602001820160405280156143d7578160200160208202803683370190505b509150865167ffffffffffffffff811180156143f257600080fd5b5060405190808252806020026020018201604052801561441c578160200160208202803683370190505b50905060005b87518110156144a25761444d8a8a8a848151811061443c57fe5b60200260200101518a8a8a8a6134d5565b84838151811061445957fe5b6020026020010184848151811061446c57fe5b60200260200101826001600160a01b03166001600160a01b03168152508260060b60060b81525050508080600101915050614422565b5097509795505050505050565b8060020b8260020b126144ef576040805162461bcd60e51b8152602060048201526003602482015262544c5560e81b604482015290519081900360640190fd5b620d89e719600283900b1215614532576040805162461bcd60e51b8152602060048201526003602482015262544c4d60e81b604482015290519081900360640190fd5b620d89e8600282900b1315614574576040805162461bcd60e51b815260206004820152600360248201526254554d60e81b604482015290519081900360640190fd5b5050565b6040805160808101825263ffffffff9283168082526000602083018190529282019290925260016060909101819052835463ffffffff1916909117909116600160f81b17909155908190565b60020b600881901d9161010090910790565b60008082116145e457600080fd5b600160801b82106145f757608091821c91015b68010000000000000000821061460f57604091821c91015b600160201b821061462257602091821c91015b62010000821061463457601091821c91015b610100821061464557600891821c91015b6010821061465557600491821c91015b6004821061466557600291821c91015b60028210612d4b57600101919050565b600080821161468357600080fd5b5060ff6001600160801b0382161561469e57607f19016146a6565b608082901c91505b67ffffffffffffffff8216156146bf57603f19016146c7565b604082901c91505b63ffffffff8216156146dc57601f19016146e4565b602082901c91505b61ffff8216156146f757600f19016146ff565b601082901c91505b60ff8216156147115760071901614719565b600882901c91505b600f82161561472b5760031901614733565b600482901c91505b6003821615614745576001190161474d565b600282901c91505b6001821615612d4b5760001901919050565b6000836001600160a01b0316856001600160a01b0316111561477f579293925b816147ac576147a7836001600160801b03168686036001600160a01b0316600160601b613425565b6147cf565b6147cf836001600160801b03168686036001600160a01b0316600160601b6142b7565b90505b949350505050565b6000836001600160a01b0316856001600160a01b031611156147fa579293925b6fffffffffffffffffffffffffffffffff60601b606084901b166001600160a01b03868603811690871661482d57600080fd5b8361485d57866001600160a01b03166148508383896001600160a01b0316613425565b8161485757fe5b04614883565b6148836148748383896001600160a01b03166142b7565b886001600160a01b0316614deb565b979650505050505050565b600080856001600160a01b0316116148a557600080fd5b6000846001600160801b0316116148bb57600080fd5b816148cd576147a78585856001614df6565b6147cf8585856001614ed7565b600080856001600160a01b0316116148f157600080fd5b6000846001600160801b03161161490757600080fd5b81614919576147a78585856000614ed7565b6147cf8585856000614df6565b61492e615704565b600085600001518503905060405180608001604052808663ffffffff1681526020018263ffffffff168660020b0288602001510160060b81526020016000856001600160801b031611614982576001614984565b845b6001600160801b031663ffffffff60801b608085901b16816149a257fe5b048860400151016001600160a01b0316815260200160011515815250915050949350505050565b6149d1615704565b6149d9615704565b888561ffff1661ffff81106149ea57fe5b60408051608081018252919092015463ffffffff8116808352600160201b8204600690810b810b900b6020840152600160581b82046001600160a01b031693830193909352600160f81b900460ff16151560608201529250614a4e90899089614fc3565b15614a86578663ffffffff16826000015163ffffffff161415614a705761365b565b81614a7d83898988614926565b9150915061365b565b888361ffff168660010161ffff1681614a9b57fe5b0661ffff1661ffff8110614aab57fe5b60408051608081018252929091015463ffffffff81168352600160201b8104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b90910416151560608201819052909250614b6057604080516080810182528a5463ffffffff81168252600160201b8104600690810b810b900b6020830152600160581b81046001600160a01b031692820192909252600160f81b90910460ff161515606082015291505b614b6f88836000015189614fc3565b614ba6576040805162461bcd60e51b815260206004820152600360248201526213d31160ea1b604482015290519081900360640190fd5b614bb38989898887615084565b9150915097509795505050505050565b6000614bd260088787876142f1565b60025460035491925090600080600f87900b15614d18576000614bf3612d50565b6000805460055492935090918291614c3d9160099186918591600160a01b810460020b9161ffff600160b81b83048116926001600160801b0390921691600160c81b9004166134d5565b9092509050614c7760068d8b8d8b8b87898b60007f0000000000000000000000000000000000000000000000000000000000000000615222565b9450614cae60068c8b8d8b8b87898b60017f0000000000000000000000000000000000000000000000000000000000000000615222565b93508415614ce257614ce260078d7f00000000000000000000000000000000000000000000000000000000000000006153df565b8315614d1457614d1460078c7f00000000000000000000000000000000000000000000000000000000000000006153df565b5050505b600080614d2a60068c8c8b8a8a615445565b9092509050614d3b878a84846154f1565b600089600f0b1215614d69578315614d5857614d5860068c615686565b8215614d6957614d6960068b615686565b50505050505095945050505050565b60008082600f0b12614d9e57614d99614d9485858560016147da565b6133b9565b6147d2565b614db1614d9485858560000360006147da565b600003949350505050565b60008082600f0b12614dd857614d99614d94858585600161475f565b614db1614d94858585600003600061475f565b808204910615150190565b60008115614e695760006001600160a01b03841115614e2c57614e2784600160601b876001600160801b0316613425565b614e44565b6001600160801b038516606085901b81614e4257fe5b045b9050614e61614e5c6001600160a01b03881683613f25565b6156b2565b9150506147d2565b60006001600160a01b03841115614e9757614e9284600160601b876001600160801b03166142b7565b614eae565b614eae606085901b6001600160801b038716614deb565b905080866001600160a01b031611614ec557600080fd5b6001600160a01b0386160390506147d2565b600082614ee55750836147d2565b6fffffffffffffffffffffffffffffffff60601b606085901b168215614f7c576001600160a01b03861684810290858281614f1c57fe5b041415614f4d57818101828110614f4b57614f4183896001600160a01b0316836142b7565b93505050506147d2565b505b614f7382614f6e878a6001600160a01b03168681614f6757fe5b0490613f25565b614deb565b925050506147d2565b6001600160a01b03861684810290858281614f9357fe5b04148015614fa057508082115b614fa957600080fd5b808203614f41614e5c846001600160a01b038b16846142b7565b60008363ffffffff168363ffffffff1611158015614fed57508363ffffffff168263ffffffff1611155b15615009578163ffffffff168363ffffffff16111590506134ce565b60008463ffffffff168463ffffffff1611615030578363ffffffff16600160201b01615038565b8363ffffffff165b64ffffffffff16905060008563ffffffff168463ffffffff1611615068578363ffffffff16600160201b01615070565b8363ffffffff165b64ffffffffff169091111595945050505050565b61508c615704565b615094615704565b60008361ffff168560010161ffff16816150aa57fe5b0661ffff169050600060018561ffff16830103905060005b506002818301048961ffff871682816150d757fe5b0661ffff81106150e357fe5b60408051608081018252929091015463ffffffff81168352600160201b8104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b9091041615156060820181905290955061514d578060010192506150c2565b898661ffff16826001018161515e57fe5b0661ffff811061516a57fe5b60408051608081018252929091015463ffffffff81168352600160201b8104600690810b810b900b60208401526001600160a01b03600160581b8204169183019190915260ff600160f81b909104161515606082015285519094506000906151d4908b908b614fc3565b90508080156151ed57506151ed8a8a8760000151614fc3565b156151f85750615215565b806152085760018203925061520f565b8160010193505b506150c2565b5050509550959350505050565b60028a810b900b600090815260208c90526040812080546001600160801b03168261524d828d613725565b9050846001600160801b0316816001600160801b0316111561529b576040805162461bcd60e51b81526020600482015260026024820152614c4f60f01b604482015290519081900360640190fd5b6001600160801b038281161590821615811415945015615344578c60020b8e60020b1361532c57600183018b9055600283018a9055600383018054670100000000000000600160d81b031916600160381b6001600160a01b038c16021766ffffffffffffff191666ffffffffffffff60068b900b161763ffffffff60d81b1916600160d81b63ffffffff8a16021790555b6003830180546001600160f81b0316600160f81b1790555b82546001600160801b0319166001600160801b0382161783558561538d5782546153889061538390600160801b9004600f90810b810b908f900b6133eb565b614070565b6153ae565b82546153ae9061538390600160801b9004600f90810b810b908f900b6133cf565b8354600f9190910b6001600160801b03908116600160801b0291161790925550909c9b505050505050505050505050565b8060020b8260020b816153ee57fe5b0760020b156153fc57600080fd5b6000806154178360020b8560020b8161541157fe5b056145c4565b600191820b820b60009081526020979097526040909620805460ff9097169190911b90951890945550505050565b600285810b80820b60009081526020899052604080822088850b850b83529082209193849391929184918291908a900b1261548b5750506001820154600283015461549e565b8360010154880391508360020154870390505b6000808b60020b8b60020b12156154c0575050600183015460028401546154d3565b84600101548a0391508460020154890390505b92909803979097039b96909503949094039850939650505050505050565b6040805160a08101825285546001600160801b0390811682526001870154602083015260028701549282019290925260038601548083166060830152600160801b900490911660808201526000600f85900b6155905781516001600160801b0316615588576040805162461bcd60e51b815260206004820152600260248201526104e560f41b604482015290519081900360640190fd5b50805161559f565b815161559c9086613725565b90505b60006155c38360200151860384600001516001600160801b0316600160801b613425565b905060006155e98460400151860385600001516001600160801b0316600160801b613425565b905086600f0b6000146156105787546001600160801b0319166001600160801b0384161788555b60018801869055600288018590556001600160801b03821615158061563e57506000816001600160801b0316115b1561567c576003880180546001600160801b031981166001600160801b039182168501821617808216600160801b9182900483168501909216021790555b5050505050505050565b600290810b810b6000908152602092909252604082208281556001810183905590810182905560030155565b806001600160a01b0381168114612d4b57600080fd5b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b6040805160808101825260008082526020820181905291810182905260608101919091529056fea164736f6c6343000706000aa164736f6c6343000706000a