stack-orchestrator/container-build/cerc-go-ethereum-foundry/stateful/src/Stateful.sol
2022-08-24 12:40:15 -06:00

23 lines
312 B
Solidity

// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.10;
contract Stateful {
uint x;
constructor(uint y) public {
x = y;
}
function off() public {
require(x == 1);
x = 0;
}
function on() public {
require(x == 0);
x = 1;
}
function inc() public {
x = x + 1;
}
}