hats-finance / Proof-Of-Humanity-V2-0xef0709445d394a22704850c772a28a863bb780b0

Proof of Humanity Protocol v2
2 stars 1 forks source link

Lack of Custom Error Messages in Require Statements reduces the debuggability of the code and negatively impacts the user experience #137

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

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

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

Description: Description\ The contract uses numerous require statements throughout its implementation without providing custom error messages.

This practice, while not directly impacting the security or functionality of the contract, reduces the debuggability of the code and negatively impacts the user experience.

When a transaction reverts due to a failed require statement, it becomes challenging for developers and users to understand the specific reason for the failure without diving deep into the contract code.

Attack Scenario\ While this issue doesn't present a direct attack vector, it can indirectly lead to user frustration and potential misuse of the contract:

A user attempts to execute a function but fails to meet a specific requirement.

The transaction reverts with a generic error message.

Without clear information about why the transaction failed, the user might repeatedly attempt the transaction with incorrect parameters or in an invalid state.

This could lead to unnecessary gas consumption and potential user errors in interacting with the contract.

Recommendation\ Use custom error messages to significantly improve the clarity of error messages, enhancing both the debugging process and overall user experience.

clesaege commented 2 months ago

Similar to https://github.com/hats-finance/Proof-Of-Humanity-V2-0xef0709445d394a22704850c772a28a863bb780b0/issues/24