hats-finance / Circles-0x6ca9ca24d78af44582951825bef9eadcb210e5cf

Circles Protocol contracts
https://aboutcircles.com
GNU Affero General Public License v3.0
0 stars 0 forks source link

Migration Mechanism Design Flaw May Prevent Some Users from Migrating V1 Circles Tokens #90

Open hats-bug-reporter[bot] opened 2 weeks ago

hats-bug-reporter[bot] commented 2 weeks ago

Github username: -- Twitter username: -- Submission hash (on-chain): 0x20a685a40c7b6bb7df06e8a13b6b0401b5246c1f6208436368a9d954cb60d860 Severity: low

Description: Description

The current migration mechanism design contains a serious flaw that may prevent some V1 Circles token holders from migrating their tokens to the V2 system. The specific issues are as follows:

  1. The migrate function in the Hub V2 contract requires users to be registered in the system to migrate tokens.

  2. The conditions for users to register in Hub V2 are:

    a) Being invited to join, or

    b) Owning a stopped V1 Circles contract.

  3. However, there are users who may have acquired V1 Circles tokens through direct transfers, airdrops, or secondary markets, but have never registered in Hub V1.

  4. These users, although holding legitimate V1 tokens, cannot register in Hub V2 due to not meeting the above registration conditions, and therefore cannot perform the migration operation.

This design flaw may result in some users' assets being trapped in the V1 system, unable to benefit from the new features and advantages of the V2 system, thus affecting user rights and the overall development of the project.

function migrate(address _owner, address[] calldata _avatars, uint256[] calldata _amounts) external onlyMigration {
    if (avatars[_owner] == address(0)) {
        // Only registered avatars can migrate v1 tokens.
        revert CirclesAvatarMustBeRegistered(_owner, 1);
    }
    // ... rest of the code ...
}

Remediation Suggestions

  1. Modify the registration logic in Hub V2 to allow users holding V1 Circles tokens to register directly, without requiring an invitation or a stopped V1 contract.
  2. Add logic in the migrate function to automatically register users if they are unregistered but hold V1 tokens.
benjaminbollen commented 2 weeks ago

Thank you for your report on the migration mechanism for V1 Circles tokens. After review, we've determined this is not an issue.

The design intentionally does not allow registration in V2 solely based on holding V1 tokens. An invitation is the preferred method for most registrations to ensure a well-connected graph. However, the system remains open and permissionless, with multiple ways for users to register in V2.

We appreciate your attention to the migration process and user accessibility. Your observation helps clarify the intentional design of our registration system. Thank you for your contribution to this security review.