counter_seahorse.py 407 B

1234567891011121314151617181920212223
  1. # counter_seahorse
  2. # Built with Seahorse v0.1.6
  3. from seahorse.prelude import *
  4. declare_id('Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS')
  5. class Counter(Account):
  6. count: u64
  7. @instruction
  8. def initialize_counter(counter: Empty[Counter], payer: Signer, seed: u8):
  9. counter.init(
  10. payer=payer,
  11. seeds=[seed]
  12. )
  13. @instruction
  14. def increment(counter: Counter):
  15. counter.count += 1