-
Notifications
You must be signed in to change notification settings - Fork 112
Test UniswapV3 and UniswapV4 swaps. #1306
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
base: main
Are you sure you want to change the base?
Conversation
…h liquidity right now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds test functionality for Uniswap V3 swaps to the MOVETokenV2 test suite. The changes focus on implementing quote and swap functionality for testing token exchanges on Uniswap V3, with placeholder code for Uniswap V4 integration.
- Adds Uniswap V3 interfaces for quoter and swap router functionality
- Implements a test function that demonstrates MOVE token to WETH swaps
- Includes commented-out Uniswap V4 code for future implementation
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| address uniswapv3Quoter = 0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6; | ||
| address uniswapv4Quoter = 0x61fFE014bA17989E743c5F6cB21bF9697530B21e; | ||
|
|
||
| uint256 amount = 100; |
Copilot
AI
Oct 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded value '100' is a magic number. Consider defining it as a named constant or making it configurable to improve test maintainability.
| uint256 snapshotId = vm.snapshot(); | ||
|
|
Copilot
AI
Oct 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The snapshot is created but never used effectively. Either remove this unused variable or implement the snapshot/revert pattern properly.
| uint256 snapshotId = vm.snapshot(); |
| vm.prank(anchorage); | ||
| move2.approve(uniswapv4Router, amount); |
Copilot
AI
Oct 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approval for uniswapv4Router serves no purpose since the V4 swap code is commented out. Remove this unused approval or implement the V4 swap functionality.
| vm.prank(anchorage); | |
| move2.approve(uniswapv4Router, amount); | |
| // vm.prank(anchorage); | |
| // move2.approve(uniswapv4Router, amount); |
Summary
protocol-units,networks,scripts,util,cicd, ormisc.modifies tests so it handles uniswap swaps, univ4 does not have enough liquidity at the moment.
Changelog
Uniswapv3 test
Testing
Outstanding issues
Adding Uniswapv4