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

Proof of Humanity Protocol v2
2 stars 1 forks source link

reverting without error messages #54

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

Description: Description\ lot of important checks in the codebase use Solidity's require(). However, many of them do not include error messages when reverting.

for example:

function withdrawFeesAndRewards(
        address payable _beneficiary,
        bytes20 _humanityId,
        uint256 _requestId,
        uint256 _challengeId,
        uint256 _round
    ) public {
        Request storage request = humanityData[_humanityId].requests[_requestId];
        Challenge storage challenge = request.challenges[_challengeId];
        Round storage round = challenge.rounds[_round];
        require(request.status == Status.Resolved);
        require(_beneficiary != address(0x0));

if third-party protocols want to interact with the codebase, they will face difficulties handling errors, as they will not know the reason for the revert unless the require() includes an error message.

Recommendation\ Consider adding error messages to every require().

clesaege commented 2 months ago

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