Skip to content

Add Freezable for asset compliance support#53

Open
Jesse-Sawa wants to merge 4 commits intomainfrom
sous
Open

Add Freezable for asset compliance support#53
Jesse-Sawa wants to merge 4 commits intomainfrom
sous

Conversation

@Jesse-Sawa
Copy link
Member

@Jesse-Sawa Jesse-Sawa commented Mar 9, 2026

Summary

  • Add Freezable abstract contract for account freezing
  • Add IFreezable interface
  • Add FreezableToken example demonstrating asset compliance pattern
  • Update README with Asset Compliance documentation

Test plan

  • Contracts compile successfully
  • Manual review of Freezable integration pattern

Note

Medium Risk
Introduces new role-gated freezing/unfreezing logic and ERC-7201 storage layout intended for integration into asset contracts; misuse or misconfiguration of roles could block transfers or break upgrade safety.

Overview
Adds Asset Compliance support via a new Freezable abstract contract + IFreezable interface, providing role-based freeze/unfreeze (single and batch), isFrozen, and internal revert helpers using an ERC-7201 namespaced storage slot.

Includes a new FreezableToken example that blocks transfers when sender/recipient is frozen, plus a Foundry test suite covering transfer behavior, access control, and event emission. Updates README.md to document the new Asset Compliance offering, interfaces, examples, and docs links.

Written by Cursor Bugbot for commit 7a403ba. This will update automatically on new commits. Configure here.

Jesse-Sawa and others added 3 commits March 9, 2026 16:28
- Add Freezable abstract contract for account freezing
- Add IFreezable interface
- Add FreezableToken example in asset-compliance/
- Update README with Asset Compliance documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Free Tier Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Missing virtual on unfreeze and unfreezeAccounts functions
    • Added the virtual keyword to both unfreeze and unfreezeAccounts functions to match the symmetric freeze and freezeAccounts functions.

Create PR

Or push these changes by commenting:

@cursor push fa3f00f68d
Preview (fa3f00f68d)
diff --git a/src/Freezable.sol b/src/Freezable.sol
--- a/src/Freezable.sol
+++ b/src/Freezable.sol
@@ -63,12 +63,12 @@
     }
 
     /// @inheritdoc IFreezable
-    function unfreeze(address account) external onlyRole(FREEZE_MANAGER_ROLE) {
+    function unfreeze(address account) external virtual onlyRole(FREEZE_MANAGER_ROLE) {
         _unfreeze(_getFreezableStorageLocation(), account);
     }
 
     /// @inheritdoc IFreezable
-    function unfreezeAccounts(address[] calldata accounts) external onlyRole(FREEZE_MANAGER_ROLE) {
+    function unfreezeAccounts(address[] calldata accounts) external virtual onlyRole(FREEZE_MANAGER_ROLE) {
         FreezableStorageStruct storage $ = _getFreezableStorageLocation();
 
         for (uint256 i; i < accounts.length; ++i) {
This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

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.

1 participant