40,000 USDC
View results
Submission Details
Severity: gas
Valid

Use Clones instead of `new` to deploy Escrows

Summary

The smart contract uses the new keyword (create2 more specifically) for deployment of the same contract code for each newly created escrow, leading to high gas costs. A more efficient method, using clones for contract deployment, is recommended.

Vulnerability Details

The contract's use of the new keyword to the same contract code for each newly created escrow is gas-intensive. The minimal proxy pattern, which deploys a template contract and creates new "clone" contracts, that delegate the calls to the template contract, this is more gas-efficient as we are only deploying the code once and a minimal proxy each time instead of deploying the same code in a new contract account.

Impact

The current deployment strategy results in high gas costs and slower transactions. Implementing the minimal proxy pattern can reduce gas costs.

Tools Used

Manual Review

Recommendation

Refactor the contract deployment strategy to use the minimal proxy pattern and clones.

Support

FAQs

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