hats-finance / Euro-Dollar-0xa4ccd3b6daa763f729ad59eae75f9cbff7baf2cd

Audit competition repository for Euro-Dollar (0xa4ccd3b6daa763f729ad59eae75f9cbff7baf2cd)
https://hats.finance
MIT License
3 stars 2 forks source link

Incorrect Documentation in _void Function Misrepresents Its Functionality #22

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): 0xc3842bd5777fbbfda1cd21007083c8e4786e931c3930ef9d16fedd687e5ca209 Severity: low

Description: Description\ In the Validator contract, the internal _void function is intended to remove an address from both the whitelist and the blacklist by setting its status to Status.VOID. However, the documentation comment above the function incorrectly states that it "Removes address from the blacklist," which does not fully capture the function's effect.

Affected Code:

/**
 * @dev Removes address from the blacklist.
 * @param account Address to remove.
 */
function _void(address account) internal {
    accountStatus[account] = Status.VOID;
    emit Voided(account);
}

Issue:

Impact:

Recommendation:

Update the documentation comment for the _void function to accurately reflect its functionality. The comment should clearly state that the function removes the address from both the whitelist and the blacklist by setting its status to VOID.

Corrected Code:

/**
 * @dev Removes address from both the whitelist and blacklist.
 * @param account Address to remove.
 */
function _void(address account) internal {
    accountStatus[account] = Status.VOID;
    emit Voided(account);
}
AndreiMVP commented 2 weeks ago

It's true the documentation is a bit misleading here, but that's not a criteria for an issue and the code is very simple and clear on how it works.