https://gitlab.com/tezos/tezos
Raw File
Tip revision: 6788630bbca152db1c14f72f166aca29546673cf authored by Antonio Locascio on 23 November 2023, 14:05:22 UTC
EVM/Kernel: add roundtrip test for seq blueprint encoding
Tip revision: 6788630
create_account.tz
/*
- optional storage: the address of the created account
- param: Left [hash]:

  Create an account with manager [hash]; then perform a recursive call
  on Right [addr] where [addr] is the address of the newly created
  account.

  The created account has an initial balance of 100tz. It is not
  delegatable.

- param: Right [addr]:

  Check that the sender is self and that [addr] is a contract of type
  [unit]. Finally store [addr].

*/
parameter (or key_hash address) ;
storage (option address) ;
code { CAR;
       IF_LEFT
         { DIP { PUSH mutez 100000000 ; PUSH bool False ; NONE key_hash };
           CREATE_ACCOUNT ;
           DIP { RIGHT key_hash ; DIP { SELF ; PUSH mutez 0 } ; TRANSFER_TOKENS ;
                 NIL operation ; SWAP ; CONS } ;
           CONS ; NONE address ; SWAP ; PAIR }
         { SELF ; ADDRESS ; SENDER ; IFCMPNEQ { FAIL } {} ;
           DUP ; CONTRACT unit ; IF_SOME { DROP ; SOME } { FAIL } ;
           NIL operation ; PAIR } } ;
back to top