contract Demo { int x; int y; constructor(int x, int y) { this.x = x; this.y = y; } function sum(int a, int b) : int { return a + b; } public function add(int z) { require(z == this.sum(this.x, this.y)); } public function sub(int z) { require(z == this.x - this.y); } }