Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
14996336 | 10 secs ago | 0 ETH | ||||
14996333 | 16 secs ago | 0 ETH | ||||
14996333 | 16 secs ago | 0 ETH | ||||
14996326 | 38 secs ago | 0 ETH | ||||
14996325 | 40 secs ago | 0 ETH | ||||
14996325 | 40 secs ago | 0 ETH | ||||
14996325 | 40 secs ago | 0 ETH | ||||
14996325 | 40 secs ago | 0 ETH | ||||
14996314 | 1 min ago | 0 ETH | ||||
14996314 | 1 min ago | 0 ETH | ||||
14996314 | 1 min ago | 0 ETH | ||||
14996314 | 1 min ago | 0 ETH | ||||
14996314 | 1 min ago | 0 ETH | ||||
14996314 | 1 min ago | 0 ETH | ||||
14996314 | 1 min ago | 0 ETH | ||||
14996314 | 1 min ago | 0 ETH | ||||
14996314 | 1 min ago | 0 ETH | ||||
14996314 | 1 min ago | 0 ETH | ||||
14996311 | 1 min ago | 0 ETH | ||||
14996311 | 1 min ago | 0 ETH | ||||
14996311 | 1 min ago | 0 ETH | ||||
14996309 | 1 min ago | 0 ETH | ||||
14996309 | 1 min ago | 0 ETH | ||||
14996307 | 1 min ago | 0 ETH | ||||
14996304 | 1 min ago | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
ClPoolFactory
Compiler Version
v0.7.6+commit.7338295f
Optimization Enabled:
Yes with 800 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity =0.7.6; import "./interfaces/IClPoolFactory.sol"; import "contracts/v2/ClPoolDeployer.sol"; import "./interfaces/IClPool.sol"; import "@openzeppelin-3.4.2/contracts/proxy/Initializable.sol"; /// @title Canonical CL factory /// @notice Deploys CL pools and manages ownership and control over pool protocol fees contract ClPoolFactory is IClPoolFactory, ClPoolDeployer, Initializable { bytes32 public constant POOL_INIT_CODE_HASH = 0x1565b129f2d1790f12d45301b9b084335626f0c92410bc43130763b69971135d; /// @inheritdoc IClPoolFactory address public override owner; /// @inheritdoc IClPoolFactory address public override nfpManager; /// @inheritdoc IClPoolFactory address public override votingEscrow; /// @inheritdoc IClPoolFactory address public override voter; /// @inheritdoc IClPoolFactory mapping(uint24 => int24) public override feeAmountTickSpacing; /// @inheritdoc IClPoolFactory mapping(address => mapping(address => mapping(uint24 => address))) public override getPool; /// @inheritdoc IClPoolFactory address public override feeCollector; /// @inheritdoc IClPoolFactory uint8 public override feeProtocol; // pool specific fee protocol if set mapping(address => uint8) _poolFeeProtocol; address public feeSetter; function initialize( address _nfpManager, address _votingEscrow, address _voter, address _implementation, address _feeSetter ) public initializer { owner = msg.sender; nfpManager = _nfpManager; votingEscrow = _votingEscrow; voter = _voter; implementation = _implementation; feeSetter = _feeSetter; emit OwnerChanged(address(0), msg.sender); emit ImplementationChanged(address(0), _implementation); emit FeeSetterChanged(address(0), _feeSetter); feeAmountTickSpacing[100] = 1; emit FeeAmountEnabled(100, 1); feeAmountTickSpacing[500] = 10; emit FeeAmountEnabled(500, 10); feeAmountTickSpacing[3000] = 60; emit FeeAmountEnabled(3000, 60); feeAmountTickSpacing[10000] = 200; emit FeeAmountEnabled(10000, 200); feeProtocol = 17; emit SetFeeProtocol(0, 0, feeProtocol, feeProtocol); } /// @inheritdoc IClPoolFactory function createPool( address tokenA, address tokenB, uint24 fee, uint160 sqrtPriceX96 ) public override returns (address pool) { require(tokenA != tokenB, "IT"); (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), "A0"); int24 tickSpacing = feeAmountTickSpacing[fee]; require(tickSpacing != 0, "T0"); require(getPool[token0][token1][fee] == address(0), "PE"); pool = _deploy( address(this), nfpManager, votingEscrow, voter, token0, token1, fee, tickSpacing ); getPool[token0][token1][fee] = pool; // populate mapping in the reverse direction, deliberate choice to avoid the cost of comparing addresses getPool[token1][token0][fee] = pool; emit PoolCreated(token0, token1, fee, tickSpacing, pool); if (sqrtPriceX96 > 0) { IClPool(pool).initialize(sqrtPriceX96); } } /// @inheritdoc IClPoolFactory function setOwner(address _owner) external override { require(msg.sender == owner, "AUTH"); emit OwnerChanged(owner, _owner); owner = _owner; } /// @inheritdoc IClPoolFactory function enableFeeAmount(uint24 fee, int24 tickSpacing) public override { require(msg.sender == owner, "AUTH"); require(fee < 1000000); // tick spacing is capped at 16384 to prevent the situation where tickSpacing is so large that // TickBitmap#nextInitializedTickWithinOneWord overflows int24 container from a valid tick // 16384 ticks represents a >5x price change with ticks of 1 bips require(tickSpacing > 0 && tickSpacing < 16384); require(feeAmountTickSpacing[fee] == 0); feeAmountTickSpacing[fee] = tickSpacing; emit FeeAmountEnabled(fee, tickSpacing); } /// @dev Sets implementation for beacon proxies /// @param _implementation new implementation address function setImplementation(address _implementation) external { require(msg.sender == owner, "AUTH"); emit ImplementationChanged(implementation, _implementation); implementation = _implementation; } /// @inheritdoc IClPoolFactory function setFeeCollector(address _feeCollector) external override { require(msg.sender == owner, "AUTH"); emit FeeCollectorChanged(feeCollector, _feeCollector); feeCollector = _feeCollector; } /// @inheritdoc IClPoolFactory function setFeeProtocol(uint8 _feeProtocol) external override { require(msg.sender == feeSetter, "AUTH"); require(_feeProtocol <= 100, "FTL"); uint8 feeProtocolOld = feeProtocol; feeProtocol = _feeProtocol; emit SetFeeProtocol( feeProtocolOld % 16, feeProtocolOld >> 4, feeProtocol, feeProtocol ); } /// @inheritdoc IClPoolFactory function setPoolFeeProtocol( address pool, uint8 _feeProtocol ) external override { require(msg.sender == feeSetter, "AUTH"); require(_feeProtocol <= 100, "FTL"); uint8 feeProtocolOld = poolFeeProtocol(pool); _poolFeeProtocol[pool] = _feeProtocol; emit SetPoolFeeProtocol( pool, feeProtocolOld % 16, feeProtocolOld >> 4, _feeProtocol, _feeProtocol ); IClPool(pool).setFeeProtocol(); } /// @inheritdoc IClPoolFactory function poolFeeProtocol( address pool ) public view override returns (uint8 __poolFeeProtocol) { __poolFeeProtocol = _poolFeeProtocol[pool]; if (__poolFeeProtocol == 0) { __poolFeeProtocol = feeProtocol; } return __poolFeeProtocol; } /// @notice initializePoolIfNecessary function initializePool( address token0, address token1, uint24 fee, uint160 sqrtPriceX96 ) external returns (address pool) { pool = getPool[token0][token1][fee]; if (pool != address(0)) { (uint160 sqrtPriceX96Existing, , , , , , ) = IClPool(pool).slot0(); if (sqrtPriceX96Existing == 0) { IClPool(pool).initialize(sqrtPriceX96); } } } function setFeeSetter(address _newFeeSetter) external override { require(msg.sender == feeSetter, "AUTH"); emit FeeSetterChanged(feeSetter, _newFeeSetter); feeSetter = _newFeeSetter; } function setFee(address _pool, uint24 _fee) external override { require(msg.sender == feeSetter, "AUTH"); IClPool(_pool).setFee(_fee); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./Proxy.sol"; import "../utils/Address.sol"; import "./IBeacon.sol"; /** * @dev This contract implements a proxy that gets the implementation address for each call from a {UpgradeableBeacon}. * * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't * conflict with the storage layout of the implementation behind the proxy. * * _Available since v3.4._ */ contract BeaconProxy is Proxy { /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 private constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Initializes the proxy with `beacon`. * * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This * will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity * constructor. * * Requirements: * * - `beacon` must be a contract with the interface {IBeacon}. */ constructor(address beacon, bytes memory data) payable { assert(_BEACON_SLOT == bytes32(uint256(keccak256("eip1967.proxy.beacon")) - 1)); _setBeacon(beacon, data); } /** * @dev Returns the current beacon address. */ function _beacon() internal view virtual returns (address beacon) { bytes32 slot = _BEACON_SLOT; // solhint-disable-next-line no-inline-assembly assembly { beacon := sload(slot) } } /** * @dev Returns the current implementation address of the associated beacon. */ function _implementation() internal view virtual override returns (address) { return IBeacon(_beacon()).implementation(); } /** * @dev Changes the proxy to use a new beacon. * * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. * * Requirements: * * - `beacon` must be a contract. * - The implementation returned by `beacon` must be a contract. */ function _setBeacon(address beacon, bytes memory data) internal virtual { require( Address.isContract(beacon), "BeaconProxy: beacon is not a contract" ); require( Address.isContract(IBeacon(beacon).implementation()), "BeaconProxy: beacon implementation is not a contract" ); bytes32 slot = _BEACON_SLOT; // solhint-disable-next-line no-inline-assembly assembly { sstore(slot, beacon) } if (data.length > 0) { Address.functionDelegateCall(_implementation(), data, "BeaconProxy: function call failed"); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity >=0.4.24 <0.8.0; import "../utils/Address.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /// @dev Returns true if and only if the function is running in the constructor function _isConstructor() private view returns (bool) { return !Address.isContract(address(this)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /** * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to * be specified by overriding the virtual {_implementation} function. * * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a * different contract through the {_delegate} function. * * The success and return data of the delegated call will be returned back to the caller of the proxy. */ abstract contract Proxy { /** * @dev Delegates the current call to `implementation`. * * This function does not return to its internall call site, it will return directly to the external caller. */ function _delegate(address implementation) internal virtual { // solhint-disable-next-line no-inline-assembly assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function * and {_fallback} should delegate. */ function _implementation() internal view virtual returns (address); /** * @dev Delegates the current call to the address returned by `_implementation()`. * * This function does not return to its internall call site, it will return directly to the external caller. */ function _fallback() internal virtual { _beforeFallback(); _delegate(_implementation()); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other * function in the contract matches the call data. */ fallback () external payable virtual { _fallback(); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data * is empty. */ receive () external payable virtual { _fallback(); } /** * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback` * call, or as part of the Solidity `fallback` or `receive` functions. * * If overriden should call `super._beforeFallback()`. */ function _beforeFallback() internal virtual { } }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity =0.7.6; import "@openzeppelin-3.4.2/contracts/proxy/BeaconProxy.sol"; contract ClBeaconProxy is BeaconProxy { // Doing so the CREATE2 hash is easier to calculate constructor() payable BeaconProxy(msg.sender, "") {} }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity =0.7.6; import "./interfaces/IClPoolDeployer.sol"; import "./interfaces/IClPool.sol"; import "../ClBeaconProxy.sol"; import "@openzeppelin-3.4.2/contracts/proxy/IBeacon.sol"; contract ClPoolDeployer is IClPoolDeployer, IBeacon { /// @inheritdoc IBeacon address public override implementation; /// @dev Deploys a pool with the given parameters by transiently setting the parameters storage slot and then /// clearing it after deploying the pool. /// @param nfpManager The contract address of the CL NFP Manager /// @param votingEscrow The contract address of Voting Escrow /// @param voter The contract address of Voter /// @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 spacing between usable ticks function _deploy( address factory, address nfpManager, address votingEscrow, address voter, address token0, address token1, uint24 fee, int24 tickSpacing ) internal returns (address pool) { pool = address( new ClBeaconProxy{ salt: keccak256(abi.encode(token0, token1, fee)) }() ); IClPool(pool).initialize( factory, nfpManager, votingEscrow, voter, token0, token1, fee, tickSpacing ); } }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; import "./pool/IClPoolImmutables.sol"; import "./pool/IClPoolState.sol"; import "./pool/IClPoolDerivedState.sol"; import "./pool/IClPoolActions.sol"; import "./pool/IClPoolOwnerActions.sol"; import "./pool/IClPoolEvents.sol"; /// @title The interface for a CL V2 Pool /// @notice A CL 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 IClPool is IClPoolImmutables, IClPoolState, IClPoolDerivedState, IClPoolActions, IClPoolOwnerActions, IClPoolEvents { /// @notice Initializes a pool with parameters provided function initialize( address _factory, address _nfpManager, address _veRam, address _voter, address _token0, address _token1, uint24 _fee, int24 _tickSpacing ) external; function _advancePeriod() external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title An interface for a contract that is capable of deploying CL Pools /// @notice A contract that constructs a pool must implement this to pass arguments to the pool /// @dev The store and retrieve method of supplying constructor arguments for CREATE2 isn't needed anymore /// since we now use a beacon pattern interface IClPoolDeployer { }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; pragma abicoder v2; /// @title The interface for the CL Factory /// @notice The CL Factory facilitates creation of CL pools and control over the protocol fees interface IClPoolFactory { /// @notice Emitted when the owner of the factory is changed /// @param oldOwner The owner before the owner was changed /// @param newOwner The owner after the owner was changed event OwnerChanged(address indexed oldOwner, address indexed newOwner); /// @notice Emitted when a pool is created /// @param token0 The first token of the pool by address sort order /// @param token1 The second token of the pool by address sort order /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip /// @param tickSpacing The minimum number of ticks between initialized ticks /// @param pool The address of the created pool event PoolCreated( address indexed token0, address indexed token1, uint24 indexed fee, int24 tickSpacing, address pool ); /// @notice Emitted when a new fee amount is enabled for pool creation via the factory /// @param fee The enabled fee, denominated in hundredths of a bip /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing); /// @notice Emitted when pairs implementation is changed /// @param oldImplementation The previous implementation /// @param newImplementation The new implementation event ImplementationChanged( address indexed oldImplementation, address indexed newImplementation ); /// @notice Emitted when the fee collector is changed /// @param oldFeeCollector The previous implementation /// @param newFeeCollector The new implementation event FeeCollectorChanged( address indexed oldFeeCollector, address indexed newFeeCollector ); /// @notice Emitted when the protocol fee is changed /// @param feeProtocol0Old The previous value of the token0 protocol fee /// @param feeProtocol1Old The previous value of the token1 protocol fee /// @param feeProtocol0New The updated value of the token0 protocol fee /// @param feeProtocol1New The updated value of the token1 protocol fee event SetFeeProtocol( uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New ); /// @notice Emitted when the protocol fee is changed /// @param pool The pool address /// @param feeProtocol0Old The previous value of the token0 protocol fee /// @param feeProtocol1Old The previous value of the token1 protocol fee /// @param feeProtocol0New The updated value of the token0 protocol fee /// @param feeProtocol1New The updated value of the token1 protocol fee event SetPoolFeeProtocol( address pool, uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New ); /// @notice Emitted when the feeSetter of the factory is changed /// @param oldSetter The feeSetter before the setter was changed /// @param newSetter The feeSetter after the setter was changed event FeeSetterChanged( address indexed oldSetter, address indexed newSetter ); /// @notice Returns the current owner of the factory /// @dev Can be changed by the current owner via setOwner /// @return The address of the factory owner function owner() external view returns (address); /// @notice Returns the CL NFP Manager function nfpManager() external view returns (address); /// @notice Returns the votingEscrow address function votingEscrow() external view returns (address); /// @notice Returns Voter address function voter() external view returns (address); /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee /// @return The tick spacing function feeAmountTickSpacing(uint24 fee) external view returns (int24); /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order /// @param tokenA The contract address of either token0 or token1 /// @param tokenB The contract address of the other token /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip /// @return pool The pool address function getPool( address tokenA, address tokenB, uint24 fee ) external view returns (address pool); /// @notice Returns the address of the fee collector contract /// @dev Fee collector decides where the protocol fees go (fee distributor, treasury, etc.) function feeCollector() external view returns (address); /// @notice Creates a pool for the given two tokens and fee /// @param tokenA One of the two tokens in the desired pool /// @param tokenB The other of the two tokens in the desired pool /// @param fee The desired fee for the pool /// @param sqrtPriceX96 initial sqrtPriceX96 of the pool /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments /// are invalid. /// @return pool The address of the newly created pool function createPool( address tokenA, address tokenB, uint24 fee, uint160 sqrtPriceX96 ) external returns (address pool); /// @notice Updates the owner of the factory /// @dev Must be called by the current owner /// @param _owner The new owner of the factory function setOwner(address _owner) external; /// @notice Enables a fee amount with the given tickSpacing /// @dev Fee amounts may never be removed once enabled /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6) /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount function enableFeeAmount(uint24 fee, int24 tickSpacing) external; /// @notice returns the default protocol fee. function feeProtocol() external view returns (uint8); /// @notice returns the protocol fee for both tokens of a pool. function poolFeeProtocol(address pool) external view returns (uint8); /// @notice Sets the default protocol's % share of the fees /// @param _feeProtocol new default protocol fee for token0 and token1 function setFeeProtocol(uint8 _feeProtocol) external; /// @notice Sets the fee collector address /// @param _feeCollector the fee collector address function setFeeCollector(address _feeCollector) external; function setFeeSetter(address _newFeeSetter) external; function setFee(address _pool, uint24 _fee) external; /// @notice Sets the default protocol's % share of the fees /// @param pool the pool address /// @param feeProtocol new protocol fee for the pool for token0 and token1 function setPoolFeeProtocol(address pool, uint8 feeProtocol) external; }
// 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 IClPoolActions { /// @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 at index 0 /// @dev The caller of this method receives a callback in the form of IRamsesV2MintCallback#ramsesV2MintCallback /// 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 Adds liquidity for the given recipient/tickLower/tickUpper position /// @dev The caller of this method receives a callback in the form of IRamsesV2MintCallback#ramsesV2MintCallback /// 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 index The index 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 veNFTTokenId The veNFT tokenId to attach to the position /// @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, uint256 index, int24 tickLower, int24 tickUpper, uint128 amount, uint256 veNFTTokenId, bytes calldata data ) external returns (uint256 amount0, uint256 amount1); /// @notice Collects tokens owed to a position /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity. /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity. /// @param recipient The address which should receive the fees collected /// @param tickLower The lower tick of the position for which to collect fees /// @param tickUpper The upper tick of the position for which to collect fees /// @param amount0Requested How much token0 should be withdrawn from the fees owed /// @param amount1Requested How much token1 should be withdrawn from the fees owed /// @return amount0 The amount of fees collected in token0 /// @return amount1 The amount of fees collected in token1 function collect( address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested ) external returns (uint128 amount0, uint128 amount1); /// @notice 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 index The index of the position to be collected /// @param tickLower The lower tick of the position for which to collect fees /// @param tickUpper The upper tick of the position for which to collect fees /// @param amount0Requested How much token0 should be withdrawn from the fees owed /// @param amount1Requested How much token1 should be withdrawn from the fees owed /// @return amount0 The amount of fees collected in token0 /// @return amount1 The amount of fees collected in token1 function collect( address recipient, uint256 index, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested ) external returns (uint128 amount0, uint128 amount1); /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position at index 0 /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0 /// @dev Fees must be collected separately via a call to #collect /// @param tickLower The lower tick of the position for which to burn liquidity /// @param tickUpper The upper tick of the position for which to burn liquidity /// @param amount How much liquidity to burn /// @return amount0 The amount of token0 sent to the recipient /// @return amount1 The amount of token1 sent to the recipient function burn( int24 tickLower, int24 tickUpper, uint128 amount ) external returns (uint256 amount0, uint256 amount1); /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0 /// @dev Fees must be collected separately via a call to #collect /// @param index The index for which the liquidity will be burned /// @param tickLower The lower tick of the position for which to burn liquidity /// @param tickUpper The upper tick of the position for which to burn liquidity /// @param amount How much liquidity to burn /// @return amount0 The amount of token0 sent to the recipient /// @return amount1 The amount of token1 sent to the recipient function burn( uint256 index, int24 tickLower, int24 tickUpper, uint128 amount ) external returns (uint256 amount0, uint256 amount1); /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0 /// @dev Fees must be collected separately via a call to #collect /// @param index The index for which the liquidity will be burned /// @param tickLower The lower tick of the position for which to burn liquidity /// @param tickUpper The upper tick of the position for which to burn liquidity /// @param amount How much liquidity to burn /// @param veNFTTokenId The veNFT Token Id to attach /// @return amount0 The amount of token0 sent to the recipient /// @return amount1 The amount of token1 sent to the recipient function burn( uint256 index, int24 tickLower, int24 tickUpper, uint128 amount, uint256 veNFTTokenId ) external returns (uint256 amount0, uint256 amount1); /// @notice Swap token0 for token1, or token1 for token0 /// @dev The caller of this method receives a callback in the form of IRamsesV2SwapCallback#ramsesV2SwapCallback /// @param recipient The address to receive the output of the swap /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0 /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative) /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this /// value after the swap. If one for zero, the price cannot be greater than this value after the swap /// @param data Any data to be passed through to the callback /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive function swap( address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes calldata data ) external returns (int256 amount0, int256 amount1); /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback /// @dev The caller of this method receives a callback in the form of IRamsesV2FlashCallback#ramsesV2FlashCallback /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling /// with 0 amount{0,1} and sending the donation amount(s) from the callback /// @param recipient The address which will receive the token0 and token1 amounts /// @param amount0 The amount of token0 to send /// @param amount1 The amount of token1 to send /// @param data Any data to be passed through to the callback function flash( address recipient, uint256 amount0, uint256 amount1, bytes calldata data ) external; /// @notice Increase the maximum number of price and liquidity observations that this pool will store /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to /// the input observationCardinalityNext. /// @param observationCardinalityNext The desired minimum number of observations for the pool to store function increaseObservationCardinalityNext( uint16 observationCardinalityNext ) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Pool state that is not stored /// @notice Contains view functions to provide information about the pool that is computed rather than stored on the /// blockchain. The functions here may have variable gas costs. interface IClPoolDerivedState { /// @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 /// @return secondsPerBoostedLiquidityPeriodX128s Cumulative seconds per boosted 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, uint160[] memory secondsPerBoostedLiquidityPeriodX128s ); /// @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. Boosted data is only valid if it's within the same period /// @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 secondsPerBoostedLiquidityInsideX128 The snapshot of seconds per boosted 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, uint160 secondsPerBoostedLiquidityInsideX128, uint32 secondsInside ); /// @notice Returns the seconds per liquidity and seconds inside a tick range for a period /// @param tickLower The lower tick of the range /// @param tickUpper The upper tick of the range /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range /// @return secondsPerBoostedLiquidityInsideX128 The snapshot of seconds per boosted liquidity for the range function periodCumulativesInside( uint32 period, int24 tickLower, int24 tickUpper ) external view returns ( uint160 secondsPerLiquidityInsideX128, uint160 secondsPerBoostedLiquidityInsideX128 ); }
// 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 IClPoolEvents { /// @notice Emitted exactly once by a pool when #initialize is first called on the pool /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96 /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool event Initialize(uint160 sqrtPriceX96, int24 tick); /// @notice Emitted when liquidity is minted for a given position /// @param sender The address that minted the liquidity /// @param owner The owner of the position and recipient of any minted liquidity /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount The amount of liquidity minted to the position range /// @param amount0 How much token0 was required for the minted liquidity /// @param amount1 How much token1 was required for the minted liquidity event Mint( address sender, address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1 ); /// @notice Emitted when fees are collected by the owner of a position /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees /// @param owner The owner of the position for which fees are collected /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount0 The amount of token0 fees collected /// @param amount1 The amount of token1 fees collected event Collect( address indexed owner, address recipient, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount0, uint128 amount1 ); /// @notice Emitted when a position's liquidity is removed /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect /// @param owner The owner of the position for which liquidity is removed /// @param tickLower The lower tick of the position /// @param tickUpper The upper tick of the position /// @param amount The amount of liquidity to remove /// @param amount0 The amount of token0 withdrawn /// @param amount1 The amount of token1 withdrawn event Burn( address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1 ); /// @notice Emitted by the pool for any swaps between token0 and token1 /// @param sender The address that initiated the swap call, and that received the callback /// @param recipient The address that received the output of the swap /// @param amount0 The delta of the token0 balance of the pool /// @param amount1 The delta of the token1 balance of the pool /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96 /// @param liquidity The liquidity of the pool after the swap /// @param tick The log base 1.0001 of price of the pool after the swap event Swap( address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick ); /// @notice Emitted by the pool for any flashes of token0/token1 /// @param sender The address that initiated the swap call, and that received the callback /// @param recipient The address that received the tokens from flash /// @param amount0 The amount of token0 that was flashed /// @param amount1 The amount of token1 that was flashed /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee event Flash( address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1 ); /// @notice Emitted by the pool for increases to the number of observations that can be stored /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index /// just before a mint/swap/burn. /// @param observationCardinalityNextOld The previous value of the next observation cardinality /// @param observationCardinalityNextNew The updated value of the next observation cardinality event IncreaseObservationCardinalityNext( uint16 observationCardinalityNextOld, uint16 observationCardinalityNextNew ); /// @notice Emitted when the protocol fee is changed by the pool /// @param feeProtocol0Old The previous value of the token0 protocol fee /// @param feeProtocol1Old The previous value of the token1 protocol fee /// @param feeProtocol0New The updated value of the token0 protocol fee /// @param feeProtocol1New The updated value of the token1 protocol fee event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New); /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner /// @param sender The address that collects the protocol fees /// @param recipient The address that receives the collected protocol fees /// @param amount0 The amount of token0 protocol fees that is withdrawn /// @param amount0 The amount of token1 protocol fees that is withdrawn event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Pool state that never changes /// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values interface IClPoolImmutables { /// @notice The contract that deployed the pool, which must adhere to the IClPoolFactory interface /// @return The contract address function factory() external view returns (address); /// @notice The contract that manages CL NFPs, which must adhere to the INonfungiblePositionManager interface /// @return The contract address function nfpManager() external view returns (address); /// @notice The contract that manages veNFTs, which must adhere to the IVotingEscrow interface /// @return The contract address function votingEscrow() external view returns (address); /// @notice The contract that manages RA votes, which must adhere to the IVoter interface /// @return The contract address function voter() 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); /// @notice returns the current fee set for the pool function currentFee() external view returns (uint24); }
// 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 IClPoolOwnerActions { /// @notice Set the protocol's % share of the fees /// @dev Fees start at 50%, with 5% increments function setFeeProtocol() 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); function setFee(uint24 _fee) external; }
// 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 IClPoolState { /// @notice reads arbitrary storage slots and returns the bytes /// @param slots The slots to read from /// @return returnData The data read from the slots function readStorage( bytes32[] calldata slots ) external view returns (bytes32[] memory returnData); /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas /// when accessed externally. /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value /// tick The current tick of the pool, i.e. according to the last tick transition that was run. /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick /// boundary. /// observationIndex The index of the last oracle observation that was written, /// observationCardinality The current maximum number of observations stored in the pool, /// observationCardinalityNext The next maximum number of observations, to be updated when the observation. /// feeProtocol The protocol fee for both tokens of the pool. /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0 /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee. /// unlocked Whether the pool is currently locked to reentrancy function slot0() external view returns ( uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked ); /// @notice Returns the last tick of a given period /// @param period The period in question /// @return previousPeriod The period before current period /// @dev this is because there might be periods without trades /// startTick The start tick of the period /// lastTick The last tick of the period, if the period is finished /// endSecondsPerLiquidityPeriodX128 Seconds per liquidity at period's end /// endSecondsPerBoostedLiquidityPeriodX128 Seconds per boosted liquidity at period's end function periods( uint256 period ) external view returns ( uint32 previousPeriod, int24 startTick, int24 lastTick, uint160 endSecondsPerLiquidityCumulativeX128, uint160 endSecondsPerBoostedLiquidityCumulativeX128, uint32 boostedInRange ); /// @notice The last period where a trade or liquidity change happened function lastPeriod() external view returns (uint256); /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool /// @dev This value can overflow the uint256 function feeGrowthGlobal0X128() external view returns (uint256); /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool /// @dev This value can overflow the uint256 function feeGrowthGlobal1X128() external view returns (uint256); /// @notice The amounts of token0 and token1 that are owed to the protocol /// @dev Protocol fees will never exceed uint128 max in either token function protocolFees() external view returns (uint128 token0, uint128 token1); /// @notice The currently in range liquidity available to the pool /// @dev This value has no relationship to the total liquidity across all ticks function liquidity() external view returns (uint128); /// @notice The currently in range derived liquidity available to the pool /// @dev This value has no relationship to the total liquidity across all ticks function boostedLiquidity() external view returns (uint128); /// @notice Get the boost information for a specific position at a period /// @return boostAmount the amount of boost this position has for this period, /// veNFTAmount the amount of veNFTs attached to this position for this period, /// secondsDebtX96 used to account for changes in the deposit amount during the period /// boostedSecondsDebtX96 used to account for changes in the boostAmount and veNFT locked during the period, function boostInfos( uint256 period, bytes32 key ) external view returns ( uint128 boostAmount, int128 veNFTAmount, int256 secondsDebtX96, int256 boostedSecondsDebtX96 ); /// @notice Look up information about a specific tick in the pool /// @param tick The tick to look up /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or /// tick upper, /// liquidityNet how much liquidity changes when the pool price crosses the tick, /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0, /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1, /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick, /// secondsOutside the seconds spent on the other side of the tick from the current tick, /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false. /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0. /// In addition, these values are only relative and must be used only in comparison to previous snapshots for /// a specific position. function ticks( int24 tick ) external view returns ( uint128 liquidityGross, int128 liquidityNet, uint128 boostedLiquidityGross, int128 boostedLiquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized ); /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information function tickBitmap(int16 wordPosition) external view returns (uint256); /// @notice Returns the information about a position by the position's key /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper /// @return liquidity The amount of liquidity in the position, /// @return feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke, /// @return feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke, /// @return tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke, /// @return tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke /// @return attachedVeNFTId the veNFT tokenId attached to the position function positions( bytes32 key ) external view returns ( uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1, uint256 attachedVeNFTId ); /// @notice Returns a period's total boost amount and total veNFT attached /// @param period Period timestamp /// @return totalBoostAmount The total amount of boost this period has, /// @return totalVeNFTAmount The total amount of veNFTs attached to this period function boostInfos( uint256 period ) external view returns (uint128 totalBoostAmount, int128 totalVeNFTAmount); /// @notice Get the period seconds debt of a specific position /// @param period the period number /// @param recipient recipient address /// @param index position index /// @param tickLower lower bound of range /// @param tickUpper upper bound of range /// @return secondsDebtX96 seconds the position was not in range for the period /// @return boostedSecondsDebtX96 boosted seconds the period function positionPeriodDebt( uint256 period, address recipient, uint256 index, int24 tickLower, int24 tickUpper ) external view returns (int256 secondsDebtX96, int256 boostedSecondsDebtX96); /// @notice get the period seconds in range of a specific position /// @param period the period number /// @param owner owner address /// @param index position index /// @param tickLower lower bound of range /// @param tickUpper upper bound of range /// @return periodSecondsInsideX96 seconds the position was not in range for the period /// @return periodBoostedSecondsInsideX96 boosted seconds the period function positionPeriodSecondsInRange( uint256 period, address owner, uint256 index, int24 tickLower, int24 tickUpper ) external view returns ( uint256 periodSecondsInsideX96, uint256 periodBoostedSecondsInsideX96 ); /// @notice Returns data about a specific observation index /// @param index The element of the observations array to fetch /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time /// ago, rather than at a specific index in the array. /// @return blockTimestamp The timestamp of the observation, /// @return tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp, /// @return secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp, /// @return initialized whether the observation has been initialized and the values are safe to use function observations( uint256 index ) external view returns ( uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized, uint160 secondsPerBoostedLiquidityPeriodX128 ); }
{ "optimizer": { "enabled": true, "runs": 800 }, "metadata": { "bytecodeHash": "none" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint24","name":"fee","type":"uint24"},{"indexed":true,"internalType":"int24","name":"tickSpacing","type":"int24"}],"name":"FeeAmountEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldFeeCollector","type":"address"},{"indexed":true,"internalType":"address","name":"newFeeCollector","type":"address"}],"name":"FeeCollectorChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldSetter","type":"address"},{"indexed":true,"internalType":"address","name":"newSetter","type":"address"}],"name":"FeeSetterChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldImplementation","type":"address"},{"indexed":true,"internalType":"address","name":"newImplementation","type":"address"}],"name":"ImplementationChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token0","type":"address"},{"indexed":true,"internalType":"address","name":"token1","type":"address"},{"indexed":true,"internalType":"uint24","name":"fee","type":"uint24"},{"indexed":false,"internalType":"int24","name":"tickSpacing","type":"int24"},{"indexed":false,"internalType":"address","name":"pool","type":"address"}],"name":"PoolCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"feeProtocol0Old","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"feeProtocol1Old","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"feeProtocol0New","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"feeProtocol1New","type":"uint8"}],"name":"SetFeeProtocol","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"uint8","name":"feeProtocol0Old","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"feeProtocol1Old","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"feeProtocol0New","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"feeProtocol1New","type":"uint8"}],"name":"SetPoolFeeProtocol","type":"event"},{"inputs":[],"name":"POOL_INIT_CODE_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"name":"createPool","outputs":[{"internalType":"address","name":"pool","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"}],"name":"enableFeeAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint24","name":"","type":"uint24"}],"name":"feeAmountTickSpacing","outputs":[{"internalType":"int24","name":"","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeCollector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeProtocol","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeSetter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint24","name":"","type":"uint24"}],"name":"getPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nfpManager","type":"address"},{"internalType":"address","name":"_votingEscrow","type":"address"},{"internalType":"address","name":"_voter","type":"address"},{"internalType":"address","name":"_implementation","type":"address"},{"internalType":"address","name":"_feeSetter","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"name":"initializePool","outputs":[{"internalType":"address","name":"pool","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nfpManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"poolFeeProtocol","outputs":[{"internalType":"uint8","name":"__poolFeeProtocol","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_pool","type":"address"},{"internalType":"uint24","name":"_fee","type":"uint24"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeCollector","type":"address"}],"name":"setFeeCollector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_feeProtocol","type":"uint8"}],"name":"setFeeProtocol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newFeeSetter","type":"address"}],"name":"setFeeSetter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_implementation","type":"address"}],"name":"setImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint8","name":"_feeProtocol","type":"uint8"}],"name":"setPoolFeeProtocol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"voter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"votingEscrow","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50611dc8806100206000396000f3fe60806040523480156200001157600080fd5b5060043610620001b45760003560e01c80638a7c195f11620000f9578063b613a1411162000099578063d784d426116200006f578063d784d42614620004bd578063dc6fd8ab14620004e6578063ebb0d9f7146200050257620001b4565b8063b613a141146200045c578063ba364c3d146200047f578063c415b95c14620004b357620001b4565b806398bbc3c711620000cf57806398bbc3c71462000400578063a42dce80146200040a578063b19805af146200043357620001b4565b80638a7c195f14620003845780638da5cb5b14620003b25780638e909e5114620003bc57620001b4565b80634f2bfe5b11620001655780636fb1461a116200013b5780636fb1461a146200030457806376734e3e146200034857806387cf3ef4146200037a57620001b4565b80634f2bfe5b14620002d0578063527eb4bc14620002da5780635c60da1b14620002fa57620001b4565b80631698ee82116200019b5780631698ee82146200022f57806322afcccb146200028a57806346c96aac14620002c657620001b4565b806313af403514620001b95780631459457a14620001e4575b600080fd5b620001e260048036036020811015620001d157600080fd5b50356001600160a01b03166200052b565b005b620001e2600480360360a0811015620001fc57600080fd5b506001600160a01b03813581169160208101358216916040820135811691606081013582169160809091013516620005d0565b6200026e600480360360608110156200024757600080fd5b5080356001600160a01b03908116916020810135909116906040013562ffffff166200099f565b604080516001600160a01b039092168252519081900360200190f35b620002af60048036036020811015620002a257600080fd5b503562ffffff16620009cb565b6040805160029290920b8252519081900360200190f35b6200026e620009e0565b6200026e620009ef565b620002e4620009fe565b6040805160ff9092168252519081900360200190f35b6200026e62000a0e565b6200026e600480360360808110156200031c57600080fd5b506001600160a01b038135811691602081013582169162ffffff60408301351691606001351662000a1d565b620001e2600480360360408110156200036057600080fd5b5080356001600160a01b0316906020013560ff1662000b48565b6200026e62000cbc565b620001e2600480360360408110156200039c57600080fd5b5062ffffff813516906020013560020b62000ccb565b6200026e62000dc4565b6200026e60048036036080811015620003d457600080fd5b506001600160a01b038135811691602081013582169162ffffff60408301351691606001351662000dd3565b6200026e620010b4565b620001e2600480360360208110156200042257600080fd5b50356001600160a01b0316620010c3565b620001e2600480360360208110156200044b57600080fd5b50356001600160a01b031662001168565b620001e2600480360360208110156200047457600080fd5b503560ff166200120d565b620001e2600480360360408110156200049757600080fd5b5080356001600160a01b0316906020013562ffffff166200131e565b6200026e620013c8565b620001e260048036036020811015620004d557600080fd5b50356001600160a01b0316620013d7565b620004f06200147b565b60408051918252519081900360200190f35b620002e4600480360360208110156200051a57600080fd5b50356001600160a01b03166200149f565b6001546001600160a01b0316331462000574576040805162461bcd60e51b81526020600480830191909152602482015263082aaa8960e31b604482015290519081900360640190fd5b6001546040516001600160a01b038084169216907fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c90600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b600054600160a81b900460ff1680620005ee5750620005ee620014d5565b80620006045750600054600160a01b900460ff16155b620006415760405162461bcd60e51b815260040180806020018281038252602e81526020018062001d8e602e913960400191505060405180910390fd5b600054600160a81b900460ff1615801562000679576000805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b60018054336001600160a01b031991821681179092556002805482166001600160a01b038a81169190911790915560038054831689831617905560048054831688831617905560008054831687831617815560098054909316918616919091179091556040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c908290a36040516001600160a01b038416906000907fcfbf4028add9318bbf716f08c348595afb063b0e9feed1f86d33681a4b3ed4d3908290a36040516001600160a01b038316906000907f774b126b94b3cc801460a024dd575406c3ebf27affd7c36198a53ac6655f056d908290a36064600081815260056020527fad66b8e7ab72f450ddfdaf1c5bc10e3a3fabf9f63ad8aa07b8743b93722f0a45805462ffffff191660019081179091556040519092917fc66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc91a36101f4600081815260056020527f526b19181003b5c873519ed63635fe97b1329efa2ea6c0dd27b500090f692847805462ffffff1916600a9081179091556040519092917fc66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc91a3610bb8600081815260056020527f920c3c101aeacc47298ad380e56bf5b36d68daf59bb11b6a0e451daf6a70b042805462ffffff1916603c9081179091556040519092917fc66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc91a3612710600081815260056020527f4b632c5a4ef6f776d7578f74fb35c8372275e5c1cfdfcda32b7cd51134d0fd7e805462ffffff191660c89081179091556040519092917fc66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc91a3600780547411000000000000000000000000000000000000000060ff60a01b1990911617908190556040805160008082526020820152600160a01b90920460ff168282018190526060830152517f973d8d92bb299f4af6ce49b52a8adb85ae46b9f214c4c4fc06ac77401237b1339181900360800190a1801562000997576000805460ff60a81b191690555b505050505050565b60066020908152600093845260408085208252928452828420905282529020546001600160a01b031681565b60056020526000908152604090205460020b81565b6004546001600160a01b031681565b6003546001600160a01b031681565b600754600160a01b900460ff1681565b6000546001600160a01b031681565b6001600160a01b0380851660009081526006602090815260408083208785168452825280832062ffffff8716845290915290205416801562000b40576000816001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801562000a9557600080fd5b505afa15801562000aaa573d6000803e3d6000fd5b505050506040513d60e081101562000ac157600080fd5b505190506001600160a01b03811662000b3e57816001600160a01b031663f637731d846040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801562000b2457600080fd5b505af115801562000b39573d6000803e3d6000fd5b505050505b505b949350505050565b6009546001600160a01b0316331462000b91576040805162461bcd60e51b81526020600480830191909152602482015263082aaa8960e31b604482015290519081900360640190fd5b60648160ff16111562000bd1576040805162461bcd60e51b815260206004820152600360248201526211951360ea1b604482015290519081900360640190fd5b600062000bde836200149f565b6001600160a01b038416600081815260086020908152604091829020805460ff191660ff88169081179091558251938452600f85811692850192909252600485901c90911683830152606083018190526080830152519192507fc79f8f26ea41a4b5cdad3c4ba9a1c7e86474a1f3a1fb31a80e1112122cb4ec4d919081900360a00190a1826001600160a01b0316637b7d549d6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000c9e57600080fd5b505af115801562000cb3573d6000803e3d6000fd5b50505050505050565b6009546001600160a01b031681565b6001546001600160a01b0316331462000d14576040805162461bcd60e51b81526020600480830191909152602482015263082aaa8960e31b604482015290519081900360640190fd5b620f42408262ffffff161062000d2957600080fd5b60008160020b13801562000d4157506140008160020b125b62000d4b57600080fd5b62ffffff8216600090815260056020526040902054600290810b900b1562000d7257600080fd5b62ffffff828116600081815260056020526040808220805462ffffff1916600287900b958616179055517fc66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc9190a35050565b6001546001600160a01b031681565b6000836001600160a01b0316856001600160a01b0316141562000e22576040805162461bcd60e51b8152602060048201526002602482015261125560f21b604482015290519081900360640190fd5b600080856001600160a01b0316876001600160a01b03161062000e4757858762000e4a565b86865b90925090506001600160a01b03821662000e90576040805162461bcd60e51b8152602060048201526002602482015261041360f41b604482015290519081900360640190fd5b62ffffff8516600090815260056020526040902054600290810b9081900b62000ee5576040805162461bcd60e51b8152602060048201526002602482015261054360f41b604482015290519081900360640190fd5b6001600160a01b0383811660009081526006602090815260408083208685168452825280832062ffffff8b168452909152902054161562000f52576040805162461bcd60e51b8152602060048201526002602482015261504560f01b604482015290519081900360640190fd5b60025460035460045462000f7d9230926001600160a01b0391821692908216911687878c88620014e8565b6001600160a01b03808516600081815260066020818152604080842089871680865290835281852062ffffff8f168087529084528286208054988a166001600160a01b0319998a1681179091558287529484528286208787528452828620818752845294829020805490971684179096558051600289900b815291820192909252815195995091947f783cca1c0412dd0d695e784568c96da2e9c22ff989357a2e8b1d9b2b4e6b71189281900390910190a46001600160a01b03851615620010a957836001600160a01b031663f637731d866040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b1580156200108f57600080fd5b505af1158015620010a4573d6000803e3d6000fd5b505050505b505050949350505050565b6002546001600160a01b031681565b6001546001600160a01b031633146200110c576040805162461bcd60e51b81526020600480830191909152602482015263082aaa8960e31b604482015290519081900360640190fd5b6007546040516001600160a01b038084169216907f649c5e3d0ed183894196148e193af316452b0037e77d2ff0fef23b7dc722bed090600090a3600780546001600160a01b0319166001600160a01b0392909216919091179055565b6009546001600160a01b03163314620011b1576040805162461bcd60e51b81526020600480830191909152602482015263082aaa8960e31b604482015290519081900360640190fd5b6009546040516001600160a01b038084169216907f774b126b94b3cc801460a024dd575406c3ebf27affd7c36198a53ac6655f056d90600090a3600980546001600160a01b0319166001600160a01b0392909216919091179055565b6009546001600160a01b0316331462001256576040805162461bcd60e51b81526020600480830191909152602482015263082aaa8960e31b604482015290519081900360640190fd5b60648160ff16111562001296576040805162461bcd60e51b815260206004820152600360248201526211951360ea1b604482015290519081900360640190fd5b6007805460ff838116600160a01b90810260ff60a01b19841617909355919004167f973d8d92bb299f4af6ce49b52a8adb85ae46b9f214c4c4fc06ac77401237b1336010826007546040805160ff9490930684168352600f600487901c166020840152600160a01b909104909216818301819052606082015290519081900360800190a15050565b6009546001600160a01b0316331462001367576040805162461bcd60e51b81526020600480830191909152602482015263082aaa8960e31b604482015290519081900360640190fd5b816001600160a01b031663eabb5622826040518263ffffffff1660e01b8152600401808262ffffff168152602001915050600060405180830381600087803b158015620013b357600080fd5b505af115801562000997573d6000803e3d6000fd5b6007546001600160a01b031681565b6001546001600160a01b0316331462001420576040805162461bcd60e51b81526020600480830191909152602482015263082aaa8960e31b604482015290519081900360640190fd5b600080546040516001600160a01b03808516939216917fcfbf4028add9318bbf716f08c348595afb063b0e9feed1f86d33681a4b3ed4d391a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b7f1565b129f2d1790f12d45301b9b084335626f0c92410bc43130763b69971135d81565b6001600160a01b03811660009081526008602052604090205460ff1680620014d05750600754600160a01b900460ff165b919050565b6000620014e2306200161a565b15905090565b600084848460405160200180846001600160a01b03168152602001836001600160a01b031681526020018262ffffff168152602001935050505060405160208183030381529060405280519060200120604051620015469062001620565b8190604051809103906000f590508015801562001567573d6000803e3d6000fd5b5060408051635fa9c92560e01b81526001600160a01b038c811660048301528b811660248301528a811660448301528981166064830152888116608483015287811660a483015262ffffff871660c4830152600286900b60e4830152915192935090831691635fa9c925916101048082019260009290919082900301818387803b158015620015f557600080fd5b505af11580156200160a573d6000803e3d6000fd5b5050505098975050505050505050565b3b151590565b61075f806200162f8339019056fe60a0604052600060809081523390610017828261001e565b50506103a8565b6100318261017360201b6100311760201c565b61006c5760405162461bcd60e51b81526004018080602001828103825260258152602001806106e06025913960400191505060405180910390fd5b6100e4826001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100a857600080fd5b505afa1580156100bc573d6000803e3d6000fd5b505050506040513d60208110156100d257600080fd5b5051610173602090811b61003117901c565b61011f5760405162461bcd60e51b815260040180806020018281038252603481526020018061072b6034913960400191505060405180910390fd5b60008051602061069f83398151915282815581511561016e5761016c610143610179565b836040518060600160405280602181526020016106bf602191396101ec60201b6100371760201c565b505b505050565b3b151590565b60006101836102f1565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156101bb57600080fd5b505afa1580156101cf573d6000803e3d6000fd5b505050506040513d60208110156101e557600080fd5b5051905090565b60606101f784610173565b6102325760405162461bcd60e51b81526004018080602001828103825260268152602001806107056026913960400191505060405180910390fd5b600080856001600160a01b0316856040518082805190602001908083835b6020831061026f5780518252601f199092019160209182019101610250565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d80600081146102cf576040519150601f19603f3d011682016040523d82523d6000602084013e6102d4565b606091505b5090925090506102e5828286610304565b925050505b9392505050565b60008051602061069f8339815191525490565b606083156103135750816102ea565b8251156103235782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561036d578181015183820152602001610355565b50505050905090810190601f16801561039a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6102e8806103b76000396000f3fe60806040523661001357610011610017565b005b6100115b61001f61002f565b61002f61002a610148565b6101c8565b565b3b151590565b606061004284610031565b61007d5760405162461bcd60e51b81526004018080602001828103825260268152602001806102b66026913960400191505060405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040518082805190602001908083835b602083106100c75780518252601f1990920191602091820191016100a8565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610127576040519150601f19603f3d011682016040523d82523d6000602084013e61012c565b606091505b509150915061013c8282866101ec565b925050505b9392505050565b6000610152610290565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561019757600080fd5b505afa1580156101ab573d6000803e3d6000fd5b505050506040513d60208110156101c157600080fd5b5051905090565b3660008037600080366000845af43d6000803e8080156101e7573d6000f35b3d6000fd5b606083156101fb575081610141565b82511561020b5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561025557818101518382015260200161023d565b50505050905090810190601f1680156102825780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50549056fe416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6e7472616374a164736f6c6343000706000aa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50426561636f6e50726f78793a2066756e6374696f6e2063616c6c206661696c6564426561636f6e50726f78793a20626561636f6e206973206e6f74206120636f6e7472616374416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6e7472616374426561636f6e50726f78793a20626561636f6e20696d706c656d656e746174696f6e206973206e6f74206120636f6e7472616374496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564a164736f6c6343000706000a
Deployed Bytecode
0x60806040523480156200001157600080fd5b5060043610620001b45760003560e01c80638a7c195f11620000f9578063b613a1411162000099578063d784d426116200006f578063d784d42614620004bd578063dc6fd8ab14620004e6578063ebb0d9f7146200050257620001b4565b8063b613a141146200045c578063ba364c3d146200047f578063c415b95c14620004b357620001b4565b806398bbc3c711620000cf57806398bbc3c71462000400578063a42dce80146200040a578063b19805af146200043357620001b4565b80638a7c195f14620003845780638da5cb5b14620003b25780638e909e5114620003bc57620001b4565b80634f2bfe5b11620001655780636fb1461a116200013b5780636fb1461a146200030457806376734e3e146200034857806387cf3ef4146200037a57620001b4565b80634f2bfe5b14620002d0578063527eb4bc14620002da5780635c60da1b14620002fa57620001b4565b80631698ee82116200019b5780631698ee82146200022f57806322afcccb146200028a57806346c96aac14620002c657620001b4565b806313af403514620001b95780631459457a14620001e4575b600080fd5b620001e260048036036020811015620001d157600080fd5b50356001600160a01b03166200052b565b005b620001e2600480360360a0811015620001fc57600080fd5b506001600160a01b03813581169160208101358216916040820135811691606081013582169160809091013516620005d0565b6200026e600480360360608110156200024757600080fd5b5080356001600160a01b03908116916020810135909116906040013562ffffff166200099f565b604080516001600160a01b039092168252519081900360200190f35b620002af60048036036020811015620002a257600080fd5b503562ffffff16620009cb565b6040805160029290920b8252519081900360200190f35b6200026e620009e0565b6200026e620009ef565b620002e4620009fe565b6040805160ff9092168252519081900360200190f35b6200026e62000a0e565b6200026e600480360360808110156200031c57600080fd5b506001600160a01b038135811691602081013582169162ffffff60408301351691606001351662000a1d565b620001e2600480360360408110156200036057600080fd5b5080356001600160a01b0316906020013560ff1662000b48565b6200026e62000cbc565b620001e2600480360360408110156200039c57600080fd5b5062ffffff813516906020013560020b62000ccb565b6200026e62000dc4565b6200026e60048036036080811015620003d457600080fd5b506001600160a01b038135811691602081013582169162ffffff60408301351691606001351662000dd3565b6200026e620010b4565b620001e2600480360360208110156200042257600080fd5b50356001600160a01b0316620010c3565b620001e2600480360360208110156200044b57600080fd5b50356001600160a01b031662001168565b620001e2600480360360208110156200047457600080fd5b503560ff166200120d565b620001e2600480360360408110156200049757600080fd5b5080356001600160a01b0316906020013562ffffff166200131e565b6200026e620013c8565b620001e260048036036020811015620004d557600080fd5b50356001600160a01b0316620013d7565b620004f06200147b565b60408051918252519081900360200190f35b620002e4600480360360208110156200051a57600080fd5b50356001600160a01b03166200149f565b6001546001600160a01b0316331462000574576040805162461bcd60e51b81526020600480830191909152602482015263082aaa8960e31b604482015290519081900360640190fd5b6001546040516001600160a01b038084169216907fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c90600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b600054600160a81b900460ff1680620005ee5750620005ee620014d5565b80620006045750600054600160a01b900460ff16155b620006415760405162461bcd60e51b815260040180806020018281038252602e81526020018062001d8e602e913960400191505060405180910390fd5b600054600160a81b900460ff1615801562000679576000805460ff60a01b1960ff60a81b19909116600160a81b1716600160a01b1790555b60018054336001600160a01b031991821681179092556002805482166001600160a01b038a81169190911790915560038054831689831617905560048054831688831617905560008054831687831617815560098054909316918616919091179091556040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c908290a36040516001600160a01b038416906000907fcfbf4028add9318bbf716f08c348595afb063b0e9feed1f86d33681a4b3ed4d3908290a36040516001600160a01b038316906000907f774b126b94b3cc801460a024dd575406c3ebf27affd7c36198a53ac6655f056d908290a36064600081815260056020527fad66b8e7ab72f450ddfdaf1c5bc10e3a3fabf9f63ad8aa07b8743b93722f0a45805462ffffff191660019081179091556040519092917fc66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc91a36101f4600081815260056020527f526b19181003b5c873519ed63635fe97b1329efa2ea6c0dd27b500090f692847805462ffffff1916600a9081179091556040519092917fc66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc91a3610bb8600081815260056020527f920c3c101aeacc47298ad380e56bf5b36d68daf59bb11b6a0e451daf6a70b042805462ffffff1916603c9081179091556040519092917fc66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc91a3612710600081815260056020527f4b632c5a4ef6f776d7578f74fb35c8372275e5c1cfdfcda32b7cd51134d0fd7e805462ffffff191660c89081179091556040519092917fc66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc91a3600780547411000000000000000000000000000000000000000060ff60a01b1990911617908190556040805160008082526020820152600160a01b90920460ff168282018190526060830152517f973d8d92bb299f4af6ce49b52a8adb85ae46b9f214c4c4fc06ac77401237b1339181900360800190a1801562000997576000805460ff60a81b191690555b505050505050565b60066020908152600093845260408085208252928452828420905282529020546001600160a01b031681565b60056020526000908152604090205460020b81565b6004546001600160a01b031681565b6003546001600160a01b031681565b600754600160a01b900460ff1681565b6000546001600160a01b031681565b6001600160a01b0380851660009081526006602090815260408083208785168452825280832062ffffff8716845290915290205416801562000b40576000816001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801562000a9557600080fd5b505afa15801562000aaa573d6000803e3d6000fd5b505050506040513d60e081101562000ac157600080fd5b505190506001600160a01b03811662000b3e57816001600160a01b031663f637731d846040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801562000b2457600080fd5b505af115801562000b39573d6000803e3d6000fd5b505050505b505b949350505050565b6009546001600160a01b0316331462000b91576040805162461bcd60e51b81526020600480830191909152602482015263082aaa8960e31b604482015290519081900360640190fd5b60648160ff16111562000bd1576040805162461bcd60e51b815260206004820152600360248201526211951360ea1b604482015290519081900360640190fd5b600062000bde836200149f565b6001600160a01b038416600081815260086020908152604091829020805460ff191660ff88169081179091558251938452600f85811692850192909252600485901c90911683830152606083018190526080830152519192507fc79f8f26ea41a4b5cdad3c4ba9a1c7e86474a1f3a1fb31a80e1112122cb4ec4d919081900360a00190a1826001600160a01b0316637b7d549d6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000c9e57600080fd5b505af115801562000cb3573d6000803e3d6000fd5b50505050505050565b6009546001600160a01b031681565b6001546001600160a01b0316331462000d14576040805162461bcd60e51b81526020600480830191909152602482015263082aaa8960e31b604482015290519081900360640190fd5b620f42408262ffffff161062000d2957600080fd5b60008160020b13801562000d4157506140008160020b125b62000d4b57600080fd5b62ffffff8216600090815260056020526040902054600290810b900b1562000d7257600080fd5b62ffffff828116600081815260056020526040808220805462ffffff1916600287900b958616179055517fc66a3fdf07232cdd185febcc6579d408c241b47ae2f9907d84be655141eeaecc9190a35050565b6001546001600160a01b031681565b6000836001600160a01b0316856001600160a01b0316141562000e22576040805162461bcd60e51b8152602060048201526002602482015261125560f21b604482015290519081900360640190fd5b600080856001600160a01b0316876001600160a01b03161062000e4757858762000e4a565b86865b90925090506001600160a01b03821662000e90576040805162461bcd60e51b8152602060048201526002602482015261041360f41b604482015290519081900360640190fd5b62ffffff8516600090815260056020526040902054600290810b9081900b62000ee5576040805162461bcd60e51b8152602060048201526002602482015261054360f41b604482015290519081900360640190fd5b6001600160a01b0383811660009081526006602090815260408083208685168452825280832062ffffff8b168452909152902054161562000f52576040805162461bcd60e51b8152602060048201526002602482015261504560f01b604482015290519081900360640190fd5b60025460035460045462000f7d9230926001600160a01b0391821692908216911687878c88620014e8565b6001600160a01b03808516600081815260066020818152604080842089871680865290835281852062ffffff8f168087529084528286208054988a166001600160a01b0319998a1681179091558287529484528286208787528452828620818752845294829020805490971684179096558051600289900b815291820192909252815195995091947f783cca1c0412dd0d695e784568c96da2e9c22ff989357a2e8b1d9b2b4e6b71189281900390910190a46001600160a01b03851615620010a957836001600160a01b031663f637731d866040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b1580156200108f57600080fd5b505af1158015620010a4573d6000803e3d6000fd5b505050505b505050949350505050565b6002546001600160a01b031681565b6001546001600160a01b031633146200110c576040805162461bcd60e51b81526020600480830191909152602482015263082aaa8960e31b604482015290519081900360640190fd5b6007546040516001600160a01b038084169216907f649c5e3d0ed183894196148e193af316452b0037e77d2ff0fef23b7dc722bed090600090a3600780546001600160a01b0319166001600160a01b0392909216919091179055565b6009546001600160a01b03163314620011b1576040805162461bcd60e51b81526020600480830191909152602482015263082aaa8960e31b604482015290519081900360640190fd5b6009546040516001600160a01b038084169216907f774b126b94b3cc801460a024dd575406c3ebf27affd7c36198a53ac6655f056d90600090a3600980546001600160a01b0319166001600160a01b0392909216919091179055565b6009546001600160a01b0316331462001256576040805162461bcd60e51b81526020600480830191909152602482015263082aaa8960e31b604482015290519081900360640190fd5b60648160ff16111562001296576040805162461bcd60e51b815260206004820152600360248201526211951360ea1b604482015290519081900360640190fd5b6007805460ff838116600160a01b90810260ff60a01b19841617909355919004167f973d8d92bb299f4af6ce49b52a8adb85ae46b9f214c4c4fc06ac77401237b1336010826007546040805160ff9490930684168352600f600487901c166020840152600160a01b909104909216818301819052606082015290519081900360800190a15050565b6009546001600160a01b0316331462001367576040805162461bcd60e51b81526020600480830191909152602482015263082aaa8960e31b604482015290519081900360640190fd5b816001600160a01b031663eabb5622826040518263ffffffff1660e01b8152600401808262ffffff168152602001915050600060405180830381600087803b158015620013b357600080fd5b505af115801562000997573d6000803e3d6000fd5b6007546001600160a01b031681565b6001546001600160a01b0316331462001420576040805162461bcd60e51b81526020600480830191909152602482015263082aaa8960e31b604482015290519081900360640190fd5b600080546040516001600160a01b03808516939216917fcfbf4028add9318bbf716f08c348595afb063b0e9feed1f86d33681a4b3ed4d391a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b7f1565b129f2d1790f12d45301b9b084335626f0c92410bc43130763b69971135d81565b6001600160a01b03811660009081526008602052604090205460ff1680620014d05750600754600160a01b900460ff165b919050565b6000620014e2306200161a565b15905090565b600084848460405160200180846001600160a01b03168152602001836001600160a01b031681526020018262ffffff168152602001935050505060405160208183030381529060405280519060200120604051620015469062001620565b8190604051809103906000f590508015801562001567573d6000803e3d6000fd5b5060408051635fa9c92560e01b81526001600160a01b038c811660048301528b811660248301528a811660448301528981166064830152888116608483015287811660a483015262ffffff871660c4830152600286900b60e4830152915192935090831691635fa9c925916101048082019260009290919082900301818387803b158015620015f557600080fd5b505af11580156200160a573d6000803e3d6000fd5b5050505098975050505050505050565b3b151590565b61075f806200162f8339019056fe60a0604052600060809081523390610017828261001e565b50506103a8565b6100318261017360201b6100311760201c565b61006c5760405162461bcd60e51b81526004018080602001828103825260258152602001806106e06025913960400191505060405180910390fd5b6100e4826001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100a857600080fd5b505afa1580156100bc573d6000803e3d6000fd5b505050506040513d60208110156100d257600080fd5b5051610173602090811b61003117901c565b61011f5760405162461bcd60e51b815260040180806020018281038252603481526020018061072b6034913960400191505060405180910390fd5b60008051602061069f83398151915282815581511561016e5761016c610143610179565b836040518060600160405280602181526020016106bf602191396101ec60201b6100371760201c565b505b505050565b3b151590565b60006101836102f1565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156101bb57600080fd5b505afa1580156101cf573d6000803e3d6000fd5b505050506040513d60208110156101e557600080fd5b5051905090565b60606101f784610173565b6102325760405162461bcd60e51b81526004018080602001828103825260268152602001806107056026913960400191505060405180910390fd5b600080856001600160a01b0316856040518082805190602001908083835b6020831061026f5780518252601f199092019160209182019101610250565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d80600081146102cf576040519150601f19603f3d011682016040523d82523d6000602084013e6102d4565b606091505b5090925090506102e5828286610304565b925050505b9392505050565b60008051602061069f8339815191525490565b606083156103135750816102ea565b8251156103235782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561036d578181015183820152602001610355565b50505050905090810190601f16801561039a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6102e8806103b76000396000f3fe60806040523661001357610011610017565b005b6100115b61001f61002f565b61002f61002a610148565b6101c8565b565b3b151590565b606061004284610031565b61007d5760405162461bcd60e51b81526004018080602001828103825260268152602001806102b66026913960400191505060405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16856040518082805190602001908083835b602083106100c75780518252601f1990920191602091820191016100a8565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610127576040519150601f19603f3d011682016040523d82523d6000602084013e61012c565b606091505b509150915061013c8282866101ec565b925050505b9392505050565b6000610152610290565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561019757600080fd5b505afa1580156101ab573d6000803e3d6000fd5b505050506040513d60208110156101c157600080fd5b5051905090565b3660008037600080366000845af43d6000803e8080156101e7573d6000f35b3d6000fd5b606083156101fb575081610141565b82511561020b5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561025557818101518382015260200161023d565b50505050905090810190601f1680156102825780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50549056fe416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6e7472616374a164736f6c6343000706000aa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50426561636f6e50726f78793a2066756e6374696f6e2063616c6c206661696c6564426561636f6e50726f78793a20626561636f6e206973206e6f74206120636f6e7472616374416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6e7472616374426561636f6e50726f78793a20626561636f6e20696d706c656d656e746174696f6e206973206e6f74206120636f6e7472616374496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564a164736f6c6343000706000a
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.