Closed bitcoinbrisbane closed 2 weeks ago
This pull request introduces multiple new Solidity contracts and interfaces related to the Uniswap V3 protocol. Key additions include the IUniswapV3
interface with a getPool
function, the UniswapV3ViaRouter
, Uniswapv3
, and UniswapDynamicFee
contracts for facilitating token swaps, and the MergeWithMarket
contract for merging tokens with market functionality. A mock contract named MockUniswapV3
is also added for testing purposes. Additionally, import paths for the IMergeV2
interface are updated across several contracts, and new dependencies are included in the package.json
file.
File Path | Change Summary |
---|---|
contracts/interfaces/IAMM.sol | - Interface added: IAMM - Methods added: function buy(uint256 amount, address token, bytes calldata extraData) external returns (uint256) - Methods added: function sell(uint256 amount, address token, bytes calldata extraData) external returns (uint256) - Method added: function swap(uint256 amount, address token, address recipient, bytes calldata extraData) external returns (uint256) - Event added: event Swapped(uint256 amount, uint256 amountOut, address token, address indexed recipient) |
contracts/core/adaptors/IUniswapV3.sol | - Interface added: IUniswapV3 - Method added: function getPool(address tokenA, address tokenB, uint24 fee) external view returns (address pool) |
contracts/core/adaptors/UniswapV3ViaRouter.sol | - Contract added: UniswapV3ViaRouter - Method added: function setFee(uint24 _fee) external onlyOwner - Method added: function swap(uint256 amount, address token, address recipient, bytes calldata extraData) external returns (uint256) - Method added: function _swap(address tokenIn, address from, address recipient, uint256 amountIn, uint256 amountOutMinimum) private returns (uint256 amountOut) |
contracts/core/amm/Uniswap.sol | - Contract added: Uniswapv3 - Public variable added: uint24 public fee - Method added: function setFee(uint24 _fee) external onlyOwner - Methods added: function buy(uint256 amount, address token, bytes calldata extraData) external returns (uint256) - Methods added: function sell(uint256 amount, address token, bytes calldata extraData) external returns (uint256) |
contracts/core/amm/UniswapDynamic.sol | - Contract added: UniswapDynamicFee - Methods added: function buy(uint256 amount, address token, bytes calldata extraData) external returns (uint256) - Methods added: function sell(uint256 amount, address token, bytes calldata extraData) external returns (uint256) - Method added: function _swap(address tokenIn, address tokenOut, uint256 amountIn, uint256 amountOutMinimum, uint24 fee) private returns (uint256 amountOut) |
contracts/core/merge/MergeWithMarket.sol | - Contract added: MergeWithMarket - Constructor added: constructor(address _wewe, address token) - Method added: function mergeAndSell(uint256 amount, IAMM amm, bytes calldata extraData) external |
contracts/core/mocks/MockAMM.sol | - Contract added: MockUniswapV3 - Methods added: function buy(uint256 amount, address token, bytes calldata extraData) external pure returns (uint256) - Methods added: function sell(uint256 amount, address token, bytes calldata extraData) external pure returns (uint256) |
contracts/core/merge/BBroMerge.sol | - Import path updated: import "./IMergeV2.sol"; → import "../../interfaces/IMergeV2.sol"; |
contracts/core/merge/BroMerge.sol | - Import path updated: import "./IMergeV2.sol"; → import "../../interfaces/IMergeV2.sol"; |
contracts/core/merge/GenericMerge.sol | - Import path updated: import "./IMergeV2.sol"; → import "../../interfaces/IMergeV2.sol"; |
contracts/core/merge/MergeFactory.sol | - Import path updated: import "./IMergeV2.sol"; → import "../../interfaces/IMergeV2.sol"; |
package.json | - Dependency updated: "hardhat": "^2.22.11" → "hardhat": "^2.22.13" - Dependency added: "@uniswap/v3-core": "^1.0.1" - Dependency added: "@uniswap/v3-periphery": "^1.4.4" - New script added: "deploy:uni": "npx hardhat ignition deploy ignition/modules/UniAdaptor.ts --network base --verify" |
test/Uniswap.test.ts | - New test suite added: describe("UniswapV3 Adaptor", ...) - New function added: async function deployFixture(TYPE: string = "UniswapV3ViaRouter") - New test cases added for various functionalities |
README.md
file include command-line instructions for interacting with a blockchain environment, which may relate to the usage of the new interfaces introduced in the main PR.Farm
contract include updates that may interact with the new interfaces defined in the main PR, particularly in how token swaps are managed.MockArrakisV2
and MockToken
contracts may relate to the new token management functionalities introduced in the main PR.BroMerge
contract may utilize the interfaces defined in the main PR for token merging operations.README.md
regarding contract addresses may include references to the new interfaces and functionalities introduced in the main PR.BBroMerge
contract may utilize the interfaces defined in the main PR for managing token merges.MergeFactory
contract may directly relate to the functionalities introduced in the main PR, as it manages the creation of merge contracts that could utilize the new interfaces.SC
In the warren where tokens play,
New contracts hop and sway.
With pools and fees, they dance around,
In the Uniswap world, joy is found!
So let us trade and merge with glee,
For every swap brings harmony! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Todo: Add withdraw
merge is SellandBuy to Wewe
Summary by CodeRabbit
IUniswapV3
andISwapRouter
interfaces for enhanced token swap functionalities.Uniswapv3
,UniswapDynamicFee
, andUniswapV3ViaRouter
contracts for streamlined token swaps.MergeWithMarket
contract for merging tokens with market capabilities.MockUniswapV3
for testing and validation purposes.IAMM
interface for standardized token transaction operations.@uniswap/v3-periphery
.hardhat
dependency version and added new dependencies for Uniswap core.