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

Initiated dispute can be stuck in `Disputed` state if an `arbiter` is no longer available

Initiated dispute can be stuck in Disputed state if an arbiter is no longer available

The contract's constructor currently sets the arbiter via i_arbiter when a new Escrow is created

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 (arbiterFee >= price) revert Escrow__FeeExceedsPrice(price, arbiterFee);
if (tokenContract.balanceOf(address(this)) < price) revert Escrow__MustDeployWithTokenBalance();
i_price = price;
i_tokenContract = tokenContract;
i_buyer = buyer;
i_seller = seller;
i_arbiter = arbiter;
i_arbiterFee = arbiterFee;
}

However, currently there is no way to set a new arbiter if an arbiter happens to be no longer available.

As a result, if a dispute is initiated via initiateDispute() by a buyer or seller. If no arbiter exists or is unavailable, then it would not be possible to resolveDispute() as it is only callable by the arbiter due to the onlyArbiter modifier.

modifier onlyArbiter() {
if (msg.sender != i_arbiter) {
revert Escrow__OnlyArbiter();
}
_;
}

https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L74

function resolveDispute(uint256 buyerAward) external onlyArbiter nonReentrant inState(State.Disputed) {

https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L109

Impact

Disputes are stuck in State.Disputed

Recommendations

Allow an option to set a new arbiter if both buyer and seller can agree upon a new arbiter

Support

FAQs

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