The newEscrow
function in the EscrowFactory
contract does not have any checks against the seller
and buyer
being the same address. This could potentially allow a user to create an escrow contract where they are both the buyer and the seller, which could lead to unexpected behavior.
The newEscrow
function is designed to create a new instance of the Escrow
contract. It accepts several parameters, including a seller
and buyer
parameter that represent the addresses of the seller and buyer respectively. However, there is no explicit check in the function to prevent the seller
and buyer
from being the same address. This means that a user could potentially create a new escrow contract where they are both the buyer and the seller.
If a user is able to create an escrow contract where they are both the buyer and the seller, it could lead to unexpected behavior. For example, the user could potentially manipulate the contract to their advantage, such as by initiating a dispute and then resolving it in their favor. This could potentially undermine the trust in the platform.
Manual code review
To mitigate this potential issue, it is recommended to add a check in the newEscrow
function to ensure that the seller
and buyer
are not the same address. This could be implemented as a simple require statement, like so:
This would ensure that an escrow contract cannot be created where the seller and buyer are the same address, thereby preventing the potential issues described above.
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.