Skip to content

new compy#1025

Open
alexcos20 wants to merge 6 commits into
mainfrom
feature/new_-compy
Open

new compy#1025
alexcos20 wants to merge 6 commits into
mainfrom
feature/new_-compy

Conversation

@alexcos20
Copy link
Copy Markdown
Member

@alexcos20 alexcos20 commented May 28, 2026

Fixes # .

Changes proposed in this PR:

  • erc upgradable proxy
  • adminBurn - allows admins to burn tokens from specific address
  • GrantToken is now pausable
  • erc20 transfers are based on allow list

@alexcos20 alexcos20 requested a review from trentmc as a code owner May 28, 2026 00:02
@alexcos20 alexcos20 self-assigned this May 28, 2026
@alexcos20
Copy link
Copy Markdown
Member Author

/run-security-scan

Copy link
Copy Markdown
Member Author

@alexcos20 alexcos20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI automated code review (Gemini 3).

Overall risk: low

Summary:
This is a solid and well-executed PR migrating GrantsToken to an upgradeable UUPS proxy pattern and adding allowlist/admin-burn capabilities. The transition to Initializable and UUPSUpgradeable follows OpenZeppelin best practices (such as _disableInitializers() in the constructor and correct use of __gap storage). The swap-and-pop allowlist implementation is highly efficient. I have left one minor note regarding a redundant override, but overall the code is clean, robust, and production-ready. LGTM!

Comments:
• [WARNING][security] The adminBurnFrom function introduces a significant centralization risk as the owner can unilaterally destroy tokens from any account. While the PR description clarifies this is an intentional fraud remediation feature, ensure the multisig controlling the owner role has strict operational security in place.
• [INFO][style] The cap() function is already defined as public view virtual in ERC20CappedUpgradeable. Overriding it just to return super.cap() is redundant and can be safely removed to keep the contract leaner.

-    function cap() public view override(ERC20CappedUpgradeable) returns (uint256) {
-        return super.cap();
-    }

• [INFO][other] Excellent use of uint256[47] private __gap;. This perfectly reserves 50 slots (accounting for the 3 slots used by _allowlist, _isAllowlisted, and _allowlistIndex, since the constant _DECIMALS does not occupy a storage slot) for future upgrades, following best practices for upgradeable contracts.
• [INFO][performance] Great use of the swap-and-pop algorithm here for array removal. This ensures O(1) gas complexity for removing elements from the allowlist, preventing potential out-of-gas issues for a growing array.

mapping(address => bool) private _isAllowlisted;
mapping(address => uint256) private _allowlistIndex; // 1-based

uint256[47] private __gap;
mapping(address => bool) private _isAllowlisted;
mapping(address => uint256) private _allowlistIndex; // 1-based

uint256[47] private __gap;
@alexcos20 alexcos20 marked this pull request as draft May 28, 2026 00:12
@openzeppelin-code
Copy link
Copy Markdown

openzeppelin-code Bot commented May 28, 2026

new compy

Generated at commit: 32052af3d34a0dc836cb6e69f8caee656b41897a

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
1
0
9
40
52
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@alexcos20 alexcos20 marked this pull request as ready for review May 28, 2026 14:17
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