mirror of
https://github.com/lux-amm/v4-core.git
synced 2026-10-30 20:54:53 +00:00
48 lines
1.6 KiB
Solidity
48 lines
1.6 KiB
Solidity
// SPDX-License-Identifier: UNLICENSED
|
|
pragma solidity ^0.8.24;
|
|
|
|
import "forge-std/Test.sol";
|
|
|
|
interface IUniswapV3Factory {
|
|
function createPool(address tokenA, address tokenB, uint24 fee) external returns (address pool);
|
|
function enableFeeAmount(uint24 fee, int24 tickSpacing) external;
|
|
}
|
|
|
|
interface IUniswapV3Pool {
|
|
function initialize(uint160 sqrtPriceX96) external;
|
|
function mint(address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes calldata data)
|
|
external
|
|
returns (uint256 amount0, uint256 amount1);
|
|
function burn(int24 tickLower, int24 tickUpper, uint128 amount)
|
|
external
|
|
returns (uint256 amount0, uint256 amount1);
|
|
function swap(
|
|
address recipient,
|
|
bool zeroForOne,
|
|
int256 amountSpecified,
|
|
uint160 sqrtPriceLimitX96,
|
|
bytes calldata data
|
|
) external returns (int256 amount0, int256 amount1);
|
|
}
|
|
|
|
interface IUniswapV3MintCallback {
|
|
function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes calldata data) external;
|
|
}
|
|
|
|
interface IUniswapV3SwapCallback {
|
|
function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes calldata data) external;
|
|
}
|
|
|
|
abstract contract V3Helper is Test {
|
|
IUniswapV3Factory v3Factory;
|
|
|
|
function setUp() public virtual {
|
|
address deployedAddr;
|
|
bytes memory bytecode = vm.readFileBinary("test/bin/v3Factory.bytecode");
|
|
assembly {
|
|
deployedAddr := create(0, add(bytecode, 0x20), mload(bytecode))
|
|
}
|
|
v3Factory = IUniswapV3Factory(deployedAddr);
|
|
}
|
|
}
|