ligo/src/bin_client/test/contracts/spawn_identities.tz

23 lines
1.2 KiB
Plaintext
Raw Normal View History

parameter nat;
storage (list address);
code { DUP;
CAR; # Get the number
DIP{CDR; NIL operation}; # Put the accumulators 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
PUSH tez "5.00"; # Strating balance
PUSH bool False; DUP; # Not spendable or delegatable
NONE key_hash;
PUSH key_hash "tz1cxcwwnzENRdhe2Kb8ZdTrdNy4bFNyScx5";
2018-05-02 01:45:15 +02:00
CREATE_CONTRACT
{ parameter string ;
storage string ;
code { CAR ; NIL operation ; PAIR } } ; # Make the contract
SWAP ; DIP { SWAP ; DIP { CONS } } ; # emit the operation
SWAP ; DIP { SWAP ; DIP { CONS } } ; # add to the list
PUSH bool True}}; # Continue the loop
DROP; PAIR} # Calling convention