improve CelerWallet#8
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors and hardens the CelerWallet contract API and internals, updating the surrounding ledger libraries, tests, invariants, and documentation to match the new naming and operator-voting semantics.
Changes:
- Renamed
CelerWallet/ICelerWalletfunctions, getters, and events (e.g.,getBalance→balanceOf,transferToWallet→transferBetweenWallets,proposeNewOperator→voteForOperator). - Added an owner-count cap (
MAX_OWNERS) enforced at wallet creation, plus a newTooManyOwnerscustom error to bound loop costs in owner/vote-related logic. - Updated tests (including invariants) and gas snapshot logs to reflect the refactor and measured gas changes.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/invariants/handlers/ChannelHandler.sol | Updates invariant helper to use balanceOf getter. |
| test/invariants/ChannelInvariants.t.sol | Updates invariant checks to use balanceOf. |
| test/gas_logs/fine_granularity/DepositEthInBatch.txt | Updates measured gas numbers. |
| test/gas_logs/CelerLedger-Migrate.txt | Updates measured migration gas numbers. |
| test/gas_logs/CelerLedger-ETH.txt | Updates measured deploy/call gas numbers. |
| test/gas_logs/CelerLedger-ERC20.txt | Updates measured ERC20 gas numbers. |
| test/CelerWallet.t.sol | Renames events/APIs in tests and adds coverage for MAX_OWNERS and vote/clearing behavior. |
| test/CelerLedger.Migrate.t.sol | Updates operator getter call to walletOperator. |
| src/lib/ledgerlib/LedgerOperation.sol | Updates wallet transfer call to transferBetweenWallets. |
| src/lib/ledgerlib/LedgerMigrate.sol | Updates operator getter call to walletOperator. |
| src/lib/AgentPayErrors.sol | Adds TooManyOwners custom error. |
| src/interfaces/ICelerWallet.sol | Renames API surface and updates NatSpec/events accordingly. |
| src/CelerWallet.sol | Implements new API names, adds MAX_OWNERS cap, and refactors operator voting state. |
| docs/contracts.md | Updates wallet API/event names in docs (but has stale source line anchors). |
| docs/architecture-summary.md | Updates migration/operator-vote terminology reference. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.