Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds uniswapv3 auto-comound #324

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.7.6;
pragma solidity 0.8.10;

/// @title Prevents delegatecall to a contract
/// @notice Base contract that provides a modifier for preventing delegatecall to methods in a child contract
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.7.6;
pragma solidity 0.8.10;

import "./interfaces/IUniswapV3Factory.sol";
import {IUniswapV3Factory} from './interfaces/IUniswapV3Factory.sol';

import "./UniswapV3PoolDeployer.sol";
import "./NoDelegateCall.sol";
import {UniswapV3PoolDeployer} from './UniswapV3PoolDeployer.sol';
import {NoDelegateCall} from './NoDelegateCall.sol';

import "./UniswapV3Pool.sol";
import {UniswapV3Pool} from './UniswapV3Pool.sol';

/// @title Canonical Uniswap V3 factory
/// @notice Deploys Uniswap V3 pools and manages ownership and control over pool protocol fees
contract UniswapV3Factory is
IUniswapV3Factory,
UniswapV3PoolDeployer,
NoDelegateCall
{
contract UniswapV3Factory is IUniswapV3Factory, UniswapV3PoolDeployer, NoDelegateCall {
/// @inheritdoc IUniswapV3Factory
address public override owner;

/// @inheritdoc IUniswapV3Factory
mapping(uint24 => int24) public override feeAmountTickSpacing;
/// @inheritdoc IUniswapV3Factory
mapping(address => mapping(address => mapping(uint24 => address)))
public
override getPool;
mapping(address => mapping(address => mapping(uint24 => address))) public override getPool;

constructor() {
owner = msg.sender;
Expand All @@ -44,9 +38,7 @@ contract UniswapV3Factory is
uint24 fee
) external override noDelegateCall returns (address pool) {
require(tokenA != tokenB);
(address token0, address token1) = tokenA < tokenB
? (tokenA, tokenB)
: (tokenB, tokenA);
(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
require(token0 != address(0));
int24 tickSpacing = feeAmountTickSpacing[fee];
require(tickSpacing != 0);
Expand Down
Loading