Definition

What is Constructor?

A constructor is the function that runs exactly once, during deployment, to set a contract's initial state such as its owner, name, or supply.

Constructor arguments are appended to the init bytecode. Mistakes here are permanent, which is why deploy consoles show the arguments back before sending.

Go deeper

Related terms

Definition by , founder of Monsmith.

See it in practice

Open Monsmith, paste a contract, and watch the audit and profiler explain it.

Open the studio