Skip to content

Rename ETH to "gas token" and ambiguous functions#79

Merged
eduv09 merged 3 commits into
developfrom
rename-eth
May 15, 2026
Merged

Rename ETH to "gas token" and ambiguous functions#79
eduv09 merged 3 commits into
developfrom
rename-eth

Conversation

@eduv09

@eduv09 eduv09 commented May 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #70

@eduv09 eduv09 self-assigned this May 15, 2026
Copilot AI review requested due to automatic review settings May 15, 2026 08:56

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

Pull request overview

This PR completes a sweeping rename of "ETH" to "gas token" across the Solidity contracts, interfaces, scripts, tests, and documentation (closes #70), to remove network-specific terminology. It also folds in a non-trivial refactor of the on-decrypt dispatch in ConfidentialToken and turns the wrapper's burn/withdrawTo paths into asynchronous, callback-finalized flows, plus a new pausable test ERC20 used for failure-path testing.

Changes:

  • Renamed ethBalanceOf/_ethBalance/InsufficientEth/EthBalanceToppedUp/EthWithdrawn and related docs/script identifiers to the gasToken* equivalents.
  • Extracted CTX submission, callback consumption, balance decoding, and the resubmit path in ConfidentialToken; replaced the OnDecryptAction enum with uint8 action constants and added an extensible _encryptedUpdateExtended that supports extra plaintext arguments.
  • Reworked ConfidentialWrapper so withdrawTo/burn schedule an async _WITHDRAW_TO CTX whose callback (_handleWithdrawToRequest) releases underlying to the recipient encoded in plaintextArguments[2], and added invariant tests, stale-callback tests, and a new IPausableERC20 test token.

Reviewed changes

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

Show a summary per file
File Description
contracts/ConfidentialToken.sol Rename ETH→gas token; refactor onDecrypt dispatch; extract _submitCTX, _reSubmitTransfer, _encryptedUpdateExtended
contracts/ConfidentialWrapper.sol Async burn/withdrawTo via new _burnTo/_handleWithdrawToRequest; recipient encoded in plaintext args
contracts/interfaces/IConfidentialToken.sol Event/error/function renames; updated NatSpec
contracts/interfaces/IConfidentialWrapper.sol Added burn(uint256) to the wrapper interface
contracts/test/TestERC20.sol New IPausableERC20 interface + pausable transfer support for tests
docs/* Regenerated NatSpec for renamed identifiers and new wrapper functions
scripts/deployAndTestMintableCnfToken.ts Renamed local constants and log strings
test/ConfidentialToken.ts, test/EIP3009.ts, test/tools/fixtures.ts Updated to new identifiers
test/ConfidentialWrapper.ts Added invariant, stale-callback, pausable-underlying, and zero-value tests
README.md Updated function references and withdrawTo description
.github/agents/cnf-token-auditor.agent.md Updated auditor checklist to new names

Comment thread contracts/test/TestERC20.sol Outdated
@codecov

codecov Bot commented May 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.84%. Comparing base (b4608a7) to head (f6a5617).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop      #79   +/-   ##
========================================
  Coverage    97.84%   97.84%           
========================================
  Files            7        7           
  Lines          417      417           
  Branches        95       95           
========================================
  Hits           408      408           
  Misses           9        9           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@eduv09 eduv09 marked this pull request as ready for review May 15, 2026 16:44
@eduv09 eduv09 requested a review from DimaStebaev as a code owner May 15, 2026 16:44
Copilot AI review requested due to automatic review settings May 15, 2026 16:44

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

@eduv09 eduv09 changed the title Rename ETH to "gas token" Rename ETH to "gas token" and ambiguous functions May 15, 2026
@eduv09 eduv09 requested a review from Copilot May 15, 2026 17:03
DimaStebaev
DimaStebaev previously approved these changes May 15, 2026

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

Pull request overview

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

Comment thread .github/agents/cnf-token-auditor.agent.md Outdated
@eduv09 eduv09 merged commit 098e9d7 into develop May 15, 2026
10 checks passed
@eduv09 eduv09 deleted the rename-eth branch May 15, 2026 18:10
@github-actions github-actions Bot locked and limited conversation to collaborators May 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Impove naming

3 participants