@juiceswapxyz/v3-periphery
v3.0.0
Published
🧃 Peripheral smart contracts for JuiceSwap V3 (Uniswap V3 fork with JuiceSwap branding)
Readme
JuiceSwap V3 Periphery
This repository contains the periphery smart contracts for JuiceSwap V3, a fork of Uniswap V3 Protocol. For the lower level core contracts, see the v3-core repository.
Overview
JuiceSwap V3 Periphery provides user-facing smart contracts for interacting with the JuiceSwap V3 Protocol, including:
- SwapRouter - Multi-hop swap execution with exact input/output amounts
- NonfungiblePositionManager - ERC721 NFT representation of liquidity positions
- V3Migrator - Migration from V2 to V3 positions
- Quoter - Off-chain quote calculations for swap pricing
- Oracle Library - TWAP oracle utilities
Key Modifications from Uniswap V3
- Updated
POOL_INIT_CODE_HASHfor JuiceSwap's modified pool contract (50% max protocol fee vs 25%) - Rebranded NFT positions:
JuiceSwap V3 Positions NFT-V1with symbolJUICE-V3-POS - Updated package name:
@juiceswapxyz/v3-periphery
Local Deployment
Install the npm package @juiceswapxyz/v3-periphery and import bytecode from artifacts:
import {
abi as SWAP_ROUTER_ABI,
bytecode as SWAP_ROUTER_BYTECODE,
} from '@juiceswapxyz/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json'
// deploy the bytecodeUsing Solidity Interfaces
Import JuiceSwap v3 periphery interfaces into your smart contracts:
import '@juiceswapxyz/v3-periphery/contracts/interfaces/ISwapRouter.sol';
contract MyContract {
ISwapRouter router;
function doSomethingWithSwapRouter() {
// router.exactInput(...);
}
}Development
Compile Contracts
npm run compileRun Tests
npm testVerify Pool Init Code Hash
Before deployment, verify that POOL_INIT_CODE_HASH matches the compiled v3-core bytecode:
npm run verify-pool-hashThis step is critical - an incorrect hash will cause all pool operations to fail.
License
GPL-2.0-or-later
