Skip to content

Rename ERC7984ERC20Wrapper totalSupply() to inferredTotalSuppy()#284

Merged
arr00 merged 1 commit intoOpenZeppelin:masterfrom
arr00:chore/name-total-supply
Jan 6, 2026
Merged

Rename ERC7984ERC20Wrapper totalSupply() to inferredTotalSuppy()#284
arr00 merged 1 commit intoOpenZeppelin:masterfrom
arr00:chore/name-total-supply

Conversation

@arr00
Copy link
Copy Markdown
Member

@arr00 arr00 commented Jan 6, 2026

Rename the totalSupply() function to inferredTotalSupply() to avoid accidental misuse.

Summary by CodeRabbit

  • Refactor
    • Updated the token supply query function name in the ERC7984 wrapper contract to better reflect its calculation methodology based on underlying token balance and exchange rate.

✏️ Tip: You can customize this high-level summary in your review settings.

@arr00 arr00 requested a review from a team as a code owner January 6, 2026 09:28
@netlify
Copy link
Copy Markdown

netlify bot commented Jan 6, 2026

Deploy Preview for confidential-tokens ready!

Name Link
🔨 Latest commit 145574b
🔍 Latest deploy log https://app.netlify.com/projects/confidential-tokens/deploys/695cd5bcbb947e00080537d6
😎 Deploy Preview https://deploy-preview-284--confidential-tokens.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 6, 2026

Walkthrough

The pull request renames the public view function totalSupply() to inferredTotalSupply() in the ERC7984ERC20Wrapper contract. The function implementation remains unchanged, and all internal references are updated accordingly to use the new name.

Changes

Cohort / File(s) Summary
Function Rename and Internal Usage Update
contracts/token/ERC7984/extensions/ERC7984ERC20Wrapper.sol
Renamed public view function totalSupply()inferredTotalSupply() with unchanged implementation. Updated internal call in _checkConfidentialTotalSupply() to reference the renamed function.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 A function once named totalSupply so bright,
Now shines as inferredTotalSupply—a clever insight!
With whiskers and hops, I celebrate the rename,
Where clarity and logic now share the same fame. ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: renaming totalSupply() to inferredTotalSupply() in ERC7984ERC20Wrapper.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0071f2f and 145574b.

📒 Files selected for processing (1)
  • contracts/token/ERC7984/extensions/ERC7984ERC20Wrapper.sol
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: tests
  • GitHub Check: slither
  • GitHub Check: coverage
🔇 Additional comments (2)
contracts/token/ERC7984/extensions/ERC7984ERC20Wrapper.sol (2)

178-178: LGTM! Internal reference correctly updated.

The internal call has been properly updated to use the new function name, maintaining consistency throughout the contract.


161-163: Good naming, but review comment's premise is incorrect.

The function inferredTotalSupply() at line 161 has good naming that clearly reflects its behavior as an inferred (non-exact) value. The internal call at line 178 is correct. However, this does not appear to be a rename from a previous totalSupply() function—no such function exists in the contract or is referenced anywhere in the codebase. The concern about a "breaking change to the public API" is not applicable. The function is used internally within an abstract contract and is not called externally.

Likely an incorrect or invalid review comment.


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

@arr00 arr00 merged commit 35a5132 into OpenZeppelin:master Jan 6, 2026
13 of 14 checks passed
@arr00 arr00 deleted the chore/name-total-supply branch January 6, 2026 13:58
arr00 added a commit that referenced this pull request Jan 6, 2026
#284)

Rename `totalSupply()` to `inferredTotalSuppy()`
arr00 added a commit that referenced this pull request Jan 8, 2026
* Start release candidate

