Constructor

We can define a constructor in order to store variables in a contract (locking script).

The constructor can be defined implicitly:

contract Test {
    int x1;
    bytes x2;
    bool x3;

    public function equal(int y) {...}
}

or explicitly:

contract Test {
    int x1;
    bytes x2;
    bool x3;

    constructor(int x1, bytes x2, bool x3) {
        this.x1 = x1;
        this.x2 = x2;
        this.x3 = x3;
    }

    public function equal(int y) {...}
}

Both examples are functionally equivalent.