40,000 USDC
View results
Submission Details
Severity: high

Buyer will never be able to #confirmReceipt() because s_state was never set to State.Created in the constructor.

Summary

s_state was never set to State.Created in the constructor.

Vulnerability Details

The #confirmReceipt() has the inState modifier which ensures that the function can ONLY be called when the state (i.e s_state) == State.created.

here is the details of the modifier

/// @dev Throws if contract called in State other than one associated for function.
modifier inState(State expectedState) {
if (s_state != expectedState) {
revert Escrow__InWrongState(s_state, expectedState);
}
_;
}

As you can see, if the state(s_state) is not in the expected state the modifier ensures a revert.

Now the issue is that the contract fails to set the state(s_state) to State.Created in the constructor.

This makes #confirmReceipt() uncallable by the buyer.

Impact

Buyer will never be able to confirm receipt.

Tools Used

Lofi Radio and Manual Review

Recommendations

set the state(s_state) to State.Created in the constructor.

Support

FAQs

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