The newEscrow
function in the EscrowFactory
contract does not have any checks against a zero price
. This could potentially allow a user to create an escrow contract without depositing any funds. While this might not necessarily be a vulnerability, it could lead to unexpected behavior and should be considered in the design of the contract.
The newEscrow
function is designed to create a new instance of the Escrow
contract. It accepts several parameters, including a price
parameter that represents the amount of funds to be deposited into the escrow contract. However, there is no explicit check in the function to prevent the price
from being set to zero. This means that a user could potentially create a new escrow contract without depositing any funds.
If a user is able to create an escrow contract with a zero price
, it could lead to unexpected behavior. For example, the seller might not be aware that no funds have been deposited and could proceed with providing the service under the assumption that they will be paid. This could potentially lead to disputes and loss of 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 price
is greater than zero. This could be implemented as a simple require statement, like so:
This would ensure that an escrow contract cannot be created without depositing any funds, 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.