Cyfrin / 2023-07-escrow

16 stars 12 forks source link

constructor can be payable #836

Closed codehawks-bot closed 1 year ago

codehawks-bot commented 1 year ago

constructor can be payable

Severity

Gas Optimization / Informational

[GAS] setting the constructor to payable

gas saved: 13 gas per instance

Number of Instances: 1

https://github.com/Cyfrin/2023-07-escrow/blob/65a60eb0773803fa0be4ba72defaec7d8567bccc/src/Escrow.sol#L32C3-L39C8

  constructor(
        uint256 price,
        IERC20 tokenContract,
        address buyer,
        address seller,
        address arbiter,
        uint256 arbiterFee
    ) {
   //some code
   }

Recommendation

set constructor to payable

PatrickAlphaC commented 1 year ago

We like the protection from having it not marked payable