Conversation
🦋 Changeset detectedLatest commit: 07bdc21 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 |
Summary of ChangesHello @itofarina, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly upgrades the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds bridge-controlled cross-chain mint/burn to EXA (BRIDGE_ROLE, crosschainMint/crosschainBurn, IERC7802 support), proxy reinitializer via Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✨ exa: add crosschain mint and burn support
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
5edfce9 to
df5529c
Compare
df5529c to
be4bd71
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
contracts/periphery/EXA.sol (1)
26-29:⚠️ Potential issue | 🟠 MajorValidate
admin_ininitialize2to prevent irreversible admin lockout.Line 28 grants
DEFAULT_ADMIN_ROLEwithout validatingadmin_. Passingaddress(0)would leave admin control effectively unusable.🛠️ Proposed fix
contract EXA is ERC20VotesUpgradeable, AccessControlUpgradeable, IERC7802 { bytes32 public constant BRIDGE_ROLE = keccak256("BRIDGE_ROLE"); + error InvalidAdmin(); @@ function initialize2(address admin_) external reinitializer(2) { + if (admin_ == address(0)) revert InvalidAdmin(); __AccessControl_init(); _grantRole(DEFAULT_ADMIN_ROLE, admin_); }#!/bin/bash set -euo pipefail echo "== Verify EXA.initialize2 has/hasn't zero-address guard ==" rg -n -C3 'function initialize2|admin_ == address\(0\)|_grantRole\(DEFAULT_ADMIN_ROLE, admin_\)' contracts/periphery/EXA.sol echo echo "== Inspect OZ AccessControlUpgradeable _grantRole behavior ==" fd -HI '^AccessControlUpgradeable\.sol$' | while read -r f; do echo "-- $f" rg -n -C3 'function _grantRole|address\(0\)' "$f" doneExpected result: no
admin_ == address(0)guard ininitialize2, and_grantRoleitself does not enforce non-zero accounts.
ℹ️ Review info
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
.changeset/silent-chefs-marry.md.gas-snapshotcontracts/periphery/EXA.soltest/EXA.t.soltest/EscrowedEXA.t.sol
0c63b60 to
ebde601
Compare
ebde601 to
5833408
Compare
87bb3d8 to
62e1258
Compare
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 62e12585f7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| function initialize2(address admin_) external reinitializer(2) { | ||
| if (msg.sender != StorageSlotUpgradeable.getAddressSlot(ADMIN_SLOT).value) revert NotProxyAdmin(); | ||
| if (admin_ == address(0)) revert ZeroAddress(); | ||
| if (bytes(name()).length == 0) revert NotInitialized(); | ||
|
|
||
| __AccessControl_init(); | ||
| _grantRole(DEFAULT_ADMIN_ROLE, admin_); |
There was a problem hiding this comment.
Initialize access control in the default EXA deployment flow
DEFAULT_ADMIN_ROLE is only granted inside initialize2, but the repository’s deploy flow still initializes EXA with only initialize (see deploy/EXA.ts), so fresh deployments/upgrades end up with no admin account able to grant BRIDGE_ROLE. In that state, all new bridge mint/burn entry points guarded by onlyRole(BRIDGE_ROLE) are unusable until an extra manual upgradeAndCall(..., initialize2(...)) step is performed.
Useful? React with 👍 / 👎.
| __ERC20Permit_init("exactly"); | ||
| __ERC20Votes_init(); | ||
| _mint(msg.sender, 10_000_000e18); | ||
| if (block.chainid == 10) _mint(msg.sender, 10_000_000e18); |
There was a problem hiding this comment.
Mint premine to a recoverable address on delayed initialize
On chain 10, initialize mints the full 10M supply to msg.sender, but this function can now be executed post-deploy only via proxy-admin-driven upgrade calls; in that path, msg.sender inside delegatecall is the ProxyAdmin contract. That means delayed initialization mints the premine to ProxyAdmin, and those tokens are effectively stuck because ProxyAdmin has no generic ERC20 transfer method.
Useful? React with 👍 / 👎.
62e1258 to
07bdc21
Compare
Summary by CodeRabbit
New Features
Tests
Dependencies
Chores