Skip to content

chore: sync ChainvoiceABI with deployed hash-based contract - #193

Merged
kumawatkaran523 merged 1 commit into
StabilityNexus:mainfrom
Atharva0506:chore/update-chainvoice-abi
Aug 16, 2026
Merged

chore: sync ChainvoiceABI with deployed hash-based contract#193
kumawatkaran523 merged 1 commit into
StabilityNexus:mainfrom
Atharva0506:chore/update-chainvoice-abi

Conversation

@Atharva0506

@Atharva0506 Atharva0506 commented Aug 8, 2026

Copy link
Copy Markdown
Member

Addressed Issues:

Part of #139 (1 of 5). Does not close it on its own.

Screenshots/Recordings:

Not applicable — no user-visible change. This PR only realigns the ABI with the contract source.

Additional Notes:

The frontend ABI still described the pre-migration contract, which stored the full invoice payload on-chain as two strings:

createInvoice(address, uint256, address, string, string)

contracts/src/Chainvoice.sol has since moved to storing only a keccak256 commitment of the invoice data, and gained the public key registry:

createInvoice(address, uint256, address, bytes32)

Regenerated from forge build output so the ABI matches the contract source exactly. This also drops the wakuPublicKeys accessor, which is now a private mapping read through getWakuPublicKey.

.env.example pointed at 0x54a5…, the old contract, where getWakuPublicKey reverts and getInvoice returns strings — following the setup docs would have produced an ABI/contract mismatch. Ethereum Classic and Polygon still run the old contract and are flagged inline as needing redeployment.

Why it is separate: this is a mechanical regeneration with no behaviour of its own. Splitting it out keeps the transport migration reviewable without an 850-line ABI diff in the middle of it.

Review order: must land together with #195 — on its own it leaves callers passing the old string arguments to a 4-argument function. Order: this → #194#195.

AI Usage Disclosure:

Check one of the checkboxes below:

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: Claude Code (CLI), model Claude Opus 5

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

Summary by CodeRabbit

  • New Features

    • Updated invoice creation and batch creation to use a single invoice data hash.
    • Updated invoice details and invoice lists to display the new data hash format.
  • Bug Fixes

    • Updated the Sepolia contract configuration for compatibility with the current application interface.
    • Removed the outdated public-key contract entry.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Atharva0506, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 91c6ea8c-8f44-4066-ad3d-af5b17c90292

📥 Commits

Reviewing files that changed from the base of the PR and between be9e09d and d409cc6.

📒 Files selected for processing (3)
  • README.md
  • frontend/.env.example
  • frontend/README.md

Walkthrough

The frontend ABI now uses bytes32 invoiceDataHash for invoice creation and invoice details. The obsolete wakuPublicKeys entry was removed. The Sepolia environment example now points to the migrated contract address.

Changes

Contract alignment

Layer / File(s) Summary
Invoice ABI migration
frontend/src/contractsABI/ChainvoiceABI.js
Invoice creation, batch creation, and invoice retrieval entries now use bytes32 invoice data hashes. The wakuPublicKeys(address) entry was removed.
Sepolia contract target
frontend/.env.example
The Sepolia contract address was updated. Comments identify the remaining addresses as incompatible pre-migration contracts.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: Typescript Lang

Poem

A rabbit checks the hashes bright,
The ABI fits the contract right.
Sepolia points to code anew,
Old addresses wait for redeploy too.
Hop, hop—the interface is true!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: synchronizing ChainvoiceABI with the deployed hash-based contract.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/.env.example`:
- Around line 4-8: Update the Sepolia contract address references in README.md
and frontend/README.md to match VITE_CONTRACT_ADDRESS_11155111 in
frontend/.env.example, replacing the old address unless it is intentionally the
primary address. Ensure both documentation files consistently describe the
current frontend configuration and deployed contract address.

In `@frontend/src/contractsABI/ChainvoiceABI.js`:
- Around line 80-82: Synchronize the invoice callers with the updated ABI:
update CreateInvoice’s createInvoice invocation to four arguments with a
non-empty bytes32, change CreateInvoicesBatch to pass one bytes32[] instead of
payload and hash arrays, and revise ReceivedInvoice and SentInvoice to read the
migrated tuple’s new off-chain fields without relying on invoice[7]/invoice[8].
Ensure migrated invoices remain included and all computed hash values are valid
bytes32 values.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 38240a44-b534-40d7-b854-c27c0c748cee

📥 Commits

Reviewing files that changed from the base of the PR and between 5080141 and be9e09d.

📒 Files selected for processing (2)
  • frontend/.env.example
  • frontend/src/contractsABI/ChainvoiceABI.js

Comment thread frontend/.env.example Outdated
Comment thread frontend/src/contractsABI/ChainvoiceABI.js
@Atharva0506
Atharva0506 force-pushed the chore/update-chainvoice-abi branch from be9e09d to f67063e Compare August 8, 2026 09:49
The frontend ABI still described the pre-migration contract, which stored
the full invoice payload on-chain as two strings:

  createInvoice(address, uint256, address, string, string)

contracts/src/Chainvoice.sol has since moved to storing only a keccak256
commitment of the invoice data, and gained the public key registry:

  createInvoice(address, uint256, address, bytes32)

Regenerated from `forge build` output so the ABI matches the contract
source exactly. This also drops the `wakuPublicKeys` accessor, which is
now a private mapping read through `getWakuPublicKey`.

.env.example pointed at 0x54a5…, the old contract, where getWakuPublicKey
reverts and getInvoice returns strings — following the setup docs would
have produced an ABI/contract mismatch. Repointed at the Sepolia
deployment of the current source. Ethereum Classic and Polygon still run
the old contract and are flagged inline as needing redeployment.

Callers in the invoice pages still pass the old string arguments and are
updated separately; this commit only realigns the ABI with the contract.
@Atharva0506
Atharva0506 force-pushed the chore/update-chainvoice-abi branch from f67063e to d409cc6 Compare August 9, 2026 08:07

@rohans02 rohans02 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed, no blocking issues.

@kumawatkaran523
kumawatkaran523 merged commit 0f3b910 into StabilityNexus:main Aug 16, 2026
4 of 5 checks passed
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.

3 participants