Within the Escrow#constructor(), there is no input validation to check whether or not the arbiter address would not be address(0).
If a seller is missing to assign an arbiter address into the arbiter parameter when the Escrow#constructor() would be called to create a new Escrow via the EscrowFactory#newEscrow(), both the seller and buyer can not initiate a dispute when they call the Escrow#initiateDispute() due to being reverted by the validation (at the Escrow.sol#L103) in the Escrow#initiateDispute() below:
When a new Escrow would be created, the Escrow#constructor() would be called via the EscrowFactory#newEscrow() like this:
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/EscrowFactory.sol#L24
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/EscrowFactory.sol#L45
Within the Escrow#constructor(), an arbiter would be assigned into the arbiter parameter and it would be assigned into the i_arbiter like this:
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L37
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L49
Within the Escrow#initiateDispute(), the i_arbiter would be validated whether or not the i_arbiter is address(0). Once the validation would be passed, the state of the State.Disputed would be stored into the s_state like this:
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L103-L104
Within the Escrow#constructor() above, an arbiter address, which is assigned into the arbiter parameter, is supposed to be checked whether or not the arbiter address would not be address(0).
However, within the Escrow#constructor() above, there is no input validation to check whether or not the arbiter address would not be address(0).
If a seller is missing to assign an arbiter address into the arbiter parameter when the Escrow#constructor() would be called to create a new Escrow via the EscrowFactory#newEscrow(), both the seller and buyer can not initiate a dispute when they call the Escrow#initiateDispute() due to being reverted by the validation (at the Escrow.sol#L103) in the Escrow#initiateDispute() below:
Both the seller and buyer can not initiate a dispute when they call the Escrow#initiateDispute().
Foundry
Within the Escrow#constructor(), consider adding an input validation to check whether or not the arbiter address would not be address(0) like this:
Also, consider adding a setter function to set an arbiter address to the i_arbiter so that a seller can set an an arbiter address to the i_arbiter even if the seller was missing to assign an arbiter address into the arbiter parameter when the Escrow#constructor() would be called via the EscrowFactory#newEscrow() like this:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.