-
Notifications
You must be signed in to change notification settings - Fork 12.2k
perf: optimize Pausable.sol by using uint256 instead of bool #5912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
perf: optimize Pausable.sol by using uint256 instead of bool #5912
Conversation
🦋 Changeset detectedLatest commit: 79a9389 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughInternal Pausable state representation changed from a boolean to a uint256 (1 = unpaused, 2 = paused). paused() now returns _paused == 2; _pause() sets 2 and _unpause() sets 1. Modifiers, events, and external signatures remain unchanged. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User
participant C as Contract (uses Pausable)
participant P as Pausable
Note over P: internal _paused: uint256 (1 = unpaused, 2 = paused)
U->>C: call protectedFunction()
C->>P: paused()
alt paused (2)
P-->>C: true
C-->>U: revert EnforcedPause
else unpaused (1)
P-->>C: false
C->>C: execute protected logic
C-->>U: return success
end
U->>C: call pause()
C->>P: _pause()
Note right of P: set _paused = 2, emit Paused
U->>C: call unpause()
C->>P: _unpause()
Note right of P: set _paused = 1, emit Unpaused
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReplaces the internal boolean File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
contracts/utils/Pausable.sol
(4 hunks)
⏰ 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). (6)
- GitHub Check: slither
- GitHub Check: halmos
- GitHub Check: tests
- GitHub Check: coverage
- GitHub Check: tests-foundry
- GitHub Check: tests-upgradeable
@@ -15,7 +15,7 @@ import {Context} from "../utils/Context.sol"; | |||
* simply including this module, only once the modifiers are put in place. | |||
*/ | |||
abstract contract Pausable is Context { | |||
bool private _paused; | |||
uint256 private _paused; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Critical: Upgrade-unsafe state encoding — existing paused proxies will read as unpaused after upgrade
Previous implementations stored true
as 1
. With this change, paused()
only returns true
for 2
, so upgrading a proxy that is currently paused (_paused == 1
) will silently flip to “unpaused”. Flip the encoding to keep 1 = paused
and use 2 = unpaused
to remain migration-safe while preserving the nonzero↔nonzero gas wins.
Recommended constants to document the scheme (place near the state var):
// New encoding (migration-safe): 0 = unpaused (legacy default), 1 = paused (legacy true), 2 = unpaused (new)
uint256 private constant _PAUSED = 1;
uint256 private constant _UNPAUSED = 2;
Please also add: (a) a changeset entry noting the state-encoding change, (b) an upgrade test that sets _paused
to 1
pre-upgrade and asserts paused() == true
post-upgrade, and (c) a brief doc comment explaining the encoding.
🏁 Script executed:
#!/bin/bash
# Show the state variable and surrounding context
sed -n '1,50p' contracts/utils/Pausable.sol
# Locate the paused() function and its logic
grep -nR "function paused" -C5 contracts/utils/Pausable.sol
grep -nR "_paused" -C3 contracts/utils/Pausable.sol
Length of output: 2694
Fix migration-unsafe paused state encoding
- Reverse encoding to preserve legacy paused proxies: 0 = legacy unpaused, 1 = paused (legacy true), 2 = unpaused (new)
- Add constants near the state var:
// Migration-safe encoding: 0=legacy unpaused, 1=paused, 2=unpaused uint256 private constant _PAUSED = 1; uint256 private constant _UNPAUSED = 2; uint256 private _paused;
- Update
paused()
,_pause()
and_unpause()
to use_PAUSED
/_UNPAUSED
- Add:
• Changelog entry for the encoding migration
• Upgrade test that sets_paused = 1
pre-upgrade and assertspaused() == true
post-upgrade
• Doc comment explaining the new encoding scheme
🤖 Prompt for AI Agents
In contracts/utils/Pausable.sol at/around line 18, the paused state uses a
migration-unsafe single uint encoding; add migration-safe constants and switch
logic: declare constants with a doc comment near the state var "//
Migration-safe encoding: 0=legacy unpaused, 1=paused, 2=unpaused", add uint256
private constant _PAUSED = 1; uint256 private constant _UNPAUSED = 2; keep
uint256 private _paused; update paused(), _pause(), and _unpause() to treat
_PAUSED as paused and _UNPAUSED as unpaused (preserving legacy value 0 as legacy
unpaused), add a changelog entry describing the encoding migration, and add an
upgrade test that pre-sets _paused = 1 before upgrade and asserts paused() ==
true after upgrade.
contracts/utils/Pausable.sol
Outdated
function paused() public view virtual returns (bool) { | ||
return _paused; | ||
return _paused == 2 ? true : false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Return check should be migration-safe and drop the ternary
Make paused()
check == 1
(or == _PAUSED
) and avoid the redundant ?:
.
- return _paused == 2 ? true : false;
+ // Legacy & new encoding: 1 = paused
+ return _paused == 1;
If you add constants:
- return _paused == 2 ? true : false;
+ return _paused == _PAUSED;
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
function paused() public view virtual returns (bool) { | |
return _paused; | |
return _paused == 2 ? true : false; | |
} | |
function paused() public view virtual returns (bool) { | |
// Legacy & new encoding: 1 = paused | |
return _paused == 1; | |
} |
🤖 Prompt for AI Agents
In contracts/utils/Pausable.sol around lines 67 to 69, the paused() function
uses a redundant ternary and checks for value 2 which is not migration-safe;
change the comparison to check for the paused sentinel (use == 1 or a named
constant like _PAUSED) and return the boolean expression directly (remove the
?:), and if not already present add a constant _PAUSED = 1 (or a suitably named
enum/constant) so the check is explicit and migration-safe.
function _pause() internal virtual whenNotPaused { | ||
_paused = true; | ||
_paused = 2; | ||
emit Paused(_msgSender()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Set paused state to 1 to preserve legacy meaning (paused) and enable nonzero↔nonzero toggles
This keeps upgrades safe and achieves the intended gas profile after the first write.
- _paused = 2;
+ _paused = 1; // _PAUSED
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
function _pause() internal virtual whenNotPaused { | |
_paused = true; | |
_paused = 2; | |
emit Paused(_msgSender()); | |
} | |
function _pause() internal virtual whenNotPaused { | |
_paused = 1; // _PAUSED | |
emit Paused(_msgSender()); | |
} |
🤖 Prompt for AI Agents
In contracts/utils/Pausable.sol around lines 96 to 99, the _pause()
implementation sets _paused = 2 which breaks the legacy meaning of "paused" and
nonzero↔nonzero toggle gas behavior; change the assignment to _paused = 1 to
preserve legacy semantics, keep the emit Paused(_msgSender()) call, run the test
suite and any upgrade/migration checks to confirm compatibility, and ensure
related code (e.g., _unpause and any external checks against _paused) still
expects 0 for unpaused and nonzero for paused.
function _unpause() internal virtual whenPaused { | ||
_paused = false; | ||
_paused = 1; | ||
emit Unpaused(_msgSender()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Set unpaused state to 2 (not 1) for the new nonzero encoding
Avoids writing zero again and maintains upgrade compatibility.
- _paused = 1;
+ _paused = 2; // _UNPAUSED
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
function _unpause() internal virtual whenPaused { | |
_paused = false; | |
_paused = 1; | |
emit Unpaused(_msgSender()); | |
} | |
function _unpause() internal virtual whenPaused { | |
_paused = 2; // _UNPAUSED | |
emit Unpaused(_msgSender()); | |
} |
🤖 Prompt for AI Agents
In contracts/utils/Pausable.sol around lines 108 to 111, the _unpause function
currently sets _paused = 1; update it to set _paused = 2 to use the new nonzero
encoding; keep the emit Unpaused(_msgSender()) and the whenPaused modifier as-is
so behavior and interface remain unchanged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 8
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.changeset/tidy-animals-guess.md (1)
1-6
: Fix package name, typo, and clarify the changeset description.
- Package should be '@openzeppelin/contracts' (this repo), not 'openzeppelin-solidity'.
- Typo: "peused" → "paused".
- Describe the internal change precisely and state no public API change.
Apply:
--- -'openzeppelin-solidity': patch +'@openzeppelin/contracts': patch --- -edited "peused" function +Optimize Pausable: store paused state as uint256 (1 = UNPAUSED, 2 = PAUSED) to reduce gas on subsequent pause operations. No public API change; paused() still returns bool.
🧹 Nitpick comments (2)
.changeset/six-stars-hide.md (2)
5-6
: Clarify external behavior and trade-offs in the note.State explicitly that the public API remains unchanged (paused() returns bool), and document the gas trade-off (unpause slightly costlier; subsequent pause much cheaper) plus the internal encoding (e.g., 1 = unpaused, 2 = paused).
Example:
-Optimized Pausable.sol by using uint256 instead of bool for lower gas usage. +Optimize Pausable.sol by storing pause state as uint256 (1 = unpaused, 2 = paused) for lower gas in subsequent toggles. +Public API unchanged: paused() still returns bool. +Trade-offs: first pause ~same cost; unpause slightly higher; subsequent pause significantly cheaper.
5-6
: The AI summary claims a public type change; the changeset does not.Good that the artifact still exposes paused() -> bool. Consider adding a one-liner here to preempt confusion.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (15)
.changeset/six-stars-hide.md
(1 hunks).changeset/tidy-animals-guess.md
(1 hunks).deps/npm/to
(1 hunks).deps/npm/tok
(1 hunks).deps/npm/toke
(1 hunks).deps/npm/token
(1 hunks)contracts/artifacts/MyERC_metadata.json
(1 hunks)contracts/token/ERC20/extensions/artifacts/ERC20Pausable.json
(1 hunks)contracts/token/ERC20/extensions/artifacts/ERC20Pausable_metadata.json
(1 hunks)contracts/utils/Pausable.sol
(4 hunks)contracts/utils/artifacts/Bytes.json
(1 hunks)contracts/utils/artifacts/Bytes_metadata.json
(1 hunks)contracts/utils/artifacts/Pausable.json
(1 hunks)contracts/utils/artifacts/Pausable_metadata.json
(1 hunks)contracts/utils/artifacts/build-info/3517b2f633518377933d870ac8680580.json
(1 hunks)
✅ Files skipped from review due to trivial changes (5)
- contracts/utils/artifacts/Bytes_metadata.json
- contracts/artifacts/MyERC_metadata.json
- contracts/utils/artifacts/Bytes.json
- contracts/token/ERC20/extensions/artifacts/ERC20Pausable.json
- contracts/utils/artifacts/build-info/3517b2f633518377933d870ac8680580.json
🚧 Files skipped from review as they are similar to previous changes (1)
- contracts/utils/Pausable.sol
🧰 Additional context used
🪛 GitHub Check: codespell
.deps/npm/toke
[failure] 3-3:
toke ==> token, took
[failure] 3-3:
toke ==> token, took
🪛 LanguageTool
.changeset/tidy-animals-guess.md
[grammar] ~5-~5: Ensure spelling is correct
Context: ...enzeppelin-solidity': patch --- edited "peused" function
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~5-~5: There might be a mistake here.
Context: ...ty': patch --- edited "peused" function
(QB_NEW_EN)
⏰ 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). (6)
- GitHub Check: tests
- GitHub Check: slither
- GitHub Check: coverage
- GitHub Check: tests-upgradeable
- GitHub Check: tests-foundry
- GitHub Check: halmos
🔇 Additional comments (5)
.changeset/tidy-animals-guess.md (1)
1-6
: paused() signature remainsbool
; no changeset alters it.deps/npm/tok (1)
1-8
: Vendored module.deps/npm/tok/index.js
not found — no removal needed.Likely an incorrect or invalid review comment.
contracts/utils/artifacts/Pausable_metadata.json (2)
45-56
: ABI shows paused() -> bool (good).This aligns with the “no public API change” claim.
98-106
: Validate evmVersion and optimizer settings.evmVersion is set to "prague" while compiler is 0.8.30; ensure your toolchain actually supports this EVM tag. Also optimizer.enabled=false makes runs=200 moot.
Do you want me to propose repo-wide Foundry/Hardhat settings that match CI and current forks?
contracts/token/ERC20/extensions/artifacts/ERC20Pausable_metadata.json (1)
487-503
: Check evmVersion and optimizer flags consistency.Same "prague" + optimizer disabled combination as other artifacts; verify support or align with CI defaults.
'openzeppelin-solidity': patch | ||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix package name in changeset front matter.
The repo’s published package is "@openzeppelin/contracts", not "openzeppelin-solidity". Using the wrong package key will bypass release automation.
Apply this diff:
----
-'openzeppelin-solidity': patch
+'@openzeppelin/contracts': patch
----
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
'openzeppelin-solidity': patch | |
--- | |
'@openzeppelin/contracts': patch | |
--- |
🤖 Prompt for AI Agents
.changeset/six-stars-hide.md around lines 2-3: the changeset front matter
currently uses the wrong package key 'openzeppelin-solidity'; replace that value
with the correct published package name "@openzeppelin/contracts" in the
front-matter section so release automation recognizes the package, ensuring the
YAML/markdown front-matter syntax remains valid after the edit.
/** | ||
* to.js - main file | ||
*/ | ||
module.exports = require('./lib/to'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Remove vendored npm artifact (.deps/npm/to) — out of PR scope and repo standards.
This PR targets Pausable gas optimizations; adding a vendored CommonJS entrypoint here is unrelated and risks supply-chain noise.
Please drop this file from the PR. If needed, depend via package.json instead of committing built artifacts. To verify there are no references:
🏁 Script executed:
#!/bin/bash
rg -n --hidden '\.deps/npm/to' -g '!**/node_modules/**'
Length of output: 57
🏁 Script executed:
#!/bin/bash
echo "Vendored files in .deps/npm/to:"
find .deps/npm/to -type f
echo ""
echo "Searching for any references to '.deps/npm/to' (excluding node_modules):"
rg -n '\.deps/npm/to' -g '!**/node_modules/**'
echo ""
echo "Searching for require(...) or import-from statements referencing module 'to' outside the vendored directory:"
rg -nP "require\s*\(\s*['\"].*to" -g '!**/node_modules/**' --glob '!.deps/npm/to/**'
rg -nP "import\s+.*from\s+['\"].*to" -g '!**/node_modules/**' --glob '!.deps/npm/to/**'
Length of output: 26260
Drop the vendored .deps/npm/to
directory
This unreferenced artifact isn’t used anywhere—remove .deps/npm/to
from the PR and declare to
as a dependency in package.json
instead.
🤖 Prompt for AI Agents
In .deps/npm/to around lines 1-4: remove the vendored .deps/npm/to directory
from the PR (delete the files and ensure the directory is not committed), add
"to" as a dependency in package.json (add the appropriate version entry under
dependencies), run npm install to update package-lock.json, and commit the
package.json and lockfile changes; also verify there are no code references to
the vendored path and update .gitignore if needed to prevent re-adding the
vendor folder.
/** | ||
* Minified by jsDelivr using Terser v5.39.0. | ||
* Original file: /npm/toke@0.0.3/build/src/toke.js | ||
* | ||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files | ||
*/ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,r){for(var t=0;t<r.length;t++){var i=r[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(r,t,i){return t&&e(r.prototype,t),i&&e(r,i),r}}();function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r.default=e,r}function _classCallCheck(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}var _utils=require("./utils"),utils=_interopRequireWildcard(_utils),_libLexicon=require("../lib/lexicon"),_libLexicon2=_interopRequireDefault(_libLexicon),_libGrammar=require("../lib/grammar"),_libGrammar2=_interopRequireDefault(_libGrammar),_default=function(){function e(r){_classCallCheck(this,e);r=r||{};this.grammar=r.grammar||_libGrammar2.default,this.lexicon=r.lexicon||_libLexicon2.default}return _createClass(e,[{key:"mk",value:function(e){return utils.mk(e,this.grammar,this.lexicon)}},{key:"compileToken",value:function(e,r){return utils.compileToken(e,r)}}]),e}();exports.default=_default,module.exports=exports.default; | ||
//# sourceMappingURL=/sm/669e91b95b4b628d5b7dbdcd73dae7cf887446c0d37562a7b23e1a1ead42e289.map |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
❓ Verification inconclusive
Remove minified third-party build (.deps/npm/toke) — licensing and provenance concerns.
Minified distribution code does not belong in this repo and is unrelated to the Solidity change. If required, consume via a package manager and pin versions.
Please delete this file from the PR. Quick check for usage:
🏁 Script executed:
#!/bin/bash
rg -n --hidden '\.deps/npm/toke' -g '!**/node_modules/**'
Length of output: 59
🏁 Script executed:
#!/bin/bash
# Check for require statements referencing toke
rg -nP --hidden "require\(['\"]/.*toke.*['\"]\)" -g "!**/node_modules/**"
# Check for import statements referencing toke
rg -nP --hidden "import\s+(?:[^'\";]+)\s+from\s+['\"]/.*toke.*['\"]" -g "!**/node_modules/**"
# Check for dynamic import of toke
rg -nP --hidden "import\(['\"]/.*toke.*['\"]\)" -g "!**/node_modules/**"
Length of output: 260
Remove the .deps/npm/toke
file—third-party minified builds must not be checked into this repo.
🧰 Tools
🪛 GitHub Check: codespell
[failure] 3-3:
toke ==> token, took
[failure] 3-3:
toke ==> token, took
🤖 Prompt for AI Agents
.deps/npm/toke lines 1-8: this is a third-party minified build file that should
not be checked into the repository; remove the file from the repo and update
version control to ignore it: delete .deps/npm/toke from the working tree,
remove it from the index (git rm --cached or git rm as appropriate) if already
committed, add an entry to .gitignore or the package lock/process that prevents
committing generated/minified vendor builds, and commit the change with a
message noting removal of checked-in third-party minified assets.
<div class="footer-left"> | ||
<svg class="logo" viewBox="0 0 140 34" xmlns="http://www.w3.org/2000/svg"> | ||
<g fill="#1e3b45"> | ||
<path | ||
d="m43.616 19.576c0 4.005-1.389 6.008-4.168 6.008-.432 0-.853-.059-1.261-.174v-1.112c.455.154.883.232 1.285.232 1.065 0 1.833-.404 2.304-1.209.471-.807.706-2.063.706-3.769v-10.859h1.134z"/> | ||
<path | ||
d="m47.065 24.705v-1.309c1.188.756 2.393 1.135 3.612 1.135 1.296 0 2.28-.268 2.952-.805.671-.537 1.007-1.288 1.007-2.251 0-.85-.226-1.528-.678-2.032-.451-.506-1.429-1.194-2.935-2.067-1.682-.979-2.747-1.799-3.195-2.46-.447-.66-.671-1.422-.671-2.286 0-1.172.455-2.169 1.366-2.988.911-.817 2.126-1.227 3.647-1.227.988 0 1.975.166 2.963.498v1.204c-.972-.44-2.011-.66-3.113-.66-1.127 0-2.02.287-2.681.858-.659.571-.99 1.297-.99 2.177 0 .848.226 1.524.677 2.026.452.5 1.426 1.184 2.923 2.048 1.551.881 2.584 1.663 3.097 2.345.514.684.77 1.469.77 2.356 0 1.274-.442 2.311-1.325 3.114-.884.803-2.133 1.204-3.746 1.204-.572 0-1.229-.09-1.973-.266-.745-.178-1.313-.383-1.707-.614z"/> | ||
<path | ||
d="m59.104 25.295v-16.602h5.881c5.895 0 8.844 2.698 8.844 8.093 0 2.585-.805 4.65-2.413 6.194-1.61 1.543-3.753 2.315-6.431 2.315zm3.74-13.556v10.522h1.852c1.621 0 2.892-.485 3.814-1.458s1.383-2.296 1.383-3.97c0-1.583-.457-2.827-1.372-3.734-.914-.907-2.199-1.36-3.85-1.36z"/> | ||
<path | ||
d="m86.841 25.295h-9.957v-16.602h9.574v3.046h-5.834v3.693h5.43v3.032h-5.43v3.796h6.217z"/> | ||
<path d="m99.893 25.295h-9.887v-16.602h3.74v13.568h6.147z"/> | ||
<path d="m105.989 8.693v16.602h-3.74v-16.602z"/> | ||
<path | ||
d="m123.834 8.693-5.719 16.602h-4.236l-5.651-16.602h4.029l3.462 11.553c.186.625.297 1.178.336 1.657h.068c.055-.518.174-1.084.36-1.702l3.439-11.508z"/> | ||
<path | ||
d="m140 25.295h-4.295l-2.581-4.273c-.193-.322-.379-.613-.555-.868-.178-.254-.358-.473-.539-.654-.182-.18-.369-.321-.567-.416-.197-.096-.41-.145-.643-.145h-1.006v6.356h-3.74v-16.602h5.926c4.029 0 6.043 1.506 6.043 4.515 0 .578-.088 1.114-.266 1.604s-.428.932-.752 1.325c-.324.395-.717.733-1.176 1.02-.459.285-.969.508-1.534.67v.047c.248.076.486.203.719.375.231.174.455.377.67.61.217.231.424.479.619.746.197.266.377.526.539.782zm-10.185-13.8v4.619h1.62c.803 0 1.448-.231 1.932-.694.494-.471.742-1.053.742-1.749 0-1.45-.87-2.177-2.605-2.177h-1.689z"/> | ||
</g> | ||
<path d="m15.386.338-3.106 11.038v.104 11.039l3.106 11.143 3.194-11.143v-11.039-.104z" | ||
fill="#bd483b"/> | ||
<path d="m15.386.338-15.386 5.542 2.186 20.492 13.2 7.29" fill="#e64e3d"/> | ||
<path d="m15.386 33.662 13.268-7.365 2.483-20.49-15.751-5.469" fill="#bd483b"/> | ||
<path | ||
d="m12.594 25.088c-1.514-.473-2.864-1.317-3.94-2.431l-.003-.002c-.131-.137-.257-.274-.381-.418-.838-.979-1.478-2.13-1.857-3.396.251.233.518.447.796.647.003.008.008.016.011.027-.003-.012-.008-.02-.011-.027.398.279.822.526 1.269.737.141.064.282.125.427.186.177.07.36.135.542.195.011.006.024.006.035.01.032.012.065.023.097.033.074.756.649 1.372 1.39 1.504.287 1.157.833 2.146 1.625 2.935z" | ||
fill="#fec82f"/> | ||
<path | ||
d="m13.174 11.794c0 .324.088.627.243.883-1.25 1.753-2.108 3.656-2.479 5.539-.041.209-.077.416-.105.619-.429.113-.79.393-1.016.762-.013 0-.024-.004-.035-.01-.023-.006-.04-.014-.061-.021-.142-.045-.281-.098-.417-.152-.204-.08-.403-.174-.598-.272-.663-.338-1.26-.772-1.781-1.291-.11-.111-.213-.219-.311-.332l-.041-.049c-.038-.045-.078-.092-.115-.137-.017-.021-.032-.039-.047-.059-.014-.018-.024-.031-.037-.045-.005-.01-.013-.016-.017-.023-.02-.022-.037-.047-.053-.068-.008-.012-.017-.022-.023-.029-.001-.004-.002-.004-.004-.008-.013-.014-.024-.033-.037-.049-.055-.072-.107-.149-.157-.225-.009-.012-.019-.024-.025-.039-.006-.006-.015-.018-.02-.027-.014-.203-.02-.408-.02-.617 0-1.882.557-3.636 1.512-5.105.113-.176.235-.348.361-.514.12-.16.245-.319.374-.467 1.126-1.317 2.61-2.315 4.299-2.847.026.182.059.367.095.553.192.967.513 1.942.949 2.898-.271.3-.434.698-.434 1.132z" | ||
fill="#fec82f"/> | ||
<path | ||
d="m12.176 20.479c0 .221-.079.424-.212.58-.029.037-.061.068-.096.1-.161.141-.368.225-.596.225-.173 0-.335-.049-.472-.135-.147-.09-.265-.219-.342-.375-.058-.121-.089-.252-.089-.395 0-.26.11-.494.286-.658.029-.027.06-.051.091-.074.148-.107.331-.17.526-.17.206 0 .395.068.546.186.085.063.155.139.213.229.094.137.145.307.145.487z" | ||
fill="#fec82f"/> | ||
<path | ||
d="m15.777 11.794c0 .147-.032.281-.094.403-.148.299-.456.502-.808.502-.044 0-.087-.002-.128-.006-.008-.004-.016-.004-.025-.006-.383-.066-.684-.369-.741-.756-.007-.043-.01-.09-.01-.137 0-.102.017-.201.05-.295.123-.354.46-.606.854-.606h.002.036c.392.018.72.285.827.645.025.082.037.168.037.256z" | ||
fill="#fec82f"/> | ||
<path | ||
d="m24.752 16.143c0 .907-.129 1.782-.368 2.61-.799-.211-1.606-.52-2.4-.914.022-.109.033-.221.033-.336 0-.225-.044-.442-.125-.639.031-.029.064-.061.095-.094.957-.977 1.763-2.055 2.404-3.212.234.821.361 1.69.361 2.585z" | ||
fill="#df9c26"/> | ||
<path | ||
d="m23.881 12.196c-.063.139-.131.277-.201.416-.627 1.235-1.455 2.382-2.459 3.407-.009.01-.02.02-.028.027-.255-.156-.557-.244-.879-.244-.375 0-.722.123-1.004.328-.514-.404-1.011-.848-1.49-1.327-.608-.604-1.157-1.247-1.647-1.909.252-.297.405-.68.405-1.102 0-.313-.087-.61-.237-.862 1.21-1.163 2.547-2.106 3.917-2.788 1.572.961 2.841 2.372 3.623 4.054z" | ||
fill="#df9c26"/> | ||
<path | ||
d="m21.217 17.503c0 .379-.23.701-.556.836-.108.045-.225.07-.348.07-.063 0-.125-.008-.185-.02-.385-.082-.681-.408-.715-.805.011-.01.021-.016.028-.022-.01-.008-.021-.014-.03-.023-.001-.012-.001-.022-.001-.037 0-.389.25-.723.601-.85.095-.033.196-.053.302-.053.09 0 .179.014.262.039.346.105.606.412.64.785.002.027.002.055.002.08z" | ||
fill="#df9c26"/> | ||
<path | ||
d="m21.452 18.767c-.301.274-.7.44-1.139.44-.351 0-.677-.107-.949-.289-.039.025-.078.051-.115.072-1.233.781-2.538 1.352-3.864 1.698v4.824c3.887 0 7.222-2.37 8.64-5.744-.859-.237-1.723-.573-2.573-1.001z" | ||
fill="#df9c26"/> | ||
<path | ||
d="m15.386 20.688c-.793.205-1.591.33-2.385.367-.042.002-.086.006-.128.008-.151.41-.454.744-.839.94.245.909.688 1.698 1.319 2.327.524.524 1.162.92 1.891 1.18.046 0 .093.002.142.002z" | ||
fill="#fec82f"/> | ||
<path | ||
d="m18.612 17.503c0-.172.026-.34.074-.498-.562-.44-1.106-.92-1.625-1.442-.614-.614-1.172-1.262-1.675-1.934v5.946c1.124-.324 2.235-.823 3.291-1.489.009-.006.02-.014.03-.022-.061-.174-.095-.364-.095-.561z" | ||
fill="#df9c26"/> | ||
<path | ||
d="m15.386 13.629c-.045-.059-.091-.113-.132-.174-.123.029-.249.043-.378.043-.227 0-.441-.045-.637-.123-1.134 1.606-1.912 3.341-2.25 5.049-.032.162-.059.32-.083.475.477.195.848.596.996 1.092.016-.004.029-.004.046-.004.809-.039 1.627-.18 2.438-.412z" | ||
fill="#fec82f"/> | ||
<path | ||
d="m15.386 6.778v3.394c.048.016.098.033.145.055 1.106-1.073 2.316-1.979 3.573-2.681-1.14-.496-2.399-.768-3.718-.768z" | ||
fill="#df9c26"/> | ||
<path | ||
d="m15.386 6.778c-.608 0-1.201.055-1.773.168.025.197.06.404.101.606.168.86.449 1.725.829 2.575.106-.02.219-.033.333-.033.178 0 .347.027.51.078z" | ||
fill="#fec82f"/> | ||
</svg> | ||
|
||
<p class="copyright">© jsdelivr.com, 2012 - 2025</p> | ||
</div> | ||
|
||
<div class="footer-right"> | ||
<a href="https://github.com/jsdelivr/jsdelivr"> | ||
<span class="gh-icon"> | ||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" viewBox="0 0 16 16" xml:space="preserve"> | ||
<path id="XMLID_1_" fill="#ff5627" d="M8,0.2c-4.4,0-8,3.6-8,8c0,3.5,2.3,6.5,5.5,7.6C5.9,15.9,6,15.6,6,15.4c0-0.2,0-0.7,0-1.4 | ||
C3.8,14.5,3.3,13,3.3,13c-0.4-0.9-0.9-1.2-0.9-1.2c-0.7-0.5,0.1-0.5,0.1-0.5c0.8,0.1,1.2,0.8,1.2,0.8C4.4,13.4,5.6,13,6,12.8 | ||
c0.1-0.5,0.3-0.9,0.5-1.1c-1.8-0.2-3.6-0.9-3.6-4c0-0.9,0.3-1.6,0.8-2.1c-0.1-0.2-0.4-1,0.1-2.1c0,0,0.7-0.2,2.2,0.8 | ||
c0.6-0.2,1.3-0.3,2-0.3c0.7,0,1.4,0.1,2,0.3c1.5-1,2.2-0.8,2.2-0.8c0.4,1.1,0.2,1.9,0.1,2.1c0.5,0.6,0.8,1.3,0.8,2.1 | ||
c0,3.1-1.9,3.7-3.7,3.9C9.7,12,10,12.5,10,13.2c0,1.1,0,1.9,0,2.2c0,0.2,0.1,0.5,0.6,0.4c3.2-1.1,5.5-4.1,5.5-7.6 | ||
C16,3.8,12.4,0.2,8,0.2z"/> | ||
</svg> | ||
</span> | ||
Documentation | ||
</a> | ||
|
||
<a href="https://www.jsdelivr.com/features">Learn more about jsDelivr</a> | ||
</div> | ||
</footer> | ||
|
||
<script> | ||
var versions = document.querySelector('.versions'); | ||
|
||
[].slice.call(versions.querySelectorAll('option')).forEach(function(option) { | ||
if (option.value === 'token@0.1.0') { | ||
option.selected = true; | ||
} | ||
}); | ||
|
||
versions.addEventListener('change', function() { | ||
location.pathname = '/npm/' + this.value + '/'; | ||
}); | ||
</script> | ||
</body> | ||
</html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
❓ Verification inconclusive
Delete unrelated static HTML page (.deps/npm/token).
Large CDN landing page HTML is unrelated to Pausable and should not live in this repo. It adds bloat and external links with no value to contracts.
Please remove this file from the PR. Verify no references:
🏁 Script executed:
#!/bin/bash
rg -n --hidden '\.deps/npm/token' -g '!**/node_modules/**'
Length of output: 60
Remove .deps/npm/token
static HTML page
Static CDN landing page isn’t used in the repo and adds unnecessary bloat; no references were found via rg -n --hidden '\.deps/npm/token' -g '!**/node_modules/**'
. Delete the entire .deps/npm/token
directory.
🤖 Prompt for AI Agents
In .deps/npm/token around lines 1 to 471, the static HTML CDN landing page and
its containing directory are unused and add bloat; remove the entire
.deps/npm/token directory (delete all files under it), run git rm -r
.deps/npm/token to remove it from the repository, commit the change, and push;
ensure there are no remaining references (run the provided ripgrep check again)
before finalizing the commit.
"details": "Returns true if the contract is paused, and false otherwise." | ||
}, | ||
"symbol()": { | ||
"details": "Returns the symbol of the token, usually a shorter version of the name." | ||
}, | ||
"totalSupply()": { | ||
"details": "Returns the value of tokens in existence." | ||
}, | ||
"transfer(address,uint256)": { | ||
"details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `value`." | ||
}, | ||
"transferFrom(address,address,uint256)": { | ||
"details": "See {IERC20-transferFrom}. Skips emitting an {Approval} event indicating an allowance update. This is not required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve]. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `value`. - the caller must have allowance for ``from``'s tokens of at least `value`." | ||
} | ||
}, | ||
"version": 1 | ||
}, | ||
"userdoc": { | ||
"kind": "user", | ||
"methods": {}, | ||
"version": 1 | ||
} | ||
}, | ||
"settings": { | ||
"compilationTarget": { | ||
"contracts/token/ERC20/extensions/ERC20Pausable.sol": "ERC20Pausable" | ||
}, | ||
"evmVersion": "prague", | ||
"libraries": {}, | ||
"metadata": { | ||
"bytecodeHash": "ipfs" | ||
}, | ||
"optimizer": { | ||
"enabled": false, | ||
"runs": 200 | ||
}, | ||
"remappings": [ | ||
":@openzeppelin/contracts/=contracts/" | ||
] | ||
}, | ||
"sources": { | ||
"contracts/interfaces/draft-IERC6093.sol": { | ||
"keccak256": "0xa667ad942f67a3a72830ba2db2556b22c94a0d0e7b934cb1af19dbb52c701011", | ||
"license": "MIT", | ||
"urls": [ | ||
"bzz-raw://a04504e81403d9f3c45593e0e29f928ff93fbcd11ea961aa8cbd96b05f80aa6e", | ||
"dweb:/ipfs/QmZtHcvctLMa4Ap1ayqq1kyKt8EN5Ni2851daEdjNNYacG" | ||
] | ||
}, | ||
"contracts/token/ERC20/ERC20.sol": { | ||
"keccak256": "0x86b7b71a6aedefdad89b607378eeab1dcc5389b9ea7d17346d08af01d7190994", | ||
"license": "MIT", | ||
"urls": [ | ||
"bzz-raw://1dc2db8d94a21eac8efe03adf574c419b08536409b416057a2b5b95cb772c43c", | ||
"dweb:/ipfs/QmZfqJCKVU1ScuX2A7s8WZdQEaikwJbDH5JBrBdKTUT4Gu" | ||
] | ||
}, | ||
"contracts/token/ERC20/IERC20.sol": { | ||
"keccak256": "0x74ed01eb66b923d0d0cfe3be84604ac04b76482a55f9dd655e1ef4d367f95bc2", | ||
"license": "MIT", | ||
"urls": [ | ||
"bzz-raw://5282825a626cfe924e504274b864a652b0023591fa66f06a067b25b51ba9b303", | ||
"dweb:/ipfs/QmeCfPykghhMc81VJTrHTC7sF6CRvaA1FXVq2pJhwYp1dV" | ||
] | ||
}, | ||
"contracts/token/ERC20/extensions/ERC20Pausable.sol": { | ||
"keccak256": "0x756aee61d83960d324973de3a64920a02b480efe662b611fb05ea506d844aa55", | ||
"license": "MIT", | ||
"urls": [ | ||
"bzz-raw://4dfb71ab2f5fcc530226a25bba4d808f4d22a7f383cae4a3be3629ec057b276c", | ||
"dweb:/ipfs/QmRzyetUjbr9Gx1pcXYSsE5rz4XypfEbZgmBvZKUNUJQLR" | ||
] | ||
}, | ||
"contracts/token/ERC20/extensions/IERC20Metadata.sol": { | ||
"keccak256": "0xd6fa4088198f04eef10c5bce8a2f4d60554b7ec4b987f684393c01bf79b94d9f", | ||
"license": "MIT", | ||
"urls": [ | ||
"bzz-raw://f95ee0bbd4dd3ac730d066ba3e785ded4565e890dbec2fa7d3b9fe3bad9d0d6e", | ||
"dweb:/ipfs/QmSLr6bHkPFWT7ntj34jmwfyskpwo97T9jZUrk5sz3sdtR" | ||
] | ||
}, | ||
"contracts/utils/Context.sol": { | ||
"keccak256": "0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2", | ||
"license": "MIT", | ||
"urls": [ | ||
"bzz-raw://6a708e8a5bdb1011c2c381c9a5cfd8a9a956d7d0a9dc1bd8bcdaf52f76ef2f12", | ||
"dweb:/ipfs/Qmax9WHBnVsZP46ZxEMNRQpLQnrdE4dK8LehML1Py8FowF" | ||
] | ||
}, | ||
"contracts/utils/Pausable.sol": { | ||
"keccak256": "0xf11f182b233f92a2c7169c0a58e9b79d68e4fb16487210e4620349f8c60072ca", | ||
"license": "MIT", | ||
"urls": [ | ||
"bzz-raw://15184450e50c0795f97be002c004abf72d7dc2f49ac9a5ac278ac0efb54e2a63", | ||
"dweb:/ipfs/QmeuEsznhKAB3ENZpuYka6iuvWey3hNXNV8DrpXK5FZacG" | ||
] | ||
} | ||
}, | ||
"version": 1 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Don’t commit ERC20Pausable metadata artifacts.
Please remove and add an ignore rule.
🤖 Prompt for AI Agents
In contracts/token/ERC20/extensions/artifacts/ERC20Pausable_metadata.json (lines
1-563), the review flags that compiled metadata/artifact files should not be
committed; remove this JSON file from the repo and add an appropriate .gitignore
rule (e.g., ignore the artifacts/ directory or *.json metadata/artifact
patterns) so future compiled artifacts are not committed; update the commit by
deleting the file and adding the .gitignore entry, then run git rm --cached if
needed and commit the changes.
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": false, | ||
"internalType": "address", | ||
"name": "account", | ||
"type": "address" | ||
} | ||
], | ||
"name": "Unpaused", | ||
"type": "event" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "paused", | ||
"outputs": [ | ||
{ | ||
"internalType": "bool", | ||
"name": "", | ||
"type": "bool" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
} | ||
], | ||
"devdoc": { | ||
"details": "Contract module which allows children to implement an emergency stop mechanism that can be triggered by an authorized account. This module is used through inheritance. It will make available the modifiers `whenNotPaused` and `whenPaused`, which can be applied to the functions of your contract. Note that they will not be pausable by simply including this module, only once the modifiers are put in place.", | ||
"errors": { | ||
"EnforcedPause()": [ | ||
{ | ||
"details": "The operation failed because the contract is paused." | ||
} | ||
], | ||
"ExpectedPause()": [ | ||
{ | ||
"details": "The operation failed because the contract is not paused." | ||
} | ||
] | ||
}, | ||
"events": { | ||
"Paused(address)": { | ||
"details": "Emitted when the pause is triggered by `account`." | ||
}, | ||
"Unpaused(address)": { | ||
"details": "Emitted when the pause is lifted by `account`." | ||
} | ||
}, | ||
"kind": "dev", | ||
"methods": { | ||
"paused()": { | ||
"details": "Returns true if the contract is paused, and false otherwise." | ||
} | ||
}, | ||
"version": 1 | ||
}, | ||
"userdoc": { | ||
"kind": "user", | ||
"methods": {}, | ||
"version": 1 | ||
} | ||
}, | ||
"settings": { | ||
"compilationTarget": { | ||
"contracts/utils/Pausable.sol": "Pausable" | ||
}, | ||
"evmVersion": "prague", | ||
"libraries": {}, | ||
"metadata": { | ||
"bytecodeHash": "ipfs" | ||
}, | ||
"optimizer": { | ||
"enabled": false, | ||
"runs": 200 | ||
}, | ||
"remappings": [ | ||
":@openzeppelin/contracts/=contracts/" | ||
] | ||
}, | ||
"sources": { | ||
"contracts/utils/Context.sol": { | ||
"keccak256": "0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2", | ||
"license": "MIT", | ||
"urls": [ | ||
"bzz-raw://6a708e8a5bdb1011c2c381c9a5cfd8a9a956d7d0a9dc1bd8bcdaf52f76ef2f12", | ||
"dweb:/ipfs/Qmax9WHBnVsZP46ZxEMNRQpLQnrdE4dK8LehML1Py8FowF" | ||
] | ||
}, | ||
"contracts/utils/Pausable.sol": { | ||
"keccak256": "0xdf8d9228aca6cb87ae8bec08c3ecd84de7897a3d7b3b15ddd157dc6689986ad1", | ||
"license": "MIT", | ||
"urls": [ | ||
"bzz-raw://2b419e49007752dba7a1ad5e4f2a8b16d8477cc5ec3ad82c84cbe2231bdfb6ad", | ||
"dweb:/ipfs/Qme2RFtT8s6Wwid5rQDEPWNCZSsXGXqzvMtz2LT9hMMf2e" | ||
] | ||
} | ||
}, | ||
"version": 1 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Remove committed metadata artifacts.
These metadata files shouldn’t live in source control for this repo.
🤖 Prompt for AI Agents
In contracts/utils/artifacts/Pausable_metadata.json around lines 1-130, this
compiled metadata file should not be committed; delete the file from the
repository (git rm contracts/utils/artifacts/Pausable_metadata.json and commit
the removal), add an appropriate ignore rule to .gitignore (e.g., ignore the
artifacts/ or metadata files pattern) to prevent future commits, and if
necessary remove it from history (use git rm --cached or git filter-repo/BFG) so
the artifact is no longer tracked.
"main:1": { | ||
"linkReferences": {}, | ||
"autoDeployLib": true | ||
}, | ||
"ropsten:3": { | ||
"linkReferences": {}, | ||
"autoDeployLib": true | ||
}, | ||
"rinkeby:4": { | ||
"linkReferences": {}, | ||
"autoDeployLib": true | ||
}, | ||
"kovan:42": { | ||
"linkReferences": {}, | ||
"autoDeployLib": true | ||
}, | ||
"goerli:5": { | ||
"linkReferences": {}, | ||
"autoDeployLib": true | ||
}, | ||
"Custom": { | ||
"linkReferences": {}, | ||
"autoDeployLib": true | ||
} | ||
}, | ||
"data": { | ||
"bytecode": { | ||
"functionDebugData": {}, | ||
"generatedSources": [], | ||
"linkReferences": {}, | ||
"object": "", | ||
"opcodes": "", | ||
"sourceMap": "" | ||
}, | ||
"deployedBytecode": { | ||
"functionDebugData": {}, | ||
"generatedSources": [], | ||
"immutableReferences": {}, | ||
"linkReferences": {}, | ||
"object": "", | ||
"opcodes": "", | ||
"sourceMap": "" | ||
}, | ||
"gasEstimates": null, | ||
"methodIdentifiers": { | ||
"paused()": "5c975abb" | ||
} | ||
}, | ||
"abi": [ | ||
{ | ||
"inputs": [], | ||
"name": "EnforcedPause", | ||
"type": "error" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "ExpectedPause", | ||
"type": "error" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": false, | ||
"internalType": "address", | ||
"name": "account", | ||
"type": "address" | ||
} | ||
], | ||
"name": "Paused", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": false, | ||
"internalType": "address", | ||
"name": "account", | ||
"type": "address" | ||
} | ||
], | ||
"name": "Unpaused", | ||
"type": "event" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "paused", | ||
"outputs": [ | ||
{ | ||
"internalType": "bool", | ||
"name": "", | ||
"type": "bool" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
} | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Do not commit build artifacts to the contracts repo.
Artifacts add churn and can get stale. Exclude artifacts from the repo (and ensure they’re ignored in .gitignore).
If these files were added intentionally, please outline the rationale (tooling requirement, reproducible builds, etc.). Otherwise, I can prep a commit to remove them and update ignore rules.
🏁 Script executed:
#!/bin/bash
echo "Files in contracts/utils/artifacts:"
find contracts/utils/artifacts -maxdepth 1 -type f -print
echo ""
echo ".gitignore lines mentioning artifacts or JSON:"
grep -nE 'artifacts|\.json' .gitignore || echo "No patterns found"
Length of output: 541
Remove build artifacts and update ignore rules
- Delete all JSON files in
contracts/utils/artifacts/
and add that directory (orcontracts/utils/artifacts/*.json
) to.gitignore
. - If these artifacts are intentionally committed (e.g., for reproducible builds or tooling), please document the rationale.
🤖 Prompt for AI Agents
In contracts/utils/artifacts/Pausable.json (lines 1-106) this is a compiled
build artifact that should not be committed; remove this file (and all JSON
files under contracts/utils/artifacts/) from the repo and add
contracts/utils/artifacts/ or contracts/utils/artifacts/*.json to .gitignore to
prevent re-adding; if you must keep artifacts intentionally, add a short README
or update the repository README explaining why they are checked in and pin the
workflow/tooling that requires them.
"bytecode": { | ||
"functionDebugData": {}, | ||
"generatedSources": [], | ||
"linkReferences": {}, | ||
"object": "", | ||
"opcodes": "", | ||
"sourceMap": "" | ||
}, | ||
"deployedBytecode": { | ||
"functionDebugData": {}, | ||
"generatedSources": [], | ||
"immutableReferences": {}, | ||
"linkReferences": {}, | ||
"object": "", | ||
"opcodes": "", | ||
"sourceMap": "" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Artifact contains empty bytecode/deployedBytecode blocks.
These look like generated placeholders and shouldn’t be committed. Remove from VCS.
🤖 Prompt for AI Agents
In contracts/utils/artifacts/Pausable.json around lines 33 to 49, the artifact
contains empty "bytecode" and "deployedBytecode" objects that are generated
placeholders and should not be committed; remove these empty blocks from the
committed JSON (or remove the entire artifact file if it’s a generated output),
then regenerate artifacts as part of the build if needed and add the generated
artifacts path to .gitignore so placeholders aren’t re-committed.
Summary
Optimized
Pausable.sol
by replacing the storage variable type frombool
touint256
.Gas Report
Analysis:
pause
: almost no differenceunpause
: slightly more expensivepause
: significant gas savings (~17k)Compatibility
PR Checklist
[ ] Tests
[ ] Documentation
[ ] Changeset entry
Summary by Sourcery
Enhancements:
Summary by CodeRabbit
Refactor
New Features
Chores