flipper.sol 555 B

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