40,000 USDC
View results
Submission Details
Severity: gas
Valid

The arbiter should not be either the buyer or the seller.

Summary

It is better to choose an arbiter who is neither the seller nor the buyer. If the arbiter acts as any one of them, then the integrity becomes questionable. Ensuring that the arbiter is another actor who can impartially judge both sides will give more integrity to the protocol."

Recommendations

constructor(
uint256 price,
IERC20 tokenContract,
address buyer,
address seller,
address arbiter,
uint256 arbiterFee
) {
if (address(tokenContract) == address(0)) revert Escrow__TokenZeroAddress();
if (buyer == address(0)) revert Escrow__BuyerZeroAddress();
if (seller == address(0)) revert Escrow__SellerZeroAddress();
+ if (buyer == arbiter || seller == arbiter) revert Escrow__InvalidArbiter();
if (arbiterFee >= price) revert Escrow__FeeExceedsPrice(price, arbiterFee);
if (tokenContract.balanceOf(address(this)) < price) revert Escrow__MustDeployWithTokenBalance();
...
}

Support

FAQs

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