40,000 USDC
View results
Submission Details
Severity: gas

SETTING THE CONSTRUCTOR TO PAYABLE

Summary

[G-2] SETTING THE CONSTRUCTOR TO PAYABLE

You can cut out 10 opcodes in the creation-time EVM bytecode if you declare a constructor payable. Making the constructor payable eliminates the need for an initial check of msg.value == 0 and saves 13 gas on deployment with no security risks.

file: /src/Escrow.sol
32 constructor(
uint256 price,
IERC20 tokenContract,
address buyer,
address seller,
address arbiter,
38 uint256 arbiterFee

https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L32-L38

Support

FAQs

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