1

I've tried to type check create_contract.tz in mini_scenarios and had the following result. It is well-typed, but I'm wondering if the occurrence of the last comment /* [ pair (list operation) (string @parameter) ] */ is an intended behavior of tezos-client typecheck script? If so, what is this type for?

I tried in a sandboxed mode of the latest master branch (5b919792).

{ parameter (option address) ;
  storage unit ;
  code { /* [ pair (option @parameter address) (unit @storage) ] */
         CAR
         /* [ list operation : @parameter string ] */ ;
         IF_NONE
           { /* [] */
             PUSH string "dummy"
             /* [ string ] */ ;
             PUSH mutez 100000000
             /* [ mutez : string ] */ ;
             NONE key_hash
             /* [ option key_hash : mutez : string ] */ ;
             CREATE_CONTRACT
               { parameter string ;
                 storage string ;
                 code { CAR ; NIL operation ; PAIR } }
             /* [ operation : address ] */ ;
             DIP { /* [ address ] */
                   SOME
                   /* [ option address ] */ ;
                   DIP { /* [] */
                         SELF
                         /* [ @self contract (option address) ] */ ;
                         PUSH mutez 0
                         /* [ mutez : @self contract (option address) ] */ }
                   /* [ option address : mutez : @self contract (option address) ] */ ;
                   TRANSFER_TOKENS
                   /* [ operation ] */ ;
                   NIL operation
                   /* [ list operation : operation ] */ ;
                   SWAP
                   /* [ operation : list operation ] */ ;
                   CONS
                   /* [ list operation ] */ }
             /* [ operation : list operation ] */ ;
             CONS
             /* [ list operation ] */ ;
             UNIT
             /* [ unit : list operation ] */ ;
             SWAP
             /* [ list operation : unit ] */ ;
             PAIR
             /* [ pair (list operation) unit ] */ }
           { /* [ @parameter.some address ] */
             SELF
             /* [ @self contract (option address) : @parameter.some address ] */ ;
             ADDRESS
             /* [ @self.address address : @parameter.some address ] */ ;
             SENDER
             /* [ @sender address : @self.address address : @parameter.some address ] */ ;
             IFCMPNEQ
               { FAIL }
               { /* [ @parameter.some address ] */ }
             /* [ @parameter.some address ] */ ;
             CONTRACT string
             /* [ @parameter.some.contract option (contract string) ] */ ;
             IF_SOME
               { /* [ @parameter.some.contract.some contract string ] */ }
               { FAIL }
             /* [ @parameter.some.contract.some contract string ] */ ;
             PUSH mutez 0
             /* [ mutez : @parameter.some.contract.some contract string ] */ ;
             PUSH string
                  "abcdefg"
             /* [ string : mutez : @parameter.some.contract.some contract string ] */ ;
             TRANSFER_TOKENS
             /* [ operation ] */ ;
             NIL operation
             /* [ list operation : operation ] */ ;
             SWAP
             /* [ operation : list operation ] */ ;
             CONS
             /* [ list operation ] */ ;
             UNIT
             /* [ unit : list operation ] */ ;
             SWAP
             /* [ list operation : unit ] */ ;
             PAIR
             /* [ pair (list operation) unit ] */ } }
  /* [ pair (list operation) (string @parameter) ] */ }
0
1

You have visibly found a bug in the client typechecking command. Don't hesitate to open an issue for it on https://gitlab.com/tezos/tezos. I bet that the client is confused by the storage type of the inner script ({ parameter string ; storage string ; code { CAR ; NIL operation ; PAIR } }).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.