August 2018
Intermediate to advanced
404 pages
11h 19m
English
The constructor is a function that is executed when a contract is created. It cannot be called explicitly and is invoked only once during its lifetime. Every contract can have exactly one constructor and if no constructor is declared, the contract will use the default constructor.
contract A { constructor() { // Constructor }}
contract A { address owner; constructor() { owner = msg.sender; }}
contract C { uint n; constructor(uint ...