HookMiner CREATE2 mining + PoolManager tick-init workaround for Unichain Sepolia#66
Open
Moses-main wants to merge 1 commit intomainfrom
Open
HookMiner CREATE2 mining + PoolManager tick-init workaround for Unichain Sepolia#66Moses-main wants to merge 1 commit intomainfrom
Moses-main wants to merge 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
VoltaicHookand incorrect/assumed tick behavior when initializing pools withsqrtPriceX96 = 2^96.0x14C0and make pool initialization resilient to the observed PoolManager tick discrepancy without changing core hook logic.Description
contracts/script/VoltaicScriptConfig.solwhich centralizes Unichain Sepolia constants, exposesrequiredHookFlags(), providesparitySqrtPriceX96()(usesTickMath.getSqrtPriceAtTick(0)), integratesHookMiner.find(...)viamineHookAddress(), validates hook flags withvalidateHookAddress(), and supplies tick-range helperscenteredLiquidityRange()/floorToSpacing().contracts/script/DeployVoltaicHook.s.solto callVoltaicScriptConfig.mineHookAddress(...), deploy the hook with the minedsalt, validate the deployed address flags, and log the expected/actual addresses and flags;FindValidHook.s.solnow previews the mined address and salt instead of brute-force deploying trials.DeployTestPool.s.sol,FreshPoolSwap.s.sol, andLocalTest.s.solto initialize pools withTickMath.getSqrtPriceAtTick(0)viaVoltaicScriptConfig.paritySqrtPriceX96()and then use the tick returned bypoolManager.initializeas the canonical center when computing liquidity ranges (viacenteredLiquidityRange).DeployTestPool.s.solalso readsVOLTAIC_HOOK_ADDRESSfrom the environment and validates its flags before use.@uniswap/v4-periphery, document the new HookMiner-based deployment workflow and the PoolManager tick workaround inREADME.mdandcontracts/README.md, and add guidance to init Uniswap v4 submodules before running scripts.Testing
git diff --checkwhich reported no issues.forge build/forge test) butforgeis not available in this environment so on-chain tests were not executed here.lib/v4-core,lib/v4-periphery,lib/openzeppelin-contracts) but the container could not reach GitHub (HTTP 403), so theHookMinerruntime and end-to-end Sepolia scripts could not be executed here.FindValidHook.s.solandDeployVoltaicHook.s.solwhich, when run in a developer environment with Foundry and the submodules initialized, will mine and validate the CREATE2 hook address and confirm the required0x14C0mask;FreshPoolSwap.s.solis provided for the optional end-to-end initialize/add-liquidity/swap verification on Sepolia.Codex Task