40,000 USDC
View results
Submission Details
Severity: high

MUST AND SHOULD TRANSFER FEES TO THE ARBITER BUT IN THE GIVEN CODE WHEN THE ARBITER_FEE>0 THEN ONLY TRANSFER

Summary

arbiter_fees transfer when the fee amount is >0 but it is not correct the when the arbiter_fees is not >0 then it is not transferring fees at that time arbiter not receive fees.

Vulnerability Details

suppose a case that arbiter_fees is Not >0 then at that time they con't receive fees but the arbiter solved the issue. in this case the arbiter was loss their funds.so i said that at first we need to check that fees> 0.when then fees is not >0 then what is the use of doing that work of Arbiter. so must and should transfer fees to Arbiter when the problem is resolves.

Impact

Arbiter loss their fees although they solve issue.

Tools Used

Manual Review

Recommendations

function resolveDispute(uint256 buyerAward) external onlyArbiter nonReentrant inState(State.Disputed) {
uint256 tokenBalance = i_tokenContract.balanceOf(address(this));

   ++ require(i_arbiterFee > 0 ,"fees must be greater than zero");

    uint256 totalFee = buyerAward + i_arbiterFee; // Reverts on overflow
    if (totalFee > tokenBalance) {
        revert Escrow__TotalFeeExceedsBalance(tokenBalance, totalFee);
    }

    s_state = State.Resolved;
    emit Resolved(i_buyer, i_seller);

    ++ i_tokenContract.safeTransfer(i_arbiter, i_arbiterFee);

    if (buyerAward > 0) {
        i_tokenContract.safeTransfer(i_buyer, buyerAward);
    }
 
     tokenBalance = i_tokenContract.balanceOf(address(this));

    if (tokenBalance > 0) {
        i_tokenContract.safeTransfer(i_seller, tokenBalance);
    }
}

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.