20,000 USDC
View results
Submission Details
Severity: gas

Constructor can be declared `payable` to reduce deployment gas even though no money is sent.

Summary

Constructor can be declared payable to save gas even though no money is sent. Since these contracts is going to be deployed only once and since constructors are only be called once this is a safe way to reduce deployment gas. Just make sure you don't send any ether during deployment by mistake.

Vulnerability Details

Constructors are not declared as payable. declaring it payable which will reduce some computation which checks if msg.value=0 or not. This will save some gas.

Impact

costs more gas

Tools Used

Manual review

Recommendations

Constructor can be declared payable to save gas even though no money is sent. Since these contracts is going to be deployed only once and since constructors are only be called once this is a safe way to reduce deployment gas. Just make sure you don't send any ether during deployment by mistake.

Support

FAQs

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