40,000 USDC
View results
Submission Details
Severity: gas

Before transfer of some functions, we should check some variables for possible gas save

Summary

[G-6] Before transfer of some functions, we should check some variables for possible gas save

Before transfer, we should check for amount being 0 so the function doesn't run when its not gonna do anything:

file: /src/EscrowFactory.sol
39 tokenContract.safeTransferFrom(msg.sender, computedAddress, price);

https://github.com/Cyfrin/2023-07-escrow/blob/main/src/EscrowFactory.sol#L39

Support

FAQs

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