Open hats-bug-reporter[bot] opened 2 months ago
Thank you for your report on the _ensureAvatarsRegistered function. After review, we've determined this is not an issue.
The function is correctly implemented and performs its intended purpose. It ensures that all provided avatars are registered as humans, and returns the count of newly registered avatars. The name "ensure" indicates that the function guarantees a condition (all avatars being registered) while also providing useful information (the count of new registrations).
We appreciate your examination of our function implementations. Your attention to detail helps maintain the clarity and correctness of our codebase. Thank you for your participation in this security review.
Github username: -- Twitter username: -- Submission hash (on-chain): 0x7a9e1a72521a2962d7f43acd2baed5d5ab6b214c1d0330333a25d816b5aa605c Severity: medium
Description: Description
As per migration rule, v1 circle owners can apply for migration within the bootsrap window where they no need to pay the
INVITATION_COST
cost. Once they pass the invitationOnlyTime, they have to pay the invitation cost which is set by the owner.This cost apply is not correctly enforced when the migartion happen through the migration contract.
As per current implementation, the migrate function allows to be called by anyone with valid human address. it does not check whether the avatar is already migrated.
The circle are transferred from the call to the migration contract and then the migrate function is called in the Hub.sol.
In the Hub.sol, once the invitation period is passed, the invitation cost is applied and then the tokens are minted
lets look at the function
_ensureAvatarsRegistered
.if the avatar is already registered, it checks if it is valid human. When the avatar already exists in the
avatars
map, the revert will happen inside_registerHuman
function call.Note, only
avatars[_avatars[i]] == address(0)
, theregistrationCount
will be updated.Impact
migration.sol
avatars[_avatars[i]]
already exists, the function_ensureAvatarsRegistered
is not reverting.Inside the
_ensureAvatarsRegistered
, revert ifavatars[_avatars[i]] != address(0)