Skip to main content

How Does a Contract’s Constructor Relate to Its Gas Usage during Deployment?

A contract's constructor is executed only once, during the contract's deployment. The gas used by the constructor is part of the total deployment cost and is consumed upfront.

The total gas limit for deployment is higher than the transaction gas limit for regular function calls. The gas used in the constructor does not affect the gas stipend provided during later Ether transfers to the deployed contract.

Why Is the 2,300 Gas Limit Sometimes Considered a Design Flaw?
How Have Recent Versions of Solidity Changed the Behavior of Fallback Functions to Mitigate This Risk?
Can a Smart Contract Execution Be Reversed after Consensus Is Reached?
What Is the Concept of “Data Immutability” Once an Oracle Submits Data to the Chain?