23 lines
1.2 KiB
Plaintext
23 lines
1.2 KiB
Plaintext
parameter nat;
|
|
storage (list (contract string));
|
|
code { DUP;
|
|
CAR; # Get the number
|
|
DIP{CDR}; # Put the accumulator on the stack
|
|
PUSH bool True; # Push true so we have a do while loop
|
|
LOOP { DUP; PUSH nat 0; CMPEQ; # Check if the number is 0
|
|
IF { PUSH bool False} # End the loop
|
|
{ PUSH nat 1; SWAP; SUB; ABS; # Subtract 1. The ABS is to make it back into a nat
|
|
PUSH string "init"; # Storage type
|
|
LAMBDA (pair string string) # Identity contract
|
|
(pair (list operation) string)
|
|
{ CAR ; NIL operation ; PAIR };
|
|
PUSH tez "5.00"; # Strating balance
|
|
PUSH bool False; DUP; # Not spendable or delegatable
|
|
NONE key_hash;
|
|
PUSH key_hash "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5";
|
|
CREATE_CONTRACT; # Make the contract
|
|
SWAP; # Add to the list
|
|
DIP{CONS};
|
|
PUSH bool True}}; # Continue the loop
|
|
DROP; NIL operation; PAIR} # Calling convention
|