40,000 USDC
View results
Submission Details
Severity: gas

Constructors can be marked payable

Summary

payable functions cost less gas to execute since the compiler does not have to add extra checks to ensure that a payment wasn't provided. A constructor can safely be marked as payable since only the deployer can pass funds.

Vulnerability Details

There is 1 instance of this issue.

File: src/Escrow.sol
32: constructor(
33: uint256 price,
34: IERC20 tokenContract,
35: address buyer,
36: address seller,
37: address arbiter,
38: uint256 arbiterFee
39: ) {
File Link Instance Count Instance Link
Escrow.sol 1 32

Impact

21 gas

Tools Used

baudit: a custom static code analysis tool; manual review

Recommendations

Mark the constructor as payable.

Support

FAQs

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