Open hats-bug-reporter[bot] opened 3 weeks ago
It's correct, you could test it.
it is checking that if a char will not any of those, then return false.
function testisvalid() public {
string memory notValid = "??Mahdi";
mockNameRegistry.isValidName(notValid);
}
[PASS] testisvalid() (gas: 7288)
Traces:
[7288] NamesTest::testisvalid()
├─ [1768] MockNameRegistry::isValidName("??Mahdi") [staticcall]
│ └─ ← [Return] false
└─ ← [Stop]
@0xmahdirostami You're right, I was mistaken
Thank you for your report on the isValidName function. After review, we've determined this is not an issue.
The isValidName and isValidSymbol functions are logically equivalent, despite their different implementations. This equivalence is based on De Morgan's laws in Boolean algebra.
We appreciate your thorough examination of our code and attention to logical operations. Your diligence contributes to the quality of our codebase. Thank you for your valuable input.
Github username: @Jelev123 Twitter username: zhulien_zhelev Submission hash (on-chain): 0x15612199e179e17a371d8bc666539cfdf9f8a9b5b891b0972a4e441e7d09ac82 Severity: low
Description: Description\ In isValidName function in loop has a check for
allowed characters
. The check is incorrect because if one if the conditions is false it will return true which will be invalid in this case.`The allowed characters: 0-9, A-Z, a-z, space,
Proof of Concept (PoC) File
Recommendation
Use
| |
operator instead&&
like it done inisValidSymbol
function