ligo/gitlab-pages/docs/intro/src/what-and-why/counter.tz
Matej Šima 628d818163 Revert "Merge with dev"
This reverts commit 6ffe220d928dc3137496bcea0cc0f4d72edc2846.
2019-11-07 23:19:27 +00:00

7 lines
273 B
Plaintext

{ parameter (or (or (nat %add) (nat %sub)) (unit %default)) ;
storage int ;
code { AMOUNT ; PUSH mutez 0 ; ASSERT_CMPEQ ; UNPAIR ;
IF_LEFT
{ IF_LEFT { ADD } { SWAP ; SUB } }
{ DROP ; DROP ; PUSH int 0 } ;
NIL operation ; PAIR } }