{"id":29644155,"url":"https://github.com/aditya-alchemist/uniswapv3-testing","last_synced_at":"2025-07-22T00:04:46.201Z","repository":{"id":305227087,"uuid":"1020881337","full_name":"Aditya-alchemist/UniswapV3-testing","owner":"Aditya-alchemist","description":"Testing and learning various types of uniswapV3 functions like swapping tokens  and adding liquidity.","archived":false,"fork":false,"pushed_at":"2025-07-18T20:39:20.000Z","size":5991,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-19T01:27:00.008Z","etag":null,"topics":["advance-defi","foundry","testing","uniswap-v3"],"latest_commit_sha":null,"homepage":"","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aditya-alchemist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-16T14:33:30.000Z","updated_at":"2025-07-18T20:39:23.000Z","dependencies_parsed_at":"2025-07-19T01:39:39.972Z","dependency_job_id":null,"html_url":"https://github.com/Aditya-alchemist/UniswapV3-testing","commit_stats":null,"previous_names":["aditya-alchemist/uniswapv3-testing"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Aditya-alchemist/UniswapV3-testing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-alchemist%2FUniswapV3-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-alchemist%2FUniswapV3-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-alchemist%2FUniswapV3-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-alchemist%2FUniswapV3-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aditya-alchemist","download_url":"https://codeload.github.com/Aditya-alchemist/UniswapV3-testing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-alchemist%2FUniswapV3-testing/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266404557,"owners_count":23923451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["advance-defi","foundry","testing","uniswap-v3"],"created_at":"2025-07-22T00:04:45.517Z","updated_at":"2025-07-22T00:04:46.180Z","avatar_url":"https://github.com/Aditya-alchemist.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# Uniswap V3 Swap Foundry Testing Suite\n\nThis project contains advanced Uniswap V3 swap tests using the [Foundry](https://github.com/foundry-rs/foundry) framework. The suite covers ERC20  WETH  WBTC swap scenarios, using a mainnet fork environment to simulate real protocol interactions and token economics.\n\n## Features\n\n- Realistic mainnet forking tests for Uniswap V3 swaps.\n- Swap and route coverage: DAI/WETH, WETH/WBTC, and multi-hop DAI/WBTC.\n- Support for **exact input** and **exact output** strategies.\n- Detailed logs for each step and assertion.\n- Modular, extendable, and easily adaptable for future DeFi protocol explorations.\n\n## Outputs\n\n### Swapping\n\u003cimg width=\"1127\" height=\"537\" alt=\"image\" src=\"https://github.com/user-attachments/assets/be262405-7037-45c0-ac20-1afd537fed65\" /\u003e\n\n### Factory\n\u003cimg width=\"1232\" height=\"494\" alt=\"Screenshot 2025-07-17 145144\" src=\"https://github.com/user-attachments/assets/aad5d30c-ab6a-43e5-be0e-cac3e41e8793\" /\u003e\n\n### Liquidity\n\u003cimg width=\"1233\" height=\"619\" alt=\"image\" src=\"https://github.com/user-attachments/assets/3a2fb171-997c-4c99-8e49-d860be88cfc6\" /\u003e\n\n\n\n\n## Prerequisites\n\n- [Foundry](https://github.com/foundry-rs/foundry) (`forge` installed, updated with `foundryup`)\n- A mainnet archival node RPC URL (e.g., from [Alchemy](https://www.alchemy.com/) or [Infura](https://infura.io/))\n- Git for version control and code management[1]\n\n## Getting Started\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com//.git\ncd \n```\n\n### 2. Install Dependencies\n\n```bash\nforge install\n```\n\nThis will fetch all required contracts and test libraries (forge-std, openzeppelin-contracts, Uniswap v3-core, v3-periphery).\n\n### 3. Environment Setup\n\nExport your mainnet RPC URL as an environment variable:\n\n```bash\nexport MAINNET_RPC_URL=\n```\n\n### 4. Run the Tests\n\n```bash\nforge test --fork-url $MAINNET_RPC_URL -vvv\n```\n\n## Project Structure\n\n```\nsrc/                # Interfaces and constants for DAI/WETH/WBTC addresses\ntest/\n  uniswap-v3/\n    solutions/      # Your filled-out tests (UniswapV3Swap.test.sol)\n    exercises/      # Exercise templates if applicable\nlib/                # External dependencies (forge-std, OpenZeppelin, Uniswap)\nfoundry.toml        # Foundry project configuration\n```\n\n## Key Files\n\n- **src/interfaces/** – ERC20, WETH, Uniswap V3 routers and pools\n- **src/Constants.sol** – Mainnet constants for DAI, WETH, WBTC, SwapRouter\n- **test/uniswap-v3/solutions/UniswapV3Swap.test.sol** – Main swap test contract\n\n## Main Test Scenarios\n\n- **test_exactInputSingle**: Swaps a fixed amount of DAI for WETH in a single pool.\n- **test_exactInput**: Multi-hop swap from DAI to WETH to WBTC.\n- **test_exactOutputSingle**: Determines minimum DAI needed for an exact WETH amount.\n- **test_exactOutput**: Determines minimum DAI needed for an exact WBTC amount, routing via WETH.\n\n## Notes and Tips\n\n- Default DAI input is `1000 * 1e18` but swap output/requirements may need adjustment based on market price and pool slippage at runtime.\n- If you encounter an \"insufficient balance\" failure, check the DAI funded in `setUp()` and decrease the output target or increase the input amount.\n- All addresses used are Ethereum mainnet canonical contracts.\n\n## Contribution\n\nFeel free to fork this repo, submit PRs, or file issues related to DeFi testing, Uniswap, or Foundry usage.\n\n## License\n\nMIT\n\n**Happy Testing!**\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faditya-alchemist%2Funiswapv3-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faditya-alchemist%2Funiswapv3-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faditya-alchemist%2Funiswapv3-testing/lists"}