* Release v0.3.0 (rc) (#221)

* Release v0.3.0 (rc)

* Update changelog

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: James Toussaint <33313130+james-toussaint@users.noreply.github.com>

* Update `checkOnTransferReceived` doc (#235)

* Versioned Docs (#236)

* generate versioned docs

* publish docs even on pre-release

* N-04: remove unused import in `ERC7984Rwa` (#243)

* N-01: reset user instead of allowing user in `unblockUser` (#244)

* N-05: Named mapping var in `ERC7984ObserverAccess` (#251)

* N-05: Named mapping var in `ERC7984ObserverAccess`

* Update contracts/token/ERC7984/extensions/ERC7984ObserverAccess.sol

Co-authored-by: James Toussaint <33313130+james-toussaint@users.noreply.github.com>

---------

Co-authored-by: James Toussaint <33313130+james-toussaint@users.noreply.github.com>

* N-08: constant names are screaming camel case (#247)

* N-08: constant names are screaming camel case

* fix lint

* N-02: reorder allowances omnibus (#250)

* Support ERC-165 interface detection on ERC-7984 (#246)

* Support ERC-165 interface detection on ERC-7984

* update link format

* Add ERC7984 impl changeset

* Update changeset

---------

Co-authored-by: Arr00 <13561405+arr00@users.noreply.github.com>

* M-03: grant allowances to agent in `ERC7984Rwa` (#242)

* M-03: grant allowances to agent in `ERC7984Rwa`

* up

* N-12: update docs in `ERC7984Restricted` (#245)

* Upgrade to use fhevm contracts v0.9.0 (#248)

* chore: fhevm-v9

* chore: port all tests for fhevm v9

* Merge pull request #1 from OpenZeppelin/chore/update-disclose-flow

update disclose flow

* Update wrapper contract (#2)

* Update wrapper contract

* fix tests

* fix mock

* update docs

* add changeset

* request id unnecessary

* Update contracts/token/ERC7984/extensions/ERC7984ERC20Wrapper.sol

Co-authored-by: James Toussaint <33313130+james-toussaint@users.noreply.github.com>

* remove unused params

* Update test/token/ERC7984/ERC7984.test.ts

Co-authored-by: James Toussaint <33313130+james-toussaint@users.noreply.github.com>

* `cts` -> `handles`

* `cleartext` -> `cleartextAmount`

* Update test/token/ERC7984/extensions/ERC7984Wrapper.test.ts

Co-authored-by: James Toussaint <33313130+james-toussaint@users.noreply.github.com>

* nit

---------

Co-authored-by: 0xalexbel <alexandre.belhoste@zama.ai>
Co-authored-by: James Toussaint <33313130+james-toussaint@users.noreply.github.com>

* N-[9,11]: fix `ERC7984Rwa` docs (#249)

* M-11: fix `ERC7984Rwa` docs

* add docs

* Update contracts/token/ERC7984/extensions/ERC7984Rwa.sol

* L-05: Grant allowances in `confidentialAvailable` (#252)

* L-05: Grant allowances in `confidentialAvailable`

* fix doc

* L-01: `tryDecrease` return initialized value if delta is initialized (#241)

* L-01: `tryDecrease` return initialized value if delta is initialized

* add comment

* Add changeset

* Upgrade to use fhevm contracts v0.9.1 (#254)

* Upgrade to use fhevm contracts v0.9.1

* bump sub package as well

* Update `ERC7984Rwa` docs (#255)

* Exit pre-release (#258)

* Release v0.3.0 (#253)

* Release v0.3.0

* Update changelog (#259)

* Update changelog

* Update CHANGELOG.md

Co-authored-by: James Toussaint <33313130+james-toussaint@users.noreply.github.com>

---------

Co-authored-by: James Toussaint <33313130+james-toussaint@users.noreply.github.com>

* remove duplicate entry

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Arr00 <13561405+arr00@users.noreply.github.com>
Co-authored-by: James Toussaint <33313130+james-toussaint@users.noreply.github.com>

* Revert when wrapper is full (#268) (#271)

* Revert when wrapper full

* up

* simplify and add tests

* update docs

* cei

* add doc

* up

* add custom error and fix tests

* comment clarification

* Rename `_checkTotalSupply` to `_checkConfidentialTotalSupply`

* add changeset

* Update contracts/token/ERC7984/extensions/ERC7984ERC20Wrapper.sol



* docs

---------

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>

* Add `ERC7984ERC20Wrapper` missing docs (#280)

Add missing docs

* Rename `ERC7984ERC20Wrapper` `totalSupply()` to `inferredTotalSuppy()` (#284)

Rename `totalSupply()` to `inferredTotalSuppy()`

* Release v0.3.1 (#272)

* Release v0.3.1

* update changelog

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Arr00 <13561405+arr00@users.noreply.github.com>

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: James Toussaint <33313130+james-toussaint@users.noreply.github.com>
Co-authored-by: Arr00 <13561405+arr00@users.noreply.github.com>
Co-authored-by: 0xalexbel <alexandre.belhoste@zama.ai>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants