Escrow is expected to be deployed with EscrowFactory, however, this is not mandatory, buyer can deploy Escrow without EscrowFactory, and seller may choose to interact with an independently deployed Escrow for the following reasons:
Seller has difficulty knowing if Escrow is deployed with EscrowFactory;
Seller does not really care how Escrow is deployed, as long as the Escrow is deployed correctly.
Unfortunately, buyer can withdraw Token from an Escrow deployed without EscrowFactory and Seller may lose rewards.
A malicious buyer can withdraw Token from Escrow if the buyer has the Token allowance, in order to achieve this, buyer needs to create 2 contracts:
Approver: grants Token allowance, can selfdesctruct
Deployer: deploys Approver and Escrow contracts, can selfdestruct
Buyer can get the Token allowance of Escrow by the following steps:
Create Deployer contract with CREATE2;
Use Deployer contract to create (nonce: 1) Approver contract;
Transfer price amount of Token to Approver address;
Call Approver contract to get Token allowance;
Destory Approver contract;
Create Deployer contract with CREATE2 again(this needs to be done in a seperate transaction), Deployer address is the same as before;
Use Deployer contract to create (nonce: 1) Escrow contract, Escrow address is the same as Approver address.
Please see the sample contracts below:
Seller loses rewards.
Manual Reivew
Register created Escrow addresses in EscrowFactory to make it easy for seller to check;
Escrow functions should revert if this Escrow is not resigester in EscrowFactory.
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.