-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistency in Custom Name and Symbol Registration Functions Leads to Unexpected Reverts #109
Comments
Not even false. If empty, returns; if not empty but invalid, reverts. |
but a wrong line comment wouldnt even qualify for a low issue, let alone medium |
function registerCustomName(address _avatar, string calldata _name) external onlyHub(1) {
if (bytes(_name).length == 0) {
// if name is left empty, it will default to default name "Circles-<base58(short)Name>"
return;
}
if (!isValidName(_name)) {
revert CirclesNamesInvalidName(_avatar, _name, 0);
}
customNames[_avatar] = _name;
}
|
right, you confirm my point. Thanks for your contribution |
Could you explain what is the intention? Empty strings in name and symbol should be allowed or not? |
It returns false and reverts with CirclesInvalidString Circles-0x6ca9ca24d78af44582951825bef9eadcb210e5cf/src/hub/Hub.sol Lines 1017 to 1026 in 507e185
|
I have resubmitted the issue in Issue # 110 Kindly ignore this issue |
Github username: --
Twitter username: --
Submission hash (on-chain): 0xfbb00fba43c02e52b4e45bfd463e4bbcb2aeb9e5e90c5884d320613ea3903ab3
Severity: medium
Description:
Description
In both the registerCustomName and registerCustomSymbol functions of the NameRegistry contract, there are critical inconsistencies between the comments and the implementations.
The comments suggest that when empty strings are provided, they should default to specific values.
However, the functions attempt to validate these empty strings, which fail the isValidName and isValidSymbol checks respectively, causing the functions to revert.
For registerCustomName, the comment states:
For registerCustomSymbol, the comment states:
However, in both cases, empty strings lead to function reverts rather than setting default values.
The text was updated successfully, but these errors were encountered: