๐ ๏ธ CabalV3Helpers
๐ ๏ธ CabalV3Helpers
The CabalV3Helpers contract is a powerful internal tool used by The Cabal platform to handle all aspects of Uniswap V3 liquidity deployment.
It abstracts away complex pool creation, position minting, and liquidity locking into a single secure module, and is only callable by the CabalFactory to prevent misuse.
๐ง Responsibilities
Deploy one-sided liquidity to Uniswap V3
Create and initialize new Uniswap V3 pools if needed
Mint positions using custom tick pricing
Lock LP NFTs into the CabalLiquidityLocker
Handle developer ETH buys through V3 swap router
Maintain full safety with nonReentrant and onlyFactory restrictions
๐ธ Key Logic
deployV3Liquidity()
deployV3Liquidity()
Deploys liquidity for a token with:
Token amount input
Initial tick pricing for pool
Automatic LP NFT creation
LP NFT is locked immediately via
initializePosition()
if recipient is the locker
Returns:
poolAddress
: the deployed or existing Uniswap V3 pooltokenId
: the LP NFT minted
executeV3DeveloperBuy()
executeV3DeveloperBuy()
Performs a Uniswap V3 ETH-to-token swap using the SwapRouter:
Buys tokens for the deployer
Sends tokens to recipient
Refunds ETH if swap fails
๐ง Technical Design
Uses adjustedTick logic to support both token0/token1 configurations
Calculates sqrtPriceX96 from ticks using
CabalV3TickMath
Supports tick validation with spacing checks
Provides internal _mintPosition() logic
โ๏ธ Parameters and Settings
Default Pool Fee
10000
(1%)
Default Lock Period
1825 days
(5 years)
Default LP Fee Cut
500
(50%)
ETH Token Address (Base)
0x4200...0006
๐ Access Control
deployV3Liquidity()
andexecuteV3DeveloperBuy()
are only callable by the factoryFactory must be set once by the owner using
setFactory()
๐จ Emergency Tools
emergencyRecoverToken()
โ withdraw stuck ERC-20semergencyRecoverETH()
โ withdraw stuck ETH
๐ Events
PoolCreated
LiquidityAdded
PositionLocked
FactoryUpdated
๐ Summary
The CabalV3Helpers contract is the backbone of our V3 deployment pipeline โ safely handling liquidity, locking, and developer incentives.
It ensures all launches on The Cabal are:
Secure
Non-custodial
Price controlled
Lock-enforced
"Set your price, lock your LP, and let the markets begin โ all from one place."
Last updated