refactor!: unify MerklePaymentVault and PaymentVault into PaymentVaultV2#4
Open
mickvandijke wants to merge 4 commits intomainfrom
Open
refactor!: unify MerklePaymentVault and PaymentVault into PaymentVaultV2#4mickvandijke wants to merge 4 commits intomainfrom
mickvandijke wants to merge 4 commits intomainfrom
Conversation
Merge the separate MerklePaymentVault and PaymentVault contracts into a single PaymentVaultV2 contract. This removes the merkle_payment_vault Rust module and consolidates all payment logic into the payment_vault module, simplifying the codebase and reducing duplication. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Rust `expected_reward_pools` and `midpoint_level` used floor(depth/2) while the Solidity `MerklePaymentLib.expectedRewardPools` uses ceil(depth/2). This caused WrongPoolCount reverts for odd depths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Rust cost estimation used `sum of top N prices` but the Solidity contract computes `median16(quotes) * (1 << depth)`. This caused the balance/allowance pre-check to pass while the on-chain tx reverted. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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.
Summary
MerklePaymentVaultandPaymentVaultcontracts into a singlePaymentVaultV2contractmerkle_payment_vaultRust module, consolidating all payment logic into thepayment_vaultmodulePaymentVault.json/PaymentVaultNoProxyV6.jsonartifacts withPaymentVaultV2.jsonTest plan
cargo checkpassescargo testagainst local Anvil instance🤖 Generated with Claude Code