Skip to content

refactor native token support#4

Merged
hhl42 merged 3 commits into
mainfrom
native-token
May 7, 2026
Merged

refactor native token support#4
hhl42 merged 3 commits into
mainfrom
native-token

Conversation

@hhl42

@hhl42 hhl42 commented May 6, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@hhl42 hhl42 requested a review from Copilot May 6, 2026 20:50
@hhl42 hhl42 changed the title refactor native token refactor native token support May 6, 2026

Copilot AI 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.

Pull request overview

Refactors the codebase’s native-token handling by removing the custom EthPool wrapper and instead wiring CelerLedger to a chain’s canonical wrapped-native (WETH9-style) contract for the multi-party-funding path, while keeping the user-facing “native” semantics (address(0), msg.value) intact.

Changes:

  • Replace EthPool with INativeWrap/nativeWrap throughout ledger storage, constructor wiring, funding flows, and getters.
  • Rename native token type from ETH to NATIVE in protobuf/Solidity enums and update interfaces/docs accordingly (incl. depositETHdepositNative).
  • Update tests, gas reports, deployment scripts, and documentation to reflect the new wrapped-native plumbing and removal of EthPool.

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/utils/LedgerTestBase.t.sol Updates test funding setup to wrap native into nativeWrap and approve ledger for pull-based funding.
test/utils/Base.t.sol Replaces EthPool deployment with NativeWrapMock and wires CelerLedger with nativeWrap.
test/GasReport.t.sol Updates gas report to measure NativeWrapMock deployment and nativeWrap-based deposit paths; removes EthPool report.
test/gas_logs/fine_granularity/DepositEthInBatch.txt Updates recorded gas numbers after native token flow changes.
test/gas_logs/EthPool.txt Removes EthPool gas log (contract removed).
test/gas_logs/CelerLedger-Migrate.txt Updates recorded gas numbers post-refactor.
test/gas_logs/CelerLedger-ETH.txt Updates deployment + function-call gas numbers and labels for nativeWrap-based flows.
test/gas_logs/CelerLedger-ERC20.txt Updates recorded gas numbers post-refactor.
test/EthPool.t.sol Removes EthPool unit tests (contract removed).
test/CelerWallet.t.sol Renames wallet native deposit test calls to depositNative.
test/CelerLedger.Migrate.t.sol Wires migration tests to new-ledger construction via nativeWrap and updates approvals.
test/CelerLedger.ETH.t.sol Renames/extends ETH(native) tests for wrapped-native deposit path and restricted receive().
src/lib/ledgerlib/LedgerStruct.sol Replaces IEthPool storage with INativeWrap in ledger state.
src/lib/ledgerlib/LedgerOperation.sol Refactors native funding/deposit logic to pull wrapped-native, unwrap, and forward native into CelerWallet.
src/lib/ledgerlib/LedgerBalanceLimit.sol Updates NatSpec to describe address(0) as “native” rather than “ETH”.
src/lib/interface/INativeWrap.sol Adds minimal wrapped-native interface (ERC20 + deposit/withdraw).
src/lib/interface/IEthPool.sol Removes EthPool interface.
src/lib/interface/ICelerWallet.sol Renames native deposit API to depositNative and updates NatSpec language.
src/lib/interface/ICelerLedger.sol Updates NatSpec/getter from getEthPool to getNativeWrap and native-token terminology.
src/lib/data/proto/entity.proto Renames TokenType.ETH to TokenType.NATIVE (value preserved).
src/lib/data/PbEntity.sol Renames Solidity enum entry ETHNATIVE.
src/helper/NativeWrapMock.sol Adds a test-only wrapped-native mock used by Foundry tests.
src/EthPool.sol Removes EthPool implementation.
src/CelerWallet.sol Renames depositETHdepositNative and updates native-related wording/error message.
src/CelerLedgerMock.sol Updates mock ledger constructor/getter naming to nativeWrap.
src/CelerLedger.sol Wires ledger to nativeWrap, adds restricted receive(), and updates getter to getNativeWrap.
script/README.md Updates deployment instructions for new nativeWrap config and removal of EthPool deploy.
script/example_config.json Replaces ethPool config field with nativeWrap.
script/DeployLedger.s.sol Reads nativeWrap from config and passes it to CelerLedger constructor.
script/DeployCore.s.sol Removes EthPool from core deployment script and output.
README.md Updates component list/docs to reflect EthPool removal and wrapped-native dependency.
docs/contracts.md Removes EthPool section; updates ledger/wallet docs for nativeWrap and depositNative.
docs/architecture-summary.md Updates architecture summary to reflect EthPool removal and wrapped-native dependency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/CelerLedger.sol Outdated

Copilot AI 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.

Pull request overview

Copilot reviewed 33 out of 33 changed files in this pull request and generated 1 comment.

Comment thread src/CelerLedgerMock.sol
@hhl42 hhl42 merged commit 1f10a38 into main May 7, 2026
2 checks passed
@hhl42 hhl42 deleted the native-token branch May 7, 2026 01:25
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.

2 participants