40,000 USDC
View results
Submission Details
Severity: gas

Setting the constructor to 'payable'

Summary

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.

'''
Before optimization
[PASS] testCanOnlyConfirmInCreatedState() (gas: 767482)
[PASS] testCanOnlyInitiateDisputeInConfirmedState() (gas: 766427)
[PASS] testCanOnlyResolveInDisputedState() (gas: 774477)
'''

'''
After optimization
[PASS] testCanOnlyConfirmInCreatedState() (gas: 767467)
[PASS] testCanOnlyInitiateDisputeInConfirmedState() (gas: 766412)
[PASS] testCanOnlyResolveInDisputedState() (gas: 774462)
'''

Support

FAQs

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