New answers tagged


In the case of the examples you posted, there is no difference. When you initialize the state variable in the line of declaration, it's the same as you if you do it in the constructor. If you want to have state variables initialized at contract creation, there is no way to optimize this. It should use a similar amount of gas in either implementation.

Top 50 recent answers are included