flipper.sol 496 B

123456789101112131415161718192021
  1. contract flipper {
  2. bool private value = true;
  3. @payer(payer)
  4. constructor() {
  5. print("Hello, World!");
  6. }
  7. /// A message that can be called on instantiated contracts.
  8. /// This one flips the value of the stored `bool` from `true`
  9. /// to `false` and vice versa.
  10. function flip() public {
  11. value = !value;
  12. }
  13. /// Simply returns the current value of our `bool`.
  14. function get() public view returns (bool) {
  15. return value;
  16. }
  17. }