|
| 1 | +# PunchSwap V3 Repository Confirmed |
| 2 | + |
| 3 | +**Date**: October 27, 2025 |
| 4 | +**Repository**: [https://github.com/Kitty-Punch/punch-swap-v3-contracts](https://github.com/Kitty-Punch/punch-swap-v3-contracts) |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## ✅ Confirmed: Using Correct Repository |
| 9 | + |
| 10 | +**Local Path**: `/Users/keshavgupta/tidal-sc/solidity/lib/punch-swap-v3-contracts` |
| 11 | + |
| 12 | +**Remote**: |
| 13 | +``` |
| 14 | +origin: https://github.com/Kitty-Punch/punch-swap-v3-contracts.git (fetch) |
| 15 | +origin: https://github.com/Kitty-Punch/punch-swap-v3-contracts.git (push) |
| 16 | +``` |
| 17 | + |
| 18 | +**Branch**: `main` |
| 19 | + |
| 20 | +**Latest Commits**: |
| 21 | +``` |
| 22 | +e6e3247 - feat: add flow mainnet template |
| 23 | +273c9d2 - feat: rebrand smart contracts (#2) |
| 24 | +e2591c5 - fixes: modify harcoded values (#1) |
| 25 | +d7cc37e - feat: initial commit |
| 26 | +``` |
| 27 | + |
| 28 | +**Status**: ✅ Repository matches, on latest commit |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +## 📋 Repository Structure |
| 33 | + |
| 34 | +As shown in the [GitHub repo](https://github.com/Kitty-Punch/punch-swap-v3-contracts): |
| 35 | + |
| 36 | +**Core Contracts** (`src/core/`): |
| 37 | +- `PunchSwapV3Factory.sol` - Creates pools |
| 38 | +- `PunchSwapV3Pool.sol` - Pool implementation |
| 39 | +- `PunchSwapV3PoolDeployer.sol` - Pool deployer |
| 40 | + |
| 41 | +**Periphery Contracts** (`src/periphery/`): |
| 42 | +- `SwapRouter.sol` - Execute swaps |
| 43 | +- `NonfungiblePositionManager.sol` - Manage liquidity positions |
| 44 | +- `Quoter.sol`, `QuoterV2.sol` - Quote swaps |
| 45 | + |
| 46 | +**Universal Router** (`src/universal-router/`): |
| 47 | +- Multi-protocol router (has compilation issues) |
| 48 | + |
| 49 | +**Deployment Scripts** (`script/`): |
| 50 | +- 14 numbered deployment scripts (00-14) |
| 51 | +- Deployment parameters for different networks |
| 52 | +- Flow mainnet and testnet configs |
| 53 | + |
| 54 | +--- |
| 55 | + |
| 56 | +## 🎯 What We Can Use |
| 57 | + |
| 58 | +### Core V3 Contracts (Essential) |
| 59 | + |
| 60 | +**These are what we need for real V3 validation**: |
| 61 | + |
| 62 | +1. **PunchSwapV3Factory** - Deploy this first |
| 63 | +2. **PunchSwapV3Pool** - Created by factory |
| 64 | +3. **SwapRouter** - For executing swaps |
| 65 | + |
| 66 | +**These give us**: |
| 67 | +- ✅ Real Uniswap V3 constant product math |
| 68 | +- ✅ Tick-based pricing |
| 69 | +- ✅ Concentrated liquidity |
| 70 | +- ✅ Price impact from swaps |
| 71 | +- ✅ Actual slippage calculation |
| 72 | + |
| 73 | +### Optional/Nice-to-Have |
| 74 | + |
| 75 | +4. **NonfungiblePositionManager** - For managing liquidity (can use direct pool interaction instead) |
| 76 | +5. **QuoterV2** - For quoting swaps (helpful but not essential) |
| 77 | +6. **UniversalRouter** - Skip (has compilation issues, not needed) |
| 78 | + |
| 79 | +--- |
| 80 | + |
| 81 | +## 🛠️ Deployment Strategy |
| 82 | + |
| 83 | +### Approach: Core-Only Deployment |
| 84 | + |
| 85 | +**Step 1: Compile Core Contracts** |
| 86 | +```bash |
| 87 | +cd solidity/lib/punch-swap-v3-contracts |
| 88 | + |
| 89 | +# Try compiling just core |
| 90 | +forge build src/core/PunchSwapV3Factory.sol |
| 91 | +forge build src/core/PunchSwapV3Pool.sol |
| 92 | +forge build src/periphery/SwapRouter.sol |
| 93 | +``` |
| 94 | + |
| 95 | +**Step 2: Get Bytecode** |
| 96 | +```bash |
| 97 | +# Factory |
| 98 | +jq -r '.bytecode.object' out/PunchSwapV3Factory.sol/PunchSwapV3Factory.json |
| 99 | + |
| 100 | +# Pool (will be deployed by factory) |
| 101 | + |
| 102 | +# SwapRouter |
| 103 | +jq -r '.bytecode.object' out/SwapRouter.sol/SwapRouter.json |
| 104 | +``` |
| 105 | + |
| 106 | +**Step 3: Deploy via Cadence** |
| 107 | +```cadence |
| 108 | +// 1. Deploy Factory |
| 109 | +flow transactions send cadence/transactions/evm/deploy_simple_contract.cdc "$FACTORY_BYTECODE" |
| 110 | +
|
| 111 | +// 2. Deploy SwapRouter (needs factory address as constructor arg) |
| 112 | +flow transactions send cadence/transactions/evm/deploy_with_constructor.cdc "$ROUTER_BYTECODE" "$CONSTRUCTOR_ARGS" |
| 113 | +``` |
| 114 | + |
| 115 | +**Step 4: Create Pools** |
| 116 | +```cadence |
| 117 | +// Call factory.createPool(token0, token1, fee) |
| 118 | +// Pool contract deployed automatically by factory |
| 119 | +``` |
| 120 | + |
| 121 | +--- |
| 122 | + |
| 123 | +## 🎯 Next Steps |
| 124 | + |
| 125 | +**Immediate** (verify we can compile core): |
| 126 | +```bash |
| 127 | +cd /Users/keshavgupta/tidal-sc/solidity/lib/punch-swap-v3-contracts |
| 128 | +forge clean |
| 129 | +forge build src/core/ --skip test |
| 130 | +``` |
| 131 | + |
| 132 | +**Then** (if successful): |
| 133 | +1. Extract Factory bytecode |
| 134 | +2. Deploy via our working EVM deployment transaction |
| 135 | +3. Verify deployment |
| 136 | +4. Deploy SwapRouter |
| 137 | +5. Create test pool |
| 138 | + |
| 139 | +**Alternative** (if compilation still fails): |
| 140 | +- Use pre-deployed PunchSwap from existing Flow testnet/mainnet |
| 141 | +- Reference existing deployment addresses |
| 142 | +- Just interact with deployed contracts |
| 143 | + |
| 144 | +--- |
| 145 | + |
| 146 | +## 💡 Key Insight |
| 147 | + |
| 148 | +**We're using the official Kitty-Punch PunchSwap V3 contracts!** |
| 149 | + |
| 150 | +This is perfect because: |
| 151 | +- ✅ Same contracts as Flow mainnet/testnet |
| 152 | +- ✅ Production-tested code |
| 153 | +- ✅ Full Uniswap V3 implementation |
| 154 | +- ✅ **True validation** when we deploy and test |
| 155 | + |
| 156 | +The [GitHub repo](https://github.com/Kitty-Punch/punch-swap-v3-contracts) shows it's a proper Uniswap V3 fork with Flow-specific deployment configs. |
| 157 | + |
| 158 | +--- |
| 159 | + |
| 160 | +## 🚀 Recommendation |
| 161 | + |
| 162 | +**Try core-only compilation**: |
| 163 | +- Skip universal-router (that's where the error is) |
| 164 | +- Just build Factory + Pool + SwapRouter |
| 165 | +- Deploy those three |
| 166 | +- **Enough for real V3 validation!** |
| 167 | + |
| 168 | +Want me to try compiling just the core contracts now? |
| 169 | + |
0 commit comments