Skip to content

refactor!: unify MerklePaymentVault and PaymentVault into PaymentVaultV2#4

Open
mickvandijke wants to merge 4 commits intomainfrom
refactor/unify-payment-vault-v2
Open

refactor!: unify MerklePaymentVault and PaymentVault into PaymentVaultV2#4
mickvandijke wants to merge 4 commits intomainfrom
refactor/unify-payment-vault-v2

Conversation

@mickvandijke
Copy link
Copy Markdown
Contributor

Summary

  • Merge separate MerklePaymentVault and PaymentVault contracts into a single PaymentVaultV2 contract
  • Remove the merkle_payment_vault Rust module, consolidating all payment logic into the payment_vault module
  • Replace stale PaymentVault.json / PaymentVaultNoProxyV6.json artifacts with PaymentVaultV2.json

Test plan

  • Verify cargo check passes
  • Run cargo test against local Anvil instance
  • Confirm merkle batch payments work end-to-end with the unified contract
  • Verify single-quote payments still work as before

🤖 Generated with Claude Code

mickvandijke and others added 4 commits April 1, 2026 17:54
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>
@mickvandijke mickvandijke marked this pull request as ready for review April 1, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant