feat: add L2 revm swap integration test and update pool data contracts#14
Merged
Will-Smith11 merged 18 commits intomainfrom Mar 6, 2026
Merged
feat: add L2 revm swap integration test and update pool data contracts#14Will-Smith11 merged 18 commits intomainfrom
Will-Smith11 merged 18 commits intomainfrom
Conversation
Contributor
Will-Smith11
commented
Mar 5, 2026
- Add SwapQuoter test contract and L2 revm swap test
- Update GetUniswapV4PoolData contract with minor fixes
- Add alloy-node-bindings dependency for testing
- Fix update provider imports for L2 and pool providers
- Add SwapQuoter test contract and L2 revm swap test - Update GetUniswapV4PoolData contract with minor fixes - Add alloy-node-bindings dependency for testing - Fix update provider imports for L2 and pool providers Co-Authored-By: Frankenstein <263438330+frankenstien-dev@users.noreply.github.com>
…ogic - Fix TAXED_GAS constant (100k → 120k) to match AngstromL2.sol - Fix test PoolKey fee: use actual registry fee instead of hardcoded 0x800000 - Restructure fee application: deduct fees from input before AMM via BeforeSwapDelta model instead of applying after AMM on output - Expose pool registry from PoolManagerService Co-Authored-By: Frankenstein <263438330+frankenstien-dev@users.noreply.github.com>
Co-Authored-By: Frankenstein <263438330+frankenstien-dev@users.noreply.github.com>
The L2 hook's `_getSwapTaxAmount()` computes `tx.gasprice - block.basefee` using uint256 arithmetic. Without setting gas_price, eth_call defaults to 0, causing an underflow revert that the quoter misparses as garbage amounts. Co-Authored-By: Frankenstein <263438330+frankenstien-dev@users.noreply.github.com>
…s it L2FeeConfiguration::swap_fee() returned 0, but on-chain V4 charges the pool's static LP fee from PoolKey.fee. Added lp_fee field and wired hook_fee through both pool creation paths. Co-Authored-By: Frankenstein <263438330+frankenstien-dev@users.noreply.github.com>
…_ticks The Solidity contract scans bitmap positions (each tick_spacing apart), so advancing by num_ticks raw tick units caused ~88% overlap between batches and insufficient tick coverage for large swaps. Co-Authored-By: Frankenstein <263438330+frankenstien-dev@users.noreply.github.com>
…expected Swaps that exceed the loaded tick window now gracefully continue instead of panicking, since the finite tick range is a known constraint. Co-Authored-By: Frankenstein <263438330+frankenstien-dev@users.noreply.github.com>
…mination L2 BeforeSwapDelta (protocol fee + MEV tax before AMM) was running for L1 pools too. Gate it behind FeeConfig::l2_fees() and add the missing L1 after-swap protocol fee on the output token. Co-Authored-By: Frankenstein <263438330+frankenstien-dev@users.noreply.github.com>
…hain over 100 blocks Co-Authored-By: Frankenstein <263438330+frankenstien-dev@users.noreply.github.com>
Co-Authored-By: Frankenstein <263438330+frankenstien-dev@users.noreply.github.com>
Co-Authored-By: Frankenstein <263438330+frankenstien-dev@users.noreply.github.com>
Set _lastBlockUpdated in slot 3 to current block number before each SwapQuoter call so beforeSwap doesn't revert with CannotSwapWhileLocked. Co-Authored-By: Frankenstein <263438330+frankenstien-dev@users.noreply.github.com>
Set _lastBlockUpdated to current_block instead of current_block + 1 so _isUnlocked() returns true during eth_call which uses block.number = latest. Co-Authored-By: Frankenstein <263438330+frankenstien-dev@users.noreply.github.com>
…limiting Shrink tick range from 6000 to 400 and load in a single batch per direction, cutting RPC calls from ~1200 to 2 per pool and preventing 429 errors. Co-Authored-By: Frankenstein <263438330+frankenstien-dev@users.noreply.github.com>
The deploy-based tick loader exceeds contract size limit at 400 ticks per batch. 100 keeps batches within EVM limits while still minimizing RPC calls. Co-Authored-By: Frankenstein <263438330+frankenstien-dev@users.noreply.github.com>
…on non-QuoteResult reverts The quoter catch clause now checks for the QuoteResult selector and minimum data length before decoding. Non-QuoteResult reverts (e.g. HookDeltaExceedsSwapAmount, WrappedError) now surface as UnexpectedRevert instead of returning uninitialized memory. Co-Authored-By: Frankenstein <263438330+frankenstien-dev@users.noreply.github.com>
…ully Lower priority_fee from 1 gwei to 10M wei (~2x basefee) to avoid MEV tax exceeding swap output on small amounts, and skip on-chain reverts instead of panicking when the hook correctly rejects economically nonsensical swaps. Co-Authored-By: Frankenstein <263438330+frankenstien-dev@users.noreply.github.com>
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.